From e7d406851909b1c3cc24ee8c61044dccf9902559 Mon Sep 17 00:00:00 2001 From: Wei Zhao Date: Wed, 13 Jun 2018 16:11:22 +0800 Subject: [PATCH] net/ixgbe: fix tunnel id format error for FDIR In cloud mode for FDIR, tunnel id should be set as protocol request, the lower 8 bits should be set as reserved. Fixes: 82fb702077f6 ("ixgbe: support new flow director modes for X550") Fixes: 11777435c727 ("net/ixgbe: parse flow director filter") Cc: stable@dpdk.org Signed-off-by: Wei Zhao Acked-by: Wenzhuo Lu --- drivers/net/ixgbe/ixgbe_fdir.c | 2 +- drivers/net/ixgbe/ixgbe_flow.c | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdir.c index d5e51797c4..67ab627fab 100644 --- a/drivers/net/ixgbe/ixgbe_fdir.c +++ b/drivers/net/ixgbe/ixgbe_fdir.c @@ -774,7 +774,7 @@ ixgbe_fdir_filter_to_atr_input(const struct rte_eth_fdir_filter *fdir_filter, input->formatted.tunnel_type = fdir_filter->input.flow.tunnel_flow.tunnel_type; input->formatted.tni_vni = - fdir_filter->input.flow.tunnel_flow.tunnel_id; + fdir_filter->input.flow.tunnel_flow.tunnel_id >> 8; } return 0; diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c index 1f2007f6d2..000f4ad282 100644 --- a/drivers/net/ixgbe/ixgbe_flow.c +++ b/drivers/net/ixgbe/ixgbe_flow.c @@ -2488,10 +2488,8 @@ ixgbe_parse_fdir_filter_tunnel(const struct rte_flow_attr *attr, rule->b_spec = TRUE; vxlan_spec = item->spec; rte_memcpy(((uint8_t *) - &rule->ixgbe_fdir.formatted.tni_vni + 1), + &rule->ixgbe_fdir.formatted.tni_vni), vxlan_spec->vni, RTE_DIM(vxlan_spec->vni)); - rule->ixgbe_fdir.formatted.tni_vni = rte_be_to_cpu_32( - rule->ixgbe_fdir.formatted.tni_vni); } } @@ -2588,7 +2586,6 @@ ixgbe_parse_fdir_filter_tunnel(const struct rte_flow_attr *attr, /* tni is a 24-bits bit field */ rte_memcpy(&rule->ixgbe_fdir.formatted.tni_vni, nvgre_spec->tni, RTE_DIM(nvgre_spec->tni)); - rule->ixgbe_fdir.formatted.tni_vni <<= 8; } } -- 2.20.1