From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9DAC448A44 for ; Fri, 31 Oct 2025 15:35:57 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 96FB940150; Fri, 31 Oct 2025 15:35:57 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id E8C7340150 for ; Fri, 31 Oct 2025 15:35:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761921356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lpt1znAIe2nzLEaoppjqtNA8ChARX0syfko1s3bqgKY=; b=Dfnkv3WCyQNWpNuOa68NJWQ9dyPtFxzBfx6aaIJcQt562z1ze9Ip9MyprrFyAtszbDw6+S 9SlgyEMu0/Wh3Vov5bk5djsb42dy8O/i254BCAa20y3clsVtQXZjGf8r3pD3ixmTAd4Iyl fwylsouIbEX4e9rnT9nFeUxNBvWA3K8= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-231-qBshrEHUNLyOTHxI8WL4jg-1; Fri, 31 Oct 2025 10:35:53 -0400 X-MC-Unique: qBshrEHUNLyOTHxI8WL4jg-1 X-Mimecast-MFC-AGG-ID: qBshrEHUNLyOTHxI8WL4jg_1761921351 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F101B1800378; Fri, 31 Oct 2025 14:35:50 +0000 (UTC) Received: from rh.redhat.com (unknown [10.44.32.50]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 572A018004D4; Fri, 31 Oct 2025 14:35:48 +0000 (UTC) From: Kevin Traynor To: Ronak Doshi Cc: Jochen Behrens , dpdk stable Subject: patch 'net/vmxnet3: fix mapping of mempools to queues' has been queued to stable release 24.11.4 Date: Fri, 31 Oct 2025 14:32:18 +0000 Message-ID: <20251031143421.324432-16-ktraynor@redhat.com> In-Reply-To: <20251031143421.324432-1-ktraynor@redhat.com> References: <20251031143421.324432-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: VrdOy0IkgCR6PzMrOQDGK3gFfdLmpElDcL0xo1raox8_1761921351 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 24.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/05/25. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/bfbe8bfeaf09e502026d7b4cf596135e9c58b87c Thanks. Kevin --- >From bfbe8bfeaf09e502026d7b4cf596135e9c58b87c Mon Sep 17 00:00:00 2001 From: Ronak Doshi Date: Wed, 9 Jul 2025 21:29:03 +0000 Subject: [PATCH] net/vmxnet3: fix mapping of mempools to queues [ upstream commit 387b6e0cca4ebbb1d2f8c03da5b9d4051dfef913 ] Index bitmask variable used was uint8_t, too small for bitmask with 9 or more queues. This patch changes it to uint16_t for now, to be same as in the Vmxnet3_MemoryRegion structure. This way txQueues can be lesser than rxQueues and have correct mapping of memory regions. Also, the patch fixes memory region check as 16 queues are allowed on both RX and TX. Fixes: 6a113992060e ("net/vmxnet3: add cmd to register memory region") Signed-off-by: Ronak Doshi Acked-by: Jochen Behrens --- drivers/net/vmxnet3/base/vmxnet3_defs.h | 3 +++ drivers/net/vmxnet3/vmxnet3_ethdev.c | 23 ++++++++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/drivers/net/vmxnet3/base/vmxnet3_defs.h b/drivers/net/vmxnet3/base/vmxnet3_defs.h index a6bb281d8d..15d4d88c5c 100644 --- a/drivers/net/vmxnet3/base/vmxnet3_defs.h +++ b/drivers/net/vmxnet3/base/vmxnet3_defs.h @@ -599,4 +599,7 @@ enum vmxnet3_intr_type { #define VMXNET3_MAX_INTRS 25 +/* Max number of queues that can request memreg, for both RX and TX. */ +#define VMXNET3_MAX_MEMREG_QUEUES 16 + /* Version 6 and later will use below macros */ #define VMXNET3_EXT_MAX_TX_QUEUES 32 diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c index 15ca25b187..e19aa43888 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c @@ -802,6 +802,7 @@ vmxnet3_dev_setup_memreg(struct rte_eth_dev *dev) Vmxnet3_CmdInfo *cmdInfo; struct rte_mempool *mp[VMXNET3_MAX_RX_QUEUES]; - uint8_t index[VMXNET3_MAX_RX_QUEUES + VMXNET3_MAX_TX_QUEUES]; - uint32_t num, i, j, size; + uint16_t index[VMXNET3_MAX_MEMREG_QUEUES]; + uint16_t tx_index_mask; + uint32_t num, tx_num, i, j, size; if (hw->memRegsPA == 0) { @@ -809,5 +810,5 @@ vmxnet3_dev_setup_memreg(struct rte_eth_dev *dev) size = sizeof(Vmxnet3_MemRegs) + - (VMXNET3_MAX_RX_QUEUES + VMXNET3_MAX_TX_QUEUES) * + (2 * VMXNET3_MAX_MEMREG_QUEUES) * sizeof(Vmxnet3_MemoryRegion); @@ -823,5 +824,7 @@ vmxnet3_dev_setup_memreg(struct rte_eth_dev *dev) } - num = hw->num_rx_queues; + num = RTE_MIN(hw->num_rx_queues, VMXNET3_MAX_MEMREG_QUEUES); + tx_num = RTE_MIN(hw->num_tx_queues, VMXNET3_MAX_MEMREG_QUEUES); + tx_index_mask = (uint16_t)((1UL << tx_num) - 1); for (i = 0; i < num; i++) { @@ -858,11 +861,13 @@ vmxnet3_dev_setup_memreg(struct rte_eth_dev *dev) mr->length = STAILQ_FIRST(&mp[i]->mem_list)->len <= INT32_MAX ? STAILQ_FIRST(&mp[i]->mem_list)->len : INT32_MAX; - mr->txQueueBits = index[i]; mr->rxQueueBits = index[i]; + /* tx uses same pool, but there may be fewer tx queues */ + mr->txQueueBits = index[i] & tx_index_mask; PMD_INIT_LOG(INFO, "index: %u startPA: %" PRIu64 " length: %u, " - "rxBits: %x", - j, mr->startPA, mr->length, mr->rxQueueBits); + "rxBits: %x, txBits: %x", + j, mr->startPA, mr->length, + mr->rxQueueBits, mr->txQueueBits); j++; } @@ -1088,6 +1093,6 @@ vmxnet3_dev_start(struct rte_eth_dev *dev) /* Check memregs restrictions first */ - if (dev->data->nb_rx_queues <= VMXNET3_MAX_RX_QUEUES && - dev->data->nb_tx_queues <= VMXNET3_MAX_TX_QUEUES) { + if (dev->data->nb_rx_queues <= VMXNET3_MAX_MEMREG_QUEUES && + dev->data->nb_tx_queues <= VMXNET3_MAX_MEMREG_QUEUES) { ret = vmxnet3_dev_setup_memreg(dev); if (ret == 0) { -- 2.51.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-10-31 13:53:52.769341733 +0000 +++ 0016-net-vmxnet3-fix-mapping-of-mempools-to-queues.patch 2025-10-31 13:53:52.024523331 +0000 @@ -1 +1 @@ -From 387b6e0cca4ebbb1d2f8c03da5b9d4051dfef913 Mon Sep 17 00:00:00 2001 +From bfbe8bfeaf09e502026d7b4cf596135e9c58b87c Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 387b6e0cca4ebbb1d2f8c03da5b9d4051dfef913 ] + @@ -15 +16,0 @@ -Cc: stable@dpdk.org