From patchwork Thu Aug 24 16:29:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 27906 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 055957D82; Thu, 24 Aug 2017 18:30:22 +0200 (CEST) Received: from rnd-relay.smtp.broadcom.com (lpdvrndsmtp01.broadcom.com [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id 009B57D62 for ; Thu, 24 Aug 2017 18:30:18 +0200 (CEST) Received: from mail-irv-17.broadcom.com (mail-irv-17.lvn.broadcom.net [10.75.224.233]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id 5BE9230C065 for ; Thu, 24 Aug 2017 09:30:17 -0700 (PDT) Received: from C02PT1RBG8WP.wifi.broadcom.net (c02pt1rbg8wp.wifi.broadcom.net [10.45.51.51]) by mail-irv-17.broadcom.com (Postfix) with ESMTP id DB3AD81EA6 for ; Thu, 24 Aug 2017 09:30:16 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Date: Thu, 24 Aug 2017 11:29:53 -0500 Message-Id: <20170824162956.62761-7-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.10.1 (Apple Git-78) In-Reply-To: <20170824162956.62761-1-ajit.khaparde@broadcom.com> References: <20170824162956.62761-1-ajit.khaparde@broadcom.com> Subject: [dpdk-dev] [PATCH 5/8] net/bnxt: add support for tx_descriptor_status 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" add support for tx_descriptor_status dev_op Signed-off-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_ethdev.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 1b8e4a9..088cf6a 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -1586,6 +1586,31 @@ bnxt_rx_descriptor_done_op(void *rx_queue, uint16_t offset) return !!(CMP_VALID(rxcmp, offset, cpr->cp_ring_struct)); } +static int +bnxt_tx_descriptor_status_op(void *tx_queue, uint16_t offset) +{ + struct bnxt_tx_queue *txq = (struct bnxt_tx_queue *)tx_queue; + struct bnxt_cp_ring_info *cpr; + struct tx_pkt_cmpl *txcmp; + uint32_t cons; + + if (!txq) + return -EINVAL; + + cpr = txq->cp_ring; + + if (offset >= txq->nb_tx_desc) + return -EINVAL; + + cons = RING_CMP(cpr->cp_ring_struct, offset); + txcmp = (struct tx_pkt_cmpl *)&cpr->cp_desc_ring[cons]; + + if (CMP_VALID(txcmp, offset, cpr->cp_ring_struct)) + return RTE_ETH_TX_DESC_DONE; + + return RTE_ETH_TX_DESC_FULL; +} + /* * Initialization */ @@ -1638,6 +1663,7 @@ static const struct eth_dev_ops bnxt_dev_ops = { .rx_queue_count = bnxt_rx_queue_count_op, .rx_descriptor_status = bnxt_rx_descriptor_status_op, .rx_descriptor_done = bnxt_rx_descriptor_done_op, + .tx_descriptor_status = bnxt_tx_descriptor_status_op, }; static bool bnxt_vf_pciid(uint16_t id)