From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 7DE5A591E for ; Fri, 2 Dec 2016 05:13:32 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 01 Dec 2016 20:13:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,284,1477983600"; d="scan'208";a="907853621" Received: from dpdk9.sh.intel.com ([10.239.129.141]) by orsmga003.jf.intel.com with ESMTP; 01 Dec 2016 20:13:23 -0800 From: Beilei Xing To: jingjing.wu@intel.com, helin.zhang@intel.com Cc: dev@dpdk.org, wenzhuo.lu@intel.com Date: Fri, 2 Dec 2016 06:53:42 -0500 Message-Id: <1480679625-4157-22-git-send-email-beilei.xing@intel.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1480679625-4157-1-git-send-email-beilei.xing@intel.com> References: <1480679625-4157-1-git-send-email-beilei.xing@intel.com> Subject: [dpdk-dev] [PATCH 21/24] net/i40e: add flow flush function 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 04:13:32 -0000 This patch adds flow flush ops. Signed-off-by: Beilei Xing --- drivers/net/i40e/i40e_ethdev.c | 17 +++++++++++++++++ drivers/net/i40e/i40e_ethdev.h | 1 + drivers/net/i40e/i40e_fdir.c | 3 +-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 34e431b..1a5b767 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -527,6 +527,8 @@ static int i40e_dev_destroy_tunnel_filter(struct i40e_pf *pf, static int i40e_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow, struct rte_flow_error *error); +static int i40e_flow_flush(struct rte_eth_dev *dev, + struct rte_flow_error *error); struct i40e_flow { enum rte_filter_type filter_type; @@ -632,6 +634,7 @@ static const struct rte_flow_ops i40e_flow_ops = { .validate = i40e_flow_validate, .create = (void *)i40e_flow_create, .destroy = i40e_flow_destroy, + .flush = i40e_flow_flush, }; /* store statistics names and its offset in stats structure */ @@ -11811,3 +11814,17 @@ i40e_flow_destroy(struct rte_eth_dev *dev, return ret; } + +static int +i40e_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error) +{ + int ret = 0; + + ret = i40e_fdir_flush(dev); + if (ret) { + error->type = RTE_FLOW_ERROR_TYPE_HANDLE; + return ret; + } + + return ret; +} diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h index 9b60651..8e6cc51 100644 --- a/drivers/net/i40e/i40e_ethdev.h +++ b/drivers/net/i40e/i40e_ethdev.h @@ -684,6 +684,7 @@ int i40e_select_filter_input_set(struct i40e_hw *hw, struct rte_eth_input_set_conf *conf, enum rte_filter_type filter); void i40e_fdir_filter_restore(struct i40e_pf *pf); +int i40e_fdir_flush(struct rte_eth_dev *dev); int i40e_add_del_fdir_filter(struct rte_eth_dev *dev, const struct rte_eth_fdir_filter *filter, bool add); diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c index 30fcd5c..8329987 100644 --- a/drivers/net/i40e/i40e_fdir.c +++ b/drivers/net/i40e/i40e_fdir.c @@ -119,7 +119,6 @@ static int i40e_fdir_filter_programming(struct i40e_pf *pf, enum i40e_filter_pctype pctype, const struct rte_eth_fdir_filter *filter, bool add); -static int i40e_fdir_flush(struct rte_eth_dev *dev); static int i40e_fdir_filter_convert(const struct rte_eth_fdir_filter *input, struct i40e_fdir_filter *filter); @@ -1315,7 +1314,7 @@ i40e_fdir_filter_programming(struct i40e_pf *pf, * i40e_fdir_flush - clear all filters of Flow Director table * @pf: board private structure */ -static int +int i40e_fdir_flush(struct rte_eth_dev *dev) { struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); -- 2.5.5