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 <[email protected]> Signed-off-by: Mateusz Palczewski <[email protected]> Signed-off-by: Kamil Maziarz <[email protected]> Tested-by: Bharathi Sreenivas <[email protected]> Signed-off-by: Tony Nguyen <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 55c1528 commit 4b31fd4

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

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)