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 99285A051C for ; Tue, 11 Feb 2020 12:42:04 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8E5B91C002; Tue, 11 Feb 2020 12:42:04 +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 59BDE1C002 for ; Tue, 11 Feb 2020 12:42:03 +0100 (CET) Received: by mail-wr1-f48.google.com with SMTP id t2so11982547wrr.1 for ; Tue, 11 Feb 2020 03:42:03 -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=zgZSi1kAxxvdC5BttxPHXMJF0NaHCIs8iBLmJ+qPxbM=; b=uRMcjtFx4PHnPQmgAwaPXGmvrFEjIM+2vwQWQ+yqegp3r/IvkEfKCCewTczfqyyHGM zE+aNFJNGbOu8z8iD2oWDqppwgQCE16EHMlkndyruva5sSajul/uSt7flpUzUutpihhv mXiUfUw/Cid4JDpjlmZ0TknlU3ECOYBag3F/Bb4M94KCCXy9dv8M4u6JoImmmhyc20r9 71XIdLUoXhfjW2KRBzqbpx68HfwpnnB64J3YdZVatD6d/fvBxr70Enh6Xgz+8PXJg4PF TNzudGf9xUWuNLRwLoWBe3MmJuD+7PVwo5YnqGobRcTq3X4iskjX8EXz+9d4VvjUmCnz bvGA== 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=zgZSi1kAxxvdC5BttxPHXMJF0NaHCIs8iBLmJ+qPxbM=; b=aHiGxN+wh1LlFY7PvfFUJMqLJadrguUNZuaiphQIhi6XUytFR+w9RteGQAaE5TPeRT Vw/mGt7H769ZoeWalVB4DY/2NnTb1Tg5ophnAB8ADbSL7i1/lmDuTWL27qBE8L3ht4XP zFFMFIsIabvYOGbXYZSk+oeZigV5kbPzUGXJEcL2IWVj2O6mak6J+3uP7nFqpixjXOPk 2IwXTvEj2Jl12vMt3XX/UyCKnkwxi7iA06O/xMMwUg6+G11FWJ05dQuhN/ELc4/4oo7A 5JpMd546R9E/g5ddrA+Z/nfKTSlKcBHP9Rzl5yFRisV52+iLFzQav5b0Cc4W/AjVxj59 4cMQ== X-Gm-Message-State: APjAAAV/XUE3NLNRpOCENNTC6hy3ejSaFFK6G9Hsbh2PvNKGN1eQxJKU C2Ow1AkaeCfacJit3NDl+mQ= X-Google-Smtp-Source: APXvYqxJeF0n4WP2xGxDfztrjkYdNg10m97nnXb1gqshBAyTJSbEa4vzVAjQqj/qGRM/XyngTMswmA== X-Received: by 2002:adf:f4cb:: with SMTP id h11mr8415609wrp.90.1581421322931; Tue, 11 Feb 2020 03:42:02 -0800 (PST) Received: from localhost ([2a01:4b00:f419:6f00:7a8e:ed70:5c52:ea3]) by smtp.gmail.com with ESMTPSA id w1sm5404150wro.72.2020.02.11.03.42.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 03:42:02 -0800 (PST) From: luca.boccassi@gmail.com To: Matan Azrad Cc: Viacheslav Ovsiienko , dpdk stable Date: Tue, 11 Feb 2020 11:21:52 +0000 Message-Id: <20200211112216.3929-166-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: make FDB default rule optional' 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 f84b4c2ec3a210d8c6de6d7684923abe9e94f554 Mon Sep 17 00:00:00 2001 From: Matan Azrad Date: Tue, 28 Jan 2020 17:06:43 +0000 Subject: [PATCH] net/mlx5: make FDB default rule optional [ upstream commit fbde43310fbec8da96e8c66d7a16d891f60ed630 ] There are RDMA-CORE versions which are not supported multi-table for some Mellanox mlx5 devices. Hence, the optimization added in commit [1] which forwards all the FDB traffic to table 1 cannot be configured. Make the above optimization optional: Do not fail when either table 1 cannot be created or the jump rule (all =>jump to table 1) is not configured successfully. In this case, all the flows will be configured to table 0. [1] commit b67b4ecbde22 ("net/mlx5: skip table zero to improve insertion rate") Signed-off-by: Matan Azrad Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5.h | 1 + drivers/net/mlx5/mlx5_flow.c | 6 ++++-- drivers/net/mlx5/mlx5_flow.h | 4 ++-- drivers/net/mlx5/mlx5_flow_dv.c | 11 ++++++----- drivers/net/mlx5/mlx5_trigger.c | 11 ++++++++--- 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index 0c3a90e1bf..7a7c1d1268 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -784,6 +784,7 @@ struct mlx5_priv { /* UAR same-page access control required in 32bit implementations. */ #endif uint8_t skip_default_rss_reta; /* Skip configuration of default reta. */ + uint8_t fdb_def_rule; /* Whether fdb jump to table 1 is configured. */ }; #define PORT_ID(priv) ((priv)->dev_data->port_id) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index a18cdb918a..45df610a91 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -5570,6 +5570,8 @@ mlx5_flow_async_pool_query_handle(struct mlx5_ibv_shared *sh, * Value is part of flow rule created by request external to PMD. * @param[in] group * rte_flow group index value. + * @param[out] fdb_def_rule + * Whether fdb jump to table 1 is configured. * @param[out] table * HW table value. * @param[out] error @@ -5580,10 +5582,10 @@ mlx5_flow_async_pool_query_handle(struct mlx5_ibv_shared *sh, */ int mlx5_flow_group_to_table(const struct rte_flow_attr *attributes, bool external, - uint32_t group, uint32_t *table, + uint32_t group, bool fdb_def_rule, uint32_t *table, struct rte_flow_error *error) { - if (attributes->transfer && external) { + if (attributes->transfer && external && fdb_def_rule) { if (group == UINT32_MAX) return rte_flow_error_set (error, EINVAL, diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h index 6eccd441d5..0da1b5e318 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h @@ -752,8 +752,8 @@ uint32_t mlx5_flow_id_get(struct mlx5_flow_id_pool *pool, uint32_t *id); uint32_t mlx5_flow_id_release(struct mlx5_flow_id_pool *pool, uint32_t id); int mlx5_flow_group_to_table(const struct rte_flow_attr *attributes, - bool external, uint32_t group, uint32_t *table, - struct rte_flow_error *error); + bool external, uint32_t group, bool fdb_def_rule, + uint32_t *table, struct rte_flow_error *error); uint64_t mlx5_flow_hashfields_adjust(struct mlx5_flow *dev_flow, int tunnel, uint64_t layer_types, uint64_t hash_fields); diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 295627fab3..eb46d00060 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -3256,7 +3256,7 @@ flow_dv_validate_action_jump(const struct rte_flow_action *action, target_group = ((const struct rte_flow_action_jump *)action->conf)->group; ret = mlx5_flow_group_to_table(attributes, external, target_group, - &table, error); + true, &table, error); if (ret) return ret; if (attributes->group == target_group) @@ -4165,7 +4165,7 @@ flow_dv_validate_attributes(struct rte_eth_dev *dev, int ret; ret = mlx5_flow_group_to_table(attributes, external, - attributes->group, + attributes->group, !!priv->fdb_def_rule, &table, error); if (ret) return ret; @@ -6677,7 +6677,7 @@ __flow_dv_translate(struct rte_eth_dev *dev, mhdr_res->ft_type = attr->egress ? MLX5DV_FLOW_TABLE_TYPE_NIC_TX : MLX5DV_FLOW_TABLE_TYPE_NIC_RX; ret = mlx5_flow_group_to_table(attr, dev_flow->external, attr->group, - &table, error); + !!priv->fdb_def_rule, &table, error); if (ret) return ret; dev_flow->group = table; @@ -6945,8 +6945,9 @@ cnt_err: case RTE_FLOW_ACTION_TYPE_JUMP: jump_data = action->conf; ret = mlx5_flow_group_to_table(attr, dev_flow->external, - jump_data->group, &table, - error); + jump_data->group, + !!priv->fdb_def_rule, + &table, error); if (ret) return ret; tbl = flow_dv_tbl_resource_get(dev, table, diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c index ab6937ab10..7e12cd5e8b 100644 --- a/drivers/net/mlx5/mlx5_trigger.c +++ b/drivers/net/mlx5/mlx5_trigger.c @@ -423,9 +423,14 @@ mlx5_traffic_enable(struct rte_eth_dev *dev) } mlx5_txq_release(dev, i); } - if (priv->config.dv_esw_en && !priv->config.vf) - if (!mlx5_flow_create_esw_table_zero_flow(dev)) - goto error; + if (priv->config.dv_esw_en && !priv->config.vf) { + if (mlx5_flow_create_esw_table_zero_flow(dev)) + priv->fdb_def_rule = 1; + else + DRV_LOG(INFO, "port %u FDB default rule cannot be" + " configured - only Eswitch group 0 flows are" + " supported.", dev->data->port_id); + } if (priv->isolated) return 0; if (dev->data->promiscuous) { -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-02-11 11:17:44.369096102 +0000 +++ 0166-net-mlx5-make-FDB-default-rule-optional.patch 2020-02-11 11:17:38.792008677 +0000 @@ -1,8 +1,10 @@ -From fbde43310fbec8da96e8c66d7a16d891f60ed630 Mon Sep 17 00:00:00 2001 +From f84b4c2ec3a210d8c6de6d7684923abe9e94f554 Mon Sep 17 00:00:00 2001 From: Matan Azrad Date: Tue, 28 Jan 2020 17:06:43 +0000 Subject: [PATCH] net/mlx5: make FDB default rule optional +[ upstream commit fbde43310fbec8da96e8c66d7a16d891f60ed630 ] + There are RDMA-CORE versions which are not supported multi-table for some Mellanox mlx5 devices. @@ -17,8 +19,6 @@ [1] commit b67b4ecbde22 ("net/mlx5: skip table zero to improve insertion rate") -Cc: stable@dpdk.org - Signed-off-by: Matan Azrad Acked-by: Viacheslav Ovsiienko --- @@ -30,10 +30,10 @@ 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h -index a7e70895e1..d7c519bae0 100644 +index 0c3a90e1bf..7a7c1d1268 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h -@@ -554,6 +554,7 @@ struct mlx5_priv { +@@ -784,6 +784,7 @@ struct mlx5_priv { /* UAR same-page access control required in 32bit implementations. */ #endif uint8_t skip_default_rss_reta; /* Skip configuration of default reta. */ @@ -42,10 +42,10 @@ #define PORT_ID(priv) ((priv)->dev_data->port_id) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c -index 47ba521a77..adba168d54 100644 +index a18cdb918a..45df610a91 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c -@@ -5577,6 +5577,8 @@ mlx5_flow_async_pool_query_handle(struct mlx5_ibv_shared *sh, +@@ -5570,6 +5570,8 @@ mlx5_flow_async_pool_query_handle(struct mlx5_ibv_shared *sh, * Value is part of flow rule created by request external to PMD. * @param[in] group * rte_flow group index value. @@ -54,7 +54,7 @@ * @param[out] table * HW table value. * @param[out] error -@@ -5587,10 +5589,10 @@ mlx5_flow_async_pool_query_handle(struct mlx5_ibv_shared *sh, +@@ -5580,10 +5582,10 @@ mlx5_flow_async_pool_query_handle(struct mlx5_ibv_shared *sh, */ int mlx5_flow_group_to_table(const struct rte_flow_attr *attributes, bool external, @@ -68,10 +68,10 @@ return rte_flow_error_set (error, EINVAL, diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h -index 4255472e54..7c31bfe8f8 100644 +index 6eccd441d5..0da1b5e318 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h -@@ -754,8 +754,8 @@ uint32_t mlx5_flow_id_get(struct mlx5_flow_id_pool *pool, uint32_t *id); +@@ -752,8 +752,8 @@ uint32_t mlx5_flow_id_get(struct mlx5_flow_id_pool *pool, uint32_t *id); uint32_t mlx5_flow_id_release(struct mlx5_flow_id_pool *pool, uint32_t id); int mlx5_flow_group_to_table(const struct rte_flow_attr *attributes, @@ -83,10 +83,10 @@ uint64_t layer_types, uint64_t hash_fields); diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c -index 5610d94386..f82c90ec00 100644 +index 295627fab3..eb46d00060 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c -@@ -3359,7 +3359,7 @@ flow_dv_validate_action_jump(const struct rte_flow_action *action, +@@ -3256,7 +3256,7 @@ flow_dv_validate_action_jump(const struct rte_flow_action *action, target_group = ((const struct rte_flow_action_jump *)action->conf)->group; ret = mlx5_flow_group_to_table(attributes, external, target_group, @@ -95,7 +95,7 @@ if (ret) return ret; if (attributes->group == target_group) -@@ -4340,7 +4340,7 @@ flow_dv_validate_attributes(struct rte_eth_dev *dev, +@@ -4165,7 +4165,7 @@ flow_dv_validate_attributes(struct rte_eth_dev *dev, int ret; ret = mlx5_flow_group_to_table(attributes, external, @@ -104,7 +104,7 @@ &table, error); if (ret) return ret; -@@ -7017,7 +7017,7 @@ __flow_dv_translate(struct rte_eth_dev *dev, +@@ -6677,7 +6677,7 @@ __flow_dv_translate(struct rte_eth_dev *dev, mhdr_res->ft_type = attr->egress ? MLX5DV_FLOW_TABLE_TYPE_NIC_TX : MLX5DV_FLOW_TABLE_TYPE_NIC_RX; ret = mlx5_flow_group_to_table(attr, dev_flow->external, attr->group, @@ -113,7 +113,7 @@ if (ret) return ret; dev_flow->group = table; -@@ -7285,8 +7285,9 @@ cnt_err: +@@ -6945,8 +6945,9 @@ cnt_err: case RTE_FLOW_ACTION_TYPE_JUMP: jump_data = action->conf; ret = mlx5_flow_group_to_table(attr, dev_flow->external,