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 944EC43795; Tue, 26 Dec 2023 08:30:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B69CE40E01; Tue, 26 Dec 2023 08:29:12 +0100 (CET) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2125.outbound.protection.outlook.com [40.107.212.125]) by mails.dpdk.org (Postfix) with ESMTP id 8AA4740E01 for ; Tue, 26 Dec 2023 08:29:10 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aVkTbde1GxblnJnt/ouHaei5PNOvp9B3faOz4uvrXkULtFuGwxB5L0GPgKFNUMeNYOu9o8v1v8xUDN04PDejlof/ewH4ewabnOxCjPWSYDmlT9E8CKtw1jtgR3kkuSrGs1/tRr7rKMnnlW8Xq+EatHgSb62Eyr2feaAD8N09EJM0LQ3yJz3MLB8EEZiCD1lKur7pLyKu05A2MGpvVvDC8s8r9a5+HhDtJhbD09qbiY6HbJZO+wrkY2yoEi8hAi7rD5rCbP+eFBWCO2Web+qv9B0eAMFXct4WcD8T1qNqYaD7XlUWnzACADUc8XklGgrong8T9s0kh/3Ob9dkgxq3dQ== 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=vS6sT+qBcIy3I2SJC6ekrV+53o16QgWP8P9TOdpTc2o=; b=C7tzzuzFZkAoxsXXQGEu6VGdWNkNlhAAM7yModMuwFnshSBGhQkWDL61iRtPz4nSOo74qB0XR57qxHWQjR1bwDZXPAMz8kRIrgQ51wuqZnwe9bikMZMgyJjoc1TOvOZV3Ji1f0MwBEFL0RGFfFOd6uq9JImGCOoCRF36Hy+BVhWZ6qpYhFTuAUb1RIlqrJgeZMtV3mC1pmSTGo5RoGt1gWuvg388xHZ5IMSLhPfiLUry8zLjvuuxamsnpDh0f2rTJezaTd9+2lRmE5SGX5qIz/zQoRSXaqPxX9ptRdrkZMAChBW38zhM7XSm+SkL0axHkoSl8p+sfvUvno/sObJ4dw== 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=vS6sT+qBcIy3I2SJC6ekrV+53o16QgWP8P9TOdpTc2o=; b=Gm4K6+4aZveQeEyNDumQwokT4ea13wgNku14IJqzw1MuNeRfRgLFW9kV/4cuFEyyUe3Ed7gGU650CrbSWmS3YZQJA+c3Oxa2F+hiuPoI4TO77DBGcIoMrHxMDCq3+BOtfXBseBWlrer+3awTnvmp9YYWSu2wUDKgIo48bPfrc6k= 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:29:09 +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:29:09 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , Peng Zhang , Chaoyong He Subject: [PATCH v6 13/14] net/nfp: support getting bond firmware creation Date: Tue, 26 Dec 2023 15:28:23 +0800 Message-Id: <20231226072824.3163121-14-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: 9f38ddf7-8e9b-41e6-317a-08dc05e45942 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zzRPzFnEYaCqTQYQ+JDqFOQjefWonR2cmPrC0Zaz60rQXhqUJBuqoiuvcfgkEThAtaYkC2kWUEArHW/eetKXqRP69Rdqk1KMQcxr+XWHdaJoDu6HNNT78PmonS+lAUK8MTPVv3xX3JcbGSRolildhCJLfAheE06zEoeKpq0pXpFCzPruU45i9MVDQLL/X3RxdFnZjMt/0PsX9GwzzOijceSVYAF4ZkAfRfCoDi6iFkNujshRriRAr0sa3EKQFhfW2wV91ngrgbATootTL6x0NxSzefv8IenxfMRDfLlKFIwL1yq3b38fm3kbSQpp0YQRH2fMJVZXfGtJnmqe9DHAOuWbqyAUp3b5Tub336lEWHCKSF8E/9Chz7QVP6/GnKFn17OVQyXCn+BFWpHt7vBMXGg3wGZv7WQCQs4kk2SVKWSRLnr6tPk4XP91+WZGIUbCZkPEhtN3q9O7645OkeS+o4o3AkifzssZ9kDAO6sRwI73wF/u31+154fhlTbQeNFx+T+GNveVj3poI84l1q2aiMYQ7P/Gl76Y+UTh24jepUMV29YaSMbGOC8Rqaq7qHpSCvx5EOu/AKdsVTpf+97m8z2KSYAqsNYlcqYsCGrkjwJV1gXJgKyrPFbhmBAcmfk0yPcdYzCLUDWhTnqOYOuGLL77h5gHxqiJx3+JRYoocLI= 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)(83380400001)(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?/F4ITTrIE5q+BPlyCot4PezGe+AYVKuhFcEosRqym6vOb4jt3K1SCJ+WsZn7?= =?us-ascii?Q?J2sr+6BYBSXvJ/5ECrrTwTP37NinY1Tqg4uOr1siDQnrw0GKHV8oKKMSs7p0?= =?us-ascii?Q?sLmpIVftpGsrhZ9k7IvDwjTNDB0yqSMQGR0EOWxPKyaiGAmFuwNanmp997My?= =?us-ascii?Q?aa0HXsMV+3rp23UKH0wCRW6BCyoJFR24+rZJoaOBzc40MvamF6hR3KKepJZz?= =?us-ascii?Q?RxvUEzf8ydFdbvCunzBlmbFdGNCpmZp/dJnixunGhkuPqm6aVPRIWfM1n6xK?= =?us-ascii?Q?hFKFMldxujEWM393gZoR7QD6Sh4hkihI0InCCykyNx5HI2sDoSP+ecW+FrcK?= =?us-ascii?Q?Kt1kYtynZRDtK2rD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us-ascii?Q?2IZFQKvVdpkLNn/d8PxYHrOdVDkx7BOHjYe91fHM1CWD/oLIrYWgB1hKmzBe?= =?us-ascii?Q?N8jd2Oiniahd4pJLYQxw8QPTvmzTJLxQG7PZn7JLvc9lCjhcoAZvM7w/4BF5?= =?us-ascii?Q?ASH4Gmz6G7wvo8bZlrzfvbGrAiHjISDvZbtzXShPpjPmSkimuTG4ffHdCVsL?= =?us-ascii?Q?yZ4r4xf5AnvCJCHIqDB1IKLd0VTomjRwdVNzDaETdWLXd3aohpOGO4q5ZvaM?= =?us-ascii?Q?munvwyKV2tv/nSLwWQOV6y/Grmtu6w9FKrXw61ku4kkuj+nxKyzJLdA+Fnpc?= =?us-ascii?Q?iXA5KPMvisnk8iMRgFw0Zly6cr81hnf/GtQXTMUzyFr2eASkjjJCjD5TCGkz?= =?us-ascii?Q?WA=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9f38ddf7-8e9b-41e6-317a-08dc05e45942 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:29:09.1056 (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: dDziV/KLJpmI749YHSyVLGnkaDiQZuI5gZ7vrlv89S3W5mrFrYmzlqyij7tw51BhYjfzyDoPD1BNWKqxvFlBuQpkk0LiWmvZBs9ZThkPsbU= 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 Support getting the status that whether the bonding port is created by the nfp firmware. Signed-off-by: Long Wu Reviewed-by: Peng Zhang Reviewed-by: Chaoyong He --- drivers/net/nfp/flower/nfp_flower_bond.c | 27 +++++++++++++++++++ drivers/net/nfp/flower/nfp_flower_bond.h | 2 ++ .../net/nfp/flower/nfp_flower_representor.c | 1 + 3 files changed, 30 insertions(+) diff --git a/drivers/net/nfp/flower/nfp_flower_bond.c b/drivers/net/nfp/flower/nfp_flower_bond.c index 73b616360a..c809465ffc 100644 --- a/drivers/net/nfp/flower/nfp_flower_bond.c +++ b/drivers/net/nfp/flower/nfp_flower_bond.c @@ -640,3 +640,30 @@ nfp_fl_bond_get_unprocessed(struct nfp_flower_bond *nfp_bond) return mbuf; } + +int +nfp_flower_bond_fw_create_get(struct rte_eth_dev *bond_dev, + struct rte_eth_dev *nfp_dev) +{ + int ret = -EINVAL; + struct nfp_bond_group *group; + struct nfp_flower_bond *nfp_bond; + struct nfp_flower_representor *repr; + + if (!nfp_flower_bond_is_member_port(bond_dev, nfp_dev)) + return ret; + + repr = nfp_dev->data->dev_private; + nfp_bond = repr->app_fw_flower->nfp_bond; + + pthread_mutex_lock(&nfp_bond->mutex); + LIST_FOREACH(group, &nfp_bond->group_list, next) { + if (group->main_dev == bond_dev && group->offloaded == true) { + ret = 0; + break; + } + } + pthread_mutex_unlock(&nfp_bond->mutex); + + return ret; +} diff --git a/drivers/net/nfp/flower/nfp_flower_bond.h b/drivers/net/nfp/flower/nfp_flower_bond.h index e88d72899f..41cd64d9eb 100644 --- a/drivers/net/nfp/flower/nfp_flower_bond.h +++ b/drivers/net/nfp/flower/nfp_flower_bond.h @@ -153,5 +153,7 @@ bool nfp_flower_bond_all_member_are_phyrepr(struct rte_eth_dev *bond_dev); struct rte_mbuf *nfp_fl_bond_get_unprocessed(struct nfp_flower_bond *nfp_bond); int nfp_fl_bond_put_unprocessed(struct nfp_flower_bond *nfp_bond, struct rte_mbuf *mbuf); +int nfp_flower_bond_fw_create_get(struct rte_eth_dev *bond_dev, + struct rte_eth_dev *nfp_dev); #endif /* __NFP_FLOWER_BOND_H__ */ diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c index 43106da90e..8a1b2eff66 100644 --- a/drivers/net/nfp/flower/nfp_flower_representor.c +++ b/drivers/net/nfp/flower/nfp_flower_representor.c @@ -458,6 +458,7 @@ static const struct eth_dev_ops nfp_flower_repr_dev_ops = { .mtr_ops_get = nfp_net_mtr_ops_get, .bond_notify_member = nfp_flower_repr_bond_notify_member, + .bond_fw_create_get = nfp_flower_bond_fw_create_get, }; static uint32_t -- 2.39.1