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 8441E426D6; Sat, 7 Oct 2023 03:35:54 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0B04D40A6D; Sat, 7 Oct 2023 03:35:21 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2124.outbound.protection.outlook.com [40.107.94.124]) by mails.dpdk.org (Postfix) with ESMTP id 67BC7406B7 for ; Sat, 7 Oct 2023 03:35:20 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G3LsoRYt6H/NUgTpvGvpfqE/+jGUei1mUxckYvmQYZvu1jVxiFggcEF5PCe+zkP/b1Ij8g9apX7NmvsZ3Jj0bNSUiwFpYY0V7VzzcnSPdJ1yK5qK+yvqYrtJg/56E8y+TzT3c7NOFWicm+NI4oOwklbCqQQohZTKQK6aQaMpFSlCa4YT+EQYEAKnFtN1uhMQqqteCXKjYBYCqAlj6wqUok4YUp78rgx+ReU6qqPeTz6e//HUg/YQYU/aW7nrgAbFCWvwJD+9HBLtV5HLu4bjIvQzBFua1zyygP5bS1aerlaca1RfGVlSh8OJyvOF1dwomXhY4K4mtdm72IPBD4pmzQ== 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=Ku8eJ0VcFXxn58DdCL+Fc0+dORAUmGQnslTPTVpPdSriS5Nd09E1X1EYyJ5fsoNJCSS/aKEeFGAyiWuS0Qm/FnjCTs48tVFZmMuQk7GCQye1WmoQlf+umVdsxgjfItXclYgiQ+gBlxZfXsOVgo30vFS5gMfuV+yHf8v/dLEieagkyUJp1aGc8P5IpPIAe/WL9nDWqkRnuuEdYxtp7EnDcDNvBPik1nED5eXZ1KCCUfAZcvdSPbd0AWZpNQ1kUPkupNHa+cXufXtR8gGsjjOlwG1+w9PCCQI/Z9v0axcmwINTJQo8OBh6h1DQSh9DsANWaZwTyMYjhkG4w3V4l4QMHA== 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=ujNNL4WfKKK0hmepHwR1XSUwJaCcOc1ftH0t8JESoMV7YKYyoGxMiCfMsl4DvysTyLiczIUYRCk8j0VNKHjiBZrS8ZVCYoP0Ylsdi6y33wAxXwp3ilMVUVoKvsFA4BkRTi5OwsKWje9MaY28V7Dhr9YFNoyVi5+x6ktUmteDjNg= 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 BY3PR13MB4913.namprd13.prod.outlook.com (2603:10b6:a03:364::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.37; Sat, 7 Oct 2023 01:35:11 +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; Sat, 7 Oct 2023 01:35:11 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , James Hershaw , Chaoyong He Subject: [PATCH v2 5/8] net/bonding: support add port by data name Date: Sat, 7 Oct 2023 09:34:37 +0800 Message-Id: <20231007013440.1309422-6-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20231007013440.1309422-1-chaoyong.he@corigine.com> References: <20231005024012.1279810-1-chaoyong.he@corigine.com> <20231007013440.1309422-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: PH8PR20CA0008.namprd20.prod.outlook.com (2603:10b6:510:23c::18) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|BY3PR13MB4913:EE_ X-MS-Office365-Filtering-Correlation-Id: 8f29f205-8188-4d85-226f-08dbc6d5a5b3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JD35UmB0/6XnadUW41wv9woa9/50jFDtUwFM2PVZHkAveN+gpk8/B5ElZsOiAAD858/NtsyH6C+Q3ysFb4gLXMtpr5BkKaZ8PBJA/QXIkJB9/qenEmTNJ/+CKcyc7IwI13/CP16pJBM+EPoluCgpkDATFus6sWh5KLb4MlTAcBDj+Ed70S3bPTJ/GPg3QjPr7em6gzKB64roADWidTJP7HjYzC9rbFf557kBicBdKxqimTgAZ0l7M1MB91QK9/1om3g8SPh9bEe9CM8vsMCwlDk4zjR5lW9c4UDSBohVi5gduR1JufCmhr0H+R59ucwQ5tDcu6lxgoI/LkLUcTylVPlfHV9E4WG2oscsPciYqlpHX1U+05MlgEvm02OcVrjlhLTBySLBYMzwmohGkv+yJOl/olgxHUXsECBp3DMYKRaS8VP/kbtOnF++2BtYXyDTNJcnV3UtePaUV9xfVM3NIlpkUB4ztP0Ouqo5ejFMIbfnYd941ZB6Psa9B/NO/wXzPIBDBAgHpEGJtSlYT9fIBg8lZxnP28FG8x0LPK4xkL/I5+BeUW137jWci2OfnbckRvmkuoatQguCsYqOjr2evfv18V+oIQT8ne3TSlbclPe1FI0CujEf6WsGcA0lViF8b3UHFBsU9wbrBH5WilRwAV28PPaLuJr97t4ObfKNU5k= 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)(136003)(396003)(366004)(376002)(346002)(39830400003)(230922051799003)(186009)(451199024)(1800799009)(64100799003)(2906002)(44832011)(8676002)(8936002)(5660300002)(4326008)(54906003)(41300700001)(66946007)(316002)(6916009)(2616005)(66556008)(66476007)(6666004)(26005)(36756003)(52116002)(107886003)(1076003)(6512007)(6506007)(86362001)(38350700002)(478600001)(38100700002)(6486002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?0jdSffDrRcXmgc/8w6Nav+UT7aDYRVQpCsH2EeZVXmC/M4tOq0iRPDdm84gQ?= =?us-ascii?Q?zrPOlPqcSw6N7r8RPo/bOPJGh6BAlMerEvHZUzwqO4caRtFdlTN8GGTvIGTM?= =?us-ascii?Q?WDKmBE3Cz9YO/lWBg2uX5gx8su61BNnp4Ux31/3MQsDpivob0qPtb9c6LyIR?= =?us-ascii?Q?87OHVIdJsvixuJRhRYkJPd/fcbrpkI0Xq6vLzhSmr+KKGH9ZTJHQ1ZhGej08?= =?us-ascii?Q?4Eh+g8o0wAyn3Trn1ORm0COQ4uqz4XPGv8M6u8DpbLK7pMQUGBewx9ZKpgnc?= =?us-ascii?Q?SYKw0seNY2V+2Xd9e5HKxYHcNH0BOrJdx9VL/bGcB99o5C8LAz4qSP2G1I8R?= =?us-ascii?Q?HiweR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pe74qw5BrI?= =?us-ascii?Q?DtrjrTAi5a+kestRGShbAmtbatvvZ0NEfwFiHZyQOU8/4FPCm4YcvMTt7gV+?= =?us-ascii?Q?nrs1VNpyalohu+fYaYscqGi6hnCaWy1B7aHQGRXNKUnnc4YMlTLFx4KSep8Z?= =?us-ascii?Q?80b9mqMqio1ZQKrBzhkXUYiDETGvOO+gI9s0WvdhSmMk+Mp4amDMv4quCEqx?= =?us-ascii?Q?XsJhdFDQFgl3sxcthHoDpZL1DwfmZ6I2wgaGEy16uPL6SuDvonRjXAj6Qb25?= =?us-ascii?Q?fCi2EUXuaA5BZazXLntQQEVY7fiDkVDi8PUIoEZS5b6asF4BYMAz0Z5EbgV9?= =?us-ascii?Q?XF0Pm4ko52nN/vh9T+NIkMV0WFa1REuZMbH5YOwOUnJJfAKKQs7gmuMJoISt?= =?us-ascii?Q?jw=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8f29f205-8188-4d85-226f-08dbc6d5a5b3 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2023 01:35:11.8766 (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: lKL0N5EYbEX5ojcTkuMs2YL3jL+iwg2kM/F2cQhRAE4StbUqJvqjlj/CDK7WPAVnuIRiTF+Iz2N+LmBwLlDTfinf2VB/SMbpfNAC8Lgt3LI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY3PR13MB4913 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