Skip to content

Commit aa6908c

Browse files
jsbronderkuba-moo
authored andcommitted
i40e: increase max descriptors for XL710
In Tables 8-12 and 8-22 in the X710/XXV710/XL710 datasheet, the QLEN description states that the maximum size of the descriptor queue is 8k minus 32, or 8160. Signed-off-by: Justin Bronder <jsbronder@cold-front.org> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> Link: https://lore.kernel.org/r/20231113231047.548659-2-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 8fedaac commit aa6908c

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

drivers/net/ethernet/intel/i40e/i40e.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#define I40E_MAX_VEB 16
2525

2626
#define I40E_MAX_NUM_DESCRIPTORS 4096
27+
#define I40E_MAX_NUM_DESCRIPTORS_XL710 8160
2728
#define I40E_MAX_CSR_SPACE (4 * 1024 * 1024 - 64 * 1024)
2829
#define I40E_DEFAULT_NUM_DESCRIPTORS 512
2930
#define I40E_REQ_DESCRIPTOR_MULTIPLE 32

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

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2015,6 +2015,18 @@ static void i40e_get_drvinfo(struct net_device *netdev,
20152015
drvinfo->n_priv_flags += I40E_GL_PRIV_FLAGS_STR_LEN;
20162016
}
20172017

2018+
static u32 i40e_get_max_num_descriptors(struct i40e_pf *pf)
2019+
{
2020+
struct i40e_hw *hw = &pf->hw;
2021+
2022+
switch (hw->mac.type) {
2023+
case I40E_MAC_XL710:
2024+
return I40E_MAX_NUM_DESCRIPTORS_XL710;
2025+
default:
2026+
return I40E_MAX_NUM_DESCRIPTORS;
2027+
}
2028+
}
2029+
20182030
static void i40e_get_ringparam(struct net_device *netdev,
20192031
struct ethtool_ringparam *ring,
20202032
struct kernel_ethtool_ringparam *kernel_ring,
@@ -2024,8 +2036,8 @@ static void i40e_get_ringparam(struct net_device *netdev,
20242036
struct i40e_pf *pf = np->vsi->back;
20252037
struct i40e_vsi *vsi = pf->vsi[pf->lan_vsi];
20262038

2027-
ring->rx_max_pending = I40E_MAX_NUM_DESCRIPTORS;
2028-
ring->tx_max_pending = I40E_MAX_NUM_DESCRIPTORS;
2039+
ring->rx_max_pending = i40e_get_max_num_descriptors(pf);
2040+
ring->tx_max_pending = i40e_get_max_num_descriptors(pf);
20292041
ring->rx_mini_max_pending = 0;
20302042
ring->rx_jumbo_max_pending = 0;
20312043
ring->rx_pending = vsi->rx_rings[0]->count;
@@ -2050,27 +2062,28 @@ static int i40e_set_ringparam(struct net_device *netdev,
20502062
struct kernel_ethtool_ringparam *kernel_ring,
20512063
struct netlink_ext_ack *extack)
20522064
{
2065+
u32 new_rx_count, new_tx_count, max_num_descriptors;
20532066
struct i40e_ring *tx_rings = NULL, *rx_rings = NULL;
20542067
struct i40e_netdev_priv *np = netdev_priv(netdev);
20552068
struct i40e_hw *hw = &np->vsi->back->hw;
20562069
struct i40e_vsi *vsi = np->vsi;
20572070
struct i40e_pf *pf = vsi->back;
2058-
u32 new_rx_count, new_tx_count;
20592071
u16 tx_alloc_queue_pairs;
20602072
int timeout = 50;
20612073
int i, err = 0;
20622074

20632075
if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
20642076
return -EINVAL;
20652077

2066-
if (ring->tx_pending > I40E_MAX_NUM_DESCRIPTORS ||
2078+
max_num_descriptors = i40e_get_max_num_descriptors(pf);
2079+
if (ring->tx_pending > max_num_descriptors ||
20672080
ring->tx_pending < I40E_MIN_NUM_DESCRIPTORS ||
2068-
ring->rx_pending > I40E_MAX_NUM_DESCRIPTORS ||
2081+
ring->rx_pending > max_num_descriptors ||
20692082
ring->rx_pending < I40E_MIN_NUM_DESCRIPTORS) {
20702083
netdev_info(netdev,
20712084
"Descriptors requested (Tx: %d / Rx: %d) out of range [%d-%d]\n",
20722085
ring->tx_pending, ring->rx_pending,
2073-
I40E_MIN_NUM_DESCRIPTORS, I40E_MAX_NUM_DESCRIPTORS);
2086+
I40E_MIN_NUM_DESCRIPTORS, max_num_descriptors);
20742087
return -EINVAL;
20752088
}
20762089

0 commit comments

Comments
 (0)