From patchwork Sat May 27 02:46:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xing, Beilei" X-Patchwork-Id: 24685 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id CA39E2BAC; Sat, 27 May 2017 04:49:34 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 1AA812BA7 for ; Sat, 27 May 2017 04:49:32 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP; 26 May 2017 19:49:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.38,400,1491289200"; d="scan'208"; a="1153433913" Received: from dpdk9.sh.intel.com ([10.239.129.137]) by fmsmga001.fm.intel.com with ESMTP; 26 May 2017 19:49:29 -0700 From: Beilei Xing To: jingjing.wu@intel.com Cc: dev@dpdk.org Date: Sat, 27 May 2017 10:46:00 +0800 Message-Id: <1495853160-36691-1-git-send-email-beilei.xing@intel.com> X-Mailer: git-send-email 2.5.5 Subject: [dpdk-dev] [PATCH] net/i40e: implement flag action for FDIR 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This commit adds flag action support for flow director. Signed-off-by: Beilei Xing --- drivers/net/i40e/i40e_flow.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index 218ece1..2af88c6 100644 --- a/drivers/net/i40e/i40e_flow.c +++ b/drivers/net/i40e/i40e_flow.c @@ -2813,7 +2813,6 @@ i40e_flow_parse_fdir_action(struct rte_eth_dev *dev, else filter->action.behavior = RTE_ETH_FDIR_REJECT; - filter->action.report_status = RTE_ETH_FDIR_REPORT_ID; filter->action.rx_queue = act_q->index; if (filter->action.rx_queue >= pf->dev_data->nb_rx_queues) { @@ -2823,10 +2822,11 @@ i40e_flow_parse_fdir_action(struct rte_eth_dev *dev, return -rte_errno; } - /* Check if the next non-void item is MARK or END. */ + /* Check if the next non-void item is MARK or FLAG or END. */ index++; NEXT_ITEM_OF_ACTION(act, actions, index); if (act->type != RTE_FLOW_ACTION_TYPE_MARK && + act->type != RTE_FLOW_ACTION_TYPE_FLAG && act->type != RTE_FLOW_ACTION_TYPE_END) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, act, "Invalid action."); @@ -2835,17 +2835,21 @@ i40e_flow_parse_fdir_action(struct rte_eth_dev *dev, if (act->type == RTE_FLOW_ACTION_TYPE_MARK) { mark_spec = (const struct rte_flow_action_mark *)act->conf; + filter->action.report_status = RTE_ETH_FDIR_REPORT_ID; filter->soft_id = mark_spec->id; + } else if (act->type == RTE_FLOW_ACTION_TYPE_FLAG) + filter->action.report_status = RTE_ETH_FDIR_NO_REPORT_STATUS; + else if (act->type == RTE_FLOW_ACTION_TYPE_END) + return 0; - /* Check if the next non-void item is END */ - index++; - NEXT_ITEM_OF_ACTION(act, actions, index); - if (act->type != RTE_FLOW_ACTION_TYPE_END) { - rte_flow_error_set(error, EINVAL, - RTE_FLOW_ERROR_TYPE_ACTION, - act, "Invalid action."); - return -rte_errno; - } + /* Check if the next non-void item is END */ + index++; + NEXT_ITEM_OF_ACTION(act, actions, index); + if (act->type != RTE_FLOW_ACTION_TYPE_END) { + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION, + act, "Invalid action."); + return -rte_errno; } return 0;