netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shailend Chand <shailend@google.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org,
	Shailend Chand <shailend@google.com>
Subject: [PATCH net-next] gve: Unify duplicate GQ min pkt desc size constants
Date: Fri,  7 Apr 2023 11:48:30 -0700	[thread overview]
Message-ID: <20230407184830.309398-1-shailend@google.com> (raw)

The two constants accomplish the same thing.

Signed-off-by: Shailend Chand <shailend@google.com>
---
 drivers/net/ethernet/google/gve/gve.h    | 2 --
 drivers/net/ethernet/google/gve/gve_tx.c | 4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/google/gve/gve.h b/drivers/net/ethernet/google/gve/gve.h
index 4d01c66d2d65..98eb78d98e9f 100644
--- a/drivers/net/ethernet/google/gve/gve.h
+++ b/drivers/net/ethernet/google/gve/gve.h
@@ -49,8 +49,6 @@
 
 #define GVE_XDP_ACTIONS 5
 
-#define GVE_TX_MAX_HEADER_SIZE 182
-
 #define GVE_GQ_TX_MIN_PKT_DESC_BYTES 182
 
 /* Each slot in the desc ring has a 1:1 mapping to a slot in the data ring */
diff --git a/drivers/net/ethernet/google/gve/gve_tx.c b/drivers/net/ethernet/google/gve/gve_tx.c
index fe6b933e1df1..813da572abca 100644
--- a/drivers/net/ethernet/google/gve/gve_tx.c
+++ b/drivers/net/ethernet/google/gve/gve_tx.c
@@ -730,7 +730,7 @@ static int gve_tx_fill_xdp(struct gve_priv *priv, struct gve_tx_ring *tx,
 	u32 reqi = tx->req;
 
 	pad = gve_tx_fifo_pad_alloc_one_frag(&tx->tx_fifo, len);
-	if (pad >= GVE_TX_MAX_HEADER_SIZE)
+	if (pad >= GVE_GQ_TX_MIN_PKT_DESC_BYTES)
 		pad = 0;
 	info = &tx->info[reqi & tx->mask];
 	info->xdp_frame = frame_p;
@@ -810,7 +810,7 @@ int gve_xdp_xmit_one(struct gve_priv *priv, struct gve_tx_ring *tx,
 {
 	int nsegs;
 
-	if (!gve_can_tx(tx, len + GVE_TX_MAX_HEADER_SIZE - 1))
+	if (!gve_can_tx(tx, len + GVE_GQ_TX_MIN_PKT_DESC_BYTES - 1))
 		return -EBUSY;
 
 	nsegs = gve_tx_fill_xdp(priv, tx, data, len, frame_p, false);
-- 
2.40.0.577.gac1e443424-goog


             reply	other threads:[~2023-04-07 18:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-07 18:48 Shailend Chand [this message]
2023-04-08  3:24 ` [PATCH net-next] gve: Unify duplicate GQ min pkt desc size constants Jakub Kicinski
2023-04-11 13:50 ` patchwork-bot+netdevbpf

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=20230407184830.309398-1-shailend@google.com \
    --to=shailend@google.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    /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).