* [dpdk-dev] [PATCH v1 3/3] net/axgbe: support for rxq and txq descriptor status API
@ 2020-02-28 10:45 asomalap
0 siblings, 0 replies; 2+ messages in thread
From: asomalap @ 2020-02-28 10:45 UTC (permalink / raw)
To: dev; +Cc: Ravi1.Kumar
From: Amaranath Somalapuram <asomalap@amd.com>
Adding API axgbe_dev_rx_descriptor_status, axgbe_dev_tx_descriptor_status
Signed-off-by: Amaranath Somalapuram <asomalap@amd.com>
---
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* [dpdk-dev] [PATCH v1 3/3] net/axgbe: support for rxq and txq descriptor status API
2020-03-02 8:16 [dpdk-dev] [PATCH v1 1/3] net/axgbe: support for rxq and txq info API asomalap
@ 2020-03-02 8:16 ` asomalap
0 siblings, 0 replies; 2+ messages in thread
From: asomalap @ 2020-03-02 8:16 UTC (permalink / raw)
To: dev; +Cc: Ravi1.Kumar
From: Amaranath Somalapuram <asomalap@amd.com>
Adding API axgbe_dev_rx_descriptor_status, axgbe_dev_tx_descriptor_status
Signed-off-by: Amaranath Somalapuram <asomalap@amd.com>
---
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-03-02 8:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-28 10:45 [dpdk-dev] [PATCH v1 3/3] net/axgbe: support for rxq and txq descriptor status API asomalap
2020-03-02 8:16 [dpdk-dev] [PATCH v1 1/3] net/axgbe: support for rxq and txq info API asomalap
2020-03-02 8:16 ` [dpdk-dev] [PATCH v1 3/3] net/axgbe: support for rxq and txq descriptor status API asomalap
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).