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 2E393A051C for ; Tue, 11 Feb 2020 12:29:33 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 273992BD8; Tue, 11 Feb 2020 12:29:33 +0100 (CET) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by dpdk.org (Postfix) with ESMTP id 61C862BD8 for ; Tue, 11 Feb 2020 12:29:32 +0100 (CET) Received: by mail-wr1-f48.google.com with SMTP id u6so11933968wrt.0 for ; Tue, 11 Feb 2020 03:29:32 -0800 (PST) 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=KMAqwpFPjHKdabYh3QJeP5Ijp8RBy71LkHdONeXTUY0=; b=aotys9dFWmh1S8c94QcPKICzyZHen6MMtHCWQGHxmprvdJVza/bYtOQXb3McNBP/pW Z+e5EXOAZ5HL5tZfL7jxNmrA1XWLjrjbofZ8ZCXEz8h0i1rxT22YpBszsQe5Z1TihN1z MOJGzSM9zk85wTsOgT6XgY21ceTyYuGQfXyWF6kwqQLdm/ca0AIqEtEc+d39/oN8qeAD K+NFXRHzTGzB29n1I6w9pGYcJApVA7HanlmVGNfGfbh1+LVzR/meossVLKZY+AexGGFU Q2tBwVOARLJI8wum88AWTgQ/12bktk62uy8pnyUgfFy5rgJTTJZRKyvE2QpPOsr4KShW aZaA== 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=KMAqwpFPjHKdabYh3QJeP5Ijp8RBy71LkHdONeXTUY0=; b=o3iN5VgxhsbyuEcBVnwMxZlCQ+/DPVLd6Rs/AEkjzCtshceV7t4iTd6fiHAX8hZGf2 MJs3IUURaRhFjRgyAr2J1b5ZTsJ/nSB9NEJI5oERNet/Z1DaBpulcZpQ5ZGyp+E171lc QUbKPRnDD081EHRP0wiF9lOv160Nb/qBTNIYujsKRLIBTQ9Kfd23bw52g3yoM/+G0+tF V5/TPL/OsM9pkeH6dNTG41tjpFJih058ZoWU98fCVSv3RjopKfvoqXAAvcC4lG96WMgx cp+yvlttAOf8CFKIy4vrG16UNtabbAatDumN794HcH2114Ldh+vgvaWITBEFXBiI4fqM BQiQ== X-Gm-Message-State: APjAAAUK7LHwRzv/nveNCQQ1tL90lYpZxcAFfg7YmXPQxhkjb9JHZzPU LyTrhG4a3US2PK3ZmWjlUEc= X-Google-Smtp-Source: APXvYqzLc9yyItNdL+Vjfy/48OH8wj0dL1em7cqalkKLKLDU+00HEXig5gL4utXFv4lIPA2/aCG4uA== X-Received: by 2002:a05:6000:1012:: with SMTP id a18mr7979869wrx.113.1581420572092; Tue, 11 Feb 2020 03:29:32 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id b18sm4926544wru.50.2020.02.11.03.29.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 03:29:31 -0800 (PST) From: luca.boccassi@gmail.com To: Viacheslav Ovsiienko Cc: Matan Azrad , dpdk stable Date: Tue, 11 Feb 2020 11:20:48 +0000 Message-Id: <20200211112216.3929-102-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200211112216.3929-1-luca.boccassi@gmail.com> References: <20200211112216.3929-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/mlx5: fix metadata item endianness conversion' has been queued to stable release 19.11.1 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 stable release 19.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/13/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. Thanks. Luca Boccassi --- >From cbc1f8d1408a58b1b1fc89ba82c7e2bbc94ab9a9 Mon Sep 17 00:00:00 2001 From: Viacheslav Ovsiienko Date: Fri, 17 Jan 2020 14:59:32 +0000 Subject: [PATCH] net/mlx5: fix metadata item endianness conversion [ upstream commit 39c09c22e5b5c46cf8f44826a1c759e036f3af3a ] The mlx5 datapath does not implement any endianness conversions for the metadata being sent and received to provide the better performance (because these conversions would be performed for each packet). These metadata are also involved into flow processing (there might be some flows matching on metadata patterns or setting the new metadata values) inside the NIC. It order to configure hardware in correct way all necessary endianness conversions are done by rte_flow handling code (only once on flow creation). This patch fixes one of these conversions for the little-endian hosts in case if META/MARK items are less than 32 bits. Fixes: acfcd5c52f94 ("net/mlx5: update meta register matcher set") Signed-off-by: Viacheslav Ovsiienko Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow_dv.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index c9bb76a8fc..8f77909419 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -5909,8 +5909,12 @@ flow_dv_translate_item_meta(struct rte_eth_dev *dev, struct mlx5_priv *priv = dev->data->dev_private; uint32_t msk_c0 = priv->sh->dv_regc0_mask; uint32_t shl_c0 = rte_bsf32(msk_c0); +#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN + uint32_t shr_c0 = __builtin_clz(priv->sh->dv_meta_mask); - msk_c0 = rte_cpu_to_be_32(msk_c0); + value >>= shr_c0; + mask >>= shr_c0; +#endif value <<= shl_c0; mask <<= shl_c0; assert(msk_c0); -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-02-11 11:17:42.406568083 +0000 +++ 0102-net-mlx5-fix-metadata-item-endianness-conversion.patch 2020-02-11 11:17:38.572004563 +0000 @@ -1,8 +1,10 @@ -From 39c09c22e5b5c46cf8f44826a1c759e036f3af3a Mon Sep 17 00:00:00 2001 +From cbc1f8d1408a58b1b1fc89ba82c7e2bbc94ab9a9 Mon Sep 17 00:00:00 2001 From: Viacheslav Ovsiienko Date: Fri, 17 Jan 2020 14:59:32 +0000 Subject: [PATCH] net/mlx5: fix metadata item endianness conversion +[ upstream commit 39c09c22e5b5c46cf8f44826a1c759e036f3af3a ] + The mlx5 datapath does not implement any endianness conversions for the metadata being sent and received to provide the better performance (because these conversions would be performed for @@ -15,7 +17,6 @@ in case if META/MARK items are less than 32 bits. Fixes: acfcd5c52f94 ("net/mlx5: update meta register matcher set") -Cc: stable@dpdk.org Signed-off-by: Viacheslav Ovsiienko Acked-by: Matan Azrad @@ -24,10 +25,10 @@ 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c -index da988f9dd7..c02517aaf3 100644 +index c9bb76a8fc..8f77909419 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c -@@ -6081,8 +6081,12 @@ flow_dv_translate_item_meta(struct rte_eth_dev *dev, +@@ -5909,8 +5909,12 @@ flow_dv_translate_item_meta(struct rte_eth_dev *dev, struct mlx5_priv *priv = dev->data->dev_private; uint32_t msk_c0 = priv->sh->dv_regc0_mask; uint32_t shl_c0 = rte_bsf32(msk_c0);