[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAVpQUBAKi+78aV2q4H2z8AVku4DGmsV-43UkksGV8kWEaauxg@mail.gmail.com>
Date: Mon, 17 Nov 2025 20:10:59 -0800
From: Kuniyuki Iwashima <kuniyu@...gle.com>
To: Miao Wang <shankerwangmiao@...il.com>
Cc: "David S . Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>,
Aaron Conole <aconole@...heb.org>, Kuniyuki Iwashima <kuni1840@...il.com>, netdev@...r.kernel.org
Subject: Re: [PATCH v1 net 2/2] selftest: af_unix: Add test for SO_PEEK_OFF.
On Mon, Nov 17, 2025 at 3:10 PM Miao Wang <shankerwangmiao@...il.com> wrote:
>
>
> > 2025年11月18日 01:47,Kuniyuki Iwashima <kuniyu@...gle.com> 写道:
> >
> > The test covers various cases to verify SO_PEEK_OFF behaviour
> > for all AF_UNIX socket types.
> >
> > two_chunks_blocking and two_chunks_overlap_blocking reproduce
> > the issue mentioned in the previous patch.
> >
> > Without the patch, the two tests fail:
> >
> > # RUN so_peek_off.stream.two_chunks_blocking ...
> > # so_peek_off.c:121:two_chunks_blocking:Expected 'bbbb' == 'aaaabbbb'.
> > # two_chunks_blocking: Test terminated by assertion
> > # FAIL so_peek_off.stream.two_chunks_blocking
> > not ok 3 so_peek_off.stream.two_chunks_blocking
> >
> > # RUN so_peek_off.stream.two_chunks_overlap_blocking ...
> > # so_peek_off.c:159:two_chunks_overlap_blocking:Expected 'bbbb' == 'aaaabbbb'.
> > # two_chunks_overlap_blocking: Test terminated by assertion
> > # FAIL so_peek_off.stream.two_chunks_overlap_blocking
> > not ok 5 so_peek_off.stream.two_chunks_overlap_blocking
> >
> > With the patch, all tests pass:
> >
> > # PASSED: 15 / 15 tests passed.
> > # Totals: pass:15 fail:0 xfail:0 xpass:0 skip:0 error:0
> >
> > Signed-off-by: Kuniyuki Iwashima <kuniyu@...gle.com>
> > ---
> > tools/testing/selftests/net/.gitignore | 1 +
> > tools/testing/selftests/net/af_unix/Makefile | 1 +
> > .../selftests/net/af_unix/so_peek_off.c | 162 ++++++++++++++++++
> > 3 files changed, 164 insertions(+)
> > create mode 100644 tools/testing/selftests/net/af_unix/so_peek_off.c
> >
>
> Hi,
>
> Many thanks for your patch. I wonder if at the end of each
> test, a normal recv() without MGS_PEEK can be called to check
> if it can receive all the content in the receiving buffer and
> check if SO_PEEK_OFF becomes back to zero.
I'd keep this for now as it covers the fix in the previous patch.
We could add more tests in net-next if we want.
Thanks!
Powered by blists - more mailing lists