Skip to content

Commit 3256d29

Browse files
Govindarajulu Varadarajandavem330
Govindarajulu Varadarajan
authored andcommitted
enic: initialize enic->rfs_h.lock in enic_probe
lockdep spotted that we are using rfs_h.lock in enic_get_rxnfc() without initializing. rfs_h.lock is initialized in enic_open(). But ethtool_ops can be called when interface is down. Move enic_rfs_flw_tbl_init to enic_probe. INFO: trying to register non-static key. the code is fine but needs lockdep annotation. turning off the locking correctness validator. CPU: 18 PID: 1189 Comm: ethtool Not tainted 4.17.0-rc7-devel+ hardkernel#27 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.0-20171110_100015-anatol 04/01/2014 Call Trace: dump_stack+0x85/0xc0 register_lock_class+0x550/0x560 ? __handle_mm_fault+0xa8b/0x1100 __lock_acquire+0x81/0x670 lock_acquire+0xb9/0x1e0 ? enic_get_rxnfc+0x139/0x2b0 [enic] _raw_spin_lock_bh+0x38/0x80 ? enic_get_rxnfc+0x139/0x2b0 [enic] enic_get_rxnfc+0x139/0x2b0 [enic] ethtool_get_rxnfc+0x8d/0x1c0 dev_ethtool+0x16c8/0x2400 ? __mutex_lock+0x64d/0xa00 ? dev_load+0x6a/0x150 dev_ioctl+0x253/0x4b0 sock_do_ioctl+0x9a/0x130 sock_ioctl+0x1af/0x350 do_vfs_ioctl+0x8e/0x670 ? syscall_trace_enter+0x1e2/0x380 ksys_ioctl+0x60/0x90 __x64_sys_ioctl+0x16/0x20 do_syscall_64+0x5a/0x170 entry_SYSCALL_64_after_hwframe+0x49/0xbe Signed-off-by: Govindarajulu Varadarajan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d1a65e2 commit 3256d29

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

drivers/net/ethernet/cisco/enic/enic_clsf.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ void enic_rfs_flw_tbl_init(struct enic *enic)
7979
enic->rfs_h.max = enic->config.num_arfs;
8080
enic->rfs_h.free = enic->rfs_h.max;
8181
enic->rfs_h.toclean = 0;
82-
enic_rfs_timer_start(enic);
8382
}
8483

8584
void enic_rfs_flw_tbl_free(struct enic *enic)
@@ -88,7 +87,6 @@ void enic_rfs_flw_tbl_free(struct enic *enic)
8887

8988
enic_rfs_timer_stop(enic);
9089
spin_lock_bh(&enic->rfs_h.lock);
91-
enic->rfs_h.free = 0;
9290
for (i = 0; i < (1 << ENIC_RFS_FLW_BITSHIFT); i++) {
9391
struct hlist_head *hhead;
9492
struct hlist_node *tmp;
@@ -99,6 +97,7 @@ void enic_rfs_flw_tbl_free(struct enic *enic)
9997
enic_delfltr(enic, n->fltr_id);
10098
hlist_del(&n->node);
10199
kfree(n);
100+
enic->rfs_h.free++;
102101
}
103102
}
104103
spin_unlock_bh(&enic->rfs_h.lock);

drivers/net/ethernet/cisco/enic/enic_main.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1971,7 +1971,7 @@ static int enic_open(struct net_device *netdev)
19711971
vnic_intr_unmask(&enic->intr[i]);
19721972

19731973
enic_notify_timer_start(enic);
1974-
enic_rfs_flw_tbl_init(enic);
1974+
enic_rfs_timer_start(enic);
19751975

19761976
return 0;
19771977

@@ -2904,6 +2904,7 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
29042904

29052905
timer_setup(&enic->notify_timer, enic_notify_timer, 0);
29062906

2907+
enic_rfs_flw_tbl_init(enic);
29072908
enic_set_rx_coal_setting(enic);
29082909
INIT_WORK(&enic->reset, enic_reset);
29092910
INIT_WORK(&enic->tx_hang_reset, enic_tx_hang_reset);

0 commit comments

Comments
 (0)