Skip to content

Commit bc6d33c

Browse files
anambiarindavem330
authored andcommitted
i40e: Fix the number of queues available to be mapped for use
Fix the number of queues per enabled TC and report available queues to the kernel without having to limit them to the max RSS limit so they are available to be mapped for XPS. This allows a queue per processing thread available for handling traffic for the given traffic class. Signed-off-by: Amritha Nambiar <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 44750f8 commit bc6d33c

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

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

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1785,7 +1785,7 @@ static void i40e_vsi_setup_queue_map(struct i40e_vsi *vsi,
17851785
struct i40e_pf *pf = vsi->back;
17861786
u16 sections = 0;
17871787
u8 netdev_tc = 0;
1788-
u16 numtc = 0;
1788+
u16 numtc = 1;
17891789
u16 qcount;
17901790
u8 offset;
17911791
u16 qmap;
@@ -1795,28 +1795,25 @@ static void i40e_vsi_setup_queue_map(struct i40e_vsi *vsi,
17951795
sections = I40E_AQ_VSI_PROP_QUEUE_MAP_VALID;
17961796
offset = 0;
17971797

1798+
/* Number of queues per enabled TC */
1799+
num_tc_qps = vsi->alloc_queue_pairs;
17981800
if (enabled_tc && (vsi->back->flags & I40E_FLAG_DCB_ENABLED)) {
17991801
/* Find numtc from enabled TC bitmap */
1800-
for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
1802+
for (i = 0, numtc = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
18011803
if (enabled_tc & BIT(i)) /* TC is enabled */
18021804
numtc++;
18031805
}
18041806
if (!numtc) {
18051807
dev_warn(&pf->pdev->dev, "DCB is enabled but no TC enabled, forcing TC0\n");
18061808
numtc = 1;
18071809
}
1808-
} else {
1809-
/* At least TC0 is enabled in non-DCB, non-MQPRIO case */
1810-
numtc = 1;
1810+
num_tc_qps = num_tc_qps / numtc;
1811+
num_tc_qps = min_t(int, num_tc_qps,
1812+
i40e_pf_get_max_q_per_tc(pf));
18111813
}
18121814

18131815
vsi->tc_config.numtc = numtc;
18141816
vsi->tc_config.enabled_tc = enabled_tc ? enabled_tc : 1;
1815-
/* Number of queues per enabled TC */
1816-
qcount = vsi->alloc_queue_pairs;
1817-
1818-
num_tc_qps = qcount / numtc;
1819-
num_tc_qps = min_t(int, num_tc_qps, i40e_pf_get_max_q_per_tc(pf));
18201817

18211818
/* Do not allow use more TC queue pairs than MSI-X vectors exist */
18221819
if (pf->flags & I40E_FLAG_MSIX_ENABLED)
@@ -1831,9 +1828,13 @@ static void i40e_vsi_setup_queue_map(struct i40e_vsi *vsi,
18311828

18321829
switch (vsi->type) {
18331830
case I40E_VSI_MAIN:
1834-
qcount = min_t(int, pf->alloc_rss_size,
1835-
num_tc_qps);
1836-
break;
1831+
if (!(pf->flags & (I40E_FLAG_FD_SB_ENABLED |
1832+
I40E_FLAG_FD_ATR_ENABLED)) ||
1833+
vsi->tc_config.enabled_tc != 1) {
1834+
qcount = min_t(int, pf->alloc_rss_size,
1835+
num_tc_qps);
1836+
break;
1837+
}
18371838
case I40E_VSI_FDIR:
18381839
case I40E_VSI_SRIOV:
18391840
case I40E_VSI_VMDQ2:

0 commit comments

Comments
 (0)