From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 99227A00BE; Wed, 20 Apr 2022 14:01:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7896440C35; Wed, 20 Apr 2022 14:01:48 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id A910C406A2 for ; Wed, 20 Apr 2022 14:01:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650456106; x=1681992106; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=sZPeO0ROTgRdXEEydJhLHFCAQ3zrw4XC20AddyI01qU=; b=Lat3StdGncMg30nQJMKQxTlGbdk4rohJWTakFXmM0P0vVX9nBHPwdtgz vRYFiSappzSdZ/eyduiIjhH20N+UhrcK2Nge9Rl5oIdfHe9KErlsc1Hyd WAWpb4rmrAJzwaAIOsNX+MHFpqbaX0MZaCLSy2bmXpCfYx8MPIJmh34q2 1oq9wjE36h/6gkhx8AU+RcdNrCjOFoC9VMEFWnLaeUTSqSvpYVSzPfNOY jdLWQQlnsc4+fgZJFW75W/UcyrAj0Qg4xRYaeWC0kMhULaIWOarQKxW3F 9nCYN9WOoPg19/1Um3f4eXY/cI/Mba1DVXEWhcg8D/gBgqeHsn/R7Ay71 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10322"; a="263771504" X-IronPort-AV: E=Sophos;i="5.90,275,1643702400"; d="scan'208";a="263771504" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2022 05:01:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,275,1643702400"; d="scan'208";a="510523746" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by orsmga003.jf.intel.com with ESMTP; 20 Apr 2022 05:01:44 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Wed, 20 Apr 2022 05:01:43 -0700 Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by fmsmsx605.amr.corp.intel.com ([10.18.126.85]) with mapi id 15.01.2308.027; Wed, 20 Apr 2022 05:01:43 -0700 From: "Zhang, Qi Z" To: "Liu, KevinX" , "dev@dpdk.org" CC: "Yang, Qiming" , "Yang, SteveX" , Alvin Zhang Subject: RE: [PATCH v4 1/2] net/ice: fix DCF ACL flow engine Thread-Topic: [PATCH v4 1/2] net/ice: fix DCF ACL flow engine Thread-Index: AQHYU8PZeUPQhVuT8UyuKPmTsH7OLKz4tBoQ Date: Wed, 20 Apr 2022 12:01:43 +0000 Message-ID: References: <20220413171030.2231163-1-kevinx.liu@intel.com> <20220419160131.484677-1-kevinx.liu@intel.com> <20220419160131.484677-2-kevinx.liu@intel.com> In-Reply-To: <20220419160131.484677-2-kevinx.liu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.401.20 dlp-product: dlpe-windows x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > -----Original Message----- > From: Liu, KevinX > Sent: Wednesday, April 20, 2022 12:02 AM > To: dev@dpdk.org > Cc: Yang, Qiming ; Zhang, Qi Z > ; Yang, SteveX ; Alvin Zhang > ; Liu, KevinX > Subject: [PATCH v4 1/2] net/ice: fix DCF ACL flow engine >=20 > From: Alvin Zhang >=20 > ACL is not a necessary feature for DCF, it may not be supported by the ic= e > kernel driver, so in this patch the program does not return the ACL initi= ation > fails to high level functions, as substitute it prints some error logs, c= leans the > related resources and unregisters the ACL engine. >=20 > Fixes: 40d466fa9f76 ("net/ice: support ACL filter in DCF") >=20 > Signed-off-by: Alvin Zhang > Signed-off-by: Kevin Liu > --- > drivers/net/ice/ice_acl_filter.c | 20 ++++++++++++++---- > drivers/net/ice/ice_generic_flow.c | 34 +++++++++++++++++++++++------- > 2 files changed, 42 insertions(+), 12 deletions(-) >=20 > diff --git a/drivers/net/ice/ice_acl_filter.c b/drivers/net/ice/ice_acl_f= ilter.c > index 8fe6f5aeb0..20a1f86c43 100644 > --- a/drivers/net/ice/ice_acl_filter.c > +++ b/drivers/net/ice/ice_acl_filter.c > @@ -56,6 +56,8 @@ ice_pattern_match_item ice_acl_pattern[] =3D { > {pattern_eth_ipv4_sctp, ICE_ACL_INSET_ETH_IPV4_SCTP, > ICE_INSET_NONE, ICE_INSET_NONE}, > }; >=20 > +static void ice_acl_prof_free(struct ice_hw *hw); > + > static int > ice_acl_prof_alloc(struct ice_hw *hw) > { > @@ -1007,17 +1009,27 @@ ice_acl_init(struct ice_adapter *ad) >=20 > ret =3D ice_acl_setup(pf); > if (ret) > - return ret; > + goto deinit_acl; >=20 > ret =3D ice_acl_bitmap_init(pf); > if (ret) > - return ret; > + goto deinit_acl; >=20 > ret =3D ice_acl_prof_init(pf); > if (ret) > - return ret; > + goto deinit_acl; >=20 > - return ice_register_parser(parser, ad); > + ret =3D ice_register_parser(parser, ad); > + if (ret) > + goto deinit_acl; > + > + return 0; > + > +deinit_acl: > + ice_deinit_acl(pf); > + ice_acl_prof_free(hw); > + PMD_DRV_LOG(ERR, "ACL init failed, may not supported!"); Better to print the error message at the place where the error happens, for= easy debugging. > + return ret; > } >=20 > static void > diff --git a/drivers/net/ice/ice_generic_flow.c > b/drivers/net/ice/ice_generic_flow.c > index 57eb002bde..cfdc4bd697 100644 > --- a/drivers/net/ice/ice_generic_flow.c > +++ b/drivers/net/ice/ice_generic_flow.c > @@ -1817,6 +1817,12 @@ ice_register_flow_engine(struct ice_flow_engine > *engine) > TAILQ_INSERT_TAIL(&engine_list, engine, node); } >=20 > +static void > +ice_unregister_flow_engine(struct ice_flow_engine *engine) { > + TAILQ_REMOVE(&engine_list, engine, node); } > + > int > ice_flow_init(struct ice_adapter *ad) > { > @@ -1843,9 +1849,18 @@ ice_flow_init(struct ice_adapter *ad) >=20 > ret =3D engine->init(ad); > if (ret) { > - PMD_INIT_LOG(ERR, "Failed to initialize engine %d", > - engine->type); > - return ret; > + /** > + * ACL may not supported in kernel driver, may not be supported > + * so just unregister the engine. > + */ > + if (engine->type =3D=3D ICE_FLOW_ENGINE_ACL) { > + ice_unregister_flow_engine(engine); > + } else { > + PMD_INIT_LOG(ERR, > + "Failed to initialize engine %d", > + engine->type); > + return ret; > + } > } > } > return 0; > @@ -1937,7 +1952,7 @@ ice_register_parser(struct ice_flow_parser *parser, >=20 > list =3D ice_get_parser_list(parser, ad); > if (list =3D=3D NULL) > - return -EINVAL; > + goto err; >=20 > if (ad->devargs.pipe_mode_support) { > TAILQ_INSERT_TAIL(list, parser_node, node); @@ -1949,7 > +1964,7 @@ ice_register_parser(struct ice_flow_parser *parser, > ICE_FLOW_ENGINE_ACL) { > TAILQ_INSERT_AFTER(list, > existing_node, > parser_node, node); > - goto DONE; > + return 0; > } > } > TAILQ_INSERT_HEAD(list, parser_node, node); @@ - > 1960,7 +1975,7 @@ ice_register_parser(struct ice_flow_parser *parser, > ICE_FLOW_ENGINE_SWITCH) { > TAILQ_INSERT_AFTER(list, > existing_node, > parser_node, node); > - goto DONE; > + return 0; > } > } > TAILQ_INSERT_HEAD(list, parser_node, node); @@ - > 1969,11 +1984,14 @@ ice_register_parser(struct ice_flow_parser *parser, > } else if (parser->engine->type =3D=3D ICE_FLOW_ENGINE_ACL) { > TAILQ_INSERT_HEAD(list, parser_node, node); > } else { > - return -EINVAL; > + goto err; > } > } > -DONE: > return 0; > +err: > + rte_free(parser_node); > + PMD_DRV_LOG(ERR, "%s failed.", __func__); > + return -EINVAL; > } >=20 > void > -- > 2.33.1