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 68CE0A0568; Mon, 2 Mar 2020 09:17:37 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0DC6D1C002; Mon, 2 Mar 2020 09:17:24 +0100 (CET) Received: from NAM04-CO1-obe.outbound.protection.outlook.com (mail-eopbgr690075.outbound.protection.outlook.com [40.107.69.75]) by dpdk.org (Postfix) with ESMTP id 9AC9C2E81 for ; Mon, 2 Mar 2020 09:17:19 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WGQkheKoC1a7xIfJyQ92e78k7Wgx4FhZ2HnGBD9xm3LOu7MAnH755s6iJSsGaG1+PuqilHN5s8iOz+qhUj1IkNaO6waCv4s9iKGDhUJYqxw12At+ifz2fviNfUa2uFkfl6cGHwZqPQzlOysiq7WaW4XFhosodXMvte91zW7yU7vFha3v7fRExo4gOk38NJ8z4+EqDSj2/wegeJLy7SCylsgYQfPKwkhV/MVo8uyrrtDU8z+pNETAx7kiZMgWk+AD203wflchdByvXxBKgi/AAbMNjKczxu5mfVAemYi7ITzMBn6NWw+Wzqecnn+iOHOGlUPOE8qVSjNejF0yRWUxFw== 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=WqrShlJvaeCOO1wF/9kAMvpDt4umVEqQISDrdSjIqF8=; b=h1czwCanpEBLxiK8Xuwxn05FiEaEeyYc3I7bjcZA0MQ8Duz5oYVx47DGdQae6Gy4dQ2cUwqwdB26JLp7eawvAhylhbtCR25SYLxSYduFRVtRZV36F9bOSvITF2Z16o/BAYbMvQos4j5cC1sZtVbADTNIBr0wELhQ3NPD4e6RVAjFqenuaU4cxq1VZhxpC7K4JlYt9tLIBtytCLe0fumpSXWqQ5zEgQrmZ8FPW5D0G12beoPV8GcCW8WVSKFAtA0kFzwspAjg70AuFqykR+qZQOyGFhff940fITGfSDNvrmU87QGOZOPKvkwj7qUyHnXC/2TW2yGCipqn7sQlrayxYA== 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=WqrShlJvaeCOO1wF/9kAMvpDt4umVEqQISDrdSjIqF8=; b=BFylusQmoGDtr7Bt1VaYEutaB0IvZbupOZCUCmR/Kj0hNiSl0CuTevXLmeOiG3NabT4/rD/txDIwpOjQYPLhjJaej4DOt1S9QpRrylqHehA1Qg4zK9yOim2rXSbucmt1s1v4TTEoSajureFUetjOyBU0tKKkSlg0HbXWbRqbjEY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Amaranath.Somalapuram@amd.com; Received: from DM5PR1201MB2474.namprd12.prod.outlook.com (2603:10b6:3:e3::8) by DM5PR1201MB0092.namprd12.prod.outlook.com (2603:10b6:4:54::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.15; Mon, 2 Mar 2020 08:17:18 +0000 Received: from DM5PR1201MB2474.namprd12.prod.outlook.com ([fe80::f914:4efa:e6a:8d81]) by DM5PR1201MB2474.namprd12.prod.outlook.com ([fe80::f914:4efa:e6a:8d81%11]) with mapi id 15.20.2772.019; Mon, 2 Mar 2020 08:17:18 +0000 From: asomalap@amd.com To: dev@dpdk.org Cc: Ravi1.Kumar@amd.com Date: Mon, 2 Mar 2020 13:46:55 +0530 Message-Id: <20200302081655.100443-3-asomalap@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200302081655.100443-1-asomalap@amd.com> References: <20200302081655.100443-1-asomalap@amd.com> Content-Type: text/plain X-ClientProxiedBy: MAXPR0101CA0046.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:d::32) To DM5PR1201MB2474.namprd12.prod.outlook.com (2603:10b6:3:e3::8) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from amd.amd.com (165.204.156.251) by MAXPR0101CA0046.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:d::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.19 via Frontend Transport; Mon, 2 Mar 2020 08:17:17 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [165.204.156.251] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 163bbf23-a50c-48d4-fe61-08d7be821fee X-MS-TrafficTypeDiagnostic: DM5PR1201MB0092:|DM5PR1201MB0092: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:13; X-Forefront-PRVS: 033054F29A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(346002)(39860400002)(136003)(396003)(376002)(199004)(189003)(9686003)(316002)(2616005)(956004)(52116002)(36756003)(6486002)(5660300002)(7696005)(26005)(16526019)(1076003)(186003)(2906002)(6916009)(8936002)(4326008)(81166006)(8676002)(478600001)(66946007)(81156014)(6666004)(66476007)(66556008); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR1201MB0092; H:DM5PR1201MB2474.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Bv94H+qpLmwv2KoCN5LDaO440llttlVJiDjJMDv7OLb4DuFwKjzQ/5DVFJ5xOsdp73MSm+a/nJFxxP30lZU/P5UOd92JOS5UmhgRGXjPJ0B/JMTYwH+Cff8P2QIxz238eK3wSQ/755jH4zAEldub90C2p70Nx9+AWosiOEPX2PELPYH+aCiKpZqmbO64Omnx7MYJHaNk5fwLyR/KhY6EJY4VMFAba/sO99VrwJ+p2sLZfm7gMdTSt3vwgCOIX7Wbt/6VFmasTVwYr6Rp2l3PGPxIEiKIcFNExwN4Z+mwdOtT6sSbp5ARbymjGYdX0cZH7LEwGFf7noP4lEAVVCMw2Ufr51cyi0WfER/jcabnSQzTiIsUccZwuUeZlY2ZVNW8L8Fh21QFfyj8Pg3FX8VBjTVjRD8Hy/c9aQFVIIKXbbU7NDv85vsklElHGuRfLtjT X-MS-Exchange-AntiSpam-MessageData: 4F+EkM5+Zt/DkwgPgkOhQsnxV5wOUhmEY3E64zNSbavJE+dXFfvelD5oo4n7DYEIqmSPvn98CL8ukHghduZIYGxL7M1k6YDN34VAypez13APUQW/dnSnxPf8Oegot4tqQLicRXY12EPZhI/KtIi79Q== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 163bbf23-a50c-48d4-fe61-08d7be821fee X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2020 08:17:18.8146 (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: HB8JgXydZj/eX6gptTf+CUk02tOSDJ96aEGGg7YftKNcl5crWuHCrA01rJot5NeaXXDiALGlXaB8V+j/x4d4rA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB0092 Subject: [dpdk-dev] [PATCH v1 3/3] net/axgbe: support for rxq and txq descriptor status API 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: Amaranath Somalapuram Adding API axgbe_dev_rx_descriptor_status, axgbe_dev_tx_descriptor_status Signed-off-by: Amaranath Somalapuram --- drivers/net/axgbe/axgbe_ethdev.c | 2 ++ drivers/net/axgbe/axgbe_rxtx.c | 46 ++++++++++++++++++++++++++++++++ drivers/net/axgbe/axgbe_rxtx.h | 2 ++ 3 files changed, 50 insertions(+) diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c index 70b198f79..58facee6a 100644 --- a/drivers/net/axgbe/axgbe_ethdev.c +++ b/drivers/net/axgbe/axgbe_ethdev.c @@ -178,6 +178,8 @@ static const struct eth_dev_ops axgbe_eth_dev_ops = { .rxq_info_get = axgbe_rxq_info_get, .txq_info_get = axgbe_txq_info_get, .dev_supported_ptypes_get = axgbe_dev_supported_ptypes_get, + .rx_descriptor_status = axgbe_dev_rx_descriptor_status, + .tx_descriptor_status = axgbe_dev_tx_descriptor_status, }; 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 96055c25b..cd02bc044 100644 --- a/drivers/net/axgbe/axgbe_rxtx.c +++ b/drivers/net/axgbe/axgbe_rxtx.c @@ -673,3 +673,49 @@ void axgbe_dev_clear_queues(struct rte_eth_dev *dev) } } } + +int +axgbe_dev_rx_descriptor_status(void *rx_queue, uint16_t offset) +{ + struct axgbe_rx_queue *rxq = rx_queue; + volatile union axgbe_rx_desc *desc; + uint16_t idx; + + + if (unlikely(offset >= rxq->nb_desc)) + return -EINVAL; + + if (offset >= rxq->nb_desc - rxq->dirty) + return RTE_ETH_RX_DESC_UNAVAIL; + + idx = AXGBE_GET_DESC_IDX(rxq, rxq->cur); + desc = &rxq->desc[idx + offset]; + + if (!AXGMAC_GET_BITS_LE(desc->write.desc3, RX_NORMAL_DESC3, OWN)) + return RTE_ETH_RX_DESC_DONE; + + return RTE_ETH_RX_DESC_AVAIL; +} + +int +axgbe_dev_tx_descriptor_status(void *tx_queue, uint16_t offset) +{ + struct axgbe_tx_queue *txq = tx_queue; + volatile struct axgbe_tx_desc *desc; + uint16_t idx; + + + if (unlikely(offset >= txq->nb_desc)) + return -EINVAL; + + if (offset >= txq->nb_desc - txq->dirty) + return RTE_ETH_TX_DESC_UNAVAIL; + + idx = AXGBE_GET_DESC_IDX(txq, txq->dirty + txq->free_batch_cnt - 1); + desc = &txq->desc[idx + offset]; + + if (!AXGMAC_GET_BITS_LE(desc->desc3, TX_NORMAL_DESC3, OWN)) + return RTE_ETH_TX_DESC_DONE; + + return RTE_ETH_TX_DESC_FULL; +} diff --git a/drivers/net/axgbe/axgbe_rxtx.h b/drivers/net/axgbe/axgbe_rxtx.h index a21537df9..933312078 100644 --- a/drivers/net/axgbe/axgbe_rxtx.h +++ b/drivers/net/axgbe/axgbe_rxtx.h @@ -183,5 +183,7 @@ uint16_t axgbe_recv_pkts_threshold_refresh(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts); void axgbe_dev_clear_queues(struct rte_eth_dev *dev); +int axgbe_dev_rx_descriptor_status(void *rx_queue, uint16_t offset); +int axgbe_dev_tx_descriptor_status(void *tx_queue, uint16_t offset); #endif /* _AXGBE_RXTX_H_ */ -- 2.17.1