Skip to content

Commit f25571b

Browse files
hramamu1Jeff Kirsher
authored andcommitted
i40e: fix configuration of RSS table with DCB
There exists a bug in the driver where the calculation of the RSS size was not taking into account the number of traffic classes enabled. This patch factors in the traffic classes both in the initial configuration of the table as well as reconfiguration. Change-ID: I34dcd345ce52faf1d6b9614bea28d450cfd5f621 Signed-off-by: Harshitha Ramamurthy <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 1793668 commit f25571b

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8577,9 +8577,12 @@ static int i40e_pf_config_rss(struct i40e_pf *pf)
85778577
i40e_write_rx_ctl(hw, I40E_PFQF_CTL_0, reg_val);
85788578

85798579
/* Determine the RSS size of the VSI */
8580-
if (!vsi->rss_size)
8581-
vsi->rss_size = min_t(int, pf->alloc_rss_size,
8582-
vsi->num_queue_pairs);
8580+
if (!vsi->rss_size) {
8581+
u16 qcount;
8582+
8583+
qcount = vsi->num_queue_pairs / vsi->tc_config.numtc;
8584+
vsi->rss_size = min_t(int, pf->alloc_rss_size, qcount);
8585+
}
85838586
if (!vsi->rss_size)
85848587
return -EINVAL;
85858588

@@ -8625,6 +8628,8 @@ int i40e_reconfig_rss_queues(struct i40e_pf *pf, int queue_count)
86258628
new_rss_size = min_t(int, queue_count, pf->rss_size_max);
86268629

86278630
if (queue_count != vsi->num_queue_pairs) {
8631+
u16 qcount;
8632+
86288633
vsi->req_queue_pairs = queue_count;
86298634
i40e_prep_for_reset(pf);
86308635

@@ -8642,8 +8647,8 @@ int i40e_reconfig_rss_queues(struct i40e_pf *pf, int queue_count)
86428647
}
86438648

86448649
/* Reset vsi->rss_size, as number of enabled queues changed */
8645-
vsi->rss_size = min_t(int, pf->alloc_rss_size,
8646-
vsi->num_queue_pairs);
8650+
qcount = vsi->num_queue_pairs / vsi->tc_config.numtc;
8651+
vsi->rss_size = min_t(int, pf->alloc_rss_size, qcount);
86478652

86488653
i40e_pf_config_rss(pf);
86498654
}

0 commit comments

Comments
 (0)