DPDK patches and discussions
 help / color / mirror / Atom feed
From: Wei Zhao <wei.zhao1@intel.com>
To: dev@dpdk.org
Cc: wenzhuo.lu@intel.com, stable@dpdk.org, Wei Zhao <wei.zhao1@intel.com>
Subject: [dpdk-dev] [PATCH v2] net/ixgbe: fix tunnel type set error for FDIR
Date: Wed, 13 Jun 2018 16:11:42 +0800	[thread overview]
Message-ID: <1528877502-5076-1-git-send-email-wei.zhao1@intel.com> (raw)
In-Reply-To: <1528189935-34943-5-git-send-email-wei.zhao1@intel.com>

Tunnel type format should be translated to ixgbe required format
before register set in FDIR cloud mode, Ans also some register
not useful in cloud mode but only useful in IP mode should be set
to zero as datasheet request.

Fixes: 82fb702077f6 ("ixgbe: support new flow director modes for X550")
Fixes: 11777435c727 ("net/ixgbe: parse flow director filter")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
---

v2:
-change register write function for FDIRIPSA and FDIRIPDA.

---
 drivers/net/ixgbe/ixgbe_fdir.c | 17 +++++++++++++----
 drivers/net/ixgbe/ixgbe_flow.c |  6 ++----
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdir.c
index 67ab627..3feb815 100644
--- a/drivers/net/ixgbe/ixgbe_fdir.c
+++ b/drivers/net/ixgbe/ixgbe_fdir.c
@@ -771,8 +771,15 @@ ixgbe_fdir_filter_to_atr_input(const struct rte_eth_fdir_filter *fdir_filter,
 			input->formatted.inner_mac,
 			fdir_filter->input.flow.tunnel_flow.mac_addr.addr_bytes,
 			sizeof(input->formatted.inner_mac));
-		input->formatted.tunnel_type =
-			fdir_filter->input.flow.tunnel_flow.tunnel_type;
+		if (fdir_filter->input.flow.tunnel_flow.tunnel_type ==
+				RTE_FDIR_TUNNEL_TYPE_VXLAN)
+			input->formatted.tunnel_type = 0x8000;
+		else if (fdir_filter->input.flow.tunnel_flow.tunnel_type ==
+				RTE_FDIR_TUNNEL_TYPE_NVGRE)
+			input->formatted.tunnel_type = 0;
+		else
+			PMD_DRV_LOG(ERR, " invalid tunnel type arguments.");
+
 		input->formatted.tni_vni =
 			fdir_filter->input.flow.tunnel_flow.tunnel_id >> 8;
 	}
@@ -1001,8 +1008,7 @@ fdir_write_perfect_filter_82599(struct ixgbe_hw *hw,
 			IXGBE_WRITE_REG(hw, IXGBE_FDIRSIPv6(2), 0);
 		} else {
 			/* tunnel mode */
-			if (input->formatted.tunnel_type !=
-				RTE_FDIR_TUNNEL_TYPE_NVGRE)
+			if (input->formatted.tunnel_type)
 				tunnel_type = 0x80000000;
 			tunnel_type |= addr_high;
 			IXGBE_WRITE_REG(hw, IXGBE_FDIRSIPv6(0), addr_low);
@@ -1010,6 +1016,9 @@ fdir_write_perfect_filter_82599(struct ixgbe_hw *hw,
 			IXGBE_WRITE_REG(hw, IXGBE_FDIRSIPv6(2),
 					input->formatted.tni_vni);
 		}
+		IXGBE_WRITE_REG(hw, IXGBE_FDIRIPSA, 0);
+		IXGBE_WRITE_REG(hw, IXGBE_FDIRIPDA, 0);
+		IXGBE_WRITE_REG(hw, IXGBE_FDIRPORT, 0);
 	}
 
 	/* record vlan (little-endian) and flex_bytes(big-endian) */
diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
index f47f125..06bc2a7 100644
--- a/drivers/net/ixgbe/ixgbe_flow.c
+++ b/drivers/net/ixgbe/ixgbe_flow.c
@@ -2436,8 +2436,7 @@ ixgbe_parse_fdir_filter_tunnel(const struct rte_flow_attr *attr,
 
 	/* Get the VxLAN info */
 	if (item->type == RTE_FLOW_ITEM_TYPE_VXLAN) {
-		rule->ixgbe_fdir.formatted.tunnel_type =
-			RTE_FDIR_TUNNEL_TYPE_VXLAN;
+		rule->ixgbe_fdir.formatted.tunnel_type = 0x8000;
 
 		/* Only care about VNI, others should be masked. */
 		if (!item->mask) {
@@ -2494,8 +2493,7 @@ ixgbe_parse_fdir_filter_tunnel(const struct rte_flow_attr *attr,
 
 	/* Get the NVGRE info */
 	if (item->type == RTE_FLOW_ITEM_TYPE_NVGRE) {
-		rule->ixgbe_fdir.formatted.tunnel_type =
-			RTE_FDIR_TUNNEL_TYPE_NVGRE;
+		rule->ixgbe_fdir.formatted.tunnel_type = 0;
 
 		/**
 		 * Only care about flags0, flags1, protocol and TNI,
-- 
2.7.5

  reply	other threads:[~2018-06-13  8:32 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-05  9:12 [dpdk-dev] [PATCH] app/testpmd: fix VLAN tci mask " Wei Zhao
2018-06-05  9:12 ` [dpdk-dev] [PATCH] net/ixgbe: add query rule stats support " Wei Zhao
2018-06-13  8:07   ` [dpdk-dev] [PATCH v2] " Wei Zhao
2018-06-13  8:08   ` Wei Zhao
2018-06-14  0:36     ` Lu, Wenzhuo
2018-06-21 14:08       ` Zhang, Qi Z
2018-06-05  9:12 ` [dpdk-dev] [PATCH] net/ixgbe: add support for VLAN in IP mode FDIR Wei Zhao
2018-06-12  2:25   ` Lu, Wenzhuo
2018-06-12  2:30     ` Zhao1, Wei
2018-06-12  2:41       ` Lu, Wenzhuo
2018-06-12  2:49         ` Zhao1, Wei
2018-06-12  3:18         ` Zhao1, Wei
2018-06-13  8:09   ` [dpdk-dev] [PATCH v2] " Wei Zhao
2018-06-14  0:37     ` Lu, Wenzhuo
2018-06-21 14:09       ` Zhang, Qi Z
2018-06-05  9:12 ` [dpdk-dev] [PATCH] net/ixgbe: fix tunnel id format error for FDIR Wei Zhao
2018-06-12  5:10   ` Lu, Wenzhuo
2018-06-12  7:49     ` Zhao1, Wei
2018-06-12  8:39       ` Lu, Wenzhuo
2018-06-12  8:43         ` Zhao1, Wei
2018-06-13  8:11   ` [dpdk-dev] [PATCH v2] " Wei Zhao
2018-06-14  0:38     ` Lu, Wenzhuo
2018-06-21 14:10       ` Zhang, Qi Z
2018-06-05  9:12 ` [dpdk-dev] [PATCH] net/ixgbe: fix tunnel type set " Wei Zhao
2018-06-13  8:11   ` Wei Zhao [this message]
2018-06-14  0:41     ` [dpdk-dev] [PATCH v2] " Lu, Wenzhuo
2018-06-14  1:51       ` Zhao1, Wei
2018-06-14  8:17     ` [dpdk-dev] [PATCH v3] " Wei Zhao
2018-06-15  0:50       ` Lu, Wenzhuo
2018-06-21 14:11         ` Zhang, Qi Z
2018-06-12  1:12 ` [dpdk-dev] [PATCH] app/testpmd: fix VLAN tci mask " Lu, Wenzhuo
2018-06-21 14:27   ` Zhang, Qi Z

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=1528877502-5076-1-git-send-email-wei.zhao1@intel.com \
    --to=wei.zhao1@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=wenzhuo.lu@intel.com \
    /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).