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 C5E6043795; Tue, 26 Dec 2023 08:29:17 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B812D40608; Tue, 26 Dec 2023 08:28:54 +0100 (CET) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2105.outbound.protection.outlook.com [40.107.212.105]) by mails.dpdk.org (Postfix) with ESMTP id CE70C402E1 for ; Tue, 26 Dec 2023 08:28:52 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CKH9BbUPL0xrj1wvwjGfMVkUP6JpPEJqWu0R6pU9Y1x1p/na7yysdCJgZV64GhEPBnE/UZSli16kYWJN85U3meO745UGpTS+r1vPP2Lh1Ju1GF+Ne3lXuiPS4CCzy2WiunbvQqqrcDOVn0bYRNFi814/KUhL4fEqDFjlra2IjJSZqrHgVPaF9bSHJDFoq03gh+kPb54OcFqxyWv6wzKxJQTeF7aZoHeuwGj6l8FEtaCl3hZnH2lal1eySHMkRI/VZe8j+ASMtvrOazurky/Ekps9E4WEFboPjAejjlb3dNFcZI0TIM6um+gX0vKkbjC0vUhHqr7cIlshO7/oHRFIzQ== 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=NxyvsD5UdbLHTpIfEaxrA9lko4i26UuqiG29K2xBy0Swc/bc2BPZ6b9dqngMjDmOneIZo+EbEq3+tZW2sps6ITFLTt+brD/NnpFun62Mxo7MHb0kjbI45EpxHhAnxjay6PnlfIvGYkI6eXjy3IVEkU7mNG0iBqXFDayxxBYQ0KjE2iS7R7ArVlm/N4iHSfVUJaPNun724KUkMZKqYaM9MbHnfY1QuSHoBd2UVdGPnBeqDlO4y3nfF8rMD7PvEiIY75yCD/bnp63Yn2ItYG1maVJ5/gC8yjornCC8pYOBu3SqqFrA8g6w7KsqOfXMbHWwqgoKbbhUV5388jgtpugZfQ== 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=eVvO/Tcu8w7TwMSVk136QWT/sXCYyzbIsMaEc6lE1pMWJSkuiU4bnkA41oQmu6beIm/zn2quYgo5DQpIaRZpTFFsdm5aH7p+00R42OH/mtoKZJknai1Re2PcCVXpCPakyJd2lV8Cu3/5c3bryGk6H557R5+AHpB9iujJw13k5qQ= 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 CH3PR13MB6506.namprd13.prod.outlook.com (2603:10b6:610:1a3::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.27; Tue, 26 Dec 2023 07:28:51 +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.027; Tue, 26 Dec 2023 07:28:51 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , Chaoyong He , James Hershaw , Peng Zhang Subject: [PATCH v6 04/14] net/bonding: support add port by data name Date: Tue, 26 Dec 2023 15:28:14 +0800 Message-Id: <20231226072824.3163121-5-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20231226072824.3163121-1-chaoyong.he@corigine.com> References: <20231226023745.3144143-1-chaoyong.he@corigine.com> <20231226072824.3163121-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR03CA0239.namprd03.prod.outlook.com (2603:10b6:a03:39f::34) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|CH3PR13MB6506:EE_ X-MS-Office365-Filtering-Correlation-Id: 657131e8-2e4d-401d-6f69-08dc05e44ebe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YNdtmWmmpn19oY9LNEhKiQp/S9847OY7GVZVAypGXXpR2jB5Q1RBaDdejh3LHoETQrZWVm4B+4PrnaIiMCtkbz+RyNUmirkWLeRJed7+ZZbRSu/TQeJKVy776xle9pFfcPh5SsAiK1kpLhCoDwEYTgAzsyBxH2HktkrbbV/topK5icoIuzGcj95dqCP7s2th0af2xcMDWKNd5gehjge87d/qAzpRY3kV7Fj+hxManNLDZl/HF5vo9zDL3wXY0C0vgMtTZACoxmm8QvoU6XQEGs0mKAZDkg/QqKJxRssXdSolNC9DNqCLWeCkxnh/lGO977an64Kpom0qgGzfBuQQUhXrmvSlqriYrHqHDymh2daya8LayxN1n+FxodiatpMjRz5GBk6c/e//h2KD22QTEMcF0xOMPR/Os+aj7o1MLA/ppVIkxF19qJ2m5M23Ko4PsW+7t5j5LTjplUFklK4nQ6Vh09Kfw8jAc/821bvTTMpXRrxDBcNMOdiaPTuac/RpRZC3uNGojWcwM15moAnpfccCf008QZLFbrzV9psc5U+vUCYeluCwRbUgK9tmNdNGO+deMzYydQ4csSVl5MdsFoEqeW0tHO/jYlf/2+5Vw3jcsYrmmoxI+TbbItIVIVPqF+PPT8ccf2vvbXSx+1bnx1/jOBcbRKc0VqAMvGy8AaI= 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)(376002)(346002)(136003)(396003)(366004)(39840400004)(230922051799003)(451199024)(186009)(64100799003)(1800799012)(107886003)(26005)(1076003)(52116002)(6666004)(2616005)(6512007)(5660300002)(44832011)(4326008)(8676002)(41300700001)(2906002)(8936002)(6486002)(478600001)(316002)(6916009)(54906003)(66476007)(66556008)(66946007)(6506007)(86362001)(36756003)(38100700002)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?XlmEDX1lEf/VtJjyHA839+lKP2u5dorNtKzo5g+9gMkYDWcwKr0FYMRBzs5Z?= =?us-ascii?Q?9tjBiLhvgtzS0bSKP8OKomzT63ovKDzJjxExrgRibOZKxkLuwF8W41AqPl2q?= =?us-ascii?Q?vnEgPi1auPkV8WclWdGmyvbTpBJb0AWJRqC9tue8Nrax7BxhsgolMP7c+tuT?= =?us-ascii?Q?pXuRlSVdKewQEXxbq8ZG70tZTQ/9N0LJm51xC+VXf+d7/b5KBiL2vnBaCB1P?= =?us-ascii?Q?MqwOkh+h6gFbCll0MxRLdoXymEjOJeln0zUdyly0h3UvrlVripklQMpxXhoS?= =?us-ascii?Q?0dbeBEppCVEL0Hrfqqs/4xyuGy93SWnIFQ28AqvFNd/ixZ9g82WUiCFZI7h8?= =?us-ascii?Q?Cz5XJFnw4tE7X0VnPEaCb9QYjOjx/lEsXrqw2v+h+PoH4Jk+aAFu5GRulejC?= =?us-ascii?Q?PLQAy7R/vjlpTfZSC+16kS/adqSC9aoQeDC8yl2mqLKTGfO89jpSpv6BlhfN?= =?us-ascii?Q?39mrNlCosvGo5JAWW20WfrcwtPYAKANqDDYIisc16q9nh2NBZbrktBI+l69Z?= =?us-ascii?Q?JtLtsKjy2FH0MHBcQj8XnRIpWEOm5HNCVtX2vmYARHzGwVwB4eZHC4FYA4wu?= =?us-ascii?Q?A48JHYeFnLSeA2BRNWtVI4PAe0Zl9uQq0GYztpobutoHamtXEuc3JDu7l8G+?= =?us-ascii?Q?/FIn+U3NjojonbtPRJwN5HXfQ1jdNX8c6Y2Z1FFvefofLRwnDdXr+KVKskyP?= =?us-ascii?Q?/HSxf7DlO21p3slEMzT44u0sBfDjG2wmsh3jd9djAFACZE44oCIso6ar3oot?= =?us-ascii?Q?6k+/5yUFRwTGxriLlvONH590WphDv6o8yX60O/5c2JAMozRQbCVOeCEs00WF?= =?us-ascii?Q?fKLIiakQa+blmx/8x5Z/DQKmM5kZzK0FSpfdgrCap7bZQMzlKIsNcgGtfR6y?= =?us-ascii?Q?My+1UzxDkoYLsjSWUrnmmeUiCQGwRZpXL3tgkJhyR7wAp8OW74GJLjaC5Lun?= =?us-ascii?Q?e2qy9I/Z4Gago1tp2HJaWm5mWXJ/Cq3yIA96ln6dW6vrQnQ7DLgFh4rsnxqT?= =?us-ascii?Q?OYVSVg7G53kqOVGF+haoVYsCLd7dm/TJmWEtPibirg2CVPF9xibDRyg4KlcZ?= =?us-ascii?Q?IH+OetilHLPR63ttxMrFlD2eWEPQZzF6ZRt9mumkyT0GFdIaXL3sReFLAFDH?= =?us-ascii?Q?H5GqiTLMpihnudV6hinj/wGQeObAa6RmelcuchECqL5Jxe6eYZNHza0adg7X?= =?us-ascii?Q?mKQTRZka0M60w+6j+8xcou6fynKgYYONtB0XDv0NU2ka90b0FxHUDIjwLpnL?= =?us-ascii?Q?QFwgYS0anT55CgGi16ybjOnXQ+/2w1CwXYkZxVje14HDPt8URKINBr+zqMxf?= =?us-ascii?Q?0tDPdl5s7ZxCjAUAAaiVqU9BbPWma+8XY3jj4rSjqIy9so4hfg9W5cbMiLGA?= =?us-ascii?Q?0pvm66kZS9O6QmB97yck4LP79brKc8ClwVnGtBEfXl/ydjEiG1CeA851cUtI?= =?us-ascii?Q?CvWQeKIQCKqKngQ/9QkPW4TisQVja8+Pc0aNCoYrXjF2Cg3B/QRaCcVEcwD1?= =?us-ascii?Q?JkPgGrwZ9xi989iv5oGpuEHe+DeBFWD1hWLLHwwHHNPRiYoDK/x92CCELLmf?= =?us-ascii?Q?+HtWJS5syUoxHWB1Pr9psqb9xMQQwT/9+TgaJHIHKfNUf48gq59yNhE+o2eU?= =?us-ascii?Q?Ig=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 657131e8-2e4d-401d-6f69-08dc05e44ebe X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2023 07:28:51.4252 (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: zZKjDiO8DkwMXoBUT9RCgdX2ess8iJrtYCs28tNb3XYRW6NMVQlMqG+WcCNpXOVNDmAtdPzSRr7GEvlbP2dW/Ol12BHu3znN0t0oPyTS4AY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR13MB6506 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