[PATCH 2/4] net/nfp: do not set the IPv6 flag in transport mode

Chaoyong He chaoyong.he at corigine.com
Mon Oct 14 04:43:56 CEST 2024


From: Shihong Wang <shihong.wang at corigine.com>

The transport only encapsulates the security protocol header,
does not pay attention to the IP protocol type, and need not
to set the IPv6 flag.

Fixes: 3d21da66c06b ("net/nfp: create security session")
Cc: stable at dpdk.org

Signed-off-by: Shihong Wang <shihong.wang at corigine.com>
Reviewed-by: Long Wu <long.wu at corigine.com>
Reviewed-by: Peng Zhang <peng.zhang at corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he at corigine.com>
---
 drivers/net/nfp/nfp_ipsec.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/drivers/net/nfp/nfp_ipsec.c b/drivers/net/nfp/nfp_ipsec.c
index 647bc2bb6d..89116af1b2 100644
--- a/drivers/net/nfp/nfp_ipsec.c
+++ b/drivers/net/nfp/nfp_ipsec.c
@@ -1056,20 +1056,9 @@ nfp_ipsec_msg_build(struct rte_eth_dev *eth_dev,
 
 		break;
 	case RTE_SECURITY_IPSEC_SA_MODE_TRANSPORT:
-		type = conf->ipsec.tunnel.type;
 		cfg->ctrl_word.mode = NFP_IPSEC_MODE_TRANSPORT;
-		if (type == RTE_SECURITY_IPSEC_TUNNEL_IPV4) {
-			memset(&cfg->src_ip, 0, sizeof(cfg->src_ip));
-			memset(&cfg->dst_ip, 0, sizeof(cfg->dst_ip));
-			cfg->ipv6 = 0;
-		} else if (type == RTE_SECURITY_IPSEC_TUNNEL_IPV6) {
-			memset(&cfg->src_ip, 0, sizeof(cfg->src_ip));
-			memset(&cfg->dst_ip, 0, sizeof(cfg->dst_ip));
-			cfg->ipv6 = 1;
-		} else {
-			PMD_DRV_LOG(ERR, "Unsupported address family!");
-			return -EINVAL;
-		}
+		memset(&cfg->src_ip, 0, sizeof(cfg->src_ip));
+		memset(&cfg->dst_ip, 0, sizeof(cfg->dst_ip));
 
 		break;
 	default:
-- 
2.39.1



More information about the dev mailing list