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 A5645A00C2 for ; Thu, 3 Nov 2022 10:30:45 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A14EA40694; Thu, 3 Nov 2022 10:30:45 +0100 (CET) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by mails.dpdk.org (Postfix) with ESMTP id EF13540693 for ; Thu, 3 Nov 2022 10:30:43 +0100 (CET) Received: by mail-wr1-f41.google.com with SMTP id bs21so1733494wrb.4 for ; Thu, 03 Nov 2022 02:30:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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; bh=tz5xl5rwAlJRH8E/O9AMqNlJokOpg70Se9g65by9KcA=; b=AfP2edlp4Jvjy9HaV05fI4oZqGEb2xc3BQBA9w5RyXoB+4PuScs0O9QcWLjKRV1iuA soTwR0Nu//IXC8xJY8ZtoEO3f5F4osRdgos4l4N4aJuvgyc0Cab/okaEMZw9C0O9C300 995yy7z+yCjvKcNaKVI7xtRHTSEcWkUe1DWhCRr9iLLqbKdhQ9RtO5rME/j/nZgcFj7E HV6ZXQdcrJA+Ya2f8nvUqL+5+tFet/npZRD+rUvd14IFkMTplcCREcZbrDSoJQib/Pe6 LviaBeHWgxAiwmcSMmOzqPUAYnNN9YTaIMd3h6gGH6VFxpclIIsklIvLsXbj8uAwCvxk 1LSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tz5xl5rwAlJRH8E/O9AMqNlJokOpg70Se9g65by9KcA=; b=LLhKePwcR/sLUr2mQZY28sxnCo9ys3pf3a9evKn1qOSUl+/rFv1PZhM+XNkqyP+DSg uewE9X7Cim79tZJ0VprfO+LexwwJw4JSBAWR1mv8niSI95NwkIC+MS7OEfnyur6/GC88 rOXSl8tq1jhG6KVl8eKwueV0TF4gsFxUcdpcE4aoRSgCZOsT/NA1kQyYfWnmqw+2D5b8 HhbuSxR2897kQDNfl01535TJFptiEsRaLZcK70qcLie+ijBfA1uPBrPsGud/SBz04T+O Z2PT1lC8wabZyxzHf1ncor9J2Dz8MDNVPpLmBredqO2kXnNSBreqPn/xEZ+a6+jn3S5O kN3w== X-Gm-Message-State: ACrzQf0IZoAojJ+2y2NV4UIZktIhmqJw8lsvcrL21u5hDvkGUlYM5/Aq MuREOisnWqLjcSGF41D6/qg= X-Google-Smtp-Source: AMsMyM4300xFPLD3cKvcVknSxrIW+TesGxD1rR+/2MSP5B6/4bQhu1Qx1XRvT0DRAHsl5OtS+BP2tw== X-Received: by 2002:adf:ec0b:0:b0:236:d76e:273f with SMTP id x11-20020adfec0b000000b00236d76e273fmr11818446wrn.179.1667467843605; Thu, 03 Nov 2022 02:30:43 -0700 (PDT) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id l6-20020a5d5266000000b00236a16c00ffsm349492wrc.43.2022.11.03.02.30.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 02:30:43 -0700 (PDT) From: luca.boccassi@gmail.com To: Viacheslav Ovsiienko Cc: Dmitry Kozlyuk , dpdk stable Subject: patch 'net/mlx5: fix inline length exceeding descriptor limit' has been queued to stable release 20.11.7 Date: Thu, 3 Nov 2022 09:27:04 +0000 Message-Id: <20221103092758.1099402-46-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221103092758.1099402-1-luca.boccassi@gmail.com> References: <20221103092758.1099402-1-luca.boccassi@gmail.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 20.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 11/05/22. 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/e577d667725a70e02d45e20199427aabbf52fea4 Thanks. Luca Boccassi --- >From e577d667725a70e02d45e20199427aabbf52fea4 Mon Sep 17 00:00:00 2001 From: Viacheslav Ovsiienko Date: Wed, 17 Aug 2022 17:13:57 +0300 Subject: [PATCH] net/mlx5: fix inline length exceeding descriptor limit [ upstream commit d15bfd2930f343baf3f9e3a20b6d5f948f783394 ] The hardware descriptor (WQE) length field is 6 bits wide and we have the native limitation for the overall descriptor length. To improve the PCIe bandwidth the packet data can be inline into descriptor. If PMD was configured to inline large amount of data it happened there was no enough space remaining in the descriptor to specify all the packet data segments and PMD rejected problematic packets. The patch tries to adjust the inline data length conservatively and allows to avoid error occurring. Fixes: 18a1c20044c0 ("net/mlx5: implement Tx burst template") Fixes: e2259f93ef45 ("net/mlx5: fix Tx when inlining is impossible") Signed-off-by: Viacheslav Ovsiienko Reviewed-by: Dmitry Kozlyuk --- drivers/net/mlx5/mlx5_rxtx.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index 1ba70264c8..436c207281 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -3575,8 +3575,24 @@ do_build: if (unlikely(loc->wqe_free < ((ds + 3) / 4))) return MLX5_TXCMP_CODE_EXIT; /* Check for maximal WQE size. */ - if (unlikely((MLX5_WQE_SIZE_MAX / MLX5_WSEG_SIZE) < ds)) - return MLX5_TXCMP_CODE_ERROR; + if (unlikely((MLX5_WQE_SIZE_MAX / MLX5_WSEG_SIZE) < ds)) { + /* Check if we can adjust the inline length. */ + if (unlikely(txq->inlen_mode)) { + ds = NB_SEGS(loc->mbuf) + 2 + + (txq->inlen_mode - + MLX5_ESEG_MIN_INLINE_SIZE + + MLX5_WSEG_SIZE + + MLX5_WSEG_SIZE - 1) / MLX5_WSEG_SIZE; + if (unlikely((MLX5_WQE_SIZE_MAX / MLX5_WSEG_SIZE) < ds)) + return MLX5_TXCMP_CODE_ERROR; + } + /* We have lucky opportunity to adjust. */ + inlen = RTE_MIN(inlen, MLX5_WQE_SIZE_MAX - + MLX5_WSEG_SIZE * 2 - + MLX5_WSEG_SIZE * NB_SEGS(loc->mbuf) - + MLX5_WSEG_SIZE + + MLX5_ESEG_MIN_INLINE_SIZE); + } #ifdef MLX5_PMD_SOFT_COUNTERS /* Update sent data bytes/packets counters. */ txq->stats.obytes += dlen + vlan; -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-11-03 09:27:28.219081693 +0000 +++ 0046-net-mlx5-fix-inline-length-exceeding-descriptor-limi.patch 2022-11-03 09:27:25.429423524 +0000 @@ -1 +1 @@ -From d15bfd2930f343baf3f9e3a20b6d5f948f783394 Mon Sep 17 00:00:00 2001 +From e577d667725a70e02d45e20199427aabbf52fea4 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit d15bfd2930f343baf3f9e3a20b6d5f948f783394 ] + @@ -19 +20,0 @@ -Cc: stable@dpdk.org @@ -24 +25 @@ - drivers/net/mlx5/mlx5_tx.h | 20 ++++++++++++++++++-- + drivers/net/mlx5/mlx5_rxtx.c | 20 ++++++++++++++++++-- @@ -27,5 +28,5 @@ -diff --git a/drivers/net/mlx5/mlx5_tx.h b/drivers/net/mlx5/mlx5_tx.h -index 8e113e3778..59ebe95032 100644 ---- a/drivers/net/mlx5/mlx5_tx.h -+++ b/drivers/net/mlx5/mlx5_tx.h -@@ -2078,8 +2078,24 @@ do_build: +diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c +index 1ba70264c8..436c207281 100644 +--- a/drivers/net/mlx5/mlx5_rxtx.c ++++ b/drivers/net/mlx5/mlx5_rxtx.c +@@ -3575,8 +3575,24 @@ do_build: