gve: Unify duplicate GQ min pkt desc size constants
authorShailend Chand <shailend@google.com>
Fri, 7 Apr 2023 18:48:30 +0000 (11:48 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 11 Apr 2023 13:47:14 +0000 (15:47 +0200)
The two constants accomplish the same thing.

Signed-off-by: Shailend Chand <shailend@google.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/20230407184830.309398-1-shailend@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/google/gve/gve.h
drivers/net/ethernet/google/gve/gve_tx.c

index 4d01c66d2d65f649ce39ac2c6d72cea646b2b03d..98eb78d98e9f43c6e8541946d5398e9d7824005e 100644 (file)
@@ -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 */
index fe6b933e1df180bed2c26f6980a6580cf6fbd3bf..813da572abca2d198cc91eec85e740504b40d5a0 100644 (file)
@@ -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);