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: sta...@dpdk.org
Signed-off-by: John Daley <johnd...@cisco.com>
---
 drivers/net/enic/enic_clsf.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

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;
-- 
2.10.0

Reply via email to