patches for DPDK stable branches
 help / color / mirror / Atom feed
From: John Daley <johndale@cisco.com>
To: johnda888@gmail.com
Cc: John Daley <johndale@cisco.com>, stable@dpdk.org
Subject: [dpdk-stable] [PATCH v2] net/enic: fix hardcoding of some flow director masks
Date: Wed,  8 Feb 2017 16:31:30 -0800	[thread overview]
Message-ID: <20170209003130.17245-2-johndale@cisco.com> (raw)
In-Reply-To: <20170209003130.17245-1-johndale@cisco.com>

Hard coded mask values were being used for several of the IPv4 and IPv6
fields. Use the values in the rte_eth_fdir_masks structure provided by the
caller.

Fixes: dfbd6a9cb504 ("net/enic: extend flow director support for 1300 series")

Cc: stable@dpdk.org
Signed-off-by: John Daley <johndale@cisco.com>
---

 v2: fix compile error

 drivers/net/enic/enic_clsf.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/enic/enic_clsf.c b/drivers/net/enic/enic_clsf.c
index bcf479a..487f804 100644
--- a/drivers/net/enic/enic_clsf.c
+++ b/drivers/net/enic/enic_clsf.c
@@ -211,15 +211,15 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,
 		memset(&ip4_val, 0, sizeof(struct ipv4_hdr));
 
 		if (input->flow.ip4_flow.tos) {
-			ip4_mask.type_of_service = 0xff;
+			ip4_mask.type_of_service = masks->ipv4_mask.tos;
 			ip4_val.type_of_service = input->flow.ip4_flow.tos;
 		}
 		if (input->flow.ip4_flow.ttl) {
-			ip4_mask.time_to_live = 0xff;
+			ip4_mask.time_to_live = masks->ipv4_mask.ttl;
 			ip4_val.time_to_live = input->flow.ip4_flow.ttl;
 		}
 		if (input->flow.ip4_flow.proto) {
-			ip4_mask.next_proto_id = 0xff;
+			ip4_mask.next_proto_id = masks->ipv4_mask.proto;
 			ip4_val.next_proto_id = input->flow.ip4_flow.proto;
 		}
 		if (input->flow.ip4_flow.src_ip) {
@@ -299,7 +299,7 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,
 		memset(&ipv6_val, 0, sizeof(struct ipv6_hdr));
 
 		if (input->flow.ipv6_flow.proto) {
-			ipv6_mask.proto = 0xff;
+			ipv6_mask.proto = masks->ipv6_mask.proto;
 			ipv6_val.proto = input->flow.ipv6_flow.proto;
 		}
 		for (i = 0; i < 4; i++) {
@@ -315,11 +315,11 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,
 					input->flow.ipv6_flow.dst_ip[i];
 		}
 		if (input->flow.ipv6_flow.tc) {
-			ipv6_mask.vtc_flow = 0x00ff0000;
-			ipv6_val.vtc_flow = input->flow.ipv6_flow.tc << 16;
+			ipv6_mask.vtc_flow = masks->ipv6_mask.tc << 12;
+			ipv6_val.vtc_flow = input->flow.ipv6_flow.tc << 12;
 		}
 		if (input->flow.ipv6_flow.hop_limits) {
-			ipv6_mask.hop_limits = 0xff;
+			ipv6_mask.hop_limits = masks->ipv6_mask.hop_limits;
 			ipv6_val.hop_limits = input->flow.ipv6_flow.hop_limits;
 		}
 
-- 
2.10.0

  parent reply	other threads:[~2017-02-09  0:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-03  9:54 [dpdk-stable] [PATCH 1/2] " John Daley
2017-02-03  9:54 ` [dpdk-stable] [PATCH 2/2] net/enic: fix flow director IPv6 traffic class specification John Daley
2017-02-03 22:54 ` [dpdk-stable] [PATCH 1/2] net/enic: fix hardcoding of some flow director masks Ferruh Yigit
     [not found] ` <20170209003130.17245-1-johndale@cisco.com>
2017-02-09  0:31   ` John Daley [this message]
     [not found] ` <20170209004009.26242-1-johndale@cisco.com>
2017-02-09  0:40   ` [dpdk-stable] [PATCH v2] " John Daley
2017-02-09 10:16     ` Ferruh Yigit
2017-02-09 17:43       ` John Daley (johndale)
2017-02-09 17:58         ` Ferruh Yigit
2017-02-09 12:21     ` Ferruh Yigit

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=20170209003130.17245-2-johndale@cisco.com \
    --to=johndale@cisco.com \
    --cc=johnda888@gmail.com \
    --cc=stable@dpdk.org \
    /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).