From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergio Gonzalez Monroy Subject: Re: [PATCH 07/11] examples/ipsec-secgw: Fixed phyiscal address of aad Date: Mon, 16 Oct 2017 10:39:39 +0100 Message-ID: <5bbf76cd-abc9-bb17-0903-1f298dc2a92b@intel.com> References: <1507987683-12315-1-git-send-email-aviadye@dev.mellanox.co.il> <1507987683-12315-7-git-send-email-aviadye@dev.mellanox.co.il> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: borisp@mellanox.com, akhil.goyal@nxp.com, hemant.agrawal@nxp.com, radu.nicolau@intel.com, declan.doherty@intel.com, liranl@mellanox.com, nelio.laranjeiro@6wind.com, thomas@monjalon.net To: aviadye@dev.mellanox.co.il, dev@dpdk.org, pablo.de.lara.guarch@intel.com, aviadye@mellanox.com Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 21D7D1B5E8 for ; Mon, 16 Oct 2017 11:39:43 +0200 (CEST) In-Reply-To: <1507987683-12315-7-git-send-email-aviadye@dev.mellanox.co.il> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 14/10/2017 14:27, aviadye@dev.mellanox.co.il wrote: > From: Aviad Yehezkel > > Signed-off-by: Aviad Yehezkel > --- > examples/ipsec-secgw/esp.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/examples/ipsec-secgw/esp.c b/examples/ipsec-secgw/esp.c > index 689e917..aa2233d 100644 > --- a/examples/ipsec-secgw/esp.c > +++ b/examples/ipsec-secgw/esp.c > @@ -355,8 +355,7 @@ esp_outbound(struct rte_mbuf *m, struct ipsec_sa *sa, > aad = get_aad(m); > memcpy(aad, esp, 8); > sym_cop->aead.aad.data = aad; > - sym_cop->aead.aad.phys_addr = rte_pktmbuf_mtophys_offset(m, > - aad - rte_pktmbuf_mtod(m, uint8_t *)); > + sym_cop->aead.aad.phys_addr = rte_mem_virt2phy(aad); > That function is very expensive and should not be used in data path. You should use the phys_addr in the crypto_op to calculate proper value. Thanks, Sergio > sym_cop->aead.digest.data = rte_pktmbuf_mtod_offset(m, uint8_t *, > rte_pktmbuf_pkt_len(m) - sa->digest_len);