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 125FD43BE4; Fri, 1 Mar 2024 19:54:14 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9116F42D68; Fri, 1 Mar 2024 19:54:13 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2080.outbound.protection.outlook.com [40.107.244.80]) by mails.dpdk.org (Postfix) with ESMTP id CAC5C402B8 for ; Fri, 1 Mar 2024 19:54:12 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RilsagxiSqCAi5wcmX6knJ+1KeI+P5QxLlNoSKNyuuyFagiFQwFjelJZs0y+fJSDNcaFGYoGy95X1DQst4pROEDiqyGH0KC/svVgshFPcpKwUlCm5Qb2tlAkWc1+lFpt5aYERaoWTDIubuGcou/M9GTHX2I2zklaLbAg+pyMxuY0rfIEyGOjCAow43qDiKfWQew98OqT6YFomMZxfnrg37c+i9GvY7AnBCv9ujphm0d6Z+61OWAHjfo5LIhPeEcSlOlPuMW1ikT5LBzZGX1rd77bBzsU0Qdb35/VOaVIuqqRPDLAyW3E+euCuXKVFfvv5AbeA5LJVbKHGICnz+K+9w== 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=Yect1A0hQywtNFzT8fBKeUYUwa/ffbKYFiuueSMph5w=; b=jWypI9eOPsJ1V3oPc4ajXUN2mEs6VzeHlHGomm2g4NdRhFqXWWMAjcB+sb6JacaG4yNb7w/RXWOavoQyyBvibimCZQxe+VWfRoUFMm5tYmm4SINo57hzBI9rP2eDLBUblGC2jXbMky3a7r15N3oGRC1pxoWq3BID0KSoZeCbqfWn6VFirswLYllQzs+rYR0J/+UckcWTX8FbtIaxGEg1ShmwVSYSDSeH2RE19v0jD1CxqQYv3sI205KxERCwv3C8yfgVUOdviH37Fod/FVydALtWoHzZ4mrECuB4jN4ZnPb5Ced67jBBAkF7j5XDXCNIxuP5tg2BKub39x4yRZEruQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Yect1A0hQywtNFzT8fBKeUYUwa/ffbKYFiuueSMph5w=; b=yM0/B5YiJHwRaFjeJ0Gn3Jp+nbyH//FGMB4emKQQobEt4kBB37fg57tzhQd+YpccQ9WrDzJe3tU1pl8GTxnY5hAusNhNB3NkO7VtjxoawaKjqq22JwDQjli3p+PUT0qYgVu6KJ8Z/2bd2gfgv3qFENyfhcnvEHNdLhlWtMPNKps= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by MW6PR12MB7086.namprd12.prod.outlook.com (2603:10b6:303:238::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.32; Fri, 1 Mar 2024 18:54:08 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3ec7:6339:1c14:c529]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3ec7:6339:1c14:c529%5]) with mapi id 15.20.7316.039; Fri, 1 Mar 2024 18:54:08 +0000 Message-ID: Date: Fri, 1 Mar 2024 18:54:04 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] testpmd: add hairpin-map parameter Content-Language: en-US To: Gregory Etelson , dev@dpdk.org Cc: mkashani@nvidia.com, thomas@monjalon.net, Aman Singh , Yuying Zhang , David Marchand References: <20230919101006.19936-1-getelson@nvidia.com> <20230928153605.759397-1-getelson@nvidia.com> From: Ferruh Yigit Autocrypt: addr=ferruh.yigit@amd.com; keydata= xsFNBGJDD3EBEAC/M7Tk/DfQSmP1K96vyzdhfSBzlCaGtcxNXorq4fALruqVsD3oi0yfyEz9 4YN8x7py0o9EL8ZdpOX0skc0AMCDAaw033uWhCn0GLMeGRKUbfOAPvL6ecSDvGD7CJIO9j0J eZUvasBgPdM/435PEr9DmC6Ggzdzt8IuG4PoLi5jpFSfcqxZFCCxLUDEo/w0nuguk2FTuYJg B2zEZ4JTBZrw7hIHiFh8D8hr6YA6a5uTofq1tr+l048lbtdFUl8TR0aIExVzE4Z8qKZlcE+9 RQaewjK5Al1jLE4sHdmd3GN+IvgDF3D/fLsi25SKJDeGSdeHkOmaX0qGeM4WKIfU6iARRCiQ N3AmBIxZ/A7UXBKLaOyZ+/i3sE6Wb53nrO4i8+0K2Qwyh6LjTeiJAIjYKN43ppxz3DaI+QwQ vI+uyHr4Gg0Da9EPPz/YyKauSeOZCfCB5gIfICO0j6x0SCl8uQ2nLpjxcZkf0gjcwUzP3h+S 3x6NfDji9YEij0zczW/dcSpGgZ6vsFpPrtnP9ZXy6J53yp0kJtOJoOlkEFFdU2yCZnCDseum CoudmGLZVvS0/DzHDJejq+3kK3FDGktZBOxZIIpal+nFqS7lVgOZc4+huVv3jyhzoAUOEyXA XK5j6o7g8STUY+z33QNnHpdLvecMwuzmvqy0jR54yAbZ64mB9QARAQABzSNGZXJydWggWWln aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLBlwQTAQgAQQIbAwULCQgHAgYVCgkICwIEFgID AQIeAQIXgAIZARYhBEm7aYjps5XGsPHCElRTPtCKKm/6BQJkdyEEBQkE3meNAAoJEFRTPtCK Km/6UdcP/0/kEp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O 8Zk= In-Reply-To: <20230928153605.759397-1-getelson@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0676.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:351::14) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|MW6PR12MB7086:EE_ X-MS-Office365-Filtering-Correlation-Id: 69d0ba9e-97c2-43f8-76da-08dc3a20f9c9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TMLMI2vMit0w4fEQrBRLzPH2KtiHBOlCCrlrA7Pyh9ipSbqwdtHjuKD51E3olOOmtMoyO6Gks1xG10oyrmO1K41CVW8ewHt2CpDSRx7H2DvtCaoZ7LxUYPmam2vinifRBtxoS9ciqffw8P75KPLVtaDGAPvShxW8DIRIWgp5FJ0XToFX64TtgVnXa4poFufQp9CCzxfxveue3kkK10/QdEahIsiUwTW1oYjlDJGA7SStm/X29ISvQXjtqpcDLcT8SIPH4oVbcRu4M2hgrAplV8e9WOfE/cNFIlfXdFGc5PmwfNMAgpOMu862s3Tt/s2gS6nAR5tDAD5pft3SdIWr2H/8t2LmFwN3SC/n64Cxw6T3WnV67ZoueqHD3Zp3aW4yPgOcxYoxhLO8EwjlU9+14q0BP85lYl+T+MiYqm/JYwTyX62fU/dqRxO8y963S5InpzYHVn+2MW6zUkzqtqBMs4WVsHs6JjaWlP4dyorgVNySx2MLzbuCkSLqFTkOClCJ5yZy0l3pJHE0zgplzyYGDMD9ZmxHFq9KSzRK5iTF0wC8SkmgYVZl9bpo3ZzdfC8T7qfeZCywS5meqcM0uQrfwWKRRwaBNfIpNRqPdpBMkj0R/tdH9KQxhpQio4e0utooZTWFieMMtSpK8PybzXObdA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WWk1ckpTa2Zid1ZUV3NnbVVPNkZra0YyZEJqallRRnpYWnFFcFFnTEJxVmty?= =?utf-8?B?MEFXWUxlMTJJdU93SFpNNlJZcE9NZDZMNEdZZEN2NGNieDBFWEF3K3VCTkc2?= =?utf-8?B?OUV3S3FDSExDckZXMDMxUURFeEplNXlPSWlEYTRrT0RnZlk5R2Ztc0JlZkVy?= =?utf-8?B?d0NVWjc3UGtRTXhtQ2F6cEpHS0owQldEKzV5Zi94a2FQWTBka3dRRmw4amx5?= =?utf-8?B?ak1JeEJRTEYwbWlKZFdjOGRDYmg0N0wzOWh0ZWZRcHRUbVcxTHhSTDI4UDQ3?= =?utf-8?B?YmlFL0hqWUZtVU05TzRkeVc2RGhDSkFadWxCMmRBNm9QWEtBVjA3TnJiQVIz?= =?utf-8?B?Uk9yRWt5Um1scG5iL0dEZHJXNGw0QVpnVFkxcFp3T0hVNHFhOVc5UFNGMktl?= =?utf-8?B?cDBHVTBUcURHZkJZcXhvZDJ4ZTRCTytGSFJLNyszb2Jxa2tMdzAraGNwRGhW?= =?utf-8?B?Y04xOUhEeVQzMk1VZHgrb2tKQy9DcStKVkpYTXVzSmN1enNobzd5d2g5T0o4?= =?utf-8?B?NFhxY1BYSmk0N2VOT1lNQldQbHJnMkNXN3lzZlQrWThFbldoeGdkcG5wSFIr?= =?utf-8?B?cThqY1Z4MmpXL0NuUjhNUWU3V245c1VacGZoNEMvNkUzYSswUGt3YzB3aTBK?= =?utf-8?B?UnBIY0xBNDhVTVl2VDlrQURjbmc3bFp3ZjNEVXBwL1RjNkN2eFowbVV6TklR?= =?utf-8?B?TWc0bHdJbU5QNl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B?ODBDWHZHMnpGSWE2UzRtQmhoSmZNN3dRKy9xbThlOWY3S0xuamR2RGFmOFRm?= =?utf-8?B?NExVY2tJdWNTM3pBRkZ2ckExb0M1M2hwTDM4ZUFlUGpteE1FMnlvVWNaMW8x?= =?utf-8?B?dDZ3d0tBWUVsU3A5TERpZzgyQlhoZ3R5R1VTNkpUZkh0OUNha1RyRkxCR0hX?= =?utf-8?B?V0YrY3dkdFo2RjZJdjVPWnV6anJqVUtMb3pFVHdSRkw1YXZqOGNrVFpxZ2ZX?= =?utf-8?B?K3lDbUFBcCtyMy9UNGc0Y0wzYkx5VzIyS29PTjBOT3hKMHltRktZMi9INzd2?= =?utf-8?B?aExpZTl5ZzBTdDBiVUYvVi8zeTdacU9qY2ttbWxOWXJhUzQrdlR1U2xnQ3Zu?= =?utf-8?B?WFo1U3MzYmZLcTZhVVpOaW5PcmV3dExaMGpSZys2WTBQOG1uSXJVSWswcUE2?= =?utf-8?B?T01LNSs3dHFSRm5Ja1J2S2FjZXdPbURTK1RxNUFUdkNRVGp1dUVhVVBPeVc2?= =?utf-8?Q?kcU+GwRf6ZGQjkJ9pl8H95VVe?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 69d0ba9e-97c2-43f8-76da-08dc3a20f9c9 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Mar 2024 18:54:08.6044 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: bVuEqUvi1qI+RKsNlT2vWUb2veMDg4FDK1ro1qWXy6479QvvSO+Aj9pZ1iBDBKVj X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB7086 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 On 9/28/2023 4:36 PM, Gregory Etelson wrote: > Hairpin offloads packet forwarding between ports. > Packet is expected on Rx port , Rx queue and is delivered > to Tx port Tx queue . > > Testpmd implements a static hairpin configuration scheme. > The scheme implicitly matches next valid port for given or . > That approach can be used in a single or double port setups only. > > The new parameter allows explicit selection of Rx and Tx ports and > queues in hairpin configuration. > The new `hairpin-map` parameter is provided with 5 parameters, > separated by `:` > > `--hairpin-map=Rx port id:Rx queue:Tx port id:Tx queue:queues number` > > Testpmd operator can provide several `hairpin-map` parameters for > different hairpin maps. > Example: > > dpdk-testpmd -- \ > \ > --rxq=2 --txq=2 --hairpinq=2 --hairpin-mode=0x12 \ > --hairpin-map=0:2:1:2:1 \ # [1] > --hairpin-map=0:3:2:2:3 # [2] > > Hairpin map [1] binds Rx port 0, queue 2 with Tx port 1, queue 2. > Hairpin map [2] binds > Rx port 0, queue 3 with Tx port 2, queue 2, > Rx port 0, queue 4 with Tx port 2, queue 3, > Rx port 0, queue 5 with Tx port 2, queue 4. > > The new `hairpin-map` parameter is optional. > If omitted, testpmd will create "default" hairpin maps. > Hi Gregory, This patch is waiting for a while in the patchwork, not because there is a problem with the implementation, but I have a feeling that it is bloating the testpmd code with the hairpin feature which is not commonly supported, and I don't know what to do. Also there was no review on the code ... As a brainstorm, what do you think move hairpin related code to its own file, and have a kind of register logic to the commands, argument parsing and usage() functions etc. @David did something similar to move PMD specific testpmd code to the drivers [1]. This can be initial steps for the more modular testpmd design and we can introduce more features with this approach in the future, I think hairpin support is a good instance to start this work, because of its limited impact to users. [1] Commit 592ab76f9f0f ("app/testpmd: register driver specific commands") Commit 94b3c1a72507 ("net/i40e: move testpmd commands") > Signed-off-by: Gregory Etelson > --- > v2: Fix Windows Server 2019 compilation failure. > v3: Update the patch comment. > Fix typo. > --- > app/test-pmd/parameters.c | 63 ++++++++ > app/test-pmd/testpmd.c | 212 ++++++++++++++++++-------- > app/test-pmd/testpmd.h | 18 +++ > doc/guides/testpmd_app_ug/run_app.rst | 3 + > 4 files changed, 230 insertions(+), 66 deletions(-) > > diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c > index a9ca58339d..c6bdfdf06f 100644 > --- a/app/test-pmd/parameters.c > +++ b/app/test-pmd/parameters.c > @@ -206,6 +206,12 @@ usage(char* progname) > printf(" --hairpin-mode=0xXX: bitmask set the hairpin port mode.\n" > " 0x10 - explicit Tx rule, 0x02 - hairpin ports paired\n" > " 0x01 - hairpin ports loop, 0x00 - hairpin port self\n"); > + printf(" --hairpin-map=rxpi:rxq:txpi:txq:n: hairpin map.\n" > + " rxpi - Rx port index.\n" > + " rxq - Rx queue.\n" > + " txpi - Tx port index.\n" > + " txq - Tx queue.\n" > + " n - hairpin queues number.\n"); > 'rxpi' or 'port index' are not common usage in DPDK, what about 'rx_port' & 'Rx port id' or similar? > } > > #ifdef RTE_LIB_CMDLINE > @@ -588,6 +594,55 @@ parse_link_speed(int n) > return speed; > } > > +static __rte_always_inline > +char *parse_hairpin_map_entry(char *input, char **next) > +{ > Why forcing this function to be inline, can make it static and left decision to compiler. <...> > diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst > index 6e9c552e76..a202c98b4c 100644 > --- a/doc/guides/testpmd_app_ug/run_app.rst > +++ b/doc/guides/testpmd_app_ug/run_app.rst > @@ -566,6 +566,9 @@ The command line options are: > > The default value is 0. Hairpin will use single port mode and implicit Tx flow mode. > > +* ``--hairpin-map=Rx port id:Rx queue:Tx port id:Tx queue:queues number`` > + > + Set explicit hairpin configuration. > What 'queues number' does is not intuitive, sample in the commit log makes it easier to understand. Can you please either explain or provide sample to clarify what "queues number" is for?