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 02DCE41C42; Wed, 8 Feb 2023 18:45:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DD84A4014F; Wed, 8 Feb 2023 18:45:46 +0100 (CET) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2044.outbound.protection.outlook.com [40.107.21.44]) by mails.dpdk.org (Postfix) with ESMTP id D3BBA40141 for ; Wed, 8 Feb 2023 18:45:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NrZ10EUtMv+ZNAXboQx6HhoMbyAiL5WwtPPBQVzbzKo=; b=4WV365S2KyZcMGmG47R9XIDCC4RcK8nFEoXXBBBM/U0ay35TEK8ru6WJqVTWUeKBLO7tnmN//UWKZSJj7GWt9WsNTuyxEC/vG8slk5LMMcPcuof23HHl/gfOkMhUjJ+LQBm+F1rqFAYjHp/JLAFTX/evPgAhr8s3Z+8Bxe2PXTw= Received: from DB3PR06CA0022.eurprd06.prod.outlook.com (2603:10a6:8:1::35) by AS2PR08MB9644.eurprd08.prod.outlook.com (2603:10a6:20b:607::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.17; Wed, 8 Feb 2023 17:45:43 +0000 Received: from DBAEUR03FT041.eop-EUR03.prod.protection.outlook.com (2603:10a6:8:1:cafe::22) by DB3PR06CA0022.outlook.office365.com (2603:10a6:8:1::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.17 via Frontend Transport; Wed, 8 Feb 2023 17:45:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT041.mail.protection.outlook.com (100.127.142.233) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.17 via Frontend Transport; Wed, 8 Feb 2023 17:45:43 +0000 Received: ("Tessian outbound 3ad958cd7492:v132"); Wed, 08 Feb 2023 17:45:43 +0000 X-CR-MTA-TID: 64aa7808 Received: from 102b26ef7bad.3 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 6F2B190C-F1E1-41A5-845B-A22B97A47514.1; Wed, 08 Feb 2023 17:45:32 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 102b26ef7bad.3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 08 Feb 2023 17:45:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fD+nWmN7tiBegq7YwbCo2PbIHNozA93a7yd+uUDQlOptyqICww0st7BfTf4wz3LGmd6qAx7Evm2+YLYWs04JYqL0fughokbEinxyyvRDLVJmE6nz+05ZqCp5NIvDPvozmns1q5EFwv+yayrMQ7tz+n96UNKEAeg4q7VpdBpIMr9QRi3vGTqwLe4tmaKULewdiyd/gn1uFZWURW4S+r40/YjTvhxDCUiYF7t7q26RHT3iVcKlMGGurltyuqRNszYns8UVz5h/Yxqpd1fTIOEHPEvjn1XzXE7kYSj/uRGX5p7bZpjw2wkeZgERxbphklDpiivfYHWm28ECIxdY8EvSyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=NrZ10EUtMv+ZNAXboQx6HhoMbyAiL5WwtPPBQVzbzKo=; b=CR2MhRe/jIPyhBtytZ9mjuzHcDKHTu9yuzZF44mvzpA0Pxs54As/yrs7bTy2BTtn8vU8XygY5zVLwiCjscWhiwZiTdMnY2rjW9I13RWrRza2pnZV6/Q8luaZ5Ml1Gth/bOEpq5UWAgPyqGA5YvwkYF/p7qabcO6bCFbHiYuVflwCqC67oXjLmP5mU9xKtG5uSqqqhwHj8oVWNHn0TUoxaGg41ZKBbIQ1E2xSxDu9UjMKMpBlhzxcHZsyLEqTTiP6EeDRBucUfwm7ybydc6EsB5DRjYG4PSEUjmek1N/XZR8fO5iP3jq7+qSZOKdUe4EOLyc3XmxtLDvZcMpuZQy9Wg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NrZ10EUtMv+ZNAXboQx6HhoMbyAiL5WwtPPBQVzbzKo=; b=4WV365S2KyZcMGmG47R9XIDCC4RcK8nFEoXXBBBM/U0ay35TEK8ru6WJqVTWUeKBLO7tnmN//UWKZSJj7GWt9WsNTuyxEC/vG8slk5LMMcPcuof23HHl/gfOkMhUjJ+LQBm+F1rqFAYjHp/JLAFTX/evPgAhr8s3Z+8Bxe2PXTw= Received: from DB7PR08MB3865.eurprd08.prod.outlook.com (2603:10a6:10:74::25) by PA4PR08MB7481.eurprd08.prod.outlook.com (2603:10a6:102:2a5::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.36; Wed, 8 Feb 2023 17:45:31 +0000 Received: from DB7PR08MB3865.eurprd08.prod.outlook.com ([fe80::ee54:c9dc:b13d:727b]) by DB7PR08MB3865.eurprd08.prod.outlook.com ([fe80::ee54:c9dc:b13d:727b%3]) with mapi id 15.20.6064.036; Wed, 8 Feb 2023 17:45:30 +0000 From: Kamalakshitha Aligeri To: Kamalakshitha Aligeri , "jerinj@marvell.com" , "thomas@monjalon.net" , "david.marchand@redhat.com" CC: "dev@dpdk.org" , nd , Nathan Brown , Ruifeng Wang , Feifei Wang , nd Subject: RE: [PATCH 1/3] examples/l3fwd: validate ptype only for type of traffic sent Thread-Topic: [PATCH 1/3] examples/l3fwd: validate ptype only for type of traffic sent Thread-Index: AQHY+G+tN9TwuguMiEqy6kT+drR+La7F2JWA Date: Wed, 8 Feb 2023 17:45:29 +0000 Message-ID: References: <20221114212533.2871770-1-kamalakshitha.aligeri@arm.com> In-Reply-To: <20221114212533.2871770-1-kamalakshitha.aligeri@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: DFC15A7449E14D459443AA1ECA11959A.0 x-checkrecipientchecked: true Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-traffictypediagnostic: DB7PR08MB3865:EE_|PA4PR08MB7481:EE_|DBAEUR03FT041:EE_|AS2PR08MB9644:EE_ X-MS-Office365-Filtering-Correlation-Id: 7767ebec-3a8f-49c6-0ac1-08db09fc4cfd x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-checkrecipientrouted: true nodisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: yMowkXXrE4RrS+5pziBYredyL1Umu+5560syKszG8Wtzh+Z4xKVXTzJvLhlqFqWH8mUMVKu+KByx5YZSJ08Doo9kPcSUJwcjVWXv8DwB2gt6wK3Jjw6/9gnfkTtClAziTzBUibZL6fR06W5QSa4HUu0CZB6f2Gi9bRC7pFQ3mSPinpuZktIeei3GD/db/moN94Nols4p1H/XXsTtOjuU78T0ZNxXvIAn3QP/0fZ/DYhyRuZlbC9K1ohyKaDi7EHVKEVRrtZUyGO12Y1FK5K1feUwlfgQmeq2CKMpZ2KooYbx+VnT6PzLOrYEbC7ruJ55Oiqfh47dP8iTdW0mJbBJpl9Xw0lWlU92fgHhAYYT/9dEyXWHYFI7gaqAW8nOaNvw40TFocHAIBiUBfgrEKX9YfhFm99apqZLxj6xn8D1Y1aRnQP9f0d092woXf/Iitd/F7RXlc5lsvEHYKYqy5sB4K/nWZoHVn40VknGTZWrsR076jYFiM2T/rrITMTb5C+qxXnfmDiq3QV4BhNocGwQrdt1Qd9lnn4WLjNmw22zZWZyUjpl+T4BudO3wH038H+tu3kpkfWjTmRuH05evzXdFHJAlsRZI+zewAnzDq+oru8BDRj4cdm88rV5UaWafPt+GFz+L9EUAEiQAAGcb2XJzx8uQ2lGxXl2afHxayGvO0D55r8VjK/dQoTYFQZHJrKkehB7To14PIFUUN8H7H+K/g== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB7PR08MB3865.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(39860400002)(366004)(346002)(136003)(396003)(376002)(451199018)(2906002)(15650500001)(38070700005)(5660300002)(122000001)(38100700002)(478600001)(7696005)(6506007)(71200400001)(53546011)(33656002)(83380400001)(26005)(9686003)(86362001)(186003)(41300700001)(55016003)(66476007)(66556008)(64756008)(66446008)(8676002)(52536014)(4326008)(8936002)(316002)(66946007)(54906003)(110136005)(76116006); DIR:OUT; SFP:1101; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB7481 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT041.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 44befa39-724b-44a0-b628-08db09fc44e7 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: m+PQGTFD91VydIf5lzSxymnzjOOATLwEY5HE0PisJBYPlqh2sG6QAyIL0KgK+k+VUHOh3qS6FDgK14W53rkh25RLNG6zeuNcWvG8uyK3Q4BWBwUU0+Jx/lxXpsSFh4MnPZ/+7pvyxMS3dimMqsn/JFkAs/Rq1bGb2sYzjgrHxwWLl8RiEmTEmRqRZ+sKpQxq4J/Q7BdPIT6I+rU+Fo5qO7tPVGsm3E2+PZysCoAUFw4/pmA6rKTeaczAt19VvyekNxgno3xepmweBp/XSMqMrXXI340hrRjLeHhbk2FAlcvGlHZuV/yxFh42or69SqTcZN55P98pumLajJ4dWpnWczxhbs2nmO+hD2xhzCvx9mmG1a7Fz1W9rwPgluiQn8szJCzaNXbS3p0jL9Iiz1jtWZL2pOWTOJa2Xwnusu/5mcUpm9Bjw8jGNjodvszlJ4YmZdvJB0kfjw8jjyFzK6DrACr44u1nfHkL48G35G49vHkxQD1PtA1EKxaYPNRkRa/OnGAPSt/c4CUjZTXU3xz13duqvqePPU78oPEfaFLETjxkzxrgTtuTNi/B+GH9DZ9vTJ62sO1gga1Km7mVrZbqTMOXkuTv4NpZM9zTJGQc1rOlbyGwCdBhbNOe0SZ5s9AdnskpPS+hhn2/mLBKRlfWUIAMN8V4prbCgcbyiZ5zBdhqVZKT+qBOcQW5vAt5enEh1v5tmn6zriqwjxFtcblIjA== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230025)(4636009)(396003)(346002)(376002)(39860400002)(136003)(451199018)(46966006)(40470700004)(36840700001)(15650500001)(52536014)(8936002)(2906002)(41300700001)(70206006)(70586007)(8676002)(4326008)(86362001)(81166007)(9686003)(316002)(110136005)(54906003)(33656002)(356005)(7696005)(5660300002)(82740400003)(40460700003)(83380400001)(26005)(478600001)(53546011)(82310400005)(186003)(6506007)(40480700001)(36860700001)(336012)(55016003)(47076005); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2023 17:45:43.0961 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7767ebec-3a8f-49c6-0ac1-08db09fc4cfd X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT041.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9644 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 Hi all, Can you please check the patch and provide comments? Thanks, Kamalakshitha > -----Original Message----- > From: Kamalakshitha Aligeri > Sent: Monday, November 14, 2022 1:26 PM > To: jerinj@marvell.com; thomas@monjalon.net; > david.marchand@redhat.com > Cc: dev@dpdk.org; nd ; Kamalakshitha Aligeri > ; Nathan Brown > ; Ruifeng Wang ; > Feifei Wang > Subject: [PATCH 1/3] examples/l3fwd: validate ptype only for type of traf= fic > sent >=20 > The check_ptype function is not considering the ptype of the incoming > traffic. --parse-ptype flag must be provided only when the NIC does not > support parsing the ptype of the incoming traffic >=20 > Suggested-by: Nathan Brown > Signed-off-by: Kamalakshitha Aligeri > Reviewed-by: Ruifeng Wang > Reviewed-by: Nathan Brown > Reviewed-by: Feifei Wang > --- > examples/l3fwd/l3fwd_em.c | 8 +++++--- examples/l3fwd/l3fwd_lpm.c | > 13 +++++++------ > examples/l3fwd/main.c | 5 ++--- > 3 files changed, 14 insertions(+), 12 deletions(-) >=20 > diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c > index a203dc9e46..682ad343d7 100644 > --- a/examples/l3fwd/l3fwd_em.c > +++ b/examples/l3fwd/l3fwd_em.c > @@ -507,12 +507,14 @@ em_check_ptype(int portid) > } > } >=20 > - if (ptype_l3_ipv4_ext =3D=3D 0) > + if (!ipv6 && !ptype_l3_ipv4_ext) { > printf("port %d cannot parse RTE_PTYPE_L3_IPV4_EXT\n", > portid); > - if (ptype_l3_ipv6_ext =3D=3D 0) > + return 0; > + } > + if (ipv6 && !ptype_l3_ipv6_ext) { > printf("port %d cannot parse RTE_PTYPE_L3_IPV6_EXT\n", > portid); > - if (!ptype_l3_ipv4_ext || !ptype_l3_ipv6_ext) > return 0; > + } >=20 > if (ptype_l4_tcp =3D=3D 0) > printf("port %d cannot parse RTE_PTYPE_L4_TCP\n", portid); > diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c > index 22d7f61a42..1ac78281f9 100644 > --- a/examples/l3fwd/l3fwd_lpm.c > +++ b/examples/l3fwd/l3fwd_lpm.c > @@ -667,16 +667,17 @@ lpm_check_ptype(int portid) > ptype_l3_ipv6 =3D 1; > } >=20 > - if (ptype_l3_ipv4 =3D=3D 0) > + if (!ipv6 && !ptype_l3_ipv4) { > printf("port %d cannot parse RTE_PTYPE_L3_IPV4\n", > portid); > + return 0; > + } >=20 > - if (ptype_l3_ipv6 =3D=3D 0) > + if (ipv6 && !ptype_l3_ipv6) { > printf("port %d cannot parse RTE_PTYPE_L3_IPV6\n", > portid); > + return 0; > + } >=20 > - if (ptype_l3_ipv4 && ptype_l3_ipv6) > - return 1; > - > - return 0; > + return 1; >=20 > } >=20 > diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index > 5198ff30dd..71a3018036 100644 > --- a/examples/l3fwd/main.c > +++ b/examples/l3fwd/main.c > @@ -964,12 +964,11 @@ parse_args(int argc, char **argv) > } >=20 > /* > - * ipv6 and hash flags are valid only for > - * exact match, reset them to default for > + * hash flag is valid only for > + * exact match, reset it to default for > * longest-prefix match. > */ > if (lookup_mode =3D=3D L3FWD_LOOKUP_LPM) { > - ipv6 =3D 0; > hash_entry_number =3D HASH_ENTRY_NUMBER_DEFAULT; > } >=20 > -- > 2.17.1