From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BEDCC282CE for ; Sat, 25 May 2019 11:56:18 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id BC0792085A for ; Sat, 25 May 2019 11:56:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BC0792085A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 13693F11; Sat, 25 May 2019 13:56:16 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 4C8E09E4 for ; Sat, 25 May 2019 13:56:14 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 May 2019 04:56:13 -0700 X-ExtLoop1: 1 Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga003.jf.intel.com with ESMTP; 25 May 2019 04:56:13 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sat, 25 May 2019 04:56:12 -0700 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sat, 25 May 2019 04:56:12 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.70]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.136]) with mapi id 14.03.0415.000; Sat, 25 May 2019 19:56:10 +0800 From: "Zhang, Qi Z" To: "Ergin, Mesut A" , "Xing, Beilei" CC: "dev@dpdk.org" Thread-Topic: [PATCH v2] net/i40e: Fail rte_flow MARK requests if RX func was vectorized Thread-Index: AQHVEoMCj2ToJLznSE6gD5A6lv3V3KZ7uguw Date: Sat, 25 May 2019 11:56:10 +0000 Message-ID: <039ED4275CED7440929022BC67E7061153387351@SHSMSX103.ccr.corp.intel.com> References: <1558738171-145415-1-git-send-email-mesut.a.ergin@intel.com> In-Reply-To: <1558738171-145415-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDQ3OGQ2MmQtYjMwZi00MzhiLWJlNjYtZTE1ZmU5MmZkZTczIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiUHdBUVhPS3M4YmZ5bEo4bHF5WDF5b04rdTJ6dlBkK3FqWGlqekJ4aGRIejdkSEFSdXcxYTlNSjJicWVcL3pVZWkifQ== 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 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: 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 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 went > 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 You can add below fix line with cc stable Fixes: 2e67a7fbf3ff ("net/i40e: config flow director automatically") Cc: stable@dpdk.org >=20 > 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(+) >=20 > 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" >=20 > #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 >=20 > +/* 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) Some code style warning in patchwork need to be fixed. Maybe we can just wrap the check algorithm into one function (ex. i40e_chec= k_mark_support.) And in future when the mark offload is ready, we can keep the function name= and just replace the inside logic? What do you think? Regards Qi > + > 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