From patchwork Wed Jun 26 13:26:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mariusz Drost X-Patchwork-Id: 55409 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A4AF12C37; Wed, 26 Jun 2019 15:29:20 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 283CB2C37 for ; Wed, 26 Jun 2019 15:29:17 +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 orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jun 2019 06:29:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,420,1557212400"; d="scan'208";a="183173209" Received: from mdrostx-mobl.ger.corp.intel.com ([10.103.104.107]) by fmsmga001.fm.intel.com with ESMTP; 26 Jun 2019 06:29:15 -0700 From: Mariusz Drost To: dev@dpdk.org Cc: akhil.goyal@nxp.com, Mariusz Drost , Konstantin Ananyev Date: Wed, 26 Jun 2019 15:26:16 +0200 Message-Id: <20190626132617.10576-2-mariuszx.drost@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20190626132617.10576-1-mariuszx.drost@intel.com> References: <20190626132617.10576-1-mariuszx.drost@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 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 Acked-by: Konstantin Ananyev Tested-by: Konstantin Ananyev --- 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*/