[dpdk-dev,2/2] net/enic: fix flow director IPv6 traffic class specification

Message ID 20170203095446.4614-2-johndale@cisco.com (mailing list archive)
State Rejected, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel compilation fail apply patch file failure

Commit Message

John Daley (johndale) Feb. 3, 2017, 9:54 a.m. UTC
The wrong offset was being used to specify the mask and value for the IPv6
traffic class field for fdir. Also, since the 1 byte field is not byte
aligned in the header, do the shifting in big endian and then convert the
32-bit vtc_flow to little endian as expected by the adapter.

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

Cc: stable@dpdk.org
Signed-off-by: John Daley <johndale@cisco.com>
---
 drivers/net/enic/enic_clsf.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
  

Patch

diff --git a/drivers/net/enic/enic_clsf.c b/drivers/net/enic/enic_clsf.c
index c2218fe..2665b6e 100644
--- a/drivers/net/enic/enic_clsf.c
+++ b/drivers/net/enic/enic_clsf.c
@@ -315,8 +315,10 @@  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 = masks->ipv6_mask.tc << 16);
-			ipv6_val.vtc_flow = input->flow.ipv6_flow.tc << 16;
+			ipv6_mask.vtc_flow = rte_be_to_cpu_32((uint32_t)
+					     masks->ipv6_mask.tc << 20);
+			ipv6_val.vtc_flow = rte_be_to_cpu_32((uint32_t)
+					    input->flow.ipv6_flow.tc << 20);
 		}
 		if (input->flow.ipv6_flow.hop_limits) {
 			ipv6_mask.hop_limits = masks->ipv6_mask.hop_limits;