From patchwork Thu May 16 04:28:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ergin, Mesut A" X-Patchwork-Id: 53459 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6517A5920; Thu, 16 May 2019 06:28:29 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 657912F7D for ; Thu, 16 May 2019 06:28:25 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 May 2019 21:28:23 -0700 X-ExtLoop1: 1 Received: from skx-pink.jf.intel.com ([10.54.80.236]) by orsmga001.jf.intel.com with ESMTP; 15 May 2019 21:28:23 -0700 From: Mesut Ali Ergin To: beilei.xing@intel.com, qi.z.zhang@intel.com Cc: dev@dpdk.org, Mesut Ali Ergin Date: Wed, 15 May 2019 21:28:03 -0700 Message-Id: <1557980885-183777-2-git-send-email-mesut.a.ergin@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1557980885-183777-1-git-send-email-mesut.a.ergin@intel.com> References: <1557980885-183777-1-git-send-email-mesut.a.ergin@intel.com> Subject: [dpdk-dev] [PATCH 1/3] net/i40e: add support for MARK + RSS action in rte_flow 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" Currently, i40e Flow Director action parser only allows following nine action combinations: (QUEUE, PASSTHRU, DROP, QUEUE + MARK, PASSTHRU + MARK, DROP + MARK, QUEUE + FLAG, PASSTHRU + FLAG, DROP + FLAG) Using the existing Cloud Filter profile on the NIC, it is possible to add support for two more combinations as: (MARK + RSS, MARK + FLAG + RSS) Addition of these new combinations would allow more applications to utilize DPDK rte_flow to implement hardware flow offloads with Intel Ethernet 700 series network adapters, including but not limited to the existing OVS DPDK partial hardware flow offload feature. Signed-off-by: Mesut Ali Ergin Acked-by: Qi Zhang --- drivers/net/i40e/i40e_flow.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index 5447e4e..d4d564f 100644 --- a/drivers/net/i40e/i40e_flow.c +++ b/drivers/net/i40e/i40e_flow.c @@ -3078,6 +3078,12 @@ i40e_flow_parse_fdir_action(struct rte_eth_dev *dev, case RTE_FLOW_ACTION_TYPE_PASSTHRU: filter->action.behavior = I40E_FDIR_PASSTHRU; break; + case RTE_FLOW_ACTION_TYPE_MARK: + filter->action.behavior = I40E_FDIR_PASSTHRU; + mark_spec = act->conf; + filter->action.report_status = I40E_FDIR_REPORT_ID; + filter->soft_id = mark_spec->id; + break; default: rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, act, @@ -3090,13 +3096,36 @@ i40e_flow_parse_fdir_action(struct rte_eth_dev *dev, NEXT_ITEM_OF_ACTION(act, actions, index); switch (act->type) { case RTE_FLOW_ACTION_TYPE_MARK: + if (!mark_spec) { + /* Double MARK actions requested */ + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION, act, + "Invalid action."); + return -rte_errno; + } mark_spec = act->conf; filter->action.report_status = I40E_FDIR_REPORT_ID; filter->soft_id = mark_spec->id; break; case RTE_FLOW_ACTION_TYPE_FLAG: + if (!mark_spec) { + /* MARK + FLAG not supported */ + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION, act, + "Invalid action."); + return -rte_errno; + } filter->action.report_status = I40E_FDIR_NO_REPORT_STATUS; break; + case RTE_FLOW_ACTION_TYPE_RSS: + if (filter->action.behavior != I40E_FDIR_PASSTHRU) { + /* RSS filter won't be next if FDIR did not pass thru */ + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION, act, + "Invalid action."); + return -rte_errno; + } + break; case RTE_FLOW_ACTION_TYPE_END: return 0; default: