]> git.droids-corp.org - dpdk.git/commitdiff
net/ixgbe: fix IP type for crypto session
authorMariusz Drost <mariuszx.drost@intel.com>
Wed, 26 Jun 2019 13:26:16 +0000 (15:26 +0200)
committerAkhil Goyal <akhil.goyal@nxp.com>
Fri, 5 Jul 2019 13:28:14 +0000 (15:28 +0200)
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")
Cc: stable@dpdk.org
Signed-off-by: Mariusz Drost <mariuszx.drost@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
drivers/net/ixgbe/ixgbe_ipsec.c

index 5a416885f85f0cd48811ccad9bc46aa77b15ea98..1eea7071617c115216f5e034ae40aca79bcffe1c 100644 (file)
@@ -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*/