]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bnxt_en: Use short TX BDs for the XDP TX ring.
authorMichael Chan <michael.chan@broadcom.com>
Tue, 4 Apr 2017 22:14:16 +0000 (18:14 -0400)
committerBrian Maly <brian.maly@oracle.com>
Mon, 8 Oct 2018 16:20:48 +0000 (12:20 -0400)
No offload is performed on the XDP_TX ring so we can use the short TX
BDs.  This has the effect of doubling the size of the XDP TX ring so
that it now matches the size of the rx ring by default.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 932dbf83ba18bdb871e0c03a4ffdd9785f7a9c07)
Orabug: 27988326

Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Reviewed-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c

index dba47894ed78016c35d73886feb78b9376012bde..bfd58cbcb4a34e81758075ebc4d9d6c998667363 100644 (file)
@@ -27,7 +27,6 @@ void bnxt_xmit_xdp(struct bnxt *bp, struct bnxt_tx_ring_info *txr,
                   dma_addr_t mapping, u32 len, u16 rx_prod)
 {
        struct bnxt_sw_tx_bd *tx_buf;
-       struct tx_bd_ext *txbd1;
        struct tx_bd *txbd;
        u32 flags;
        u16 prod;
@@ -37,22 +36,12 @@ void bnxt_xmit_xdp(struct bnxt *bp, struct bnxt_tx_ring_info *txr,
        tx_buf->rx_prod = rx_prod;
 
        txbd = &txr->tx_desc_ring[TX_RING(prod)][TX_IDX(prod)];
-       flags = (len << TX_BD_LEN_SHIFT) | TX_BD_TYPE_LONG_TX_BD |
-               (2 << TX_BD_FLAGS_BD_CNT_SHIFT) | TX_BD_FLAGS_COAL_NOW |
+       flags = (len << TX_BD_LEN_SHIFT) | (1 << TX_BD_FLAGS_BD_CNT_SHIFT) |
                TX_BD_FLAGS_PACKET_END | bnxt_lhint_arr[len >> 9];
        txbd->tx_bd_len_flags_type = cpu_to_le32(flags);
        txbd->tx_bd_opaque = prod;
        txbd->tx_bd_haddr = cpu_to_le64(mapping);
 
-       prod = NEXT_TX(prod);
-       txbd1 = (struct tx_bd_ext *)
-               &txr->tx_desc_ring[TX_RING(prod)][TX_IDX(prod)];
-
-       txbd1->tx_bd_hsize_lflags = cpu_to_le32(0);
-       txbd1->tx_bd_mss = cpu_to_le32(0);
-       txbd1->tx_bd_cfa_action = cpu_to_le32(0);
-       txbd1->tx_bd_cfa_meta = cpu_to_le32(0);
-
        prod = NEXT_TX(prod);
        txr->tx_prod = prod;
 }
@@ -71,7 +60,6 @@ void bnxt_tx_int_xdp(struct bnxt *bp, struct bnxt_napi *bnapi, int nr_pkts)
        for (i = 0; i < nr_pkts; i++) {
                last_tx_cons = tx_cons;
                tx_cons = NEXT_TX(tx_cons);
-               tx_cons = NEXT_TX(tx_cons);
        }
        txr->tx_cons = tx_cons;
        if (bnxt_tx_avail(bp, txr) == bp->tx_ring_size) {
@@ -138,7 +126,7 @@ bool bnxt_rx_xdp(struct bnxt *bp, struct bnxt_rx_ring_info *rxr, u16 cons,
                return false;
 
        case XDP_TX:
-               if (tx_avail < 2) {
+               if (tx_avail < 1) {
                        trace_xdp_exception(bp->dev, xdp_prog, act);
                        bnxt_reuse_rx_data(rxr, cons, page);
                        return true;