DPDK patches and discussions
 help / color / mirror / Atom feed
From: Mariusz Drost <mariuszx.drost@intel.com>
To: radu.nicolau@intel.com, akhil.goyal@nxp.com,
	wenzhuo.lu@intel.com, konstantin.ananyev@intel.com
Cc: dev@dpdk.org, Mariusz Drost <mariuszx.drost@intel.com>
Subject: [dpdk-dev] [PATCH 1/2] net/ixgbe: fix lack of ip type for crypto session
Date: Tue,  4 Jun 2019 12:06:43 +0200	[thread overview]
Message-ID: <20190604100644.13724-2-mariuszx.drost@intel.com> (raw)
In-Reply-To: <20190604100644.13724-1-mariuszx.drost@intel.com>

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 <mariuszx.drost@intel.com>
---
 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


  reply	other threads:[~2019-06-04 10:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-04 10:06 [dpdk-dev] [PATCH 0/2] fixes for inline-crypto ipsec Mariusz Drost
2019-06-04 10:06 ` Mariusz Drost [this message]
2019-06-06 10:43   ` [dpdk-dev] [PATCH 1/2] net/ixgbe: fix lack of ip type for crypto session Ananyev, Konstantin
2019-06-04 10:06 ` [dpdk-dev] [PATCH 2/2] examples/ipsec-secgw: fix not working inline ipsec modes Mariusz Drost
2019-06-06 10:43   ` Ananyev, Konstantin
2019-06-20 13:08   ` Akhil Goyal
2019-06-25 13:14     ` Akhil Goyal
2019-06-25 13:48       ` Drost, MariuszX
2019-06-26  7:06         ` Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190604100644.13724-2-mariuszx.drost@intel.com \
    --to=mariuszx.drost@intel.com \
    --cc=akhil.goyal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=konstantin.ananyev@intel.com \
    --cc=radu.nicolau@intel.com \
    --cc=wenzhuo.lu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).