Re: [PATCH bpf-next v2] bpf: Simplify tnum_step()
From: Hao Sun
Date: Wed Mar 25 2026 - 04:00:47 EST
On Tue, Mar 24, 2026 at 10:57 PM Harishankar Vishwanathan
<harishankar.vishwanathan@xxxxxxxxx> wrote:
>
> On Tue, Mar 24, 2026 at 5:36 PM Alexei Starovoitov
> <alexei.starovoitov@xxxxxxxxx> wrote:
> >
> > On Tue, Mar 24, 2026 at 2:33 PM Harishankar Vishwanathan
> > <harishankar.vishwanathan@xxxxxxxxx> wrote:
> > >
> > > On Tue, Mar 24, 2026 at 11:50 AM <patchwork-bot+netdevbpf@xxxxxxxxxx> wrote:
> > > >
> > > > Hello:
> > > >
> > > > This patch was applied to bpf/bpf-next.git (master)
> > > > by Alexei Starovoitov <ast@xxxxxxxxxx>:
> > >
> > > Hello, I see this was applied. Just a heads up that I still had a few
> > > concerns regarding the
> > > commit message and code style in my last reply. I think it was my
> > > mistake to include
> > > the Reviewed-by while still requesting changes.
> > >
> > > Hao, would you like to send a follow-up for those, or should I put one together?
> > >
> > > Or Alexei, do you think it is okay as is? If yes, we can just leave it be.
> >
> > They read like nits to me.
> > New code is definitely cleaner.
> > As a follow up better craft a targeted selftest and explain
> > your points in selftest comments.
>
> Yes they were definitely nits. Makes sense to keep the
> code clean.
>
> The logic is sound and verified, so I'm happy to leave it as-is.
> If I find the time to put together a targeted selftest down the road,
> I'll send a separate patch!
Hi Harishankar,
Thank you for reviewing the code and verifying its correctness, which
gives additional confidence.
I kept the commit message concise, as I felt it was sufficient to describe:
simplifying the problem to finding the submask and treating d’s mask bits
as a counter that we increment by one. Once this perspective is clear,
the rest of the logic should be relatively easy to follow.
That said, please feel free to refine the message further, e.g., adding a
selftest and referencing it from the code.