]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
iavf: sprinkle netdev_assert_locked() annotations
authorPrzemek Kitszel <przemyslaw.kitszel@intel.com>
Fri, 4 Apr 2025 10:23:20 +0000 (12:23 +0200)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 3 Jun 2025 16:48:03 +0000 (09:48 -0700)
Lockdep annotations help in general, but here it is extra good, as next
commit will remove crit lock.

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/iavf/iavf_ethtool.c
drivers/net/ethernet/intel/iavf/iavf_main.c

index 288bb5b2e72ef793bcdc40c71bb3e4c263031adf..03d86fe80ad9104af8bcd539b30dfa58717c1fcd 100644 (file)
@@ -4,6 +4,8 @@
 #include <linux/bitfield.h>
 #include <linux/uaccess.h>
 
+#include <net/netdev_lock.h>
+
 /* ethtool support for iavf */
 #include "iavf.h"
 
@@ -1259,6 +1261,8 @@ static int iavf_add_fdir_ethtool(struct iavf_adapter *adapter, struct ethtool_rx
        int count = 50;
        int err;
 
+       netdev_assert_locked(adapter->netdev);
+
        if (!(adapter->flags & IAVF_FLAG_FDIR_ENABLED))
                return -EOPNOTSUPP;
 
@@ -1440,6 +1444,8 @@ iavf_set_adv_rss_hash_opt(struct iavf_adapter *adapter,
        u64 hash_flds;
        u32 hdrs;
 
+       netdev_assert_locked(adapter->netdev);
+
        if (!ADV_RSS_SUPPORT(adapter))
                return -EOPNOTSUPP;
 
index 4b6963ffaba5f906b113885cc36824da5a8f1ccf..bf8c7baf2ab8ae31a2cb07f58f53c7beec40f173 100644 (file)
@@ -1292,6 +1292,8 @@ static void iavf_configure(struct iavf_adapter *adapter)
  **/
 static void iavf_up_complete(struct iavf_adapter *adapter)
 {
+       netdev_assert_locked(adapter->netdev);
+
        iavf_change_state(adapter, __IAVF_RUNNING);
        clear_bit(__IAVF_VSI_DOWN, adapter->vsi.state);
 
@@ -1417,6 +1419,8 @@ void iavf_down(struct iavf_adapter *adapter)
 {
        struct net_device *netdev = adapter->netdev;
 
+       netdev_assert_locked(netdev);
+
        if (adapter->state <= __IAVF_DOWN_PENDING)
                return;
 
@@ -3078,6 +3082,8 @@ static void iavf_disable_vf(struct iavf_adapter *adapter)
        struct iavf_vlan_filter *fv, *fvtmp;
        struct iavf_cloud_filter *cf, *cftmp;
 
+       netdev_assert_locked(adapter->netdev);
+
        adapter->flags |= IAVF_FLAG_PF_COMMS_FAILED;
 
        /* We don't use netif_running() because it may be true prior to
@@ -5194,6 +5200,8 @@ iavf_shaper_set(struct net_shaper_binding *binding,
        struct iavf_ring *tx_ring;
        int ret = 0;
 
+       netdev_assert_locked(adapter->netdev);
+
        mutex_lock(&adapter->crit_lock);
        if (handle->id >= adapter->num_active_queues)
                goto unlock;
@@ -5222,6 +5230,8 @@ static int iavf_shaper_del(struct net_shaper_binding *binding,
        struct iavf_adapter *adapter = netdev_priv(binding->netdev);
        struct iavf_ring *tx_ring;
 
+       netdev_assert_locked(adapter->netdev);
+
        mutex_lock(&adapter->crit_lock);
        if (handle->id >= adapter->num_active_queues)
                goto unlock;