Skip to content

Commit e14d1bd

Browse files
rrogalsxsmb49
authored andcommitted
ice: Fix RDMA VSI removal during queue rebuild
BugLink: https://bugs.launchpad.net/bugs/2038236 [ Upstream commit 4b31fd4 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent cdb98b6 commit e14d1bd

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
@@ -8832,6 +8832,7 @@ ice_setup_tc(struct net_device *netdev, enum tc_setup_type type,
88328832
{
88338833
struct ice_netdev_priv *np = netdev_priv(netdev);
88348834
struct ice_pf *pf = np->vsi->back;
8835+
bool locked = false;
88358836
int err;
88368837

88378838
switch (type) {
@@ -8841,10 +8842,27 @@ ice_setup_tc(struct net_device *netdev, enum tc_setup_type type,
88418842
ice_setup_tc_block_cb,
88428843
np, np, true);
88438844
case TC_SETUP_QDISC_MQPRIO:
8845+
if (pf->adev) {
8846+
mutex_lock(&pf->adev_mutex);
8847+
device_lock(&pf->adev->dev);
8848+
locked = true;
8849+
if (pf->adev->dev.driver) {
8850+
netdev_err(netdev, "Cannot change qdisc when RDMA is active\n");
8851+
err = -EBUSY;
8852+
goto adev_unlock;
8853+
}
8854+
}
8855+
88448856
/* setup traffic classifier for receive side */
88458857
mutex_lock(&pf->tc_mutex);
88468858
err = ice_setup_tc_mqprio_qdisc(netdev, type_data);
88478859
mutex_unlock(&pf->tc_mutex);
8860+
8861+
adev_unlock:
8862+
if (locked) {
8863+
device_unlock(&pf->adev->dev);
8864+
mutex_unlock(&pf->adev_mutex);
8865+
}
88488866
return err;
88498867
default:
88508868
return -EOPNOTSUPP;

0 commit comments

Comments
 (0)