[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230728171243.2446101-1-anthony.l.nguyen@intel.com>
Date: Fri, 28 Jul 2023 10:12:43 -0700
From: Tony Nguyen <anthony.l.nguyen@...el.com>
To: davem@...emloft.net,
kuba@...nel.org,
pabeni@...hat.com,
edumazet@...gle.com,
netdev@...r.kernel.org
Cc: Rafal Rogalski <rafalx.rogalski@...el.com>,
anthony.l.nguyen@...el.com,
david.m.ertman@...el.com,
shiraz.saleem@...el.com,
mustafa.ismail@...el.com,
jgg@...dia.com,
leonro@...dia.com,
linux-rdma@...r.kernel.org,
Mateusz Palczewski <mateusz.palczewski@...el.com>,
Kamil Maziarz <kamil.maziarz@...el.com>,
Bharathi Sreenivas <bharathi.sreenivas@...el.com>
Subject: [PATCH net] ice: Fix RDMA VSI removal during queue rebuild
From: Rafal Rogalski <rafalx.rogalski@...el.com>
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: 348048e724a0 ("ice: Implement iidc operations")
Signed-off-by: Rafal Rogalski <rafalx.rogalski@...el.com>
Signed-off-by: Mateusz Palczewski <mateusz.palczewski@...el.com>
Signed-off-by: Kamil Maziarz <kamil.maziarz@...el.com>
Tested-by: Bharathi Sreenivas <bharathi.sreenivas@...el.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@...el.com>
---
drivers/net/ethernet/intel/ice/ice_main.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index f02d44455772..cf92c39467c8 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -8813,6 +8813,7 @@ ice_setup_tc(struct net_device *netdev, enum tc_setup_type type,
{
struct ice_netdev_priv *np = netdev_priv(netdev);
struct ice_pf *pf = np->vsi->back;
+ bool locked = false;
int err;
switch (type) {
@@ -8822,10 +8823,27 @@ ice_setup_tc(struct net_device *netdev, enum tc_setup_type type,
ice_setup_tc_block_cb,
np, np, true);
case TC_SETUP_QDISC_MQPRIO:
+ if (pf->adev) {
+ mutex_lock(&pf->adev_mutex);
+ device_lock(&pf->adev->dev);
+ locked = true;
+ if (pf->adev->dev.driver) {
+ netdev_err(netdev, "Cannot change qdisc when RDMA is active\n");
+ err = -EBUSY;
+ goto adev_unlock;
+ }
+ }
+
/* setup traffic classifier for receive side */
mutex_lock(&pf->tc_mutex);
err = ice_setup_tc_mqprio_qdisc(netdev, type_data);
mutex_unlock(&pf->tc_mutex);
+
+adev_unlock:
+ if (locked) {
+ device_unlock(&pf->adev->dev);
+ mutex_unlock(&pf->adev_mutex);
+ }
return err;
default:
return -EOPNOTSUPP;
--
2.38.1
Powered by blists - more mailing lists