[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <SJ0PR11MB58657540C92FD4DBA94926A08F112@SJ0PR11MB5865.namprd11.prod.outlook.com>
Date: Tue, 7 Jan 2025 10:06:41 +0000
From: "Romanowski, Rafal" <rafal.romanowski@...el.com>
To: Wander Lairson Costa <wander@...hat.com>, "Nguyen, Anthony L"
<anthony.l.nguyen@...el.com>, "Kitszel, Przemyslaw"
<przemyslaw.kitszel@...el.com>, Andrew Lunn <andrew+netdev@...n.ch>, "David
S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, "Jakub
Kicinski" <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, "Sebastian
Andrzej Siewior" <bigeasy@...utronix.de>, Clark Williams
<clrkwllms@...nel.org>, Steven Rostedt <rostedt@...dmis.org>, Auke Kok
<auke-jan.h.kok@...el.com>, Jeff Garzik <jgarzik@...hat.com>, "moderated
list:INTEL ETHERNET DRIVERS" <intel-wired-lan@...ts.osuosl.org>, "open
list:NETWORKING DRIVERS" <netdev@...r.kernel.org>, open list
<linux-kernel@...r.kernel.org>, "open list:Real-time Linux
(PREEMPT_RT):Keyword:PREEMPT_RT" <linux-rt-devel@...ts.linux.dev>
Subject: RE: [Intel-wired-lan] [PATCH iwl-net 1/4] igb: narrow scope of
vfs_lock in SR-IOV cleanup
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@...osl.org> On Behalf Of
> Wander Lairson Costa
> Sent: Wednesday, December 4, 2024 12:42 PM
> To: Nguyen, Anthony L <anthony.l.nguyen@...el.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@...el.com>; Andrew Lunn <andrew+netdev@...n.ch>;
> David S. Miller <davem@...emloft.net>; Eric Dumazet
> <edumazet@...gle.com>; Jakub Kicinski <kuba@...nel.org>; Paolo Abeni
> <pabeni@...hat.com>; Sebastian Andrzej Siewior <bigeasy@...utronix.de>; Clark
> Williams <clrkwllms@...nel.org>; Steven Rostedt <rostedt@...dmis.org>; Auke
> Kok <auke-jan.h.kok@...el.com>; Jeff Garzik <jgarzik@...hat.com>; moderated
> list:INTEL ETHERNET DRIVERS <intel-wired-lan@...ts.osuosl.org>; open
> list:NETWORKING DRIVERS <netdev@...r.kernel.org>; open list <linux-
> kernel@...r.kernel.org>; open list:Real-time Linux
> (PREEMPT_RT):Keyword:PREEMPT_RT <linux-rt-devel@...ts.linux.dev>
> Cc: Wander Lairson Costa <wander@...hat.com>
> Subject: [Intel-wired-lan] [PATCH iwl-net 1/4] igb: narrow scope of vfs_lock in SR-
> IOV cleanup
>
> The adapter->vfs_lock currently protects critical sections shared between
> igb_disable_sriov() and igb_msg_task(). Since igb_msg_task() — which is invoked
> solely by the igb_msix_other() ISR—only proceeds when
> adapter->vfs_allocated_count > 0, we can reduce the lock scope further.
>
> By moving the assignment adapter->vfs_allocated_count = 0 to the start of the
> cleanup code in igb_disable_sriov(), we can restrict the spinlock protection solely
> to this assignment. This change removes kfree() calls from within the locked
> section, simplifying lock management.
>
> Once kfree() is outside the vfs_lock scope, it becomes possible to safely convert
> vfs_lock to a raw_spin_lock.
>
> Signed-off-by: Wander Lairson Costa <wander@...hat.com>
> ---
> drivers/net/ethernet/intel/igb/igb_main.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/igb/igb_main.c
> b/drivers/net/ethernet/intel/igb/igb_main.c
> index 08578980b6518..4ca25660e876e 100644
> --- a/drivers/net/ethernet/intel/igb/igb_main.c
> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
> @@ -3708,12 +3708,12 @@ static int igb_disable_sriov(struct pci_dev *pdev,
Tested-by: Rafal Romanowski <rafal.romanowski@...el.com>
Powered by blists - more mailing lists