[v2] cryptodev: fix device socket ID type

Message ID 20230705103630.1131136-1-ciara.power@intel.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series [v2] cryptodev: fix device socket ID type |

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/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-unit-testing success Testing PASS
ci/iol-aarch-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-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS

Commit Message

Power, Ciara July 5, 2023, 10:36 a.m. UTC
  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(-)
  

Comments

Konstantin Ananyev July 5, 2023, 11:29 a.m. UTC | #1
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>
  
Akhil Goyal July 5, 2023, 6:23 p.m. UTC | #2
> 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.
  

Patch

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