X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Focteontx2%2Fotx2_tx.h;h=a97b16067783189daeeeb594038469c068c84870;hb=6a11a1eac0b6dcd52580eef99cf6f09e3361cc3b;hp=caf170fd1a3780201fb8f16082e507c99efe0c8e;hpb=cb7ee83b63657b4c519c35570f85c748462a100a;p=dpdk.git diff --git a/drivers/net/octeontx2/otx2_tx.h b/drivers/net/octeontx2/otx2_tx.h index caf170fd1a..a97b160677 100644 --- a/drivers/net/octeontx2/otx2_tx.h +++ b/drivers/net/octeontx2/otx2_tx.h @@ -363,6 +363,10 @@ otx2_nix_xmit_prepare(struct rte_mbuf *m, uint64_t *cmd, const uint16_t flags) * DF bit = 0 otherwise */ send_hdr->w0.df = otx2_nix_prefree_seg(m); + /* Ensuring mbuf fields which got updated in + * otx2_nix_prefree_seg are written before LMTST. + */ + rte_io_wmb(); } /* Mark mempool object as "put" since it is freed by NIX */ if (!send_hdr->w0.df) @@ -395,6 +399,12 @@ otx2_nix_xmit_submit_lmt(const rte_iova_t io_addr) return otx2_lmt_submit(io_addr); } +static __rte_always_inline uint64_t +otx2_nix_xmit_submit_lmt_release(const rte_iova_t io_addr) +{ + return otx2_lmt_submit_release(io_addr); +} + static __rte_always_inline uint16_t otx2_nix_prepare_mseg(struct rte_mbuf *m, uint64_t *cmd, const uint16_t flags) { @@ -430,13 +440,17 @@ otx2_nix_prepare_mseg(struct rte_mbuf *m, uint64_t *cmd, const uint16_t flags) sg_u = sg_u | ((uint64_t)m->data_len << (i << 4)); *slist = rte_mbuf_data_iova(m); /* Set invert df if buffer is not to be freed by H/W */ - if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F) + if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F) { sg_u |= (otx2_nix_prefree_seg(m) << (i + 55)); + /* Commit changes to mbuf */ + rte_io_wmb(); + } /* Mark mempool object as "put" since it is freed by NIX */ - if (!(sg_u & (1ULL << (i + 55)))) { - m->next = NULL; +#ifdef RTE_LIBRTE_MEMPOOL_DEBUG + if (!(sg_u & (1ULL << (i + 55)))) __mempool_check_cookies(m->pool, (void **)&m, 1, 0); - } + rte_io_wmb(); +#endif slist++; i++; nb_segs--; @@ -483,6 +497,19 @@ otx2_nix_xmit_mseg_one(uint64_t *cmd, void *lmt_addr, } while (lmt_status == 0); } +static __rte_always_inline void +otx2_nix_xmit_mseg_one_release(uint64_t *cmd, void *lmt_addr, + rte_iova_t io_addr, uint16_t segdw) +{ + uint64_t lmt_status; + + rte_io_wmb(); + do { + otx2_lmt_mov_seg(lmt_addr, (const void *)cmd, segdw); + lmt_status = otx2_lmt_submit(io_addr); + } while (lmt_status == 0); +} + #define L3L4CSUM_F NIX_TX_OFFLOAD_L3_L4_CSUM_F #define OL3OL4CSUM_F NIX_TX_OFFLOAD_OL3_OL4_CSUM_F #define VLAN_F NIX_TX_OFFLOAD_VLAN_QINQ_F