DPDK patches and discussions
 help / color / mirror / Atom feed
From: Joshua Washington <joshwash@google.com>
To: Jeroen de Borst <jeroendb@google.com>,
	Rushil Gupta <rushilg@google.com>,
	 Joshua Washington <joshwash@google.com>
Cc: dev@dpdk.org, Ferruh Yigit <ferruh.yigit@amd.com>,
	 Harshitha Ramamurthy <hramamurthy@google.com>
Subject: [PATCH 2/4] net/gve: remove explicit field for Rx pages per QPL
Date: Wed, 17 Jul 2024 10:56:17 -0700	[thread overview]
Message-ID: <20240717175619.3159026-3-joshwash@google.com> (raw)
In-Reply-To: <20240717175619.3159026-1-joshwash@google.com>

priv->rx_data_slot_cnt is a field that holds the number of pages per RX
QPL as passed by the device. With the modify ring size feature, this
field no longer makes sense, as there is a clearly defined relationship
on GQ between the ring size and the number of pages per RX QPL (1:1). As
such, when a user modifies the ring size, this value would be useless,
as the ring size dictates the number of pages in the QPL, and each QPL
"knows" how many pages it holds.

tx_pages_per_qpl is unaffected by this because TX rings use a static
number of pages per QPL.

Signed-off-by: Joshua Washington <joshwash@google.com>
Reviewed-by: Rushil Gupta <rushilg@google.com>
Reviewed-by: Harshitha Ramamurthy <hramamurthy@google.com>
---
 drivers/net/gve/base/gve_adminq.c | 7 -------
 drivers/net/gve/gve_ethdev.h      | 3 +--
 drivers/net/gve/gve_rx.c          | 2 +-
 3 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/net/gve/base/gve_adminq.c b/drivers/net/gve/base/gve_adminq.c
index eb8bed0d9b..c25fefbd0f 100644
--- a/drivers/net/gve/base/gve_adminq.c
+++ b/drivers/net/gve/base/gve_adminq.c
@@ -837,14 +837,7 @@ int gve_adminq_describe_device(struct gve_priv *priv)
 	PMD_DRV_LOG(INFO, "MAC addr: " RTE_ETHER_ADDR_PRT_FMT,
 		    RTE_ETHER_ADDR_BYTES(&priv->dev_addr));
 	priv->tx_pages_per_qpl = be16_to_cpu(descriptor->tx_pages_per_qpl);
-	priv->rx_data_slot_cnt = be16_to_cpu(descriptor->rx_pages_per_qpl);
 
-	if (gve_is_gqi(priv) && priv->rx_data_slot_cnt < priv->rx_desc_cnt) {
-		PMD_DRV_LOG(ERR,
-			    "rx_data_slot_cnt cannot be smaller than rx_desc_cnt, setting rx_desc_cnt down to %d",
-			    priv->rx_data_slot_cnt);
-		priv->rx_desc_cnt = priv->rx_data_slot_cnt;
-	}
 	priv->default_num_queues = be16_to_cpu(descriptor->default_num_queues);
 
 	gve_enable_supported_features(priv, supported_features_mask,
diff --git a/drivers/net/gve/gve_ethdev.h b/drivers/net/gve/gve_ethdev.h
index 1731c2ab93..393a4362c9 100644
--- a/drivers/net/gve/gve_ethdev.h
+++ b/drivers/net/gve/gve_ethdev.h
@@ -238,8 +238,7 @@ struct gve_priv {
 	uint16_t max_rx_desc_cnt;
 	uint16_t tx_desc_cnt; /* txq size */
 	uint16_t rx_desc_cnt; /* rxq size */
-	uint16_t tx_pages_per_qpl; /* tx buffer length */
-	uint16_t rx_data_slot_cnt; /* rx buffer length */
+	uint16_t tx_pages_per_qpl;
 
 	/* Only valid for DQO_RDA queue format */
 	uint16_t tx_compq_size; /* tx completion queue size */
diff --git a/drivers/net/gve/gve_rx.c b/drivers/net/gve/gve_rx.c
index 41987ec870..d2c6920406 100644
--- a/drivers/net/gve/gve_rx.c
+++ b/drivers/net/gve/gve_rx.c
@@ -386,7 +386,7 @@ gve_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
 	/* Allocate and register QPL for the queue. */
 	if (rxq->is_gqi_qpl) {
 		rxq->qpl = gve_setup_queue_page_list(hw, queue_id, true,
-						     hw->rx_data_slot_cnt);
+						     nb_desc);
 		if (!rxq->qpl) {
 			PMD_DRV_LOG(ERR,
 				    "Failed to alloc rx qpl for queue %hu.",
-- 
2.45.2.803.g4e1b14247a-goog


  parent reply	other threads:[~2024-07-17 17:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-17 17:56 [PATCH 0/4] gve GQ ring size modification Joshua Washington
2024-07-17 17:56 ` [PATCH 1/4] net/gve: add ring size device option Joshua Washington
2024-07-17 17:56 ` Joshua Washington [this message]
2024-07-17 17:56 ` [PATCH 3/4] net/gve: add min ring size support Joshua Washington
2024-07-17 17:56 ` [PATCH 4/4] net/gve: add ability to modify ring size in GQ format Joshua Washington
2024-07-19 18:59 ` [PATCH 0/4] gve GQ ring size modification Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240717175619.3159026-3-joshwash@google.com \
    --to=joshwash@google.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=hramamurthy@google.com \
    --cc=jeroendb@google.com \
    --cc=rushilg@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).