Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1378559ybl; Tue, 13 Aug 2019 11:32:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqwL1EifjstT5baCUjJo6xWHZDubn2nCqqUkLemXNNobMvEIrFJSUwR9gH5oi5KFHJhejcCY X-Received: by 2002:aa7:82da:: with SMTP id f26mr42649003pfn.82.1565721131251; Tue, 13 Aug 2019 11:32:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565721131; cv=none; d=google.com; s=arc-20160816; b=Bz9zAkKXlKAjABc3qMkmqTUKQ1I4saqzHB01gExjwRA0NXec4vlkrq0FDg4po7zkN9 K5czyX0nD2lq2aGMAFl0TA40wPLpODaqC8KYLGmVSLEfFzudZ+UK2LiQm+DQG+kTuQDM ulEV0X6QatbNUK08Pa71MnJPN9zbTKX6k5dYyJ0uhfADKIhCXq2Z7AsLwlqys3JY6yBj xT2kjLqWAi3rivy7eK0r219WbHXZbQaPY4g1OsUeUG6PNejVXUfRMfxJwBGUx7LFf1hP sy7SMOhvVYn2m2TQAO/0Uud0WCBzrnmtncKXhRMZKHm+1+AGAuTuk9G+3Sy1Mz91g8bf 1Efw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=o3hRZk2U4koHlYuT/FUnBXn1CHhorNKem6nT0e8m1mg=; b=AV24yBHDkE76vISV6yR7XJECAax2rzrxLoDN4Wc4zzDyIuA1YcBUzSPm4zafykP7OT blOrcy5SchQ9EZE6M4vtB09mKDUvf3bdebWn48CWsKxnXQsBMoj0GgkIpK0IXMOP7dUS PXNKH0tU/Tc5zVfxKc7XdcohiQqKVbPQk6TPegCoGcKUBD4Dhq1K5wPGjcIiy6e2Um8h G3sooouzraqoQ9/ixYQOsy8FQAYCfxeF0tNADgSlTe2tGsVx1I89EqSwPcnwglWRD/Jj W4bytbaxr+7OJQ27azJ7dYX/IhPeBavaokEML4EaEXZCLtVRBLlHdDdxeuS44Qy2Quu5 KtlQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si16277773plw.278.2019.08.13.11.31.55; Tue, 13 Aug 2019 11:32:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727483AbfHMRmB (ORCPT + 99 others); Tue, 13 Aug 2019 13:42:01 -0400 Received: from smtp8.emailarray.com ([65.39.216.67]:29124 "EHLO smtp8.emailarray.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727777AbfHMRmB (ORCPT ); Tue, 13 Aug 2019 13:42:01 -0400 Received: (qmail 31454 invoked by uid 89); 13 Aug 2019 17:42:00 -0000 Received: from unknown (HELO ?172.20.41.143?) (amxlbW9uQGZsdWdzdmFtcC5jb21AMTk5LjIwMS42NC4xMzc=) (POLARISLOCAL) by smtp8.emailarray.com with (AES256-GCM-SHA384 encrypted) SMTP; 13 Aug 2019 17:42:00 -0000 From: "Jonathan Lemon" To: "Ivan Khoronzhuk" Cc: magnus.karlsson@intel.com, bjorn.topel@intel.com, davem@davemloft.net, hawk@kernel.org, john.fastabend@gmail.com, jakub.kicinski@netronome.com, daniel@iogearbox.net, netdev@vger.kernel.org, bpf@vger.kernel.org, xdp-newbies@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH bpf-next 3/3] samples: bpf: syscal_nrs: use mmap2 if defined Date: Tue, 13 Aug 2019 10:41:54 -0700 X-Mailer: MailMate (1.12.5r5635) Message-ID: <036BCF4A-53D6-4000-BBDE-07C04B8B23FA@flugsvamp.com> In-Reply-To: <20190813102318.5521-4-ivan.khoronzhuk@linaro.org> References: <20190813102318.5521-1-ivan.khoronzhuk@linaro.org> <20190813102318.5521-4-ivan.khoronzhuk@linaro.org> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13 Aug 2019, at 3:23, Ivan Khoronzhuk wrote: > For arm32 xdp sockets mmap2 is preferred, so use it if it's defined. > > Signed-off-by: Ivan Khoronzhuk Doesn't this change the application API? -- Jonathan > --- > samples/bpf/syscall_nrs.c | 5 +++++ > samples/bpf/tracex5_kern.c | 11 +++++++++++ > 2 files changed, 16 insertions(+) > > diff --git a/samples/bpf/syscall_nrs.c b/samples/bpf/syscall_nrs.c > index 516e255cbe8f..2dec94238350 100644 > --- a/samples/bpf/syscall_nrs.c > +++ b/samples/bpf/syscall_nrs.c > @@ -9,5 +9,10 @@ void syscall_defines(void) > COMMENT("Linux system call numbers."); > SYSNR(__NR_write); > SYSNR(__NR_read); > +#ifdef __NR_mmap2 > + SYSNR(__NR_mmap2); > +#else > SYSNR(__NR_mmap); > +#endif > + > } > diff --git a/samples/bpf/tracex5_kern.c b/samples/bpf/tracex5_kern.c > index f57f4e1ea1ec..300350ad299a 100644 > --- a/samples/bpf/tracex5_kern.c > +++ b/samples/bpf/tracex5_kern.c > @@ -68,12 +68,23 @@ PROG(SYS__NR_read)(struct pt_regs *ctx) > return 0; > } > > +#ifdef __NR_mmap2 > +PROG(SYS__NR_mmap2)(struct pt_regs *ctx) > +{ > + char fmt[] = "mmap2\n"; > + > + bpf_trace_printk(fmt, sizeof(fmt)); > + return 0; > +} > +#else > PROG(SYS__NR_mmap)(struct pt_regs *ctx) > { > char fmt[] = "mmap\n"; > + > bpf_trace_printk(fmt, sizeof(fmt)); > return 0; > } > +#endif > > char _license[] SEC("license") = "GPL"; > u32 _version SEC("version") = LINUX_VERSION_CODE; > -- > 2.17.1