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 0C118A09FF; Wed, 6 Jan 2021 09:01:21 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BC573160807; Wed, 6 Jan 2021 09:01:20 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2048.outbound.protection.outlook.com [40.107.94.48]) by mails.dpdk.org (Postfix) with ESMTP id 2B8DD1607F4 for ; Wed, 6 Jan 2021 09:01:20 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PcPlEL1ZsuLme0DuOUPywTCD0tyh+xK7YIJu5beRFm2tu2dk81xpwANEXN6CcVPTmfakQVWWj4I/YYC5C7fYoFlEU3E61vWdzZUDGAXEID/wT4VsbKF23Mc4kRFAvwt5FBdmqZCOUnVemQcOW+5AY2XpiNJuX/7nRhl7TtxTt/WUgRGs/WN8ktSnjJt7ke5o934NJtTUcI4H4O1IPOqBIcXFwAR07nm3AWBI4abamlWtJr1i0GzGQSNdBuGr9tizbDsYph4FL2/aW32qbPrI7ceXK4Al1dWc5dnXe+GKOAus8IhB0leINiD7ZIn+UPJqPxXzyhM68W7dJRDT0DJkrg== 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=A+1ZEALo9a60/z2Oqne5OpbP+lL36McyslxT14/3aec=; b=b7sXhyOBBWtYHTLnWtt9f0gfKAXJRPwXRAqKxLtUFlx5e5VBkn34kiJ0cyNuHzgASoBUwQN0CJ0z8a0SKilg3n9/EZviUsbJIl4pB3m+mXTlDBR1fDLNUj2SKqNrB0yiXGi0ue9b3P53DQ5khXdGVk1dbBXnApG3wdo1tgumGp7XmX4OuypN6bGBftkrjVyo2c6y1L6hRmcnF/FZ5kcz0F+v653ABZqhegS5NHUmUNpwSxQKj1aaMBc2JYmRuTw283ctyfMdwvgItuc7NiRx2MCdDVKiwq+DT5qtGuryZTdwTmcvzc9W5CjQzQeLqpN+oE3S7P3PhYvzjPCF55nz4A== 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=A+1ZEALo9a60/z2Oqne5OpbP+lL36McyslxT14/3aec=; b=tS4jRMtCuO52SxEou1ktHBUhugdHinuGrDdpjOtHI9+HyDmeYmF8/9P73jthbr+xO/YjUKSmfdRpNyR7/zOltMn3QxfhOxWD9/5ThZ6lhT5XjY1mvxu26/wd/P0G84MWICBx0v88cVnVtW6xMDWD6WC8dg3pEZT+qVwQWWLl8Fc= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=amd.com; Received: from CY4PR1201MB0231.namprd12.prod.outlook.com (2603:10b6:910:24::11) by CY4PR1201MB0054.namprd12.prod.outlook.com (2603:10b6:910:1a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.23; Wed, 6 Jan 2021 08:01:18 +0000 Received: from CY4PR1201MB0231.namprd12.prod.outlook.com ([fe80::7c8f:95c0:45fc:d6c6]) by CY4PR1201MB0231.namprd12.prod.outlook.com ([fe80::7c8f:95c0:45fc:d6c6%10]) with mapi id 15.20.3721.024; Wed, 6 Jan 2021 08:01:18 +0000 From: selwin.sebastian@amd.com To: dev@dpdk.org Cc: amaranath.somalapuram@amd.com, ferruh.yigit@intel.com Date: Wed, 6 Jan 2021 13:30:58 +0530 Message-Id: <20210106080058.24163-1-selwin.sebastian@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: Content-Type: text/plain X-Originating-IP: [165.204.156.251] X-ClientProxiedBy: MAXPR0101CA0057.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:e::19) To CY4PR1201MB0231.namprd12.prod.outlook.com (2603:10b6:910:24::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from cae-Bilby-RV1.amd.com (165.204.156.251) by MAXPR0101CA0057.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6 via Frontend Transport; Wed, 6 Jan 2021 08:01:16 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ba89bbd6-8743-480e-9cf7-08d8b2193f5e X-MS-TrafficTypeDiagnostic: CY4PR1201MB0054: 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: TtsDN+X98vWszTzwVN4HF0dCqrOneox69qw5FOvJrNvNiw/5/6NXnaMXgUSdEmwXqOfopVL4+VU+45wMqLzUnj7Mryz4xTiiTtaHzI6h6hvkoIGN8UedrDBt1y/A5Wgw10Tc++KbJimRqprW3Vp9YK5BdTw9igpKDFUSj4SKCC72PyeKovVPLiUGAJb0euebpoLTOQ7RTIM7XWU9c+NK2JaboiSeFq7QUGB8DfpmbSDEbj1ATn6prDcFPgAw0/7ngOn9aR1Kli5rWkppDqCnFlDF3inGfQEsEB69TdnA5BIWO17wuecExAnnImfkbWll5qgpaEexIc2Xql5f4bY388Qcb7MUNrXzUFVc8OnhfTWBDcb2EoQA2se9wXf6qFcybbWWJXyNyWYtQArAj9g7/g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR1201MB0231.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(396003)(346002)(376002)(366004)(136003)(4326008)(2906002)(5660300002)(66556008)(66946007)(478600001)(6916009)(316002)(8936002)(186003)(9686003)(16526019)(2616005)(6486002)(8676002)(1076003)(6666004)(26005)(36756003)(52116002)(7696005)(86362001)(956004)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?uZ7u70VDxT3atqu0KRBBdsT17ci0G496ZpmvRR+2DI9QtSuNQrwosPmh7hUj?= =?us-ascii?Q?IFSYkgqlYxqXu/bNdzoNsF9ChbV1ysSM8YxXP6x6mfDfHsN9CKH0Im0sn8Ib?= =?us-ascii?Q?6gzHYI+FvlOzMDLq+7cbkWRGQVEAseVnGrsHvKW9BPR3bgAcPFXGMv5G/JRM?= =?us-ascii?Q?+y3rgZAJNeJLIHVEsCt9ZujNANUdGKCUSz7+ZueUhjgs+qoYkBT1eesqWOYH?= =?us-ascii?Q?86oaKW0yZDYa58H7pPFRxhRqhA5q51A9y+fT7MA3tZtpf4MwmGU4jjpqImkW?= =?us-ascii?Q?uE46crvHNDOuLeOC4hzMGY26ws7oGQ9foh7DfP16pCiFisRv3IgLLxR8ePDc?= =?us-ascii?Q?Z6ahkv8hjaykMO9xVMl81MkNfKFaT51t5q+Ckb43wE6lR1+4XjUkSDGgFpXK?= =?us-ascii?Q?/8/V0NwNK02nk31C0OeQ/7depey4aZA+uYFWqrNQMj45si1f0tY4rk/zlzQA?= =?us-ascii?Q?kGdS7HRzAwy079RuzNe+rwkKDfXpm/SIKSctBXfeDd1gngnQjfNsx2EfJOXi?= =?us-ascii?Q?NU6nULzjVpOwXWEkwq1iNXIYyfyMh6oap7/4mj4xoOmkXVpId3hOibZSZlVN?= =?us-ascii?Q?DQeeYhO/jJoZJ4S/g802cJFOqI9Nv1seaJOfX8XocZDyMibOIT15jzanIkrY?= =?us-ascii?Q?UKo6bjFra787bzUhQ+Y60G1M3rHX0dIXw65XlF9yYAqc25ehFnn4td+87hCn?= =?us-ascii?Q?PKSdeipmp9rHT3NYWOaVHBQnBZ6fYuWeTZzNt0i0V33WFCFwqcmfef78CMtW?= =?us-ascii?Q?5taoP+MYZHAdiT5Msr37A+AYDv/r7pxUwfuJmC6bbxyeDlJZERR/+IXAYcPK?= =?us-ascii?Q?t5TbgpCGi1/q0RlrZtP+Dm/7I3NkuQnOVmeqlyEdVVtTSTuRzulkzhtPSwY9?= =?us-ascii?Q?VBdQQM17xKl7Y3LUy4t91yWH+OyACAPKPNBZos9N5sX0poEJOM7S+Xk6fZqy?= =?us-ascii?Q?hx/zAGdpHf2wbTFAJxJQk3MJ87ZIR2VitW0117RIIVzTjxNvEd2pKzSv2zF2?= =?us-ascii?Q?DSQQ?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthSource: CY4PR1201MB0231.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jan 2021 08:01:17.8957 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-Network-Message-Id: ba89bbd6-8743-480e-9cf7-08d8b2193f5e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: oEXn5Imc4zy2e0e9HVTpSc5G1mxAEWJn1D4/BhP5UpRh5Req89SM4LOT8kJhXv7BjOBF4IOY3j6F0G+vvTkM0g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0054 Subject: [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" 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 = Y L3 checksum offload = Y L4 checksum offload = Y Basic stats = Y +FW version = Y Linux UIO = Y x86-32 = Y x86-64 = Y diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.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 = { .timesync_adjust_time = axgbe_timesync_adjust_time, .timesync_read_time = axgbe_timesync_read_time, .timesync_write_time = axgbe_timesync_write_time, + .fw_version_get = 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..c10127a02 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; } +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 = (struct axgbe_port *)eth_dev->data->dev_private; + hw_feat = &pdata->hw_feat; + + if (fw_version == NULL) + return -EINVAL; + + ret = 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 += 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); int 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(void *tx_queue, struct rte_mbuf **tx_pkts, -- 2.17.1