}
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;
(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);
}
}
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--;