From patchwork Sun Dec 31 07:34:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shachar Beiser X-Patchwork-Id: 32814 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 71C0B2B8E; Sun, 31 Dec 2017 08:34:47 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id AF83C2A5E for ; Sun, 31 Dec 2017 08:34:45 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from shacharbe@mellanox.com) with ESMTPS (AES256-SHA encrypted); 31 Dec 2017 09:34:43 +0200 Received: from pegasus08.mtr.labs.mlnx (pegasus08.mtr.labs.mlnx [10.210.16.114]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id vBV7YhVk021806; Sun, 31 Dec 2017 09:34:43 +0200 Received: from pegasus08.mtr.labs.mlnx (localhost [127.0.0.1]) by pegasus08.mtr.labs.mlnx (8.14.7/8.14.7) with ESMTP id vBV7Yhbf006975; Sun, 31 Dec 2017 07:34:43 GMT Received: (from shacharbe@localhost) by pegasus08.mtr.labs.mlnx (8.14.7/8.14.7/Submit) id vBV7YhdH006974; Sun, 31 Dec 2017 07:34:43 GMT From: Shachar Beiser To: dev@dpdk.org Cc: Shachar Beiser , Adrien Mazarguil , Nelio Laranjeiro , stable@dpdk.org Date: Sun, 31 Dec 2017 07:34:30 +0000 Message-Id: <4099d025d85f32f5e9a51e4476b3472fa944b261.1514705637.git.shacharbe@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <07cfe9a606927b551c3530a2b910ef88547d9118.1514705637.git.shacharbe@mellanox.com> References: <07cfe9a606927b551c3530a2b910ef88547d9118.1514705637.git.shacharbe@mellanox.com> In-Reply-To: <07cfe9a606927b551c3530a2b910ef88547d9118.1514705637.git.shacharbe@mellanox.com> References: <07cfe9a606927b551c3530a2b910ef88547d9118.1514705637.git.shacharbe@mellanox.com> Subject: [dpdk-dev] [PATCH 2/2] net/mlx5: fix IPv6 header fields 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" There are parameters that are not copy from spec to verbs structure in the vtc_label Fixes: 43e9d97 ("net/mlx5: support upstream rdma-core") Cc: stable@dpdk.org Signed-off-by: Shachar Beiser Acked-by: Yongseok Koh --- drivers/net/mlx5/mlx5_flow.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 6605cfd..3209be8 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -48,6 +48,7 @@ #include #include #include +#include #include "mlx5.h" #include "mlx5_prm.h" @@ -1399,6 +1400,8 @@ struct ibv_spec_header { parser->layer = HASH_RXQ_IPV6; if (spec) { unsigned int i; + uint32_t vtc_flow_val; + uint32_t vtc_flow_mask; if (!mask) mask = default_mask; @@ -1410,7 +1413,20 @@ struct ibv_spec_header { RTE_DIM(ipv6.mask.src_ip)); memcpy(&ipv6.mask.dst_ip, mask->hdr.dst_addr, RTE_DIM(ipv6.mask.dst_ip)); - ipv6.mask.flow_label = mask->hdr.vtc_flow; + vtc_flow_val = rte_be_to_cpu_32(spec->hdr.vtc_flow); + vtc_flow_mask = rte_be_to_cpu_32(mask->hdr.vtc_flow); + ipv6.val.flow_label = + rte_cpu_to_be_32((vtc_flow_val & IPV6_HDR_FL_MASK) >> + IPV6_HDR_FL_SHIFT); + ipv6.val.traffic_class = (vtc_flow_val & IPV6_HDR_TC_MASK) >> + IPV6_HDR_TC_SHIFT; + ipv6.val.next_hdr = spec->hdr.proto; + ipv6.val.hop_limit = spec->hdr.hop_limits; + ipv6.mask.flow_label = + rte_cpu_to_be_32((vtc_flow_mask & IPV6_HDR_FL_MASK) >> + IPV6_HDR_FL_SHIFT); + ipv6.mask.traffic_class = (vtc_flow_mask & IPV6_HDR_TC_MASK) >> + IPV6_HDR_TC_SHIFT; ipv6.mask.next_hdr = mask->hdr.proto; ipv6.mask.hop_limit = mask->hdr.hop_limits; /* Remove unwanted bits from values. */ @@ -1419,6 +1435,7 @@ struct ibv_spec_header { ipv6.val.dst_ip[i] &= ipv6.mask.dst_ip[i]; } ipv6.val.flow_label &= ipv6.mask.flow_label; + ipv6.val.traffic_class &= ipv6.mask.traffic_class; ipv6.val.next_hdr &= ipv6.mask.next_hdr; ipv6.val.hop_limit &= ipv6.mask.hop_limit; }