* [Intel-wired-lan] [PATCH net-next] i40e: increase max descriptors for XL710
@ 2023-10-23 14:35 Justin Bronder
2023-10-23 14:40 ` Paul Menzel
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Justin Bronder @ 2023-10-23 14:35 UTC (permalink / raw)
To: intel-wired-lan; +Cc: Justin Bronder
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>
---
drivers/net/ethernet/intel/i40e/i40e.h | 1 +
.../net/ethernet/intel/i40e/i40e_ethtool.c | 23 +++++++++++++++----
2 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index 6e310a539467..ad261fa00d4c 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -50,6 +50,7 @@
#define I40E_MAX_VEB 16
#define I40E_MAX_NUM_DESCRIPTORS 4096
+#define I40E_MAX_NUM_DESCRIPTORS_XL710 8160
#define I40E_MAX_CSR_SPACE (4 * 1024 * 1024 - 64 * 1024)
#define I40E_DEFAULT_NUM_DESCRIPTORS 512
#define I40E_REQ_DESCRIPTOR_MULTIPLE 32
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index afc4fa8c66af..338c8f1acc1a 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -2013,6 +2013,18 @@ static void i40e_get_drvinfo(struct net_device *netdev,
drvinfo->n_priv_flags += I40E_GL_PRIV_FLAGS_STR_LEN;
}
+static u32 i40e_get_max_num_descriptors(struct i40e_pf *pf)
+{
+ struct i40e_hw *hw = &pf->hw;
+
+ switch (hw->mac.type) {
+ case I40E_MAC_XL710:
+ return I40E_MAX_NUM_DESCRIPTORS_XL710;
+ default:
+ return I40E_MAX_NUM_DESCRIPTORS;
+ }
+}
+
static void i40e_get_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ring,
struct kernel_ethtool_ringparam *kernel_ring,
@@ -2022,8 +2034,8 @@ static void i40e_get_ringparam(struct net_device *netdev,
struct i40e_pf *pf = np->vsi->back;
struct i40e_vsi *vsi = pf->vsi[pf->lan_vsi];
- ring->rx_max_pending = I40E_MAX_NUM_DESCRIPTORS;
- ring->tx_max_pending = I40E_MAX_NUM_DESCRIPTORS;
+ ring->rx_max_pending = i40e_get_max_num_descriptors(pf);
+ ring->tx_max_pending = i40e_get_max_num_descriptors(pf);
ring->rx_mini_max_pending = 0;
ring->rx_jumbo_max_pending = 0;
ring->rx_pending = vsi->rx_rings[0]->count;
@@ -2057,18 +2069,19 @@ static int i40e_set_ringparam(struct net_device *netdev,
u16 tx_alloc_queue_pairs;
int timeout = 50;
int i, err = 0;
+ u32 max_num_descriptors = i40e_get_max_num_descriptors(pf);
if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
return -EINVAL;
- if (ring->tx_pending > I40E_MAX_NUM_DESCRIPTORS ||
+ if (ring->tx_pending > max_num_descriptors ||
ring->tx_pending < I40E_MIN_NUM_DESCRIPTORS ||
- ring->rx_pending > I40E_MAX_NUM_DESCRIPTORS ||
+ ring->rx_pending > max_num_descriptors ||
ring->rx_pending < I40E_MIN_NUM_DESCRIPTORS) {
netdev_info(netdev,
"Descriptors requested (Tx: %d / Rx: %d) out of range [%d-%d]\n",
ring->tx_pending, ring->rx_pending,
- I40E_MIN_NUM_DESCRIPTORS, I40E_MAX_NUM_DESCRIPTORS);
+ I40E_MIN_NUM_DESCRIPTORS, max_num_descriptors);
return -EINVAL;
}
--
2.42.0
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Intel-wired-lan] [PATCH net-next] i40e: increase max descriptors for XL710
2023-10-23 14:35 [Intel-wired-lan] [PATCH net-next] i40e: increase max descriptors for XL710 Justin Bronder
@ 2023-10-23 14:40 ` Paul Menzel
2023-10-23 14:41 ` [Intel-wired-lan] " Justin Bronder
2023-10-31 10:38 ` [Intel-wired-lan] [PATCH net-next] " Pucha, HimasekharX Reddy
2 siblings, 0 replies; 4+ messages in thread
From: Paul Menzel @ 2023-10-23 14:40 UTC (permalink / raw)
To: Justin Bronder; +Cc: intel-wired-lan
Dear Justin,
Thank you for your patch.
Am 23.10.23 um 16:35 schrieb Justin Bronder:> 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.
Maybe state the problem more clearly, that currently a common macro is
defined for all models.
> Signed-off-by: Justin Bronder <jsbronder@cold-front.org>
> ---
> drivers/net/ethernet/intel/i40e/i40e.h | 1 +
> .../net/ethernet/intel/i40e/i40e_ethtool.c | 23 +++++++++++++++----
> 2 files changed, 19 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
> index 6e310a539467..ad261fa00d4c 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e.h
> +++ b/drivers/net/ethernet/intel/i40e/i40e.h
> @@ -50,6 +50,7 @@
> #define I40E_MAX_VEB 16
>
> #define I40E_MAX_NUM_DESCRIPTORS 4096
> +#define I40E_MAX_NUM_DESCRIPTORS_XL710 8160
> #define I40E_MAX_CSR_SPACE (4 * 1024 * 1024 - 64 * 1024)
> #define I40E_DEFAULT_NUM_DESCRIPTORS 512
> #define I40E_REQ_DESCRIPTOR_MULTIPLE 32
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> index afc4fa8c66af..338c8f1acc1a 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> @@ -2013,6 +2013,18 @@ static void i40e_get_drvinfo(struct net_device *netdev,
> drvinfo->n_priv_flags += I40E_GL_PRIV_FLAGS_STR_LEN;
> }
>
> +static u32 i40e_get_max_num_descriptors(struct i40e_pf *pf)
I’d use `unsigned int` as typo of the return value.
> +{
> + struct i40e_hw *hw = &pf->hw;
> +
> + switch (hw->mac.type) {
> + case I40E_MAC_XL710:
> + return I40E_MAX_NUM_DESCRIPTORS_XL710;
> + default:
> + return I40E_MAX_NUM_DESCRIPTORS;
> + }
> +}
> +
> static void i40e_get_ringparam(struct net_device *netdev,
> struct ethtool_ringparam *ring,
> struct kernel_ethtool_ringparam *kernel_ring,
> @@ -2022,8 +2034,8 @@ static void i40e_get_ringparam(struct net_device *netdev,
> struct i40e_pf *pf = np->vsi->back;
> struct i40e_vsi *vsi = pf->vsi[pf->lan_vsi];
>
> - ring->rx_max_pending = I40E_MAX_NUM_DESCRIPTORS;
> - ring->tx_max_pending = I40E_MAX_NUM_DESCRIPTORS;
> + ring->rx_max_pending = i40e_get_max_num_descriptors(pf);
> + ring->tx_max_pending = i40e_get_max_num_descriptors(pf);
> ring->rx_mini_max_pending = 0;
> ring->rx_jumbo_max_pending = 0;
> ring->rx_pending = vsi->rx_rings[0]->count;
> @@ -2057,18 +2069,19 @@ static int i40e_set_ringparam(struct net_device *netdev,
> u16 tx_alloc_queue_pairs;
> int timeout = 50;
> int i, err = 0;
> + u32 max_num_descriptors = i40e_get_max_num_descriptors(pf);
>
> if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
> return -EINVAL;
>
> - if (ring->tx_pending > I40E_MAX_NUM_DESCRIPTORS ||
> + if (ring->tx_pending > max_num_descriptors ||
> ring->tx_pending < I40E_MIN_NUM_DESCRIPTORS ||
> - ring->rx_pending > I40E_MAX_NUM_DESCRIPTORS ||
> + ring->rx_pending > max_num_descriptors ||
> ring->rx_pending < I40E_MIN_NUM_DESCRIPTORS) {
> netdev_info(netdev,
> "Descriptors requested (Tx: %d / Rx: %d) out of range [%d-%d]\n",
> ring->tx_pending, ring->rx_pending,
> - I40E_MIN_NUM_DESCRIPTORS, I40E_MAX_NUM_DESCRIPTORS);
> + I40E_MIN_NUM_DESCRIPTORS, max_num_descriptors);
> return -EINVAL;
> }
Kind regards,
Paul
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Intel-wired-lan] i40e: increase max descriptors for XL710
2023-10-23 14:35 [Intel-wired-lan] [PATCH net-next] i40e: increase max descriptors for XL710 Justin Bronder
2023-10-23 14:40 ` Paul Menzel
@ 2023-10-23 14:41 ` Justin Bronder
2023-10-31 10:38 ` [Intel-wired-lan] [PATCH net-next] " Pucha, HimasekharX Reddy
2 siblings, 0 replies; 4+ messages in thread
From: Justin Bronder @ 2023-10-23 14:41 UTC (permalink / raw)
To: intel-wired-lan
My apologies I didn't notice my last email did get moderator approval and made it to the list. Please ignore this email.
On 23/10/23 10:35 -0400, Justin Bronder wrote:
> 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>
> ---
> drivers/net/ethernet/intel/i40e/i40e.h | 1 +
> .../net/ethernet/intel/i40e/i40e_ethtool.c | 23 +++++++++++++++----
> 2 files changed, 19 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
> index 6e310a539467..ad261fa00d4c 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e.h
> +++ b/drivers/net/ethernet/intel/i40e/i40e.h
> @@ -50,6 +50,7 @@
> #define I40E_MAX_VEB 16
>
> #define I40E_MAX_NUM_DESCRIPTORS 4096
> +#define I40E_MAX_NUM_DESCRIPTORS_XL710 8160
> #define I40E_MAX_CSR_SPACE (4 * 1024 * 1024 - 64 * 1024)
> #define I40E_DEFAULT_NUM_DESCRIPTORS 512
> #define I40E_REQ_DESCRIPTOR_MULTIPLE 32
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> index afc4fa8c66af..338c8f1acc1a 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> @@ -2013,6 +2013,18 @@ static void i40e_get_drvinfo(struct net_device *netdev,
> drvinfo->n_priv_flags += I40E_GL_PRIV_FLAGS_STR_LEN;
> }
>
> +static u32 i40e_get_max_num_descriptors(struct i40e_pf *pf)
> +{
> + struct i40e_hw *hw = &pf->hw;
> +
> + switch (hw->mac.type) {
> + case I40E_MAC_XL710:
> + return I40E_MAX_NUM_DESCRIPTORS_XL710;
> + default:
> + return I40E_MAX_NUM_DESCRIPTORS;
> + }
> +}
> +
> static void i40e_get_ringparam(struct net_device *netdev,
> struct ethtool_ringparam *ring,
> struct kernel_ethtool_ringparam *kernel_ring,
> @@ -2022,8 +2034,8 @@ static void i40e_get_ringparam(struct net_device *netdev,
> struct i40e_pf *pf = np->vsi->back;
> struct i40e_vsi *vsi = pf->vsi[pf->lan_vsi];
>
> - ring->rx_max_pending = I40E_MAX_NUM_DESCRIPTORS;
> - ring->tx_max_pending = I40E_MAX_NUM_DESCRIPTORS;
> + ring->rx_max_pending = i40e_get_max_num_descriptors(pf);
> + ring->tx_max_pending = i40e_get_max_num_descriptors(pf);
> ring->rx_mini_max_pending = 0;
> ring->rx_jumbo_max_pending = 0;
> ring->rx_pending = vsi->rx_rings[0]->count;
> @@ -2057,18 +2069,19 @@ static int i40e_set_ringparam(struct net_device *netdev,
> u16 tx_alloc_queue_pairs;
> int timeout = 50;
> int i, err = 0;
> + u32 max_num_descriptors = i40e_get_max_num_descriptors(pf);
>
> if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
> return -EINVAL;
>
> - if (ring->tx_pending > I40E_MAX_NUM_DESCRIPTORS ||
> + if (ring->tx_pending > max_num_descriptors ||
> ring->tx_pending < I40E_MIN_NUM_DESCRIPTORS ||
> - ring->rx_pending > I40E_MAX_NUM_DESCRIPTORS ||
> + ring->rx_pending > max_num_descriptors ||
> ring->rx_pending < I40E_MIN_NUM_DESCRIPTORS) {
> netdev_info(netdev,
> "Descriptors requested (Tx: %d / Rx: %d) out of range [%d-%d]\n",
> ring->tx_pending, ring->rx_pending,
> - I40E_MIN_NUM_DESCRIPTORS, I40E_MAX_NUM_DESCRIPTORS);
> + I40E_MIN_NUM_DESCRIPTORS, max_num_descriptors);
> return -EINVAL;
> }
>
> --
> 2.42.0
>
--
Justin Bronder
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Intel-wired-lan] [PATCH net-next] i40e: increase max descriptors for XL710
2023-10-23 14:35 [Intel-wired-lan] [PATCH net-next] i40e: increase max descriptors for XL710 Justin Bronder
2023-10-23 14:40 ` Paul Menzel
2023-10-23 14:41 ` [Intel-wired-lan] " Justin Bronder
@ 2023-10-31 10:38 ` Pucha, HimasekharX Reddy
2 siblings, 0 replies; 4+ messages in thread
From: Pucha, HimasekharX Reddy @ 2023-10-31 10:38 UTC (permalink / raw)
To: Justin Bronder, intel-wired-lan@lists.osuosl.org
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of Justin Bronder
> Sent: Monday, October 23, 2023 8:06 PM
> To: intel-wired-lan@lists.osuosl.org
> Cc: Justin Bronder <jsbronder@cold-front.org>
> Subject: [Intel-wired-lan] [PATCH net-next] 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>
> ---
> drivers/net/ethernet/intel/i40e/i40e.h | 1 +
> .../net/ethernet/intel/i40e/i40e_ethtool.c | 23 +++++++++++++++----
> 2 files changed, 19 insertions(+), 5 deletions(-)
>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-10-31 10:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-23 14:35 [Intel-wired-lan] [PATCH net-next] i40e: increase max descriptors for XL710 Justin Bronder
2023-10-23 14:40 ` Paul Menzel
2023-10-23 14:41 ` [Intel-wired-lan] " Justin Bronder
2023-10-31 10:38 ` [Intel-wired-lan] [PATCH net-next] " Pucha, HimasekharX Reddy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox