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 4E7CAA051C for ; Tue, 11 Feb 2020 12:31:02 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 44FA72BE9; Tue, 11 Feb 2020 12:31:02 +0100 (CET) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by dpdk.org (Postfix) with ESMTP id EA20A1BFAE for ; Tue, 11 Feb 2020 12:31:00 +0100 (CET) Received: by mail-wr1-f67.google.com with SMTP id r11so8661709wrq.10 for ; Tue, 11 Feb 2020 03:31:00 -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=V0LkXt9oG7emXuXJreaQfBA5gXTEeCDExA2ZREMxJ5I=; b=uSjbr0C6Je9QqSs/SrGCXvjO6j3qm72xsr78ZQ2Ww+AeOIEYSYlYo2/wp/LbEr7PNA 1aTspGiGcJ+WAaFk1gkXzSoyUE7lKj5d7SkmhHYkRoLyRwDByjLVxKSMjzY2z1IUahSu Wo+KvVEaql8jGRffuESZxYI4njJcJMk21ieX1gqru3D/wkyDe/sl6RFAgnBh39YAv2AE Vru+nP5KOyMMw1wOjNQ8zkfixcw5RazQJ+Tp2w1IcD1PgSmyfCW8ARiR/gjgPeaYxxDi RoT5xgZKs5lmJXom9lJ3R38fKE5E0Fdar1QHIuQjCbTL2N2/RyLakCiAymC4G2yqE3/q nNxA== 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=V0LkXt9oG7emXuXJreaQfBA5gXTEeCDExA2ZREMxJ5I=; b=Jsy9IQNSPjimJM/6wxs8TAcrk9N+OH3CEsumrRN1rcfipy9VDcs6MvTY4/BbMLo+Fi uRmD+f1JUNVslPXdlBH/t4A5XKSvSC0jmTO/59EjLPDGdCLlQk3DtKaLpujV3cmEoCm9 PYRiiXDMfY5EHx064ctdnYQYMoFZ9nkE33hFtkiyeSpDVo0Q68enjtJNrSiNM2Jg69tJ WJZHZ1iD2MEZdfe9+PmRmz7oMW3HH7u3hMAsyBh+zEyWkqntr4rKhAKUqEbfz7pN8x9w DZEJii3jvRK+jM5afRDCtlFkQyuXl5NJaPNqGIJjI6fCbTEQ1tbAv+RHKX5Ooehvqx6U psog== X-Gm-Message-State: APjAAAVCR+AthzUhrddY5fLqTvKCC4XJxYGeceCll0axQTdBdPmDS0D1 l198j4kKP+Woxqe8oLJQOtDTNhURcho= X-Google-Smtp-Source: APXvYqxROOGJL4uagH2qREFVGxM3LjSm9F49orywE5TAuJROWOwz8llyi6MlqRO61zDPUPeF71y31w== X-Received: by 2002:a5d:6284:: with SMTP id k4mr8324223wru.398.1581420660587; Tue, 11 Feb 2020 03:31:00 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id w13sm4851699wru.38.2020.02.11.03.30.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 03:31:00 -0800 (PST) From: luca.boccassi@gmail.com To: Dekel Peled Cc: Viacheslav Ovsiienko , dpdk stable Date: Tue, 11 Feb 2020 11:21:06 +0000 Message-Id: <20200211112216.3929-120-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: optimize Rx hash fields 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 92290f523dc17fcd6188729d3d32f40007167fd6 Mon Sep 17 00:00:00 2001 From: Dekel Peled Date: Wed, 15 Jan 2020 23:19:39 +0200 Subject: [PATCH] net/mlx5: optimize Rx hash fields conversion [ upstream commit 70ccb6056847a87bba374d703f51705344982eec ] Previous fix added translation of Rx hash fields to PRM format. This patch optimizes the fix, to perform value translation only if value is not zero. In case value is zero, there is no need to translate it. Fixes: c3e33304a7f6 ("net/mlx5: fix setting of Rx hash fields") Signed-off-by: Dekel Peled Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_rxq.c | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index 906ff0e045..da020a0aa0 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -2453,7 +2453,6 @@ 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; @@ -2467,23 +2466,27 @@ 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; -#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; + /* If needed, translate hash_fields bitmap to PRM format. */ + if (hash_fields) { +#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT + struct mlx5_rx_hash_field_select *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; + struct mlx5_rx_hash_field_select *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 = + + /* 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)) << @@ -2492,6 +2495,7 @@ mlx5_hrxq_new(struct rte_eth_dev *dev, 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:42.933213192 +0000 +++ 0120-net-mlx5-optimize-Rx-hash-fields-conversion.patch 2020-02-11 11:17:38.600005087 +0000 @@ -1,8 +1,10 @@ -From 70ccb6056847a87bba374d703f51705344982eec Mon Sep 17 00:00:00 2001 +From 92290f523dc17fcd6188729d3d32f40007167fd6 Mon Sep 17 00:00:00 2001 From: Dekel Peled Date: Wed, 15 Jan 2020 23:19:39 +0200 Subject: [PATCH] net/mlx5: optimize Rx hash fields conversion +[ upstream commit 70ccb6056847a87bba374d703f51705344982eec ] + Previous fix added translation of Rx hash fields to PRM format. This patch optimizes the fix, to perform value translation only @@ -10,7 +12,6 @@ In case value is zero, there is no need to translate it. Fixes: c3e33304a7f6 ("net/mlx5: fix setting of Rx hash fields") -Cc: stable@dpdk.org Signed-off-by: Dekel Peled Acked-by: Viacheslav Ovsiienko @@ -19,10 +20,10 @@ 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c -index c87ce151d7..4092cb71ce 100644 +index 906ff0e045..da020a0aa0 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c -@@ -2465,7 +2465,6 @@ mlx5_hrxq_new(struct rte_eth_dev *dev, +@@ -2453,7 +2453,6 @@ mlx5_hrxq_new(struct rte_eth_dev *dev, } } else { /* ind_tbl->type == MLX5_IND_TBL_TYPE_DEVX */ struct mlx5_devx_tir_attr tir_attr; @@ -30,7 +31,7 @@ uint32_t i; uint32_t lro = 1; -@@ -2479,23 +2478,27 @@ mlx5_hrxq_new(struct rte_eth_dev *dev, +@@ -2467,23 +2466,27 @@ 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; @@ -72,7 +73,7 @@ ((!!(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)) << -@@ -2504,6 +2507,7 @@ mlx5_hrxq_new(struct rte_eth_dev *dev, +@@ -2492,6 +2495,7 @@ mlx5_hrxq_new(struct rte_eth_dev *dev, 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;