* [PATCH net-next v1] bpf: Remove redundant ifdef
@ 2017-02-11 19:37 Mickaël Salaün
2017-02-13 1:53 ` Wangnan (F)
2017-02-15 17:15 ` David Miller
0 siblings, 2 replies; 5+ messages in thread
From: Mickaël Salaün @ 2017-02-11 19:37 UTC (permalink / raw)
To: linux-kernel
Cc: Mickaël Salaün, Alexei Starovoitov, Daniel Borkmann,
David S . Miller, Wang Nan, netdev
Remove a useless ifdef __NR_bpf as requested by Wang Nan.
Inline one-line static functions as it was in the bpf_sys.h file.
Signed-off-by: Mickaël Salaün <mic@digikod.net>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: David S. Miller <davem@davemloft.net>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/r/828ab1ff-4dcf-53ff-c97b-074adb895006@huawei.com
---
tools/lib/bpf/bpf.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c
index 50e04cc5dddd..2de9c386989a 100644
--- a/tools/lib/bpf/bpf.c
+++ b/tools/lib/bpf/bpf.c
@@ -42,21 +42,15 @@
# endif
#endif
-static __u64 ptr_to_u64(const void *ptr)
+static inline __u64 ptr_to_u64(const void *ptr)
{
return (__u64) (unsigned long) ptr;
}
-static int sys_bpf(enum bpf_cmd cmd, union bpf_attr *attr,
- unsigned int size)
+static inline int sys_bpf(enum bpf_cmd cmd, union bpf_attr *attr,
+ unsigned int size)
{
-#ifdef __NR_bpf
return syscall(__NR_bpf, cmd, attr, size);
-#else
- fprintf(stderr, "No bpf syscall, kernel headers too old?\n");
- errno = ENOSYS;
- return -1;
-#endif
}
int bpf_create_map(enum bpf_map_type map_type, int key_size,
--
2.11.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v1] bpf: Remove redundant ifdef
2017-02-11 19:37 [PATCH net-next v1] bpf: Remove redundant ifdef Mickaël Salaün
@ 2017-02-13 1:53 ` Wangnan (F)
2017-02-14 17:07 ` David Miller
2017-02-15 17:15 ` David Miller
1 sibling, 1 reply; 5+ messages in thread
From: Wangnan (F) @ 2017-02-13 1:53 UTC (permalink / raw)
To: Mickaël Salaün, linux-kernel
Cc: Alexei Starovoitov, Daniel Borkmann, David S . Miller, netdev
On 2017/2/12 3:37, Mickaël Salaün wrote:
> Remove a useless ifdef __NR_bpf as requested by Wang Nan.
>
> Inline one-line static functions as it was in the bpf_sys.h file.
>
> Signed-off-by: Mickaël Salaün <mic@digikod.net>
> Cc: Alexei Starovoitov <ast@fb.com>
> Cc: Daniel Borkmann <daniel@iogearbox.net>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Wang Nan <wangnan0@huawei.com>
> Link: https://lkml.kernel.org/r/828ab1ff-4dcf-53ff-c97b-074adb895006@huawei.com
> ---
> tools/lib/bpf/bpf.c | 12 +++---------
> 1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c
> index 50e04cc5dddd..2de9c386989a 100644
> --- a/tools/lib/bpf/bpf.c
> +++ b/tools/lib/bpf/bpf.c
> @@ -42,21 +42,15 @@
> # endif
> #endif
>
> -static __u64 ptr_to_u64(const void *ptr)
> +static inline __u64 ptr_to_u64(const void *ptr)
> {
> return (__u64) (unsigned long) ptr;
> }
>
> -static int sys_bpf(enum bpf_cmd cmd, union bpf_attr *attr,
> - unsigned int size)
> +static inline int sys_bpf(enum bpf_cmd cmd, union bpf_attr *attr,
> + unsigned int size)
> {
> -#ifdef __NR_bpf
> return syscall(__NR_bpf, cmd, attr, size);
> -#else
> - fprintf(stderr, "No bpf syscall, kernel headers too old?\n");
> - errno = ENOSYS;
> - return -1;
> -#endif
> }
>
> int bpf_create_map(enum bpf_map_type map_type, int key_size,
Acked-by: Wang Nan <wangnan0@huawei.com>
However, it is better to merge this patch with commit
702498a1426bc95b6f49f9c5fba616110cbd3947.
Thank you.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v1] bpf: Remove redundant ifdef
2017-02-13 1:53 ` Wangnan (F)
@ 2017-02-14 17:07 ` David Miller
2017-02-15 0:52 ` Wangnan (F)
0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2017-02-14 17:07 UTC (permalink / raw)
To: wangnan0; +Cc: mic, linux-kernel, ast, daniel, netdev
From: "Wangnan (F)" <wangnan0@huawei.com>
Date: Mon, 13 Feb 2017 09:53:49 +0800
>
>
> On 2017/2/12 3:37, Mickaël Salaün wrote:
>> Remove a useless ifdef __NR_bpf as requested by Wang Nan.
>>
>> Inline one-line static functions as it was in the bpf_sys.h file.
>>
>> Signed-off-by: Mickaël Salaün <mic@digikod.net>
>> Cc: Alexei Starovoitov <ast@fb.com>
>> Cc: Daniel Borkmann <daniel@iogearbox.net>
>> Cc: David S. Miller <davem@davemloft.net>
>> Cc: Wang Nan <wangnan0@huawei.com>
>> Link:
>> https://lkml.kernel.org/r/828ab1ff-4dcf-53ff-c97b-074adb895006@huawei.com
>> ---
>> tools/lib/bpf/bpf.c | 12 +++---------
>> 1 file changed, 3 insertions(+), 9 deletions(-)
>>
>> diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c
>> index 50e04cc5dddd..2de9c386989a 100644
>> --- a/tools/lib/bpf/bpf.c
>> +++ b/tools/lib/bpf/bpf.c
>> @@ -42,21 +42,15 @@
>> # endif
>> #endif
>> -static __u64 ptr_to_u64(const void *ptr)
>> +static inline __u64 ptr_to_u64(const void *ptr)
>> {
>> return (__u64) (unsigned long) ptr;
>> }
>> -static int sys_bpf(enum bpf_cmd cmd, union bpf_attr *attr,
>> - unsigned int size)
>> +static inline int sys_bpf(enum bpf_cmd cmd, union bpf_attr *attr,
>> + unsigned int size)
>> {
>> -#ifdef __NR_bpf
>> return syscall(__NR_bpf, cmd, attr, size);
>> -#else
>> - fprintf(stderr, "No bpf syscall, kernel headers too old?\n");
>> - errno = ENOSYS;
>> - return -1;
>> -#endif
>> }
>> int bpf_create_map(enum bpf_map_type map_type, int key_size,
>
> Acked-by: Wang Nan <wangnan0@huawei.com>
>
> However, it is better to merge this patch with commit
> 702498a1426bc95b6f49f9c5fba616110cbd3947.
I don't know where this commit ID is. Since this patch is targetting
net-next I would expect a commit ID with not context to be in that
tree. Please always specify where the commit ID you mention is.
Futhermore, commits in net-next are permanent so it is not possible
afterwards to "merge this patch with commit X".
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v1] bpf: Remove redundant ifdef
2017-02-14 17:07 ` David Miller
@ 2017-02-15 0:52 ` Wangnan (F)
0 siblings, 0 replies; 5+ messages in thread
From: Wangnan (F) @ 2017-02-15 0:52 UTC (permalink / raw)
To: David Miller; +Cc: mic, linux-kernel, ast, daniel, netdev
On 2017/2/15 1:07, David Miller wrote:
> From: "Wangnan (F)" <wangnan0@huawei.com>
> Date: Mon, 13 Feb 2017 09:53:49 +0800
>
>>
>> On 2017/2/12 3:37, Mickaël Salaün wrote:
>>> Remove a useless ifdef __NR_bpf as requested by Wang Nan.
>>>
>>> Inline one-line static functions as it was in the bpf_sys.h file.
>>>
>>> Signed-off-by: Mickaël Salaün <mic@digikod.net>
>>> Cc: Alexei Starovoitov <ast@fb.com>
>>> Cc: Daniel Borkmann <daniel@iogearbox.net>
>>> Cc: David S. Miller <davem@davemloft.net>
>>> Cc: Wang Nan <wangnan0@huawei.com>
>>> Link:
>>> https://lkml.kernel.org/r/828ab1ff-4dcf-53ff-c97b-074adb895006@huawei.com
>>> ---
>>> tools/lib/bpf/bpf.c | 12 +++---------
>>> 1 file changed, 3 insertions(+), 9 deletions(-)
>>>
>>> diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c
>>> index 50e04cc5dddd..2de9c386989a 100644
>>> --- a/tools/lib/bpf/bpf.c
>>> +++ b/tools/lib/bpf/bpf.c
>>> @@ -42,21 +42,15 @@
>>> # endif
>>> #endif
>>> -static __u64 ptr_to_u64(const void *ptr)
>>> +static inline __u64 ptr_to_u64(const void *ptr)
>>> {
>>> return (__u64) (unsigned long) ptr;
>>> }
>>> -static int sys_bpf(enum bpf_cmd cmd, union bpf_attr *attr,
>>> - unsigned int size)
>>> +static inline int sys_bpf(enum bpf_cmd cmd, union bpf_attr *attr,
>>> + unsigned int size)
>>> {
>>> -#ifdef __NR_bpf
>>> return syscall(__NR_bpf, cmd, attr, size);
>>> -#else
>>> - fprintf(stderr, "No bpf syscall, kernel headers too old?\n");
>>> - errno = ENOSYS;
>>> - return -1;
>>> -#endif
>>> }
>>> int bpf_create_map(enum bpf_map_type map_type, int key_size,
>> Acked-by: Wang Nan <wangnan0@huawei.com>
>>
>> However, it is better to merge this patch with commit
>> 702498a1426bc95b6f49f9c5fba616110cbd3947.
> I don't know where this commit ID is. Since this patch is targetting
> net-next I would expect a commit ID with not context to be in that
> tree. Please always specify where the commit ID you mention is.
It is "bpf: Remove bpf_sys.h from selftests" in net-next.
> Futhermore, commits in net-next are permanent so it is not possible
> afterwards to "merge this patch with commit X".
I understand. Maintainers sometime reset
his/her head to an early version and amend
the commit to make the history clean, but
clearly net-next never do this.
Thank you.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v1] bpf: Remove redundant ifdef
2017-02-11 19:37 [PATCH net-next v1] bpf: Remove redundant ifdef Mickaël Salaün
2017-02-13 1:53 ` Wangnan (F)
@ 2017-02-15 17:15 ` David Miller
1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2017-02-15 17:15 UTC (permalink / raw)
To: mic; +Cc: linux-kernel, ast, daniel, wangnan0, netdev
From: Mickaël Salaün <mic@digikod.net>
Date: Sat, 11 Feb 2017 20:37:08 +0100
> Remove a useless ifdef __NR_bpf as requested by Wang Nan.
>
> Inline one-line static functions as it was in the bpf_sys.h file.
>
> Signed-off-by: Mickaël Salaün <mic@digikod.net>
> Cc: Alexei Starovoitov <ast@fb.com>
> Cc: Daniel Borkmann <daniel@iogearbox.net>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Wang Nan <wangnan0@huawei.com>
> Link: https://lkml.kernel.org/r/828ab1ff-4dcf-53ff-c97b-074adb895006@huawei.com
Applied.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-02-15 17:15 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-11 19:37 [PATCH net-next v1] bpf: Remove redundant ifdef Mickaël Salaün
2017-02-13 1:53 ` Wangnan (F)
2017-02-14 17:07 ` David Miller
2017-02-15 0:52 ` Wangnan (F)
2017-02-15 17:15 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.