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 AF912A09FF; Tue, 29 Dec 2020 08:10:15 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0E34E2B86; Tue, 29 Dec 2020 08:10:14 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2056.outbound.protection.outlook.com [40.107.243.56]) by dpdk.org (Postfix) with ESMTP id 63BC72A63 for ; Tue, 29 Dec 2020 08:10:11 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kq59PtjqbJxESZw/PG8V3KZnb+by+gGyDP37f1eMOQr6H4i3+SQuNAU2fFHF7FcgFuz6ALg/oYVpakF/3N8sHURVAP+hNhjzDjB6D5msPJMxN3S85m9P5+QbFk1/9226sS6yd/YVEoL5SQEYP95QrNma3Ci25ZP1f+i4FXbz9PhvkotphkruCx7X6yuh15C4brVIB2ToYeyGfEI3tuObZT0uv1C/AUPpJT5mz/sIKe1QpuS8o6gK59fGkdoni/GRDYv6htgkv+hdl/28lHWndQPDO/OHuCAy1YtXwPZIjMle3DnVXyfoVFl+b4oIIQXjrputIlnUBjwQfhnTmIz7mg== 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=CojGGhG71Z3oGGGhaG1S6FJfI2hDaLXlIn+AfxoLSJ8=; b=cr/4yg2Q0U3rQtXYQBIbhnNsPLlsXCUhFrBwJGCwQSUTWQS2w5L0+H3sJb61MRA+asE76H8a1Ngzj6R881VC429l7feg8ey/fbkJabLzTXIJARz4Q7Qwt/Hy5FPndiJdCn58/FT9dQe7ERpU05VEwcx3VHvXiEnUx38+QBb/J+fKpIxvkhkhCSzhgzyLVZkfDckbz524NFnXtIK1uou8iim70OBLWDE49L5rjSemS9sZr54MO+m3cMuNg+wVTmcxuNJRJ8yKsUX5TooNt47NvZ2DeB5ED4thZkHgWKQFVYZ8Th6KrjXO7iEY/ftFExfyIudholuwO1T8IFHC60cNkQ== 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=CojGGhG71Z3oGGGhaG1S6FJfI2hDaLXlIn+AfxoLSJ8=; b=jTZAbRtDf2W8kg3sxjpWLOVrrWnZh3IvP5Yglnmq+RM8K5iHtCmV2kLrHiynuf0fJ5EZj4kZmSbxFW0SgdmUH6EIj7KAFyClkbJVMivRXNNhq3OYyibqFWwp3Y/6JDr7WB5eexdozxrnLXdwg3AFJ9VMSx0Tgd5logat0wewZ0Y= 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 CY4PR12MB1831.namprd12.prod.outlook.com (2603:10b6:903:128::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3700.27; Tue, 29 Dec 2020 07:10:07 +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.3700.031; Tue, 29 Dec 2020 07:10:07 +0000 From: selwin.sebastian@amd.com To: dev@dpdk.org Cc: amaranath.somalapuram@amd.com, ferruh.yigit@intel.com Date: Tue, 29 Dec 2020 12:39:47 +0530 Message-Id: <20201229070947.14073-1-selwin.sebastian@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <12017189-0d86-2cea-8f65-f38dc57a8120@intel.com> References: <12017189-0d86-2cea-8f65-f38dc57a8120@intel.com> Content-Type: text/plain X-Originating-IP: [165.204.156.251] X-ClientProxiedBy: MA1PR01CA0138.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:35::32) 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 MA1PR01CA0138.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:35::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3700.27 via Frontend Transport; Tue, 29 Dec 2020 07:10:05 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 26fad621-2792-4682-81bb-08d8abc8c5ac X-MS-TrafficTypeDiagnostic: CY4PR12MB1831: 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: c/0+htH2O5BtVin/Xe2KeU6QhuGJcJGouOBLguH8XZUSWfyDbVYD6lTx+PPEzsDPLN5s11GrcnFwdFu2+lbM7TF9g7MfokhSnTr8Uv11cLh3OhqWHTZ0tjytQspJkkTfUFvrr0Jngigiod//rUurptoWPjMw+vaknTqNmns5/JQnGpJdbRU10R/RuNUDtf7Awmnkk/gLtXiTyxk4hbm0+qV7eypRwbJ8O23TvmRjHnIaCRhI838LkmDoz/XqxclC8UXT4nkeLeypm3A0W3ZUPVvSWi3zLPjLFZ8q/KQEBue95MAcUuNcdEJCQ6S6rQt4DNu0GVQNDghWCsaoe/d3B+60ViNiw8v0d6i1re5ZkFSNK2xoAMCu/qV+ejmUR1k1dD3DPgjDKthykxv54p6c7A== 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)(366004)(346002)(396003)(136003)(376002)(39860400002)(52116002)(16526019)(8936002)(6666004)(186003)(2906002)(66946007)(86362001)(1076003)(8676002)(66476007)(478600001)(36756003)(6486002)(5660300002)(9686003)(26005)(6916009)(4326008)(2616005)(66556008)(7696005)(316002)(956004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?EwCRa+Yrr5LyuzYsCK82huDI39xyLRM7RcBXP+Mkr+6CR9SDKNDnTwm/sGFo?= =?us-ascii?Q?Q5efijdZHnjtSttdFHtpuZ45jUZBHIemtfCcHhuWte6YsAUZXO0n6jD5joTF?= =?us-ascii?Q?oz+Uq23Sd46ByqaWY1ttVJJPoowzeIUnmhThWQ4AjUkzP/t0bl4Dohiv+JEN?= =?us-ascii?Q?oVmFWPRVd5ViGPHWah6lYpOUy5Id7uh1X35s8nr/ZVqol/gOj0bIba4ch0Uf?= =?us-ascii?Q?RzXZYsxT6LUKOQKyNG6AwdlHd15B4L0F0KNSgVnQHCM4RbtCzV9F4c9k9f/V?= =?us-ascii?Q?s1pmDbnUPERCvLlRC9QIIKnvX4CHyZGE3RAGaOS0wSq/2iTzRRYVz7unFIZ/?= =?us-ascii?Q?z15Rim2brfVE0qDbXJWnkba1rMQqHZk6VrqxCaexlSCUMEsBSqvre+E6jmBq?= =?us-ascii?Q?4RvaE9G0DrAzjkqIctT2mlBLqR2mJ32tFuBf4oaYaBxTSiA1akuL1rDk1fOT?= =?us-ascii?Q?2X8SL2Y8PoJP6zo1O1Txh7LF3VYdxiGGQjKXyT7GB9P3sq/eN5Vk1dUy62Ae?= =?us-ascii?Q?DCzSCWmL4uW4z3Awv6Z1AAQxx9LimDAGkuvllCs5jwnMrzCHLqnHif1armGc?= =?us-ascii?Q?yrVuXES8ChgJsyHZq7WBSOi2jkZfnUkRdyg2+bJcw+3RQLDt7FD+5nZLs5Qb?= =?us-ascii?Q?NsGODX0lGK0OJ6EF31YbK9MQ9wOwlWgYyOaLEq/KD1P88VkksYTagoPoEys4?= =?us-ascii?Q?7QTGsoqi6TEQdDjGRMh+5Jpga7ZElXUNE8ZcFjJAWytE5vdsKUvouyDALcYo?= =?us-ascii?Q?f5vXkMnp1hxo4D2AyCz8+euzoCP6gSQ37fuYipMmEVWEAiBiRT1cd11vfwIt?= =?us-ascii?Q?R5F8x9denLgwJ2kORd+Z7+CZI2k0aFFErQn6jXSEspNMduMRyhFN+hD3K6Ix?= =?us-ascii?Q?GJSEB211peogTv5kdP+W/fOSbQK4Y/ziMBVR4lTGImO3k7Ou7x8ocSL3S6F7?= =?us-ascii?Q?o0vKcOtxS5hC9ImwpoC3AuwwVt39SgYpmFcowdIm4MpM7T/uizi2Fc2SGW83?= =?us-ascii?Q?z/yi?= 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: 29 Dec 2020 07:10:07.0551 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-Network-Message-Id: 26fad621-2792-4682-81bb-08d8abc8c5ac X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8rIxiFPH2D42owcd5KCFvz6SCvW6Z9UiWdOf10wxd385cQdMcvBAGn7kcUB8YjDsRMvqGS0o0kKTLN7qSWhqvQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1831 Subject: [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" 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 = 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..3298a294e 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; } +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 || fw_size <= 0) + 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)); + ret += 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); 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