Thread (148 messages) 148 messages, 7 authors, 2017-01-25

Re: [PATCH v2 02/18] net/ixgbe: store flow director filter

From: Zhao1, Wei <hidden>
Date: 2017-01-10 05:30:49

Hi, yigit
-----Original Message-----
From: Yigit, Ferruh
Sent: Saturday, January 7, 2017 12:31 AM
To: Zhao1, Wei <redacted>; dev@dpdk.org
Cc: Lu, Wenzhuo <redacted>
Subject: Re: [dpdk-dev] [PATCH v2 02/18] net/ixgbe: store flow director filter

On 12/30/2016 7:52 AM, Wei Zhao wrote:
quoted
Add support for storing flow director filter in SW.

Signed-off-by: Wenzhuo Lu <redacted>
Signed-off-by: Wei Zhao <redacted>
---

v2:
--add a fdir initialization function in device start process
---
<...>
quoted
@@ -1276,6 +1278,9 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev)

 	/* initialize SYN filter */
 	filter_info->syn_info = 0;
+	/* initialize flow director filter list & hash */
+	ixgbe_fdir_filter_init(eth_dev);
+
 	return 0;
 }
@@ -1284,6 +1289,9 @@ eth_ixgbe_dev_uninit(struct rte_eth_dev
*eth_dev)  {
 	struct rte_pci_device *pci_dev;
 	struct ixgbe_hw *hw;
+	struct ixgbe_hw_fdir_info *fdir_info =
+		IXGBE_DEV_PRIVATE_TO_FDIR_INFO(eth_dev->data-
dev_private);
+	struct ixgbe_fdir_filter *fdir_filter;

 	PMD_INIT_FUNC_TRACE();
@@ -1317,9 +1325,56 @@ eth_ixgbe_dev_uninit(struct rte_eth_dev
*eth_dev)
quoted
 	rte_free(eth_dev->data->hash_mac_addrs);
 	eth_dev->data->hash_mac_addrs = NULL;

+	/* remove all the fdir filters & hash */
+	if (fdir_info->hash_map)
+		rte_free(fdir_info->hash_map);
+	if (fdir_info->hash_handle)
+		rte_hash_free(fdir_info->hash_handle);
+
+	while ((fdir_filter = TAILQ_FIRST(&fdir_info->fdir_list))) {
+		TAILQ_REMOVE(&fdir_info->fdir_list,
+			     fdir_filter,
+			     entries);
+		rte_free(fdir_filter);
+	}
+
What do you think extracting these into a function as done in init() ?

<...>
Ok , I will do as your suggestion.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help