Commit 4de00f0a authored by Shailend Chand's avatar Shailend Chand Committed by Paolo Abeni

gve: Unify duplicate GQ min pkt desc size constants

The two constants accomplish the same thing.
Signed-off-by: default avatarShailend Chand <shailend@google.com>
Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/20230407184830.309398-1-shailend@google.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent ebe3bdc4
...@@ -49,8 +49,6 @@ ...@@ -49,8 +49,6 @@
#define GVE_XDP_ACTIONS 5 #define GVE_XDP_ACTIONS 5
#define GVE_TX_MAX_HEADER_SIZE 182
#define GVE_GQ_TX_MIN_PKT_DESC_BYTES 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 */ /* Each slot in the desc ring has a 1:1 mapping to a slot in the data ring */
......
...@@ -730,7 +730,7 @@ static int gve_tx_fill_xdp(struct gve_priv *priv, struct gve_tx_ring *tx, ...@@ -730,7 +730,7 @@ static int gve_tx_fill_xdp(struct gve_priv *priv, struct gve_tx_ring *tx,
u32 reqi = tx->req; u32 reqi = tx->req;
pad = gve_tx_fifo_pad_alloc_one_frag(&tx->tx_fifo, len); 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; pad = 0;
info = &tx->info[reqi & tx->mask]; info = &tx->info[reqi & tx->mask];
info->xdp_frame = frame_p; info->xdp_frame = frame_p;
...@@ -810,7 +810,7 @@ int gve_xdp_xmit_one(struct gve_priv *priv, struct gve_tx_ring *tx, ...@@ -810,7 +810,7 @@ int gve_xdp_xmit_one(struct gve_priv *priv, struct gve_tx_ring *tx,
{ {
int nsegs; 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; return -EBUSY;
nsegs = gve_tx_fill_xdp(priv, tx, data, len, frame_p, false); nsegs = gve_tx_fill_xdp(priv, tx, data, len, frame_p, false);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment