From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BFDA1A057B; Thu, 2 Apr 2020 10:31:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A65201BEE7; Thu, 2 Apr 2020 10:31:15 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 33E921BE0C; Thu, 2 Apr 2020 10:31:14 +0200 (CEST) IronPort-SDR: yNbsKWsz/BRk4oJMrO/3vDcTHBlSukKNEhQBQRjxObKxHJr3nFVmDvROCjDhHsudNqMxhASn0a /txKU47XGsEg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Apr 2020 01:31:03 -0700 IronPort-SDR: J9lsZBDf2PdpxwuGCePgxU4SLDazgeWux6P+U/BFIYBV3TAmyJtCo3HPpW/JjEkf7/MWRlWN2f 8JDDlKMz40vg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,335,1580803200"; d="scan'208";a="396284854" Received: from pgsmsx108.gar.corp.intel.com ([10.221.44.103]) by orsmga004.jf.intel.com with ESMTP; 02 Apr 2020 01:31:01 -0700 Received: from pgsmsx103.gar.corp.intel.com ([169.254.2.161]) by PGSMSX108.gar.corp.intel.com ([169.254.8.177]) with mapi id 14.03.0439.000; Thu, 2 Apr 2020 16:31:00 +0800 From: "Zhao1, Wei" To: "Zhang, Qi Z" , "dev@dpdk.org" CC: "Peng, Yuan" , "Lu, Nannan" , "Fu, Qi" , "Wang, Haiyue" , "stable@dpdk.org" Thread-Topic: [PATCH v2 06/13] net/ice: add action number check for swicth Thread-Index: AQHWCL1p6SaQquITAkC4sze5fK3JCqhk+iYAgACGXhA= Date: Thu, 2 Apr 2020 08:31:00 +0000 Message-ID: References: <20200313020806.21654-1-wei.zhao1@intel.com> <20200402064620.47668-1-wei.zhao1@intel.com> <20200402064620.47668-7-wei.zhao1@intel.com> <039ED4275CED7440929022BC67E70611547F1D03@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <039ED4275CED7440929022BC67E70611547F1D03@SHSMSX103.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMmExNWQwYzUtNWFmYS00YmY1LWFkNjQtMzNmOTQ0N2ZhNmFkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoicmsxd1owYmd4UURvMmpNNW5NTDh0UEtHSmxsV1lcLzdZRUJcL2FxeWVrVTFkaW5JSG8xQVhkZ1BLRkZiOUpiamg2In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [172.30.20.205] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 06/13] net/ice: add action number check for swicth 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" Ok > -----Original Message----- > From: Zhang, Qi Z > Sent: Thursday, April 2, 2020 4:30 PM > To: Zhao1, Wei ; dev@dpdk.org > Cc: Peng, Yuan ; Lu, Nannan ; > Fu, Qi ; Wang, Haiyue ; > stable@dpdk.org > Subject: RE: [PATCH v2 06/13] net/ice: add action number check for swicth >=20 >=20 >=20 > > -----Original Message----- > > From: Zhao1, Wei > > Sent: Thursday, April 2, 2020 2:46 PM > > To: dev@dpdk.org > > Cc: Zhang, Qi Z ; Peng, Yuan > > ; Lu, Nannan ; Fu, Qi > > ; Wang, Haiyue ; > > stable@dpdk.org; Zhao1, Wei > > Subject: [PATCH v2 06/13] net/ice: add action number check for swicth > > > > The action number can only be one for DCF or PF switch filter, not > > support large action. >=20 > There is no "large action" in rte_flow, maybe just "not support multiple > actions"? >=20 > > > > Cc: stable@dpdk.org > > Fixes: 47d460d63233 ("net/ice: rework switch filter") > > > > Signed-off-by: Wei Zhao > > --- > > drivers/net/ice/ice_switch_filter.c | 48 > > +++++++++++++++++++++++++++++ > > 1 file changed, 48 insertions(+) > > > > diff --git a/drivers/net/ice/ice_switch_filter.c > > b/drivers/net/ice/ice_switch_filter.c > > index d9bdf9637..cc48f22dd 100644 > > --- a/drivers/net/ice/ice_switch_filter.c > > +++ b/drivers/net/ice/ice_switch_filter.c > > @@ -1073,6 +1073,46 @@ ice_switch_parse_action(struct ice_pf *pf, > > return -rte_errno; > > } > > > > +static int > > +ice_switch_check_action(const struct rte_flow_action *actions, > > + struct rte_flow_error *error) > > +{ > > + const struct rte_flow_action *action; > > + enum rte_flow_action_type action_type; > > + uint16_t actions_num =3D 0; > > + > > + for (action =3D actions; action->type !=3D > > + RTE_FLOW_ACTION_TYPE_END; action++) { > > + action_type =3D action->type; > > + switch (action_type) { > > + case RTE_FLOW_ACTION_TYPE_VF: > > + case RTE_FLOW_ACTION_TYPE_RSS: > > + case RTE_FLOW_ACTION_TYPE_QUEUE: > > + case RTE_FLOW_ACTION_TYPE_DROP: > > + actions_num++; > > + break; > > + case RTE_FLOW_ACTION_TYPE_VOID: > > + continue; > > + default: > > + rte_flow_error_set(error, > > + EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, > > + actions, > > + "Invalid action type"); > > + return -rte_errno; > > + } > > + } > > + > > + if (actions_num > 1) { > > + rte_flow_error_set(error, > > + EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, > > + actions, > > + "Invalid action number"); > > + return -rte_errno; > > + } > > + > > + return 0; > > +} > > + > > static int > > ice_switch_parse_pattern_action(struct ice_adapter *ad, > > struct ice_pattern_match_item *array, @@ -1158,6 +1198,14 @@ > > ice_switch_parse_pattern_action(struct ice_adapter *ad, > > goto error; > > } > > > > + ret =3D ice_switch_check_action(actions, error); > > + if (ret) { > > + rte_flow_error_set(error, EINVAL, > > + RTE_FLOW_ERROR_TYPE_HANDLE, NULL, > > + "Invalid input action number"); > > + goto error; > > + } > > + > > if (ad->hw.dcf_enabled) > > ret =3D ice_switch_parse_dcf_action(actions, error, &rule_info); > > else > > -- > > 2.19.1