DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Ji, Kai" <kai.ji@intel.com>,
	"Power, Ciara" <ciara.power@intel.com>, <dev@dpdk.org>
Cc: "Matz, Olivier" <olivier.matz@6wind.com>,
	"Akhil Goyal" <gakhil@marvell.com>,
	"Fan Zhang" <fanzhang.oss@gmail.com>,
	"Bruce Richardson" <bruce.richardson@intel.com>
Subject: RE: [PATCH] cryptodev: fix device socket ID type
Date: Wed, 5 Jul 2023 11:44:50 +0200	[thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D87A61@smartserver.smartshare.dk> (raw)
In-Reply-To: <SN6PR11MB34082127B1ABA0DD95C2E5CC812EA@SN6PR11MB3408.namprd11.prod.outlook.com>

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

  reply	other threads:[~2023-07-05  9:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-29 13:21 Ciara Power
2023-07-04 22:30 ` Ji, Kai
2023-07-05  9:44   ` Morten Brørup [this message]
2023-07-05 10:36 ` [PATCH v2] " Ciara Power
2023-07-05 11:29   ` Konstantin Ananyev
2023-07-05 18:23     ` [EXT] " Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=98CBD80474FA8B44BF855DF32C47DC35D87A61@smartserver.smartshare.dk \
    --to=mb@smartsharesystems.com \
    --cc=bruce.richardson@intel.com \
    --cc=ciara.power@intel.com \
    --cc=dev@dpdk.org \
    --cc=fanzhang.oss@gmail.com \
    --cc=gakhil@marvell.com \
    --cc=kai.ji@intel.com \
    --cc=olivier.matz@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).