DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev v1] examples/ipsec-secgw: fix of socket id default value
@ 2023-07-05 17:29 Kai Ji
  2023-07-06 11:00 ` [PATCH v2] " Kai Ji
  0 siblings, 1 reply; 4+ messages in thread
From: Kai Ji @ 2023-07-05 17:29 UTC (permalink / raw)
  To: dev; +Cc: gakhil, stable, Kai Ji, olivier.matz

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 | 5 +++++
 1 file changed, 5 insertions(+)

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] examples/ipsec-secgw: fix of socket id default value
  2023-07-05 17:29 [dpdk-dev v1] examples/ipsec-secgw: fix of socket id default value Kai Ji
@ 2023-07-06 11:00 ` Kai Ji
  2023-07-06 15:58   ` Power, Ciara
  0 siblings, 1 reply; 4+ messages in thread
From: Kai Ji @ 2023-07-06 11:00 UTC (permalink / raw)
  To: dev; +Cc: gakhil, stable, Kai Ji, olivier.matz

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(+)

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;
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH v2] examples/ipsec-secgw: fix of socket id default value
  2023-07-06 11:00 ` [PATCH v2] " Kai Ji
@ 2023-07-06 15:58   ` Power, Ciara
  2023-07-06 18:17     ` Akhil Goyal
  0 siblings, 1 reply; 4+ messages in thread
From: Power, Ciara @ 2023-07-06 15:58 UTC (permalink / raw)
  To: Ji, Kai, dev; +Cc: gakhil, stable, Ji, Kai, Matz, Olivier



> -----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>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH v2] examples/ipsec-secgw: fix of socket id default value
  2023-07-06 15:58   ` Power, Ciara
@ 2023-07-06 18:17     ` Akhil Goyal
  0 siblings, 0 replies; 4+ messages in thread
From: Akhil Goyal @ 2023-07-06 18:17 UTC (permalink / raw)
  To: Power, Ciara, Ji, Kai, dev; +Cc: stable, Ji, Kai, Matz, Olivier

> > 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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-07-06 18:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-05 17:29 [dpdk-dev v1] examples/ipsec-secgw: fix of socket id default value Kai Ji
2023-07-06 11:00 ` [PATCH v2] " Kai Ji
2023-07-06 15:58   ` Power, Ciara
2023-07-06 18:17     ` Akhil Goyal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).