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 C2E61426E6; Sun, 8 Oct 2023 03:52:09 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6F87D406FF; Sun, 8 Oct 2023 03:51:39 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2104.outbound.protection.outlook.com [40.107.237.104]) by mails.dpdk.org (Postfix) with ESMTP id 36742402F1 for ; Sun, 8 Oct 2023 03:51:37 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HfyDuRO37AChp234mH76jE0s3zLiyfF9sYU+I3NyWC1gl7+ViTPjXw2gFeXOhJp/Do3MgxK/TbgME2tx5WaRKTMiAXlzMvXuavYI4+LgSGr3+Xpvd+7Tg/JqOWxFCQqB1FxplZifVdD1bmumzVHuzN/oZKuEfW+o0oHEitfEzkzR5WnuWJH59FiWXTWybHkkMKFuuKumEZc5TCo/en/BpMWeJpUfZnio8WmbkQVyWJ+LovBI2Tw6x2fNwojsuiZWW6iTRJbYABYMkceEEYlqNHJkNLY6Wq5uzVfgaazoWtJnHxumpBlIh6MXXdVxpMdM5NA9TedKCmNO9Gi9n1jv8A== 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=NqJjM672fut2XagkkPoqrsgO6tSCWiTuSj/hlpc8175mvV0rxzXUEj4t/QwPG06C+KXT6g0qQLnaJ85vbHsrQ7ubu1xOFcA47md4+bBU/itfcP4a349H7tWjQgeh1M60QfccRlt+7aYXEGMmnDtqNNfpkU2EwEFgkU2Y2M9Y6kuyR1m39wWToiFRZJq/igCApKsHujQObEAFAMl6/mevmu8nDqBELSe80L8SBmollInz/kuDJkGg2beEuZCrhlOVF/ycbpTRbJmWnBm4mO8z/FY6dA/L7tRKmgal/lKfCneHPGfSWFOP9UqG7q7e41H8Y+tzOB/UU4nmyWiT4fh/PA== 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=HSnY40/0QHeuRTcZPUmJPJfn30Lz9hxS5ZbmhyBEI7E2YUQiwpMxQQ3ShPDgSDyfLxOuDjMSPzks1m8Uq5Y0Lx0FpW8pni/Vb7y7uelH2+mDaQRaehJauphYceVeOjnb4b7qHheOeOSvQGS3VgyrNw0PNJHMbFHC4YpwOH+k9wc= 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 BLAPR13MB4579.namprd13.prod.outlook.com (2603:10b6:208:327::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.41; Sun, 8 Oct 2023 01:51:35 +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; Sun, 8 Oct 2023 01:51:35 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , James Hershaw , Chaoyong He Subject: [PATCH v3 5/8] net/bonding: support add port by data name Date: Sun, 8 Oct 2023 09:50:38 +0800 Message-Id: <20231008015041.1551165-6-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20231008015041.1551165-1-chaoyong.he@corigine.com> References: <20231007013440.1309422-1-chaoyong.he@corigine.com> <20231008015041.1551165-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR05CA0173.namprd05.prod.outlook.com (2603:10b6:a03:339::28) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|BLAPR13MB4579:EE_ X-MS-Office365-Filtering-Correlation-Id: c05ee916-29e9-441d-db14-08dbc7a11a8f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sMsMnWM+dtbGobHdZqhf2hd+hemV6yiyreAtOmWKsfDFO5MmXB9pGITwhOXxtkqbOsDPERnofK/gTdGI4nLfn9sbfNvNbEPcx8JUUeWGHuO9RNy2C3+XsXlg3K9Spw9jbhXXLUjlzZLmp5t/ygjkErzQfnQRya3GjtMWM1Dc6cr/j57ndDmaX7BVSRDNx2yJil2LUi8v5DAXDwqq0f48dvPx21oSY313yiz7rPRWcfanTWUmR+BZ0PGMJtkakHWyu1pWsEONO2BR1SPLi991OksO1Wj/ryjBTzxeZx0VsjlAqIkPusbEfvuK38yxzmUWye1VF14SGiuue4+LrZVOYQS2+6Bc2nGF9shrE6N1De5jsFO9sche9uQ1bs+IWC4Rlr1GXY1ehanDLKRLjRViC9GXSwLMYnPMVciMXaViqV2ZCExwFSfv+GLq2tM2szqUlO+kxsJebhAVFdMAzIEHHnSOUsrquxL1k1HXapUmz0QkGlhdhndflDjpjWWKwq9CFTjkJaCP6/WujrQxziAt2VKIaO4bjo3cunhRKoi/p8JgKE4uoaqElGgNc5yAC3o6kZPD9s6kO9bSqFL5B4m6OiFzaQngwn9ZSd7ElZSWgcFho0+k6SLT3npNXeV0kjOg5VssvtIL4sMTuX/eknA9Jo9hhil7K/BQECmyd0g21eo= 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)(39830400003)(376002)(396003)(366004)(136003)(346002)(230922051799003)(451199024)(186009)(64100799003)(1800799009)(41300700001)(1076003)(107886003)(2616005)(316002)(6916009)(66556008)(66946007)(54906003)(66476007)(36756003)(5660300002)(44832011)(38350700002)(38100700002)(86362001)(2906002)(26005)(8676002)(8936002)(4326008)(478600001)(6486002)(6506007)(52116002)(6512007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?T0B3JU4UMXjURg4gmOmjH+kYesGLMWnLkkg4LuEqWzd3zfKM4Vr6o9vGjv4f?= =?us-ascii?Q?d3oVL0x9pMulxRGYLSZbxSaMz6TWmcsc4OXg5iAxfuQ9FaxfuAW54Nho367J?= =?us-ascii?Q?U1/WxS9gmxGmoapot0vYubZllm2fyQLLjlZXYpiQpJrMNd9gJclB7+ITuW5V?= =?us-ascii?Q?98UDGl7GYqA1oibZTe/d4tCmgvBYlApmn/0TRtMCOudNSO7ohV6I91dWSAm0?= =?us-ascii?Q?83c+ot6KUuXFHYNobf6dXzxv9ggzdO2173ExiqK53uKfns++fPddKTmZFMnL?= =?us-ascii?Q?RnGydVqrRRZzJmKvvSnB//586DIBVaNiKwX5ldcAL4wMw6FwSlVsqn15I33T?= =?us-ascii?Q?9SoOpSMzD7ORr/xCfAaG0BWXZ04BPVDr9TmLyo6OppHydu9RoRU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8gJRfCsYNW02ChtXmK8jNoZKFz+u3a8aVb?= =?us-ascii?Q?BTVotmLsDQzFo3PI1PfUIr+QBnZUCxz4m8y9qdzeTHcPnhIi/A7HZMrtz5xs?= =?us-ascii?Q?COr3V5RKFzas1IdShBrLV0/1l3Tz36bYsOeECOFt7nt1nOD8x8k5Fc2Q3kqF?= =?us-ascii?Q?6QcUzi/vK2rUkr8l8PO+ytb2SGswIbDPOp4wCGLwnmCiNx+4IGhffCt4fKyg?= =?us-ascii?Q?9jKhpG+a3G3PArkZ0wtRpFvB4ogQUsbrdc5iBc0SY0GcxNVNP7MtSOtoCW5Z?= =?us-ascii?Q?C/X4l6W1RTUwpjCNVaJTZJ/qvzHVG1rR1iKjA7OMTu+XMnkSAd41eBqA3+Kq?= =?us-ascii?Q?hw=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: c05ee916-29e9-441d-db14-08dbc7a11a8f X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2023 01:51:35.5247 (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: W5AOdGBYpHiO9/lCsHcwnykugp1B0/+3b1vd6WKmg0NnMzuE9HUXfCNZ88ICRTjN5g6W82NkjK8gr4B9HBeH305EOdBaohE5w6EmPlRKZEA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR13MB4579 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