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 EE5B4A051C for ; Tue, 11 Feb 2020 12:25:04 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E61162B9C; Tue, 11 Feb 2020 12:25:04 +0100 (CET) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by dpdk.org (Postfix) with ESMTP id 466A82B9C for ; Tue, 11 Feb 2020 12:25:04 +0100 (CET) Received: by mail-wm1-f49.google.com with SMTP id b17so3075493wmb.0 for ; Tue, 11 Feb 2020 03:25:04 -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=HTNxSNrpZfgWnJjDt6d4CTnOD0wmOFwENGeL0TggD/Y=; b=uk4+2DglmxV2LO2388npH6lyoh134/iqrb1X9L+ZdYQ7ZMYIpCKhZu1l0BIXCs0eLL dx6wq2LBqlHOuLlk/QxgmYTyfaMLEuFU7HCC6DPgHU0Xbwwqm8wQ1M4JsphBUb4Kbmru GfgaciLHqi6SjHYjd5yI2fxWCnf9YhVdFXNH+lB6X4yjyClprAqxdXy7fasQMNrnxLPN 9hb5QaRZsIWfl/k/QZplrBlHA7fHBO+hZYYu1xTK4nKIi6SlGzAcBbZNtzM4vqvcZlXz U5pai2Nj11XVLL86THZeFyeUB+6kR8TRE+7vsPdZbXS2Ghl0Oz1wmUXbadXf97C7DShi +Qvw== 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=HTNxSNrpZfgWnJjDt6d4CTnOD0wmOFwENGeL0TggD/Y=; b=gp5BPUwI4ikHF86M9PgZmx/U4OKcrvhievaeoB1YEdF3IMBplwXj92E2jy6mXQ7OCS IdMzDzk/5hSwTtHy1/NsiY9fdLfCmTDshgg0pL52FteRXau/V/erRpWxELvJMq6pnOWT rhg0EJTOivb2fTIvmn8pNb+U4sbeUdo7PcEcWKbJU5QfVC7I3d5QTdQIIkCwirvoDp8u +6C/P+m7oet2gQ3DcW7Mt3rdfe0fX2/vyEy2nkuUrXabBBu2ty8/QLeebj8BD2afQPxT r6xazWctycFculigJhX3lmAQhOwYuF0yPPuDZkEfvBzkVSBJmPslKgi3AO+KtLXi11pp tK2A== X-Gm-Message-State: APjAAAU2CXKbSkEfCeVurd/mLlbuWYtc5RSC5O4pYqRMtCz0d2kqlvNl BATSla0rYA0s5GFp2fk+eGXim7b6oUw= X-Google-Smtp-Source: APXvYqzlBvxbECEtUWNQTYnoOBrRKKvcPO1XSjWTGoBAHlLNeYiYBl2kRSqEClGS+2IzUgCOB8sKcw== X-Received: by 2002:a1c:e108:: with SMTP id y8mr4854865wmg.147.1581420302953; Tue, 11 Feb 2020 03:25:02 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id p12sm2905844wrx.10.2020.02.11.03.25.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 03:25:02 -0800 (PST) From: luca.boccassi@gmail.com To: Dekel Peled Cc: Matan Azrad , dpdk stable Date: Tue, 11 Feb 2020 11:19:47 +0000 Message-Id: <20200211112216.3929-41-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 setting of Rx hash fields' 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 68892d210ad6805118840626582045d88f8aa4b0 Mon Sep 17 00:00:00 2001 From: Dekel Peled Date: Wed, 18 Dec 2019 12:05:46 +0200 Subject: [PATCH] net/mlx5: fix setting of Rx hash fields [ upstream commit c3e33304a7f6f51f49904faf27be768a59c18553 ] Rx hash fields were copied from input parameter into TIR attributes directly, with no translation. As result the copied value was wrong. This patch adds translation of value from input bitmap to the appropriate format. Fixes: dc9ceff73c99 ("net/mlx5: create advanced RxQ via DevX") Signed-off-by: Dekel Peled Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow.h | 21 +++++++++++++++++++++ drivers/net/mlx5/mlx5_rxq.c | 29 +++++++++++++++++++++++++++-- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h index 3fff5dd7da..db12715ecc 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h @@ -288,6 +288,27 @@ enum mlx5_feature_name { /* IBV hash source bits for IPV6. */ #define MLX5_IPV6_IBV_RX_HASH (IBV_RX_HASH_SRC_IPV6 | IBV_RX_HASH_DST_IPV6) +/* IBV hash bits for L3 SRC. */ +#define MLX5_L3_SRC_IBV_RX_HASH (IBV_RX_HASH_SRC_IPV4 | IBV_RX_HASH_SRC_IPV6) + +/* IBV hash bits for L3 DST. */ +#define MLX5_L3_DST_IBV_RX_HASH (IBV_RX_HASH_DST_IPV4 | IBV_RX_HASH_DST_IPV6) + +/* IBV hash bits for TCP. */ +#define MLX5_TCP_IBV_RX_HASH (IBV_RX_HASH_SRC_PORT_TCP | \ + IBV_RX_HASH_DST_PORT_TCP) + +/* IBV hash bits for UDP. */ +#define MLX5_UDP_IBV_RX_HASH (IBV_RX_HASH_SRC_PORT_UDP | \ + IBV_RX_HASH_DST_PORT_UDP) + +/* IBV hash bits for L4 SRC. */ +#define MLX5_L4_SRC_IBV_RX_HASH (IBV_RX_HASH_SRC_PORT_TCP | \ + IBV_RX_HASH_SRC_PORT_UDP) + +/* IBV hash bits for L4 DST. */ +#define MLX5_L4_DST_IBV_RX_HASH (IBV_RX_HASH_DST_PORT_TCP | \ + IBV_RX_HASH_DST_PORT_UDP) /* Geneve header first 16Bit */ #define MLX5_GENEVE_VER_MASK 0x3 diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index 986ec016df..906ff0e045 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -36,6 +36,7 @@ #include "mlx5_autoconf.h" #include "mlx5_defs.h" #include "mlx5_glue.h" +#include "mlx5_flow.h" /* Default RSS hash key also used for ConnectX-3. */ uint8_t rss_hash_default_key[] = { @@ -2452,6 +2453,7 @@ mlx5_hrxq_new(struct rte_eth_dev *dev, } } else { /* ind_tbl->type == MLX5_IND_TBL_TYPE_DEVX */ struct mlx5_devx_tir_attr tir_attr; + struct mlx5_rx_hash_field_select *rx_hash_field_select; uint32_t i; uint32_t lro = 1; @@ -2465,8 +2467,31 @@ mlx5_hrxq_new(struct rte_eth_dev *dev, memset(&tir_attr, 0, sizeof(tir_attr)); tir_attr.disp_type = MLX5_TIRC_DISP_TYPE_INDIRECT; tir_attr.rx_hash_fn = MLX5_RX_HASH_FN_TOEPLITZ; - memcpy(&tir_attr.rx_hash_field_selector_outer, &hash_fields, - sizeof(uint64_t)); +#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT + tir_attr.tunneled_offload_en = !!tunnel; + /* Translate hash_fields bitmap to PRM format. */ + rx_hash_field_select = hash_fields & IBV_RX_HASH_INNER ? + &tir_attr.rx_hash_field_selector_inner : + &tir_attr.rx_hash_field_selector_outer; +#else + rx_hash_field_select = &tir_attr.rx_hash_field_selector_outer; +#endif + /* 1 bit: 0: IPv4, 1: IPv6. */ + rx_hash_field_select->l3_prot_type = + !!(hash_fields & MLX5_IPV6_IBV_RX_HASH); + /* 1 bit: 0: TCP, 1: UDP. */ + rx_hash_field_select->l4_prot_type = + !!(hash_fields & MLX5_UDP_IBV_RX_HASH); + /* Bitmask which sets which fields to use in RX Hash. */ + rx_hash_field_select->selected_fields = + ((!!(hash_fields & MLX5_L3_SRC_IBV_RX_HASH)) << + MLX5_RX_HASH_FIELD_SELECT_SELECTED_FIELDS_SRC_IP) | + (!!(hash_fields & MLX5_L3_DST_IBV_RX_HASH)) << + MLX5_RX_HASH_FIELD_SELECT_SELECTED_FIELDS_DST_IP | + (!!(hash_fields & MLX5_L4_SRC_IBV_RX_HASH)) << + MLX5_RX_HASH_FIELD_SELECT_SELECTED_FIELDS_L4_SPORT | + (!!(hash_fields & MLX5_L4_DST_IBV_RX_HASH)) << + MLX5_RX_HASH_FIELD_SELECT_SELECTED_FIELDS_L4_DPORT; if (rxq_ctrl->obj->type == MLX5_RXQ_OBJ_TYPE_DEVX_HAIRPIN) tir_attr.transport_domain = priv->sh->td->id; else -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-02-11 11:17:40.547660447 +0000 +++ 0041-net-mlx5-fix-setting-of-Rx-hash-fields.patch 2020-02-11 11:17:38.384001048 +0000 @@ -1,8 +1,10 @@ -From c3e33304a7f6f51f49904faf27be768a59c18553 Mon Sep 17 00:00:00 2001 +From 68892d210ad6805118840626582045d88f8aa4b0 Mon Sep 17 00:00:00 2001 From: Dekel Peled Date: Wed, 18 Dec 2019 12:05:46 +0200 Subject: [PATCH] net/mlx5: fix setting of Rx hash fields +[ upstream commit c3e33304a7f6f51f49904faf27be768a59c18553 ] + Rx hash fields were copied from input parameter into TIR attributes directly, with no translation. As result the copied value was wrong. @@ -10,7 +12,6 @@ appropriate format. Fixes: dc9ceff73c99 ("net/mlx5: create advanced RxQ via DevX") -Cc: stable@dpdk.org Signed-off-by: Dekel Peled Acked-by: Matan Azrad @@ -20,10 +21,10 @@ 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h -index 08e223e546..27d82ac60f 100644 +index 3fff5dd7da..db12715ecc 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h -@@ -282,6 +282,27 @@ enum mlx5_feature_name { +@@ -288,6 +288,27 @@ enum mlx5_feature_name { /* IBV hash source bits for IPV6. */ #define MLX5_IPV6_IBV_RX_HASH (IBV_RX_HASH_SRC_IPV6 | IBV_RX_HASH_DST_IPV6) @@ -52,7 +53,7 @@ /* Geneve header first 16Bit */ #define MLX5_GENEVE_VER_MASK 0x3 diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c -index bbc07db386..ca25e324c3 100644 +index 986ec016df..906ff0e045 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -36,6 +36,7 @@ @@ -63,7 +64,7 @@ /* Default RSS hash key also used for ConnectX-3. */ uint8_t rss_hash_default_key[] = { -@@ -2459,6 +2460,7 @@ mlx5_hrxq_new(struct rte_eth_dev *dev, +@@ -2452,6 +2453,7 @@ mlx5_hrxq_new(struct rte_eth_dev *dev, } } else { /* ind_tbl->type == MLX5_IND_TBL_TYPE_DEVX */ struct mlx5_devx_tir_attr tir_attr; @@ -71,7 +72,7 @@ uint32_t i; uint32_t lro = 1; -@@ -2472,8 +2474,31 @@ mlx5_hrxq_new(struct rte_eth_dev *dev, +@@ -2465,8 +2467,31 @@ mlx5_hrxq_new(struct rte_eth_dev *dev, memset(&tir_attr, 0, sizeof(tir_attr)); tir_attr.disp_type = MLX5_TIRC_DISP_TYPE_INDIRECT; tir_attr.rx_hash_fn = MLX5_RX_HASH_FN_TOEPLITZ;