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 6171C43196; Wed, 18 Oct 2023 09:49:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 83DE142DF4; Wed, 18 Oct 2023 09:48:55 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2115.outbound.protection.outlook.com [40.107.223.115]) by mails.dpdk.org (Postfix) with ESMTP id 8BA2742D78 for ; Wed, 18 Oct 2023 09:48:52 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iCyCLzYIstD/vJ8ocfIwoG/w3kb0+B4jI/6TDmCBlh4KxIalHQCIz8z0HMp17DgFHvMvdXgyRRcfa3nezl0aPzUH9En/teiC3WSeVQvPXWBUp8Awm1OIG7uUnSUqVuadPVOML3ScEWWbDwyXgQQRXiXqSafnbcDe41SkSOQ1/F/ABtw+7pYLPF1sThU+G3DjCWEiLAAQTO/Jbd+L61fu35EaO2a/dl1f3JAgPx0e3VCXbbinC07LD+H/9h+9SqgI9zFuFLQoIVQIYTzRlycrcn6EP8e9nlXHM5VmkHiVx3ES+Y5tvrgAdqvwSM2W0j/aDOO6VxpgZTGS4zBPYTQhkA== 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=JoIqdu6MeTIlc0TQpferMo1wepHdiAGLeysgfZdi50qi47gmpBVnnsitEMtRBmEsqOA7tRY7fC3604tJVbA6dklKIScfRdYFwyvhdpaTQzBuMdw+rPHTNoboQV2ospNVrApoz6KwQRdEQ7hL4XbZKZMNz8wDf632KPEKE/cup5WVGvq+rA/OyFo85gyu+lBqLPt5a1kU1SACyK0E68AoZfCzzeb/pHjjDolHAPq7O9hykUQJjXtktzK3d5xgaY0I0rC4Se9sdxs3yBcnBJcMkZY4ZHf2Tg1pGKdotcGjwzQMro5oCBmS7SmCUg2c64MZxx5cCyMIBMkPY1UOP/A64w== 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=LYb/J1dYF3b6MDaa4twuSdGWEnQ7B3/BTjjYQiQhO5BOUF8w2B88eCsyVrd3+mE/rFx1OEqLjr72MhVtzkx7JunOIydByRlduRbCzCbsMl/JM+j2aNJh+7RG/LQavIxkZMzL5rwYpxDnRKat4yXdymdk8/n0VsO3IGHpp1TAMxc= 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 CH0PR13MB5188.namprd13.prod.outlook.com (2603:10b6:610:fd::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.23; Wed, 18 Oct 2023 07:48:51 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::142e:d47c:7320:8a9d]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::142e:d47c:7320:8a9d%4]) with mapi id 15.20.6907.021; Wed, 18 Oct 2023 07:48:51 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , James Hershaw , Chaoyong He Subject: [PATCH v4 4/6] net/bonding: support add port by data name Date: Wed, 18 Oct 2023 15:48:19 +0800 Message-Id: <20231018074821.1908906-5-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20231018074821.1908906-1-chaoyong.he@corigine.com> References: <20231008015041.1551165-1-chaoyong.he@corigine.com> <20231018074821.1908906-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR02CA0019.apcprd02.prod.outlook.com (2603:1096:4:195::13) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|CH0PR13MB5188:EE_ X-MS-Office365-Filtering-Correlation-Id: 5514ae9d-919b-4cec-4472-08dbcfaeab61 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Q0VUu8P+D3cpWmvyxBM9i3uyWkGVuuxPEGhs6VYGJvfirt6zjCUU4cZHsrPZhvu7Q/VZao5sWDV60yGVa4zzErysXvW19tR46H7og3W0idxRHSRsTOe7XoaTnddh6ZfsDtVacpR95rflN9gsxbxkfqQdJLwDY8kFADgDdl5CZrcymwLD7GnkgmEp2Wo4wziCgRqC0xM2BOV976d1M0diD2g2vDOw4BCMmkx3r88EiJypQl4Wqpoywm5seva9YlrBq4FKT/wnmrP6NgtPX9R6P+5p1xuXbkYQ5CVoH9pxHKb8jaTskOUjFM0AoL4kF7g4D9yy3u3k1+F7zQmVMpUj8BG3FmS5Wm052wvNRgO1qg35iTXZVUl/m+tqHr2vOte1QnxBoord0gHQaQ3aeJQgoIY9JUCccDhvCXbuvxgF6HCCASDai7/vQLRbcGDLbRRIKYmdPrxK3D00XIu9LUZs3bf5Pdma+2RM7zmt9f+EhMsopqR4zaaIq4hPAUw+OsCdSL8irXKjbajOt4lW4E7O3YB0E2ax9GSRNlF3Lmm2P4TdRwd4TMTcsux6LGs/XFdq/m/WS5/+wkrJ8RlKC9H72UtlW6yZsbZ57z36/o/bR500qj/mEDwF0BiBl4pFPvhBJJl6GJx1O2yDTG5Yp8jVoUjkwMYFqCPgZKhVirVWUC0= 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)(136003)(396003)(346002)(376002)(39830400003)(230922051799003)(64100799003)(451199024)(1800799009)(186009)(86362001)(41300700001)(5660300002)(8936002)(4326008)(8676002)(2906002)(44832011)(36756003)(6486002)(478600001)(107886003)(2616005)(1076003)(26005)(52116002)(6512007)(6666004)(6506007)(38350700005)(54906003)(66476007)(66556008)(66946007)(316002)(6916009)(38100700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?MM4Md3C/WMuU8Gc+IcD1tYvRK9CIEahRYX6qPiv103XyB6SLVl2Zd1aO639T?= =?us-ascii?Q?gVyWkqsxXdSwT+GMZZ/oUNiUyfsEvnoZ7I1H//vNJsRIF3ib5ZhU2uILK2U9?= =?us-ascii?Q?+uaCHQynTjbeQbInKM+Qn5mXa5xlYbqcbXNdT4W+1msbZHAAN1BdggRIraYa?= =?us-ascii?Q?QjAhfnZqPIEv2UDsvBgFQFVbHp3KHFmRdA/QX83Zqnj+eIweEMN6OXBbJ2yS?= =?us-ascii?Q?wakvrlNb4ojuWG0+OCNesDRIv7GE31JSNi370kddVyxZLci0Zi4rSvmgk2yc?= =?us-ascii?Q?DpSVpocxaBo8S98G5qa8Jvs0xfLBddD48PCKuny2UIxcBWAyggTJsdqv9Xgp?= =?us-ascii?Q?/LchUOeryUXtwS0p2TwfFa0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bY+f2NHMoZ/kqpZs1T7tp4oZmKN8GuQ+wkXtOZteeQD3Tmyqafi848OhkWhV?= =?us-ascii?Q?e1QfFRJcSQDxg1+CvfUZ3wq8i0dg3HRCpTVgg+Ytb2unJLBKLUVmuJxtWaiP?= =?us-ascii?Q?c8qE8xCy6+1bYU8vSPrjbV10hnUTtcAoMzymDez0HqbyYTvnk+oUELT2NSgR?= =?us-ascii?Q?9UAOlrVnJ5FPm1Ty+p2W6js8qtUheTwn6WkF3ttovSp0k1IkC1PIVoQO48U1?= =?us-ascii?Q?17LEq7jZ/JYSRW8bUEakcf9N/tKzRyGLAhYdm8tyw/JS7eU28erjMdO91spG?= =?us-ascii?Q?hGdOUFl788cewnCTnmVHNFx8ay4EjLJRuCEzeoqgX8L0ll488sOLShByuKUs?= =?us-ascii?Q?Zg=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5514ae9d-919b-4cec-4472-08dbcfaeab61 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2023 07:48:51.1269 (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: MMsI3Z4jpKaYnqJ29V29koVshHBaD0DYORpXfL6OkbHsR2Q2CgcSKnuUsAB+72eZNhG89yGgDBVTHClzkiYGqEd3NWjLeScCpahoPgVVnCg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR13MB5188 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