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 B8DF945712 for ; Fri, 2 Aug 2024 12:13:39 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8E43F410EE; Fri, 2 Aug 2024 12:13:39 +0200 (CEST) Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010021.outbound.protection.outlook.com [52.101.69.21]) by mails.dpdk.org (Postfix) with ESMTP id 4DFEA40431; Fri, 2 Aug 2024 12:13:38 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LZongGyiMkqxNycrAwYOzjdgzCVaothUzkChmdgoRIuYmfnE6WtyDApMn77rtuNw8vuBTprk38llSE0gj0hSP53/nB3GOJvYnagaMGgR6mQ8ogWktZpOkT5UB/2ktAWDV5L8ycPDnR5GJPMVK88RE6QmXN7e69nUlORuuGXmH4/ZHDrnL1iNcVUuiN4Jbe5JzFMdl+ksSPH+tH7najW+9NLXlfLMetT7wakcAYwzlGPuktBhhHqQRDN7zwQZWxONT4Pxv8WFbyp0n5MZcN8P2OVw6DYjO+zUYN7IYOGcjkvl1x8MTOjcZycy4rSAbixiG8sr8KvfiyWpLiuyx5F3ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=X9BUb0Vwtl0v1W+RgJX4ffPwULqio4J0PRQGuepidzQ=; b=orMZ5AZ7WEWWmWBgmY8fKRIpTNM6pbbrTTccBOsVOBj0JvvuS36716Do6rusmw6CvDemz4EKEuhxozNuRd6H6U2B8XEoFgP6b8dbfVHpEa8w+nmnU+TkUImlnC2pCFU9ZA2kVKACAt3lK4TGJy/nysZ/nEmr9i/y86BMAbNYSFWODTcQ7pxTWS+10YTsNPgMq1FcNtCNTbCIaQvmiHn1I0Tryw0FGeWWWZ3kk/Vd5J6+TQeK6gRwAr8gQa7bDsk4r2lR2f5Osfd9Mvj/F5UJiqK+9Pz7niuNxHW453bjGI7MmiyZtqw8BAUbZkVAeq3id961awvAdFhlG3ee0i1I8g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=X9BUb0Vwtl0v1W+RgJX4ffPwULqio4J0PRQGuepidzQ=; b=DfucHXUXlEzmXByLBZT2UEBiNoUwierh1NEK9vtjdgfi/D2hio259F9Bc8JIKV6uDHWEGr8lm6eL+bcbdk3bSmY6Tff74WXq7hMgh5gvhZql6uUGoBXtuvYTTIDRN6/LVLs0Ho7teXO9VbEmtXmcIF0cXov8ubpTzXewYqbEtfd4MJQjln3ljK8rzJ39CPkqSIDklj5C4r0mk+kmJdSTp0zAdf5mL34/BqsZ/o2ZShT61gzgx1gWlZhWcuDzpO5xrmwM8Q8waf1So82Y//lq7hvv1eCQIehTRwwwIb/fGZhlfeA93ow7+MwgLLnq5or2C2EB/vQ0CvKVxEOl0bexgw== Received: from AS8SPR01MB0024.eurprd04.prod.outlook.com (2603:10a6:20b:3d0::24) by GVXPR04MB10946.eurprd04.prod.outlook.com (2603:10a6:150:21d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23; Fri, 2 Aug 2024 10:13:35 +0000 Received: from AS8SPR01MB0024.eurprd04.prod.outlook.com ([fe80::c634:479e:8f8a:a325]) by AS8SPR01MB0024.eurprd04.prod.outlook.com ([fe80::c634:479e:8f8a:a325%7]) with mapi id 15.20.7828.016; Fri, 2 Aug 2024 10:13:35 +0000 From: Gagandeep Singh To: Konstantin Ananyev , "dev@dpdk.org" , Konstantin Ananyev , Sean Morrissey CC: "stable@dpdk.org" Subject: RE: [PATCH 3/3] examples/l3fwd: fix maximum acceptable port ID in routes Thread-Topic: [PATCH 3/3] examples/l3fwd: fix maximum acceptable port ID in routes Thread-Index: AQHa1p/wVRBmr3j9f0St0JrbTClx37H6t9YAgAFKzOCAAEMlgIAF2LrQgAARmwCAAlvLgIABBl4AgA5I2rA= Date: Fri, 2 Aug 2024 10:13:35 +0000 Message-ID: References: <20240715101458.645014-1-g.singh@nxp.com> <20240715101458.645014-3-g.singh@nxp.com> <370cf325ad02427cbca5a37756da4c35@huawei.com> <2d2ec732b68b4faba1af4777bd486893@huawei.com> <5f6a307304e8472e9379922ae8c427ea@huawei.com> In-Reply-To: <5f6a307304e8472e9379922ae8c427ea@huawei.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: AS8SPR01MB0024:EE_|GVXPR04MB10946:EE_ x-ms-office365-filtering-correlation-id: 3b98fa6a-28d9-47dc-ba78-08dcb2dbc520 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?9+I+5RQh+GJbvAgcz4Y5hIFPJxzzkqIHRBO3e+J/2AB19glOykDOrVaEGXCa?= =?us-ascii?Q?NlrPh+Vxyd+Ec5n8XVWsjc3SbpT5cBC8QjPqWA/XbuPnY0JS7DQgxRPqxp6E?= =?us-ascii?Q?h8mGOctOl64c0oDrXiSYBhFH1g0Tk21pHEls2tEB3X11yPHtMG/DkEHpJB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F4Co+v5M7wdfVkReaWg3OmbAobJ5UZanXE86Dz7cF?= =?us-ascii?Q?f7VC1VcBvXqT9ULJSCSDZbNbxUYXSxY9l4W0rGkjmpKP+oRevbhqvF7FbMHb?= =?us-ascii?Q?TNpRT408gv2CrJPsqKdPiTpzFXvOfVUiy0sRD5UPJ02J0yz/i7Rh1AsfPtSF?= =?us-ascii?Q?bcZMvuT+5LOFXHIE/GRkrNNKmUiKJJshW7NtOjaQwv3FHJl0r7HKsO5E/UoM?= =?us-ascii?Q?Ob3/tExSG4PrG4aLoDcq24ueaynCTc92Oj/vi7Q96jUkUbqFZOjGhBevmDj+?= =?us-ascii?Q?mdMl+6m33vQk9WfKdXdFGyW0UcIdIKuUWTO7WVDMr9aqqG8vex75XNWH5UGi?= =?us-ascii?Q?95bTUnRRML48WE0PFPzhGCIwyqIHTUkidsshF8wZM9qITa2F8g=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8SPR01MB0024.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?WiqtNXAV04ELsuwzXRivH5h4pGfR/UbXwFbJekZNbH/5quEpi4XUFPm9J+qv?= =?us-ascii?Q?yi7yhJz2t7ynvdDOI8+i81Wcclj5XoTM9mXZ6AaNOyNyKarJPLR73ObeCljU?= =?us-ascii?Q?eJdNJrlyMdYi0sAvPrsoHvfTlX9eo1Rw+EfXkTBobHq2WkEx7xVRp/Jp8/jJ?= =?us-ascii?Q?8WMc6SpCpcWFj+BSSi0jMtSfyWOKbUATs25RrtMcskT6pCLT9b0q37AjBb+E?= =?us-ascii?Q?ypMoGmbVZkETCFwN1BBuedpNvLWgEUvJZykMGCB6o0BJlnPlwDX3Ye+mFtXZ?= =?us-ascii?Q?K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3vAbtU/28SvZipNIw9nJ6PcHe1y8QKU?= =?us-ascii?Q?UW0UgJ2Xaecp7gzXc2kaG9ehIynx0bcRQpxoXtr6iufZXETjL+RbLjRiHFpY?= =?us-ascii?Q?Hr57cu2VAdVAUrfS2JvVce+UZLw0FNTV+lkdNban4XYGvupC9xGh5LKDjPkn?= =?us-ascii?Q?r5RaGVvsYI00bNcCWZtUZb3VAbDXrULRKsz5ALtGUQ28oan4fz2kZc03tjSt?= =?us-ascii?Q?gnZQWd0BXAMn6d1+6a54LU5o6DWB52EFeIk95RvIIDz9qjf0FM+gE1hq7Wgi?= =?us-ascii?Q?32cHNhMpjCFtykfIGy3xkxcBr+sLJUlpzYCb4hwuasA8JAa+0iMTTgHkOYy9?= =?us-ascii?Q?Z1FD7yx/khAmlrEZpr61IuR6B2naBoV9psKAV2P2RbI2/g+3NCItNPOuxJt0?= =?us-ascii?Q?//MpuK5uoVkUg2n67FM=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AS8SPR01MB0024.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3b98fa6a-28d9-47dc-ba78-08dcb2dbc520 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Aug 2024 10:13:35.4118 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: OOUNOUBD8GqPDdFgOLA60JllhoRi5uRc+Wb55pqm6sT5U9AnWguIu0VtJcS69F0H X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB10946 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, > -----Original Message----- > From: Konstantin Ananyev > Sent: Wednesday, July 24, 2024 1:32 PM > To: Konstantin Ananyev ; Gagandeep > Singh ; dev@dpdk.org; Konstantin Ananyev > ; Sean Morrissey > > Cc: stable@dpdk.org > Subject: RE: [PATCH 3/3] examples/l3fwd: fix maximum acceptable port ID > in routes >=20 >=20 >=20 > > > > > > > > Application is accepting routes for port ID up to > > > > > > > > UINT8_MAX for LPM amd EM routes on parsing the given rule > > > > > > > > file, but only up to > > > > > > > > 32 ports can be enabled as per the variable > > > > > > > > enabled_port_mask which is defined as uint32_t. > > > > > > > > > > > > > > > > This patch restricts the rules parsing code to accept > > > > > > > > routes for port ID up to 31 only to avoid any unnecessary > > > > > > > > maintenance of rules which will never be used. > > > > > > > > > > > > > > If we want to add this extra check, probably better to do it = in > setup_lpm(). > > > > > > > Where we already check that port is enabled, and If not, > > > > > > > then this route rule will be skipped: > > > > > > > > > > > > > > /* populate the LPM table */ > > > > > > > for (i =3D 0; i < route_num_v4; i++) { > > > > > > > struct in_addr in; > > > > > > > > > > > > > > /* skip unused ports */ > > > > > > > if ((1 << route_base_v4[i].if_out & > > > > > > > enabled_port_mask) =3D=3D 0) > > > > > > > continue; > > > > > > > > > > > > > > Same for EM. > > > > > > I am trying to update the check for MAX if_out value in rules > > > > > > config file parsing > > > > > which will be before setup_lpm(). > > > > > > The reason is, restricting and adding only those rules which > > > > > > can be used by the application while populating the > > > > > > route_base_v4/v6 at first step and avoid unnecessary memory > > > > > > allocation for local variables to store more > > > > > not required rules. > > > > > > > > > > Hmm... but why it is a problem? > > > > Not really a problem, Just trying to optimize wherever it Is possib= le. > > > > > > > > > > > > > > > > > > > > > > ((1 << route_base_v4[i].if_out & > > > > > > > enabled_port_mask) > > > > > > By looking into this check, it seems restriction to maximum 31 > > > > > > port ID while parsing rule file becomes more valid as this > > > > > > check can pass due to overflow in case value of > route_base_v4[i].if_out Is 31+. > > > > > > > > > > Agree, I think we need both, and it probably need to be in > setup_lpm(). > > > > > Something like: > > > > > > > > > > if (route_base_v4[i].if_out >=3D sizeof(enabled_port_mask) * CHAR= _BIT > || > > > > > ((1 << route_base_v4[i].if_out & enabled_port_mask) =3D=3D 0) = { > > > > > /* print some error message here*/ > > > > > rte_exiit(...); /* or return an error */ } > > > > > > > > > Yes, I can change it to this. > > > > > > I re-checked the code, IMO we should restrict the rules in " > read_config_files" > > > May be we can move this check to read_config_files. > > > As having this check in the setup can result in rte_exit() call when > > > no user rule file Is given and application is using the default > > > rules. In that case route_base_v4 will Have 16 rules for 16 ports (de= fault > rules). > > > So this check will fails always unless user enable all the 16 ports w= ith -p > option. > > > > Ah yes, you are right. > > That's why probably right now we probably just do 'continue;' here... > > Yeh, probably the easiest way is to put this check before setup_lpm() > > - in parsing code, or straight after that. > > Can I ask you for one more thing: can we add a new function that would > > do this check and use it everywhere (lpm/em/acl). >=20 > As alternative thought - we might add to setup_lpm() an extra parameter t= o > indicate what do we want to do on rule with invalid/disabled port - just = skip > it or fail. > Another alternative - remove default route ability at all, though that on= e is a > change in behavior and probably there would be some complaints. Sorry for late reply, first option looks ok to me. I can add a user given o= ption in Setup functions to decide skip or continue.=20 In V2, also will try to create a common function for this check for all the= setup Functions. >=20 > > > > > > > > > > > > > > > > > > > Another question here - why we just silently skip the rule wi= th > invalid port? > > > > > > In read_config_files_lpm() we are calling the rte_exit in case = port ID > is 31+. > > > > > > In setup_lpm, skipping the rules for the ports which are not > > > > > > enabled and not giving error, I guess probably because of ease = of > use. > > > > > > e.g. user has only single ipv4_routes config file with route > > > > > > rules for port ID 0,1,2,3,4 and want to use same file for > > > > > > multiple test cases like 1. when only port 0 enabled 2. when > > > > > > only port 0 and 1 enabled and so on. > > > > > > In this case, user can avoid to have separate route files for > > > > > > each of the test > > > > case. > > > > > > > > > > The problem as I see it - we are not consistent here. > > > > > In some cases we just silently skip rules with invalid (or > > > > > disabled) port numbers, in other cases we generate an error and e= xit. > > > > > For me it would be better, if we follow one simple policy (abort > > > > > with > > > > > error) here for all cases. > > > > Ok, I will add the rte_exit if route port is invalid or not enabled= . > > > > With this change onwards It will be assumed user will add only > > > > those routes With port IDs which are valid and enabled in the > application. > > > > > > > > > > > > > > > > > > > > > > Probably need to fail with error... that what ACL code-path d= oes. > > > > > > > > > > > > > > > Fixes: e7e6dd643092 ("examples/l3fwd: support config file > > > > > > > > for > > > > > > > > EM") > > > > > > > > Fixes: 52def963fc1c ("examples/l3fwd: support config file > > > > > > > > for > > > > > > > > LPM/FIB") > > > > > > > > Cc: sean.morrissey@intel.com > > > > > > > > Cc: stable@dpdk.org > > > > > > > > > > > > > > > > Signed-off-by: Gagandeep Singh > > > > > > > > --- > > > > > > > > examples/l3fwd/em_route_parse.c | 6 ++++-- > > > > > > > > examples/l3fwd/lpm_route_parse.c | 6 ++++-- > > > > > > > > 2 files changed, 8 insertions(+), 4 deletions(-) > > > > > > > > > > > > > > > > diff --git a/examples/l3fwd/em_route_parse.c > > > > > > > > b/examples/l3fwd/em_route_parse.c index > > > > > > > > 8b534de5f1..65c71cd1ba > > > > > > > > 100644 > > > > > > > > --- a/examples/l3fwd/em_route_parse.c > > > > > > > > +++ b/examples/l3fwd/em_route_parse.c > > > > > > > > @@ -65,7 +65,8 @@ em_parse_v6_rule(char *str, struct > em_rule *v) > > > > > > > > /* protocol. */ > > > > > > > > GET_CB_FIELD(in[CB_FLD_PROTO], v->v6_key.proto, 0, > UINT8_MAX, 0); > > > > > > > > /* out interface. */ > > > > > > > > - GET_CB_FIELD(in[CB_FLD_IF_OUT], v->if_out, 0, UINT8_MAX, > 0); > > > > > > > > + GET_CB_FIELD(in[CB_FLD_IF_OUT], v->if_out, 0, > > > > > > > > + (sizeof(enabled_port_mask) * CHAR_BIT) - 1, > 0); > > > > > > > > > > > > > > > > return 0; > > > > > > > > } > > > > > > > > @@ -102,7 +103,8 @@ em_parse_v4_rule(char *str, struct > em_rule *v) > > > > > > > > /* protocol. */ > > > > > > > > GET_CB_FIELD(in[CB_FLD_PROTO], v->v4_key.proto, 0, > UINT8_MAX, 0); > > > > > > > > /* out interface. */ > > > > > > > > - GET_CB_FIELD(in[CB_FLD_IF_OUT], v->if_out, 0, UINT8_MAX, > 0); > > > > > > > > + GET_CB_FIELD(in[CB_FLD_IF_OUT], v->if_out, 0, > > > > > > > > + (sizeof(enabled_port_mask) * CHAR_BIT) - 1, > 0); > > > > > > > > > > > > > > > > return 0; > > > > > > > > } > > > > > > > > diff --git a/examples/l3fwd/lpm_route_parse.c > > > > > > > > b/examples/l3fwd/lpm_route_parse.c > > > > > > > > index f27b66e838..357c12d9fe 100644 > > > > > > > > --- a/examples/l3fwd/lpm_route_parse.c > > > > > > > > +++ b/examples/l3fwd/lpm_route_parse.c > > > > > > > > @@ -110,7 +110,8 @@ lpm_parse_v6_rule(char *str, struct > > > > > > > > lpm_route_rule > > > > > > > > *v) > > > > > > > > > > > > > > > > rc =3D lpm_parse_v6_net(in[CB_FLD_DST_ADDR], v->ip_32, > > > > > > > > &v->depth); > > > > > > > > > > > > > > > > - GET_CB_FIELD(in[CB_FLD_IF_OUT], v->if_out, 0, UINT8_MAX, > 0); > > > > > > > > + GET_CB_FIELD(in[CB_FLD_IF_OUT], v->if_out, 0, > > > > > > > > + (sizeof(enabled_port_mask) * CHAR_BIT) - 1, > 0); > > > > > > > > > > > > > > > > return rc; > > > > > > > > } > > > > > > > > @@ -132,7 +133,8 @@ lpm_parse_v4_rule(char *str, struct > > > > > > > > lpm_route_rule > > > > > > > > *v) > > > > > > > > > > > > > > > > rc =3D parse_ipv4_addr_mask(in[CB_FLD_DST_ADDR], &v->ip, > > > > > > > > &v->depth); > > > > > > > > > > > > > > > > - GET_CB_FIELD(in[CB_FLD_IF_OUT], v->if_out, 0, UINT8_MAX, > 0); > > > > > > > > + GET_CB_FIELD(in[CB_FLD_IF_OUT], v->if_out, 0, > > > > > > > > + (sizeof(enabled_port_mask) * CHAR_BIT) - 1, > 0); > > > > > > > > > > > > > > > > return rc; > > > > > > > > } > > > > > > > > -- > > > > > > > > 2.25.1 > > > > > > > > > > > > Gagan > > >