Skip to contentSkip to conversation

examples/ipsec-secgw: fix of socket id default value

PATCH Superseded Kai Ji 3 participants 4 messages Jul 5, 2023 – Jul 6, 2023

lore
Share & tools
lore

Kai Ji

author
#0 lore raw

PATCH 1/1 examples/ipsec-secgw: fix of socket id default value

Due to recent changes to the default device socket ID, before being used as an index for session mempool list, set socket ID to 0 if unknown (-1).

Fixes 7dcd73e37965 ("drivers/bus: set device NUMA node to unknown by default")
---
 examples/ipsec-secgw/ipsec-secgw.c | 5 +++++
 1 file changed, 5 insertions(+)
examples/ipsec-secgw/ipsec-secgw.c +5 -0
index 029749e522..e678625ece 100644
@@ -1699,6 +1699,11 @@ cryptodevs_init(enum eh_pkt_transfer_mode mode)
 
 		total_nb_qps += qp;
 		dev_conf.socket_id = rte_cryptodev_socket_id(cdev_id);
+		/* range check the socket_id - negative values become big
+		 * positive ones due to use of unsigned value
+		 */
+		if (dev_conf.socket_id >= RTE_MAX_NUMA_NODES)
+			dev_conf.socket_id = 0;
 		dev_conf.nb_queue_pairs = qp;
 		dev_conf.ff_disable = RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO;
 
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH v2 1/1 examples/ipsec-secgw: fix of socket id default value

Due to recent changes to the default device socket ID, before being used as an index for session mempool list, set socket ID to 0 if unknown (-1).

Fixes 7dcd73e37965 ("drivers/bus: set device NUMA node to unknown by default")
---
 examples/ipsec-secgw/ipsec-secgw.c | 3 +++
 1 file changed, 3 insertions(+)
examples/ipsec-secgw/ipsec-secgw.c +3 -0
index 029749e522..72b3bfba9e 100644
@@ -1699,6 +1699,9 @@ cryptodevs_init(enum eh_pkt_transfer_mode mode)
 
 		total_nb_qps += qp;
 		dev_conf.socket_id = rte_cryptodev_socket_id(cdev_id);
+		/* Use the first socket if SOCKET_ID_ANY is returned. */
+		if (dev_conf.socket_id == SOCKET_ID_ANY)
+			dev_conf.socket_id = 0;
 		dev_conf.nb_queue_pairs = qp;
 		dev_conf.ff_disable = RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO;
 
Signature · 1 line
2.34.1
Acked-by on v2 1/1
#2 lore raw
Quoted 13 lines

-----Original Message-----
From: Kai Ji <[email protected]>
Sent: Thursday 6 July 2023 12:01
To: [email protected]
Cc: [email protected]; [email protected]; Ji, Kai <[email protected]>; Matz, Olivier <[email protected]>
Subject: [PATCH v2] examples/ipsec-secgw: fix of socket id default value

Due to recent changes to the default device socket ID, before being used as an index for session mempool list, set socket ID to 0 if unknown (-1).

Quoted 8 lines
Fixes 7dcd73e37965 ("drivers/bus: set device NUMA node to unknown by

default")
Cc: [email protected]
Cc: [email protected]

---
 examples/ipsec-secgw/ipsec-secgw.c | 3 +++
Acked-by Applied
#3 lore raw
Quoted 10 lines
Quoted 10 lines

Subject: [PATCH v2] examples/ipsec-secgw: fix of socket id default value

Due to recent changes to the default device socket ID, before being used as an index for session mempool list, set socket ID to 0 if unknown (-1).

Fixes 7dcd73e37965 ("drivers/bus: set device NUMA node to unknown by

default")
Cc: [email protected]
Cc: [email protected]

Quoted 5 lines
Quoted 3 lines
---
 examples/ipsec-secgw/ipsec-secgw.c | 3 +++

Applied to dpdk-next-crypto
Thanks.