]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ice: enforce RTNL assumption of queue NAPI manipulation
authorPrzemek Kitszel <przemyslaw.kitszel@intel.com>
Fri, 12 Sep 2025 13:06:19 +0000 (15:06 +0200)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Fri, 24 Oct 2025 18:10:44 +0000 (11:10 -0700)
Instead of making assumptions in comments move them into code.
Be also more precise, RTNL must be locked only when there is
NAPI, and we have VSIs w/o NAPI that call ice_vsi_clear_napi_queues()
during rmmod.

Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_lib.c

index 4479c824561e9b70a9161d20ba1b70a587cd0e34..69cb0381c4609532314c6a93d66618b2bb9f0c1a 100644 (file)
@@ -2769,7 +2769,6 @@ void ice_dis_vsi(struct ice_vsi *vsi, bool locked)
  * @vsi: VSI pointer
  *
  * Associate queue[s] with napi for all vectors.
- * The caller must hold rtnl_lock.
  */
 void ice_vsi_set_napi_queues(struct ice_vsi *vsi)
 {
@@ -2779,6 +2778,7 @@ void ice_vsi_set_napi_queues(struct ice_vsi *vsi)
        if (!netdev)
                return;
 
+       ASSERT_RTNL();
        ice_for_each_rxq(vsi, q_idx)
                netif_queue_set_napi(netdev, q_idx, NETDEV_QUEUE_TYPE_RX,
                                     &vsi->rx_rings[q_idx]->q_vector->napi);
@@ -2799,7 +2799,6 @@ void ice_vsi_set_napi_queues(struct ice_vsi *vsi)
  * @vsi: VSI pointer
  *
  * Clear the association between all VSI queues queue[s] and napi.
- * The caller must hold rtnl_lock.
  */
 void ice_vsi_clear_napi_queues(struct ice_vsi *vsi)
 {
@@ -2809,6 +2808,7 @@ void ice_vsi_clear_napi_queues(struct ice_vsi *vsi)
        if (!netdev)
                return;
 
+       ASSERT_RTNL();
        /* Clear the NAPI's interrupt number */
        ice_for_each_q_vector(vsi, v_idx) {
                struct ice_q_vector *q_vector = vsi->q_vectors[v_idx];