linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next] selftests/bpf: fix incorrect fcntl call
@ 2022-08-24 14:01 Qiao Ma
  2022-08-24 15:03 ` Mykola Lysenko
  0 siblings, 1 reply; 3+ messages in thread
From: Qiao Ma @ 2022-08-24 14:01 UTC (permalink / raw)
  To: andrii, shuah, mykolal, linux-kernel; +Cc: bpf, linux-kselftest

To set socket noblock, we need to use
> fcntl(fd, F_SETFL, O_NONBLOCK);
rather than:
> fcntl(fd, O_NONBLOCK);

Signed-off-by: Qiao Ma <mqaio@linux.alibaba.com>
---
 tools/testing/selftests/bpf/test_sockmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/bpf/test_sockmap.c b/tools/testing/selftests/bpf/test_sockmap.c
index 0fbaccdc8861..b163b7cfd957 100644
--- a/tools/testing/selftests/bpf/test_sockmap.c
+++ b/tools/testing/selftests/bpf/test_sockmap.c
@@ -598,7 +598,7 @@ static int msg_loop(int fd, int iov_count, int iov_length, int cnt,
 		struct timeval timeout;
 		fd_set w;
 
-		fcntl(fd, fd_flags);
+		fcntl(fd, F_SETFL, fd_flags);
 		/* Account for pop bytes noting each iteration of apply will
 		 * call msg_pop_data helper so we need to account for this
 		 * by calculating the number of apply iterations. Note user
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf-next] selftests/bpf: fix incorrect fcntl call
  2022-08-24 14:01 [PATCH bpf-next] selftests/bpf: fix incorrect fcntl call Qiao Ma
@ 2022-08-24 15:03 ` Mykola Lysenko
  2022-08-24 15:50   ` Alexei Starovoitov
  0 siblings, 1 reply; 3+ messages in thread
From: Mykola Lysenko @ 2022-08-24 15:03 UTC (permalink / raw)
  To: Qiao Ma; +Cc: Mykola Lysenko, andrii, shuah, linux-kernel, bpf, linux-kselftest

Hi Qiao,

> On Aug 24, 2022, at 7:01 AM, Qiao Ma <mqaio@linux.alibaba.com> wrote:
> 
> !-------------------------------------------------------------------|
>  This Message Is From an External Sender
> 
> |-------------------------------------------------------------------!
> 
> To set socket noblock, we need to use
>> fcntl(fd, F_SETFL, O_NONBLOCK);
> rather than:
>> fcntl(fd, O_NONBLOCK);

Can you please add more description on what is it fixing?

Additionally, add file name to the title to make it easier to identify the commit from oneline git log.

Something like “selftests/bpf: fix incorrect fcntl call (test_sockmap.c)”.

Thank you!


> 
> Signed-off-by: Qiao Ma <mqaio@linux.alibaba.com>
> ---
> tools/testing/selftests/bpf/test_sockmap.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/bpf/test_sockmap.c b/tools/testing/selftests/bpf/test_sockmap.c
> index 0fbaccdc8861..b163b7cfd957 100644
> --- a/tools/testing/selftests/bpf/test_sockmap.c
> +++ b/tools/testing/selftests/bpf/test_sockmap.c
> @@ -598,7 +598,7 @@ static int msg_loop(int fd, int iov_count, int iov_length, int cnt,
> 		struct timeval timeout;
> 		fd_set w;
> 
> -		fcntl(fd, fd_flags);
> +		fcntl(fd, F_SETFL, fd_flags);
> 		/* Account for pop bytes noting each iteration of apply will
> 		 * call msg_pop_data helper so we need to account for this
> 		 * by calculating the number of apply iterations. Note user
> -- 
> 1.8.3.1
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf-next] selftests/bpf: fix incorrect fcntl call
  2022-08-24 15:03 ` Mykola Lysenko
@ 2022-08-24 15:50   ` Alexei Starovoitov
  0 siblings, 0 replies; 3+ messages in thread
From: Alexei Starovoitov @ 2022-08-24 15:50 UTC (permalink / raw)
  To: Mykola Lysenko; +Cc: Qiao Ma, andrii, shuah, linux-kernel, bpf, linux-kselftest

On Wed, Aug 24, 2022 at 8:13 AM Mykola Lysenko <mykolal@fb.com> wrote:
>
> Hi Qiao,
>
> > On Aug 24, 2022, at 7:01 AM, Qiao Ma <mqaio@linux.alibaba.com> wrote:
> >
> > !-------------------------------------------------------------------|
> >  This Message Is From an External Sender
> >
> > |-------------------------------------------------------------------!
> >
> > To set socket noblock, we need to use
> >> fcntl(fd, F_SETFL, O_NONBLOCK);
> > rather than:
> >> fcntl(fd, O_NONBLOCK);
>
> Can you please add more description on what is it fixing?
>
> Additionally, add file name to the title to make it easier to identify the commit from oneline git log.

file name in commit log? I think it's overkill.
The file names can be seen with git log --stat
Let's not put duplicate info into subjects.

> Something like “selftests/bpf: fix incorrect fcntl call (test_sockmap.c)”.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-24 15:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-24 14:01 [PATCH bpf-next] selftests/bpf: fix incorrect fcntl call Qiao Ma
2022-08-24 15:03 ` Mykola Lysenko
2022-08-24 15:50   ` Alexei Starovoitov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).