X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Focteontx2%2Fotx2_tx.h;h=486248dff754883b6023721e240bfc10c3ba39aa;hb=83680d371592fcf1b66cbbfecb0fb8b3aa4ccc8d;hp=d6ea3b4874a2d0614c2420b458546ae91fb93838;hpb=ce8628c66a22f1222693075d9d474bd4b96f9c2c;p=dpdk.git diff --git a/drivers/net/octeontx2/otx2_tx.h b/drivers/net/octeontx2/otx2_tx.h index d6ea3b4874..486248dff7 100644 --- a/drivers/net/octeontx2/otx2_tx.h +++ b/drivers/net/octeontx2/otx2_tx.h @@ -197,7 +197,8 @@ otx2_nix_xmit_prepare_tso(struct rte_mbuf *m, const uint64_t flags) } static __rte_always_inline void -otx2_nix_xmit_prepare(struct rte_mbuf *m, uint64_t *cmd, const uint16_t flags) +otx2_nix_xmit_prepare(struct rte_mbuf *m, uint64_t *cmd, const uint16_t flags, + const uint64_t lso_tun_fmt) { struct nix_send_ext_s *send_hdr_ext; struct nix_send_hdr_s *send_hdr; @@ -339,14 +340,15 @@ otx2_nix_xmit_prepare(struct rte_mbuf *m, uint64_t *cmd, const uint16_t flags) (ol_flags & PKT_TX_TUNNEL_MASK)) { const uint8_t is_udp_tun = (NIX_UDP_TUN_BITMASK >> ((ol_flags & PKT_TX_TUNNEL_MASK) >> 45)) & 0x1; + uint8_t shift = is_udp_tun ? 32 : 0; + + shift += (!!(ol_flags & PKT_TX_OUTER_IPV6) << 4); + shift += (!!(ol_flags & PKT_TX_IPV6) << 3); w1.il4type = NIX_SENDL4TYPE_TCP_CKSUM; w1.ol4type = is_udp_tun ? NIX_SENDL4TYPE_UDP_CKSUM : 0; /* Update format for UDP tunneled packet */ - send_hdr_ext->w0.lso_format += is_udp_tun ? 2 : 6; - - send_hdr_ext->w0.lso_format += - !!(ol_flags & PKT_TX_OUTER_IPV6) << 1; + send_hdr_ext->w0.lso_format = (lso_tun_fmt >> shift); } } @@ -440,13 +442,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--;