DPDK patches and discussions
 help / color / mirror / Atom feed
From: Shahaf Shuler <shahafs@mellanox.com>
To: olivier.matz@6wind.com, stephen@networkplumber.org,
	yskoh@mellanox.com, nelio.laranjeiro@6wind.com,
	adrien.mazarguil@6wind.com
Cc: dev@dpdk.org, Shachar Beiser <shacharbe@mellanox.com>, stable@dpdk.org
Subject: [dpdk-dev] [PATCH v2 2/2] net/mlx5: fix IPv6 header fields
Date: Tue, 16 Jan 2018 11:17:52 +0200	[thread overview]
Message-ID: <68c1b4a1e1c53716343359a65bb216468ef5c735.1516093981.git.shahafs@mellanox.com> (raw)
In-Reply-To: <07cfe9a606927b551c3530a2b910ef88547d9118.1514705637.git.shacharbe@mellanox.com>

From: Shachar Beiser <shacharbe@mellanox.com>

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 <shacharbe@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
---
Sending on behalf of Shachar.

On v2:
 - No changes.

---
 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 ff9fd78d5..4396ea852 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -48,6 +48,7 @@
 #include <rte_flow.h>
 #include <rte_flow_driver.h>
 #include <rte_malloc.h>
+#include <rte_ip.h>
 
 #include "mlx5.h"
 #include "mlx5_defs.h"
@@ -1410,6 +1411,8 @@ mlx5_flow_create_ipv6(const struct rte_flow_item *item,
 		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;
@@ -1421,7 +1424,20 @@ mlx5_flow_create_ipv6(const struct rte_flow_item *item,
 		       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. */
@@ -1430,6 +1446,7 @@ mlx5_flow_create_ipv6(const struct rte_flow_item *item,
 			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;
 	}
-- 
2.12.0

      parent reply	other threads:[~2018-01-16  9:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-31  7:34 [dpdk-dev] [PATCH 1/2] lib/net: add IPv6 header fields macros Shachar Beiser
2017-12-31  7:34 ` [dpdk-dev] [PATCH 2/2] net/mlx5: fix IPv6 header fields Shachar Beiser
2018-01-02 19:56   ` Yongseok Koh
2017-12-31 17:37 ` [dpdk-dev] [PATCH 1/2] lib/net: add IPv6 header fields macros Stephen Hemminger
2018-01-16  9:17 ` [dpdk-dev] [PATCH v2 " Shahaf Shuler
2018-01-17 16:53   ` Ferruh Yigit
2018-01-18 13:57     ` Olivier Matz
2018-01-18 15:07       ` Ferruh Yigit
2018-01-16  9:17 ` Shahaf Shuler [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=68c1b4a1e1c53716343359a65bb216468ef5c735.1516093981.git.shahafs@mellanox.com \
    --to=shahafs@mellanox.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --cc=nelio.laranjeiro@6wind.com \
    --cc=olivier.matz@6wind.com \
    --cc=shacharbe@mellanox.com \
    --cc=stable@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=yskoh@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).