Re: [PATCH net-next 3/5] net: napi: Make gro_flush_timeout per-NAPI
From: Joe Damato
Date: Thu Aug 29 2024 - 09:57:59 EST
On Thu, Aug 29, 2024 at 03:48:05PM +0200, Eric Dumazet wrote:
> On Thu, Aug 29, 2024 at 3:13 PM Joe Damato <jdamato@xxxxxxxxxx> wrote:
> >
> > Allow per-NAPI gro_flush_timeout setting.
> >
> > The existing sysfs parameter is respected; writes to sysfs will write to
> > all NAPI structs for the device and the net_device gro_flush_timeout
> > field. Reads from sysfs will read from the net_device field.
> >
> > The ability to set gro_flush_timeout on specific NAPI instances will be
> > added in a later commit, via netdev-genl.
> >
> > Signed-off-by: Joe Damato <jdamato@xxxxxxxxxx>
> > Reviewed-by: Martin Karsten <mkarsten@xxxxxxxxxxxx>
> > Tested-by: Martin Karsten <mkarsten@xxxxxxxxxxxx>
> > ---
> > include/linux/netdevice.h | 26 ++++++++++++++++++++++++++
> > net/core/dev.c | 32 ++++++++++++++++++++++++++++----
> > net/core/net-sysfs.c | 2 +-
> > 3 files changed, 55 insertions(+), 5 deletions(-)
> >
> > diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> > index 7d53380da4c0..d00024d9f857 100644
> > --- a/include/linux/netdevice.h
> > +++ b/include/linux/netdevice.h
> > @@ -372,6 +372,7 @@ struct napi_struct {
> > int rx_count; /* length of rx_list */
> > unsigned int napi_id;
> > int defer_hard_irqs;
> > + unsigned long gro_flush_timeout;
> > struct hrtimer timer;
> > struct task_struct *thread;
> > /* control-path-only fields follow */
> > @@ -557,6 +558,31 @@ void napi_set_defer_hard_irqs(struct napi_struct *n, int defer);
> > */
> > void netdev_set_defer_hard_irqs(struct net_device *netdev, int defer);
> >
>
> Same remark : dev->gro_flush_timeout is no longer read in the fast path.
>
> Please move gro_flush_timeout out of net_device_read_txrx and update
> Documentation/networking/net_cachelines/net_device.rst
Thanks, Eric. I will take care of both in the v2.