Skip to contentSkip to conversation

iavf: Rework mutexes for better synchronisation

PATCH New Mateusz Palczewski 3 participants 3 messages Feb 23, 2022 – Feb 25, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/8 iavf: Rework mutexes for better synchronisation

From: SlawomirX Laba <[email protected]>

The driver used to crash in multiple spots when put to stress testing of the init, reset and remove paths.

The user would experience call traces or hangs when creating, resetting, removing VFs. Depending on the machines, the call traces are happening in random spots, like reset restoring resources racing with driver remove.

Make adapter->crit_lock mutex a mandatory lock for guarding the operations performed on all workqueues and functions dealing with resource allocation and disposal.

Make __IAVF_REMOVE a final state of the driver respected by workqueues that shall not requeue, when they fail to obtain the crit_lock.

Make the IRQ handler not to queue the new work for adminq_task when the __IAVF_REMOVE state is set.

Fixes 5ac49f3c2702 ("iavf: use mutexes for locking of critical sections")
---
 drivers/net/ethernet/intel/iavf/iavf.h      |  1 -
 drivers/net/ethernet/intel/iavf/iavf_main.c | 66 +++++++++++----------
 2 files changed, 36 insertions(+), 31 deletions(-)
drivers/net/ethernet/intel/iavf/iavf.h +0 -1
index 59806d1..44f83e0 100644
@@ -246,7 +246,6 @@ struct iavf_adapter {
 	struct list_head mac_filter_list;
 	struct mutex crit_lock;
 	struct mutex client_lock;
-	struct mutex remove_lock;
 	/* Lock to protect accesses to MAC and VLAN lists */
 	spinlock_t mac_vlan_list_lock;
 	char misc_vector_name[IFNAMSIZ + 9];
drivers/net/ethernet/intel/iavf/iavf_main.c +36 -30

149 lines not on this page · raw message

Signature · 1 line
2.27.0
#1 lore raw

PATCH 1/8 iavf: Rework mutexes for better synchronisation

From: Mateusz Palczewski <[email protected]>
Date: Wed, 23 Feb 2022 13:35:49 +0100

First of all, please check your git-send-email settings. Your patches don't have "In-Reply-To" and "References" headers, which mean that they won't be represented as a series in Patchwork and as an e-mail thread in list archivies or just mailboxes. All the patches should have the ID of the cover letter (which I haven't received at all, did you compose it?) in both headers to be correctly represented.

Quoted 1 line

From: SlawomirX Laba <[email protected]>

"Slawomir" with no X I guess?
It's currently inconsistent with the Signed-off-by, and generally people outside Intel don't know (and shouldn't care) what this X does mean.
So please fix in v2.

Quoted 17 lines

The driver used to crash in multiple spots when put to stress testing of the init, reset and remove paths.

The user would experience call traces or hangs when creating, resetting, removing VFs. Depending on the machines, the call traces are happening in random spots, like reset restoring resources racing with driver remove.

Make adapter->crit_lock mutex a mandatory lock for guarding the operations performed on all workqueues and functions dealing with resource allocation and disposal.

Make __IAVF_REMOVE a final state of the driver respected by workqueues that shall not requeue, when they fail to obtain the crit_lock.

Quoted 5 lines

Make the IRQ handler not to queue the new work for adminq_task when the __IAVF_REMOVE state is set.

Fixes 5ac49f3c2702 ("iavf: use mutexes for locking of critical sections")

Here's a correct signature for the reference.

Quoted 8 lines
---
 drivers/net/ethernet/intel/iavf/iavf.h      |  1 -
 drivers/net/ethernet/intel/iavf/iavf_main.c | 66 +++++++++++----------
 2 files changed, 36 insertions(+), 31 deletions(-)

--- 8< ---

Quoted 2 lines
Signature · 1 line
2.27.0

Thanks,
Al

#2 lore raw

PATCH 1/8 iavf: Rework mutexes for better synchronisation

In reply to Mateusz Palczewski

drivers/net/ethernet/intel/iavf/iavf.h struct iavf_adapter {

Quoted 48 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Mateusz Palczewski
Sent: Wednesday, February 23, 2022 1:36 PM
To: intel-wired-lan at lists.osuosl.org
Cc: Laba, SlawomirX <[email protected]>; Burra, Phani R <[email protected]>; Palczewski, Mateusz <[email protected]>
Subject: [Intel-wired-lan] [PATCH net v1 1/8] iavf: Rework mutexes for better synchronisation

From: SlawomirX Laba <[email protected]>

The driver used to crash in multiple spots when put to stress testing of the init, reset and remove paths.

The user would experience call traces or hangs when creating, resetting, removing VFs. Depending on the machines, the call traces are happening in random spots, like reset restoring resources racing with driver remove.

Make adapter->crit_lock mutex a mandatory lock for guarding the operations performed on all workqueues and functions dealing with resource allocation and disposal.

Make __IAVF_REMOVE a final state of the driver respected by workqueues that shall not requeue, when they fail to obtain the crit_lock.

Make the IRQ handler not to queue the new work for adminq_task when the __IAVF_REMOVE state is set.

Fixes 5ac49f3c2702 ("iavf: use mutexes for locking of critical sections")
---
 drivers/net/ethernet/intel/iavf/iavf.h      |  1 -
 drivers/net/ethernet/intel/iavf/iavf_main.c | 66 +++++++++++----------
 2 files changed, 36 insertions(+), 31 deletions(-)
drivers/net/ethernet/intel/iavf/iavf.h +0 -0
index 59806d1..44f83e0 100644
@@ -246,7 +246,6 @@ struct iavf_adapter {