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 0F956A051C for ; Tue, 11 Feb 2020 12:29:30 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 036EB1BFA9; Tue, 11 Feb 2020 12:29:30 +0100 (CET) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by dpdk.org (Postfix) with ESMTP id A00261BE90 for ; Tue, 11 Feb 2020 12:29:28 +0100 (CET) Received: by mail-wm1-f66.google.com with SMTP id c84so3070736wme.4 for ; Tue, 11 Feb 2020 03:29:28 -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=Qa3mlvFcZYhxV0XTfyYiSr1sUkcXFvguOEvpVqYvT/0=; b=u2LMkha2BkNoquJHXNpD5UbQMPiEyvBRYrKMje8H9EkKVu7YH6tJWr+F083R4NiWwl CK14V4Q8cJoK/bFgkplCDM4f3f+hH20u0i569+nj4T2q/YE4USrBN74hnffWwCOoLqog FSnRibvp9s1rKktOVtJ5fL0/Ozwr1EmUTV4NiDSahakAFZmUwCoYYvDLPoHHxOxkfo97 n3/eEwgir8za/pQKBP1LMmINw6krsvNgmsIpZazFEO/wV0rFyBGWFQzGC4xHEY2/Tj0J EAohuNcjCRebk3J1hAEIvXsWlLIiz56fiQQy3wXRz+ZCFYulWxPqlh986gzRtQJ/Mhh1 psgg== 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=Qa3mlvFcZYhxV0XTfyYiSr1sUkcXFvguOEvpVqYvT/0=; b=T/HV7SjCS34bRNcRc7EIoRKvTqszL7aWOImt0N17lilX4i3M1Y2lf032iFjS3UnirK quALXgCzbz9YL60veLJgKur3Ze+AjcW/toy3Y9MV5SBrZhGIQmJHAyBQwO7OoZ8Z7Uo3 HUydO6l4IZ6uLIP2IXlEUh86pn+LWv1kOIsaFNQSIxEdNqgC2Mu9yaRoN812c/7y4cM1 D0INU8n1U/AMJftACbZtSksG1ccGQ/Ktk0/644+7e4JUnCjcpEPzOWQhUYniMtcbS2Pl o+NEWLhGKydG/lSgHCHL64jNKAIXK49PlTKQe2hhrZ4JMHyoZp3cxxiSRbLHvuqBbVua m8AA== X-Gm-Message-State: APjAAAWKZcBVoxJqla5VvtHn9cQjwndJ6EV6eNTwYpvnne4eGkU6s8aB /T0n6aapdrW/7clfUKq75hFT9qZd+3I= X-Google-Smtp-Source: APXvYqyIcCW60BF5OpaAtcq3sRzb11+fbJV0ymRrZ+GSkOBg6f660gonhGtIR7D3Tndp+PMPC+a5Ng== X-Received: by 2002:a1c:f008:: with SMTP id a8mr5030935wmb.81.1581420567803; Tue, 11 Feb 2020 03:29:27 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id n8sm4793934wrx.42.2020.02.11.03.29.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 03:29:27 -0800 (PST) From: luca.boccassi@gmail.com To: Viacheslav Ovsiienko Cc: Matan Azrad , dpdk stable Date: Tue, 11 Feb 2020 11:20:46 +0000 Message-Id: <20200211112216.3929-100-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 shared metadata matcher field setup' 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 a7a7bbba6c9a59fcdb10e1a89eecb920416458ed Mon Sep 17 00:00:00 2001 From: Viacheslav Ovsiienko Date: Fri, 17 Jan 2020 11:01:34 +0000 Subject: [PATCH] net/mlx5: fix shared metadata matcher field setup [ upstream commit abde8206f236c39b33498b8098c4760f68d78f18 ] Matcher is flow table related structure providing the flow pattern to be translated directly in hardware controlling data. Some fields in this structure might be split (by software) between multiple items. For example, the metadata register c0 field in the matcher might be split into two independent subfields - the source vport index and META item value. These subfields have no permanent assigned masks, the actual configuration is queried from the kernel drivers in runtime. To handle source vport value (the port of e-Switch which is origin of the packet) the kernel might use the dedicated vport field in the matcher or the part of register c0 field, depending on configuration. To setup the matcher structure fields the macro MLX5_SET is used. MLX5_SET configures the specified 32-bit field as whole entity. For metadata register c0 we should take into account the provided mask in order to configure the specified subfield bits only, otherwise setting vport overrides the META values and vice versa. 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 | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index baf617aaa6..9dd0dbdc0a 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -5748,6 +5748,7 @@ flow_dv_match_meta_reg(void *matcher, void *key, MLX5_ADDR_OF(fte_match_param, matcher, misc_parameters_2); void *misc2_v = MLX5_ADDR_OF(fte_match_param, key, misc_parameters_2); + uint32_t temp; data &= mask; switch (reg_type) { @@ -5760,8 +5761,18 @@ flow_dv_match_meta_reg(void *matcher, void *key, MLX5_SET(fte_match_set_misc2, misc2_v, metadata_reg_b, data); break; case REG_C_0: - MLX5_SET(fte_match_set_misc2, misc2_m, metadata_reg_c_0, mask); - MLX5_SET(fte_match_set_misc2, misc2_v, metadata_reg_c_0, data); + /* + * The metadata register C0 field might be divided into + * source vport index and META item value, we should set + * this field according to specified mask, not as whole one. + */ + temp = MLX5_GET(fte_match_set_misc2, misc2_m, metadata_reg_c_0); + temp |= mask; + MLX5_SET(fte_match_set_misc2, misc2_m, metadata_reg_c_0, temp); + temp = MLX5_GET(fte_match_set_misc2, misc2_v, metadata_reg_c_0); + temp &= ~mask; + temp |= data; + MLX5_SET(fte_match_set_misc2, misc2_v, metadata_reg_c_0, temp); break; case REG_C_1: MLX5_SET(fte_match_set_misc2, misc2_m, metadata_reg_c_1, mask); -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-02-11 11:17:42.336879158 +0000 +++ 0100-net-mlx5-fix-shared-metadata-matcher-field-setup.patch 2020-02-11 11:17:38.556004264 +0000 @@ -1,8 +1,10 @@ -From abde8206f236c39b33498b8098c4760f68d78f18 Mon Sep 17 00:00:00 2001 +From a7a7bbba6c9a59fcdb10e1a89eecb920416458ed Mon Sep 17 00:00:00 2001 From: Viacheslav Ovsiienko Date: Fri, 17 Jan 2020 11:01:34 +0000 Subject: [PATCH] net/mlx5: fix shared metadata matcher field setup +[ upstream commit abde8206f236c39b33498b8098c4760f68d78f18 ] + Matcher is flow table related structure providing the flow pattern to be translated directly in hardware controlling data. Some fields in this structure might be split (by software) between multiple items. @@ -23,7 +25,6 @@ otherwise setting vport overrides the META values and vice versa. Fixes: acfcd5c52f94 ("net/mlx5: update meta register matcher set") -Cc: stable@dpdk.org Signed-off-by: Viacheslav Ovsiienko Acked-by: Matan Azrad @@ -32,10 +33,10 @@ 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c -index e37ed93c12..e1b2534d9f 100644 +index baf617aaa6..9dd0dbdc0a 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c -@@ -5920,6 +5920,7 @@ flow_dv_match_meta_reg(void *matcher, void *key, +@@ -5748,6 +5748,7 @@ flow_dv_match_meta_reg(void *matcher, void *key, MLX5_ADDR_OF(fte_match_param, matcher, misc_parameters_2); void *misc2_v = MLX5_ADDR_OF(fte_match_param, key, misc_parameters_2); @@ -43,7 +44,7 @@ data &= mask; switch (reg_type) { -@@ -5932,8 +5933,18 @@ flow_dv_match_meta_reg(void *matcher, void *key, +@@ -5760,8 +5761,18 @@ flow_dv_match_meta_reg(void *matcher, void *key, MLX5_SET(fte_match_set_misc2, misc2_v, metadata_reg_b, data); break; case REG_C_0: