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 27B31A0C41 for ; Tue, 30 Nov 2021 17:40:09 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2214A41148; Tue, 30 Nov 2021 17:40:09 +0100 (CET) Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by mails.dpdk.org (Postfix) with ESMTP id B1405410F7 for ; Tue, 30 Nov 2021 17:40:07 +0100 (CET) Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (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 smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 9378D3F1B1 for ; Tue, 30 Nov 2021 16:40:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638290407; bh=jMyzCFceXPsd6gy3A0aEP7g+um/iOWcyjXubgkKFtBM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=PalOFDOWRq5Hb0HQIad3ydJQBQfPNzlHZ1Nk+iCJLEqOVucfO8cc6jLZbnPVY9bT3 zcNAspn8ZPshFMv/tS/I5OYuCvxvwjWMOvlJz5AG32euAhnYEFb1qF0+3am+H6dXWJ /5oUvmcNKFk1/Kq1oy8fxDxksmy6h8mslnvPZr5hIHOw/xRSEPnCBo4sFyTl7iF4DY 1rizubmEsZMSRmFcX8ZD6KjSA1/gCYDzbpf/pD5w27jDcYaKc2HvWq9bhRxx05/thZ wI1GyBS409JMAgvhjzehpSpOHUOQ9J6WBu+DAsiHdqIjek+HTCzItfqBDtqpWlvx57 G6gJy/1xMebhw== Received: by mail-ed1-f69.google.com with SMTP id w5-20020a05640234c500b003f1b9ab06d2so5322908edc.13 for ; Tue, 30 Nov 2021 08:40:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jMyzCFceXPsd6gy3A0aEP7g+um/iOWcyjXubgkKFtBM=; b=B6K6TkyClUex4eTRqzTGXBQEXsrNycd35etHsICTJRbRvJ/Bb5O4+aAREVLLHK+NxO FNSyKbRigAuALmvhw0zCkUhE2ApOhUg/J0YQzz75LcaAyS83kZPwaId79oyxGNq6sqSY 8CdhDyWeWtGXUuDkG/1vvmTAGMnsBizTw1By9fqrtuLnXG16Cu9n+8bG6HAdArvDDQ4G 51LhzIIhQxwW97kSAMUtmbH0Z3oiH4Tq6oPvOcXcY5njLI2wIWWyV+AM12ne93IEavQx q2j2nXSQtoyy6vOFbJV+rIn3sXSt7xun/+zzbNGxK1QJ8ftxJ1mtmIjtuC8KjFde3JmU soyg== X-Gm-Message-State: AOAM531lMwksi3/hZrrLxwI4yrZ5VDViNnDiCnrcX43YU8xpSum1rCmB BN/4f284b/oHCgD/cY3owDWW2bj9m0worRy0f06+3UUHjpXauOVOMmOUWr7A9X8409f9ScNS9ia OtqIXJlbyPRP29qd8bfJUZYJo X-Received: by 2002:a17:906:2bd5:: with SMTP id n21mr173432ejg.337.1638290407308; Tue, 30 Nov 2021 08:40:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxo6rVP55T4Y3Cb1J1xDUjMUqYbG1u14tQLkZsQFn+BtzwKBb8DcOEze4KXwTK6/9Y+bae/FA== X-Received: by 2002:a17:906:2bd5:: with SMTP id n21mr173408ejg.337.1638290407140; Tue, 30 Nov 2021 08:40:07 -0800 (PST) Received: from localhost.localdomain ([2001:67c:1560:8007::aac:c4ad]) by smtp.gmail.com with ESMTPSA id z1sm11626017edq.54.2021.11.30.08.40.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Nov 2021 08:40:06 -0800 (PST) From: christian.ehrhardt@canonical.com To: Julien Meunier Cc: Haiyue Wang , dpdk stable Subject: patch 'net/ixgbe: fix queue release' has been queued to stable release 19.11.11 Date: Tue, 30 Nov 2021 17:34:40 +0100 Message-Id: <20211130163605.2460997-76-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211130163605.2460997-1-christian.ehrhardt@canonical.com> References: <20211130163605.2460997-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 19.11.11 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before December 10th 2021. 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/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/4d26daff818cd70cecc2899ebaaedc0311e4f988 Thanks. Christian Ehrhardt --- >From 4d26daff818cd70cecc2899ebaaedc0311e4f988 Mon Sep 17 00:00:00 2001 From: Julien Meunier Date: Tue, 28 Sep 2021 10:12:38 +0200 Subject: [PATCH] net/ixgbe: fix queue release [ upstream commit 6507e67af817183c69b684e81d820791eef18259 ] On the vector implementation, during the tear-down, the mbufs not drained in the RxQ and TxQ are freed based on an algorithm which supposed that the number of descriptors is a power of 2 (max_desc). Based on this hypothesis, this algorithm uses a bitmask in order to detect an index overflow during the iteration, and to restart the loop from 0. However, there is no such power of 2 requirement in the ixgbe for the number of descriptors in the RxQ / TxQ. The only requirement is to have a number correctly aligned. If a user requested to configure a number of descriptors which is not a power of 2, as a consequence, during the tear-down, it was possible to be in an infinite loop, and to never reach the exit loop condition. By removing the bitmask and changing the loop method, we can avoid this issue, and allow the user to configure a RxQ / TxQ which is not a power of 2. Fixes: c95584dc2b18 ("ixgbe: new vectorized functions for Rx/Tx") Signed-off-by: Julien Meunier Acked-by: Haiyue Wang --- drivers/net/ixgbe/ixgbe_rxtx_vec_common.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h b/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h index a97c27189b..e650feac82 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h @@ -152,7 +152,7 @@ _ixgbe_tx_queue_release_mbufs_vec(struct ixgbe_tx_queue *txq) /* release the used mbufs in sw_ring */ for (i = txq->tx_next_dd - (txq->tx_rs_thresh - 1); i != txq->tx_tail; - i = (i + 1) & max_desc) { + i = (i + 1) % txq->nb_tx_desc) { txe = &txq->sw_ring_v[i]; rte_pktmbuf_free_seg(txe->mbuf); } @@ -168,7 +168,6 @@ _ixgbe_tx_queue_release_mbufs_vec(struct ixgbe_tx_queue *txq) static inline void _ixgbe_rx_queue_release_mbufs_vec(struct ixgbe_rx_queue *rxq) { - const unsigned int mask = rxq->nb_rx_desc - 1; unsigned int i; if (rxq->sw_ring == NULL || rxq->rxrearm_nb >= rxq->nb_rx_desc) @@ -183,7 +182,7 @@ _ixgbe_rx_queue_release_mbufs_vec(struct ixgbe_rx_queue *rxq) } else { for (i = rxq->rx_tail; i != rxq->rxrearm_start; - i = (i + 1) & mask) { + i = (i + 1) % rxq->nb_rx_desc) { if (rxq->sw_ring[i].mbuf != NULL) rte_pktmbuf_free_seg(rxq->sw_ring[i].mbuf); } -- 2.34.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-30 16:50:10.324289013 +0100 +++ 0076-net-ixgbe-fix-queue-release.patch 2021-11-30 16:50:05.790873530 +0100 @@ -1 +1 @@ -From 6507e67af817183c69b684e81d820791eef18259 Mon Sep 17 00:00:00 2001 +From 4d26daff818cd70cecc2899ebaaedc0311e4f988 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 6507e67af817183c69b684e81d820791eef18259 ] + @@ -26 +27,0 @@ -Cc: stable@dpdk.org @@ -35 +36 @@ -index adba855ca3..005e60668a 100644 +index a97c27189b..e650feac82 100644