[v1,1/3] net/axgbe: support for rxq and txq info API

Message ID 20200302081655.100443-1-asomalap@amd.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series [v1,1/3] net/axgbe: support for rxq and txq info API |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-testing success Testing PASS

Commit Message

AMARANATH SOMALAPURAM March 2, 2020, 8:16 a.m. UTC
  From: Amaranath Somalapuram <asomalap@amd.com>

Adding API for axgbe_rxq_info_get, axgbe_txq_info_get

Signed-off-by: Amaranath Somalapuram <asomalap@amd.com>
---
 drivers/net/axgbe/axgbe_ethdev.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
  

Comments

Kumar, Ravi1 March 14, 2020, 6:16 p.m. UTC | #1
[AMD Public Use]

For series,
Acked-by: Ravi Kumar <ravi1.kumar@amd.com> 


>From: Amaranath Somalapuram <asomalap@amd.com>
>
>Adding API for axgbe_rxq_info_get, axgbe_txq_info_get
>
>Signed-off-by: Amaranath Somalapuram <asomalap@amd.com>
>---
> drivers/net/axgbe/axgbe_ethdev.c | 30 ++++++++++++++++++++++++++++++
> 1 file changed, 30 insertions(+)
>
>diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c
>index d0b6f091f..887b4829d 100644
>--- a/drivers/net/axgbe/axgbe_ethdev.c
>+++ b/drivers/net/axgbe/axgbe_ethdev.c
>@@ -44,6 +44,10 @@ axgbe_dev_xstats_get_names_by_id(struct rte_eth_dev *dev,  static int axgbe_dev_xstats_reset(struct rte_eth_dev *dev);  static int  axgbe_dev_info_get(struct rte_eth_dev *dev,
> 			       struct rte_eth_dev_info *dev_info);
>+static void axgbe_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
>+	struct rte_eth_rxq_info *qinfo);
>+static void axgbe_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
>+	struct rte_eth_txq_info *qinfo);
> 
> struct axgbe_xstats {
> 	char name[RTE_ETH_XSTATS_NAME_SIZE];
>@@ -170,6 +174,8 @@ static const struct eth_dev_ops axgbe_eth_dev_ops = {
> 	.rx_queue_release     = axgbe_dev_rx_queue_release,
> 	.tx_queue_setup       = axgbe_dev_tx_queue_setup,
> 	.tx_queue_release     = axgbe_dev_tx_queue_release,
>+	.rxq_info_get                 = axgbe_rxq_info_get,
>+	.txq_info_get                 = axgbe_txq_info_get,
> };
> 
> static int axgbe_phy_reset(struct axgbe_port *pdata) @@ -816,6 +822,30 @@ axgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
> 	return 0;
> }
> 
>+void
>+axgbe_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
>+	struct rte_eth_rxq_info *qinfo)
>+{
>+	struct   axgbe_rx_queue *rxq;
>+
>+	rxq = dev->data->rx_queues[queue_id];
>+	qinfo->mp = rxq->mb_pool;
>+	qinfo->scattered_rx = dev->data->scattered_rx;
>+	qinfo->nb_desc = rxq->nb_desc;
>+	qinfo->conf.rx_free_thresh = rxq->free_thresh; }
>+
>+void
>+axgbe_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
>+	struct rte_eth_txq_info *qinfo)
>+{
>+	struct  axgbe_tx_queue *txq;
>+
>+	txq = dev->data->tx_queues[queue_id];
>+	qinfo->nb_desc = txq->nb_desc;
>+	qinfo->conf.tx_free_thresh = txq->free_thresh; }
>+
> static void axgbe_get_all_hw_features(struct axgbe_port *pdata)  {
> 	unsigned int mac_hfr0, mac_hfr1, mac_hfr2;
>--
>2.17.1
>
  
Ferruh Yigit March 16, 2020, 1:32 p.m. UTC | #2
On 3/14/2020 6:16 PM, Kumar, Ravi1 wrote:
> [AMD Public Use]
<...>
> 
>> From: Amaranath Somalapuram <asomalap@amd.com>
>>
>> Adding API for axgbe_rxq_info_get, axgbe_txq_info_get
>>
>> Signed-off-by: Amaranath Somalapuram <asomalap@amd.com>
> 
> For series,
> Acked-by: Ravi Kumar <ravi1.kumar@amd.com> 
> 

Series applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c
index d0b6f091f..887b4829d 100644
--- a/drivers/net/axgbe/axgbe_ethdev.c
+++ b/drivers/net/axgbe/axgbe_ethdev.c
@@ -44,6 +44,10 @@  axgbe_dev_xstats_get_names_by_id(struct rte_eth_dev *dev,
 static int axgbe_dev_xstats_reset(struct rte_eth_dev *dev);
 static int  axgbe_dev_info_get(struct rte_eth_dev *dev,
 			       struct rte_eth_dev_info *dev_info);
+static void axgbe_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+	struct rte_eth_rxq_info *qinfo);
+static void axgbe_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+	struct rte_eth_txq_info *qinfo);
 
 struct axgbe_xstats {
 	char name[RTE_ETH_XSTATS_NAME_SIZE];
@@ -170,6 +174,8 @@  static const struct eth_dev_ops axgbe_eth_dev_ops = {
 	.rx_queue_release     = axgbe_dev_rx_queue_release,
 	.tx_queue_setup       = axgbe_dev_tx_queue_setup,
 	.tx_queue_release     = axgbe_dev_tx_queue_release,
+	.rxq_info_get                 = axgbe_rxq_info_get,
+	.txq_info_get                 = axgbe_txq_info_get,
 };
 
 static int axgbe_phy_reset(struct axgbe_port *pdata)
@@ -816,6 +822,30 @@  axgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 	return 0;
 }
 
+void
+axgbe_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+	struct rte_eth_rxq_info *qinfo)
+{
+	struct   axgbe_rx_queue *rxq;
+
+	rxq = dev->data->rx_queues[queue_id];
+	qinfo->mp = rxq->mb_pool;
+	qinfo->scattered_rx = dev->data->scattered_rx;
+	qinfo->nb_desc = rxq->nb_desc;
+	qinfo->conf.rx_free_thresh = rxq->free_thresh;
+}
+
+void
+axgbe_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+	struct rte_eth_txq_info *qinfo)
+{
+	struct  axgbe_tx_queue *txq;
+
+	txq = dev->data->tx_queues[queue_id];
+	qinfo->nb_desc = txq->nb_desc;
+	qinfo->conf.tx_free_thresh = txq->free_thresh;
+}
+
 static void axgbe_get_all_hw_features(struct axgbe_port *pdata)
 {
 	unsigned int mac_hfr0, mac_hfr1, mac_hfr2;