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 0ED97426BB; Thu, 5 Oct 2023 04:41:12 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5EACD406B7; Thu, 5 Oct 2023 04:40:49 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2127.outbound.protection.outlook.com [40.107.220.127]) by mails.dpdk.org (Postfix) with ESMTP id 3AE22402D8 for ; Thu, 5 Oct 2023 04:40:46 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oZr2pfe3BY1ybvtQAkFLaf8ht5l6ot2jeVp2GscLVhqzsNI07dt25M1NiEU6ZRQfeHfQ+k9S7+TpUjdb+j39sO/7yRN0nOT5A+fxBqcqUvBE2xaiHUI+GUhHpNXUAoWCR+Bmo6M/l3HpIt7LIwXq+y4PeAYZUrRqgwo7H3hxP2y0ZcFV+je6i4YKz42ZexkLUFvrMh+4sDEB0jpTpGv01wE+zQmdFOmjeEoEXSpRAFSBDL9HbfIWX6mK+zp56FNepKK3d2UVwXoiAzdqs9k1IMfkcY0/xeVgeT30Im6lIF8QkH9h8xNuL2+XZ4mOhu20TNlHVnpCvoGYY7Qjb1fFmQ== 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=hl1SKumr1OOZk4L8LdQN1aMK7JBu1nskMfmPPhr9NpU=; b=d/4qYMchEbfeeVZcqkz350Y7CksInBwCNezHfdrcVctOhT80lcSIHXPc7Fkk2aedqUT1gfig1l9WJGieyDFmSUC2cN2VFr4BFw44kTZFreEzFam6FjGtTdd4AwCb1+j0K+/mhCHJ3PqbChdQlMe//YR/1yVKmxsNpCOg94B96qeF+Sr6bmfJatLbteiXLdvTTGEG942gJPbFvjmGCLJGOBGaC81J7cy0OHWNXfgS/TdmqggQxPZYOu45tH5XNAl3PoyFT279yKlTG0T2gQDJXpuwh+Jdo5Jk6iGYY4kRZNSqjBmzHuE9a0HTwUBncD6WNDySSJyzZLbIt8a+g3J5fw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hl1SKumr1OOZk4L8LdQN1aMK7JBu1nskMfmPPhr9NpU=; b=nH1nEIjCxp9dLd4edWjnmRtkCSMPZwxP4/gncyv1CrSvWv8WAMHN84KIIkPRn4BGlj2JQsAIBFTJ/jDMw7aibg9A/1tQyhm0feLeTHiUrUfnzVPZNFNOiRm5D1xJFCQU8aU3rlm8+Aj2CNnK5aXkQtQnMg+gfJdyUT36zww3mDs= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by PH0PR13MB4780.namprd13.prod.outlook.com (2603:10b6:510:79::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.28; Thu, 5 Oct 2023 02:40:44 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::28c0:63e2:ecd1:9314]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::28c0:63e2:ecd1:9314%4]) with mapi id 15.20.6813.027; Thu, 5 Oct 2023 02:40:44 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , James Hershaw , Chaoyong He Subject: [PATCH 5/8] net/bonding: support add port by data name Date: Thu, 5 Oct 2023 10:40:09 +0800 Message-Id: <20231005024012.1279810-6-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20231005024012.1279810-1-chaoyong.he@corigine.com> References: <20231005024012.1279810-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: PH0PR07CA0064.namprd07.prod.outlook.com (2603:10b6:510:f::9) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|PH0PR13MB4780:EE_ X-MS-Office365-Filtering-Correlation-Id: 32f322b2-35d6-4fea-7ea2-08dbc54c7926 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: POMGKvgrPKKYp6rVHy9o+k5i20ZXFNQHG+S/AgAXbl0vM9BiqEgFqoLDjZyLCYW+hkxyeOLu7Q7dJyIaJHaYXYzLCT7RhhQpxdUEHpA8WR4Cm/Y1LDsk8OCjYfrdxF4D70cH99hs2Bx4WzOoWMY6/HH4x3DAEfGepSAtCP5eObp7B6C5VHEXSwaEsJK21agHori9GpVrsUU0JDkaCR8Mv+EvLU/UWUJm8k4O/F7mzTxsz150z3v8vUYd32U7WY6MDfMy5v3jde5Qa1VeLMS7DYsemvfZ3n4wLDAXXUo9Wvlt04tWRQSf9nuyl0LDDW9y3zhy/yUB8Xit9IbK5xIVi+ull4mamoqRvk7XDQxgtSAdXe4Jnn91mWnTJUjjwySItfKFMVEVAMjEI+rxOSqHimsH4JKY7nyli7OxePUJZurdm1o4cp9dB44TWKXUpi6uiCdO2imexlEMjni0mffBRYmaHo8i3eFbQg90oC0urbK82mStY+SR3hDDM4vF1Gxjc66OKoWyoJ5VGnMK8m60KCT0au48wBg4gJXRC4AMtIqSmcCto2XbbcHOX/JJ9CNhl5slspGFf8U/oVnaQidPmrfBHP2+U2uZHznvjv8hLLwHMFGs2R9ygT0dDm0h1StAe1PYBCwL6aPH92WRvFWWKVp4J+7senKm4WW4FGnhucE= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(376002)(346002)(136003)(39830400003)(396003)(230922051799003)(451199024)(186009)(1800799009)(64100799003)(8676002)(107886003)(2616005)(66476007)(4326008)(38100700002)(54906003)(316002)(478600001)(8936002)(66556008)(66946007)(38350700002)(2906002)(6916009)(86362001)(41300700001)(6486002)(6506007)(5660300002)(52116002)(6512007)(1076003)(6666004)(26005)(44832011)(36756003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?AxFm9MH3IlGdXXssVSUahCFcci1L9LUccY4RIhY/3Fj11Xi+uFaYsv4q7goX?= =?us-ascii?Q?K8Sbs15SO51P97wW0wzg/+N54K6XssIw1ow7GPo8U+IEWqQbIc+QIzFf5T2B?= =?us-ascii?Q?4XUhYRl0cIgwFZqbv3lKM7gJUVBgkKDjEJFpIutYiwF1wDNPeQ6+deHRQJom?= =?us-ascii?Q?w1glbksErVYAksC9H42kL4aGb/ozS+PRt0UhUcAASN/0dRoqueAAQpbt7HU2?= =?us-ascii?Q?Pv4jefQLOKG/6rX2X9VZLuuI1mysXg38bixS8rew48tQDRlpFkmo0sZzQQ6F?= =?us-ascii?Q?CXsgSmJ2L8BgOTCg9NaxCULrrQfnVsWW4NhfCZYp7rvz6Tt40jEM9jrUJRGt?= =?us-ascii?Q?N82nWYfI3iZRZxFAcAfl2UdQ7/m4m9vXCH+VmPGunu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++2PNgXkqOfpJmIjFN/idQ85Qcdlir0pYrhghBu+E0D697AoAq340?= =?us-ascii?Q?6kciG0wtV9rU9uqXoq68cOVpb+NhwMW+CLKaRDd3Ayi8USvzzGLIRIbgg9e4?= =?us-ascii?Q?qOXaopou2MQGBPAv4ztUToH332hAN1L3UrTbUUknNYvrz3qEfUhh2rB1PDUK?= =?us-ascii?Q?+oapOmyuJuISRDgTeOYOcpT0/hWnc+2CKRKfAeMk0AMk07ScTRAkyfnhn+Ob?= =?us-ascii?Q?ubq44naM/EtB5R114heD3T3653+rd9DSjRMZlyxOhACF3T5tYD5PddafbwHE?= =?us-ascii?Q?tTlIiYw9npyghkd1edMGzv/vKJAWReQl5RWFdHB7YZzle5z72Nn1khWUucxD?= =?us-ascii?Q?hg=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 32f322b2-35d6-4fea-7ea2-08dbc54c7926 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2023 02:40:44.6804 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: MBT49aLihsXuo7qEa6ciVa81xpuz7g4uGoAA5eVxjHffNvrbpSh20wQeqI7jZcbLprQDJe1cCYcEuFCugBGK23wOEkM7gSaPycmqsQDza8g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR13MB4780 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 From: Long Wu Several ports may share the same PCI address, like nfp representor. So we cannot add this type of ports to bonding port by "--vdev" argument in dpdk-testpmd. But the port's data name is unique between them, we include an option to add such ports to the bonding port. After adding this feature, we can create a bonding port that member port is this type of port by "--vdev" in dpdk-testpmd start command. For example: dpdk-testpmd -l 2-10 -s 0x8 -a ca:00.0,representor=[0-2] --vdev 'net_bonding0,member=flower_repr_p0,member=flower_repr_p1, mode=4,socket_id=1,xmit_policy=l34' -- -i Note: 1. "ca:00.0" is nfp 4000 card. 2. "flower_repr_p0" and "flower_repr_p1" are nfp phy representor's data name. Signed-off-by: Long Wu Reviewed-by: James Hershaw Reviewed-by: Chaoyong He --- drivers/net/bonding/rte_eth_bond_args.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/bonding/rte_eth_bond_args.c b/drivers/net/bonding/rte_eth_bond_args.c index 8a3e4656ef..b320eb3038 100644 --- a/drivers/net/bonding/rte_eth_bond_args.c +++ b/drivers/net/bonding/rte_eth_bond_args.c @@ -70,6 +70,9 @@ find_port_id_by_dev_name(const char *name) if (strcmp(rte_eth_devices[i].device->name, name) == 0) return i; + + if (strcmp(rte_eth_devices[i].data->name, name) == 0) + return i; } return -1; } -- 2.39.1