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 445F5A00C5; Thu, 4 Jun 2020 06:48:14 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 162C81D580; Thu, 4 Jun 2020 06:48:14 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2080.outbound.protection.outlook.com [40.107.236.80]) by dpdk.org (Postfix) with ESMTP id A30B41D55E for ; Thu, 4 Jun 2020 06:48:12 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SWNhV+de3HP55RSJ5A9kF7qGJNcfZKsibc38XGP+OSJYWwCj85f64S3JEP2LYZM9ZOfrHQPuBsQYV3HxVTOakNu5d/0iM4NHiYWIND3jslxyRf5Rlnq2FFdB1AHI7Gim64p8YZSsEdDUwCmHHMlIvVbyHsn3QUOxWk6Fo1DzXWGZ+VgJcj1mPNZY6i2XjllyxuNeTjwih3nckTNSGjfdlbumvUgT0tZ6IBure6hyZgWrnSMzSiHqZrAuSKh8i2ujV4fUph6Wuia5wVpvcXKBrLpl6MJdbukEdHpvD1lAIxQbiP0LNvtVpIj7b6TJ7emJA20wNZDzY/N061gdaIX9zQ== 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=wryZU0WrJ/1fwMBXrPe9e07iHH018sIDHeIuZkK2R88=; b=KE1EFxOghQtlfYqc6ZtjjWhXVBOG950uaPuwtR+G+/EXwYkoTlF0k1uPRrkD35NZ/F1WF+oOIlwrGtF90ZREN0064RaIzI8bmdEH+RN29A/5GbR8vquH4gql6VleK2EkJ0H6fMEa7daFrhS/5ecJyEobF+GW2AxNLkcp7Kq+tBMK3nkdsPi75b4fsbmCpCe+i29YgxVDnlFK55bmF0g3uk/wQCEZ9Zl6fj2OTvolWIAxkHehtQA1MwY3Vq7YddytCrEWfOBQMW/joAQqE6czoKLMdnePRe0aOj4np5cMQ9F9P6DZjr3TVFrYGv3RSf4CACit4VUdR76CMrErtIIHEw== 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=wryZU0WrJ/1fwMBXrPe9e07iHH018sIDHeIuZkK2R88=; b=jlT2xHBXMDnVgxtOtevoKnkjDNRnNamm79vqUVx84maZr0YUewdrqhc2ZcZ3SsLI08tOrwNXpKd0MqN6hD6Jrkik0bf9hCQALalbW4i+gvp9+kU3IKmMbp/GKUUfIQ7FRunMqt/Dn9JvwLgee2uRESuihufoVidIsLUEvkzZwOY= Received: from CY4PR12MB1574.namprd12.prod.outlook.com (2603:10b6:910:e::23) by CY4PR12MB1464.namprd12.prod.outlook.com (2603:10b6:910:d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.17; Thu, 4 Jun 2020 04:48:10 +0000 Received: from CY4PR12MB1574.namprd12.prod.outlook.com ([fe80::7405:91a0:a2ea:b344]) by CY4PR12MB1574.namprd12.prod.outlook.com ([fe80::7405:91a0:a2ea:b344%6]) with mapi id 15.20.3045.024; Thu, 4 Jun 2020 04:48:10 +0000 From: "Somalapuram, Amaranath" To: "Sebastian, Selwin" , "dev@dpdk.org" CC: Ferruh Yigit Thread-Topic: [PATCH v1] net/axgbe: add support for utility APIs Thread-Index: AQHWOByUGuswaXkddUGnpZZd/htX1KjH5ihg Date: Thu, 4 Jun 2020 04:48:09 +0000 Message-ID: References: <20200601135703.18815-1-selwin.sebastian@amd.com> In-Reply-To: <20200601135703.18815-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_0d814d60-469d-470c-8cb0-58434e2bf457_ActionId=4823e8cd-2c2f-4812-b8b1-00008856f3e5; MSIP_Label_0d814d60-469d-470c-8cb0-58434e2bf457_ContentBits=0; MSIP_Label_0d814d60-469d-470c-8cb0-58434e2bf457_Enabled=true; MSIP_Label_0d814d60-469d-470c-8cb0-58434e2bf457_Method=Privileged; MSIP_Label_0d814d60-469d-470c-8cb0-58434e2bf457_Name=Public_0; MSIP_Label_0d814d60-469d-470c-8cb0-58434e2bf457_SetDate=2020-06-04T04:47:52Z; MSIP_Label_0d814d60-469d-470c-8cb0-58434e2bf457_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: [2405:201:d805:fef:e178:9d4d:818a:793e] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 06b96598-feed-4e4e-d7e0-08d808427b28 x-ms-traffictypediagnostic: CY4PR12MB1464: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:962; x-forefront-prvs: 04244E0DC5 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: E112JyaUD1Dknsuz8ZmgcLuAaXO/aBk83lRR3bAJGQ7EnyiCyIwdfMsLQqfQ9xivTDSy8O359eh69owuuCh6JOvm6aYUc/cP4LRnwgeZ9BfEcFtv6Edf2I2UhFNPjZGECl/NTAidHyBm5l+I53x4WLtdjKd77P5YsuaxNlhiiGkgfJV8XQOPC80xl0I+2IJwtY/+NEvJNmf7xSiv/rm5oSx/3Hrbxz73iankkvtuTBT/EWCakmxD31nAkzemQm6C/2LHi9D8MrfFIXZTbjS8bVKiGO8wVVj7ltgYlHGF9f/havFwTFiZuMZcgutGxNRrY6Pg3nd0RJdK58g7Wwu8MA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR12MB1574.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(136003)(366004)(346002)(376002)(39860400002)(478600001)(2906002)(9686003)(76116006)(66476007)(83380400001)(66946007)(53546011)(66556008)(5660300002)(55016002)(64756008)(6506007)(66446008)(7696005)(86362001)(8936002)(4326008)(110136005)(186003)(316002)(8676002)(52536014)(71200400001)(33656002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: 0l0Bx5wg1WG1w3qAhwmyYyFKdFMBr4ayVNqOh3ENx2mUdYZZuFa07skah7c+WDzOEwXtwbwvTKB/HBx03w9ac9novFvph07QzUiQSIeKrgRTHMevpeJcHMCo5qMb6jF0UYkKtoKHegOmQMqq5HloS6yFdHc1rYnzg93l7b0bim/bSM5LG6i1VMvLLRIImb2bfiTQboe5co6de9AiVKrAKs+FzlgTBrzO6zpFP/eAvAyBNmsJIeia1S80eA5lNsP5lVLeeFg1ACR7ofGhGavNHDBy/Ur2y6uwjfEHtaNHHOPvMbR2ssoQ3PimErevQfki8jdhQ3ma2j6pvzBCbiKHydxsmGBM7CtEWkCAfDtebYOr9Rcy8tEThKyFwDL1nw+HOBI99YkB8EJtrVw7XVLc1Y3ZTgz4hsvVmZphutmpNV+l7XpciL8916xrrgFDGXj6TnyGLrryRyd/WEVLiC4yJA+SDIKRBYtYr/HTBCAJDxyJPYBRCBhUPkjEXo6N3gNAPrL0MtIruj9kvxF6RufXfiWXkQ/JKpSixijWzoRGC0o= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 06b96598-feed-4e4e-d7e0-08d808427b28 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jun 2020 04:48:09.9153 (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: meS2mY3UbfRiEvTEifE/h7JHgtFXAubSdPWfXkrTO3sSpS52i4qK/pDztmSZG2FA8QD1tHiWT4Tv0E7P+uniQQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1464 Subject: Re: [dpdk-dev] [PATCH v1] net/axgbe: add support for utility APIs 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" [AMD Public Use] Acked-by: Somalapuram Amaranath -----Original Message----- From: Sebastian, Selwin Sent: Monday, June 1, 2020 7:27 PM To: dev@dpdk.org Cc: Somalapuram, Amaranath Subject: [PATCH v1] net/axgbe: add support for utility APIs From: Selwin Sebastian Add support for rx, tx queue utility APIs Add support for 'fw_revision_get'= API Signed-off-by: Selwin Sebastian --- drivers/net/axgbe/axgbe_ethdev.c | 7 +++ drivers/net/axgbe/axgbe_rxtx.c | 89 ++++++++++++++++++++++++++++++++ drivers/net/axgbe/axgbe_rxtx.h | 4 ++ 3 files changed, 100 insertions(+) diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_eth= dev.c index 867058845..e943d1dae 100644 --- a/drivers/net/axgbe/axgbe_ethdev.c +++ b/drivers/net/axgbe/axgbe_ethdev.c @@ -214,6 +214,11 @@ static const struct eth_dev_ops axgbe_eth_dev_ops =3D = { .dev_supported_ptypes_get =3D axgbe_dev_supported_ptypes_get, .rx_descriptor_status =3D axgbe_dev_rx_descriptor_status, .tx_descriptor_status =3D axgbe_dev_tx_descriptor_status, +.rx_queue_start =3D axgbe_dev_rx_queue_start, +.rx_queue_stop =3D axgbe_dev_rx_queue_stop, +.tx_queue_start =3D axgbe_dev_tx_queue_start, +.tx_queue_stop =3D axgbe_dev_tx_queue_stop, +.fw_version_get =3D axgbe_dev_fw_version_get, }; static int axgbe_phy_reset(struct axgbe_port *pdata) @@ -1006,6 +1011,8 @@= axgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_i= nfo) DEV_TX_OFFLOAD_IPV4_CKSUM | DEV_TX_OFFLOAD_UDP_CKSUM | DEV_TX_OFFLOAD_TCP_CKSUM; +dev_info->dev_capa =3D RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP | +RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP; if (pdata->hw_feat.rss) { dev_info->flow_type_rss_offloads =3D AXGBE_RSS_OFFLOAD; diff --git a/drive= rs/net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.c index 30c467db7.= .495e07902 100644 --- a/drivers/net/axgbe/axgbe_rxtx.c +++ b/drivers/net/axgbe/axgbe_rxtx.c @@ -565,6 +565,95 @@ int axgbe_dev_tx_queue_setup(struct rte_eth_dev *dev, = uint16_t queue_idx, return 0; } +int axgbe_dev_tx_queue_start(struct rte_eth_dev *eth_dev, +uint16_t queue_idx) +{ +struct axgbe_port *pdata =3D +(struct axgbe_port *)eth_dev->data->dev_private; +int ret =3D 0; + +PMD_INIT_FUNC_TRACE(); + +AXGMAC_MTL_IOWRITE_BITS(pdata, queue_idx, +MTL_Q_TQOMR, TXQEN, MTL_Q_ENABLED); +eth_dev->data->tx_queue_state[queue_idx] =3D +RTE_ETH_QUEUE_STATE_STARTED; + +return ret; +} + +int axgbe_dev_tx_queue_stop(struct rte_eth_dev *eth_dev, +uint16_t queue_idx) +{ +int ret =3D 0; +struct axgbe_port *pdata =3D +(struct axgbe_port *)eth_dev->data->dev_private; + +PMD_INIT_FUNC_TRACE(); + +AXGMAC_MTL_IOWRITE_BITS(pdata, queue_idx, MTL_Q_TQOMR, TXQEN, 0); +eth_dev->data->tx_queue_state[queue_idx] =3D +RTE_ETH_QUEUE_STATE_STOPPED; + +return ret; +} + +int axgbe_dev_rx_queue_start(struct rte_eth_dev *eth_dev, +uint16_t queue_idx) +{ +struct axgbe_port *pdata =3D +(struct axgbe_port *)eth_dev->data->dev_private; +unsigned int reg_val =3D 0; +int ret =3D 0; + +PMD_INIT_FUNC_TRACE(); + +reg_val |=3D (0x02 << (queue_idx << 1)); +AXGMAC_IOWRITE(pdata, MAC_RQC0R, reg_val); +eth_dev->data->rx_queue_state[queue_idx] =3D +RTE_ETH_QUEUE_STATE_STARTED; + +return ret; +} + +int axgbe_dev_rx_queue_stop(struct rte_eth_dev *eth_dev, +uint16_t queue_idx) +{ +int ret =3D 0; +struct axgbe_port *pdata =3D +(struct axgbe_port *)eth_dev->data->dev_private; +struct axgbe_rx_queue *rxq; + +PMD_INIT_FUNC_TRACE(); + +AXGMAC_IOWRITE(pdata, MAC_RQC0R, 0); +rxq =3D eth_dev->data->rx_queues[queue_idx]; + +/* Disable Rx DMA channel */ +AXGMAC_DMA_IOWRITE_BITS(rxq, DMA_CH_RCR, SR, 0); +eth_dev->data->rx_queue_state[queue_idx] =3D +RTE_ETH_QUEUE_STATE_STOPPED; + +return ret; +} + +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, SNPSVER)); + +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..3e05e0e6f 100644 --- a/drivers/net/axgbe/axgbe_rxtx.h +++ b/drivers/net/axgbe/axgbe_rxtx.h @@ -161,6 +161,10 @@ void axgbe_dev_enable_tx(struct rte_eth_dev *dev); vo= id axgbe_dev_disable_tx(struct rte_eth_dev *dev); int axgbe_dev_tx_queue_s= tart(struct rte_eth_dev *dev, uint16_t tx_queue_id); int axgbe_dev_tx_queu= e_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id); +int axgbe_dev_rx_queue_start(struct rte_eth_dev *eth_dev, uint16_t +queue_idx); int axgbe_dev_rx_queue_stop(struct rte_eth_dev *eth_dev, +uint16_t queue_idx); 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); -- 2.17.1