From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH v2 02/18] net/ixgbe: store flow director filter Date: Fri, 6 Jan 2017 16:31:25 +0000 Message-ID: <0505090d-e126-12d5-75e6-2a0498cec4bf@intel.com> References: <1483084390-53159-1-git-send-email-wei.zhao1@intel.com> <1483084390-53159-3-git-send-email-wei.zhao1@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: Wenzhuo Lu To: Wei Zhao , dev@dpdk.org Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id B9436152A for ; Fri, 6 Jan 2017 17:31:27 +0100 (CET) In-Reply-To: <1483084390-53159-3-git-send-email-wei.zhao1@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 12/30/2016 7:52 AM, Wei Zhao wrote: > Add support for storing flow director filter in SW. > > Signed-off-by: Wenzhuo Lu > Signed-off-by: Wei Zhao > --- > > v2: > --add a fdir initialization function in device start process > --- <...> > @@ -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) > 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() ? <...>