Skip to content

Commit 179d516

Browse files
committed
Merge branch 'intel-wired-lan-driver-updates-2024-04-23-i40e-iavf-ice'
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2024-04-23 (i40e, iavf, ice) This series contains updates to i40e, iavf, and ice drivers. Sindhu removes WQ_MEM_RECLAIM flag from workqueue for i40e. Erwan Velu adjusts message to avoid confusion on base being reported on i40e. Sudheer corrects insufficient check for TC equality on iavf. Jake corrects ordering of locks to avoid possible deadlock on ice. ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 4334496 + 96fdd1f commit 179d516

File tree

3 files changed

+40
-12
lines changed

3 files changed

+40
-12
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16107,8 +16107,8 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1610716107
val = FIELD_GET(I40E_PRTGL_SAH_MFS_MASK,
1610816108
rd32(&pf->hw, I40E_PRTGL_SAH));
1610916109
if (val < MAX_FRAME_SIZE_DEFAULT)
16110-
dev_warn(&pdev->dev, "MFS for port %x has been set below the default: %x\n",
16111-
pf->hw.port, val);
16110+
dev_warn(&pdev->dev, "MFS for port %x (%d) has been set below the default (%d)\n",
16111+
pf->hw.port, val, MAX_FRAME_SIZE_DEFAULT);
1611216112

1611316113
/* Add a filter to drop all Flow control frames from any VSI from being
1611416114
* transmitted. By doing so we stop a malicious VF from sending out
@@ -16650,7 +16650,7 @@ static int __init i40e_init_module(void)
1665016650
* since we need to be able to guarantee forward progress even under
1665116651
* memory pressure.
1665216652
*/
16653-
i40e_wq = alloc_workqueue("%s", WQ_MEM_RECLAIM, 0, i40e_driver_name);
16653+
i40e_wq = alloc_workqueue("%s", 0, 0, i40e_driver_name);
1665416654
if (!i40e_wq) {
1665516655
pr_err("%s: Failed to create workqueue\n", i40e_driver_name);
1665616656
return -ENOMEM;

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

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3502,6 +3502,34 @@ static void iavf_del_all_cloud_filters(struct iavf_adapter *adapter)
35023502
spin_unlock_bh(&adapter->cloud_filter_list_lock);
35033503
}
35043504

3505+
/**
3506+
* iavf_is_tc_config_same - Compare the mqprio TC config with the
3507+
* TC config already configured on this adapter.
3508+
* @adapter: board private structure
3509+
* @mqprio_qopt: TC config received from kernel.
3510+
*
3511+
* This function compares the TC config received from the kernel
3512+
* with the config already configured on the adapter.
3513+
*
3514+
* Return: True if configuration is same, false otherwise.
3515+
**/
3516+
static bool iavf_is_tc_config_same(struct iavf_adapter *adapter,
3517+
struct tc_mqprio_qopt *mqprio_qopt)
3518+
{
3519+
struct virtchnl_channel_info *ch = &adapter->ch_config.ch_info[0];
3520+
int i;
3521+
3522+
if (adapter->num_tc != mqprio_qopt->num_tc)
3523+
return false;
3524+
3525+
for (i = 0; i < adapter->num_tc; i++) {
3526+
if (ch[i].count != mqprio_qopt->count[i] ||
3527+
ch[i].offset != mqprio_qopt->offset[i])
3528+
return false;
3529+
}
3530+
return true;
3531+
}
3532+
35053533
/**
35063534
* __iavf_setup_tc - configure multiple traffic classes
35073535
* @netdev: network interface device structure
@@ -3559,7 +3587,7 @@ static int __iavf_setup_tc(struct net_device *netdev, void *type_data)
35593587
if (ret)
35603588
return ret;
35613589
/* Return if same TC config is requested */
3562-
if (adapter->num_tc == num_tc)
3590+
if (iavf_is_tc_config_same(adapter, &mqprio_qopt->qopt))
35633591
return 0;
35643592
adapter->num_tc = num_tc;
35653593

drivers/net/ethernet/intel/ice/ice_vf_lib.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,11 @@ int ice_reset_vf(struct ice_vf *vf, u32 flags)
856856
return 0;
857857
}
858858

859+
if (flags & ICE_VF_RESET_LOCK)
860+
mutex_lock(&vf->cfg_lock);
861+
else
862+
lockdep_assert_held(&vf->cfg_lock);
863+
859864
lag = pf->lag;
860865
mutex_lock(&pf->lag_mutex);
861866
if (lag && lag->bonded && lag->primary) {
@@ -867,11 +872,6 @@ int ice_reset_vf(struct ice_vf *vf, u32 flags)
867872
act_prt = ICE_LAG_INVALID_PORT;
868873
}
869874

870-
if (flags & ICE_VF_RESET_LOCK)
871-
mutex_lock(&vf->cfg_lock);
872-
else
873-
lockdep_assert_held(&vf->cfg_lock);
874-
875875
if (ice_is_vf_disabled(vf)) {
876876
vsi = ice_get_vf_vsi(vf);
877877
if (!vsi) {
@@ -956,14 +956,14 @@ int ice_reset_vf(struct ice_vf *vf, u32 flags)
956956
ice_mbx_clear_malvf(&vf->mbx_info);
957957

958958
out_unlock:
959-
if (flags & ICE_VF_RESET_LOCK)
960-
mutex_unlock(&vf->cfg_lock);
961-
962959
if (lag && lag->bonded && lag->primary &&
963960
act_prt != ICE_LAG_INVALID_PORT)
964961
ice_lag_move_vf_nodes_cfg(lag, pri_prt, act_prt);
965962
mutex_unlock(&pf->lag_mutex);
966963

964+
if (flags & ICE_VF_RESET_LOCK)
965+
mutex_unlock(&vf->cfg_lock);
966+
967967
return err;
968968
}
969969

0 commit comments

Comments
 (0)