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

Message ID 20230706110034.981345-1-kai.ji@intel.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series [v2] examples/ipsec-secgw: fix of socket id default value |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-aarch-unit-testing success Testing PASS
ci/iol-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS

Commit Message

Ji, Kai July 6, 2023, 11 a.m. UTC
  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: olivier.matz@6wind.com
Cc: stable@dpdk.org

Signed-off-by: Kai Ji <kai.ji@intel.com>
---
 examples/ipsec-secgw/ipsec-secgw.c | 3 +++
 1 file changed, 3 insertions(+)
  

Comments

Power, Ciara July 6, 2023, 3:58 p.m. UTC | #1
> -----Original Message-----
> From: Kai Ji <kai.ji@intel.com>
> Sent: Thursday 6 July 2023 12:01
> To: dev@dpdk.org
> Cc: gakhil@marvell.com; stable@dpdk.org; Ji, Kai <kai.ji@intel.com>; Matz,
> Olivier <olivier.matz@6wind.com>
> 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: olivier.matz@6wind.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Kai Ji <kai.ji@intel.com>
> ---
>  examples/ipsec-secgw/ipsec-secgw.c | 3 +++

Acked-by: Ciara Power <ciara.power@intel.com>
  
Akhil Goyal July 6, 2023, 6:17 p.m. UTC | #2
> > 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: olivier.matz@6wind.com
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Kai Ji <kai.ji@intel.com>
> > ---
> >  examples/ipsec-secgw/ipsec-secgw.c | 3 +++
> 
> Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Applied to dpdk-next-crypto
Thanks.
  

Patch

diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 029749e522..72b3bfba9e 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -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;