{"id":813290,"url":"http://patchwork.ozlabs.org/api/1.2/patches/813290/?format=json","web_url":"http://patchwork.ozlabs.org/project/intel-wired-lan/patch/150529678520.57063.3558143909401835083.stgit@anamdev.jf.intel.com/","project":{"id":46,"url":"http://patchwork.ozlabs.org/api/1.2/projects/46/?format=json","name":"Intel Wired Ethernet development","link_name":"intel-wired-lan","list_id":"intel-wired-lan.osuosl.org","list_email":"intel-wired-lan@osuosl.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<150529678520.57063.3558143909401835083.stgit@anamdev.jf.intel.com>","list_archive_url":null,"date":"2017-09-13T09:59:45","name":"[RFC,v3,6/7] i40e: Clean up of cloud filters","commit_ref":null,"pull_url":null,"state":"changes-requested","archived":false,"hash":"513a4ad33a466af25dc3e2405902634b660ad019","submitter":{"id":68504,"url":"http://patchwork.ozlabs.org/api/1.2/people/68504/?format=json","name":"Nambiar, Amritha","email":"amritha.nambiar@intel.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/intel-wired-lan/patch/150529678520.57063.3558143909401835083.stgit@anamdev.jf.intel.com/mbox/","series":[{"id":2860,"url":"http://patchwork.ozlabs.org/api/1.2/series/2860/?format=json","web_url":"http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=2860","date":"2017-09-13T09:59:13","name":"tc-flower based cloud filters in i40e","version":3,"mbox":"http://patchwork.ozlabs.org/series/2860/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/813290/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/813290/checks/","tags":{},"related":[],"headers":{"Return-Path":"<intel-wired-lan-bounces@osuosl.org>","X-Original-To":["incoming@patchwork.ozlabs.org","intel-wired-lan@lists.osuosl.org"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","intel-wired-lan@lists.osuosl.org"],"Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.138; helo=whitealder.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)","Received":["from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xsccW2hQ0z9s76\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 20:00:59 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id AF166889DC;\n\tWed, 13 Sep 2017 10:00:57 +0000 (UTC)","from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id EEO3KFCrAl6g; Wed, 13 Sep 2017 10:00:56 +0000 (UTC)","from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id C6A3A889C7;\n\tWed, 13 Sep 2017 10:00:56 +0000 (UTC)","from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 1A6501CEB58\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Sep 2017 10:00:54 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 12B22882FC\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Sep 2017 10:00:54 +0000 (UTC)","from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id qoy0zFnzK9DS for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Sep 2017 10:00:53 +0000 (UTC)","from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 77ECD882F5\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Sep 2017 10:00:53 +0000 (UTC)","from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby orsmga104.jf.intel.com with ESMTP; 13 Sep 2017 03:00:52 -0700","from anamdev.jf.intel.com ([10.166.29.110])\n\tby fmsmga005.fm.intel.com with ESMTP; 13 Sep 2017 03:00:52 -0700"],"X-Virus-Scanned":["amavisd-new at osuosl.org","amavisd-new at osuosl.org"],"X-Greylist":"domain auto-whitelisted by SQLgrey-1.7.6","X-ExtLoop1":"1","X-IronPort-AV":"E=Sophos;i=\"5.42,387,1500966000\"; d=\"scan'208\";a=\"150797324\"","From":"Amritha Nambiar <amritha.nambiar@intel.com>","To":"intel-wired-lan@lists.osuosl.org, jeffrey.t.kirsher@intel.com","Date":"Wed, 13 Sep 2017 02:59:45 -0700","Message-ID":"<150529678520.57063.3558143909401835083.stgit@anamdev.jf.intel.com>","In-Reply-To":"<150529632024.57063.15338545678487601430.stgit@anamdev.jf.intel.com>","References":"<150529632024.57063.15338545678487601430.stgit@anamdev.jf.intel.com>","User-Agent":"StGit/0.17.1-dirty","MIME-Version":"1.0","Cc":"netdev@vger.kernel.org","Subject":"[Intel-wired-lan] [RFC PATCH v3 6/7] i40e: Clean up of cloud filters","X-BeenThere":"intel-wired-lan@osuosl.org","X-Mailman-Version":"2.1.18-1","Precedence":"list","List-Id":"Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>","List-Unsubscribe":"<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>","List-Archive":"<http://lists.osuosl.org/pipermail/intel-wired-lan/>","List-Post":"<mailto:intel-wired-lan@osuosl.org>","List-Help":"<mailto:intel-wired-lan-request@osuosl.org?subject=help>","List-Subscribe":"<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"intel-wired-lan-bounces@osuosl.org","Sender":"\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"},"content":"Introduce the cloud filter datastructure and cleanup of cloud\nfilters associated with the device.\n\nv2: Moved field comments in struct i40e_cloud_filter to the right.\nRemoved hlist_empty check from i40e_cloud_filter_exit()\n\nSigned-off-by: Amritha Nambiar <amritha.nambiar@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e.h      |    9 +++++++++\n drivers/net/ethernet/intel/i40e/i40e_main.c |   24 ++++++++++++++++++++++++\n 2 files changed, 33 insertions(+)","diff":"diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h\nindex d846da9..6018fb6 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e.h\n@@ -252,6 +252,12 @@ struct i40e_fdir_filter {\n \tu32 fd_id;\n };\n \n+struct i40e_cloud_filter {\n+\tstruct hlist_node cloud_node;\n+\tunsigned long cookie;\n+\tu16 seid;\t/* filter control */\n+};\n+\n #define I40E_ETH_P_LLDP\t\t\t0x88cc\n \n #define I40E_DCB_PRIO_TYPE_STRICT\t0\n@@ -419,6 +425,9 @@ struct i40e_pf {\n \tstruct i40e_udp_port_config udp_ports[I40E_MAX_PF_UDP_OFFLOAD_PORTS];\n \tu16 pending_udp_bitmap;\n \n+\tstruct hlist_head cloud_filter_list;\n+\tu16 num_cloud_filters;\n+\n \tenum i40e_interrupt_policy int_policy;\n \tu16 rx_itr_default;\n \tu16 tx_itr_default;\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex 60c689a..afcf08a 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -6922,6 +6922,26 @@ static void i40e_fdir_filter_exit(struct i40e_pf *pf)\n }\n \n /**\n+ * i40e_cloud_filter_exit - Cleans up the Cloud Filters\n+ * @pf: Pointer to PF\n+ *\n+ * This function destroys the hlist where all the Cloud Filters\n+ * filters were saved.\n+ **/\n+static void i40e_cloud_filter_exit(struct i40e_pf *pf)\n+{\n+\tstruct i40e_cloud_filter *cfilter;\n+\tstruct hlist_node *node;\n+\n+\thlist_for_each_entry_safe(cfilter, node,\n+\t\t\t\t  &pf->cloud_filter_list, cloud_node) {\n+\t\thlist_del(&cfilter->cloud_node);\n+\t\tkfree(cfilter);\n+\t}\n+\tpf->num_cloud_filters = 0;\n+}\n+\n+/**\n  * i40e_close - Disables a network interface\n  * @netdev: network interface device structure\n  *\n@@ -12176,6 +12196,7 @@ static int i40e_setup_pf_switch(struct i40e_pf *pf, bool reinit)\n \t\t\tvsi = i40e_vsi_reinit_setup(pf->vsi[pf->lan_vsi]);\n \t\tif (!vsi) {\n \t\t\tdev_info(&pf->pdev->dev, \"setup of MAIN VSI failed\\n\");\n+\t\t\ti40e_cloud_filter_exit(pf);\n \t\t\ti40e_fdir_teardown(pf);\n \t\t\treturn -EAGAIN;\n \t\t}\n@@ -13010,6 +13031,8 @@ static void i40e_remove(struct pci_dev *pdev)\n \tif (pf->vsi[pf->lan_vsi])\n \t\ti40e_vsi_release(pf->vsi[pf->lan_vsi]);\n \n+\ti40e_cloud_filter_exit(pf);\n+\n \t/* remove attached clients */\n \tif (pf->flags & I40E_FLAG_IWARP_ENABLED) {\n \t\tret_code = i40e_lan_del_device(pf);\n@@ -13241,6 +13264,7 @@ static void i40e_shutdown(struct pci_dev *pdev)\n \n \tdel_timer_sync(&pf->service_timer);\n \tcancel_work_sync(&pf->service_task);\n+\ti40e_cloud_filter_exit(pf);\n \ti40e_fdir_teardown(pf);\n \n \t/* Client close must be called explicitly here because the timer\n","prefixes":["RFC","v3","6/7"]}