Re: [PATCH net-next v27 07/13] rtase: Implement a function to receive packets

From: Jakub Kicinski
Date: Tue Aug 20 2024 - 10:46:40 EST


On Tue, 20 Aug 2024 05:13:32 +0000 Larry Chiu wrote:
> > Memory allocation failures happen, we shouldn't risk spamming the logs.
> > I mean these two messages and the one in rtase_alloc_rx_data_buf(),
> > the should be removed.
> >
> > There is a alloc_fail statistic defined in include/net/netdev_queues.h
> > that's the correct way to report buffer allocation failures.
>
> Hi, Jakub,
> Can we just count the rx_alloc_fail here?
> If we implement the "netdev_stat_ops", we can report this counter.

I think so.

> > And you should have a periodic service task / work which checks for
> > buffers being exhausted, and if they are schedule NAPI so that it tries
> > to allocate.
>
> We will redefine the rtase_rx_ring_fill() to check the buffers and
> try to get page from the pool.
> Should we return the budget to schedule this NAPI if there are some
> empty buffers?

I wouldn't recommend that. If system is under memory stress
we shouldn't be adding extra load by rescheduling NAPI.