iavf: sprinkle netdev_assert_locked() annotations

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>
This commit is contained in:
Przemek Kitszel 2025-04-04 12:23:20 +02:00 committed by Tony Nguyen
parent 257a8241ad
commit 05702b5c94
2 changed files with 16 additions and 0 deletions

View 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;

View 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;