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 0B6A843829 for ; Fri, 8 Mar 2024 15:32:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0691D42F0D; Fri, 8 Mar 2024 15:32:40 +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 9468740E2D for ; Fri, 8 Mar 2024 15:32:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709908358; 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=t8LkOVtKYHk9PSHg547GaGzE/SRp8kkRU8ph+85Bk7c=; b=eFIuKfer7kvZfDMq2w2j4+AmobPVjGSLRtoeJYV9jWnblt0r5XBDRWLMAJ3Umzt5Lwp+vL zb1dUln141qSjPd+QITnusmsSJtoBO/igHSE1aElmpgoIMojwWFYkvymxbqbnuc5/+fA/z +quwbQiaub4/NxWSWrWcxsHnAHxwweM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-477-Gsl8NxOdOg-QaWFcrj3Q1A-1; Fri, 08 Mar 2024 09:32:35 -0500 X-MC-Unique: Gsl8NxOdOg-QaWFcrj3Q1A-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id BE2D285A58B; Fri, 8 Mar 2024 14:32:34 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.194.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9EFD537FC; Fri, 8 Mar 2024 14:32:32 +0000 (UTC) From: Kevin Traynor To: Viacheslav Ovsiienko Cc: Dariusz Sosnowski , dpdk stable Subject: patch 'net/mlx5: fix error packets drop in regular Rx' has been queued to stable release 21.11.7 Date: Fri, 8 Mar 2024 14:28:13 +0000 Message-ID: <20240308142824.528417-25-ktraynor@redhat.com> In-Reply-To: <20240308142824.528417-1-ktraynor@redhat.com> References: <20240308142824.528417-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 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 21.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/13/24. 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/c52e6e0ecda72ad163fc7757abe825105d7a16c8 Thanks. Kevin --- >From c52e6e0ecda72ad163fc7757abe825105d7a16c8 Mon Sep 17 00:00:00 2001 From: Viacheslav Ovsiienko Date: Tue, 20 Feb 2024 13:45:20 +0200 Subject: [PATCH] net/mlx5: fix error packets drop in regular Rx [ upstream commit ef296e8f6140ea469b50c7bfe73501b1c9ef86e1 ] When packet gets received with error it is reported in CQE structure and PMD analyzes the error syndrome and provides two options - either reset the entire queue for the critical errors, or just ignore the packet. The non-vectorized rx_burst did not ignore the non-critical error packets, and in case of packet length exceeding the mbuf data buffer length it took the next element in the queue WQE ring, resulting in CQE/WQE consume indices synchronization lost. Fixes: aa67ed308458 ("net/mlx5: ignore non-critical syndromes for Rx queue") Signed-off-by: Viacheslav Ovsiienko Acked-by: Dariusz Sosnowski --- drivers/net/mlx5/mlx5_rx.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rx.c b/drivers/net/mlx5/mlx5_rx.c index ab88f2526f..eea6a5c6c7 100644 --- a/drivers/net/mlx5/mlx5_rx.c +++ b/drivers/net/mlx5/mlx5_rx.c @@ -584,5 +584,6 @@ mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec, * Indication if it is called from MPRQ. * @return - * 0 in case of empty CQE, MLX5_REGULAR_ERROR_CQE_RET in case of error CQE, + * 0 in case of empty CQE, + * MLX5_REGULAR_ERROR_CQE_RET in case of error CQE, * MLX5_CRITICAL_ERROR_CQE_RET in case of error CQE lead to Rx queue reset, * otherwise the packet size in regular RxQ, @@ -658,4 +659,9 @@ mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe, ret == MLX5_RECOVERY_COMPLETED_RET) return MLX5_CRITICAL_ERROR_CQE_RET; + if (!mprq && ret == MLX5_RECOVERY_IGNORE_RET) { + *skip_cnt = 1; + ++rxq->cq_ci; + return MLX5_ERROR_CQE_MASK; + } } else { return 0; @@ -911,17 +917,16 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n) len = mlx5_rx_poll_len(rxq, cqe, cqe_cnt, &mcqe, &skip_cnt, false); if (unlikely(len & MLX5_ERROR_CQE_MASK)) { + /* We drop packets with non-critical errors */ + rte_mbuf_raw_free(rep); if (len == MLX5_CRITICAL_ERROR_CQE_RET) { - rte_mbuf_raw_free(rep); rq_ci = rxq->rq_ci << sges_n; break; } + /* Skip specified amount of error CQEs packets */ rq_ci >>= sges_n; rq_ci += skip_cnt; rq_ci <<= sges_n; - idx = rq_ci & wqe_cnt; - wqe = &((volatile struct mlx5_wqe_data_seg *)rxq->wqes)[idx]; - seg = (*rxq->elts)[idx]; - cqe = &(*rxq->cqes)[rxq->cq_ci & cqe_cnt]; - len = len & ~MLX5_ERROR_CQE_MASK; + MLX5_ASSERT(!pkt); + continue; } if (len == 0) { -- 2.43.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-03-08 13:47:49.768500536 +0000 +++ 0025-net-mlx5-fix-error-packets-drop-in-regular-Rx.patch 2024-03-08 13:47:49.024686681 +0000 @@ -1 +1 @@ -From ef296e8f6140ea469b50c7bfe73501b1c9ef86e1 Mon Sep 17 00:00:00 2001 +From c52e6e0ecda72ad163fc7757abe825105d7a16c8 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit ef296e8f6140ea469b50c7bfe73501b1c9ef86e1 ] + @@ -18 +19,0 @@ -Cc: stable@dpdk.org @@ -27 +28 @@ -index 5bf1a679b2..cc087348a4 100644 +index ab88f2526f..eea6a5c6c7 100644 @@ -30 +31 @@ -@@ -614,5 +614,6 @@ mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec, +@@ -584,5 +584,6 @@ mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec, @@ -38 +39 @@ -@@ -698,4 +699,9 @@ mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe, +@@ -658,4 +659,9 @@ mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe, @@ -48,2 +49,2 @@ -@@ -972,17 +978,16 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n) - len = mlx5_rx_poll_len(rxq, cqe, cqe_n, cqe_mask, &mcqe, &skip_cnt, false); +@@ -911,17 +917,16 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n) + len = mlx5_rx_poll_len(rxq, cqe, cqe_cnt, &mcqe, &skip_cnt, false); @@ -62 +63 @@ -- idx = rq_ci & wqe_mask; +- idx = rq_ci & wqe_cnt; @@ -65 +66 @@ -- cqe = &(*rxq->cqes)[rxq->cq_ci & cqe_mask]; +- cqe = &(*rxq->cqes)[rxq->cq_ci & cqe_cnt];