[PATCH v6 14/14] examples/ipsec-secgw: fix port ID restriction

Sivaprasad Tummala sivaprasad.tummala at amd.com
Thu Mar 21 19:47:20 CET 2024


Currently application supports port IDs up to 255
irrespective of RTE_MAX_ETHPORTS.

The patch fixes these constraints by allowing port
IDs up to RTE_MAX_ETHPORTS.

Fixes: d299106e8e31 ("examples/ipsec-secgw: add IPsec sample application")
Cc: sergio.gonzalez.monroy at intel.com
Cc: stable at dpdk.org

Signed-off-by: Sivaprasad Tummala <sivaprasad.tummala at amd.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev at huawei.com>
Acked-by: Morten Brørup <mb at smartsharesystems.com>
Acked-by: Ferruh Yigit <ferruh.yigit at amd.com>
---
 examples/ipsec-secgw/ipsec-secgw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 0fa9622626..dc7491a2b9 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -1048,7 +1048,7 @@ parse_config(const char *q_arg)
 	char *str_fld[_NUM_FLD];
 	int32_t i;
 	uint32_t size;
-	uint32_t max_fld[_NUM_FLD] = {USHRT_MAX,
+	uint32_t max_fld[_NUM_FLD] = {RTE_MAX_ETHPORTS,
 				USHRT_MAX, RTE_MAX_LCORE};
 
 	nb_lcore_params = 0;
@@ -1079,7 +1079,7 @@ parse_config(const char *q_arg)
 			return -1;
 		}
 		lcore_params_array[nb_lcore_params].port_id =
-			(uint8_t)int_fld[FLD_PORT];
+			(uint16_t)int_fld[FLD_PORT];
 		lcore_params_array[nb_lcore_params].queue_id =
 			(uint16_t)int_fld[FLD_QUEUE];
 		lcore_params_array[nb_lcore_params].lcore_id =
-- 
2.34.1



More information about the stable mailing list