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 65FC4A04DD; Thu, 19 Nov 2020 12:35:37 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3B2E3DED; Thu, 19 Nov 2020 12:35:36 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-eopbgr770089.outbound.protection.outlook.com [40.107.77.89]) by dpdk.org (Postfix) with ESMTP id 6BF9C3B5 for ; Thu, 19 Nov 2020 12:35:33 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VBEaK7WlruA1KwaODC8DdoonoS1Si/cLWCYSWWXwQaLWy4QqEP+VZm+2mR4jHKII79xl0XJqkGFxkll1P52OUrcLvjkBWj2O3IemJdgXJ22wfeqvmgGc1SIQiAmdQehG/tTQCHKaV+CUEm9EY/nr5XM5LS9HdWolgjVBBT7IVLFDdIWc/JNRSWDjwDNfEeMKV9Z7C6LgCX9XW2M0qMtWXdyP5eISm0VyVYAJ70/MXLEFRYYEnLq+TPYbh9g3gv0TN0bW2oLcH3IucDXnEjHqQIazFMwK6viONKnL4jK7uoq9ej6sDeYrs79nT8+KkB1SYqYOVCZ/cgJ/klCfgfwIAA== 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=mBEWMhjXho1vKVZNuuzg/9ekmt/zsAYnH3dbomvUxLw=; b=jCOwC/whxlH2iBqsaU5eL+asXRrQK3dZk12xk33T+vOFejAxr/DA/IwfK9SIFvG5zEDzFNofqtlRX61/rY4uk0BhL58FHD4V8nVprqzJBT1xsHiJKg46Qtl3t3BQLtTLQ2avOJKbgmZc6h44np3jdzn8IJ9XtOVUyPTXAITVh0nsgZm2G0BCIwLJn1+imaLh5tDlAoq16hGGD6sxrx63lSHQ1tAgUNTveCViFcYE3YzzOHVBHeAP4u/2HRf6ohPvyATTlwTmh9ZsQutj0Nec1PKgPeR4dLXmiNLARIK45gRSqbDVDxy/sox/Ixoe8hoc+Hw8K3wCpC8qT7ILA2GKbw== 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=mBEWMhjXho1vKVZNuuzg/9ekmt/zsAYnH3dbomvUxLw=; b=T6G7QO+AqIci6+GvWptyRmGfQ9jL2szz6gNS8QCIS61JdFJBlWTC6f9NmKTxJPeONuf4CooHjDgGWSsh7fg4xrL/faHEsrVnzBhv1GVLBelneAJkPJKdQKe77hnxPesYZgQPAktHZE0HkZKA55SyWYhSUPIESXom2tZvikQp8zc= Received: from BYAPR12MB2821.namprd12.prod.outlook.com (2603:10b6:a03:9b::30) by BYAPR12MB3383.namprd12.prod.outlook.com (2603:10b6:a03:dc::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3541.22; Thu, 19 Nov 2020 11:35:31 +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.3589.022; Thu, 19 Nov 2020 11:35:31 +0000 From: "Somalapuram, Amaranath" To: "Sebastian, Selwin" , "dev@dpdk.org" , Ferruh Yigit Thread-Topic: [dpdk-dev] [PATCH v1] net/axgbe: add support for reading FW version Thread-Index: AQHWvkVQIsTwAZbBYUW+mSSPpIK/M6nPUQbAgAABjPA= Date: Thu, 19 Nov 2020 11:35:30 +0000 Message-ID: References: <20201119072607.5717-1-selwin.sebastian@amd.com> In-Reply-To: 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=e165e172-1efd-4b0d-86a5-688accb7950a; 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-11-19T11:34:38Z; MSIP_Label_f2ed062d-8486-4f50-a4f1-3cce0dd00d64_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; 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: [165.204.159.242] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: c7c357cb-b0b3-41a5-e877-08d88c7f388b x-ms-traffictypediagnostic: BYAPR12MB3383: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:962; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: R7+G1/E7YlliHSA8K2YJYOCr+DrjbCzU1ms3vhmon+BCdqEUU4y87QFcK6mgoJoDUBUIBtlxkizUhnj77BTE+mXIf8KllEc+JHsbUCTV3qApx1oqN8JXxdMvWY7BMPoLHChdxD8YPIFPiEvRHNX92EMAvrdiLJnuuog3RWi8XGT4W801p4arvyr/dOqUY3b8mz72yLaCIjUTjXePtcUEG6Jp/utu1Pe3RLAykpUNf5HPQ4G1vx2tQTuIP+zFBBhmNdz7i0Zv0svw9rp9aPrhCl1n1EE1et6q24/HZOI/nKAFsTMbAyW6czCDQ9Zy6uMoLUESWpxL2HjwwfIczmVo2A== 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)(39860400002)(366004)(396003)(136003)(376002)(346002)(186003)(8936002)(7696005)(53546011)(6506007)(316002)(2906002)(55016002)(110136005)(8676002)(9686003)(478600001)(52536014)(83380400001)(86362001)(26005)(66446008)(66946007)(66556008)(33656002)(66476007)(71200400001)(76116006)(64756008)(5660300002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: 5Jgs5COXIRc+wnavRk7mmnUrI28QowOv7iKpGiyJoF15u6Xa2DMGKVDlyZKpyX62sAf9uNA311+Er3lDAhVtqZ3FgUWALXCwhG1uJTH3gAVeZZSwWoJoT1/RM4he+DqjE2jX43yziyb+eOUgzKEdka2MtWOjNEZswDoaLcw2iyyPwbPT6QZpTIVmgUeYgCcxhf17DwlUNOatTj5A3f++73g4UzDfsBjiquScUvNTv+GBbu9mNYvnWHiocLaXuJ4NcEW+eBZAE4Q0agzQHpcJXAQvhSzarY4yY5P/bO7Bd03mGoXcJW+YRjVSdr/9y36RoUprzeXvsBzlueleN3GIMOxOBw/FVuDwMiMGtwJyVV8rd8/p/1keG4PLSveZccK2zGaZynh2/IwdauO0ms62JKxbODlkmLxbzb+nBGpnJZ5QOw1RMN6xUWnJIAlNfe+amW/3IHMHoTy4sefhsF26vmZaJxI+T045j4rQyNllUYJPWFndYuuEA/Nh/X72k/2kMZRyMHJMv/GuKf4IYfWSMW8+IA0nzo+iU/mG7T6IBx1oYJWAC7L90/eDnk+EtQhrAOQcQjgFfe5RTFjlJlHDHnBwIVrjfbuJZhnu4GHzqmBOASkFBNu/nFLTukmKIw7gL+h82oBHsJZPqnjzTiJxvw== 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: c7c357cb-b0b3-41a5-e877-08d88c7f388b X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Nov 2020 11:35:30.9823 (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: VoctDgzXvErq+fP3S8FvAehhs+HUdeNxrHdZMQ0Jehk0ptHrP7NxF6dNG6/SYwIReR8o8Tp1Tnix6YnKbOB/tg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB3383 Subject: Re: [dpdk-dev] [PATCH v1] 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: Thursday, November 19, 2020 4:56 PM To: Sebastian, Selwin ; dev@dpdk.org Cc: Somalapuram, Amaranath Subject: RE: [dpdk-dev] [PATCH v1] net/axgbe: add support for reading FW ve= rsion [AMD Official Use Only - Internal Distribution Only] +Amar -----Original Message----- From: dev On Behalf Of selwin.sebastian@amd.com Sent: Thursday, November 19, 2020 12:56 PM To: dev@dpdk.org Subject: [dpdk-dev] [PATCH v1] net/axgbe: add support for reading FW versio= n [CAUTION: External Email] 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 | 21 +++++++++++++++++++++ drivers/net/axgbe/axgbe_rxtx.h | 3 +++ 4 files changed, 26 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, }; 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..22= 7be33fa 100644 --- a/drivers/net/axgbe/axgbe_rxtx.c +++ b/drivers/net/axgbe/axgbe_rxtx.c @@ -571,6 +571,27 @@ int axgbe_dev_tx_queue_setup(struct rte_eth_dev *dev, = uint16_t queue_idx, return 0; } +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; + char fw_ver[32]; + + 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; + + snprintf(fw_version, sizeof(fw_ver), "%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,=20 + SNPSVER)); + + return 0; +} + static void axgbe_txq_prepare_tx_stop(struct axgbe_port *pdata, unsigned int queue) { diff --git a/d= rivers/net/axgbe/axgbe_rxtx.h b/drivers/net/axgbe/axgbe_rxtx.h index f2fbe9= 299..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)= ; +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(v= oid *tx_queue, struct rte_mbuf **tx_pkts, -- 2.17.1 Acked-by: Amaranath Somalapuram