Skip to content

Commit 3349d36

Browse files
committed
Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue
Nguyen, Anthony L says: ==================== 40GbE Intel Wired LAN Driver Updates 2021-08-17 This series contains updates to iavf and i40e drivers. Stefan Assmann converts use of flag based locking of critical sections to mutexes for iavf. Colin King fixes a spelling error for i40e. * '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: i40e: Fix spelling mistake "dissable" -> "disable" iavf: use mutexes for locking of critical sections ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 752be29 + 6e9078a commit 3349d36

File tree

4 files changed

+57
-64
lines changed

4 files changed

+57
-64
lines changed

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4638,7 +4638,7 @@ void i40e_vsi_stop_rings(struct i40e_vsi *vsi)
46384638
err = i40e_control_wait_rx_q(pf, pf_q, false);
46394639
if (err)
46404640
dev_info(&pf->pdev->dev,
4641-
"VSI seid %d Rx ring %d dissable timeout\n",
4641+
"VSI seid %d Rx ring %d disable timeout\n",
46424642
vsi->seid, pf_q);
46434643
}
46444644

drivers/net/ethernet/intel/iavf/iavf.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,6 @@ enum iavf_state_t {
185185
__IAVF_RUNNING, /* opened, working */
186186
};
187187

188-
enum iavf_critical_section_t {
189-
__IAVF_IN_CRITICAL_TASK, /* cannot be interrupted */
190-
__IAVF_IN_CLIENT_TASK,
191-
__IAVF_IN_REMOVE_TASK, /* device being removed */
192-
};
193-
194188
#define IAVF_CLOUD_FIELD_OMAC 0x01
195189
#define IAVF_CLOUD_FIELD_IMAC 0x02
196190
#define IAVF_CLOUD_FIELD_IVLAN 0x04
@@ -235,6 +229,9 @@ struct iavf_adapter {
235229
struct iavf_q_vector *q_vectors;
236230
struct list_head vlan_filter_list;
237231
struct list_head mac_filter_list;
232+
struct mutex crit_lock;
233+
struct mutex client_lock;
234+
struct mutex remove_lock;
238235
/* Lock to protect accesses to MAC and VLAN lists */
239236
spinlock_t mac_vlan_list_lock;
240237
char misc_vector_name[IFNAMSIZ + 9];

drivers/net/ethernet/intel/iavf/iavf_ethtool.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,8 +1352,7 @@ static int iavf_add_fdir_ethtool(struct iavf_adapter *adapter, struct ethtool_rx
13521352
if (!fltr)
13531353
return -ENOMEM;
13541354

1355-
while (test_and_set_bit(__IAVF_IN_CRITICAL_TASK,
1356-
&adapter->crit_section)) {
1355+
while (!mutex_trylock(&adapter->crit_lock)) {
13571356
if (--count == 0) {
13581357
kfree(fltr);
13591358
return -EINVAL;
@@ -1378,7 +1377,7 @@ static int iavf_add_fdir_ethtool(struct iavf_adapter *adapter, struct ethtool_rx
13781377
if (err && fltr)
13791378
kfree(fltr);
13801379

1381-
clear_bit(__IAVF_IN_CRITICAL_TASK, &adapter->crit_section);
1380+
mutex_unlock(&adapter->crit_lock);
13821381
return err;
13831382
}
13841383

@@ -1563,8 +1562,7 @@ iavf_set_adv_rss_hash_opt(struct iavf_adapter *adapter,
15631562
return -EINVAL;
15641563
}
15651564

1566-
while (test_and_set_bit(__IAVF_IN_CRITICAL_TASK,
1567-
&adapter->crit_section)) {
1565+
while (!mutex_trylock(&adapter->crit_lock)) {
15681566
if (--count == 0) {
15691567
kfree(rss_new);
15701568
return -EINVAL;
@@ -1600,7 +1598,7 @@ iavf_set_adv_rss_hash_opt(struct iavf_adapter *adapter,
16001598
if (!err)
16011599
mod_delayed_work(iavf_wq, &adapter->watchdog_task, 0);
16021600

1603-
clear_bit(__IAVF_IN_CRITICAL_TASK, &adapter->crit_section);
1601+
mutex_unlock(&adapter->crit_lock);
16041602

16051603
if (!rss_new_add)
16061604
kfree(rss_new);

0 commit comments

Comments
 (0)