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 CF8804378F; Tue, 26 Dec 2023 03:38:44 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 92C07402F2; Tue, 26 Dec 2023 03:38:18 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2100.outbound.protection.outlook.com [40.107.236.100]) by mails.dpdk.org (Postfix) with ESMTP id D715B402E1 for ; Tue, 26 Dec 2023 03:38:16 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z6sKNEz+uxyB595RkN1v1Km2tChu5jRwdGck+yg9lwABRkrnOr64EXk/x2weZQVpfPfvKnADf4CDZgVivm/9rtf7KY8KJd+iz+QBGyjlOzz9BzIanTXEYw7iJv+pkeT7L8sjeZwfckliU9CDCu/RX4mJ0U0s8e+qNUZVOoXKYlc+TQtlS5QkN57UBMrCakgDOGvrNFoTTOJ+UCLX4paInKOoukz1tMPnNsFoz+y2UsMavqNUBr8Y+Mfxd+CpxQu0eK8GkpLVX+QmfzqaNeVpXhuJ+4VdO/rua0viqh8Ngkxlc6rAj4iOmtG4AaoZXI6JC0mSRXgtmilXy5PVZlhFoA== 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=UvhjJGhyC0UM6fXZg/Q/G0VntG1y7xTC3QWy8sigACU=; b=Y8BnDQIHtLQDQeMQaBUXrI6Eq4HxdCjczWAahs4xEKUqNQBVdgJ2icVqskMdXK6vbIsClG76hWgMdMKQ1z1v+13g3Uc0Fjb1fQ7rEvzMEHGol3ya2EXtP8ZY3gIpCp1Est6vpXMVTPHi8kEVyy9GX/7uo9OjWQ5k/LQba0T1f9AXLwaVPyYFxPD08QxCNC9YxzNiaW88axF3IflgVTJABi6T9Bk8uKijp+UBNpRbXzdf7cxLDX55O5PYr/uoJsOI131RKV/Onb9XN13wdtFd5QAi3J7dR/HnWo/qiowKypE7IfY/hZPLldYuQ2IUO/MGjICurqFrXOydML1BVkdLDg== 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=UvhjJGhyC0UM6fXZg/Q/G0VntG1y7xTC3QWy8sigACU=; b=syQuV9zKRYWscQAzZsqF5wHiHrI6IdRDkEY2lxRg0LKm38/CHGeb6jZyeAhygtKgszZyS3J1t/JqnqCOpt50m2oOhWGBDrIzt5Otqs+C/0vRyf47OqQANd1O8Mi8adjym55OWz6Azp+MybLaS5y6rL0/cxP2UDqJ2OAaspI7sB4= 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 MW4PR13MB5864.namprd13.prod.outlook.com (2603:10b6:303:1b7::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.26; Tue, 26 Dec 2023 02:38:15 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::45b3:d83c:cff2:4a1b]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::45b3:d83c:cff2:4a1b%6]) with mapi id 15.20.7113.026; Tue, 26 Dec 2023 02:38:15 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , Chaoyong He , James Hershaw , Peng Zhang Subject: [PATCH v5 04/14] net/bonding: support add port by data name Date: Tue, 26 Dec 2023 10:37:35 +0800 Message-Id: <20231226023745.3144143-5-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20231226023745.3144143-1-chaoyong.he@corigine.com> References: <20231018074821.1908906-1-chaoyong.he@corigine.com> <20231226023745.3144143-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR01CA0156.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::36) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|MW4PR13MB5864:EE_ X-MS-Office365-Filtering-Correlation-Id: bfe81490-46ea-4b1c-2868-08dc05bbb62c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Y3gNAn2K4jZDwd9S7nu3VfQE4fXrp39Qzznuojd3DByGObI4o4xp+W8NbvYCQ9AfTTvghz19fQJ43f4A3Xv3S+kfiXxXLs35glroODu34B7ADYXFDthz5q8Xlsfc+auPzuAXXbA3SrX/nENDixMNxJUUdKrzAc9avM2sEXf7wEbkD6p69+8+YVSSnDCJ7R6ekewe9iPirDEb7aFfwGHcwPa+4NBbMtUPMh4YaSLJvxVMZpVd/ifwvwa0qu1qSsv5hcdjN8P3cT2NkZWqLJ3gAdYhaXIY8DGk7cGjUyAb+k+xVDssVHM56PlxfOgAqMbSFl080AMfE19oP+oAl5bF9q1BQUWX918MMqKLp7Uwb8DhOUihCf3x42H/v8aqzCOq/XpChUaGSbx9yJ8Qw5dElsC7dERDzHBPkCeVwaw7eECwTzBaRwtrRtbD1cKlzYDzo68ijZ6eX6TasOIAMokMW8lxO4W0/uatPoGWWr3WwMqt0M1CBtMn/Hl7yAAFVSWdXuiafowCFabnBTgjCQtKJIvrxfCKet3NXxKQ8MMvIWw70AFf34OiIVx7LXFfje5VGsNu7lCOWTws8d3a84mPLW5bu9MVX99r3ZYWMJ/z4YY4nSVwNyARnD17tr4RMcjK6ZC1ZzEAhJyS/yeQNDuujK7zAAB00ELK9+6S80/RSog= 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)(39840400004)(376002)(396003)(366004)(136003)(346002)(230922051799003)(451199024)(1800799012)(64100799003)(186009)(41300700001)(2616005)(38100700002)(26005)(107886003)(1076003)(316002)(4326008)(54906003)(8676002)(2906002)(5660300002)(44832011)(8936002)(478600001)(6512007)(6666004)(6506007)(52116002)(66476007)(66556008)(66946007)(6486002)(6916009)(38350700005)(86362001)(36756003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?mAaTFzyx3cArrYMnsOtss9P/75P++udLfIp6RO80+Yv5x04fB75/8jMJg/+s?= =?us-ascii?Q?f21pIVKLHOedvXHvrcroDStaf94NI7Qu/keLe5xTwkK/+I6xb/WRucQkxTDf?= =?us-ascii?Q?dwLcqzNpUDtKAT76NAfsOi/y7Fcw1GWApWCz+HUigLbJOPDUWfHoCAorOUVh?= =?us-ascii?Q?5hb5+MA3ckL2+UqbKc8mCs1sSeqdAYeEicjMsClukhDR60mK9oJ0Pe5hu22x?= =?us-ascii?Q?teOEB7abu/9GSztUzkKp4R8EfNJhKJzsyH6jS4OfhfhLj+g8b+30heHEq7Qa?= =?us-ascii?Q?cbQUp06eiIcG/hRupaFx0aPeGUf8PMU9lCwXHanL0YtPcm6FNPg11zcNClXs?= =?us-ascii?Q?D7ZJpGykfDwr7/apeGn+wlL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/5h?= =?us-ascii?Q?DgOjc2SfXlH2ZWthDsYqNV+SGJ7e/ZnpW3dXOOGrHXybH9isnDD14TPTnKBd?= =?us-ascii?Q?FeEroK3+VmJ3cycGDhijzjzh9G/QFWig6s0APSzCWF2iwetXMU40bHrJFoaX?= =?us-ascii?Q?8tl+0xY18eIiBEITfY4QeWF2TqczouE2Zo8oX2piRuTzoW2A8AhSva7lWUnY?= =?us-ascii?Q?RbL6iEHI2oov9nx1szTZaCmt6cqkGtIH7Y5KdlmqMMMymNMqJhJ3BkbVUw3M?= =?us-ascii?Q?AtKrPiAufvScjQrbED1kvMWDLJL2VD/orL8ZAwMXJigq5u8RkpF21Xrq7rrn?= =?us-ascii?Q?50dtbfpPWmuyWSCNAHLWvqUIcaFuSpaEkjgmD0i90CdY0cwLPSGIzfx+zosI?= =?us-ascii?Q?fQ=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: bfe81490-46ea-4b1c-2868-08dc05bbb62c X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2023 02:38:15.4619 (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: FkWhhBLvMPmPj1O9pdBw0e/3G2oS4JIAtK3BKji40SrYbO62/aOlw7Bn+zs79oIzXEsc10ra6CTp3nyEP3u5ikRn8VBORnewB7WkDzmHXRA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR13MB5864 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 port. So users 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, include an option to add such ports to the bonding port. After adding this feature, users 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 port's data name. Signed-off-by: Long Wu Reviewed-by: Chaoyong He Reviewed-by: James Hershaw Reviewed-by: Peng Zhang --- 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