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 D1B33A05D3 for ; Fri, 24 May 2019 04:48:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A03E6A49; Fri, 24 May 2019 04:48:37 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id C3BE41D7 for ; Fri, 24 May 2019 04:48:35 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 May 2019 19:48:34 -0700 X-ExtLoop1: 1 Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga008.jf.intel.com with ESMTP; 23 May 2019 19:48:34 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 23 May 2019 19:48:33 -0700 Received: from shsmsx105.ccr.corp.intel.com (10.239.4.158) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 23 May 2019 19:48:33 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.70]) by SHSMSX105.ccr.corp.intel.com ([169.254.11.10]) with mapi id 14.03.0415.000; Fri, 24 May 2019 10:48:32 +0800 From: "Zhang, Qi Z" To: "Ergin, Mesut A" , "Xing, Beilei" CC: "dev@dpdk.org" Thread-Topic: [PATCH] net/i40e: Fail rte_flow MARK requests if RX func was vectorized Thread-Index: AQHVEZD95eA6MMh4Y0m7aSSPQvPiPKZ5kSTw Date: Fri, 24 May 2019 02:48:31 +0000 Message-ID: <039ED4275CED7440929022BC67E7061153386AB5@SHSMSX103.ccr.corp.intel.com> References: <1558634242-441514-1-git-send-email-mesut.a.ergin@intel.com> In-Reply-To: <1558634242-441514-1-git-send-email-mesut.a.ergin@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZGY0YWFmZWYtODA3YS00ZmI2LTljZTctODUyOTZmYjgxY2FjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiblhkK2ZlNTFYNFhBNTE4XC9TMjNlZXhURGpnend5eHkxRGR5MVVDTmpEbFVLMU1IZkxOVFoxbmdzZDhpMG4wNnAifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] 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" Hi Mesut: > -----Original Message----- > From: Ergin, Mesut A > Sent: Friday, May 24, 2019 1:57 AM > To: Xing, Beilei ; Zhang, Qi Z > Cc: dev@dpdk.org; Ergin, Mesut A > Subject: [PATCH] net/i40e: Fail rte_flow MARK requests if RX func was > vectorized >=20 > 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. >=20 > Currently, i40e rte_flow driver would successfully install the flow with = MARK > action, even when vector RX functions are in use. However, those vector R= X > functions will fail to retrieve the MARK data from the device descriptor = into > the mbuf. The original app installing the flow would never know what wen= t > wrong. The change introduced in this patch must be reverted if/when vecto= r > RX functions start supporting correct FDIR processing for MARK actions. >=20 > Signed-off-by: Mesut Ali Ergin > --- > drivers/net/i40e/i40e_flow.c | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) >=20 > diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c = index > 3afd779..9a14a1c 100644 > --- a/drivers/net/i40e/i40e_flow.c > +++ b/drivers/net/i40e/i40e_flow.c > @@ -22,6 +22,7 @@ > #include "base/i40e_type.h" > #include "base/i40e_prototype.h" > #include "i40e_ethdev.h" > +#include "i40e_rxtx.h" >=20 > #define I40E_IPV6_TC_MASK (0xFF << I40E_FDIR_IPv6_TC_OFFSET) > #define I40E_IPV6_FRAG_HEADER 44 > @@ -3079,6 +3080,16 @@ 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 (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) { > + /* Vector RX Functions do not support MARK*/ > + rte_flow_error_set(error, EINVAL, > + RTE_FLOW_ERROR_TYPE_ACTION, act, > + "Action not supported when vector RX is in use."); > + return -rte_errno; > + } We may not need to prevent this if the device is already stopped (check dev= ->data->dev_started),=20 since with the fdir flow be created here, vector path will not be selected = in following dev_start. > filter->action.behavior =3D I40E_FDIR_PASSTHRU; > mark_spec =3D act->conf; > filter->action.report_status =3D I40E_FDIR_REPORT_ID; @@ -3103,6 > +3114,16 @@ i40e_flow_parse_fdir_action(struct rte_eth_dev *dev, > "Invalid action."); > return -rte_errno; > } > + if (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) { > + /* Vector RX Functions do not support MARK*/ > + rte_flow_error_set(error, EINVAL, > + RTE_FLOW_ERROR_TYPE_ACTION, act, > + "Action not supported when vector RX is in use."); > + 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