From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id C6A8A1B74E; Tue, 5 Jun 2018 11:32:42 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jun 2018 02:32:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,478,1520924400"; d="scan'208";a="234756535" Received: from dpdk6.bj.intel.com ([172.16.182.94]) by fmsmga006.fm.intel.com with ESMTP; 05 Jun 2018 02:32:41 -0700 From: Wei Zhao To: dev@dpdk.org Cc: wenzhuo.lu@intel.com, stable@dpdk.org, Wei Zhao Date: Tue, 5 Jun 2018 17:12:14 +0800 Message-Id: <1528189935-34943-4-git-send-email-wei.zhao1@intel.com> X-Mailer: git-send-email 2.7.5 In-Reply-To: <1528189935-34943-1-git-send-email-wei.zhao1@intel.com> References: <1528189935-34943-1-git-send-email-wei.zhao1@intel.com> Subject: [dpdk-dev] [PATCH] net/ixgbe: fix tunnel id format error for FDIR X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 09:32:43 -0000 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") Signed-off-by: Wei Zhao --- drivers/net/ixgbe/ixgbe_fdir.c | 2 +- drivers/net/ixgbe/ixgbe_flow.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdir.c index d5e5179..67ab627 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 eb0644c..64af777 100644 --- a/drivers/net/ixgbe/ixgbe_flow.c +++ b/drivers/net/ixgbe/ixgbe_flow.c @@ -2489,8 +2489,7 @@ ixgbe_parse_fdir_filter_tunnel(const struct rte_flow_attr *attr, rte_memcpy(((uint8_t *) &rule->ixgbe_fdir.formatted.tni_vni + 1), 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); + rule->ixgbe_fdir.formatted.tni_vni >>= 8; } } @@ -2587,7 +2586,7 @@ 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; + rule->ixgbe_fdir.formatted.tni_vni >>= 8; } } -- 2.7.5