From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F575606A31F for ; Sat, 5 Dec 2026 20:53:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=networkplumber-org.20260707.gappssmtp.com header.i=@networkplumber-org.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=sL9ZKbcF Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AB6FC40EA5; Sat, 5 Dec 2026 21:52:39 +0100 (CET) Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by mails.dpdk.org (Postfix) with ESMTPS id 22E2840E5E for ; Sat, 5 Dec 2026 21:52:36 +0100 (CET) Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-8d1aec63541so905753b3a.3 for ; Sat, 05 Dec 2026 12:52:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20260707.gappssmtp.com; s=20260707; t=1796503954; x=1797108754; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=90UqQpyL0orEpaf1g9O3SQmOhaPOIMtxxYAfSexDNuU=; b=sL9ZKbcFS/DGvNskJiDEaiFrbHXbrBYWO975OGcJ/t78ZuhJc8gcLvgS/FhrR3sVBf cC/geiNP5d2XhLoP5fh1osWc/BscWhdZdPdzvLDlZVhe6SixISES4I949uE4JBlYDAUs pcZm4Y+cmfTAIOvUiRt6fmfOMLgV4EccsxSeXHjgbVPS+Egj3oVCgmt5deas/NMTugB9 RrB/f78lAWpFF9lk2Erdr2QG7qw7UdxXfued4AnF3lAXhfQotDBb4o6A7fSXBnuAWTKV sFLPEtBJ/a5LSfCC5csEHGRTvP/7oviX0+hiPJfYRFUOgqtg2DB3kfgOXfN9VLLV7HTq D4TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796503954; x=1797108754; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=90UqQpyL0orEpaf1g9O3SQmOhaPOIMtxxYAfSexDNuU=; b=lVzmGO2ivQzPkvksqA/jVWNfo9nuuUDLToDPlYd7xiH4UpHZOD/GxJ1B1rmdL34lYZ HXpTyH58ChzjWTjABVTITsqx+FjoxNboDVAmfE+XzSKWzRPtNm9ub2QJcDZLoBAOuQQQ XUAn4EIkBP6G8AzgVBjFAXwP8u6zajHXIjRsZkLOUGVKr6eA85QOgl3PXr5aNslp+gAT BitI1TRQvRAfSq+sH1KRwgn6s20bGw/rxMwkKTwHiSXp6VXrNBT6aef/ywgcFaWZ76f+ MFOzvpGEQBD8B+0tSwQIh+1RbU7IgjFujzmcuF5FXR+wu7C1So7K7ouSJBVLlN9F52dX eTFw== X-Gm-Message-State: AB4q+uFFq4p9wCgKSvsQhhBNKDxkJ74THn+FS+m7My+RRfYn6AWTAr6H pm+6eQ4EJVCt0V1NiqZb+IHjPTDiHJ92WNwJwIYchQu6gwFt2b+r8HWXKUvGIawDa2ZAQC0Nas0 95YkV/CU= X-Gm-Gg: AZFdTZeBW9PolPjqukUG8W76SKE9q3ywlKcsvCoqChDCCxTr5Ne8u9sumK57nvrSewi 16gxSumFLBjrpknCZaDb+4o+elPeYqbkyw1Z6fbBzIpfGOQ+4OlmT5eTNfShLkjfCwIbPCFi5mi usmuxeYqi3B0Lw1EKXudeL5G3N/H7hhcIeeoMsa9ubBMfAyBAN+7YU4n7xVFWCfSe1kTG+qHjdf miAJVYTZlBGWWa2HOufNcC1ySzO7YYgJlGrpqzAU5+PSbLoA9Qc/G17yIkOFkixNTxgknRqtcvi s8M8LVJdyj5k86b8YDNwDItydWi4+u8s8DnIWO8Mn+XaXONDECPIT7dyUtJrmfkuGtTXYB4slGW XpumtQ9zbKCC9jGfOtGSAXNVPs3vUnamH6EwHxxSadHG9SpnFE3ifa+TxOwM/p9+i2hQ2P+jsAw OVdUbqwkrC1DjU99009lBzF5a59Zjr2fOQe4Ztjp0FFRBoQ3X2QLrJmwx62j2EB/28+1wIzCdv9 gD98ZQml+I2wwuF4JYe/i2rfR9eS1F3iBHtO7KDvsdYzS3msxIe9SjwvDaBh8xIvCaMjqZn2qNp kg7ZnxDAboeGLrUY8QbFhsiDtoSTu2hv4ormSAKW4uQBGmsqZ/u2rkfd8PqbNJk0uIye X-Received: by 2002:a17:90b:5346:b0:3ac:9c37:942e with SMTP id 98e67ed59e1d1-3b5e065799dmr5928422a91.49.1796503954558; Sat, 05 Dec 2026 12:52:34 -0800 (PST) Received: from phoenix.lan (204-195-112-43.wavecable.com. [204.195.112.43]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b6166c7c72sm2965998a91.3.2026.12.05.12.52.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Dec 2026 12:52:34 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Thomas Monjalon , Bruce Richardson Subject: [PATCH v5 08/68] net/ring: make NUMA node signed Date: Sat, 5 Dec 2026 12:49:39 -0800 Message-ID: <20261205205221.1131118-9-stephen@networkplumber.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261205205221.1131118-1-stephen@networkplumber.org> References: <20260914054912.755403-1-stephen@networkplumber.org> <20261205205221.1131118-1-stephen@networkplumber.org> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 rte_eth_from_rings() takes a numa node (socket) but used unsigned where int should have been used to allow for SOCKET_ID_ANY. The only usage is in call rte_malloc routines with socket and those functions expect int. Change the parameter to int socket_id and carry that through the two internal create functions. The devargs path keeps working as before: "nodeaction=name:-1:CREATE" was already accepted, since strtol() returned -1 into an unsigned int which became SOCKET_ID_ANY again at the allocation. The ABI checker flags the signedness change on an exported function. It is not a binary change: int and unsigned int are the same size and in the same register class, and rte_zmalloc_socket() and rte_ring_create() already took the value as an int, so an old caller passing (unsigned)-1 reached them as SOCKET_ID_ANY before this patch too. Suppress the warning until the next major ABI version. Signed-off-by: Stephen Hemminger --- devtools/libabigail.abignore | 6 ++++ doc/guides/rel_notes/release_27_03.rst | 4 +++ drivers/net/ring/rte_eth_ring.c | 38 +++++++++++++------------- drivers/net/ring/rte_eth_ring.h | 11 ++++---- 4 files changed, 35 insertions(+), 24 deletions(-) diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore index 21b8cd6113..6b7772565d 100644 --- a/devtools/libabigail.abignore +++ b/devtools/libabigail.abignore @@ -33,3 +33,9 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Temporary exceptions till next major ABI version ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; The numa node parameter of rte_eth_from_rings() changed from unsigned +; to int so that SOCKET_ID_ANY can be passed. Same size and the value was +; already converted to int internally, so old binaries are unaffected. +[suppress_function] + name = rte_eth_from_rings diff --git a/doc/guides/rel_notes/release_27_03.rst b/doc/guides/rel_notes/release_27_03.rst index a91813faca..36101f52d6 100644 --- a/doc/guides/rel_notes/release_27_03.rst +++ b/doc/guides/rel_notes/release_27_03.rst @@ -84,6 +84,10 @@ API Changes Also, make sure to start the actual text at the margin. ======================================================= +* net/ring: the last parameter of ``rte_eth_from_rings()`` changed from + ``const unsigned numa_node`` to ``int socket_id``, so that + ``SOCKET_ID_ANY`` can be passed. + ABI Changes ----------- diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c index d75ae2cbed..4204e1d661 100644 --- a/drivers/net/ring/rte_eth_ring.c +++ b/drivers/net/ring/rte_eth_ring.c @@ -32,7 +32,7 @@ struct ring_internal_args { const unsigned int nb_rx_queues; struct rte_ring * const *tx_queues; const unsigned int nb_tx_queues; - const unsigned int numa_node; + int socket_id; }; /* rte_eth_from_rings() stashes a pointer to its on-stack args here */ @@ -361,7 +361,7 @@ do_eth_dev_ring_create(const char *name, const unsigned int nb_rx_queues, struct rte_ring *const tx_queues[], const unsigned int nb_tx_queues, - const unsigned int numa_node, enum dev_action action, + int socket_id, enum dev_action action, struct rte_eth_dev **eth_dev_p) { struct rte_eth_dev_data *data = NULL; @@ -371,24 +371,24 @@ do_eth_dev_ring_create(const char *name, void **tx_queues_local = NULL; unsigned int i; - PMD_LOG(INFO, "Creating rings-backed ethdev on numa socket %u", - numa_node); + PMD_LOG(INFO, "Creating rings-backed ethdev on numa socket %d", + socket_id); rx_queues_local = rte_calloc_socket(name, nb_rx_queues, - sizeof(void *), 0, numa_node); + sizeof(void *), 0, socket_id); if (rx_queues_local == NULL) { rte_errno = ENOMEM; goto error; } tx_queues_local = rte_calloc_socket(name, nb_tx_queues, - sizeof(void *), 0, numa_node); + sizeof(void *), 0, socket_id); if (tx_queues_local == NULL) { rte_errno = ENOMEM; goto error; } - internals = rte_zmalloc_socket(name, sizeof(*internals), 0, numa_node); + internals = rte_zmalloc_socket(name, sizeof(*internals), 0, socket_id); if (internals == NULL) { rte_errno = ENOMEM; goto error; @@ -404,7 +404,7 @@ do_eth_dev_ring_create(const char *name, /* now put it all together * - store EAL device in eth_dev, * - store queue data in internals, - * - store numa_node info in eth_dev_data + * - store socket id info in eth_dev_data * - point eth_dev_data to internals * - and point eth_dev structure to new eth_dev_data structure */ @@ -439,7 +439,7 @@ do_eth_dev_ring_create(const char *name, data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS; eth_dev->dev_ops = &ops; - data->numa_node = numa_node; + data->numa_node = socket_id; /* finally assign rx and tx ops */ eth_dev->rx_pkt_burst = eth_ring_rx; @@ -464,14 +464,14 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[], const unsigned int nb_rx_queues, struct rte_ring *const tx_queues[], const unsigned int nb_tx_queues, - const unsigned int numa_node) + int socket_id) { struct ring_internal_args args = { .rx_queues = rx_queues, .nb_rx_queues = nb_rx_queues, .tx_queues = tx_queues, .nb_tx_queues = nb_tx_queues, - .numa_node = numa_node, + .socket_id = socket_id, }; char ring_name[RTE_RING_NAMESIZE]; uint16_t port_id = RTE_MAX_ETHPORTS; @@ -526,7 +526,7 @@ rte_eth_from_ring(struct rte_ring *r) static int eth_dev_ring_create(const char *name, struct rte_vdev_device *vdev, - const unsigned int numa_node, + int socket_id, enum dev_action action, struct rte_eth_dev **eth_dev) { /* rx and tx are so-called from point of view of first port. @@ -549,7 +549,7 @@ eth_dev_ring_create(const char *name, } rxtx[i] = (action == DEV_CREATE) ? - rte_ring_create(rng_name, 1024, numa_node, + rte_ring_create(rng_name, 1024, socket_id, RING_F_SP_ENQ|RING_F_SC_DEQ) : rte_ring_lookup(rng_name); if (rxtx[i] == NULL) @@ -557,7 +557,7 @@ eth_dev_ring_create(const char *name, } if (do_eth_dev_ring_create(name, vdev, rxtx, num_rings, rxtx, num_rings, - numa_node, action, eth_dev) < 0) + socket_id, action, eth_dev) < 0) return -1; return 0; @@ -565,7 +565,7 @@ eth_dev_ring_create(const char *name, struct node_action_pair { char name[ETH_RING_ACTION_MAX_LEN]; - unsigned int node; + int socket_id; enum dev_action action; }; @@ -626,7 +626,7 @@ static int parse_kvlist(const char *key __rte_unused, goto out; errno = 0; - info->list[info->count].node = strtol(node, &end, 10); + info->list[info->count].socket_id = strtol(node, &end, 10); if ((errno != 0) || (*end != '\0')) { PMD_LOG(WARNING, @@ -686,7 +686,7 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) internal_args->nb_rx_queues, internal_args->tx_queues, internal_args->nb_tx_queues, - internal_args->numa_node, + internal_args->socket_id, DEV_ATTACH, ð_dev); return ret >= 0 ? 0 : ret; @@ -740,7 +740,7 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) for (info->count = 0; info->count < info->total; info->count++) { ret = eth_dev_ring_create(info->list[info->count].name, dev, - info->list[info->count].node, + info->list[info->count].socket_id, info->list[info->count].action, ð_dev); if (ret == -1 && info->list[info->count].action == DEV_CREATE) { @@ -748,7 +748,7 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) "Attach to pmd_ring for %s", name); ret = eth_dev_ring_create(name, dev, - info->list[info->count].node, + info->list[info->count].socket_id, DEV_ATTACH, ð_dev); } diff --git a/drivers/net/ring/rte_eth_ring.h b/drivers/net/ring/rte_eth_ring.h index 98292c7b33..dfbfce9f2f 100644 --- a/drivers/net/ring/rte_eth_ring.h +++ b/drivers/net/ring/rte_eth_ring.h @@ -24,17 +24,18 @@ extern "C" { * pointer to array of rte_rings to be used as TX queues * @param nb_tx_queues * number of elements in the tx_queues array - * @param numa_node - * the numa node on which the memory for this port is to be allocated + * @param socket_id + * the NUMA socket on which the memory for this port is to be allocated, + * or SOCKET_ID_ANY * @return * the port number of the newly created the ethdev or -1 on error. */ int rte_eth_from_rings(const char *name, struct rte_ring * const rx_queues[], - const unsigned nb_rx_queues, + const unsigned int nb_rx_queues, struct rte_ring *const tx_queues[], - const unsigned nb_tx_queues, - const unsigned numa_node); + const unsigned int nb_tx_queues, + int socket_id); /** * Create a new ethdev port from a ring -- 2.53.0