From: Ajit Khaparde <ajit.khaparde@broadcom.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com
Subject: [dpdk-dev] [PATCH v2 16/19] net/bnxt: add support for tx_descriptor_status
Date: Mon, 18 Sep 2017 10:17:52 -0500 [thread overview]
Message-ID: <20170918151755.86605-17-ajit.khaparde@broadcom.com> (raw)
In-Reply-To: <20170918151755.86605-1-ajit.khaparde@broadcom.com>
add support for tx_descriptor_status dev_op
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
--
v1->v2: incorporate review comments.
---
doc/guides/nics/features/bnxt.ini | 1 +
drivers/net/bnxt/bnxt_ethdev.c | 38 ++++++++++++++++++++++++++++++++++++++
drivers/net/bnxt/bnxt_txr.c | 3 +++
3 files changed, 42 insertions(+)
diff --git a/doc/guides/nics/features/bnxt.ini b/doc/guides/nics/features/bnxt.ini
index e0af1df..089d914 100644
--- a/doc/guides/nics/features/bnxt.ini
+++ b/doc/guides/nics/features/bnxt.ini
@@ -22,6 +22,7 @@ Extended stats = Y
FW version = Y
LED = Y
Rx descriptor status = Y
+Tx descriptor status = Y
Linux UIO = Y
Linux VFIO = Y
x86-64 = Y
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 140db0e..daf7990 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1605,6 +1605,43 @@ bnxt_rx_descriptor_status_op(void *rx_queue, uint16_t offset)
return RTE_ETH_RX_DESC_AVAIL;
}
+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_tx_ring_info *txr;
+ struct bnxt_cp_ring_info *cpr;
+ struct bnxt_sw_tx_bd *tx_buf;
+ struct tx_pkt_cmpl *txcmp;
+ uint32_t cons, cp_cons;
+
+ if (!txq)
+ return -EINVAL;
+
+ cpr = txq->cp_ring;
+ txr = txq->tx_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];
+ cp_cons = cpr->cp_raw_cons;
+
+ if (cons > cp_cons) {
+ if (CMPL_VALID(txcmp, cpr->valid))
+ return RTE_ETH_TX_DESC_UNAVAIL;
+ } else {
+ if (CMPL_VALID(txcmp, !cpr->valid))
+ return RTE_ETH_TX_DESC_UNAVAIL;
+ }
+ tx_buf = &txr->tx_buf_ring[cons];
+ if (tx_buf->mbuf == NULL)
+ return RTE_ETH_TX_DESC_DONE;
+
+ return RTE_ETH_TX_DESC_FULL;
+}
+
/*
* Initialization
*/
@@ -1656,6 +1693,7 @@ static const struct eth_dev_ops bnxt_dev_ops = {
.xstats_get_names_by_id = bnxt_dev_xstats_get_names_by_id_op,
.rx_queue_count = bnxt_rx_queue_count_op,
.rx_descriptor_status = bnxt_rx_descriptor_status_op,
+ .tx_descriptor_status = bnxt_tx_descriptor_status_op,
};
static bool bnxt_vf_pciid(uint16_t id)
diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
index 60cc174..8ca4bbd 100644
--- a/drivers/net/bnxt/bnxt_txr.c
+++ b/drivers/net/bnxt/bnxt_txr.c
@@ -313,6 +313,9 @@ static int bnxt_handle_tx_cp(struct bnxt_tx_queue *txq)
if (!CMP_VALID(txcmp, raw_cons, cpr->cp_ring_struct))
break;
+ cpr->valid = FLIP_VALID(cons,
+ cpr->cp_ring_struct->ring_mask,
+ cpr->valid);
if (CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2)
nb_tx_pkts++;
--
2.10.1 (Apple Git-78)
next prev parent reply other threads:[~2017-09-18 15:18 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-18 15:17 [dpdk-dev] [PATCH v2 00/19] bnxt patch set Ajit Khaparde
2017-09-18 15:17 ` [dpdk-dev] [PATCH v2 01/19] net/bnxt: fix HWRM_*() macros and locking Ajit Khaparde
2017-09-18 15:17 ` [dpdk-dev] [PATCH v2 02/19] net/bnxt: use 64-bits of address for vlan_table Ajit Khaparde
2017-09-18 15:17 ` [dpdk-dev] [PATCH v2 03/19] net/bnxt: fix an issue with group id calculation Ajit Khaparde
2017-09-18 15:17 ` [dpdk-dev] [PATCH v2 04/19] net/bnxt: fix calculation of number of pools Ajit Khaparde
2017-09-18 15:17 ` [dpdk-dev] [PATCH v2 05/19] net/bnxt: handle multi queue mode properly Ajit Khaparde
2017-09-18 15:17 ` [dpdk-dev] [PATCH v2 06/19] net/bnxt: fix rx handling and buffer allocation logic Ajit Khaparde
2017-09-18 15:17 ` [dpdk-dev] [PATCH v2 07/19] net/bnxt: fix an issue with broadcast traffic Ajit Khaparde
2017-09-18 15:17 ` [dpdk-dev] [PATCH v2 08/19] net/bnxt: fix usage of ETH_VMDQ_* flags Ajit Khaparde
2017-09-18 15:17 ` [dpdk-dev] [PATCH v2 09/19] net/bnxt: set checksum offload flags correctly Ajit Khaparde
2017-09-18 15:17 ` [dpdk-dev] [PATCH v2 10/19] net/bnxt: update status of Rx IP/L4 CKSUM Ajit Khaparde
2017-09-18 15:17 ` [dpdk-dev] [PATCH v2 11/19] net/bnxt: add support for xstats get by id Ajit Khaparde
2017-09-19 12:39 ` Ferruh Yigit
2017-09-18 15:17 ` [dpdk-dev] [PATCH v2 12/19] net/bnxt: fix config rss update Ajit Khaparde
2017-09-18 15:17 ` [dpdk-dev] [PATCH v2 13/19] net/bnxt: set the hash_key_size Ajit Khaparde
2017-09-18 15:17 ` [dpdk-dev] [PATCH v2 14/19] net/bnxt: add support for rx_queue_count Ajit Khaparde
2017-09-18 15:17 ` [dpdk-dev] [PATCH v2 15/19] net/bnxt: add support for rx_descriptor_status Ajit Khaparde
2017-09-18 15:17 ` Ajit Khaparde [this message]
2017-09-18 15:17 ` [dpdk-dev] [PATCH v2 17/19] net/bnxt: add new HWRM structs to support flow filtering Ajit Khaparde
2017-09-18 15:17 ` [dpdk-dev] [PATCH v2 18/19] net/bnxt: add support for flow filter ops Ajit Khaparde
2017-09-19 12:38 ` Ferruh Yigit
2017-09-18 15:17 ` [dpdk-dev] [PATCH v2 19/19] doc: update release notes Ajit Khaparde
2017-09-18 18:46 ` Mcnamara, John
2017-09-19 12:39 ` Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170918151755.86605-17-ajit.khaparde@broadcom.com \
--to=ajit.khaparde@broadcom.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).