Skip to content

Commit

Permalink
compressdev: fix socket ID type
Browse files Browse the repository at this point in the history
[ upstream commit c0941508b30618b9dd335fb4b533d451f8686f3b ]

Socket ID is used and interpreted as integer, one of the possible
values for socket id is -1 (SOCKET_ID_ANY).
here socket_id is defined as unsigned 8 bit integer, so when putting
-1, it is interpreted as 255, which causes allocation errors when
trying to allocate from socket_id (255).

change socket_id from unsigned 8 bit integer to integer.

Fixes: ed7dd94 ("compressdev: add basic device management")

Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
  • Loading branch information
RajaZid20 authored and cpaelzer committed Mar 9, 2022
1 parent c8a4d2d commit 166408a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/librte_compressdev/rte_compressdev_internal.h
Expand Up @@ -98,7 +98,7 @@ struct rte_compressdev {
struct rte_compressdev_data {
uint8_t dev_id;
/**< Compress device identifier */
uint8_t socket_id;
int socket_id;
/**< Socket identifier where memory is allocated */
char name[RTE_COMPRESSDEV_NAME_MAX_LEN];
/**< Unique identifier name */
Expand Down

0 comments on commit 166408a

Please sign in to comment.