X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Focteontx2%2Fotx2_ethdev_sec_tx.h;h=623a2a841eea7368e761302d02b40b10302c68de;hb=48fbc1be82b551e41c58e94de780fdd2ffaaeb78;hp=2e35a8c773bd93e57049c446f0419760c41855ef;hpb=41a18d8b9631231e1f7de8b5afdf9870e2b41e38;p=dpdk.git diff --git a/drivers/net/octeontx2/otx2_ethdev_sec_tx.h b/drivers/net/octeontx2/otx2_ethdev_sec_tx.h index 2e35a8c773..623a2a841e 100644 --- a/drivers/net/octeontx2/otx2_ethdev_sec_tx.h +++ b/drivers/net/octeontx2/otx2_ethdev_sec_tx.h @@ -9,6 +9,7 @@ #include #include "otx2_ethdev_sec.h" +#include "otx2_security.h" struct otx2_ipsec_fp_out_hdr { uint32_t ip_id; @@ -29,12 +30,11 @@ otx2_ipsec_fp_out_rlen_get(struct otx2_sec_session_ipsec_ip *sess, } static __rte_always_inline void -otx2_ssogws_head_wait(struct otx2_ssogws *ws); +otx2_ssogws_head_wait(uint64_t base); static __rte_always_inline int -otx2_sec_event_tx(struct otx2_ssogws *ws, struct rte_event *ev, - struct rte_mbuf *m, const struct otx2_eth_txq *txq, - const uint32_t offload_flags) +otx2_sec_event_tx(uint64_t base, struct rte_event *ev, struct rte_mbuf *m, + const struct otx2_eth_txq *txq, const uint32_t offload_flags) { uint32_t dlen, rlen, desc_headroom, extend_head, extend_tail; struct otx2_sec_session_ipsec_ip *sess; @@ -54,13 +54,12 @@ otx2_sec_event_tx(struct otx2_ssogws *ws, struct rte_event *ev, struct nix_iova_s nix_iova; } *sd; - priv = get_sec_session_private_data((void *)(m->udata64)); + priv = get_sec_session_private_data((void *)(*rte_security_dynfield(m))); sess = &priv->ipsec.ip; sa = &sess->out_sa; RTE_ASSERT(sess->cpt_lmtline != NULL); - RTE_ASSERT(!(offload_flags & (NIX_TX_OFFLOAD_MBUF_NOFF_F | - NIX_TX_OFFLOAD_VLAN_QINQ_F))); + RTE_ASSERT(!(offload_flags & NIX_TX_OFFLOAD_VLAN_QINQ_F)); dlen = rte_pktmbuf_pkt_len(m) + sizeof(*hdr) - RTE_ETHER_HDR_LEN; rlen = otx2_ipsec_fp_out_rlen_get(sess, dlen - sizeof(*hdr)); @@ -86,7 +85,7 @@ otx2_sec_event_tx(struct otx2_ssogws *ws, struct rte_event *ev, */ rte_pktmbuf_append(m, extend_tail); data = rte_pktmbuf_prepend(m, extend_head); - data_addr = rte_pktmbuf_mtophys(m); + data_addr = rte_pktmbuf_iova(m); /* * Move the Ethernet header, to insert otx2_ipsec_fp_out_hdr prior @@ -135,6 +134,8 @@ otx2_sec_event_tx(struct otx2_ssogws *ws, struct rte_event *ev, sd->nix_hdr.w0.sizem1 = 1; sd->nix_hdr.w0.total = rte_pktmbuf_data_len(m); sd->nix_hdr.w0.aura = npa_lf_aura_handle_to_aura(m->pool->pool_id); + if (offload_flags & NIX_TX_OFFLOAD_MBUF_NOFF_F) + sd->nix_hdr.w0.df = otx2_nix_prefree_seg(m); sd->nix_sg.u = 0; sd->nix_sg.subdc = NIX_SUBDC_SG; @@ -148,7 +149,7 @@ otx2_sec_event_tx(struct otx2_ssogws *ws, struct rte_event *ev, __mempool_check_cookies(m->pool, (void **)&m, 1, 0); if (!ev->sched_type) - otx2_ssogws_head_wait(ws); + otx2_ssogws_head_wait(base + SSOW_LF_GWS_TAG); inst.param1 = sess->esn_hi >> 16; inst.param2 = sess->esn_hi & 0xffff; @@ -159,7 +160,7 @@ otx2_sec_event_tx(struct otx2_ssogws *ws, struct rte_event *ev, sess->ip_id++; sess->esn++; - rte_cio_wmb(); + rte_io_wmb(); do { otx2_lmt_mov(sess->cpt_lmtline, &inst, 2);