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 BA4EB45C11; Wed, 30 Oct 2024 09:28:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 45DCA4337D; Wed, 30 Oct 2024 09:28:36 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2111.outbound.protection.outlook.com [40.107.236.111]) by mails.dpdk.org (Postfix) with ESMTP id 6D1C543371 for ; Wed, 30 Oct 2024 09:28:32 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BjWDxMu/weEL8v5YBbNjFzkOu3wl31dnHPXEOMhCtjD/5GAHBF0KpKda9YrwvYajn+7rR5eW1u2hcq5G1giWx+jrqyIpoHghk5uI79NESGBraWsOATI2KodMvWOztk5E0l8QTquQxx8WKcb/7WqekL4H0X+UBf6PZdaHfedXBmGMXlP8e7aEdyZzKxaZTA88PLWZnBL7rJkGg5pG12PSxzU+fSJoYFSJGLob/ZB5AhUV9yp3KbNaeCKcVpTQW/PIdbhDv+eMWFYm/915oS+RhjTgUIx8dlmIrGyKFMHCEMO0a+M09+gRkSBmEhYfi7bK3sBSDVaXMQr2aG949w8AvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=M+SbFBTVK75iHA311/NfHprNoOGYPCM+hGwVtQc86ts=; b=nC5AWguw3PWzHId8tV2Q2WDzxiejNEYZyXDGOKjkEMgzyqoeQHt6RYHJLCVmbcyzvPXK/LeB/eO2Rq1XFBvnY/Nb1V2X9pFrTzPSWBAkLa+IP6hTpRJ57Uiyjq7+4X+UZ3byg6HVLcxpfnp46jJGfDz8vJCgNHPEHWK6tnuNr2X7iwROY1ADkj10xYGyXsPfD2KF5pmVnVcWl57Xet6NROLOQYhye760aAw7e61VKLWMgD7U6Qm61KEKAzvsD2Ae6rxE4MLm4Pk2WohZHtvCuGOMJS6rfb66jyb61WbI2esunf8Zgy0wl7Nh1KPn1pr55XBscJSnn8piIqzx6E/wIQ== 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=M+SbFBTVK75iHA311/NfHprNoOGYPCM+hGwVtQc86ts=; b=KaYWQFR/AK0xglrP7FgwrBMTJ9pK/GlH8kl5wVmfUAokGt0QjVjkBztJVAhvzZ01nJ0v9EEVCCStz2z05XEcgbvxEkcyAHyHEBTN5KYT+o4vKUjj75EC4GMTwK+xBfPllkAZczPgrzX8GWPrXA2UeKP5bKZstxQEZx6ffieLifU= 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 LV8PR13MB6775.namprd13.prod.outlook.com (2603:10b6:408:233::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.20; Wed, 30 Oct 2024 08:28:26 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%5]) with mapi id 15.20.8093.027; Wed, 30 Oct 2024 08:28:26 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , James Hershaw Subject: [PATCH 4/4] net/nfp: add support for port identify Date: Wed, 30 Oct 2024 16:27:59 +0800 Message-ID: <20241030082759.209617-5-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241030082759.209617-1-chaoyong.he@corigine.com> References: <20241030081910.209308-1-chaoyong.he@corigine.com> <20241030082759.209617-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR02CA0120.apcprd02.prod.outlook.com (2603:1096:4:92::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_|LV8PR13MB6775:EE_ X-MS-Office365-Filtering-Correlation-Id: e2364fa5-00ee-4eae-6852-08dcf8bcd360 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|52116014|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?RxI5W6nhyI7Yuv/5O5bGEh3z2/79nc5fA/TpwHn4hmmd7d1eUmgkNNHt4YM6?= =?us-ascii?Q?tGejTXs8TmGSSuuO6E96rcz24EMirhVbhaBjz7n0Vixo7edk5J1gQm35LMp6?= =?us-ascii?Q?tx5a9u3iXV02miA6AoQ4Ck89xZFAQLZLYW/KURG5aTgidGYqImOGuqCRh57u?= =?us-ascii?Q?yyl+arIoYx21gcnYm4hOjeSLfURVQKoqu6VAqU0P8/rAHmXWOVFbFlt4skq5?= =?us-ascii?Q?xQASrgv3/9wCbRsYYfR4Nq/Cp/VxcsTaJB+YFuzhd9CFUOGHzVO/7sEcTLDt?= =?us-ascii?Q?plXkz2pGjjXjjfpQKhQ+DtewEQ/QNcgRgEIhUjZl8f4kpD6JEJbnD1YeAKMK?= =?us-ascii?Q?5Xn80h32Wx6uSwWLNkaCkgM4rqMXMhrdODztwuFi6l9+nmxFKHJftLGMOXqE?= =?us-ascii?Q?5WqRbYr7WnbGRS1NH0M0QuypvqWXoUMYgawMk2XkR3C+349zTAERCYGTzkCD?= =?us-ascii?Q?dxmepAFb4cu967PFXlK3Hv26KujCh6qwLRvy/kqWj8K7m8KwpK9W3SAm9tbs?= =?us-ascii?Q?c/nmq9ZoFGSN7BhxkILEUgJ06pXe8XmRlw5stMoMR56UeWYpAu9GeAgoyJ7L?= =?us-ascii?Q?ElDbvKxuRLR7WITg8B7yR3GxVk5AgoBGL3U3Rwf2+8Zd2Qj8coHpSomuRjF/?= =?us-ascii?Q?q/TPgdwCbtdV06a1+jt1kLHT+4PtC7P525fkUAAqMjIlNuBODIqhU6DMoRBl?= =?us-ascii?Q?64k0xaLZz5g2/8uXPS+1wfNR282cwf0vOwYve3rAuweU+KQcCXG46fAnMtsF?= =?us-ascii?Q?JloqGS5dY8jTKPCVIv1erlc/MdS5oTXKdT2moAW9RK8S1T84u0+GJps4nWA4?= =?us-ascii?Q?8Vf4bUVT6Er4FnbfuEoQyNsLIEr4bMRK0lB5dllnermyLJzHZZSzo213Ovk8?= =?us-ascii?Q?SRPIrF081CDCJKe/2n2CengzD+Xvm/aaeS08wqITbNXSd+LrbBpGwn0R39ew?= =?us-ascii?Q?1h6j7wXk3sveXb9kshV2gNfHE0KSHfUiQBWVtG1Md0SwL7N5bC3FLev1tjXc?= =?us-ascii?Q?5rLseunWM7ja3rqGm49zx/1ecS5f9RaQj1vQahdeKV79GnaJytI6FvzDDkBs?= =?us-ascii?Q?TAM0Q31E/83RWFV0xix22JHpR1itQloQVO4CW2RkIBjlon4RHIl//dr1UI+t?= =?us-ascii?Q?dugzadziVonLkqp72BcpOkatzV+W4lxdgvX76kYvYaN9Y+ujHdTMlpgU30E+?= =?us-ascii?Q?HPaAyfYfrj1wIzvbC3nA2YiETl9UiSs6HdiqZ5PuBNNvKmDEZmW2iiZMRHPq?= =?us-ascii?Q?e2+qgy6UNQzwRmIrq8tQFCMhtZ7b4aBalkPcpJk56OwqbNTacUwYw+ZdBR8Y?= =?us-ascii?Q?FcUhyC9tP2orEI+Ghh46+Ff93YMm44+3Op1U5XtoBla3taNvGDAiSEEI5vxg?= =?us-ascii?Q?0tTXUTw=3D?= 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:(13230040)(366016)(52116014)(376014)(1800799024)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?t+dzhQEywbAgq08MPP8mQV2qsP03mGwBjH7Auf0GwsVWCiEFmEWtPo8R/Aqe?= =?us-ascii?Q?h9R2YPmPkjZiDsr02F+xuyzHTdKQ8dC/eAaGTIrRnQD9SAaYHhLaiNYB9L+e?= =?us-ascii?Q?GgOrl9cFtIagv8NNgl1SJO5Rsr7veldxw4xrhA/od8Xbx++BWAQREwsvF5HD?= =?us-ascii?Q?ZDqm9tGVMqjzS4r6Uj2E8Wy46zD8ftlbMiwuWN7JZn9pr5jI2jRC/KP8SIqI?= =?us-ascii?Q?be963NsjLBAKdQDGJJDzoGASvphY3uqQI6t3mflnelxsTAOBsK3rAxvCuW9S?= =?us-ascii?Q?cc7eiV9PAlNuSYTqNjXMVOkqWYaI19c+d3rn0GzFjkiBNKHVvnrbw68hB6SY?= =?us-ascii?Q?yFHME1EJjPPulMGf+aG1u6IeRAbSJOXcXhFChl3g3B2b67dVSzCgajyUYXWN?= =?us-ascii?Q?wt9Q6DhgTp/Gmjl0m7bylYpDuoVXECJfyuBcPytDaV/U6/J/TV2q+DsI8HZO?= =?us-ascii?Q?isYfima+Oy4icuJQvb0s4XF6eQkjQ+rMsxoTVtrlohjTI6WkhGW5ikKs6b8t?= =?us-ascii?Q?w4qqM+KHDI+iz81juBNiY+Rg421G2cCr8QpxryZK5Oq2XV5EJzm51mSR0a7n?= =?us-ascii?Q?BWhW4GkXHZdewNHnVFIqVtWfdQ8ZWRXvyCPgTtVCxdsjcT79hqfXvOSu18jW?= =?us-ascii?Q?mduREgd06EivmCACvb5/acV8FIL03wzsry2NQKPOxQGN8H6ozLEClkge2Qo3?= =?us-ascii?Q?IJOKq0lx1v2yMxYnSQJaitWQgz7Y76KuVWoMXaBOPRHA1KCMUFVt4S3uBpnt?= =?us-ascii?Q?RNszkRzmIiE5YS1Pyi/sqdhZIUDsjiM3kQQ+mIKpb3HEY+JfRkbwoNuQFCCl?= =?us-ascii?Q?0xM46l+2AfDxch2rBaivir1PUh7irQg2nlCp1/5ryOCZYNGqzenEMMbrsSTV?= =?us-ascii?Q?CJTuIf1dTRovLK8+LCR9fYQ7m4YNLBLx+/vsYPhaRWXA/z5tg/bd3o5flAsS?= =?us-ascii?Q?K9PsAY9WHfPP1oybGXiDdIcR+IrPv2HIGXtjYi1qo6UsPSxFSiSrS6nuBhgK?= =?us-ascii?Q?fuDdGZS8XWsrLU6CgEopJebnEjPSNYIRa+CNIu4akEV5ebDqtwB9lJztKAsz?= =?us-ascii?Q?iGxdTxlByrYlvo8jC2uY2W0NtnU1jNfa3YOZrlcvrEuUsMiwzEKAOBrUHK9s?= =?us-ascii?Q?3PeEhOvhdKOFL5qkI4qVfZ7fQkhlqQYhhOiJ+nXxgTNmWY6PKi6XOsP3RKVp?= =?us-ascii?Q?hxXYaD45HMEdZjk/TC9CdMXDlxBhKIHY3SVwf2Xis3vbfmNQPc/TihlfoMoj?= =?us-ascii?Q?L6TFR4UrWw3xClVqYKtFAYyGk76iICvYsmn4p785kR5JG4ib1+21SvrpCxp+?= =?us-ascii?Q?xeuJihTDpxD0/PgtUqS8faPsrgY4EnAdzY2srGCpkeMmv4XF4osQ+75+rsG4?= =?us-ascii?Q?L7tndlg4o55xnIQejulqN0jmm1Q6A26ne6xm17qv4kBWHAcERg4MGZZco5Qb?= =?us-ascii?Q?VFEfAIPFHLodE3Tqjp5Ebgp/Iw6uMOKrTRdgstazwEMR7NgN4VTRY5Efjizz?= =?us-ascii?Q?ZsvVGZBsKxkNI6hly/2Fvzs0PtzSYWUyyqG3m2cqelKy7VyiWhROnfGKny+/?= =?us-ascii?Q?zy3aqpVxrEvU2Y+DCi00Bk9hmYlQ2vjZCG81CXVwWtBJuIIhfvu1lUNN+Yki?= =?us-ascii?Q?WA=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: e2364fa5-00ee-4eae-6852-08dcf8bcd360 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2024 08:28:26.5342 (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: XdIIaATtOjXCl2KAHkdE7yzzBFUqylIizXuIV2RkNhKwoWMTTdhlb0PkMTyGSN69hyhNKyx/GTSwKfAYJ0gHCFypMj1oomtxLySCMgJTr3E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR13MB6775 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 Implement the necessary functions to allow user to visually identify a physical port associated with a netdev by blinking an LED on that port. Signed-off-by: James Hershaw Signed-off-by: Chaoyong He --- .../net/nfp/flower/nfp_flower_representor.c | 30 ++++++++++++++++ drivers/net/nfp/nfp_ethdev.c | 2 ++ drivers/net/nfp/nfp_net_common.c | 32 +++++++++++++++++ drivers/net/nfp/nfp_net_common.h | 2 ++ drivers/net/nfp/nfpcore/nfp_nsp.h | 1 + drivers/net/nfp/nfpcore/nfp_nsp_eth.c | 36 +++++++++++++++++++ 6 files changed, 103 insertions(+) diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c index 3d043e052a..01ca8a6768 100644 --- a/drivers/net/nfp/flower/nfp_flower_representor.c +++ b/drivers/net/nfp/flower/nfp_flower_representor.c @@ -88,6 +88,30 @@ nfp_repr_get_module_eeprom(struct rte_eth_dev *dev, return nfp_net_get_module_eeprom(dev, info); } +static int +nfp_flower_repr_led_on(struct rte_eth_dev *dev) +{ + struct nfp_flower_representor *repr; + + repr = dev->data->dev_private; + if (!nfp_flower_repr_is_phy(repr)) + return -EOPNOTSUPP; + + return nfp_net_led_on(dev); +} + +static int +nfp_flower_repr_led_off(struct rte_eth_dev *dev) +{ + struct nfp_flower_representor *repr; + + repr = dev->data->dev_private; + if (!nfp_flower_repr_is_phy(repr)) + return -EOPNOTSUPP; + + return nfp_net_led_off(dev); +} + static int nfp_flower_repr_link_update(struct rte_eth_dev *dev, __rte_unused int wait_to_complete) @@ -623,6 +647,9 @@ static const struct eth_dev_ops nfp_flower_multiple_pf_repr_dev_ops = { .set_eeprom = nfp_repr_set_eeprom, .get_module_info = nfp_repr_get_module_info, .get_module_eeprom = nfp_repr_get_module_eeprom, + + .dev_led_on = nfp_flower_repr_led_on, + .dev_led_off = nfp_flower_repr_led_off, }; static const struct eth_dev_ops nfp_flower_repr_dev_ops = { @@ -661,6 +688,9 @@ static const struct eth_dev_ops nfp_flower_repr_dev_ops = { .set_eeprom = nfp_repr_set_eeprom, .get_module_info = nfp_repr_get_module_info, .get_module_eeprom = nfp_repr_get_module_eeprom, + + .dev_led_on = nfp_flower_repr_led_on, + .dev_led_off = nfp_flower_repr_led_off, }; static uint32_t diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c index 2ee76d309c..f54483822f 100644 --- a/drivers/net/nfp/nfp_ethdev.c +++ b/drivers/net/nfp/nfp_ethdev.c @@ -983,6 +983,8 @@ static const struct eth_dev_ops nfp_net_eth_dev_ops = { .set_eeprom = nfp_net_set_eeprom, .get_module_info = nfp_net_get_module_info, .get_module_eeprom = nfp_net_get_module_eeprom, + .dev_led_on = nfp_net_led_on, + .dev_led_off = nfp_net_led_off, }; static inline void diff --git a/drivers/net/nfp/nfp_net_common.c b/drivers/net/nfp/nfp_net_common.c index a45837353a..e68ce68229 100644 --- a/drivers/net/nfp/nfp_net_common.c +++ b/drivers/net/nfp/nfp_net_common.c @@ -3181,3 +3181,35 @@ nfp_net_get_module_eeprom(struct rte_eth_dev *dev, nfp_nsp_close(nsp); return ret; } + +static int +nfp_net_led_control(struct rte_eth_dev *dev, + bool is_on) +{ + int ret; + uint32_t nfp_idx; + struct nfp_net_hw_priv *hw_priv; + + hw_priv = dev->process_private; + nfp_idx = nfp_net_get_nfp_index(dev); + + ret = nfp_eth_set_idmode(hw_priv->pf_dev->cpp, nfp_idx, is_on); + if (ret < 0) { + PMD_DRV_LOG(ERR, "Set nfp idmode failed."); + return ret; + } + + return 0; +} + +int +nfp_net_led_on(struct rte_eth_dev *dev) +{ + return nfp_net_led_control(dev, true); +} + +int +nfp_net_led_off(struct rte_eth_dev *dev) +{ + return nfp_net_led_control(dev, false); +} diff --git a/drivers/net/nfp/nfp_net_common.h b/drivers/net/nfp/nfp_net_common.h index 5ad698cad2..d85a00a75e 100644 --- a/drivers/net/nfp/nfp_net_common.h +++ b/drivers/net/nfp/nfp_net_common.h @@ -399,6 +399,8 @@ int nfp_net_get_eeprom(struct rte_eth_dev *dev, struct rte_dev_eeprom_info *eepr int nfp_net_set_eeprom(struct rte_eth_dev *dev, struct rte_dev_eeprom_info *eeprom); int nfp_net_get_module_info(struct rte_eth_dev *dev, struct rte_eth_dev_module_info *info); int nfp_net_get_module_eeprom(struct rte_eth_dev *dev, struct rte_dev_eeprom_info *info); +int nfp_net_led_on(struct rte_eth_dev *dev); +int nfp_net_led_off(struct rte_eth_dev *dev); #define NFP_PRIV_TO_APP_FW_NIC(app_fw_priv)\ ((struct nfp_app_fw_nic *)app_fw_priv) diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.h b/drivers/net/nfp/nfpcore/nfp_nsp.h index 0ae10dabfb..6230a84e34 100644 --- a/drivers/net/nfp/nfpcore/nfp_nsp.h +++ b/drivers/net/nfp/nfpcore/nfp_nsp.h @@ -216,6 +216,7 @@ int nfp_eth_set_speed(struct nfp_nsp *nsp, uint32_t speed); int nfp_eth_set_split(struct nfp_nsp *nsp, uint32_t lanes); int nfp_eth_set_tx_pause(struct nfp_nsp *nsp, bool tx_pause); int nfp_eth_set_rx_pause(struct nfp_nsp *nsp, bool rx_pause); +int nfp_eth_set_idmode(struct nfp_cpp *cpp, uint32_t idx, bool is_on); /* NSP static information */ struct nfp_nsp_identify { diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c index 1fcd54656a..404690d05f 100644 --- a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c +++ b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c @@ -44,6 +44,7 @@ #define NSP_ETH_CTRL_SET_LANES RTE_BIT64(5) #define NSP_ETH_CTRL_SET_ANEG RTE_BIT64(6) #define NSP_ETH_CTRL_SET_FEC RTE_BIT64(7) +#define NSP_ETH_CTRL_SET_IDMODE RTE_BIT64(8) #define NSP_ETH_CTRL_SET_TX_PAUSE RTE_BIT64(10) #define NSP_ETH_CTRL_SET_RX_PAUSE RTE_BIT64(11) @@ -736,3 +737,38 @@ nfp_eth_set_rx_pause(struct nfp_nsp *nsp, return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_STATE, NSP_ETH_STATE_RX_PAUSE, rx_pause, NSP_ETH_CTRL_SET_RX_PAUSE); } + +int +nfp_eth_set_idmode(struct nfp_cpp *cpp, + uint32_t idx, + bool is_on) +{ + uint64_t reg; + struct nfp_nsp *nsp; + union eth_table_entry *entries; + + nsp = nfp_eth_config_start(cpp, idx); + if (nsp == NULL) + return -EIO; + + /* + * Older ABI versions did support this feature, however this has only + * been reliable since ABI 32. + */ + if (nfp_nsp_get_abi_ver_minor(nsp) < 32) { + PMD_DRV_LOG(ERR, "Operation only supported on ABI 32 or newer."); + nfp_eth_config_cleanup_end(nsp); + return -ENOTSUP; + } + + entries = nfp_nsp_config_entries(nsp); + + reg = rte_le_to_cpu_64(entries[idx].control); + reg &= ~NSP_ETH_CTRL_SET_IDMODE; + reg |= FIELD_PREP(NSP_ETH_CTRL_SET_IDMODE, is_on); + entries[idx].control = rte_cpu_to_le_64(reg); + + nfp_nsp_config_set_modified(nsp, 1); + + return nfp_eth_config_commit_end(nsp); +} -- 2.43.5