lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <69154395-38f4-44ff-96db-7c383a97ddb9@intel.com>
Date: Tue, 21 Jan 2025 07:52:20 -0700
From: Ahmed Zaki <ahmed.zaki@...el.com>
To: Jakub Kicinski <kuba@...nel.org>
CC: <netdev@...r.kernel.org>, <intel-wired-lan@...ts.osuosl.org>,
	<andrew+netdev@...n.ch>, <edumazet@...gle.com>, <horms@...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>, David Arinzon <darinzon@...zon.com>
Subject: Re: [PATCH net-next v6 1/5] net: move ARFS rmap management to core



On 2025-01-20 5:59 p.m., Jakub Kicinski wrote:
> On Fri, 17 Jan 2025 17:33:31 -0700 Ahmed Zaki wrote:
>> +#ifdef CONFIG_RFS_ACCEL
>> +static void
>> +netif_irq_cpu_rmap_notify(struct irq_affinity_notify *notify,
>> +			  const cpumask_t *mask)
>> +{
>> +	struct napi_struct *napi =
>> +		container_of(notify, struct napi_struct, notify);
>> +	struct cpu_rmap *rmap = napi->dev->rx_cpu_rmap;
>> +	int err;
>> +
>> +	if (napi->dev->rx_cpu_rmap_auto) {
> 
> Can this ever not be true?

It can, but not in this patch. I will it move to next one.

> 
>> +		err = cpu_rmap_update(rmap, napi->napi_rmap_idx, mask);
>> +		if (err)
>> +			pr_warn("%s: RMAP update failed (%d)\n",
>> +				__func__, err);
> 
> netdev_warn(napi->dev, "...) ?
> 
>> +	}
>> +}
>> +
>> +static void netif_napi_affinity_release(struct kref *ref)
>> +{
>> +	struct napi_struct *napi =
>> +		container_of(ref, struct napi_struct, notify.kref);
>> +	struct cpu_rmap *rmap = napi->dev->rx_cpu_rmap;
>> +
>> +	if (!napi->dev->rx_cpu_rmap_auto)
> 
> Similar question, can it possibly be false without driver bugs?
> I think you disable rmap completely if we can't add a single IRQ,
> that may be too drastic. Better miss one IRQ than the whole rmap, no?
> 

Same. This belongs to next patch (when the notifier can be set because 
of ARFS rmap or napi.irq affinity).

>> +		return;
>> +	rmap->obj[napi->napi_rmap_idx] = NULL;
>> +	napi->napi_rmap_idx = -1;
> 
> Why do we modify NAPI here? Shouldn't caller be responsible for this?
> 

This is called when the notifier is set to NULL.

Setting  napi_rmap_idx is not strictly needed but the idea was to have 
netif_napi_affinity_release() unwind all changes made in 
napi_irq_cpu_rmap_add().


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ