From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 8A5CAA0096 for ; Tue, 4 Jun 2019 12:10:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5198F1BBF8; Tue, 4 Jun 2019 12:10:33 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id C37E91BBF8 for ; Tue, 4 Jun 2019 12:10:31 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jun 2019 03:10:30 -0700 X-ExtLoop1: 1 Received: from mdrostx-mobl.ger.corp.intel.com ([10.103.104.107]) by fmsmga001.fm.intel.com with ESMTP; 04 Jun 2019 03:10:28 -0700 From: Mariusz Drost To: radu.nicolau@intel.com, akhil.goyal@nxp.com, wenzhuo.lu@intel.com, konstantin.ananyev@intel.com Cc: dev@dpdk.org, Mariusz Drost Date: Tue, 4 Jun 2019 12:06:43 +0200 Message-Id: <20190604100644.13724-2-mariuszx.drost@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20190604100644.13724-1-mariuszx.drost@intel.com> References: <20190604100644.13724-1-mariuszx.drost@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 1/2] net/ixgbe: fix lack of ip type for crypto session X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When ixgbe_crypto_add_sa() is called, it checks whether the ip type is IPv6 or IPv4 to write correct addresses to the registers. Type itself is never specified, and act as IPv4, which is the default value. It causes lack of support for IPv6. To fix that, ip type needs to be stored in device private data, based on crypto session ip type field, before the checking is done. Fixes: ec17993a145a ("examples/ipsec-secgw: support security offload") Fixes: 9a0752f498d2 ("net/ixgbe: enable inline IPsec") Signed-off-by: Mariusz Drost --- drivers/net/ixgbe/ixgbe_ipsec.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/ixgbe/ixgbe_ipsec.c b/drivers/net/ixgbe/ixgbe_ipsec.c index 5a416885f..1eea70716 100644 --- a/drivers/net/ixgbe/ixgbe_ipsec.c +++ b/drivers/net/ixgbe/ixgbe_ipsec.c @@ -154,8 +154,12 @@ ixgbe_crypto_add_sa(struct ixgbe_crypto_session *ic_session) if (ic_session->op == IXGBE_OP_AUTHENTICATED_DECRYPTION) priv->rx_sa_tbl[sa_index].mode |= (IPSRXMOD_PROTO | IPSRXMOD_DECRYPT); - if (ic_session->dst_ip.type == IPv6) + if (ic_session->dst_ip.type == IPv6) { priv->rx_sa_tbl[sa_index].mode |= IPSRXMOD_IPV6; + priv->rx_ip_tbl[ip_index].ip.type = IPv6; + } else if (ic_session->dst_ip.type == IPv4) + priv->rx_ip_tbl[ip_index].ip.type = IPv4; + priv->rx_sa_tbl[sa_index].used = 1; /* write IP table entry*/ -- 2.17.1