From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 810D6A0471 for ; Mon, 17 Jun 2019 10:51:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5EF561BE6B; Mon, 17 Jun 2019 10:51:56 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 29F371BE65 for ; Mon, 17 Jun 2019 10:51:54 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jun 2019 01:51:52 -0700 X-ExtLoop1: 1 Received: from pgsmsx102.gar.corp.intel.com ([10.221.44.80]) by orsmga005.jf.intel.com with ESMTP; 17 Jun 2019 01:51:53 -0700 Received: from pgsmsx109.gar.corp.intel.com (10.221.44.109) by PGSMSX102.gar.corp.intel.com (10.221.44.80) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 17 Jun 2019 16:51:51 +0800 Received: from pgsmsx103.gar.corp.intel.com ([169.254.2.96]) by PGSMSX109.gar.corp.intel.com ([169.254.14.14]) with mapi id 14.03.0439.000; Mon, 17 Jun 2019 16:51:51 +0800 From: "Zhao1, Wei" To: "Xing, Beilei" , "Yang, Qiming" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2 1/3] net/ice: enable switch filter Thread-Index: AQHVIPPdU1J/6sy0M06ZNgNITQs6Aqae0qQAgAC+zDA= Date: Mon, 17 Jun 2019 08:51:51 +0000 Message-ID: References: <1559552722-8970-1-git-send-email-qiming.yang@intel.com> <20190612075029.109914-1-qiming.yang@intel.com> <20190612075029.109914-2-qiming.yang@intel.com> <94479800C636CB44BD422CB454846E013CDE5B2E@SHSMSX101.ccr.corp.intel.com> In-Reply-To: <94479800C636CB44BD422CB454846E013CDE5B2E@SHSMSX101.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [172.30.20.206] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 1/3] net/ice: enable switch 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi , Beilei > -----Original Message----- > From: Xing, Beilei > Sent: Monday, June 17, 2019 1:27 PM > To: Yang, Qiming ; dev@dpdk.org > Cc: Zhao1, Wei > Subject: RE: [dpdk-dev] [PATCH v2 1/3] net/ice: enable switch filter >=20 >=20 >=20 > ... >=20 > > + > > +/* By now ice switch filter action code implement only > > +* supports QUEUE or DROP. > > +*/ > > +static int > > +ice_parse_switch_action(struct ice_pf *pf, > > + const struct rte_flow_action *actions, > > + struct rte_flow_error *error, > > + struct ice_adv_rule_info *rule_info) { > > + struct ice_hw *hw =3D ICE_PF_TO_HW(pf); > > + struct ice_vsi *vsi =3D pf->main_vsi; > > + const struct rte_flow_action *act; > > + const struct rte_flow_action_queue *act_q; > > + uint16_t base_queue, index =3D 0; > > + uint32_t reg; > > + > > + /* Check if the first non-void action is QUEUE or DROP. */ > > + NEXT_ITEM_OF_ACTION(act, actions, index); > > + if (act->type !=3D RTE_FLOW_ACTION_TYPE_QUEUE && > > + act->type !=3D RTE_FLOW_ACTION_TYPE_DROP) { > > + rte_flow_error_set(error, EINVAL, > > RTE_FLOW_ERROR_TYPE_ACTION, > > + act, "Not supported action."); > > + return -rte_errno; > > + } > > + reg =3D ICE_READ_REG(hw, PFLAN_RX_QALLOC); > > + if (reg & PFLAN_RX_QALLOC_VALID_M) { > > + base_queue =3D reg & PFLAN_RX_QALLOC_FIRSTQ_M; > > + } else { > > + rte_flow_error_set(error, EINVAL, > > + RTE_FLOW_ERROR_TYPE_ACTION, > > + act, "Invalid queue register"); > > + return -rte_errno; > > + } > > + if (act->type =3D=3D RTE_FLOW_ACTION_TYPE_QUEUE) { > > + act_q =3D act->conf; > > + rule_info->sw_act.fltr_act =3D ICE_FWD_TO_Q; > > + rule_info->sw_act.fwd_id.q_id =3D base_queue + act_q->index; > > + if (act_q->index >=3D pf->dev_data->nb_rx_queues) { > > + rte_flow_error_set(error, EINVAL, > > + RTE_FLOW_ERROR_TYPE_ACTION, > > + act, "Invalid queue ID for" > > + " switch filter."); > > + return -rte_errno; > > + } > > + } else { > > + rule_info->sw_act.fltr_act =3D ICE_DROP_PACKET; > > + } > > + > > + rule_info->sw_act.vsi_handle =3D vsi->idx; > > + rule_info->rx =3D 1; > > + rule_info->sw_act.src =3D vsi->idx; > > + > > + /* Check if the next non-void item is END */ > > + index++; > > + NEXT_ITEM_OF_ACTION(act, actions, index); > > + if (act->type !=3D RTE_FLOW_ACTION_TYPE_END) { > > + rte_flow_error_set(error, EINVAL, > > RTE_FLOW_ERROR_TYPE_ACTION, > > + act, "Not supported action."); > > + return -rte_errno; > > + } > > + > > + return 0; > > +} >=20 >=20 > How about use supported array to replace NEXT_ITEM_OF_ACTION? Just like > pattern. This seems no need to change, i40e also implement in this way.