X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Focteontx2%2Fotx2_tx.c;h=ff299f00b9139d6a3a6bc34e3fa4ee0e80d50212;hb=90bbd7d9545f88ac11f8b89449ad7fd799adbfba;hp=4f2036cb4591521beb018fc09526eb2567774893;hpb=77791f626f64b3f7a91482316241167967067f23;p=dpdk.git diff --git a/drivers/net/octeontx2/otx2_tx.c b/drivers/net/octeontx2/otx2_tx.c index 4f2036cb45..ff299f00b9 100644 --- a/drivers/net/octeontx2/otx2_tx.c +++ b/drivers/net/octeontx2/otx2_tx.c @@ -27,6 +27,7 @@ nix_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, struct otx2_eth_txq *txq = tx_queue; uint16_t i; const rte_iova_t io_addr = txq->io_addr; void *lmt_addr = txq->lmt_addr; + uint64_t lso_tun_fmt; NIX_XMIT_FC_OR_RETURN(txq, pkts); @@ -34,15 +35,19 @@ nix_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, /* Perform header writes before barrier for TSO */ if (flags & NIX_TX_OFFLOAD_TSO_F) { + lso_tun_fmt = txq->lso_tun_fmt; for (i = 0; i < pkts; i++) otx2_nix_xmit_prepare_tso(tx_pkts[i], flags); } - /* Lets commit any changes in the packet */ - rte_cio_wmb(); + /* Lets commit any changes in the packet here as no further changes + * to the packet will be done unless no fast free is enabled. + */ + if (!(flags & NIX_TX_OFFLOAD_MBUF_NOFF_F)) + rte_io_wmb(); for (i = 0; i < pkts; i++) { - otx2_nix_xmit_prepare(tx_pkts[i], cmd, flags); + otx2_nix_xmit_prepare(tx_pkts[i], cmd, flags, lso_tun_fmt); /* Passing no of segdw as 4: HDR + EXT + SG + SMEM */ otx2_nix_xmit_prepare_tstamp(cmd, &txq->cmd[0], tx_pkts[i]->ol_flags, 4, flags); @@ -62,6 +67,7 @@ nix_xmit_pkts_mseg(void *tx_queue, struct rte_mbuf **tx_pkts, struct otx2_eth_txq *txq = tx_queue; uint64_t i; const rte_iova_t io_addr = txq->io_addr; void *lmt_addr = txq->lmt_addr; + uint64_t lso_tun_fmt; uint16_t segdw; NIX_XMIT_FC_OR_RETURN(txq, pkts); @@ -70,15 +76,19 @@ nix_xmit_pkts_mseg(void *tx_queue, struct rte_mbuf **tx_pkts, /* Perform header writes before barrier for TSO */ if (flags & NIX_TX_OFFLOAD_TSO_F) { + lso_tun_fmt = txq->lso_tun_fmt; for (i = 0; i < pkts; i++) otx2_nix_xmit_prepare_tso(tx_pkts[i], flags); } - /* Lets commit any changes in the packet */ - rte_cio_wmb(); + /* Lets commit any changes in the packet here as no further changes + * to the packet will be done unless no fast free is enabled. + */ + if (!(flags & NIX_TX_OFFLOAD_MBUF_NOFF_F)) + rte_io_wmb(); for (i = 0; i < pkts; i++) { - otx2_nix_xmit_prepare(tx_pkts[i], cmd, flags); + otx2_nix_xmit_prepare(tx_pkts[i], cmd, flags, lso_tun_fmt); segdw = otx2_nix_prepare_mseg(tx_pkts[i], cmd, flags); otx2_nix_xmit_prepare_tstamp(cmd, &txq->cmd[0], tx_pkts[i]->ol_flags, segdw, @@ -127,8 +137,11 @@ nix_xmit_pkts_vector(void *tx_queue, struct rte_mbuf **tx_pkts, /* Reduce the cached count */ txq->fc_cache_pkts -= pkts; - /* Lets commit any changes in the packet */ - rte_cio_wmb(); + /* Lets commit any changes in the packet here as no further changes + * to the packet will be done unless no fast free is enabled. + */ + if (!(flags & NIX_TX_OFFLOAD_MBUF_NOFF_F)) + rte_io_wmb(); senddesc01_w0 = vld1q_dup_u64(&txq->cmd[0]); senddesc23_w0 = senddesc01_w0; @@ -221,6 +234,10 @@ nix_xmit_pkts_vector(void *tx_queue, struct rte_mbuf **tx_pkts, 1, 0); senddesc01_w0 = vorrq_u64(senddesc01_w0, xmask01); senddesc23_w0 = vorrq_u64(senddesc23_w0, xmask23); + /* Ensuring mbuf fields which got updated in + * otx2_nix_prefree_seg are written before LMTST. + */ + rte_io_wmb(); } else { struct rte_mbuf *mbuf; /* Mark mempool object as "put" since @@ -947,7 +964,7 @@ nix_xmit_pkts_vector(void *tx_queue, struct rte_mbuf **tx_pkts, #endif #define T(name, f6, f5, f4, f3, f2, f1, f0, sz, flags) \ -static uint16_t __rte_noinline __hot \ +static uint16_t __rte_noinline __rte_hot \ otx2_nix_xmit_pkts_ ## name(void *tx_queue, \ struct rte_mbuf **tx_pkts, uint16_t pkts) \ { \ @@ -964,7 +981,7 @@ NIX_TX_FASTPATH_MODES #undef T #define T(name, f6, f5, f4, f3, f2, f1, f0, sz, flags) \ -static uint16_t __rte_noinline __hot \ +static uint16_t __rte_noinline __rte_hot \ otx2_nix_xmit_pkts_mseg_ ## name(void *tx_queue, \ struct rte_mbuf **tx_pkts, uint16_t pkts) \ { \ @@ -982,7 +999,7 @@ NIX_TX_FASTPATH_MODES #undef T #define T(name, f6, f5, f4, f3, f2, f1, f0, sz, flags) \ -static uint16_t __rte_noinline __hot \ +static uint16_t __rte_noinline __rte_hot \ otx2_nix_xmit_pkts_vec_ ## name(void *tx_queue, \ struct rte_mbuf **tx_pkts, uint16_t pkts) \ { \