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 4955044077; Mon, 20 May 2024 12:43:07 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7DC7A40A82; Mon, 20 May 2024 12:42:52 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2058.outbound.protection.outlook.com [40.107.220.58]) by mails.dpdk.org (Postfix) with ESMTP id F33A140DC9 for ; Mon, 20 May 2024 12:42:50 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FPe8N5ZMPhrdeeLEndnrYPnv8V6/zWcsDaEHP3SHRX2QYkx6BUY+nPSuf+31xOdSPs7YbY7t+swsC0Tg83/SPQacxUssgwItnAekpmkuh54m97vqOX3UjT54qb4893gewi2iR9rInWwJgLbMv7WmUmuua90INS9QPAxHdsYcLcJdnoNUCCcA7gcOwzOTf5i2OO2aYcnLuDEjrb/f6i/BFIpcpjuJPipcHfMkgKwW/YB/EQVDlT+kT5CXhTg4NwNsWsmXv1ybhs6gjnLmCYqeT6ypDBhYvLI9ouExrBuS/+cek6kHItWL3dbBDDnelc9c3/XtluTyJWGVSEDVPCci9g== 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=E00ZuUpiH/pYow3Mo+DpEFVVQzNjq0PYyWRSIhTrdts=; b=K8sC08YeptcW/qCCYvAVYBTBU1xusJeZIAPZzbK+lwoSucY0s8RLK+Q/cZrsWDqF56B5jUivGM/329ZfZQTTnLFEvSU8r5UIBkiR1Yd8GQruK4i63MSpdvv/zDkA+39hbp9v8u2/0OE3dUdp/eCwv2MaLMCSpVNkH5wgACOTh3URj/qfaigN3uC5GNd7jmQg6Zqw4zHSo7/mfMwSBAFGQrWaPC6b+xTnOZAkNLyaM4k5Ovmo7TszJHh/I8X49rFA2Yn9SIjlCdoCiFAANbASyKcgqxe2dbbdVLJzOM8lICp6XYIed8y21hnF124u3q98wP7DaPa/Xp8iLzVf33Pkjw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=E00ZuUpiH/pYow3Mo+DpEFVVQzNjq0PYyWRSIhTrdts=; b=OJdh7MS3eK/R5dM3o/VgXjqyqgd/NJVqUAN0EWDUzQ1PFzsBCg8/wwnsVfS/ZunExd/8So0QepnhB/AOKsCaO7FFVzkD0J01S5vCR0xNbVF0zJrwNY4s/Nb78aHFpDvOwrkAP0LhQTD4OKw1PGBcFocCI8erNtdpO6kAjBIzp+I= Received: from DM4PR12MB5055.namprd12.prod.outlook.com (2603:10b6:5:39a::20) by CY8PR12MB7123.namprd12.prod.outlook.com (2603:10b6:930:60::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.35; Mon, 20 May 2024 10:42:48 +0000 Received: from DM4PR12MB5055.namprd12.prod.outlook.com ([fe80::acbd:ea93:4496:51a5]) by DM4PR12MB5055.namprd12.prod.outlook.com ([fe80::acbd:ea93:4496:51a5%7]) with mapi id 15.20.7587.035; Mon, 20 May 2024 10:42:48 +0000 From: "Sebastian, Selwin" To: "Ande, Venkat Kumar" , "dev@dpdk.org" Subject: RE: [PATCH v2 17/25] net/axgbe: use definitions for mailbox commands Thread-Topic: [PATCH v2 17/25] net/axgbe: use definitions for mailbox commands Thread-Index: AQHaoHxGetnWvmMhSkyNErwSz4EGpLGgA+3g Date: Mon, 20 May 2024 10:42:48 +0000 Message-ID: References: <20240412125013.10498-1-VenkatKumar.Ande@amd.com> <20240507124305.2318-1-venkatkumar.ande@amd.com> <20240507124305.2318-17-venkatkumar.ande@amd.com> In-Reply-To: <20240507124305.2318-17-venkatkumar.ande@amd.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_dce362fe-1558-4fb5-9f64-8a6240d76441_ActionId=fd952683-65f6-4e86-9517-c98ebd374ed8; MSIP_Label_dce362fe-1558-4fb5-9f64-8a6240d76441_ContentBits=0; MSIP_Label_dce362fe-1558-4fb5-9f64-8a6240d76441_Enabled=true; MSIP_Label_dce362fe-1558-4fb5-9f64-8a6240d76441_Method=Standard; MSIP_Label_dce362fe-1558-4fb5-9f64-8a6240d76441_Name=AMD Internal Distribution Only; MSIP_Label_dce362fe-1558-4fb5-9f64-8a6240d76441_SetDate=2024-05-20T10:42:44Z; MSIP_Label_dce362fe-1558-4fb5-9f64-8a6240d76441_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM4PR12MB5055:EE_|CY8PR12MB7123:EE_ x-ms-office365-filtering-correlation-id: 29a2eb92-8ad1-4ff5-0516-08dc78b99772 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|1800799015|366007|376005|38070700009; x-microsoft-antispam-message-info: =?us-ascii?Q?a4OOIUyuEnAVWX7B/u+kwJ72RrJTeGoRQDS0xmsM70txnftD/u3SaxioKD07?= =?us-ascii?Q?7Bo2n7fPrKF1mIe3a9N35J8EylyV6Efdw2jxfp+aOQfSQm/cGy7ZhVxnyfFI?= =?us-ascii?Q?HCIPmyQcwlYJ9ea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p8zPWJ?= =?us-ascii?Q?LnRLjPwBc7c6eTx53E2+qIVW5oQ2WdBzJS//BYXnkYD5OPnt+QPYyFDW+UQQ?= =?us-ascii?Q?uv+V+bs5SfR7lHUyO2nIxzvVMi4lgTsemomfI2TsM9wdXhTzGAoZLM3u8Cma?= =?us-ascii?Q?7Gw6R5gGqfqGpT5yYArrir9XGfN7DXXWWaJgUP5L0jvPHzVD+CBe4BnNVHZw?= =?us-ascii?Q?zvaWFlINwvImhVmFYMUzi0frsL3J+SUG+7vjshE2b87RQnbiZ19pws0IjNCH?= =?us-ascii?Q?A5v3E3I+UrjrpvviDtB7Ff24Loi6EkVKkArIq4yTJgBYKnnuu1KIOTZAwR0X?= =?us-ascii?Q?LtaDCn0CrifW3rADHFxjycD2P6w1ZAGJFtQdTuPJRHbYkg=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR12MB5055.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(1800799015)(366007)(376005)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?UrtyjUsjOFpFDGC36dHSdd/bjmpkpNN5UAMS+EsTTAYjZDCFmWbyy20b580q?= =?us-ascii?Q?iS6ZNKSM9NY/MoPIemPUtekfsj4PioPEEJna0R7JoFaMTMcKmbXxBQuUPVU+?= =?us-ascii?Q?HnjjnDQNwFK4Ujb+5X7Gm0/LhTIh/JDac5vgAr/vEVQ9fhUci3h4E6adbfHK?= =?us-ascii?Q?LQsLyzV3z2k+cLhs3Bdrxz9n1YGC8vInF3+IMzhMN9gaV1BWRyfmJwTp9cfO?= =?us-ascii?Q?VB8Jexx8KP6dwZcyKeTqWwLbBKQdCXSk8dOf1AKBM+pZq3Zo3lmvJxxhtYkW?= =?us-ascii?Q?nyv8sjkJM/03MQOnBuQ0JIqOdLAPZhd0+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ii?Q?hZl/mxj68rJ/isy4cNIt3Sl5Eb7FMABjz++8MAiNiUJdlE0aRAECztyMimGT?= =?us-ascii?Q?iUxmRjVzHG4EZTrzdH2+egKnerAnWgGopR3kpBujRnhCXg/F3/KaCSNrZfTy?= =?us-ascii?Q?2P9IgfXFIXsYuOHVN8GfiwBtHMfPPkHaTlI0LHvSsgZX4QA5mHwq6z1az/ad?= =?us-ascii?Q?UmMH5mjRf6aVbhwR+JwubvnxME9ZUHDi4svMYk8j1L9zG9BGdzpUKXuW9lIM?= =?us-ascii?Q?USeRrFVJPdwTyIB66kCGbdNPZ/UdHOmW8g9tllT3MdSRJJOr5EHBBPJ6jmeN?= =?us-ascii?Q?KKpy5i40odyyzMVx54heNn99Kf6MSQmc1m+m5aRv8MwC4mY6UVFLXksR0EIn?= =?us-ascii?Q?vip6/kSecDDh6avLrrKzualH9ZyFjERxwyXtN1ZZ?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5055.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 29a2eb92-8ad1-4ff5-0516-08dc78b99772 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 May 2024 10:42:48.4298 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Lq8Qh7RmIgMO1T422ik89F627rMfI09yFDMCoaZYGPa2lBbKouy+iVdw+arOJYlCmAF+I+SNPbe7V40tW0Tvcw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7123 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 [AMD Official Use Only - AMD Internal Distribution Only] Acked-by: Selwin Sebastian -----Original Message----- From: Ande, Venkat Kumar Sent: Tuesday, May 7, 2024 6:13 PM To: dev@dpdk.org Cc: Sebastian, Selwin ; Ande, Venkat Kumar Subject: [PATCH v2 17/25] net/axgbe: use definitions for mailbox commands Instead of using hardcoded values, use enumerations for mailbox command and= sub commands. Signed-off-by: Venkat Kumar Ande --- drivers/net/axgbe/axgbe_ethdev.h | 25 +++++++++++++++++++++++++ drivers/net/axgbe/axgbe_phy_impl.c | 25 +++++++++++++++---------- 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/drivers/net/axgbe/axgbe_ethdev.h b/drivers/net/axgbe/axgbe_eth= dev.h index b9d8a4e74f..6dc1c1274b 100644 --- a/drivers/net/axgbe/axgbe_ethdev.h +++ b/drivers/net/axgbe/axgbe_ethdev.h @@ -231,6 +231,31 @@ enum axgbe_mdio_mode { AXGBE_MDIO_MODE_CL45, }; +enum axgbe_mb_cmd { + AXGBE_MB_CMD_POWER_OFF =3D 0, + AXGBE_MB_CMD_SET_1G, + AXGBE_MB_CMD_SET_2_5G, + AXGBE_MB_CMD_SET_10G_SFI, + AXGBE_MB_CMD_SET_10G_KR, + AXGBE_MB_CMD_RRC +}; + +enum axgbe_mb_subcmd { + AXGBE_MB_SUBCMD_NONE =3D 0, + + /* 10GbE SFP subcommands */ + AXGBE_MB_SUBCMD_ACTIVE =3D 0, + AXGBE_MB_SUBCMD_PASSIVE_1M, + AXGBE_MB_SUBCMD_PASSIVE_3M, + AXGBE_MB_SUBCMD_PASSIVE_OTHER, + + /* 1GbE Mode subcommands */ + AXGBE_MB_SUBCMD_10MBITS =3D 0, + AXGBE_MB_SUBCMD_100MBITS, + AXGBE_MB_SUBCMD_1G_SGMII, + AXGBE_MB_SUBCMD_1G_KX +}; + struct axgbe_phy { uint32_t supported; uint32_t advertising; diff --git a/drivers/net/axgbe/axgbe_phy_impl.c b/drivers/net/axgbe/axgbe_p= hy_impl.c index 2620d44dfb..67a18e7c55 100644 --- a/drivers/net/axgbe/axgbe_phy_impl.c +++ b/drivers/net/axgbe/axgbe_phy_impl.c @@ -1219,7 +1219,7 @@ static void axgbe_phy_pll_ctrl(struct axgbe_port *pda= ta, bool enable) } static void axgbe_phy_perform_ratechange(struct axgbe_port *pdata, - unsigned int cmd, unsigned int sub_= cmd) + enum axgbe_mb_cmd cmd, enum axgbe_mb_subcmd sub_cmd) { unsigned int s0 =3D 0; unsigned int wait; @@ -1266,7 +1266,7 @@ static void axgbe_phy_rrc(struct axgbe_port *pdata) /* Receiver Reset Cycle */ - axgbe_phy_perform_ratechange(pdata, 5, 0); + axgbe_phy_perform_ratechange(pdata, AXGBE_MB_CMD_RRC, +AXGBE_MB_SUBCMD_NONE); PMD_DRV_LOG(DEBUG, "receiver reset complete\n"); } @@ -1276,7 +127= 6,7 @@ static void axgbe_phy_power_off(struct axgbe_port *pdata) struct axgbe_phy_data *phy_data =3D pdata->phy_data; /* Power off */ - axgbe_phy_perform_ratechange(pdata, 0, 0); + axgbe_phy_perform_ratechange(pdata, AXGBE_MB_CMD_POWER_OFF, +AXGBE_MB_SUBCMD_NONE); phy_data->cur_mode =3D AXGBE_MODE_UNKNOWN; @@ -1291,14 +1291,18 @@ static void axgbe_phy_sfi_mode(struct axgbe_port *p= data) /* 10G/SFI */ if (phy_data->sfp_cable !=3D AXGBE_SFP_CABLE_PASSIVE) { - axgbe_phy_perform_ratechange(pdata, 3, 0); + axgbe_phy_perform_ratechange(pdata, AXGBE_MB_CMD_SET_10G_SF= I, + AXGBE_MB_SUBCMD_ACT= IVE); } else { if (phy_data->sfp_cable_len <=3D 1) - axgbe_phy_perform_ratechange(pdata, 3, 1); + axgbe_phy_perform_ratechange(pdata, AXGBE_MB_CMD_SE= T_10G_SFI, + AXGBE_MB_SUBCMD_PAS= SIVE_1M); else if (phy_data->sfp_cable_len <=3D 3) - axgbe_phy_perform_ratechange(pdata, 3, 2); + axgbe_phy_perform_ratechange(pdata, AXGBE_MB_CMD_SE= T_10G_SFI, + AXGBE_MB_SUBCMD_PAS= SIVE_3M); else - axgbe_phy_perform_ratechange(pdata, 3, 3); + axgbe_phy_perform_ratechange(pdata, AXGBE_MB_CMD_SE= T_10G_SFI, + AXGBE_MB_SUBCMD_PAS= SIVE_OTHER); } phy_data->cur_mode =3D AXGBE_MODE_SFI; @@ -1313,7 +1317,8 @@ static void axgbe_phy_kr_mode(struct axgbe_port *pdat= a) axgbe_phy_set_redrv_mode(pdata); /* 10G/KR */ - axgbe_phy_perform_ratechange(pdata, 4, 0); + axgbe_phy_perform_ratechange(pdata, AXGBE_MB_CMD_SET_10G_KR= , + AXGBE_MB_SUBCMD_NONE); phy_data->cur_mode =3D AXGBE_MODE_KR; PMD_DRV_LOG(DEBUG, "10GbE KR mode set\n"); @@ -1326,7 +1331,7 @@ st= atic void axgbe_phy_kx_2500_mode(struct axgbe_port *pdata) axgbe_phy_set_redrv_mode(pdata); /* 2.5G/KX */ - axgbe_phy_perform_ratechange(pdata, 2, 0); + axgbe_phy_perform_ratechange(pdata, AXGBE_MB_CMD_SET_2_5G, +AXGBE_MB_SUBCMD_NONE); phy_data->cur_mode =3D AXGBE_MODE_KX_2500; } @@ -1337,7 +1342,7 @@ static void axgbe_phy_sgmii_1000_mode(struct axgbe_po= rt *pdata) axgbe_phy_set_redrv_mode(pdata); /* 1G/SGMII */ - axgbe_phy_perform_ratechange(pdata, 1, 2); + axgbe_phy_perform_ratechange(pdata, AXGBE_MB_CMD_SET_1G, +AXGBE_MB_SUBCMD_1G_SGMII); phy_data->cur_mode =3D AXGBE_MODE_SGMII_1000; } -- 2.34.1