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 9BB734378F; Tue, 26 Dec 2023 03:39:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3C9C140DCE; Tue, 26 Dec 2023 03:38:39 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2100.outbound.protection.outlook.com [40.107.236.100]) by mails.dpdk.org (Postfix) with ESMTP id E4EF640698 for ; Tue, 26 Dec 2023 03:38:37 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JtCb3y5gkVkVN9QOKy4+d9RlvCnZvynaGDjIRZ8HduerBZ+xY57/vwvxQ7BrRFyVZ203PmXiaR64zQBCK+I2bx0VxWOzzfAxPsdzltFLkHpmfHxs3oiwJuRj0knIMGn8nsSvbnnKdefvXniXiYWDq5LnSr1cITuuOJ9cchLE08ZyudCJNWpcuyczQxuQiFiBBv+6xtexAiXI7Nd5y0ltnRfmaBMoAsqz8H1prmZohDpcjyJ1d9d3n017C2mJi8U537nLMCJ2sgwtVzSTxkmfM/Ta6HaLYVPmcRb7j58GY5uzfd8tSgaSC7COrM5OJH//Zv7FQNCcbY63Ntsw7+bTXA== 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=z54Ge58MLaoYDAf9ByPebtSKVAEljKXVjLuYRwQsiUQ=; b=RKdPZIvsVvPptK/GK4UGJm3qM7oDmP1fVb+DDi1ijpxid9WCzV92GJgQc2VRU4nUlMMkI8//SuncSi0oy957mtpgULGbGvPoDiyYH7Tuxb5Da6T+lfq1RNZvkIjcRGrzhvIBmX1s6m01lB7r37SrV07VhB6i0/uZ35IOMocGbS/7nOC2XHp0kQSpDlrR4YiptfviyLFrd+OltiuIpYDe+W2BcQptYB2oGtN1XfEU/uSuv0F7QJufEw239KtuOBLsfzgscj1REti/7IVdfr6P3963GUzXe8zXcbjjj1SVlw6gvethDiokJeBmrsAas+HmT0emsEoZI/M8fGYuStfmMg== 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=z54Ge58MLaoYDAf9ByPebtSKVAEljKXVjLuYRwQsiUQ=; b=OsFmr7MHBpNLoT9SkgSq7pBafmd3kQoszTrTBJhUpRcpv2GpP99UT3XRePBaw0hH6tahFMoqUIv/Qy36FknF11fTiYZgTH/na1eVKeTC/lq064134abxLHG1F1QKtvNC+PT4o96c8FyrgqlU8jZOVrMtbt4X+J0kQL3immcxDr0= 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 MW4PR13MB5864.namprd13.prod.outlook.com (2603:10b6:303:1b7::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.26; Tue, 26 Dec 2023 02:38:35 +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.026; Tue, 26 Dec 2023 02:38:35 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , Peng Zhang , Chaoyong He Subject: [PATCH v5 13/14] net/nfp: support getting bond firmware creation Date: Tue, 26 Dec 2023 10:37:44 +0800 Message-Id: <20231226023745.3144143-14-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20231226023745.3144143-1-chaoyong.he@corigine.com> References: <20231018074821.1908906-1-chaoyong.he@corigine.com> <20231226023745.3144143-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR01CA0156.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::36) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|MW4PR13MB5864:EE_ X-MS-Office365-Filtering-Correlation-Id: 00b05186-a865-45f4-74c0-08dc05bbc240 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0hnw8WED5nGpUBAQ/7eDSnANRxljBPaXPawyvY/5XBiCL/+7Dwr/x5HpY4a7sRDNOniPlT9AHH0kZYv3e3HUOCl7Bd3MHrPNRLnGd4daqlY+FYruWZa2zN11ygZC35022Jk9smagQ+jELZWSnuOv6YGMUclNK8fAZoTwnqNUOXQp/SN1ikYIm+CjvRG4fpk1TBsnyiEr5wtjcZBc4QJhx8mX75yFAJD32HIbN6czZiFwsZS5GnqKsA24KyfPEa4hvzmjNLrC+PJ7F2GI8nHxMcwn8yNpyGSSlqhQ1GJdq21YWdgESMnQxdw9LIw0L3CCOTvkldyt4aPpmyTpgCTU9yXWfZKEA81p8Cj5o2eblOLcbqX5gABK1he3LfSLfzyEkLGj6ZNDRh0h4lIeIQS4GZRPFWo0c8j64mRyZnyp6wUwfIVvJiF5elAOk/Ul2xilLygpO/ua3ZMJweHsyfooFkbxtQz8wCU1Bp4M22nbwPYl+JNMGn9rEAHnscFhcawijaJq/CdOIhtv9REm9WuemkLhawIhxZ8b7lbaPcR7WUbYA4LkZzUE91i+7sDX4IecsJlATBbRLHKY4VyAVLKNyMS7hVqApv92PAwZwuD138PRydkHWPRtpCrK8lV9IU1IdGPm3vntKRaV/OyLX5m7VR1UbEeYbGyRH5QX0qs3uZo= 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)(39840400004)(376002)(396003)(366004)(136003)(346002)(230922051799003)(451199024)(1800799012)(64100799003)(186009)(83380400001)(41300700001)(2616005)(38100700002)(26005)(107886003)(1076003)(316002)(4326008)(54906003)(8676002)(2906002)(5660300002)(44832011)(8936002)(478600001)(6512007)(6666004)(6506007)(52116002)(66476007)(66556008)(66946007)(6486002)(6916009)(38350700005)(86362001)(36756003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?/w30zJuq6n8cCWfFtWsbpJxX14B0MAblC3Hl6QLzoQ5rKctQFjr/bIwFekoN?= =?us-ascii?Q?JXVC7tm6HRgXY+fYc75BEbC2jtD4Af6mVLTlzx7v80RjuLpFd/VJEX5HHl+y?= =?us-ascii?Q?d/gHDIA0buowB6G/nP6fsb6gcKDsgzbvlaAak9FDfLVurC+hA6rtvxEO6oNg?= =?us-ascii?Q?V5JK1hKrkBA03eiO2D8sWMm1W+C+rbhNbyjF8e/X6U3iI1fgaQEIVivG6g9U?= =?us-ascii?Q?Kr8SMvJwsYB3tIU1CgIDZVSf7ZQSVnAFuRNT7MdE7ihe+aCdPkzshMJ6mM1j?= =?us-ascii?Q?MeiB5giI54YO8JF4xqTtWOmyVdr93C5ZUSgU1boyb9Qv3R6UH7MN4HsbPLES?= =?us-ascii?Q?BC085ydBgnyRrp3hRXZ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Ig?= =?us-ascii?Q?5cHrznpD83xZHRGTmQco1VrTr9vX3DYo118LTRnoRr4m2DXXnQkcp2aw5KVb?= =?us-ascii?Q?iArJGLpdF+tjiKwhKbZ1ZZS7/kRvMp7JHlzOSrrBWaqPIBTpp5xHLMS4n3dp?= =?us-ascii?Q?tNpYfwGeLcPweUjyR29aAVkOhy0FT7fYt6OmOCzPBYX5hoakAde7A1F0Xd8O?= =?us-ascii?Q?K1LI8lNVrT87Pism3/edn/cFzpMoLZjQ58z3HAVXm4A5i8WmfYOSesF3gbYu?= =?us-ascii?Q?I+3FphRRC0I68wM+LTcQFCbAt+uiRJ2jjHZmTwHOVwL+8UmfRoveb8M9c6ST?= =?us-ascii?Q?p7fu0hkO/K8L+z3bdoM0SQxldP8307uEwq7HwSGLMXhwRhSb+J9nfqkKOXZs?= =?us-ascii?Q?Qg=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 00b05186-a865-45f4-74c0-08dc05bbc240 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2023 02:38:35.7308 (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: TtVqsKFPRs6/pOsO/11x/WpSByo8g1bYNQ8HVOTVr/3zGpZ4sn55GSxWwpbCoZxP/f75xE4/6DanMEnIvMuMXJj0tYsTCQpxuMKwMQ0guMs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR13MB5864 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 59d1c211f2..91d7d88b8c 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