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 E342FA0C4C for ; Mon, 12 Jul 2021 15:14:57 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DD6164069E; Mon, 12 Jul 2021 15:14:57 +0200 (CEST) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mails.dpdk.org (Postfix) with ESMTP id 4B5E64069E for ; Mon, 12 Jul 2021 15:14:57 +0200 (CEST) Received: by mail-wr1-f43.google.com with SMTP id v5so25577215wrt.3 for ; Mon, 12 Jul 2021 06:14:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yuSlMPiUdkp9LWiMNENELPu9p5V0wAbfnQumjwxVAXU=; b=sA/nxAijM3bcpyrca24qeN9O6trojfoKOh7SkA5wH7wsukVlcNakuNM+Z/R3s/0Rdz aMI+DmheqUDHJ5BTAFz40p8mXWPASfL81h4hENrKv/F4ZYQzvGEq7T4V80Jhj7VpjSVm jjNMRs2OBogv0T5KRfg+WGghp7+sR+NTZfEHa9GBN/Ej49fnG/UsJZiQ2EzYfuq3faXC 29gv6ffjInMx0fy87EZYgZkjBPY0xqRP6fcGMTuVq9P9HeFMKIPPMwsEU+FyaOt/PjLA ZfcGiMaEcM7ml8XkptRxT/pad+6PZuaLMc8l0P5WQfggf6U/pzMI77LL/O4LQ8KZYUW4 CKkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yuSlMPiUdkp9LWiMNENELPu9p5V0wAbfnQumjwxVAXU=; b=oiL47BcGgDNeGXdiKuWB8dkP6gp6ouPravNMvdKrUNdmYm/GkZyYSGNAQ25d/fP/rR 7M3gi9C4QhADzmL10hx3WVe4rBX9P7g9kVNBp7emCZ02jS7J6y3g92+i7SFIatpZi47A nV+8CdhBAmnwIHd6TQSiVSj4+14jui8dS12BG7fhh8isj51sqHo/zNwuAwWpvGxasA9I tIyDs3W4bErUSUFhVN3NS2rP/NP+bnSLgbh8RJr2m8+nKLPI+dOFRS67ekBD4rSeqcNv fW3qZK7VDwop9JCFlp1XR0lCItz1ajPsTZRGw0tcpZf3bvzsTFFV1/R7z7RmQokfaZSF o8ow== X-Gm-Message-State: AOAM53030kBGSjYBj3V/ioJjvVFhgq5OyhUu00cFCJkPJlHYHPMD+4Rp qkmrHjhF+JO1jPEQm8oK2hs= X-Google-Smtp-Source: ABdhPJzvpxhnD1D60cBI6//PT/xkU6EDQNv8d96rjZRJvi+F8kgn7dAh1wr8meAQqxN6nDv0RKYKDA== X-Received: by 2002:a5d:6209:: with SMTP id y9mr44727664wru.402.1626095697075; Mon, 12 Jul 2021 06:14:57 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id u15sm19750543wmq.48.2021.07.12.06.14.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 06:14:56 -0700 (PDT) From: luca.boccassi@gmail.com To: Viacheslav Ovsiienko Cc: dpdk stable Date: Mon, 12 Jul 2021 14:05:27 +0100 Message-Id: <20210712130551.2462159-92-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210712130551.2462159-1-luca.boccassi@gmail.com> References: <20210712130551.2462159-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/mlx5: fix multi-segment inline for the first segments' has been queued to stable release 20.11.3 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/14/21. 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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/50ad5c68ce041b5258278d041ea1052bb3fa6709 Thanks. Luca Boccassi --- >From 50ad5c68ce041b5258278d041ea1052bb3fa6709 Mon Sep 17 00:00:00 2001 From: Viacheslav Ovsiienko Date: Tue, 22 Jun 2021 19:40:49 +0300 Subject: [PATCH] net/mlx5: fix multi-segment inline for the first segments [ upstream commit ec837ad0fc7c6df4912cc2706b9cd54b225f4a34 ] Before 19.08 release the Tx burst routines of mlx5 PMD provided data inline for the first short segments of the multi-segment packets. In the release 19.08 mlx5 Tx datapath was refactored and this behavior was broken, affecting the performance. For example, the T-Rex traffic generator might use small leading segments to handle packet headers and performance degradation was noticed. If the first segments of the multi-segment packet are short and the overall length is below the inline threshold it should be inline into the WQE to fix the performance. Fixes: 18a1c20044c0 ("net/mlx5: implement Tx burst template") Signed-off-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_rxtx.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index c765314068..64bba34ffc 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -3456,6 +3456,8 @@ mlx5_tx_packet_multi_inline(struct mlx5_txq_data *__rte_restrict txq, unsigned int nxlen; uintptr_t start; + mbuf = loc->mbuf; + nxlen = rte_pktmbuf_data_len(mbuf); /* * Packet length exceeds the allowed inline * data length, check whether the minimal @@ -3466,28 +3468,23 @@ mlx5_tx_packet_multi_inline(struct mlx5_txq_data *__rte_restrict txq, MLX5_ESEG_MIN_INLINE_SIZE); MLX5_ASSERT(txq->inlen_mode <= txq->inlen_send); inlen = txq->inlen_mode; - } else { - if (loc->mbuf->ol_flags & PKT_TX_DYNF_NOINLINE || - !vlan || txq->vlan_en) { - /* - * VLAN insertion will be done inside by HW. - * It is not utmost effective - VLAN flag is - * checked twice, but we should proceed the - * inlining length correctly and take into - * account the VLAN header being inserted. - */ - return mlx5_tx_packet_multi_send - (txq, loc, olx); - } + } else if (vlan && !txq->vlan_en) { + /* + * VLAN insertion is requested and hardware does not + * support the offload, will do with software inline. + */ inlen = MLX5_ESEG_MIN_INLINE_SIZE; + } else if (mbuf->ol_flags & PKT_TX_DYNF_NOINLINE || + nxlen > txq->inlen_send) { + return mlx5_tx_packet_multi_send(txq, loc, olx); + } else { + goto do_first; } /* * Now we know the minimal amount of data is requested * to inline. Check whether we should inline the buffers * from the chain beginning to eliminate some mbufs. */ - mbuf = loc->mbuf; - nxlen = rte_pktmbuf_data_len(mbuf); if (unlikely(nxlen <= txq->inlen_send)) { /* We can inline first mbuf at least. */ if (nxlen < inlen) { @@ -3509,6 +3506,7 @@ mlx5_tx_packet_multi_inline(struct mlx5_txq_data *__rte_restrict txq, goto do_align; } } +do_first: do { inlen = nxlen; mbuf = NEXT(mbuf); -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-07-12 13:41:41.341503969 +0100 +++ 0092-net-mlx5-fix-multi-segment-inline-for-the-first-segm.patch 2021-07-12 13:41:36.778128610 +0100 @@ -1 +1 @@ -From ec837ad0fc7c6df4912cc2706b9cd54b225f4a34 Mon Sep 17 00:00:00 2001 +From 50ad5c68ce041b5258278d041ea1052bb3fa6709 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit ec837ad0fc7c6df4912cc2706b9cd54b225f4a34 ] + @@ -21 +22,0 @@ -Cc: stable@dpdk.org @@ -25 +26 @@ - drivers/net/mlx5/mlx5_tx.h | 28 +++++++++++++--------------- + drivers/net/mlx5/mlx5_rxtx.c | 28 +++++++++++++--------------- @@ -28,5 +29,5 @@ -diff --git a/drivers/net/mlx5/mlx5_tx.h b/drivers/net/mlx5/mlx5_tx.h -index 7d3ff8407c..634c9d754a 100644 ---- a/drivers/net/mlx5/mlx5_tx.h -+++ b/drivers/net/mlx5/mlx5_tx.h -@@ -2040,6 +2040,8 @@ mlx5_tx_packet_multi_inline(struct mlx5_txq_data *__rte_restrict txq, +diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c +index c765314068..64bba34ffc 100644 +--- a/drivers/net/mlx5/mlx5_rxtx.c ++++ b/drivers/net/mlx5/mlx5_rxtx.c +@@ -3456,6 +3456,8 @@ mlx5_tx_packet_multi_inline(struct mlx5_txq_data *__rte_restrict txq, @@ -39,3 +40,3 @@ - * Packet length exceeds the allowed inline data length, - * check whether the minimal inlining is required. -@@ -2049,28 +2051,23 @@ mlx5_tx_packet_multi_inline(struct mlx5_txq_data *__rte_restrict txq, + * Packet length exceeds the allowed inline + * data length, check whether the minimal +@@ -3466,28 +3468,23 @@ mlx5_tx_packet_multi_inline(struct mlx5_txq_data *__rte_restrict txq, @@ -80 +81 @@ -@@ -2092,6 +2089,7 @@ mlx5_tx_packet_multi_inline(struct mlx5_txq_data *__rte_restrict txq, +@@ -3509,6 +3506,7 @@ mlx5_tx_packet_multi_inline(struct mlx5_txq_data *__rte_restrict txq,