From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 559AC4C8B for ; Tue, 14 Aug 2018 13:17:37 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from shahafs@mellanox.com) with ESMTPS (AES256-SHA encrypted); 14 Aug 2018 14:21:15 +0300 Received: from unicorn01.mtl.labs.mlnx. (unicorn01.mtl.labs.mlnx [10.7.12.62]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id w7EBHZDl022770; Tue, 14 Aug 2018 14:17:35 +0300 From: Shahaf Shuler To: yskoh@mellanox.com Cc: dev@dpdk.org, stable@dpdk.org, nelio.laranjeiro@6wind.com, orika@mellanox.com Date: Tue, 14 Aug 2018 14:17:21 +0300 Message-Id: <40237a945a95cad4cd0a422f0975bc03f294b0e7.1534245265.git.shahafs@mellanox.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180812111441.149234-1-shahafs@mellanox.com> References: <20180812111441.149234-1-shahafs@mellanox.com> Subject: [dpdk-dev] [PATCH v2] net/mlx5: fix RSS flow action hash type selection X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Aug 2018 11:17:37 -0000 On the code after the below commits, the criteria to select the IPV4 or IPV6 hash functions was the existence of some ETH_RSS_IPV4 RSS types on the flow rule. The check is wrong. For example ETH_RSS_NONFRAG_IPV4_TCP will not select the IPV4 hash which will cause the packet to be spread in a bad way. Fix it by adding the corresponding types needed for each hash selection. Fixes: 592f05b29a25 ("net/mlx5: add RSS flow action") Fixes: fd0b70316bca ("net/mlx5: support inner RSS computation") Cc: stable@dpdk.org Cc: nelio.laranjeiro@6wind.com Cc: orika@mellanox.com Reported-by: Yaroslav Brustinov Signed-off-by: Shahaf Shuler --- Few notes: 1. this patch should be backported to 18.08 stable 2. There is more work planned in 18.11 for the flow engine. The work should be on top of this fix. On v2: * Removed duplicated ETH_RSS_NONFRAG_IPV6_OTHER flag. * Ordered the flags according to their aprearance in rte_ethdev.h --- drivers/net/mlx5/mlx5_flow.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index ca4625b699..3f548a9a43 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -1053,6 +1053,8 @@ mlx5_flow_item_ipv4(const struct rte_flow_item *item, struct rte_flow *flow, mlx5_flow_verbs_hashfields_adjust (flow, tunnel, (ETH_RSS_IPV4 | ETH_RSS_FRAG_IPV4 | + ETH_RSS_NONFRAG_IPV4_TCP | + ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_NONFRAG_IPV4_OTHER), (IBV_RX_HASH_SRC_IPV4 | IBV_RX_HASH_DST_IPV4)); flow->cur_verbs->attr->priority = MLX5_PRIORITY_MAP_L3; @@ -1188,7 +1190,10 @@ mlx5_flow_item_ipv6(const struct rte_flow_item *item, struct rte_flow *flow, if (size <= flow_size) { mlx5_flow_verbs_hashfields_adjust (flow, tunnel, - (ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_OTHER), + (ETH_RSS_IPV6 | ETH_RSS_FRAG_IPV6 | + ETH_RSS_NONFRAG_IPV6_TCP | ETH_RSS_NONFRAG_IPV6_UDP | + ETH_RSS_NONFRAG_IPV6_OTHER | ETH_RSS_IPV6_EX | + ETH_RSS_IPV6_TCP_EX | ETH_RSS_IPV6_UDP_EX), (IBV_RX_HASH_SRC_IPV6 | IBV_RX_HASH_DST_IPV6)); flow->cur_verbs->attr->priority = MLX5_PRIORITY_MAP_L3; mlx5_flow_spec_verbs_add(flow, &ipv6, size); -- 2.12.0