* [PATCH] cryptodev: fix device socket ID type
@ 2023-06-29 13:21 Ciara Power
2023-07-04 22:30 ` Ji, Kai
2023-07-05 10:36 ` [PATCH v2] " Ciara Power
0 siblings, 2 replies; 6+ messages in thread
From: Ciara Power @ 2023-06-29 13:21 UTC (permalink / raw)
To: dev; +Cc: kai.ji, Ciara Power, olivier.matz, Akhil Goyal, Fan Zhang
The socket ID field for a cryptodev device data was unsigned int.
Due to recent changes to the default device socket ID,
this caused an issue when the socket ID was unknown and set to -1.
The device socket ID wrapped around to 255,
and caused errors when allocating memory.
Changing this field type to int fixes the issue, as it now takes the
correct -1 value.
Fixes: 7dcd73e37965 ("drivers/bus: set device NUMA node to unknown by default")
Cc: olivier.matz@6wind.com
Signed-off-by: Ciara Power <ciara.power@intel.com>
---
lib/cryptodev/cryptodev_pmd.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h
index 8710ed7558..4c98cedca6 100644
--- a/lib/cryptodev/cryptodev_pmd.h
+++ b/lib/cryptodev/cryptodev_pmd.h
@@ -65,7 +65,7 @@ struct rte_cryptodev_data {
/** Device ID for this instance */
uint8_t dev_id;
/** Socket ID where memory is allocated */
- uint8_t socket_id;
+ int socket_id;
/** Unique identifier name */
char name[RTE_CRYPTODEV_NAME_MAX_LEN];
--
2.25.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] cryptodev: fix device socket ID type
2023-06-29 13:21 [PATCH] cryptodev: fix device socket ID type Ciara Power
@ 2023-07-04 22:30 ` Ji, Kai
2023-07-05 9:44 ` Morten Brørup
2023-07-05 10:36 ` [PATCH v2] " Ciara Power
1 sibling, 1 reply; 6+ messages in thread
From: Ji, Kai @ 2023-07-04 22:30 UTC (permalink / raw)
To: Power, Ciara, dev; +Cc: Matz, Olivier, Akhil Goyal, Fan Zhang
[-- Attachment #1: Type: text/plain, Size: 1580 bytes --]
Acked-by: Kai Ji <kai.ji@intel.com<mailto:kai.ji@intel.com>>
________________________________
From: Power, Ciara <ciara.power@intel.com>
Sent: 29 June 2023 14:21
To: dev@dpdk.org <dev@dpdk.org>
Cc: Ji, Kai <kai.ji@intel.com>; Power, Ciara <ciara.power@intel.com>; Matz, Olivier <olivier.matz@6wind.com>; Akhil Goyal <gakhil@marvell.com>; Fan Zhang <fanzhang.oss@gmail.com>
Subject: [PATCH] cryptodev: fix device socket ID type
The socket ID field for a cryptodev device data was unsigned int.
Due to recent changes to the default device socket ID,
this caused an issue when the socket ID was unknown and set to -1.
The device socket ID wrapped around to 255,
and caused errors when allocating memory.
Changing this field type to int fixes the issue, as it now takes the
correct -1 value.
Fixes: 7dcd73e37965 ("drivers/bus: set device NUMA node to unknown by default")
Cc: olivier.matz@6wind.com
Signed-off-by: Ciara Power <ciara.power@intel.com>
---
lib/cryptodev/cryptodev_pmd.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h
index 8710ed7558..4c98cedca6 100644
--- a/lib/cryptodev/cryptodev_pmd.h
+++ b/lib/cryptodev/cryptodev_pmd.h
@@ -65,7 +65,7 @@ struct rte_cryptodev_data {
/** Device ID for this instance */
uint8_t dev_id;
/** Socket ID where memory is allocated */
- uint8_t socket_id;
+ int socket_id;
/** Unique identifier name */
char name[RTE_CRYPTODEV_NAME_MAX_LEN];
--
2.25.1
[-- Attachment #2: Type: text/html, Size: 2864 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] cryptodev: fix device socket ID type
2023-07-04 22:30 ` Ji, Kai
@ 2023-07-05 9:44 ` Morten Brørup
0 siblings, 0 replies; 6+ messages in thread
From: Morten Brørup @ 2023-07-05 9:44 UTC (permalink / raw)
To: Ji, Kai, Power, Ciara, dev
Cc: Matz, Olivier, Akhil Goyal, Fan Zhang, Bruce Richardson
[-- Attachment #1: Type: text/plain, Size: 2405 bytes --]
In my opinion, changing the type to the conventional type used for socket_id seems like a much better solution than just changing the signedness, as proposed in another RFC [1]. (If we used more specialized types, like socket_id_t, we wouldn't even have this discussion. It is the DPDK convention to avoid specialized types, and I'm not against this convention; I'm only mentioning it to support changing the type here to int.)
And SOCKET_ID_ANY (-1) being used for multiple purposes, as discussed in the RFC, is another issue, to be discussed separately.
[1]: https://patches.dpdk.org/project/dpdk/patch/20230117101646.2521875-1-didier.pallard@6wind.com/ <https://patches.dpdk.org/project/dpdk/patch/20230117101646.2521875-1-didier.pallard@6wind.com/>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Kai Ji <kai.ji@intel.com>
________________________________
From: Power, Ciara <ciara.power@intel.com>
Sent: 29 June 2023 14:21
To: dev@dpdk.org <dev@dpdk.org>
Cc: Ji, Kai <kai.ji@intel.com>; Power, Ciara <ciara.power@intel.com>; Matz, Olivier <olivier.matz@6wind.com>; Akhil Goyal <gakhil@marvell.com>; Fan Zhang <fanzhang.oss@gmail.com>
Subject: [PATCH] cryptodev: fix device socket ID type
The socket ID field for a cryptodev device data was unsigned int.
Due to recent changes to the default device socket ID,
this caused an issue when the socket ID was unknown and set to -1.
The device socket ID wrapped around to 255,
and caused errors when allocating memory.
Changing this field type to int fixes the issue, as it now takes the
correct -1 value.
Fixes: 7dcd73e37965 ("drivers/bus: set device NUMA node to unknown by default")
Cc: olivier.matz@6wind.com
Signed-off-by: Ciara Power <ciara.power@intel.com>
---
lib/cryptodev/cryptodev_pmd.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h
index 8710ed7558..4c98cedca6 100644
--- a/lib/cryptodev/cryptodev_pmd.h
+++ b/lib/cryptodev/cryptodev_pmd.h
@@ -65,7 +65,7 @@ struct rte_cryptodev_data {
/** Device ID for this instance */
uint8_t dev_id;
/** Socket ID where memory is allocated */
- uint8_t socket_id;
+ int socket_id;
/** Unique identifier name */
char name[RTE_CRYPTODEV_NAME_MAX_LEN];
--
2.25.1
[-- Attachment #2: Type: text/html, Size: 6691 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2] cryptodev: fix device socket ID type
2023-06-29 13:21 [PATCH] cryptodev: fix device socket ID type Ciara Power
2023-07-04 22:30 ` Ji, Kai
@ 2023-07-05 10:36 ` Ciara Power
2023-07-05 11:29 ` Konstantin Ananyev
1 sibling, 1 reply; 6+ messages in thread
From: Ciara Power @ 2023-07-05 10:36 UTC (permalink / raw)
To: dev
Cc: gakhil, Ciara Power, olivier.matz, stable, Morten Brørup,
Kai Ji, Fan Zhang
The socket ID field for a cryptodev device data was unsigned int.
Due to recent changes to the default device socket ID,
this caused an issue when the socket ID was unknown and set to -1.
The device socket ID wrapped around to 255,
and caused errors when allocating memory.
Changing this field type to int fixes the issue, as it now takes the
correct -1 value.
Fixes: 7dcd73e37965 ("drivers/bus: set device NUMA node to unknown by default")
Cc: olivier.matz@6wind.com
Cc: stable@dpdk.org
Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Kai Ji <kai.ji@intel.com>
---
v2: Added cc for stable mailing list
---
lib/cryptodev/cryptodev_pmd.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h
index 8710ed7558..4c98cedca6 100644
--- a/lib/cryptodev/cryptodev_pmd.h
+++ b/lib/cryptodev/cryptodev_pmd.h
@@ -65,7 +65,7 @@ struct rte_cryptodev_data {
/** Device ID for this instance */
uint8_t dev_id;
/** Socket ID where memory is allocated */
- uint8_t socket_id;
+ int socket_id;
/** Unique identifier name */
char name[RTE_CRYPTODEV_NAME_MAX_LEN];
--
2.25.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] cryptodev: fix device socket ID type
2023-07-05 10:36 ` [PATCH v2] " Ciara Power
@ 2023-07-05 11:29 ` Konstantin Ananyev
2023-07-05 18:23 ` [EXT] " Akhil Goyal
0 siblings, 1 reply; 6+ messages in thread
From: Konstantin Ananyev @ 2023-07-05 11:29 UTC (permalink / raw)
To: Ciara Power, dev
Cc: gakhil, olivier.matz, stable, Morten Brørup, Kai Ji, Fan Zhang
05/07/2023 11:36, Ciara Power пишет:
> The socket ID field for a cryptodev device data was unsigned int.
> Due to recent changes to the default device socket ID,
> this caused an issue when the socket ID was unknown and set to -1.
> The device socket ID wrapped around to 255,
> and caused errors when allocating memory.
>
> Changing this field type to int fixes the issue, as it now takes the
> correct -1 value.
>
> Fixes: 7dcd73e37965 ("drivers/bus: set device NUMA node to unknown by default")
> Cc: olivier.matz@6wind.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Ciara Power <ciara.power@intel.com>
> Acked-by: Morten Brørup <mb@smartsharesystems.com>
> Acked-by: Kai Ji <kai.ji@intel.com>
>
> ---
> v2: Added cc for stable mailing list
> ---
> lib/cryptodev/cryptodev_pmd.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h
> index 8710ed7558..4c98cedca6 100644
> --- a/lib/cryptodev/cryptodev_pmd.h
> +++ b/lib/cryptodev/cryptodev_pmd.h
> @@ -65,7 +65,7 @@ struct rte_cryptodev_data {
> /** Device ID for this instance */
> uint8_t dev_id;
> /** Socket ID where memory is allocated */
> - uint8_t socket_id;
> + int socket_id;
> /** Unique identifier name */
> char name[RTE_CRYPTODEV_NAME_MAX_LEN];
>
Acked-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [EXT] Re: [PATCH v2] cryptodev: fix device socket ID type
2023-07-05 11:29 ` Konstantin Ananyev
@ 2023-07-05 18:23 ` Akhil Goyal
0 siblings, 0 replies; 6+ messages in thread
From: Akhil Goyal @ 2023-07-05 18:23 UTC (permalink / raw)
To: Konstantin Ananyev, Ciara Power, dev
Cc: olivier.matz, stable, Morten Brørup, Kai Ji, Fan Zhang
> 05/07/2023 11:36, Ciara Power пишет:
> > The socket ID field for a cryptodev device data was unsigned int.
> > Due to recent changes to the default device socket ID,
> > this caused an issue when the socket ID was unknown and set to -1.
> > The device socket ID wrapped around to 255,
> > and caused errors when allocating memory.
> >
> > Changing this field type to int fixes the issue, as it now takes the
> > correct -1 value.
> >
> > Fixes: 7dcd73e37965 ("drivers/bus: set device NUMA node to unknown by
> default")
> > Cc: olivier.matz@6wind.com
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Ciara Power <ciara.power@intel.com>
> > Acked-by: Morten Brørup <mb@smartsharesystems.com>
> > Acked-by: Kai Ji <kai.ji@intel.com>
> >
> Acked-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Applied to dpdk-next-crypto
Thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-07-05 18:23 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-29 13:21 [PATCH] cryptodev: fix device socket ID type Ciara Power
2023-07-04 22:30 ` Ji, Kai
2023-07-05 9:44 ` Morten Brørup
2023-07-05 10:36 ` [PATCH v2] " Ciara Power
2023-07-05 11:29 ` Konstantin Ananyev
2023-07-05 18:23 ` [EXT] " 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).