Skip to content

Commit 6619585

Browse files
TaeheeYookuba-moo
authored andcommitted
eth: bnxt: do not use BNXT_VNIC_NTUPLE unconditionally in queue restart logic
When a queue is restarted, it sets MRU to 0 for stopping packet flow. MRU variable is a member of vnic_info[], the first vnic_info is default and the second is ntuple. Only when ntuple is enabled(ethtool -K eth0 ntuple on), vnic_info for ntuple is allocated in init logic. The bp->nr_vnics indicates how many vnic_info are allocated. However bnxt_queue_{start | stop}() accesses vnic_info[BNXT_VNIC_NTUPLE] regardless of ntuple state. Reviewed-by: Somnath Kotur <[email protected]> Fixes: b9d2956 ("bnxt_en: stop packet flow during bnxt_queue_stop/start") Signed-off-by: Taehee Yoo <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ca2456e commit 6619585

File tree

1 file changed

+2
-2
lines changed
  • drivers/net/ethernet/broadcom/bnxt

1 file changed

+2
-2
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15643,7 +15643,7 @@ static int bnxt_queue_start(struct net_device *dev, void *qmem, int idx)
1564315643
cpr = &rxr->bnapi->cp_ring;
1564415644
cpr->sw_stats->rx.rx_resets++;
1564515645

15646-
for (i = 0; i <= BNXT_VNIC_NTUPLE; i++) {
15646+
for (i = 0; i <= bp->nr_vnics; i++) {
1564715647
vnic = &bp->vnic_info[i];
1564815648

1564915649
rc = bnxt_hwrm_vnic_set_rss_p5(bp, vnic, true);
@@ -15671,7 +15671,7 @@ static int bnxt_queue_stop(struct net_device *dev, void *qmem, int idx)
1567115671
struct bnxt_vnic_info *vnic;
1567215672
int i;
1567315673

15674-
for (i = 0; i <= BNXT_VNIC_NTUPLE; i++) {
15674+
for (i = 0; i <= bp->nr_vnics; i++) {
1567515675
vnic = &bp->vnic_info[i];
1567615676
vnic->mru = 0;
1567715677
bnxt_hwrm_vnic_update(bp, vnic,

0 commit comments

Comments
 (0)