From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 8CD0EFA31 for ; Fri, 2 Dec 2016 11:47:09 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 02 Dec 2016 02:47:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,729,1477983600"; d="scan'208";a="1067043924" Received: from dpdk1.bj.intel.com ([172.16.182.84]) by orsmga001.jf.intel.com with ESMTP; 02 Dec 2016 02:47:07 -0800 From: Wei Zhao To: dev@dpdk.org Cc: wenzhuo.lu@intel.com, wei zhao1 Date: Fri, 2 Dec 2016 18:43:14 +0800 Message-Id: <1480675394-59179-19-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 18/18] net/ixgbe: flush consistent filter X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 10:47:10 -0000 From: wei zhao1 This patch adds a function to flush all the flow directory filter on a port. Signed-off-by: wei zhao1 Signed-off-by: Wenzhuo Lu --- drivers/net/ixgbe/ixgbe_ethdev.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 23efc57..e420a3f 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -458,6 +458,8 @@ struct ixgbe_flow *ixgbe_flow_create(struct rte_eth_dev *dev, int ixgbe_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow, struct rte_flow_error *error); +int ixgbe_flow_flush(struct rte_eth_dev *dev, + struct rte_flow_error *error); /* * Define VF Stats MACRO for Non "cleared on read" register @@ -847,7 +849,7 @@ static const struct rte_flow_ops ixgbe_flow_ops = { ixgbe_flow_validate, (void *)ixgbe_flow_create, ixgbe_flow_destroy, - NULL, + ixgbe_flow_flush, NULL, }; /* ntuple filter list structure */ @@ -9946,6 +9948,22 @@ ixgbe_flow_destroy(struct rte_eth_dev *dev, } +/* Destroy all flow rules associated with a port on ixgbe. */ +int +ixgbe_flow_flush(struct rte_eth_dev *dev, + struct rte_flow_error *error) +{ + int ret = 0; + + error->type = RTE_FLOW_ERROR_TYPE_NONE; + if((ret = ixgbe_flush_all_filter(dev)) != 0) { + error->type = RTE_FLOW_ERROR_TYPE_HANDLE; + return ret; + } + + return ret; +} + RTE_PMD_REGISTER_PCI(net_ixgbe, rte_ixgbe_pmd.pci_drv); RTE_PMD_REGISTER_PCI_TABLE(net_ixgbe, pci_id_ixgbe_map); RTE_PMD_REGISTER_PCI(net_ixgbe_vf, rte_ixgbevf_pmd.pci_drv); -- 2.5.5