[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2ccd9a5a-7b3a-4234-8d61-64cee4c1fb28@intel.com>
Date: Fri, 10 Jan 2025 08:16:26 -0700
From: Ahmed Zaki <ahmed.zaki@...el.com>
To: Simon Horman <horms@...nel.org>
CC: <netdev@...r.kernel.org>, <intel-wired-lan@...ts.osuosl.org>,
<andrew+netdev@...n.ch>, <edumazet@...gle.com>, <kuba@...nel.org>,
<pabeni@...hat.com>, <davem@...emloft.net>, <michael.chan@...adcom.com>,
<tariqt@...dia.com>, <anthony.l.nguyen@...el.com>,
<przemyslaw.kitszel@...el.com>, <jdamato@...tly.com>, <shayd@...dia.com>,
<akpm@...ux-foundation.org>, <shayagr@...zon.com>,
<kalesh-anakkur.purayil@...adcom.com>
Subject: Re: [PATCH net-next v4 2/6] net: napi: add internal ARFS rmap
management
On 2025-01-10 4:55 a.m., Simon Horman wrote:
> On Thu, Jan 09, 2025 at 04:31:03PM -0700, Ahmed Zaki wrote:
>> For drivers using the netif_enable_cpu_rmap(), move the IRQ rmap notifier
>> inside the napi_struct.
>>
>> Signed-off-by: Ahmed Zaki <ahmed.zaki@...el.com>
>
> ...
>
>> diff --git a/net/core/dev.c b/net/core/dev.c
>
> ...
>
>> +static int napi_irq_cpu_rmap_add(struct napi_struct *napi, int irq)
>> +{
>> + struct cpu_rmap *rmap = napi->dev->rx_cpu_rmap;
>> + int rc;
>> +
>> + if (!napi || !rmap)
>> + return -EINVAL;
>
> Hi Ahmed,
>
> Here it is assumed that napi may be NULL. But it is dereferenced
> unconditionally on the first like of this function.
>
> Flagged by Smatch.
>
Correct. This was probably a defensive check, I will remove it since the
caller already dereferences the napi ptr.
Thanks for the review.
Ahmed
Powered by blists - more mailing lists