DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jingjing Wu <jingjing.wu@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 10/15] ixgbe: implement the flush operation of flow director
Date: Thu, 29 Jan 2015 13:29:20 +0800	[thread overview]
Message-ID: <1422509365-13596-11-git-send-email-jingjing.wu@intel.com> (raw)
In-Reply-To: <1422509365-13596-1-git-send-email-jingjing.wu@intel.com>

This patch implement RTE_ETH_FILTER_FLUSH operation to delete all
flow director filters in ixgbe driver.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
---
 lib/librte_pmd_ixgbe/ixgbe_fdir.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/lib/librte_pmd_ixgbe/ixgbe_fdir.c b/lib/librte_pmd_ixgbe/ixgbe_fdir.c
index 40ab342..4f843bb 100644
--- a/lib/librte_pmd_ixgbe/ixgbe_fdir.c
+++ b/lib/librte_pmd_ixgbe/ixgbe_fdir.c
@@ -130,6 +130,7 @@ static int ixgbe_add_del_fdir_filter(struct rte_eth_dev *dev,
 			      const struct rte_eth_fdir_filter *fdir_filter,
 			      bool del,
 			      bool update);
+static int ixgbe_fdir_flush(struct rte_eth_dev *dev);
 static void ixgbe_fdir_info_get(struct rte_eth_dev *dev,
 			struct rte_eth_fdir_info *fdir_info);
 static void ixgbe_fdir_stats_get(struct rte_eth_dev *dev,
@@ -964,6 +965,28 @@ ixgbe_add_del_fdir_filter(struct rte_eth_dev *dev,
 	return err;
 }
 
+static int
+ixgbe_fdir_flush(struct rte_eth_dev *dev)
+{
+	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	struct ixgbe_hw_fdir_info *info =
+			IXGBE_DEV_PRIVATE_TO_FDIR_INFO(dev->data->dev_private);
+	int ret;
+
+	ret = ixgbe_reinit_fdir_tables_82599(hw);
+	if (ret < 0) {
+		PMD_INIT_LOG(ERR, "Failed to re-initialize FD table.");
+		return ret;
+	}
+
+	info->f_add = 0;
+	info->f_remove = 0;
+	info->add = 0;
+	info->remove = 0;
+
+	return ret;
+}
+
 #define FDIRENTRIES_NUM_SHIFT 10
 static void
 ixgbe_fdir_info_get(struct rte_eth_dev *dev, struct rte_eth_fdir_info *fdir_info)
@@ -1103,6 +1126,9 @@ ixgbe_fdir_ctrl_func(struct rte_eth_dev *dev,
 		ret = ixgbe_add_del_fdir_filter(dev,
 			(struct rte_eth_fdir_filter *)arg, TRUE, FALSE);
 		break;
+	case RTE_ETH_FILTER_FLUSH:
+		ret = ixgbe_fdir_flush(dev);
+		break;
 	case RTE_ETH_FILTER_INFO:
 		ixgbe_fdir_info_get(dev, (struct rte_eth_fdir_info *)arg);
 		break;
-- 
1.9.3

  parent reply	other threads:[~2015-01-29  5:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-29  5:29 [dpdk-dev] [PATCH 00/15] migrate flow director in ixgbe driver to new API Jingjing Wu
2015-01-29  5:29 ` [dpdk-dev] [PATCH 01/15] ixgbe: migrate flow director filter operations (add/delete/update) " Jingjing Wu
2015-01-29  5:29 ` [dpdk-dev] [PATCH 02/15] ethdev: extend flow type and flexible payload type definition for flow director Jingjing Wu
2015-01-29  5:29 ` [dpdk-dev] [PATCH 03/15] ixgbe: implement the flexpayload configuration of flow director filter Jingjing Wu
2015-01-29  5:29 ` [dpdk-dev] [PATCH 04/15] app/test: remove the flexbytes_offset setting in test_link_bonding Jingjing Wu
2015-01-29  5:29 ` [dpdk-dev] [PATCH 05/15] testpmd: remove the flexbytes_offset setting Jingjing Wu
2015-01-29  5:29 ` [dpdk-dev] [PATCH 06/15] ethdev: remove flexbytes_offset from rte_fdir_conf Jingjing Wu
2015-01-29  5:29 ` [dpdk-dev] [PATCH 07/15] ethdev: structures definition for flow director masks Jingjing Wu
2015-01-29  5:29 ` [dpdk-dev] [PATCH 08/15] ixgbe: implement the mask configuration of flow director filter Jingjing Wu
2015-01-29  5:29 ` [dpdk-dev] [PATCH 09/15] ixgbe: implement the get info and statistic operations of flow director Jingjing Wu
2015-01-29  5:29 ` Jingjing Wu [this message]
2015-01-29  5:29 ` [dpdk-dev] [PATCH 11/15] testpmd: add and update commands for " Jingjing Wu
2015-01-29  5:29 ` [dpdk-dev] [PATCH 12/15] testpmd: update function to show flow director information Jingjing Wu
2015-01-29  5:29 ` [dpdk-dev] [PATCH 13/15] testpmd: set the default value of flow director's mask Jingjing Wu
2015-01-29  5:29 ` [dpdk-dev] [PATCH 14/15] testpmd: remove old commands for flow director Jingjing Wu
2015-01-29  5:29 ` [dpdk-dev] [PATCH 15/15] doc: commands changed in testpmd_funcs.rst " Jingjing Wu
2015-02-11  8:09 ` [dpdk-dev] [PATCH 00/15] migrate flow director in ixgbe driver to new API Zhang, Helin
2015-02-22  1:04   ` Thomas Monjalon

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=1422509365-13596-11-git-send-email-jingjing.wu@intel.com \
    --to=jingjing.wu@intel.com \
    --cc=dev@dpdk.org \
    /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).