Skip to content

Commit 4b31fd4

Browse files
rrogalsxkuba-moo
authored andcommitted
ice: Fix RDMA VSI removal during queue rebuild
During qdisc create/delete, it is necessary to rebuild the queue of VSIs. An error occurred because the VSIs created by RDMA were still active. Added check if RDMA is active. If yes, it disallows qdisc changes and writes a message in the system logs. Fixes: 348048e ("ice: Implement iidc operations") Signed-off-by: Rafal Rogalski <rafalx.rogalski@intel.com> Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com> Signed-off-by: Kamil Maziarz <kamil.maziarz@intel.com> Tested-by: Bharathi Sreenivas <bharathi.sreenivas@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Link: https://lore.kernel.org/r/20230728171243.2446101-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 55c1528 commit 4b31fd4

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8813,6 +8813,7 @@ ice_setup_tc(struct net_device *netdev, enum tc_setup_type type,
88138813
{
88148814
struct ice_netdev_priv *np = netdev_priv(netdev);
88158815
struct ice_pf *pf = np->vsi->back;
8816+
bool locked = false;
88168817
int err;
88178818

88188819
switch (type) {
@@ -8822,10 +8823,27 @@ ice_setup_tc(struct net_device *netdev, enum tc_setup_type type,
88228823
ice_setup_tc_block_cb,
88238824
np, np, true);
88248825
case TC_SETUP_QDISC_MQPRIO:
8826+
if (pf->adev) {
8827+
mutex_lock(&pf->adev_mutex);
8828+
device_lock(&pf->adev->dev);
8829+
locked = true;
8830+
if (pf->adev->dev.driver) {
8831+
netdev_err(netdev, "Cannot change qdisc when RDMA is active\n");
8832+
err = -EBUSY;
8833+
goto adev_unlock;
8834+
}
8835+
}
8836+
88258837
/* setup traffic classifier for receive side */
88268838
mutex_lock(&pf->tc_mutex);
88278839
err = ice_setup_tc_mqprio_qdisc(netdev, type_data);
88288840
mutex_unlock(&pf->tc_mutex);
8841+
8842+
adev_unlock:
8843+
if (locked) {
8844+
device_unlock(&pf->adev->dev);
8845+
mutex_unlock(&pf->adev_mutex);
8846+
}
88298847
return err;
88308848
default:
88318849
return -EOPNOTSUPP;

0 commit comments

Comments
 (0)