From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (xvm-189-124.dc0.ghst.net [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D728AA0524; Thu, 7 Jan 2021 11:44:57 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 57042140F25; Thu, 7 Jan 2021 11:44:57 +0100 (CET) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam08on2052.outbound.protection.outlook.com [40.107.102.52]) by mails.dpdk.org (Postfix) with ESMTP id AE004140F1C for ; Thu, 7 Jan 2021 11:44:55 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fILF+ntFq5o932q2933579efwfG9T44TqBz01x0cH38NQfcRqVTXaMdEGKcasxFYTBZi99F+o+MjhNu1/+CwL83ISxZdJUTf6KylZBkNYVEBSUWamZD0prJsCVutRoJYxOamtD7NGAjVV/QXlV6RhBJHrcwb9hIxIEwrVRcjHsBX2bN+Jjrpui2QmM5/xP7newswkSXLijsEoJs6MQ7JcNPIB2PUokzlrPQyLVBuBQr9WDS5JMraA/Iv6lUWmMpunW1AUy+hI1h+HsTyjNoJ9jMbuVICxZe6fAOXAEzkJGS8Nomjme1qcIGOEoIptR0NXVq9/PMoWltG7GN/ili4NA== 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=QeDpjTypHB8KPONXgARcA4dHc37XkMzGwaTHHeH1wFY=; b=IS50DEO4Sv6YrM6H3+RBC8rw4rFQDTOoh4DGoNGJz7+yHO7XcpIla7wQ+/HRlf8VGr0zZHCfwFd1MxxkgMgRdpyPLEs9DxCpcvUQVwr8cFdY88nBbihcPw2nY2D8ntQejF3msRV/DhXt5zY1fg9cmW6iwTwCiVaZcIUIiPW2HvQdxjsUZrx/D7tBhCHaxO7Tq7VCjITd4UobZsViivPEPyuIJDAevwSpw3Yw2kCr0HrWYd+JMBjaenO8+/TBi62/A2aUMBjjngYGTQL6ZVAmXP0wMqY5HT5WBPGTwhxxrTyyLur7mh4cpciyroOCLaOeXjBxcEk75Bghb2z695FrKQ== 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=QeDpjTypHB8KPONXgARcA4dHc37XkMzGwaTHHeH1wFY=; b=dIwKTNQ7zsmxX3FWx2xXd5mcJUT0gTa6hZ89ujCdl6kRRvf5Vxse7eAbSs58OxVIkRrQrb3+1QHvj8368frsnwrjoSltDRvNpct9EO0ikgGOq1JNCH2WPC1E5pL4/BW0QEV7rNwTMT9xHMpqzr7gZ8MkBjH2kElu8gJRuUxpWVM= Received: from BYAPR12MB2821.namprd12.prod.outlook.com (2603:10b6:a03:9b::30) by BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.20; Thu, 7 Jan 2021 10:44:53 +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.3742.006; Thu, 7 Jan 2021 10:44:53 +0000 From: "Somalapuram, Amaranath" To: "Sebastian, Selwin" , "dev@dpdk.org" CC: "ferruh.yigit@intel.com" Thread-Topic: [PATCH v3] net/axgbe: add support for reading FW version Thread-Index: AQHW5AIdSybBXr+IpUqGUTkFG4T+Sqob++Ig Date: Thu, 7 Jan 2021 10:44:53 +0000 Message-ID: References: <20210106080058.24163-1-selwin.sebastian@amd.com> In-Reply-To: <20210106080058.24163-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=a863878a-a9f2-46c3-b371-f200094be247; 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=2021-01-07T10:44:39Z; 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:5c8a:c107:e270:5e97] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: ccc934c1-0d74-482d-6f3c-08d8b2f94478 x-ms-traffictypediagnostic: BY5PR12MB4130: 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: 3H/9+OeT+NYAFQuDwHoP+LSEJGR2xciRudzsyYx8bTMNy5ZxaIEYkSwsogBhcVTp34aine8dlEPwy96AzeaHXUHFE1WW4UTaqiPmYrBHgSkY3By3SvakDYxhedDNnSlndEYJH0ie8msyzaF6tE6wEJLKxizNdJYPCJjyKOEF3/Z2fdjUJJBYY2SNnZqZdIlflmLc1h6XLCJh8WnFPXFOqdOCoEZH4KgzI0bi/NrC1urDcWHY7heFjp0LOLuvEaL0A6JxwFdzzstbFFGSbz+ADtdBAkT+InOhxqpRrU0VzGOifeNNXRwnUcMp5Q+Ne4CbYy1K8ACHdjN8I4lbQ76eSB4OeN0hnRwbUugEfuB74jjf/h3UKZcU1fSdV8rJLioxhDV8Jt5iU9LIATl9jAgq5A== 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)(366004)(39860400002)(346002)(136003)(396003)(376002)(66946007)(76116006)(9686003)(71200400001)(83380400001)(33656002)(66476007)(6506007)(53546011)(110136005)(52536014)(66446008)(478600001)(66556008)(5660300002)(186003)(55016002)(4326008)(64756008)(7696005)(2906002)(86362001)(8676002)(8936002)(316002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?kOge5vidfmYfEc5wUkTxG6uSm+4Jz5BprGfeuYJaugnjYWSNL4gxExnkTIsv?= =?us-ascii?Q?6Dcq7om6sLX8XmiFS/Vi0w5Ksz2cXsfyLTyJnGxRl6/DlX3fnI7+JJKHuKSa?= =?us-ascii?Q?9tui13UaNWBosWkR/ePMo1VZl567P1YSDqxGjeDFE2yVLHDtomy9ZWDCbDR5?= =?us-ascii?Q?cMeAb18Rv3z4hfiBbTnYLkh25HSYe+bq+oGjyDWRx9aCfpTOLRrgxm9bqzIi?= =?us-ascii?Q?MdvCjnLU9pg+GNjg/7TgEwrqFLn9WNo2kTmYGtUiDJyT44oYfkCcZLT2D7/a?= =?us-ascii?Q?LdhmUTQaQU3ocuDGQTYMScK21EMwiY45ZlaN8JQBWeIh33AZYsnahO/3D+LY?= =?us-ascii?Q?vGE/51q7aTSzrOUAngiZ5Er0LWfQtXSeIbbuALy4d4Ywev7HMvNUMi8hVPHv?= =?us-ascii?Q?zT2DlA/I0EjT9aQBd1H/7AnetpI2Is7E4ArLpTL+UywOD39ANFChrHi7OM5W?= =?us-ascii?Q?bItxB9I6T8X8EmlE4dfKD+fYmP9aGjh0KpmkiVDDJJjHrt37dSbuqDEvIU5N?= =?us-ascii?Q?kkHw6b4L87WZqJxisq7eAQaIC1O74EG3rhvx9zANc9wfYTsWu7uxadZtVDWd?= =?us-ascii?Q?VFVlX7UzBXw7zWwxjV8R2hXlaiCSEuDkHjJ9/NjBngB89EtJj72TeSv8E++7?= =?us-ascii?Q?UZU3x6W7EmmBV3cGJoU0Duu1Jxmu7N4mfsPL8+3OvpHs6otz8o3eNWLgFu5a?= =?us-ascii?Q?gTDxpH39zBb34ZoseZRzRbrqVwJ/Ee/FfyHx+qpk1ikPZExNzqcXtu/QMNjf?= =?us-ascii?Q?ztRSaeDTHK+7ykUv/NcAP9Wc2pFhQAhbfKUNYYisLv8/SwtvCD5DIvuQYMoQ?= =?us-ascii?Q?m/8xzVdFo1XoFGyfnpT03K1Bx033JHRhDBWvKJ/hf0WFYBCn8evoGRGlB4T4?= =?us-ascii?Q?42P+zM347ny4JPSqjAlZCtzeVlEHBNTfKPi08tGY5DYn0PbU8rI4u0bLcm1U?= =?us-ascii?Q?Cx4Rq6NlRbJdzcyxHenpRPSw1B1zK+8r1q8QC45If/dnk4gTvXp3s0Xr0WtC?= =?us-ascii?Q?XlqiobCwFH0jR89J4+9/p8cZZG8N6Ma9xmgTfp9LuSfg2XI=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: ccc934c1-0d74-482d-6f3c-08d8b2f94478 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jan 2021 10:44:53.7469 (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: PsLM3MgPoU1DzSV0f5N7hT2MiIowzJYee8wjTa1l8vWivNeYALaPnoRA2ntL4GPFQVuirv7VPIVMkfhZ9IqKyA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4130 Subject: Re: [dpdk-dev] [PATCH v3] net/axgbe: add support for reading FW version 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 Sender: "dev" -----Original Message----- From: Sebastian, Selwin =20 Sent: Wednesday, January 6, 2021 1:31 PM To: dev@dpdk.org Cc: Somalapuram, Amaranath ; ferruh.yigit@in= tel.com Subject: [PATCH v3] 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 | 28 ++++++++++++++++++++++++++++ drivers/net/axgbe/axgbe_rxtx.h | 3 +++ 4 files changed, 33 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..c1= 0127a02 100644 --- a/drivers/net/axgbe/axgbe_rxtx.c +++ b/drivers/net/axgbe/axgbe_rxtx.c @@ -571,6 +571,34 @@ 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) + 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)); + if (ret < 0) + return -EINVAL; + + ret +=3D 1; /* add the size of '\0' */ + + if (fw_size < (size_t)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