From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7D419A0A00; Wed, 30 Dec 2020 13:41:30 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A5D362B8E; Wed, 30 Dec 2020 13:41:28 +0100 (CET) Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-eopbgr750078.outbound.protection.outlook.com [40.107.75.78]) by dpdk.org (Postfix) with ESMTP id E0A102B8C for ; Wed, 30 Dec 2020 13:41:25 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j6tmNnkapIVPqMu0C0v3Z3p1TbprcK+P9DX9SZPfs72jsbiSTbC9l9/iuMx8WF+mdBHLzoJY7jWCMuN1BR9ac56aaiBx1i9y8xp06ws693BT1e08zxGaaORpDW+bb7Pa/Z3peLzw6xsE4DAo6CPSAxmn6POx3HCjbgtPOs1n3HiBozi9xQVJKccXzJyB1tTarPX57ewXi2oe4h1SO1QqUDa55CSBXMQceZqtNdPSvD2vqf5yGNzg7nfWx9DETwIA06dNVtXni85Lhu8WUlpab50jXFX9ABZJ2RUpzBX1Zq1TPXZ38h4Xym1ec7sFyKNQgFZH2q8yi/jJt2KHHBk5XQ== 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-SenderADCheck; bh=rW8Bsu8rNYnyLAUu1PVSKZaJB0wcTma/lfG7ihlc9pM=; b=Qq3mvgeqAqOC43vujRDyh1WRZfuHrvuBypjo/dxMiNq8WOekwnyegLHjxgkPjlnacheEt2gyjkD+aQ6+KJWzg0pMYNTMVFqjTIk2R1ilAxf05QYVmvkc7N0CUWsSAsgG+g0x+28IMywCLzFBWs8sD6C2zdwcMDbZW/DcReicY9jMtjIHGmc11pq+lb9KffBRDRMlcnbNOLLsVNWXAa2mr1YRdc6dre74O0KF/m8DJq6BbTqN3bAI9JXJcM4X0T+qYNafPk/HQxDP8z+k4/ApfRp7kqN+zvWe1PJ+C3tuCTK7NR5ib30cCHa8HwtpozKWc4BY34pmcG2RckNdkeB8Vw== 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=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rW8Bsu8rNYnyLAUu1PVSKZaJB0wcTma/lfG7ihlc9pM=; b=xTStmz/QOvErkl4Qz9OGnRrUmQBXBV9lQCDNCnOcnewWMp/M/fFyA1J7dTxh9ZpW5I3gyql3JvFXImvja1t/YkF1bZdq/qSbmxqRXfu3ibZJX0TJ7GcU5KzSls9hOPMwkp9+DsdITGAHWe1gl80gavKTH3iHSAZItfhB/h06Otc= Received: from BYAPR12MB2821.namprd12.prod.outlook.com (2603:10b6:a03:9b::30) by BYAPR12MB2598.namprd12.prod.outlook.com (2603:10b6:a03:6a::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3700.27; Wed, 30 Dec 2020 12:41:23 +0000 Received: from BYAPR12MB2821.namprd12.prod.outlook.com ([fe80::c9e:efb6:8cd1:5a6d]) by BYAPR12MB2821.namprd12.prod.outlook.com ([fe80::c9e:efb6:8cd1:5a6d%4]) with mapi id 15.20.3700.031; Wed, 30 Dec 2020 12:41:22 +0000 From: "Somalapuram, Amaranath" To: "Sebastian, Selwin" , "dev@dpdk.org" CC: "ferruh.yigit@intel.com" Thread-Topic: [PATCH v2] net/axgbe: add support for reading FW version Thread-Index: AQHW3bGlRSZBQisEika5rHCGSu07ZaoPlmOw Date: Wed, 30 Dec 2020 12:41:22 +0000 Message-ID: References: <12017189-0d86-2cea-8f65-f38dc57a8120@intel.com> <20201229070947.14073-1-selwin.sebastian@amd.com> In-Reply-To: <20201229070947.14073-1-selwin.sebastian@amd.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f2ed062d-8486-4f50-a4f1-3cce0dd00d64_ActionId=f96cb5c9-889d-4477-89f0-095cdca4f2a9; MSIP_Label_f2ed062d-8486-4f50-a4f1-3cce0dd00d64_ContentBits=0; MSIP_Label_f2ed062d-8486-4f50-a4f1-3cce0dd00d64_Enabled=true; MSIP_Label_f2ed062d-8486-4f50-a4f1-3cce0dd00d64_Method=Privileged; MSIP_Label_f2ed062d-8486-4f50-a4f1-3cce0dd00d64_Name=Non-Business; MSIP_Label_f2ed062d-8486-4f50-a4f1-3cce0dd00d64_SetDate=2020-12-30T12:40:56Z; MSIP_Label_f2ed062d-8486-4f50-a4f1-3cce0dd00d64_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; dlp-product: dlpe-windows dlp-version: 11.5.0.60 dlp-reaction: no-action authentication-results: amd.com; dkim=none (message not signed) header.d=none;amd.com; dmarc=none action=none header.from=amd.com; x-originating-ip: [2405:201:d005:904d:cca:7366:81da:7c98] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: c1c207d8-ab6c-4570-3c28-08d8acc03707 x-ms-traffictypediagnostic: BYAPR12MB2598: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2449; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: nI7UjZEjqOiqGcjQ623tdRdvFNVCfF0FxIjr8Vg8ZI1GE0yD45Xlx623ZYFlPR0uEG/Bc5A5ynqi8nXsM8pShBrWH12QPrE/uKJiz8HuwNdmCAw/AUTkv9Q3ZGkBi/EIUi70BLw7jTrKSmGFh8FNyeYX4kniEwJ7K30WGcO/Wnen+M0dmP6hCbQJ5wes3vfl/9AFcq6+bYvlGGwBHkoGiq2as9A3veBO1xQJ72x+emC7aCv7wa4/1dUJLbxv3PdjVl4KFcYPRT0L3fwt2DP8oI+Ov6p1pKO4PqfnTg5w9MwvTupY/MEK0X4c5rPmEYOv3lm2OAhPEGoiCG0YnbXWemkerm06F6crLxyNNWtgrsJPWcTNOtFJoWYn6BsAMnEKymvlXtDRjI1O2lVtTZQ4VA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR12MB2821.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(366004)(346002)(396003)(39860400002)(376002)(66946007)(64756008)(66446008)(2906002)(9686003)(7696005)(53546011)(33656002)(66556008)(71200400001)(86362001)(110136005)(55016002)(4326008)(6506007)(316002)(478600001)(5660300002)(8936002)(76116006)(66476007)(52536014)(8676002)(83380400001)(186003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?6z76ZQeAhqqq6VKMkS26V3qIkyRrBNOH8uTUrML3+7Y0TJJKKYuJj9Tuwupm?= =?us-ascii?Q?DmaPFv5oOJ1ms6ANGObWf+P91sp8UtsPfGi4ynG1Yk8/L3HKQCFApkikIlaU?= =?us-ascii?Q?yOzyBE/ATBzlDbOlPuM/wjLvCiZGxYwxtqnwHQVSDHFRi8+6KLqk9YyT88Ui?= =?us-ascii?Q?/pnGIM0F/nUDV53faP3f5v+YzcJmT80YpvEUmj3di/p7IIBvOaxc9cN1PwJ4?= =?us-ascii?Q?0T+bJckwDJMOn6+d8A4CPA34AzfVgKF2YgkgPeh15joGlhK9HDDknX72FFDP?= =?us-ascii?Q?BdP2oB/4e7hk09HUUb9Aixy9a9ousCrGx5CkvCYagIMPOcojoFl8z3CJojM1?= =?us-ascii?Q?oBKZvBQAiM4XKTonSsY7noKXzy5TZcXivdeVXTkx4Q41ZXaiDNtnE47ecWDO?= =?us-ascii?Q?Tmq0FtUwYiq359KFUX+WqXS7TcX8s6Vm5XyILQji2d1O6YSag4eZ7XgCiOM7?= =?us-ascii?Q?5KTSHrYdcKkob+CWCRsSzixGhnQ3z0yGRXJN+h+xV84s5ij3/G8+jiIgHN4L?= =?us-ascii?Q?Y7/rANh0k/sxBV0vw4o6VDn7LMhuJ/7o1xV8N8x7FaNNIQMeFca7qSFMUxso?= =?us-ascii?Q?FG4nkaL8FdgXWYtD1FMxfHXXmME3SHgkGCys7HkDkhIuhwY058sBV1HzozL3?= =?us-ascii?Q?A6kT4CreMltEIXopnsvdnf0fo3tpxZxudQy5svah7VNMUc8K0uiZaiZ2mfP1?= =?us-ascii?Q?YD60YTzKSN6B93n2mzP+wOz7RO0UPibEOg0P8F8MtTxbuToi8j3hT9dMOatC?= =?us-ascii?Q?efJOx7/HkMB6B+etRar8/dILj+uiReFzqcT3rg9KOtV8rGauTM1dA1aocShi?= =?us-ascii?Q?QZnt4Wh3bSyo7S6RMXn4yoGT8ilvazOyx8diA8JGoHMbMwQh+JIsM6IwQCyq?= =?us-ascii?Q?vhg8ULPTrL36W6LL0UqgrgCA7+Glk0VLd7HsV3PEBrLLOHlgTsU7tYVQSvUO?= =?us-ascii?Q?PVXLRvghhTfBv8IUjT1Lf/7vDDvH9l3AiJsUOE93FyDCY08ZjqIBuUQ7j4j5?= =?us-ascii?Q?LkUcxgB/560jovxCGFHu1YH2JDsYlqYgKNMzCTd1n/p5iYA=3D?= 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: BYAPR12MB2821.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c1c207d8-ab6c-4570-3c28-08d8acc03707 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Dec 2020 12:41:22.8165 (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: j+JE7CzBe1g57lzxLUALXp3z4SzoDzhvmBtVV50nZolxkbOmosUvAj41Jq7cDSVkkxoZ56xh4IOcXc3tEdKjeQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB2598 Subject: Re: [dpdk-dev] [PATCH v2] net/axgbe: add support for reading FW version X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" -----Original Message----- From: Sebastian, Selwin =20 Sent: Tuesday, December 29, 2020 12:40 PM To: dev@dpdk.org Cc: Somalapuram, Amaranath ; ferruh.yigit@in= tel.com Subject: [PATCH v2] net/axgbe: add support for reading FW version From: Selwin Sebastian Added support for fw_version_get API Signed-off-by: Selwin Sebastian --- doc/guides/nics/features/axgbe.ini | 1 + drivers/net/axgbe/axgbe_ethdev.c | 1 + drivers/net/axgbe/axgbe_rxtx.c | 25 +++++++++++++++++++++++++ drivers/net/axgbe/axgbe_rxtx.h | 3 +++ 4 files changed, 30 insertions(+) diff --git a/doc/guides/nics/features/axgbe.ini b/doc/guides/nics/features/= axgbe.ini index 34df0d1ee..3adc5639f 100644 --- a/doc/guides/nics/features/axgbe.ini +++ b/doc/guides/nics/features/axgbe.ini @@ -17,6 +17,7 @@ CRC offload =3D Y L3 checksum offload =3D Y L4 checksum offload =3D Y Basic stats =3D Y +FW version =3D Y Linux UIO =3D Y x86-32 =3D Y x86-64 =3D Y diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_eth= dev.c index cfe6aba73..1982c6a8e 100644 --- a/drivers/net/axgbe/axgbe_ethdev.c +++ b/drivers/net/axgbe/axgbe_ethdev.c @@ -257,6 +257,7 @@ static const struct eth_dev_ops axgbe_eth_dev_ops =3D { .timesync_adjust_time =3D axgbe_timesync_adjust_time, .timesync_read_time =3D axgbe_timesync_read_time, .timesync_write_time =3D axgbe_timesync_write_time, + .fw_version_get =3D axgbe_dev_fw_version_get, }; =20 static int axgbe_phy_reset(struct axgbe_port *pdata) diff --git a/drivers/= net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.c index 032e3cebc..32= 98a294e 100644 --- a/drivers/net/axgbe/axgbe_rxtx.c +++ b/drivers/net/axgbe/axgbe_rxtx.c @@ -571,6 +571,31 @@ int axgbe_dev_tx_queue_setup(struct rte_eth_dev *dev, = uint16_t queue_idx, return 0; } =20 +int axgbe_dev_fw_version_get(struct rte_eth_dev *eth_dev, + char *fw_version, size_t fw_size) +{ + struct axgbe_port *pdata; + struct axgbe_hw_features *hw_feat; + int ret; + + pdata =3D (struct axgbe_port *)eth_dev->data->dev_private; + hw_feat =3D &pdata->hw_feat; + + if (fw_version =3D=3D NULL || fw_size <=3D 0) + return -EINVAL; + + ret =3D snprintf(fw_version, fw_size, "%d.%d.%d", + AXGMAC_GET_BITS(hw_feat->version, MAC_VR, USERVER), + AXGMAC_GET_BITS(hw_feat->version, MAC_VR, DEVID), + AXGMAC_GET_BITS(hw_feat->version, MAC_VR, SNPSVER)); + ret +=3D 1; /* add the size of '\0' */ + + if (fw_size < (u32)ret) + return ret; + else + return 0; +} + static void axgbe_txq_prepare_tx_stop(struct axgbe_port *pdata, unsigned int queue) { diff --git a/drivers/net/axgbe/axgbe_rxtx.h b/drivers/net/axgbe/axgbe_rxtx.= h index f2fbe9299..c2b11bb0e 100644 --- a/drivers/net/axgbe/axgbe_rxtx.h +++ b/drivers/net/axgbe/axgbe_rxtx.h @@ -162,6 +162,9 @@ void axgbe_dev_disable_tx(struct rte_eth_dev *dev); in= t axgbe_dev_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id); = int axgbe_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id)= ; =20 +int axgbe_dev_fw_version_get(struct rte_eth_dev *eth_dev, + char *fw_version, size_t fw_size); + uint16_t axgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts); uint16_t axgbe_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts, -- 2.17.1 Acked-by: Somalapuram Amaranath