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 44D8BA0096 for ; Mon, 3 Jun 2019 19:44:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ACF611BA83; Mon, 3 Jun 2019 19:44:47 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 3CDB81B95A for ; Mon, 3 Jun 2019 19:44:46 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jun 2019 10:44:45 -0700 X-ExtLoop1: 1 Received: from orsmsx110.amr.corp.intel.com ([10.22.240.8]) by FMSMGA003.fm.intel.com with ESMTP; 03 Jun 2019 10:44:45 -0700 Received: from orsmsx112.amr.corp.intel.com ([169.254.3.79]) by ORSMSX110.amr.corp.intel.com ([169.254.10.7]) with mapi id 14.03.0415.000; Mon, 3 Jun 2019 10:44:44 -0700 From: "Ergin, Mesut A" To: "Zhang, Qi Z" , "Xing, Beilei" CC: "dev@dpdk.org" Thread-Topic: [PATCH v2] net/i40e: Fail rte_flow MARK requests if RX func was vectorized Thread-Index: AQHVEoMB5ybg/WObQ0+0ZN7eNRW+i6Z8MgIAgA4QqkA= Date: Mon, 3 Jun 2019 17:44:44 +0000 Message-ID: <3615B82CA151CF42A86EDDD9846A8B38C7AA4680@ORSMSX112.amr.corp.intel.com> References: <1558738171-145415-1-git-send-email-mesut.a.ergin@intel.com> <039ED4275CED7440929022BC67E7061153387351@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <039ED4275CED7440929022BC67E7061153387351@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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDQ3OGQ2MmQtYjMwZi00MzhiLWJlNjYtZTE1ZmU5MmZkZTczIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiUHdBUVhPS3M4YmZ5bEo4bHF5WDF5b04rdTJ6dlBkK3FqWGlqekJ4aGRIejdkSEFSdXcxYTlNSjJicWVcL3pVZWkifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.22.254.140] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: Fail rte_flow MARK requests if RX func was vectorized 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" > -----Original Message----- > From: Zhang, Qi Z > Sent: Saturday, May 25, 2019 4:56 AM > To: Ergin, Mesut A ; Xing, Beilei > > Cc: dev@dpdk.org > Subject: RE: [PATCH v2] net/i40e: Fail rte_flow MARK requests if RX func = was > vectorized >=20 >=20 >=20 > > -----Original Message----- > > From: Ergin, Mesut A > > Sent: Saturday, May 25, 2019 6:50 AM > > To: Xing, Beilei ; Zhang, Qi Z > > Cc: dev@dpdk.org; Ergin, Mesut A > > Subject: [PATCH v2] net/i40e: Fail rte_flow MARK requests if RX func wa= s > > vectorized > > > > Runtime requests to install an rte_flow with MARK action should fail if= a vector > > RX function was already chosen for the device during configuration time= . > > > > Currently, i40e rte_flow driver would successfully install the flow wit= h MARK > > action, even when vector RX functions are in use. However, those vector= RX > > functions will fail to retrieve the MARK data from the device descripto= r into > > the mbuf. The original app installing the flow would never know what we= nt > > wrong. The change introduced in this patch must be reverted if/when vec= tor > > RX functions start supporting correct FDIR processing for MARK actions. > > > > Signed-off-by: Mesut Ali Ergin >=20 > You can add below fix line with cc stable > Fixes: 2e67a7fbf3ff ("net/i40e: config flow director automatically") > Cc: stable@dpdk.org >=20 Done in v3, sending shortly. > > > > v2: > > - Check added to fail MARK request only if the device was started > > --- > > drivers/net/i40e/i40e_flow.c | 22 ++++++++++++++++++++++ > > 1 file changed, 22 insertions(+) > > > > diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.= c index > > 3afd779..d1233ed 100644 > > --- a/drivers/net/i40e/i40e_flow.c > > +++ b/drivers/net/i40e/i40e_flow.c > > @@ -22,12 +22,20 @@ > > #include "base/i40e_type.h" > > #include "base/i40e_prototype.h" > > #include "i40e_ethdev.h" > > +#include "i40e_rxtx.h" > > > > #define I40E_IPV6_TC_MASK (0xFF << I40E_FDIR_IPv6_TC_OFFSET) > > #define I40E_IPV6_FRAG_HEADER 44 > > #define I40E_TENANT_ARRAY_NUM 3 > > #define I40E_TCI_MASK 0xFFFF > > > > +/* Check whether device RX function is vectorized */ > > +#define I40E_RX_IS_VECTOR(dev) \ > > + (dev->rx_pkt_burst =3D=3D i40e_recv_scattered_pkts_vec || \ > > + dev->rx_pkt_burst =3D=3D i40e_recv_pkts_vec || \ > > + dev->rx_pkt_burst =3D=3D i40e_recv_scattered_pkts_vec_avx2 || \ > > + dev->rx_pkt_burst =3D=3D i40e_recv_pkts_vec_avx2) >=20 > Some code style warning in patchwork need to be fixed. > Maybe we can just wrap the check algorithm into one function (ex. > i40e_check_mark_support.) > And in future when the mark offload is ready, we can keep the function na= me > and just replace the inside logic? What do you think? >=20 > Regards > Qi >=20 Fair enough -- done in v3 and sending shortly. Thanks. Mesut > > + > > static int i40e_flow_validate(struct rte_eth_dev *dev, > > const struct rte_flow_attr *attr, > > const struct rte_flow_item pattern[], @@ -3079,6 > > +3087,13 @@ i40e_flow_parse_fdir_action(struct rte_eth_dev *dev, > > filter->action.behavior =3D I40E_FDIR_PASSTHRU; > > break; > > case RTE_FLOW_ACTION_TYPE_MARK: > > + if (I40E_RX_IS_VECTOR(dev) && dev->data->dev_started) { > > + /* MARK not supported w/ Vector RX on a started > device*/ > > + rte_flow_error_set(error, EINVAL, > > + RTE_FLOW_ERROR_TYPE_ACTION, > act, > > + "Action not supported: Vector RX has > been > > active."); > > + return -rte_errno; > > + } > > filter->action.behavior =3D I40E_FDIR_PASSTHRU; > > mark_spec =3D act->conf; > > filter->action.report_status =3D I40E_FDIR_REPORT_ID; @@ - > 3103,6 > > +3118,13 @@ i40e_flow_parse_fdir_action(struct rte_eth_dev *dev, > > "Invalid action."); > > return -rte_errno; > > } > > + if (I40E_RX_IS_VECTOR(dev) && dev->data->dev_started) { > > + /* MARK not supported w/ Vector RX on a started > device*/ > > + rte_flow_error_set(error, EINVAL, > > + RTE_FLOW_ERROR_TYPE_ACTION, > act, > > + "Action not supported: Vector RX has > been > > active."); > > + return -rte_errno; > > + } > > mark_spec =3D act->conf; > > filter->action.report_status =3D I40E_FDIR_REPORT_ID; > > filter->soft_id =3D mark_spec->id; > > -- > > 2.7.4