<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: "Sitka Text", Cochin, serif; font-size: 11pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted0">
Acked-by: Kai Ji <<a href="mailto:kai.ji@intel.com" class="ContentPasted0" data-loopstyle="linkonly">kai.ji@intel.com</a>><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Power, Ciara <ciara.power@intel.com><br>
<b>Sent:</b> 29 June 2023 14:21<br>
<b>To:</b> dev@dpdk.org <dev@dpdk.org><br>
<b>Cc:</b> 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><br>
<b>Subject:</b> [PATCH] cryptodev: fix device socket ID type</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">The socket ID field for a cryptodev device data was unsigned int.<br>
Due to recent changes to the default device socket ID,<br>
this caused an issue when the socket ID was unknown and set to -1.<br>
The device socket ID wrapped around to 255,<br>
and caused errors when allocating memory.<br>
<br>
Changing this field type to int fixes the issue, as it now takes the<br>
correct -1 value.<br>
<br>
Fixes: 7dcd73e37965 ("drivers/bus: set device NUMA node to unknown by default")<br>
Cc: olivier.matz@6wind.com<br>
<br>
Signed-off-by: Ciara Power <ciara.power@intel.com><br>
---<br>
 lib/cryptodev/cryptodev_pmd.h | 2 +-<br>
 1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h<br>
index 8710ed7558..4c98cedca6 100644<br>
--- a/lib/cryptodev/cryptodev_pmd.h<br>
+++ b/lib/cryptodev/cryptodev_pmd.h<br>
@@ -65,7 +65,7 @@ struct rte_cryptodev_data {<br>
         /** Device ID for this instance */<br>
         uint8_t dev_id;<br>
         /** Socket ID where memory is allocated */<br>
-       uint8_t socket_id;<br>
+       int socket_id;<br>
         /** Unique identifier name */<br>
         char name[RTE_CRYPTODEV_NAME_MAX_LEN];<br>
 <br>
-- <br>
2.25.1<br>
<br>
</div>
</span></font></div>
</body>
</html>