From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 48D5FA04B1 for ; Mon, 23 Nov 2020 18:13:34 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3F4D5C8E4; Mon, 23 Nov 2020 18:13:33 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by dpdk.org (Postfix) with ESMTP id EAC32C904 for ; Mon, 23 Nov 2020 18:13:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606151609; 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=A7UUIUmmkyc/DF+RONVMjboy7tRQl4HADGZj0GfqXRM=; b=CYK3lNgFfTUO3ztZTY/KGTNPiGa93kYgkR4CvGeqNbgERy9DysyM1VXt0aq8lg8MY9QAUl 56hAjG+stUIY6xpmW60a2kCiNhrM+eQuxOFHzFXa6tqVl9Og+5k9QKL3MB9SDwNkxE0XuU EEdjTggUFD+xymq8+iLF5arOORXzSqM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-557-CzdGXrOrPaqrJw_ZT_nezg-1; Mon, 23 Nov 2020 12:13:26 -0500 X-MC-Unique: CzdGXrOrPaqrJw_ZT_nezg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 38DF687951F; Mon, 23 Nov 2020 17:13:25 +0000 (UTC) Received: from rh.redhat.com (ovpn-112-19.ams2.redhat.com [10.36.112.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1EB2960C04; Mon, 23 Nov 2020 17:13:23 +0000 (UTC) From: Kevin Traynor To: Didier Pallard Cc: Maxime Leroy , Viacheslav Ovsiienko , dpdk stable Date: Mon, 23 Nov 2020 17:12:16 +0000 Message-Id: <20201123171222.79398-24-ktraynor@redhat.com> In-Reply-To: <20201123171222.79398-1-ktraynor@redhat.com> References: <20201123171222.79398-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Subject: [dpdk-stable] patch 'net/mlx5: fix Rx descriptor status' has been queued to LTS release 18.11.11 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.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 11/27/20. 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-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/b8a7d45b93255969067b0150fa9d086fa86586a1 Thanks. Kevin. --- >From b8a7d45b93255969067b0150fa9d086fa86586a1 Mon Sep 17 00:00:00 2001 From: Didier Pallard Date: Tue, 17 Nov 2020 12:26:47 +0100 Subject: [PATCH] net/mlx5: fix Rx descriptor status [ upstream commit 7c085d3a4a06b60cd04a408d7edf4e9382172a42 ] Three bugs in rx_queue_count function: - One entry may contain several segments, so 'used' must be multiplied by number of segments per entry to properly reflect the queue usage. - The number of cqes is equals to (1U << rxq->elts_n) - 1 in SPRQ mode. The range returned by rx_queue_count should be the number of entries used in queue, so it ranges from 0 to max number of entries in queue, not this number minus one. - For MPRQ mode, we need to take into account of the number of strd. Fixes: 8788fec1f269 ("net/mlx5: implement descriptor status API") Signed-off-by: Didier Pallard Signed-off-by: Maxime Leroy Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_rxtx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index dd7b183395..c9305334d0 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -432,4 +432,7 @@ rx_queue_count(struct mlx5_rxq_data *rxq) volatile struct mlx5_cqe *cqe; const unsigned int cqe_n = (1 << rxq->cqe_n); + const unsigned int sges_n = (1 << rxq->sges_n); + const unsigned int elts_n = (1 << rxq->elts_n); + const unsigned int strd_n = (1 << rxq->strd_num_n); const unsigned int cqe_cnt = cqe_n - 1; unsigned int cq_ci, used; @@ -457,5 +460,5 @@ rx_queue_count(struct mlx5_rxq_data *rxq) cqe = &(*rxq->cqes)[cq_ci & cqe_cnt]; } - used = RTE_MIN(used, cqe_n); + used = RTE_MIN(used * sges_n, elts_n * strd_n); return used; } -- 2.26.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-11-23 17:10:14.558324428 +0000 +++ 0024-net-mlx5-fix-Rx-descriptor-status.patch 2020-11-23 17:10:14.009061603 +0000 @@ -1 +1 @@ -From 7c085d3a4a06b60cd04a408d7edf4e9382172a42 Mon Sep 17 00:00:00 2001 +From b8a7d45b93255969067b0150fa9d086fa86586a1 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 7c085d3a4a06b60cd04a408d7edf4e9382172a42 ] + @@ -16 +17,0 @@ -Cc: stable@dpdk.org @@ -26 +27 @@ -index 2733dcd3ff..2ecf901fb1 100644 +index dd7b183395..c9305334d0 100644 @@ -29 +30 @@ -@@ -464,4 +464,7 @@ rx_queue_count(struct mlx5_rxq_data *rxq) +@@ -432,4 +432,7 @@ rx_queue_count(struct mlx5_rxq_data *rxq) @@ -37 +38 @@ -@@ -489,5 +492,5 @@ rx_queue_count(struct mlx5_rxq_data *rxq) +@@ -457,5 +460,5 @@ rx_queue_count(struct mlx5_rxq_data *rxq)