Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/17469/?format=api
http://patches.dpdk.org/api/patches/17469/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1480675394-59179-11-git-send-email-wei.zhao1@intel.com/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<1480675394-59179-11-git-send-email-wei.zhao1@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1480675394-59179-11-git-send-email-wei.zhao1@intel.com", "date": "2016-12-02T10:43:06", "name": "[dpdk-dev,10/18] net/ixgbe: flush all the filters", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "4fe720a904ff3da5f03dca0a17b60381d52af1cb", "submitter": { "id": 495, "url": "http://patches.dpdk.org/api/people/495/?format=api", "name": "Zhao1, Wei", "email": "wei.zhao1@intel.com" }, "delegate": { "id": 319, "url": "http://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1480675394-59179-11-git-send-email-wei.zhao1@intel.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/17469/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/17469/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 106D2FA5D;\n\tFri, 2 Dec 2016 11:47:35 +0100 (CET)", "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby dpdk.org (Postfix) with ESMTP id 841F058C8\n\tfor <dev@dpdk.org>; Fri, 2 Dec 2016 11:46:58 +0100 (CET)", "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga103.jf.intel.com with ESMTP; 02 Dec 2016 02:46:58 -0800", "from dpdk1.bj.intel.com ([172.16.182.84])\n\tby orsmga001.jf.intel.com with ESMTP; 02 Dec 2016 02:46:57 -0800" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos; i=\"5.33,729,1477983600\"; d=\"scan'208\";\n\ta=\"1067043846\"", "From": "Wei Zhao <wei.zhao1@intel.com>", "To": "dev@dpdk.org", "Cc": "wenzhuo.lu@intel.com,\n\twei zhao1 <wei.zhao1@intel.com>", "Date": "Fri, 2 Dec 2016 18:43:06 +0800", "Message-Id": "<1480675394-59179-11-git-send-email-wei.zhao1@intel.com>", "X-Mailer": "git-send-email 2.5.5", "In-Reply-To": "<1480675394-59179-1-git-send-email-wei.zhao1@intel.com>", "References": "<1480675394-59179-1-git-send-email-wei.zhao1@intel.com>", "Subject": "[dpdk-dev] [PATCH 10/18] net/ixgbe: flush all the filters", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "From: wei zhao1 <wei.zhao1@intel.com>\n\nAdd support for flush all the filters in SW.\n\nSigned-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>\nSigned-off-by: wei zhao1 <wei.zhao1@intel.com>\n---\n drivers/net/ixgbe/ixgbe_ethdev.c | 93 ++++++++++++++++++++++++++++++++++++++++\n drivers/net/ixgbe/ixgbe_ethdev.h | 9 ++++\n drivers/net/ixgbe/ixgbe_fdir.c | 24 +++++++++++\n drivers/net/ixgbe/ixgbe_pf.c | 1 +\n 4 files changed, 127 insertions(+)", "diff": "diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c\nindex 783f426..f84ca17 100644\n--- a/drivers/net/ixgbe/ixgbe_ethdev.c\n+++ b/drivers/net/ixgbe/ixgbe_ethdev.c\n@@ -392,6 +392,7 @@ static int ixgbe_dev_udp_tunnel_port_del(struct rte_eth_dev *dev,\n \t\t\t\t\t struct rte_eth_udp_tunnel *udp_tunnel);\n static int ixgbe_filter_restore(struct rte_eth_dev *dev);\n static void ixgbe_l2_tunnel_conf(struct rte_eth_dev *dev);\n+int ixgbe_flush_all_filter(struct rte_eth_dev *dev);\n \n /*\n * Define VF Stats MACRO for Non \"cleared on read\" register\n@@ -6190,6 +6191,7 @@ ixgbe_add_del_ethertype_filter(struct rte_eth_dev *dev,\n \t\tethertype_filter.ethertype = filter->ether_type;\n \t\tethertype_filter.etqf = etqf;\n \t\tethertype_filter.etqs = etqs;\n+\t\tethertype_filter.conf = FALSE;\n \t\tret = ixgbe_ethertype_filter_insert(filter_info,\n \t\t\t\t\t\t ðertype_filter);\n \t\tif (ret < 0) {\n@@ -7902,6 +7904,97 @@ ixgbe_l2_tunnel_conf(struct rte_eth_dev *dev)\n \t(void)ixgbe_update_e_tag_eth_type(hw, l2_tn_info->e_tag_ether_type);\n }\n \n+/* remove all the n-tuple filters */\n+static void\n+ixgbe_clear_all_ntuple_filter(struct rte_eth_dev *dev)\n+{\n+\tstruct ixgbe_filter_info *filter_info =\n+\t\tIXGBE_DEV_PRIVATE_TO_FILTER_INFO(dev->data->dev_private);\n+\tstruct ixgbe_5tuple_filter *p_5tuple;\n+\n+\twhile ((p_5tuple = TAILQ_FIRST(&filter_info->fivetuple_list)))\n+\t\tixgbe_remove_5tuple_filter(dev, p_5tuple);\n+}\n+\n+/* remove all the ether type filters */\n+static void\n+ixgbe_clear_all_ethertype_filter(struct rte_eth_dev *dev)\n+{\n+\tstruct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct ixgbe_filter_info *filter_info =\n+\t\tIXGBE_DEV_PRIVATE_TO_FILTER_INFO(dev->data->dev_private);\n+\tint i;\n+\n+\tfor (i = 0; i < IXGBE_MAX_ETQF_FILTERS; i++) {\n+\t\tif (filter_info->ethertype_mask & (1 << i) &&\n+\t\t !filter_info->ethertype_filters[i].conf) {\n+\t\t\t(void)ixgbe_ethertype_filter_remove(filter_info,\n+\t\t\t\t\t\t\t (uint8_t)i);\n+\t\t\tIXGBE_WRITE_REG(hw, IXGBE_ETQF(i), 0);\n+\t\t\tIXGBE_WRITE_REG(hw, IXGBE_ETQS(i), 0);\n+\t\t\tIXGBE_WRITE_FLUSH(hw);\n+\t\t}\n+\t}\n+}\n+\n+/* remove the SYN filter */\n+static void\n+ixgbe_clear_syn_filter(struct rte_eth_dev *dev)\n+{\n+\tstruct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct ixgbe_filter_info *filter_info =\n+\t\tIXGBE_DEV_PRIVATE_TO_FILTER_INFO(dev->data->dev_private);\n+\n+\tif (filter_info->syn_info & IXGBE_SYN_FILTER_ENABLE) {\n+\t\tfilter_info->syn_info = 0;\n+\n+\t\tIXGBE_WRITE_REG(hw, IXGBE_SYNQF, 0);\n+\t\tIXGBE_WRITE_FLUSH(hw);\n+\t}\n+}\n+\n+/* remove all the L2 tunnel filters */\n+static int\n+ixgbe_clear_all_l2_tn_filter(struct rte_eth_dev *dev)\n+{\n+\tstruct ixgbe_l2_tn_info *l2_tn_info =\n+\t\tIXGBE_DEV_PRIVATE_TO_L2_TN_INFO(dev->data->dev_private);\n+\tstruct ixgbe_l2_tn_filter *l2_tn_filter;\n+\tstruct rte_eth_l2_tunnel_conf l2_tn_conf;\n+\tint ret = 0;\n+\n+\twhile ((l2_tn_filter = TAILQ_FIRST(&l2_tn_info->l2_tn_list))) {\n+\t\tl2_tn_conf.l2_tunnel_type = l2_tn_filter->key.l2_tn_type;\n+\t\tl2_tn_conf.tunnel_id = l2_tn_filter->key.tn_id;\n+\t\tl2_tn_conf.pool = l2_tn_filter->pool;\n+\t\tret = ixgbe_dev_l2_tunnel_filter_del(dev, &l2_tn_conf);\n+\t\tif (ret < 0)\n+\t\t\treturn ret;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+int\n+ixgbe_flush_all_filter(struct rte_eth_dev *dev)\n+{\n+\tint ret = 0;\n+\n+\tixgbe_clear_all_ntuple_filter(dev);\n+\tixgbe_clear_all_ethertype_filter(dev);\n+\tixgbe_clear_syn_filter(dev);\n+\n+\tret = ixgbe_clear_all_fdir_filter(dev);\n+\tif (ret < 0)\n+\t\treturn ret;\n+\n+\tret = ixgbe_clear_all_l2_tn_filter(dev);\n+\tif (ret < 0)\n+\t\treturn ret;\n+\n+\treturn 0;\n+}\n+\n RTE_PMD_REGISTER_PCI(net_ixgbe, rte_ixgbe_pmd.pci_drv);\n RTE_PMD_REGISTER_PCI_TABLE(net_ixgbe, pci_id_ixgbe_map);\n RTE_PMD_REGISTER_PCI(net_ixgbe_vf, rte_ixgbevf_pmd.pci_drv);\ndiff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h\nindex 6327962..9ed5f45 100644\n--- a/drivers/net/ixgbe/ixgbe_ethdev.h\n+++ b/drivers/net/ixgbe/ixgbe_ethdev.h\n@@ -274,6 +274,11 @@ struct ixgbe_ethertype_filter {\n \tuint16_t ethertype;\n \tuint32_t etqf;\n \tuint32_t etqs;\n+\t/**\n+\t * If this filter is added by configuration,\n+\t * it should not be removed.\n+\t */\n+\tbool conf;\n };\n \n /*\n@@ -495,6 +500,7 @@ uint32_t ixgbe_convert_vm_rx_mask_to_val(uint16_t rx_mask, uint32_t orig_val);\n int ixgbe_fdir_ctrl_func(struct rte_eth_dev *dev,\n \t\t\tenum rte_filter_op filter_op, void *arg);\n void ixgbe_fdir_filter_restore(struct rte_eth_dev *dev);\n+int ixgbe_clear_all_fdir_filter(struct rte_eth_dev *dev);\n \n static inline int\n ixgbe_ethertype_filter_lookup(struct ixgbe_filter_info *filter_info,\n@@ -525,6 +531,8 @@ ixgbe_ethertype_filter_insert(struct ixgbe_filter_info *filter_info,\n \t\t\t\tethertype_filter->etqf;\n \t\t\tfilter_info->ethertype_filters[i].etqs =\n \t\t\t\tethertype_filter->etqs;\n+\t\t\tfilter_info->ethertype_filters[i].conf =\n+\t\t\t\tethertype_filter->conf;\n \t\t\treturn i;\n \t\t}\n \t}\n@@ -541,6 +549,7 @@ ixgbe_ethertype_filter_remove(struct ixgbe_filter_info *filter_info,\n \tfilter_info->ethertype_filters[idx].ethertype = 0;\n \tfilter_info->ethertype_filters[idx].etqf = 0;\n \tfilter_info->ethertype_filters[idx].etqs = 0;\n+\tfilter_info->ethertype_filters[idx].etqs = FALSE;\n \treturn idx;\n }\n \ndiff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdir.c\nindex d390972..7097dca 100644\n--- a/drivers/net/ixgbe/ixgbe_fdir.c\n+++ b/drivers/net/ixgbe/ixgbe_fdir.c\n@@ -1514,3 +1514,27 @@ ixgbe_fdir_filter_restore(struct rte_eth_dev *dev)\n \t\t}\n \t}\n }\n+\n+/* remove all the flow director filters */\n+int\n+ixgbe_clear_all_fdir_filter(struct rte_eth_dev *dev)\n+{\n+\tstruct ixgbe_hw_fdir_info *fdir_info =\n+\t\tIXGBE_DEV_PRIVATE_TO_FDIR_INFO(dev->data->dev_private);\n+\tstruct ixgbe_fdir_filter *fdir_filter;\n+\tint ret = 0;\n+\n+\t/* flush flow director */\n+\trte_hash_reset(fdir_info->hash_handle);\n+\tmemset(fdir_info->hash_map, 0,\n+\t sizeof(struct ixgbe_fdir_filter *) * IXGBE_MAX_FDIR_FILTER_NUM);\n+\twhile ((fdir_filter = TAILQ_FIRST(&fdir_info->fdir_list))) {\n+\t\tTAILQ_REMOVE(&fdir_info->fdir_list,\n+\t\t\t fdir_filter,\n+\t\t\t entries);\n+\t\trte_free(fdir_filter);\n+\t}\n+\tret = ixgbe_fdir_flush(dev);\n+\n+\treturn ret;\n+}\ndiff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c\nindex 6139915..5f017eb 100644\n--- a/drivers/net/ixgbe/ixgbe_pf.c\n+++ b/drivers/net/ixgbe/ixgbe_pf.c\n@@ -197,6 +197,7 @@ ixgbe_add_tx_flow_control_drop_filter(struct rte_eth_dev *eth_dev)\n \t\t\t\tIXGBE_ETQF_TX_ANTISPOOF |\n \t\t\t\tIXGBE_ETHERTYPE_FLOW_CTRL;\n \tethertype_filter.etqs = 0;\n+\tethertype_filter.conf = TRUE;\n \ti = ixgbe_ethertype_filter_insert(filter_info,\n \t\t\t\t\t ðertype_filter);\n \tif (i < 0) {\n", "prefixes": [ "dpdk-dev", "10/18" ] }{ "id": 17469, "url": "