Skip to content

Commit 05702b5

Browse files
pkitszelanguy11
authored andcommitted
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 <[email protected]> Signed-off-by: Przemek Kitszel <[email protected]> Tested-by: Rafal Romanowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 257a824 commit 05702b5

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

drivers/net/ethernet/intel/iavf/iavf_ethtool.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#include <linux/bitfield.h>
55
#include <linux/uaccess.h>
66

7+
#include <net/netdev_lock.h>
8+
79
/* ethtool support for iavf */
810
#include "iavf.h"
911

@@ -1259,6 +1261,8 @@ static int iavf_add_fdir_ethtool(struct iavf_adapter *adapter, struct ethtool_rx
12591261
int count = 50;
12601262
int err;
12611263

1264+
netdev_assert_locked(adapter->netdev);
1265+
12621266
if (!(adapter->flags & IAVF_FLAG_FDIR_ENABLED))
12631267
return -EOPNOTSUPP;
12641268

@@ -1440,6 +1444,8 @@ iavf_set_adv_rss_hash_opt(struct iavf_adapter *adapter,
14401444
u64 hash_flds;
14411445
u32 hdrs;
14421446

1447+
netdev_assert_locked(adapter->netdev);
1448+
14431449
if (!ADV_RSS_SUPPORT(adapter))
14441450
return -EOPNOTSUPP;
14451451

drivers/net/ethernet/intel/iavf/iavf_main.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,6 +1292,8 @@ static void iavf_configure(struct iavf_adapter *adapter)
12921292
**/
12931293
static void iavf_up_complete(struct iavf_adapter *adapter)
12941294
{
1295+
netdev_assert_locked(adapter->netdev);
1296+
12951297
iavf_change_state(adapter, __IAVF_RUNNING);
12961298
clear_bit(__IAVF_VSI_DOWN, adapter->vsi.state);
12971299

@@ -1417,6 +1419,8 @@ void iavf_down(struct iavf_adapter *adapter)
14171419
{
14181420
struct net_device *netdev = adapter->netdev;
14191421

1422+
netdev_assert_locked(netdev);
1423+
14201424
if (adapter->state <= __IAVF_DOWN_PENDING)
14211425
return;
14221426

@@ -3078,6 +3082,8 @@ static void iavf_disable_vf(struct iavf_adapter *adapter)
30783082
struct iavf_vlan_filter *fv, *fvtmp;
30793083
struct iavf_cloud_filter *cf, *cftmp;
30803084

3085+
netdev_assert_locked(adapter->netdev);
3086+
30813087
adapter->flags |= IAVF_FLAG_PF_COMMS_FAILED;
30823088

30833089
/* 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,
51945200
struct iavf_ring *tx_ring;
51955201
int ret = 0;
51965202

5203+
netdev_assert_locked(adapter->netdev);
5204+
51975205
mutex_lock(&adapter->crit_lock);
51985206
if (handle->id >= adapter->num_active_queues)
51995207
goto unlock;
@@ -5222,6 +5230,8 @@ static int iavf_shaper_del(struct net_shaper_binding *binding,
52225230
struct iavf_adapter *adapter = netdev_priv(binding->netdev);
52235231
struct iavf_ring *tx_ring;
52245232

5233+
netdev_assert_locked(adapter->netdev);
5234+
52255235
mutex_lock(&adapter->crit_lock);
52265236
if (handle->id >= adapter->num_active_queues)
52275237
goto unlock;

0 commit comments

Comments
 (0)