[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMEhMpkdS61-bMbKEZSfu4Vo3JnpA-rxK7NDB3k+unw7wUQmCg@mail.gmail.com>
Date: Tue, 28 Oct 2025 12:57:42 +0530
From: Shivaji Kant <shivajikant@...gle.com>
To: Eric Dumazet <edumazet@...gle.com>
Cc: netdev@...r.kernel.org, "David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>,
Mina Almasry <almasrymina@...gle.com>, Stanislav Fomichev <sdf@...ichev.me>,
Pavel Begunkov <asml.silence@...il.com>, Pranjal Shrivastava <praan@...gle.com>,
Vedant Mathur <vedantmathur@...gle.com>
Subject: Re: [PATCH] net: devmem: Remove dst (ENODEV) check in net_devmem_get_binding
Thanks Eric for pointing it out.
The description of the patch needs to be updated.
Will send a v2 with updated description in 24 hrs.
On Tue, Oct 28, 2025 at 12:33 PM Eric Dumazet <edumazet@...gle.com> wrote:
>
> On Mon, Oct 27, 2025 at 11:07 PM Shivaji Kant <shivajikant@...gle.com> wrote:
> >
> > The Devmem TX binding lookup function, performs a strict
> > check against the socket's destination cache (`dst`) to
> > ensure the bound `dmabuf_id` corresponds to the correct
> > network device (`dst->dev->ifindex == binding->dev->ifindex`).
> >
> > However, this check incorrectly fails and returns `-ENODEV`
> > if the socket's route cache entry (`dst`) is merely missing
> > or expired (`dst == NULL`). This scenario is observed during
> > network events, such as when flow steering rules are deleted,
> > leading to a temporary route cache invalidation.
> >
> > The parent caller, `tcp_sendmsg_locked()`, is already
> > responsible for acquiring or validating the route (`dst_entry`).
> > If `dst` is `NULL`, `tcp_sendmsg_locked()` will correctly
> > derive the route before transmission.
> >
> > This patch removes the `dst` validation from
> > `net_devmem_get_binding()`. The function now only validates
> > the existence of the binding and its TX vector, relying on the
> > calling context for device/route correctness. This allows
> > temporary route cache misses to be handled gracefully by the
> > TCP/IP stack without ENODEV error on the Devmem TX path.
> >
> > Reported-by: Eric Dumazet <edumazet@...gle.com>
> > Reported-by: Vedant Mathur <vedantmathur@...gle.com>
> > Suggested-by: Eric Dumazet <edumazet@...gle.com>
> > Fixes: bd61848900bf ("net: devmem: Implement TX path")
> > Signed-off-by: Shivaji Kant <shivajikant@...gle.com>
> > ---
> > net/core/devmem.c | 27 ++++++++++++++++++++++++---
> > 1 file changed, 24 insertions(+), 3 deletions(-)
> >
>
> Patch looks good, but the title should be improved a bit.
>
> "Remove dst (ENODEV) check in net_devmem_get_binding"
>
> It is not about removing the check, more about refreshing the dst if necessary ?
>
> Please wait ~24 hours before sending an updated version, to give time
> for other reviewers to chime in.
>
> Thanks !
Powered by blists - more mailing lists