DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCHv5 0/8] ethdev: add new API to retrieve RX/TX queue information
@ 2015-10-01 19:54 Konstantin Ananyev
  2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 1/8] " Konstantin Ananyev
                   ` (7 more replies)
  0 siblings, 8 replies; 43+ messages in thread
From: Konstantin Ananyev @ 2015-10-01 19:54 UTC (permalink / raw)
  To: dev

Add the ability for the upper layer to query:
1) configured RX/TX queue information.
2) information about RX/TX descriptors min/max/align
numbers per queue for the device.

Right now 1) is implemented for:
ixgbe, i40e, e1000 PMDs.

Ananyev, Konstantin (5):
  ethdev: add new API to retrieve RX/TX queue information
  i40e: add support for eth_(rxq|txq)_info_get
  ixgbe: add support for eth_(rxq|txq)_info_get
  e1000: add support for eth_(rxq|txq)_info_get
  testpmd: add new command to display RX/TX queue information

Konstantin Ananyev (3):
  fm10k: add HW specific desc_lim data into dev_info
  cxgbe: add HW specific desc_lim data into dev_info
  vmxnet3: add HW specific desc_lim data into dev_info

 app/test-pmd/cmdline.c                 | 48 +++++++++++++++++++
 app/test-pmd/config.c                  | 77 ++++++++++++++++++++++++++++++
 app/test-pmd/testpmd.h                 |  2 +
 drivers/net/cxgbe/cxgbe_ethdev.c       |  9 ++++
 drivers/net/e1000/e1000_ethdev.h       | 36 ++++++++++++++
 drivers/net/e1000/em_ethdev.c          | 14 ++++++
 drivers/net/e1000/em_rxtx.c            | 71 ++++++++++++++++------------
 drivers/net/e1000/igb_ethdev.c         | 22 +++++++++
 drivers/net/e1000/igb_rxtx.c           | 66 +++++++++++++++++---------
 drivers/net/fm10k/fm10k_ethdev.c       | 11 +++++
 drivers/net/i40e/i40e_ethdev.c         | 14 ++++++
 drivers/net/i40e/i40e_ethdev.h         |  5 ++
 drivers/net/i40e/i40e_ethdev_vf.c      | 12 +++++
 drivers/net/i40e/i40e_rxtx.c           | 37 +++++++++++++++
 drivers/net/ixgbe/ixgbe_ethdev.c       | 23 +++++++++
 drivers/net/ixgbe/ixgbe_ethdev.h       |  6 +++
 drivers/net/ixgbe/ixgbe_rxtx.c         | 68 +++++++++++++++++----------
 drivers/net/ixgbe/ixgbe_rxtx.h         | 21 +++++++++
 drivers/net/vmxnet3/vmxnet3_ethdev.c   | 12 +++++
 lib/librte_ether/rte_ethdev.c          | 68 +++++++++++++++++++++++++++
 lib/librte_ether/rte_ethdev.h          | 85 +++++++++++++++++++++++++++++++++-
 lib/librte_ether/rte_ether_version.map |  8 ++++
 22 files changed, 635 insertions(+), 80 deletions(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [dpdk-dev] [PATCHv5 1/8] ethdev: add new API to retrieve RX/TX queue information
  2015-10-01 19:54 [dpdk-dev] [PATCHv5 0/8] ethdev: add new API to retrieve RX/TX queue information Konstantin Ananyev
@ 2015-10-01 19:54 ` Konstantin Ananyev
  2015-10-14 11:39   ` [dpdk-dev] [dpdk-dev, PATCHv5, " Amine Kherbouche
                     ` (3 more replies)
  2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 2/8] i40e: add support for eth_(rxq|txq)_info_get and (rx|tx)_desc_lim Konstantin Ananyev
                   ` (6 subsequent siblings)
  7 siblings, 4 replies; 43+ messages in thread
From: Konstantin Ananyev @ 2015-10-01 19:54 UTC (permalink / raw)
  To: dev

From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>

Add the ability for the upper layer to query RX/TX queue information.
Add into rte_eth_dev_info new fields to represent information about
RX/TX descriptors min/max/alig nnumbers per queue for the device.

Add new structures:
struct rte_eth_rxq_info
struct rte_eth_txq_info

new functions:
rte_eth_rx_queue_info_get
rte_eth_tx_queue_info_get

into rte_etdev API.

Left extra free space in the queue info structures,
so extra fields could be added later without ABI breakage.

Add new fields:
rx_desc_lim
tx_desc_lim
into rte_eth_dev_info.

v2 changes:
- Add formal check for the qinfo input parameter.
- As suggested rename 'rx_qinfo/tx_qinfo' to 'rxq_info/txq_info'

v3 changes:
- Updated rte_ether_version.map
- Merged with latest changes

v4 changes:
- rte_ether_version.map: move new functions into DPDK_2.1 sub-space.

v5 changes:
- adressed previous code-review comments
- rte_ether_version.map: move new functions into DPDK_2.2 sub-space.
- added new fields into rte_eth_dev_info

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 lib/librte_ether/rte_ethdev.c          | 68 +++++++++++++++++++++++++++
 lib/librte_ether/rte_ethdev.h          | 85 +++++++++++++++++++++++++++++++++-
 lib/librte_ether/rte_ether_version.map |  8 ++++
 3 files changed, 159 insertions(+), 2 deletions(-)

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index b309309..66bd074 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -1447,6 +1447,19 @@ rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id,
 		return -EINVAL;
 	}
 
+	if (nb_rx_desc > dev_info.rx_desc_lim.nb_max ||
+			nb_rx_desc < dev_info.rx_desc_lim.nb_min ||
+			nb_rx_desc % dev_info.rx_desc_lim.nb_align != 0) {
+
+		PMD_DEBUG_TRACE("Invalid value for nb_rx_desc(=%hu), "
+			"should be: <= %hu, = %hu, and a product of %hu\n",
+			nb_rx_desc,
+			dev_info.rx_desc_lim.nb_max,
+			dev_info.rx_desc_lim.nb_min,
+			dev_info.rx_desc_lim.nb_align);
+		return -EINVAL;
+	}
+
 	if (rx_conf == NULL)
 		rx_conf = &dev_info.default_rxconf;
 
@@ -1786,11 +1799,18 @@ void
 rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info)
 {
 	struct rte_eth_dev *dev;
+	const struct rte_eth_desc_lim lim = {
+		.nb_max = UINT16_MAX,
+		.nb_min = 0,
+		.nb_align = 1,
+	};
 
 	VALID_PORTID_OR_RET(port_id);
 	dev = &rte_eth_devices[port_id];
 
 	memset(dev_info, 0, sizeof(struct rte_eth_dev_info));
+	dev_info->rx_desc_lim = lim;
+	dev_info->tx_desc_lim = lim;
 
 	FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get);
 	(*dev->dev_ops->dev_infos_get)(dev, dev_info);
@@ -3449,6 +3469,54 @@ rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id,
 }
 
 int
+rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id,
+	struct rte_eth_rxq_info *qinfo)
+{
+	struct rte_eth_dev *dev;
+
+	VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+
+	if (qinfo == NULL)
+		return -EINVAL;
+
+	dev = &rte_eth_devices[port_id];
+	if (queue_id >= dev->data->nb_rx_queues) {
+		PMD_DEBUG_TRACE("Invalid RX queue_id=%d\n", queue_id);
+		return -EINVAL;
+	}
+
+	FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rxq_info_get, -ENOTSUP);
+
+	memset(qinfo, 0, sizeof(*qinfo));
+	dev->dev_ops->rxq_info_get(dev, queue_id, qinfo);
+	return 0;
+}
+
+int
+rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id,
+	struct rte_eth_txq_info *qinfo)
+{
+	struct rte_eth_dev *dev;
+
+	VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+
+	if (qinfo == NULL)
+		return -EINVAL;
+
+	dev = &rte_eth_devices[port_id];
+	if (queue_id >= dev->data->nb_tx_queues) {
+		PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
+		return -EINVAL;
+	}
+
+	FUNC_PTR_OR_ERR_RET(*dev->dev_ops->txq_info_get, -ENOTSUP);
+
+	memset(qinfo, 0, sizeof(*qinfo));
+	dev->dev_ops->txq_info_get(dev, queue_id, qinfo);
+	return 0;
+}
+
+int
 rte_eth_dev_set_mc_addr_list(uint8_t port_id,
 			     struct ether_addr *mc_addr_set,
 			     uint32_t nb_mc_addr)
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index fa06554..2cb9bc2 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -653,6 +653,15 @@ struct rte_eth_txconf {
 };
 
 /**
+ * A structure contains information about HW descriptor ring limitations.
+ */
+struct rte_eth_desc_lim {
+	uint16_t nb_max;   /**< Max allowed number of descriptors. */
+	uint16_t nb_min;   /**< Min allowed number of descriptors. */
+	uint16_t nb_align; /**< Number of descriptors should be aligned to. */
+};
+
+/**
  * This enum indicates the flow control mode
  */
 enum rte_eth_fc_mode {
@@ -945,6 +954,8 @@ struct rte_eth_dev_info {
 	uint16_t vmdq_queue_base; /**< First queue ID for VMDQ pools. */
 	uint16_t vmdq_queue_num;  /**< Queue number for VMDQ pools. */
 	uint16_t vmdq_pool_base;  /**< First ID of VMDQ pools. */
+	struct rte_eth_desc_lim rx_desc_lim;  /**< RX descriptors limits */
+	struct rte_eth_desc_lim tx_desc_lim;  /**< TX descriptors limits */
 };
 
 /** Maximum name length for extended statistics counters */
@@ -962,6 +973,26 @@ struct rte_eth_xstats {
 	uint64_t value;
 };
 
+/**
+ * Ethernet device RX queue information structure.
+ * Used to retieve information about configured queue.
+ */
+struct rte_eth_rxq_info {
+	struct rte_mempool *mp;     /**< mempool used by that queue. */
+	struct rte_eth_rxconf conf; /**< queue config parameters. */
+	uint8_t scattered_rx;       /**< scattered packets RX supported. */
+	uint16_t nb_desc;           /**< configured number of RXDs. */
+} __rte_cache_aligned;
+
+/**
+ * Ethernet device TX queue information structure.
+ * Used to retieve information about configured queue.
+ */
+struct rte_eth_txq_info {
+	struct rte_eth_txconf conf; /**< queue config parameters. */
+	uint16_t nb_desc;           /**< configured number of TXDs. */
+} __rte_cache_aligned;
+
 struct rte_eth_dev;
 
 struct rte_eth_dev_callback;
@@ -1073,6 +1104,12 @@ typedef uint32_t (*eth_rx_queue_count_t)(struct rte_eth_dev *dev,
 typedef int (*eth_rx_descriptor_done_t)(void *rxq, uint16_t offset);
 /**< @internal Check DD bit of specific RX descriptor */
 
+typedef void (*eth_rxq_info_get_t)(struct rte_eth_dev *dev,
+	uint16_t rx_queue_id, struct rte_eth_rxq_info *qinfo);
+
+typedef void (*eth_txq_info_get_t)(struct rte_eth_dev *dev,
+	uint16_t tx_queue_id, struct rte_eth_txq_info *qinfo);
+
 typedef int (*mtu_set_t)(struct rte_eth_dev *dev, uint16_t mtu);
 /**< @internal Set MTU. */
 
@@ -1465,9 +1502,13 @@ struct eth_dev_ops {
 	rss_hash_update_t rss_hash_update;
 	/** Get current RSS hash configuration. */
 	rss_hash_conf_get_t rss_hash_conf_get;
-	eth_filter_ctrl_t              filter_ctrl;          /**< common filter control*/
+	eth_filter_ctrl_t              filter_ctrl;
+	/**< common filter control. */
 	eth_set_mc_addr_list_t set_mc_addr_list; /**< set list of mcast addrs */
-
+	eth_rxq_info_get_t rxq_info_get;
+	/**< retrieve RX queue information. */
+	eth_txq_info_get_t txq_info_get;
+	/**< retrieve TX queue information. */
 	/** Turn IEEE1588/802.1AS timestamping on. */
 	eth_timesync_enable_t timesync_enable;
 	/** Turn IEEE1588/802.1AS timestamping off. */
@@ -3821,6 +3862,46 @@ int rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id,
 		struct rte_eth_rxtx_callback *user_cb);
 
 /**
+ * Retrieve information about given port's RX queue.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param queue_id
+ *   The RX queue on the Ethernet device for which information
+ *   will be retrieved.
+ * @param qinfo
+ *   A pointer to a structure of type *rte_eth_rxq_info_info* to be filled with
+ *   the information of the Ethernet device.
+ *
+ * @return
+ *   - 0: Success
+ *   - -ENOTSUP: routine is not supported by the device PMD.
+ *   - -EINVAL:  The port_id or the queue_id is out of range.
+ */
+int rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id,
+	struct rte_eth_rxq_info *qinfo);
+
+/**
+ * Retrieve information about given port's TX queue.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param queue_id
+ *   The TX queue on the Ethernet device for which information
+ *   will be retrieved.
+ * @param qinfo
+ *   A pointer to a structure of type *rte_eth_txq_info_info* to be filled with
+ *   the information of the Ethernet device.
+ *
+ * @return
+ *   - 0: Success
+ *   - -ENOTSUP: routine is not supported by the device PMD.
+ *   - -EINVAL:  The port_id or the queue_id is out of range.
+ */
+int rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id,
+	struct rte_eth_txq_info *qinfo);
+
+/*
  * Retrieve number of available registers for access
  *
  * @param port_id
diff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map
index 8345a6c..1fb4b87 100644
--- a/lib/librte_ether/rte_ether_version.map
+++ b/lib/librte_ether/rte_ether_version.map
@@ -127,3 +127,11 @@ DPDK_2.1 {
 	rte_eth_timesync_read_tx_timestamp;
 
 } DPDK_2.0;
+
+DPDK_2.2 {
+	global:
+
+	rte_eth_rx_queue_info_get;
+	rte_eth_tx_queue_info_get;
+
+} DPDK_2.1;
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [dpdk-dev] [PATCHv5 2/8] i40e: add support for eth_(rxq|txq)_info_get and (rx|tx)_desc_lim
  2015-10-01 19:54 [dpdk-dev] [PATCHv5 0/8] ethdev: add new API to retrieve RX/TX queue information Konstantin Ananyev
  2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 1/8] " Konstantin Ananyev
@ 2015-10-01 19:54 ` Konstantin Ananyev
  2015-10-14 12:46   ` Remy Horton
  2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 3/8] ixgbe: " Konstantin Ananyev
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 43+ messages in thread
From: Konstantin Ananyev @ 2015-10-01 19:54 UTC (permalink / raw)
  To: dev

From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>

This patch assumes that the patch:
i40e: fix wrong alignment for the number of HW descriptors
already applied.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c    | 14 ++++++++++++++
 drivers/net/i40e/i40e_ethdev.h    |  5 +++++
 drivers/net/i40e/i40e_ethdev_vf.c | 12 ++++++++++++
 drivers/net/i40e/i40e_rxtx.c      | 37 +++++++++++++++++++++++++++++++++++++
 4 files changed, 68 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 2dd9fdc..cbc1985 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -283,6 +283,8 @@ static const struct eth_dev_ops i40e_eth_dev_ops = {
 	.udp_tunnel_add               = i40e_dev_udp_tunnel_add,
 	.udp_tunnel_del               = i40e_dev_udp_tunnel_del,
 	.filter_ctrl                  = i40e_dev_filter_ctrl,
+	.rxq_info_get                 = i40e_rxq_info_get,
+	.txq_info_get                 = i40e_txq_info_get,
 	.mirror_rule_set              = i40e_mirror_rule_set,
 	.mirror_rule_reset            = i40e_mirror_rule_reset,
 	.timesync_enable              = i40e_timesync_enable,
@@ -1674,6 +1676,18 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 				ETH_TXQ_FLAGS_NOOFFLOADS,
 	};
 
+	dev_info->rx_desc_lim = (struct rte_eth_desc_lim) {
+		.nb_max = I40E_MAX_RING_DESC,
+		.nb_min = I40E_MIN_RING_DESC,
+		.nb_align = I40E_ALIGN_RING_DESC,
+	};
+
+	dev_info->tx_desc_lim = (struct rte_eth_desc_lim) {
+		.nb_max = I40E_MAX_RING_DESC,
+		.nb_min = I40E_MIN_RING_DESC,
+		.nb_align = I40E_ALIGN_RING_DESC,
+	};
+
 	if (pf->flags & I40E_FLAG_VMDQ) {
 		dev_info->max_vmdq_pools = pf->max_nb_vmdq_vsi;
 		dev_info->vmdq_queue_base = dev_info->max_rx_queues;
diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index 6185657..4748392 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -502,6 +502,11 @@ int i40e_fdir_ctrl_func(struct rte_eth_dev *dev,
 			  enum rte_filter_op filter_op,
 			  void *arg);
 
+void i40e_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+	struct rte_eth_rxq_info *qinfo);
+void i40e_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+	struct rte_eth_txq_info *qinfo);
+
 /* I40E_DEV_PRIVATE_TO */
 #define I40E_DEV_PRIVATE_TO_PF(adapter) \
 	(&((struct i40e_adapter *)adapter)->pf)
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index b694400..5dad12d 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1756,6 +1756,18 @@ i40evf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		.txq_flags = ETH_TXQ_FLAGS_NOMULTSEGS |
 				ETH_TXQ_FLAGS_NOOFFLOADS,
 	};
+
+	dev_info->rx_desc_lim = (struct rte_eth_desc_lim) {
+		.nb_max = I40E_MAX_RING_DESC,
+		.nb_min = I40E_MIN_RING_DESC,
+		.nb_align = I40E_ALIGN_RING_DESC,
+	};
+
+	dev_info->tx_desc_lim = (struct rte_eth_desc_lim) {
+		.nb_max = I40E_MAX_RING_DESC,
+		.nb_min = I40E_MIN_RING_DESC,
+		.nb_align = I40E_ALIGN_RING_DESC,
+	};
 }
 
 static void
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 7a30c44..78b2f9b 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -3065,3 +3065,40 @@ i40e_fdir_setup_rx_resources(struct i40e_pf *pf)
 
 	return I40E_SUCCESS;
 }
+
+void
+i40e_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+	struct rte_eth_rxq_info *qinfo)
+{
+	struct i40e_rx_queue *rxq;
+
+	rxq = dev->data->rx_queues[queue_id];
+
+	qinfo->mp = rxq->mp;
+	qinfo->scattered_rx = dev->data->scattered_rx;
+	qinfo->nb_desc = rxq->nb_rx_desc;
+
+	qinfo->conf.rx_free_thresh = rxq->rx_free_thresh;
+	qinfo->conf.rx_drop_en = rxq->drop_en;
+	qinfo->conf.rx_deferred_start = rxq->rx_deferred_start;
+}
+
+void
+i40e_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+	struct rte_eth_txq_info *qinfo)
+{
+	struct i40e_tx_queue *txq;
+
+	txq = dev->data->tx_queues[queue_id];
+
+	qinfo->nb_desc = txq->nb_tx_desc;
+
+	qinfo->conf.tx_thresh.pthresh = txq->pthresh;
+	qinfo->conf.tx_thresh.hthresh = txq->hthresh;
+	qinfo->conf.tx_thresh.wthresh = txq->wthresh;
+
+	qinfo->conf.tx_free_thresh = txq->tx_free_thresh;
+	qinfo->conf.tx_rs_thresh = txq->tx_rs_thresh;
+	qinfo->conf.txq_flags = txq->txq_flags;
+	qinfo->conf.tx_deferred_start = txq->tx_deferred_start;
+}
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [dpdk-dev] [PATCHv5 3/8] ixgbe: add support for eth_(rxq|txq)_info_get and (rx|tx)_desc_lim
  2015-10-01 19:54 [dpdk-dev] [PATCHv5 0/8] ethdev: add new API to retrieve RX/TX queue information Konstantin Ananyev
  2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 1/8] " Konstantin Ananyev
  2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 2/8] i40e: add support for eth_(rxq|txq)_info_get and (rx|tx)_desc_lim Konstantin Ananyev
@ 2015-10-01 19:54 ` Konstantin Ananyev
  2015-10-14 12:47   ` Remy Horton
  2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 4/8] e1000: " Konstantin Ananyev
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 43+ messages in thread
From: Konstantin Ananyev @ 2015-10-01 19:54 UTC (permalink / raw)
  To: dev

From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 23 ++++++++++++++
 drivers/net/ixgbe/ixgbe_ethdev.h |  6 ++++
 drivers/net/ixgbe/ixgbe_rxtx.c   | 68 +++++++++++++++++++++++++---------------
 drivers/net/ixgbe/ixgbe_rxtx.h   | 21 +++++++++++++
 4 files changed, 93 insertions(+), 25 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index ec2918c..4769bb0 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -386,6 +386,18 @@ static const struct rte_pci_id pci_id_ixgbevf_map[] = {
 
 };
 
+static const struct rte_eth_desc_lim rx_desc_lim = {
+	.nb_max = IXGBE_MAX_RING_DESC,
+	.nb_min = IXGBE_MIN_RING_DESC,
+	.nb_align = IXGBE_RXD_ALIGN,
+};
+
+static const struct rte_eth_desc_lim tx_desc_lim = {
+	.nb_max = IXGBE_MAX_RING_DESC,
+	.nb_min = IXGBE_MIN_RING_DESC,
+	.nb_align = IXGBE_TXD_ALIGN,
+};
+
 static const struct eth_dev_ops ixgbe_eth_dev_ops = {
 	.dev_configure        = ixgbe_dev_configure,
 	.dev_start            = ixgbe_dev_start,
@@ -456,6 +468,8 @@ static const struct eth_dev_ops ixgbe_eth_dev_ops = {
 	.rss_hash_conf_get    = ixgbe_dev_rss_hash_conf_get,
 	.filter_ctrl          = ixgbe_dev_filter_ctrl,
 	.set_mc_addr_list     = ixgbe_dev_set_mc_addr_list,
+	.rxq_info_get         = ixgbe_rxq_info_get,
+	.txq_info_get         = ixgbe_txq_info_get,
 	.timesync_enable      = ixgbe_timesync_enable,
 	.timesync_disable     = ixgbe_timesync_disable,
 	.timesync_read_rx_timestamp = ixgbe_timesync_read_rx_timestamp,
@@ -494,6 +508,8 @@ static const struct eth_dev_ops ixgbevf_eth_dev_ops = {
 	.mac_addr_add         = ixgbevf_add_mac_addr,
 	.mac_addr_remove      = ixgbevf_remove_mac_addr,
 	.set_mc_addr_list     = ixgbe_dev_set_mc_addr_list,
+	.rxq_info_get         = ixgbe_rxq_info_get,
+	.txq_info_get         = ixgbe_txq_info_get,
 	.mac_addr_set         = ixgbevf_set_default_mac_addr,
 	.get_reg_length       = ixgbevf_get_reg_length,
 	.get_reg              = ixgbevf_get_regs,
@@ -2396,6 +2412,10 @@ ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		.txq_flags = ETH_TXQ_FLAGS_NOMULTSEGS |
 				ETH_TXQ_FLAGS_NOOFFLOADS,
 	};
+
+	dev_info->rx_desc_lim = rx_desc_lim;
+	dev_info->tx_desc_lim = tx_desc_lim;
+
 	dev_info->hash_key_size = IXGBE_HKEY_MAX_INDEX * sizeof(uint32_t);
 	dev_info->reta_size = ETH_RSS_RETA_SIZE_128;
 	dev_info->flow_type_rss_offloads = IXGBE_RSS_OFFLOAD_ALL;
@@ -2449,6 +2469,9 @@ ixgbevf_dev_info_get(struct rte_eth_dev *dev,
 		.txq_flags = ETH_TXQ_FLAGS_NOMULTSEGS |
 				ETH_TXQ_FLAGS_NOOFFLOADS,
 	};
+
+	dev_info->rx_desc_lim = rx_desc_lim;
+	dev_info->tx_desc_lim = tx_desc_lim;
 }
 
 /* return 0 means link status changed, -1 means not changed */
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h
index c3d4f4f..d16f476 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.h
+++ b/drivers/net/ixgbe/ixgbe_ethdev.h
@@ -351,6 +351,12 @@ int ixgbe_dev_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id);
 
 int ixgbe_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id);
 
+void ixgbe_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+	struct rte_eth_rxq_info *qinfo);
+
+void ixgbe_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+	struct rte_eth_txq_info *qinfo);
+
 int ixgbevf_dev_rx_init(struct rte_eth_dev *dev);
 
 void ixgbevf_dev_tx_init(struct rte_eth_dev *dev);
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index a598a72..ba08588 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -1821,25 +1821,6 @@ ixgbe_recv_pkts_lro_bulk_alloc(void *rx_queue, struct rte_mbuf **rx_pkts,
  **********************************************************************/
 
 /*
- * Rings setup and release.
- *
- * TDBA/RDBA should be aligned on 16 byte boundary. But TDLEN/RDLEN should be
- * multiple of 128 bytes. So we align TDBA/RDBA on 128 byte boundary. This will
- * also optimize cache line size effect. H/W supports up to cache line size 128.
- */
-#define IXGBE_ALIGN 128
-
-/*
- * Maximum number of Ring Descriptors.
- *
- * Since RDLEN/TDLEN should be multiple of 128 bytes, the number of ring
- * descriptors should meet the following condition:
- *      (num_ring_desc * sizeof(rx/tx descriptor)) % 128 == 0
- */
-#define IXGBE_MIN_RING_DESC 32
-#define IXGBE_MAX_RING_DESC 4096
-
-/*
  * Create memzone for HW rings. malloc can't be used as the physical address is
  * needed. If the memzone is already created, then this function returns a ptr
  * to the old one.
@@ -2007,9 +1988,9 @@ ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev,
 	 * It must not exceed hardware maximum, and must be multiple
 	 * of IXGBE_ALIGN.
 	 */
-	if (((nb_desc * sizeof(union ixgbe_adv_tx_desc)) % IXGBE_ALIGN) != 0 ||
-	    (nb_desc > IXGBE_MAX_RING_DESC) ||
-	    (nb_desc < IXGBE_MIN_RING_DESC)) {
+	if (nb_desc % IXGBE_TXD_ALIGN != 0 ||
+			(nb_desc > IXGBE_MAX_RING_DESC) ||
+			(nb_desc < IXGBE_MIN_RING_DESC)) {
 		return -EINVAL;
 	}
 
@@ -2374,9 +2355,9 @@ ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev,
 	 * It must not exceed hardware maximum, and must be multiple
 	 * of IXGBE_ALIGN.
 	 */
-	if (((nb_desc * sizeof(union ixgbe_adv_rx_desc)) % IXGBE_ALIGN) != 0 ||
-	    (nb_desc > IXGBE_MAX_RING_DESC) ||
-	    (nb_desc < IXGBE_MIN_RING_DESC)) {
+	if (nb_desc % IXGBE_RXD_ALIGN != 0 ||
+			(nb_desc > IXGBE_MAX_RING_DESC) ||
+			(nb_desc < IXGBE_MIN_RING_DESC)) {
 		return (-EINVAL);
 	}
 
@@ -4649,6 +4630,43 @@ ixgbe_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id)
 	return 0;
 }
 
+void
+ixgbe_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+	struct rte_eth_rxq_info *qinfo)
+{
+	struct ixgbe_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_rx_desc;
+
+	qinfo->conf.rx_free_thresh = rxq->rx_free_thresh;
+	qinfo->conf.rx_drop_en = rxq->drop_en;
+	qinfo->conf.rx_deferred_start = rxq->rx_deferred_start;
+}
+
+void
+ixgbe_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+	struct rte_eth_txq_info *qinfo)
+{
+	struct ixgbe_tx_queue *txq;
+
+	txq = dev->data->tx_queues[queue_id];
+
+	qinfo->nb_desc = txq->nb_tx_desc;
+
+	qinfo->conf.tx_thresh.pthresh = txq->pthresh;
+	qinfo->conf.tx_thresh.hthresh = txq->hthresh;
+	qinfo->conf.tx_thresh.wthresh = txq->wthresh;
+
+	qinfo->conf.tx_free_thresh = txq->tx_free_thresh;
+	qinfo->conf.tx_rs_thresh = txq->tx_rs_thresh;
+	qinfo->conf.txq_flags = txq->txq_flags;
+	qinfo->conf.tx_deferred_start = txq->tx_deferred_start;
+}
+
 /*
  * [VF] Initializes Receive Unit.
  */
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.h b/drivers/net/ixgbe/ixgbe_rxtx.h
index b9eca67..475a800 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.h
+++ b/drivers/net/ixgbe/ixgbe_rxtx.h
@@ -34,6 +34,27 @@
 #ifndef _IXGBE_RXTX_H_
 #define _IXGBE_RXTX_H_
 
+/*
+ * Rings setup and release.
+ *
+ * TDBA/RDBA should be aligned on 16 byte boundary. But TDLEN/RDLEN should be
+ * multiple of 128 bytes. So we align TDBA/RDBA on 128 byte boundary. This will
+ * also optimize cache line size effect. H/W supports up to cache line size 128.
+ */
+#define	IXGBE_ALIGN	128
+
+#define IXGBE_RXD_ALIGN	(IXGBE_ALIGN / sizeof(union ixgbe_adv_rx_desc))
+#define IXGBE_TXD_ALIGN	(IXGBE_ALIGN / sizeof(union ixgbe_adv_tx_desc))
+
+/*
+ * Maximum number of Ring Descriptors.
+ *
+ * Since RDLEN/TDLEN should be multiple of 128 bytes, the number of ring
+ * descriptors should meet the following condition:
+ *      (num_ring_desc * sizeof(rx/tx descriptor)) % 128 == 0
+ */
+#define	IXGBE_MIN_RING_DESC	32
+#define	IXGBE_MAX_RING_DESC	4096
 
 #define RTE_PMD_IXGBE_TX_MAX_BURST 32
 #define RTE_PMD_IXGBE_RX_MAX_BURST 32
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [dpdk-dev] [PATCHv5 4/8] e1000: add support for eth_(rxq|txq)_info_get and (rx|tx)_desc_lim
  2015-10-01 19:54 [dpdk-dev] [PATCHv5 0/8] ethdev: add new API to retrieve RX/TX queue information Konstantin Ananyev
                   ` (2 preceding siblings ...)
  2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 3/8] ixgbe: " Konstantin Ananyev
@ 2015-10-01 19:54 ` Konstantin Ananyev
  2015-10-14 12:48   ` Remy Horton
  2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 5/8] fm10k: add HW specific desc_lim data into dev_info Konstantin Ananyev
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 43+ messages in thread
From: Konstantin Ananyev @ 2015-10-01 19:54 UTC (permalink / raw)
  To: dev

From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 drivers/net/e1000/e1000_ethdev.h | 36 ++++++++++++++++++++
 drivers/net/e1000/em_ethdev.c    | 14 ++++++++
 drivers/net/e1000/em_rxtx.c      | 71 +++++++++++++++++++++++-----------------
 drivers/net/e1000/igb_ethdev.c   | 22 +++++++++++++
 drivers/net/e1000/igb_rxtx.c     | 66 ++++++++++++++++++++++++-------------
 5 files changed, 156 insertions(+), 53 deletions(-)

diff --git a/drivers/net/e1000/e1000_ethdev.h b/drivers/net/e1000/e1000_ethdev.h
index 4e69e44..3c6f613 100644
--- a/drivers/net/e1000/e1000_ethdev.h
+++ b/drivers/net/e1000/e1000_ethdev.h
@@ -108,6 +108,30 @@
 	ETH_RSS_IPV6_TCP_EX | \
 	ETH_RSS_IPV6_UDP_EX)
 
+/*
+ * Maximum number of Ring Descriptors.
+ *
+ * Since RDLEN/TDLEN should be multiple of 128 bytes, the number of ring
+ * desscriptors should meet the following condition:
+ * (num_ring_desc * sizeof(struct e1000_rx/tx_desc)) % 128 == 0
+ */
+#define	E1000_MIN_RING_DESC	32
+#define	E1000_MAX_RING_DESC	4096
+
+/*
+ * TDBA/RDBA should be aligned on 16 byte boundary. But TDLEN/RDLEN should be
+ * multiple of 128 bytes. So we align TDBA/RDBA on 128 byte boundary.
+ * This will also optimize cache line size effect.
+ * H/W supports up to cache line size 128.
+ */
+#define	E1000_ALIGN	128
+
+#define	IGB_RXD_ALIGN	(E1000_ALIGN / sizeof(union e1000_adv_rx_desc))
+#define	IGB_TXD_ALIGN	(E1000_ALIGN / sizeof(union e1000_adv_tx_desc))
+
+#define	EM_RXD_ALIGN	(E1000_ALIGN / sizeof(struct e1000_rx_desc))
+#define	EM_TXD_ALIGN	(E1000_ALIGN / sizeof(struct e1000_data_desc))
+
 /* structure for interrupt relative data */
 struct e1000_interrupt {
 	uint32_t flags;
@@ -307,6 +331,12 @@ void igb_pf_mbx_process(struct rte_eth_dev *eth_dev);
 
 int igb_pf_host_configure(struct rte_eth_dev *eth_dev);
 
+void igb_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+	struct rte_eth_rxq_info *qinfo);
+
+void igb_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+	struct rte_eth_txq_info *qinfo);
+
 /*
  * RX/TX EM function prototypes
  */
@@ -343,6 +373,12 @@ uint16_t eth_em_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 uint16_t eth_em_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 		uint16_t nb_pkts);
 
+void em_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+	struct rte_eth_rxq_info *qinfo);
+
+void em_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+	struct rte_eth_txq_info *qinfo);
+
 void igb_pf_host_uninit(struct rte_eth_dev *dev);
 
 #endif /* _E1000_ETHDEV_H_ */
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index 912f5dd..0cbc228 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -166,6 +166,8 @@ static const struct eth_dev_ops eth_em_ops = {
 	.mac_addr_add         = eth_em_rar_set,
 	.mac_addr_remove      = eth_em_rar_clear,
 	.set_mc_addr_list     = eth_em_set_mc_addr_list,
+	.rxq_info_get         = em_rxq_info_get,
+	.txq_info_get         = em_txq_info_get,
 };
 
 /**
@@ -933,6 +935,18 @@ eth_em_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 
 	dev_info->max_rx_queues = 1;
 	dev_info->max_tx_queues = 1;
+
+	dev_info->rx_desc_lim = (struct rte_eth_desc_lim) {
+		.nb_max = E1000_MAX_RING_DESC,
+		.nb_min = E1000_MIN_RING_DESC,
+		.nb_align = EM_RXD_ALIGN,
+	};
+
+	dev_info->tx_desc_lim = (struct rte_eth_desc_lim) {
+		.nb_max = E1000_MAX_RING_DESC,
+		.nb_min = E1000_MIN_RING_DESC,
+		.nb_align = EM_TXD_ALIGN,
+	};
 }
 
 /* return 0 means link status changed, -1 means not changed */
diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index 3b8776d..03e1bc2 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -1081,26 +1081,6 @@ eth_em_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 	return (nb_rx);
 }
 
-/*
- * Rings setup and release.
- *
- * TDBA/RDBA should be aligned on 16 byte boundary. But TDLEN/RDLEN should be
- * multiple of 128 bytes. So we align TDBA/RDBA on 128 byte boundary.
- * This will also optimize cache line size effect.
- * H/W supports up to cache line size 128.
- */
-#define EM_ALIGN 128
-
-/*
- * Maximum number of Ring Descriptors.
- *
- * Since RDLEN/TDLEN should be multiple of 128 bytes, the number of ring
- * desscriptors should meet the following condition:
- * (num_ring_desc * sizeof(struct e1000_rx/tx_desc)) % 128 == 0
- */
-#define EM_MIN_RING_DESC 32
-#define EM_MAX_RING_DESC 4096
-
 #define	EM_MAX_BUF_SIZE     16384
 #define EM_RCTL_FLXBUF_STEP 1024
 
@@ -1210,11 +1190,11 @@ eth_em_tx_queue_setup(struct rte_eth_dev *dev,
 	/*
 	 * Validate number of transmit descriptors.
 	 * It must not exceed hardware maximum, and must be multiple
-	 * of EM_ALIGN.
+	 * of E1000_ALIGN.
 	 */
-	if (((nb_desc * sizeof(*txq->tx_ring)) % EM_ALIGN) != 0 ||
-			(nb_desc > EM_MAX_RING_DESC) ||
-			(nb_desc < EM_MIN_RING_DESC)) {
+	if (nb_desc % EM_TXD_ALIGN != 0 ||
+			(nb_desc > E1000_MAX_RING_DESC) ||
+			(nb_desc < E1000_MIN_RING_DESC)) {
 		return -(EINVAL);
 	}
 
@@ -1272,7 +1252,7 @@ eth_em_tx_queue_setup(struct rte_eth_dev *dev,
 	 * handle the maximum ring size is allocated in order to allow for
 	 * resizing in later calls to the queue setup function.
 	 */
-	tsize = sizeof (txq->tx_ring[0]) * EM_MAX_RING_DESC;
+	tsize = sizeof(txq->tx_ring[0]) * E1000_MAX_RING_DESC;
 	if ((tz = ring_dma_zone_reserve(dev, "tx_ring", queue_idx, tsize,
 			socket_id)) == NULL)
 		return (-ENOMEM);
@@ -1375,11 +1355,11 @@ eth_em_rx_queue_setup(struct rte_eth_dev *dev,
 	/*
 	 * Validate number of receive descriptors.
 	 * It must not exceed hardware maximum, and must be multiple
-	 * of EM_ALIGN.
+	 * of E1000_ALIGN.
 	 */
-	if (((nb_desc * sizeof(rxq->rx_ring[0])) % EM_ALIGN) != 0 ||
-			(nb_desc > EM_MAX_RING_DESC) ||
-			(nb_desc < EM_MIN_RING_DESC)) {
+	if (nb_desc % EM_RXD_ALIGN != 0 ||
+			(nb_desc > E1000_MAX_RING_DESC) ||
+			(nb_desc < E1000_MIN_RING_DESC)) {
 		return (-EINVAL);
 	}
 
@@ -1399,7 +1379,7 @@ eth_em_rx_queue_setup(struct rte_eth_dev *dev,
 	}
 
 	/* Allocate RX ring for max possible mumber of hardware descriptors. */
-	rsize = sizeof (rxq->rx_ring[0]) * EM_MAX_RING_DESC;
+	rsize = sizeof(rxq->rx_ring[0]) * E1000_MAX_RING_DESC;
 	if ((rz = ring_dma_zone_reserve(dev, "rx_ring", queue_idx, rsize,
 			socket_id)) == NULL)
 		return (-ENOMEM);
@@ -1881,3 +1861,34 @@ eth_em_tx_init(struct rte_eth_dev *dev)
 	/* This write will effectively turn on the transmit unit. */
 	E1000_WRITE_REG(hw, E1000_TCTL, tctl);
 }
+
+void
+em_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+	struct rte_eth_rxq_info *qinfo)
+{
+	struct em_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_rx_desc;
+	qinfo->conf.rx_free_thresh = rxq->rx_free_thresh;
+}
+
+void
+em_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+	struct rte_eth_txq_info *qinfo)
+{
+	struct em_tx_queue *txq;
+
+	txq = dev->data->tx_queues[queue_id];
+
+	qinfo->nb_desc = txq->nb_tx_desc;
+
+	qinfo->conf.tx_thresh.pthresh = txq->pthresh;
+	qinfo->conf.tx_thresh.hthresh = txq->hthresh;
+	qinfo->conf.tx_thresh.wthresh = txq->wthresh;
+	qinfo->conf.tx_free_thresh = txq->tx_free_thresh;
+	qinfo->conf.tx_rs_thresh = txq->tx_rs_thresh;
+}
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 848ef6e..73c067e 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -281,6 +281,18 @@ static const struct rte_pci_id pci_id_igbvf_map[] = {
 {0},
 };
 
+static const struct rte_eth_desc_lim rx_desc_lim = {
+	.nb_max = E1000_MAX_RING_DESC,
+	.nb_min = E1000_MIN_RING_DESC,
+	.nb_align = IGB_RXD_ALIGN,
+};
+
+static const struct rte_eth_desc_lim tx_desc_lim = {
+	.nb_max = E1000_MAX_RING_DESC,
+	.nb_min = E1000_MIN_RING_DESC,
+	.nb_align = IGB_RXD_ALIGN,
+};
+
 static const struct eth_dev_ops eth_igb_ops = {
 	.dev_configure        = eth_igb_configure,
 	.dev_start            = eth_igb_start,
@@ -319,6 +331,8 @@ static const struct eth_dev_ops eth_igb_ops = {
 	.rss_hash_conf_get    = eth_igb_rss_hash_conf_get,
 	.filter_ctrl          = eth_igb_filter_ctrl,
 	.set_mc_addr_list     = eth_igb_set_mc_addr_list,
+	.rxq_info_get         = igb_rxq_info_get,
+	.txq_info_get         = igb_txq_info_get,
 	.timesync_enable      = igb_timesync_enable,
 	.timesync_disable     = igb_timesync_disable,
 	.timesync_read_rx_timestamp = igb_timesync_read_rx_timestamp,
@@ -349,6 +363,8 @@ static const struct eth_dev_ops igbvf_eth_dev_ops = {
 	.tx_queue_setup       = eth_igb_tx_queue_setup,
 	.tx_queue_release     = eth_igb_tx_queue_release,
 	.set_mc_addr_list     = eth_igb_set_mc_addr_list,
+	.rxq_info_get         = igb_rxq_info_get,
+	.txq_info_get         = igb_txq_info_get,
 	.mac_addr_set         = igbvf_default_mac_addr_set,
 	.get_reg_length       = igbvf_get_reg_length,
 	.get_reg              = igbvf_get_regs,
@@ -1570,6 +1586,9 @@ eth_igb_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		},
 		.txq_flags = 0,
 	};
+
+	dev_info->rx_desc_lim = rx_desc_lim;
+	dev_info->tx_desc_lim = tx_desc_lim;
 }
 
 static void
@@ -1621,6 +1640,9 @@ eth_igbvf_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		},
 		.txq_flags = 0,
 	};
+
+	dev_info->rx_desc_lim = rx_desc_lim;
+	dev_info->tx_desc_lim = tx_desc_lim;
 }
 
 /* return 0 means link status changed, -1 means not changed */
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index 19905fd..cca3300 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -1148,25 +1148,12 @@ eth_igb_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 }
 
 /*
- * Rings setup and release.
- *
- * TDBA/RDBA should be aligned on 16 byte boundary. But TDLEN/RDLEN should be
- * multiple of 128 bytes. So we align TDBA/RDBA on 128 byte boundary.
- * This will also optimize cache line size effect.
- * H/W supports up to cache line size 128.
- */
-#define IGB_ALIGN 128
-
-/*
  * Maximum number of Ring Descriptors.
  *
  * Since RDLEN/TDLEN should be multiple of 128bytes, the number of ring
  * desscriptors should meet the following condition:
  *      (num_ring_desc * sizeof(struct e1000_rx/tx_desc)) % 128 == 0
  */
-#define IGB_MIN_RING_DESC 32
-#define IGB_MAX_RING_DESC 4096
-
 static const struct rte_memzone *
 ring_dma_zone_reserve(struct rte_eth_dev *dev, const char *ring_name,
 		      uint16_t queue_id, uint32_t ring_size, int socket_id)
@@ -1183,10 +1170,10 @@ ring_dma_zone_reserve(struct rte_eth_dev *dev, const char *ring_name,
 
 #ifdef RTE_LIBRTE_XEN_DOM0
 	return rte_memzone_reserve_bounded(z_name, ring_size,
-			socket_id, 0, IGB_ALIGN, RTE_PGSIZE_2M);
+			socket_id, 0, E1000_ALIGN, RTE_PGSIZE_2M);
 #else
 	return rte_memzone_reserve_aligned(z_name, ring_size,
-			socket_id, 0, IGB_ALIGN);
+			socket_id, 0, E1000_ALIGN);
 #endif
 }
 
@@ -1282,10 +1269,11 @@ eth_igb_tx_queue_setup(struct rte_eth_dev *dev,
 	/*
 	 * Validate number of transmit descriptors.
 	 * It must not exceed hardware maximum, and must be multiple
-	 * of IGB_ALIGN.
+	 * of E1000_ALIGN.
 	 */
-	if (((nb_desc * sizeof(union e1000_adv_tx_desc)) % IGB_ALIGN) != 0 ||
-	    (nb_desc > IGB_MAX_RING_DESC) || (nb_desc < IGB_MIN_RING_DESC)) {
+	if (nb_desc % IGB_TXD_ALIGN != 0 ||
+			(nb_desc > E1000_MAX_RING_DESC) ||
+			(nb_desc < E1000_MIN_RING_DESC)) {
 		return -EINVAL;
 	}
 
@@ -1321,7 +1309,7 @@ eth_igb_tx_queue_setup(struct rte_eth_dev *dev,
 	 * handle the maximum ring size is allocated in order to allow for
 	 * resizing in later calls to the queue setup function.
 	 */
-	size = sizeof(union e1000_adv_tx_desc) * IGB_MAX_RING_DESC;
+	size = sizeof(union e1000_adv_tx_desc) * E1000_MAX_RING_DESC;
 	tz = ring_dma_zone_reserve(dev, "tx_ring", queue_idx,
 					size, socket_id);
 	if (tz == NULL) {
@@ -1430,10 +1418,11 @@ eth_igb_rx_queue_setup(struct rte_eth_dev *dev,
 	/*
 	 * Validate number of receive descriptors.
 	 * It must not exceed hardware maximum, and must be multiple
-	 * of IGB_ALIGN.
+	 * of E1000_ALIGN.
 	 */
-	if (((nb_desc * sizeof(union e1000_adv_rx_desc)) % IGB_ALIGN) != 0 ||
-	    (nb_desc > IGB_MAX_RING_DESC) || (nb_desc < IGB_MIN_RING_DESC)) {
+	if (nb_desc % IGB_RXD_ALIGN != 0 ||
+			(nb_desc > E1000_MAX_RING_DESC) ||
+			(nb_desc < E1000_MIN_RING_DESC)) {
 		return (-EINVAL);
 	}
 
@@ -1469,7 +1458,7 @@ eth_igb_rx_queue_setup(struct rte_eth_dev *dev,
 	 *  handle the maximum ring size is allocated in order to allow for
 	 *  resizing in later calls to the queue setup function.
 	 */
-	size = sizeof(union e1000_adv_rx_desc) * IGB_MAX_RING_DESC;
+	size = sizeof(union e1000_adv_rx_desc) * E1000_MAX_RING_DESC;
 	rz = ring_dma_zone_reserve(dev, "rx_ring", queue_idx, size, socket_id);
 	if (rz == NULL) {
 		igb_rx_queue_release(rxq);
@@ -2482,3 +2471,34 @@ eth_igbvf_tx_init(struct rte_eth_dev *dev)
 	}
 
 }
+
+void
+igb_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+	struct rte_eth_rxq_info *qinfo)
+{
+	struct igb_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_rx_desc;
+
+	qinfo->conf.rx_free_thresh = rxq->rx_free_thresh;
+	qinfo->conf.rx_drop_en = rxq->drop_en;
+}
+
+void
+igb_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+	struct rte_eth_txq_info *qinfo)
+{
+	struct igb_tx_queue *txq;
+
+	txq = dev->data->tx_queues[queue_id];
+
+	qinfo->nb_desc = txq->nb_tx_desc;
+
+	qinfo->conf.tx_thresh.pthresh = txq->pthresh;
+	qinfo->conf.tx_thresh.hthresh = txq->hthresh;
+	qinfo->conf.tx_thresh.wthresh = txq->wthresh;
+}
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [dpdk-dev] [PATCHv5 5/8] fm10k: add HW specific desc_lim data into dev_info
  2015-10-01 19:54 [dpdk-dev] [PATCHv5 0/8] ethdev: add new API to retrieve RX/TX queue information Konstantin Ananyev
                   ` (3 preceding siblings ...)
  2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 4/8] e1000: " Konstantin Ananyev
@ 2015-10-01 19:54 ` Konstantin Ananyev
  2015-10-14 12:48   ` Remy Horton
  2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 6/8] cxgbe: " Konstantin Ananyev
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 43+ messages in thread
From: Konstantin Ananyev @ 2015-10-01 19:54 UTC (permalink / raw)
  To: dev

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 drivers/net/fm10k/fm10k_ethdev.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index a69c990..9588dab 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -964,6 +964,17 @@ fm10k_dev_infos_get(struct rte_eth_dev *dev,
 				ETH_TXQ_FLAGS_NOOFFLOADS,
 	};
 
+	dev_info->rx_desc_lim = (struct rte_eth_desc_lim) {
+		.nb_max = FM10K_MAX_RX_DESC,
+		.nb_min = FM10K_MIN_RX_DESC,
+		.nb_align = FM10K_MULT_RX_DESC,
+	};
+
+	dev_info->tx_desc_lim = (struct rte_eth_desc_lim) {
+		.nb_max = FM10K_MAX_TX_DESC,
+		.nb_min = FM10K_MIN_TX_DESC,
+		.nb_align = FM10K_MULT_TX_DESC,
+	};
 }
 
 static int
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [dpdk-dev] [PATCHv5 6/8] cxgbe: add HW specific desc_lim data into dev_info
  2015-10-01 19:54 [dpdk-dev] [PATCHv5 0/8] ethdev: add new API to retrieve RX/TX queue information Konstantin Ananyev
                   ` (4 preceding siblings ...)
  2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 5/8] fm10k: add HW specific desc_lim data into dev_info Konstantin Ananyev
@ 2015-10-01 19:54 ` Konstantin Ananyev
  2015-10-14 12:49   ` Remy Horton
  2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 7/8] vmxnet3: " Konstantin Ananyev
  2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 8/8] testpmd: add new command to display RX/TX queue information Konstantin Ananyev
  7 siblings, 1 reply; 43+ messages in thread
From: Konstantin Ananyev @ 2015-10-01 19:54 UTC (permalink / raw)
  To: dev

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 drivers/net/cxgbe/cxgbe_ethdev.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index 478051a..6d26899 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -141,6 +141,12 @@ static void cxgbe_dev_info_get(struct rte_eth_dev *eth_dev,
 	struct adapter *adapter = pi->adapter;
 	int max_queues = adapter->sge.max_ethqsets / adapter->params.nports;
 
+	static const struct rte_eth_desc_lim cxgbe_desc_lim = {
+		.nb_max = CXGBE_MAX_RING_DESC_SIZE,
+		.nb_min = CXGBE_MIN_RING_DESC_SIZE,
+		.nb_align = 1,
+	};
+
 	device_info->min_rx_bufsize = 68; /* XXX: Smallest pkt size */
 	device_info->max_rx_pktlen = 1500; /* XXX: For now we support mtu */
 	device_info->max_rx_queues = max_queues;
@@ -162,6 +168,9 @@ static void cxgbe_dev_info_get(struct rte_eth_dev *eth_dev,
 				       DEV_TX_OFFLOAD_TCP_TSO;
 
 	device_info->reta_size = pi->rss_size;
+
+	device_info->rx_desc_lim = cxgbe_desc_lim;
+	device_info->tx_desc_lim = cxgbe_desc_lim;
 }
 
 static void cxgbe_dev_promiscuous_enable(struct rte_eth_dev *eth_dev)
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [dpdk-dev] [PATCHv5 7/8] vmxnet3: add HW specific desc_lim data into dev_info
  2015-10-01 19:54 [dpdk-dev] [PATCHv5 0/8] ethdev: add new API to retrieve RX/TX queue information Konstantin Ananyev
                   ` (5 preceding siblings ...)
  2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 6/8] cxgbe: " Konstantin Ananyev
@ 2015-10-01 19:54 ` Konstantin Ananyev
  2015-10-14 12:49   ` Remy Horton
  2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 8/8] testpmd: add new command to display RX/TX queue information Konstantin Ananyev
  7 siblings, 1 reply; 43+ messages in thread
From: Konstantin Ananyev @ 2015-10-01 19:54 UTC (permalink / raw)
  To: dev

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index a70be5c..3745b7d 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -677,6 +677,18 @@ vmxnet3_dev_info_get(__attribute__((unused))struct rte_eth_dev *dev, struct rte_
 	dev_info->default_txconf.txq_flags = ETH_TXQ_FLAGS_NOMULTSEGS |
 						ETH_TXQ_FLAGS_NOOFFLOADS;
 	dev_info->flow_type_rss_offloads = VMXNET3_RSS_OFFLOAD_ALL;
+
+	dev_info->rx_desc_lim = (struct rte_eth_desc_lim) {
+		.nb_max = VMXNET3_RX_RING_MAX_SIZE,
+		.nb_min = VMXNET3_DEF_RX_RING_SIZE,
+		.nb_align = 1,
+	};
+
+	dev_info->tx_desc_lim = (struct rte_eth_desc_lim) {
+		.nb_max = VMXNET3_TX_RING_MAX_SIZE,
+		.nb_min = VMXNET3_DEF_TX_RING_SIZE,
+		.nb_align = 1,
+	};
 }
 
 /* return 0 means link status changed, -1 means not changed */
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [dpdk-dev] [PATCHv5 8/8] testpmd: add new command to display RX/TX queue information
  2015-10-01 19:54 [dpdk-dev] [PATCHv5 0/8] ethdev: add new API to retrieve RX/TX queue information Konstantin Ananyev
                   ` (6 preceding siblings ...)
  2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 7/8] vmxnet3: " Konstantin Ananyev
@ 2015-10-01 19:54 ` Konstantin Ananyev
  2015-10-14 12:49   ` Remy Horton
  7 siblings, 1 reply; 43+ messages in thread
From: Konstantin Ananyev @ 2015-10-01 19:54 UTC (permalink / raw)
  To: dev

From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 app/test-pmd/cmdline.c | 48 +++++++++++++++++++++++++++++++
 app/test-pmd/config.c  | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++
 app/test-pmd/testpmd.h |  2 ++
 3 files changed, 127 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 0f8f48f..ea2b8a8 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -5305,6 +5305,53 @@ cmdline_parse_inst_t cmd_showport = {
 	},
 };
 
+/* *** SHOW QUEUE INFO *** */
+struct cmd_showqueue_result {
+	cmdline_fixed_string_t show;
+	cmdline_fixed_string_t type;
+	cmdline_fixed_string_t what;
+	uint8_t portnum;
+	uint16_t queuenum;
+};
+
+static void
+cmd_showqueue_parsed(void *parsed_result,
+	__attribute__((unused)) struct cmdline *cl,
+	__attribute__((unused)) void *data)
+{
+	struct cmd_showqueue_result *res = parsed_result;
+
+	if (!strcmp(res->type, "rxq"))
+		rx_queue_infos_display(res->portnum, res->queuenum);
+	else if (!strcmp(res->type, "txq"))
+		tx_queue_infos_display(res->portnum, res->queuenum);
+}
+
+cmdline_parse_token_string_t cmd_showqueue_show =
+	TOKEN_STRING_INITIALIZER(struct cmd_showqueue_result, show, "show");
+cmdline_parse_token_string_t cmd_showqueue_type =
+	TOKEN_STRING_INITIALIZER(struct cmd_showqueue_result, type, "rxq#txq");
+cmdline_parse_token_string_t cmd_showqueue_what =
+	TOKEN_STRING_INITIALIZER(struct cmd_showqueue_result, what, "info");
+cmdline_parse_token_num_t cmd_showqueue_portnum =
+	TOKEN_NUM_INITIALIZER(struct cmd_showqueue_result, portnum, UINT8);
+cmdline_parse_token_num_t cmd_showqueue_queuenum =
+	TOKEN_NUM_INITIALIZER(struct cmd_showqueue_result, queuenum, UINT16);
+
+cmdline_parse_inst_t cmd_showqueue = {
+	.f = cmd_showqueue_parsed,
+	.data = NULL,
+	.help_str = "show rxq|txq info <port number> <queue_number>",
+	.tokens = {
+		(void *)&cmd_showqueue_show,
+		(void *)&cmd_showqueue_type,
+		(void *)&cmd_showqueue_what,
+		(void *)&cmd_showqueue_portnum,
+		(void *)&cmd_showqueue_queuenum,
+		NULL,
+	},
+};
+
 /* *** READ PORT REGISTER *** */
 struct cmd_read_reg_result {
 	cmdline_fixed_string_t read;
@@ -8910,6 +8957,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_help_long,
 	(cmdline_parse_inst_t *)&cmd_quit,
 	(cmdline_parse_inst_t *)&cmd_showport,
+	(cmdline_parse_inst_t *)&cmd_showqueue,
 	(cmdline_parse_inst_t *)&cmd_showportall,
 	(cmdline_parse_inst_t *)&cmd_showcfg,
 	(cmdline_parse_inst_t *)&cmd_start,
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index cf2aa6e..aad2ab6 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -293,6 +293,69 @@ nic_stats_mapping_display(portid_t port_id)
 }
 
 void
+rx_queue_infos_display(portid_t port_id, uint16_t queue_id)
+{
+	struct rte_eth_rxq_info qinfo;
+	int32_t rc;
+	static const char *info_border = "*********************";
+
+	rc = rte_eth_rx_queue_info_get(port_id, queue_id, &qinfo);
+	if (rc != 0) {
+		printf("Failed to retrieve information for port: %hhu, "
+			"RX queue: %hu\nerror desc: %s(%d)\n",
+			port_id, queue_id, strerror(-rc), rc);
+		return;
+	}
+
+	printf("\n%s Infos for port %-2u, RX queue %-2u %s",
+	       info_border, port_id, queue_id, info_border);
+
+	printf("\nMempool: %s", (qinfo.mp == NULL) ? "NULL" : qinfo.mp->name);
+	printf("\nRX prefetch threshold: %hhu", qinfo.conf.rx_thresh.pthresh);
+	printf("\nRX host threshold: %hhu", qinfo.conf.rx_thresh.hthresh);
+	printf("\nRX writeback threshold: %hhu", qinfo.conf.rx_thresh.wthresh);
+	printf("\nRX free threshold: %hu", qinfo.conf.rx_free_thresh);
+	printf("\nRX drop packets: %s",
+		(qinfo.conf.rx_drop_en != 0) ? "on" : "off");
+	printf("\nRX deferred start: %s",
+		(qinfo.conf.rx_deferred_start != 0) ? "on" : "off");
+	printf("\nRX scattered packets: %s",
+		(qinfo.scattered_rx != 0) ? "on" : "off");
+	printf("\nNumber of RXDs: %hu", qinfo.nb_desc);
+	printf("\n");
+}
+
+void
+tx_queue_infos_display(portid_t port_id, uint16_t queue_id)
+{
+	struct rte_eth_txq_info qinfo;
+	int32_t rc;
+	static const char *info_border = "*********************";
+
+	rc = rte_eth_tx_queue_info_get(port_id, queue_id, &qinfo);
+	if (rc != 0) {
+		printf("Failed to retrieve information for port: %hhu, "
+			"TX queue: %hu\nerror desc: %s(%d)\n",
+			port_id, queue_id, strerror(-rc), rc);
+		return;
+	}
+
+	printf("\n%s Infos for port %-2u, TX queue %-2u %s",
+	       info_border, port_id, queue_id, info_border);
+
+	printf("\nTX prefetch threshold: %hhu", qinfo.conf.tx_thresh.pthresh);
+	printf("\nTX host threshold: %hhu", qinfo.conf.tx_thresh.hthresh);
+	printf("\nTX writeback threshold: %hhu", qinfo.conf.tx_thresh.wthresh);
+	printf("\nTX RS threshold: %hu", qinfo.conf.tx_rs_thresh);
+	printf("\nTX free threshold: %hu", qinfo.conf.tx_free_thresh);
+	printf("\nTX flags: %#x", qinfo.conf.txq_flags);
+	printf("\nTX deferred start: %s",
+		(qinfo.conf.tx_deferred_start != 0) ? "on" : "off");
+	printf("\nNumber of TXDs: %hu", qinfo.nb_desc);
+	printf("\n");
+}
+
+void
 port_infos_display(portid_t port_id)
 {
 	struct rte_port *port;
@@ -380,6 +443,20 @@ port_infos_display(portid_t port_id)
 			printf("  %s\n", (p ? p : "unknown"));
 		}
 	}
+
+	printf("Max possible RX queues: %u\n", dev_info.max_rx_queues);
+	printf("Max possible number of RXDs per queue: %hu\n",
+		dev_info.rx_desc_lim.nb_max);
+	printf("Min possible number of RXDs per queue: %hu\n",
+		dev_info.rx_desc_lim.nb_min);
+	printf("RXDs number alignment: %hu\n", dev_info.rx_desc_lim.nb_align);
+
+	printf("Max possible TX queues: %u\n", dev_info.max_tx_queues);
+	printf("Max possible number of TXDs per queue: %hu\n",
+		dev_info.tx_desc_lim.nb_max);
+	printf("Min possible number of TXDs per queue: %hu\n",
+		dev_info.tx_desc_lim.nb_min);
+	printf("TXDs number alignment: %hu\n", dev_info.tx_desc_lim.nb_align);
 }
 
 int
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index d287274..2551704 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -480,6 +480,8 @@ void nic_xstats_display(portid_t port_id);
 void nic_xstats_clear(portid_t port_id);
 void nic_stats_mapping_display(portid_t port_id);
 void port_infos_display(portid_t port_id);
+void rx_queue_infos_display(portid_t port_idi, uint16_t queue_id);
+void tx_queue_infos_display(portid_t port_idi, uint16_t queue_id);
 void fwd_lcores_config_display(void);
 void fwd_config_display(void);
 void rxtx_config_display(void);
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [dpdk-dev] [dpdk-dev, PATCHv5, 1/8] ethdev: add new API to retrieve RX/TX queue information
  2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 1/8] " Konstantin Ananyev
@ 2015-10-14 11:39   ` Amine Kherbouche
  2015-10-14 11:49     ` Ananyev, Konstantin
  2015-10-14 12:44   ` [dpdk-dev] [PATCHv5 " Remy Horton
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 43+ messages in thread
From: Amine Kherbouche @ 2015-10-14 11:39 UTC (permalink / raw)
  To: Ananyev, Konstantin, dev



Hi Konstantin
> +/**
> + * Ethernet device RX queue information structure.
> + * Used to retieve information about configured queue.
> + */
> +struct rte_eth_rxq_info {
> +	struct rte_mempool *mp;     /**< mempool used by that queue. */
> +	struct rte_eth_rxconf conf; /**< queue config parameters. */
> +	uint8_t scattered_rx;       /**< scattered packets RX supported. */
> +	uint16_t nb_desc;           /**< configured number of RXDs. */
Here i need two more fields in this struct :
     uint16_t free_desc : for free queue descriptors
     uint16_t used_desc : for used queue descriptors
> +} __rte_cache_aligned;
> +
> +/**
> + * Ethernet device TX queue information structure.
> + * Used to retieve information about configured queue.
> + */
> +struct rte_eth_txq_info {
> +	struct rte_eth_txconf conf; /**< queue config parameters. */
> +	uint16_t nb_desc;           /**< configured number of TXDs. */
And also here.
> +} __rte_cache_aligned;
> +
>   struct rte_eth_dev;
How to add them without breaking API ? I would prefer to see them now, so
I'll send an update on your patch series that i'll use this 2 more
fields. The purpose will be to provide analysis of the usage of the RX
and TX queues.

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [dpdk-dev] [dpdk-dev, PATCHv5, 1/8] ethdev: add new API to retrieve RX/TX queue information
  2015-10-14 11:39   ` [dpdk-dev] [dpdk-dev, PATCHv5, " Amine Kherbouche
@ 2015-10-14 11:49     ` Ananyev, Konstantin
  2015-10-14 12:21       ` Amine Kherbouche
  2015-10-20  7:53       ` Qiu, Michael
  0 siblings, 2 replies; 43+ messages in thread
From: Ananyev, Konstantin @ 2015-10-14 11:49 UTC (permalink / raw)
  To: Amine Kherbouche, dev

Hi Amine,

> -----Original Message-----
> From: Amine Kherbouche [mailto:amine.kherbouche@6wind.com]
> Sent: Wednesday, October 14, 2015 12:40 PM
> To: Ananyev, Konstantin; dev@dpdk.org
> Subject: Re: [dpdk-dev, PATCHv5, 1/8] ethdev: add new API to retrieve RX/TX queue information
> 
> 
> 
> Hi Konstantin
> > +/**
> > + * Ethernet device RX queue information structure.
> > + * Used to retieve information about configured queue.
> > + */
> > +struct rte_eth_rxq_info {
> > +	struct rte_mempool *mp;     /**< mempool used by that queue. */
> > +	struct rte_eth_rxconf conf; /**< queue config parameters. */
> > +	uint8_t scattered_rx;       /**< scattered packets RX supported. */
> > +	uint16_t nb_desc;           /**< configured number of RXDs. */
> Here i need two more fields in this struct :
>      uint16_t free_desc : for free queue descriptors
>      uint16_t used_desc : for used queue descriptors
> > +} __rte_cache_aligned;

Yep, that’s good thing to have.
But to fill them properly extra work is required, so my thought was to left it for future expansion.

> > +
> > +/**
> > + * Ethernet device TX queue information structure.
> > + * Used to retieve information about configured queue.
> > + */
> > +struct rte_eth_txq_info {
> > +	struct rte_eth_txconf conf; /**< queue config parameters. */
> > +	uint16_t nb_desc;           /**< configured number of TXDs. */
> And also here.
> > +} __rte_cache_aligned;
> > +
> >   struct rte_eth_dev;
> How to add them without breaking API ?

As I said in the patch comments:
"left extra free space in the queue info structures,
so extra fields could be added later without ABI breakage."
As you can see both queue info structures have size 64B each.
So there is plenty of space for expansion without ABI breakage.  

 I would prefer to see them now, so
> I'll send an update on your patch series that i'll use this 2 more
> fields. The purpose will be to provide analysis of the usage of the RX
> and TX queues.

Well, in general I am not opposed to add these fields to the structures.
In fact, I think it is a good thing to have.
But if we'll add them without making queue_info_get() feeling them properly -
it might create a lot of controversy.
So unless you prepared to make changes in all queue_info_get() too,
my opinion - let's leave it as it is for 2.2, and add new fields in later releases.
As I said above - ABI wouldn't be affected.

Konstantin



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [dpdk-dev] [dpdk-dev, PATCHv5, 1/8] ethdev: add new API to retrieve RX/TX queue information
  2015-10-14 11:49     ` Ananyev, Konstantin
@ 2015-10-14 12:21       ` Amine Kherbouche
  2015-10-14 12:42         ` Ananyev, Konstantin
  2015-10-20  7:53       ` Qiu, Michael
  1 sibling, 1 reply; 43+ messages in thread
From: Amine Kherbouche @ 2015-10-14 12:21 UTC (permalink / raw)
  To: Ananyev, Konstantin, dev


Hi Konstantin

> Well, in general I am not opposed to add these fields to the structures.
> In fact, I think it is a good thing to have.
> But if we'll add them without making queue_info_get() feeling them properly -
> it might create a lot of controversy.
> So unless you prepared to make changes in all queue_info_get() too,
> my opinion - let's leave it as it is for 2.2, and add new fields in later releases.
Thanks for your answer, I'm almost done with all changes in 
queue_info_get(), so i have just to
test and send a series of v6 for your series.

Best,
Amine Kherbouche

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [dpdk-dev] [dpdk-dev, PATCHv5, 1/8] ethdev: add new API to retrieve RX/TX queue information
  2015-10-14 12:21       ` Amine Kherbouche
@ 2015-10-14 12:42         ` Ananyev, Konstantin
  2015-10-14 12:47           ` Amine Kherbouche
  0 siblings, 1 reply; 43+ messages in thread
From: Ananyev, Konstantin @ 2015-10-14 12:42 UTC (permalink / raw)
  To: Amine Kherbouche, dev



> -----Original Message-----
> From: Amine Kherbouche [mailto:amine.kherbouche@6wind.com]
> Sent: Wednesday, October 14, 2015 1:22 PM
> To: Ananyev, Konstantin; dev@dpdk.org
> Subject: Re: [dpdk-dev, PATCHv5, 1/8] ethdev: add new API to retrieve RX/TX queue information
> 
> 
> Hi Konstantin
> 
> > Well, in general I am not opposed to add these fields to the structures.
> > In fact, I think it is a good thing to have.
> > But if we'll add them without making queue_info_get() feeling them properly -
> > it might create a lot of controversy.
> > So unless you prepared to make changes in all queue_info_get() too,
> > my opinion - let's leave it as it is for 2.2, and add new fields in later releases.
> Thanks for your answer, I'm almost done with all changes in
> queue_info_get(), so i have just to
> test and send a series of v6 for your series.

So your v6 will make all implemented queue_info_get()s to fill these two new fields correctly, right?
Konstantin

> 
> Best,
> Amine Kherbouche

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [dpdk-dev] [PATCHv5 1/8] ethdev: add new API to retrieve RX/TX queue information
  2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 1/8] " Konstantin Ananyev
  2015-10-14 11:39   ` [dpdk-dev] [dpdk-dev, PATCHv5, " Amine Kherbouche
@ 2015-10-14 12:44   ` Remy Horton
  2015-10-14 16:09   ` Stephen Hemminger
  2015-10-19 22:06   ` [dpdk-dev] [dpdk-dev,PATCHv6 0/6] Enhance queue information API Amine Kherbouche
  3 siblings, 0 replies; 43+ messages in thread
From: Remy Horton @ 2015-10-14 12:44 UTC (permalink / raw)
  To: dev


On 01/10/2015 20:54, Konstantin Ananyev wrote:

> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

Acked-by: Remy Horton <remy.horton@intel.com>

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [dpdk-dev] [PATCHv5 2/8] i40e: add support for eth_(rxq|txq)_info_get and (rx|tx)_desc_lim
  2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 2/8] i40e: add support for eth_(rxq|txq)_info_get and (rx|tx)_desc_lim Konstantin Ananyev
@ 2015-10-14 12:46   ` Remy Horton
  0 siblings, 0 replies; 43+ messages in thread
From: Remy Horton @ 2015-10-14 12:46 UTC (permalink / raw)
  To: dev



On 01/10/2015 20:54, Konstantin Ananyev wrote:
> From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
>
> This patch assumes that the patch:
> i40e: fix wrong alignment for the number of HW descriptors
> already applied.
>
> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

Acked-by: Remy Horton <remy.horton@intel.com>

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [dpdk-dev] [dpdk-dev, PATCHv5, 1/8] ethdev: add new API to retrieve RX/TX queue information
  2015-10-14 12:42         ` Ananyev, Konstantin
@ 2015-10-14 12:47           ` Amine Kherbouche
  2015-10-14 12:48             ` Ananyev, Konstantin
  0 siblings, 1 reply; 43+ messages in thread
From: Amine Kherbouche @ 2015-10-14 12:47 UTC (permalink / raw)
  To: Ananyev, Konstantin, dev



>
> So your v6 will make all implemented queue_info_get()s to fill these two new fields correctly, right?
> Konstantin
Yes.

Amine Kherbouche

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [dpdk-dev] [PATCHv5 3/8] ixgbe: add support for eth_(rxq|txq)_info_get and (rx|tx)_desc_lim
  2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 3/8] ixgbe: " Konstantin Ananyev
@ 2015-10-14 12:47   ` Remy Horton
  0 siblings, 0 replies; 43+ messages in thread
From: Remy Horton @ 2015-10-14 12:47 UTC (permalink / raw)
  To: dev


On 01/10/2015 20:54, Konstantin Ananyev wrote:
> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

Acked-by: Remy Horton <remy.horton@intel.com>

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [dpdk-dev] [PATCHv5 4/8] e1000: add support for eth_(rxq|txq)_info_get and (rx|tx)_desc_lim
  2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 4/8] e1000: " Konstantin Ananyev
@ 2015-10-14 12:48   ` Remy Horton
  0 siblings, 0 replies; 43+ messages in thread
From: Remy Horton @ 2015-10-14 12:48 UTC (permalink / raw)
  To: dev


On 01/10/2015 20:54, Konstantin Ananyev wrote:
> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

Acked-by: Remy Horton <remy.horton@intel.com>

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [dpdk-dev] [dpdk-dev, PATCHv5, 1/8] ethdev: add new API to retrieve RX/TX queue information
  2015-10-14 12:47           ` Amine Kherbouche
@ 2015-10-14 12:48             ` Ananyev, Konstantin
  0 siblings, 0 replies; 43+ messages in thread
From: Ananyev, Konstantin @ 2015-10-14 12:48 UTC (permalink / raw)
  To: Amine Kherbouche, dev



> -----Original Message-----
> From: Amine Kherbouche [mailto:amine.kherbouche@6wind.com]
> Sent: Wednesday, October 14, 2015 1:47 PM
> To: Ananyev, Konstantin; dev@dpdk.org
> Subject: Re: [dpdk-dev, PATCHv5, 1/8] ethdev: add new API to retrieve RX/TX queue information
> 
> 
> 
> >
> > So your v6 will make all implemented queue_info_get()s to fill these two new fields correctly, right?
> > Konstantin
> Yes.

Ok great, will wait for v6 then.
Konstantin

> 
> Amine Kherbouche

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [dpdk-dev] [PATCHv5 5/8] fm10k: add HW specific desc_lim data into dev_info
  2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 5/8] fm10k: add HW specific desc_lim data into dev_info Konstantin Ananyev
@ 2015-10-14 12:48   ` Remy Horton
  0 siblings, 0 replies; 43+ messages in thread
From: Remy Horton @ 2015-10-14 12:48 UTC (permalink / raw)
  To: dev



On 01/10/2015 20:54, Konstantin Ananyev wrote:
> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

Acked-by: Remy Horton <remy.horton@intel.com>

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [dpdk-dev] [PATCHv5 6/8] cxgbe: add HW specific desc_lim data into dev_info
  2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 6/8] cxgbe: " Konstantin Ananyev
@ 2015-10-14 12:49   ` Remy Horton
  0 siblings, 0 replies; 43+ messages in thread
From: Remy Horton @ 2015-10-14 12:49 UTC (permalink / raw)
  To: dev


On 01/10/2015 20:54, Konstantin Ananyev wrote:
> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

Acked-by: Remy Horton <remy.horton@intel.com>

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [dpdk-dev] [PATCHv5 7/8] vmxnet3: add HW specific desc_lim data into dev_info
  2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 7/8] vmxnet3: " Konstantin Ananyev
@ 2015-10-14 12:49   ` Remy Horton
  0 siblings, 0 replies; 43+ messages in thread
From: Remy Horton @ 2015-10-14 12:49 UTC (permalink / raw)
  To: dev



On 01/10/2015 20:54, Konstantin Ananyev wrote:
> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

Acked-by: Remy Horton <remy.horton@intel.com>

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [dpdk-dev] [PATCHv5 8/8] testpmd: add new command to display RX/TX queue information
  2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 8/8] testpmd: add new command to display RX/TX queue information Konstantin Ananyev
@ 2015-10-14 12:49   ` Remy Horton
  0 siblings, 0 replies; 43+ messages in thread
From: Remy Horton @ 2015-10-14 12:49 UTC (permalink / raw)
  To: dev


On 01/10/2015 20:54, Konstantin Ananyev wrote:
> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

Acked-by: Remy Horton <remy.horton@intel.com>

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [dpdk-dev] [PATCHv5 1/8] ethdev: add new API to retrieve RX/TX queue information
  2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 1/8] " Konstantin Ananyev
  2015-10-14 11:39   ` [dpdk-dev] [dpdk-dev, PATCHv5, " Amine Kherbouche
  2015-10-14 12:44   ` [dpdk-dev] [PATCHv5 " Remy Horton
@ 2015-10-14 16:09   ` Stephen Hemminger
  2015-10-14 18:44     ` Ananyev, Konstantin
  2015-10-19 22:06   ` [dpdk-dev] [dpdk-dev,PATCHv6 0/6] Enhance queue information API Amine Kherbouche
  3 siblings, 1 reply; 43+ messages in thread
From: Stephen Hemminger @ 2015-10-14 16:09 UTC (permalink / raw)
  To: Konstantin Ananyev; +Cc: dev

On Thu,  1 Oct 2015 20:54:46 +0100
Konstantin Ananyev <konstantin.ananyev@intel.com> wrote:

> +	if (nb_rx_desc > dev_info.rx_desc_lim.nb_max ||
> +			nb_rx_desc < dev_info.rx_desc_lim.nb_min ||
> +			nb_rx_desc % dev_info.rx_desc_lim.nb_align != 0) {
> +

Preferred indentation style is to line up the conditional.
	if (nb_rx_desc > dev_info.rx_desc_lim.nb_max ||
	    nb_rx_desc < dev_info.rx_desc_lim.nb_min ||
	    nb_rx_desc % dev_info.rx_desc_lim.nb_align != 0) {

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [dpdk-dev] [PATCHv5 1/8] ethdev: add new API to retrieve RX/TX queue information
  2015-10-14 16:09   ` Stephen Hemminger
@ 2015-10-14 18:44     ` Ananyev, Konstantin
  2015-10-16 13:16       ` Bruce Richardson
  0 siblings, 1 reply; 43+ messages in thread
From: Ananyev, Konstantin @ 2015-10-14 18:44 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev



> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Wednesday, October 14, 2015 5:09 PM
> To: Ananyev, Konstantin
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCHv5 1/8] ethdev: add new API to retrieve RX/TX queue information
> 
> On Thu,  1 Oct 2015 20:54:46 +0100
> Konstantin Ananyev <konstantin.ananyev@intel.com> wrote:
> 
> > +	if (nb_rx_desc > dev_info.rx_desc_lim.nb_max ||
> > +			nb_rx_desc < dev_info.rx_desc_lim.nb_min ||
> > +			nb_rx_desc % dev_info.rx_desc_lim.nb_align != 0) {
> > +
> 
> Preferred indentation style is to line up the conditional.
> 	if (nb_rx_desc > dev_info.rx_desc_lim.nb_max ||
> 	    nb_rx_desc < dev_info.rx_desc_lim.nb_min ||
> 	    nb_rx_desc % dev_info.rx_desc_lim.nb_align != 0) {


As I remember within DPDK we use an extra tab as preferred indentation style for several years.
Why it suddenly changed now?
Konstantin

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [dpdk-dev] [PATCHv5 1/8] ethdev: add new API to retrieve RX/TX queue information
  2015-10-14 18:44     ` Ananyev, Konstantin
@ 2015-10-16 13:16       ` Bruce Richardson
  0 siblings, 0 replies; 43+ messages in thread
From: Bruce Richardson @ 2015-10-16 13:16 UTC (permalink / raw)
  To: Ananyev, Konstantin; +Cc: dev

On Wed, Oct 14, 2015 at 06:44:38PM +0000, Ananyev, Konstantin wrote:
> 
> 
> > -----Original Message-----
> > From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> > Sent: Wednesday, October 14, 2015 5:09 PM
> > To: Ananyev, Konstantin
> > Cc: dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCHv5 1/8] ethdev: add new API to retrieve RX/TX queue information
> > 
> > On Thu,  1 Oct 2015 20:54:46 +0100
> > Konstantin Ananyev <konstantin.ananyev@intel.com> wrote:
> > 
> > > +	if (nb_rx_desc > dev_info.rx_desc_lim.nb_max ||
> > > +			nb_rx_desc < dev_info.rx_desc_lim.nb_min ||
> > > +			nb_rx_desc % dev_info.rx_desc_lim.nb_align != 0) {
> > > +
> > 
> > Preferred indentation style is to line up the conditional.
> > 	if (nb_rx_desc > dev_info.rx_desc_lim.nb_max ||
> > 	    nb_rx_desc < dev_info.rx_desc_lim.nb_min ||
> > 	    nb_rx_desc % dev_info.rx_desc_lim.nb_align != 0) {
> 
> 
> As I remember within DPDK we use an extra tab as preferred indentation style for several years.
> Why it suddenly changed now?
> Konstantin
>
We actually have a mix of styles, some using double-indent on continuation, and
some using aligning as above. I prefer the double indent, as I don't like mixing
tabs and spaces for indentation and the resulting line-up of lines for those poor
souls using 4-char tabs, but overall, the global rule is to try and copy the
existing style in the file being modified. There are already instances of
this style of indent in ethdev.c [I checked, which is why I didn't object myself
to Stephen's comment :-)]

/Bruce

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [dpdk-dev] [dpdk-dev,PATCHv6 0/6] Enhance queue information API.
  2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 1/8] " Konstantin Ananyev
                     ` (2 preceding siblings ...)
  2015-10-14 16:09   ` Stephen Hemminger
@ 2015-10-19 22:06   ` Amine Kherbouche
  2015-10-19 22:06     ` [dpdk-dev] [dpdk-dev, PATCHv6 1/6] ethdev: enhance rte_eth_(tx|rx)q_info struct Amine Kherbouche
                       ` (5 more replies)
  3 siblings, 6 replies; 43+ messages in thread
From: Amine Kherbouche @ 2015-10-19 22:06 UTC (permalink / raw)
  To: dev; +Cc: amine.kherbouche

This v6 series is an enhancement to queue information API v5.

Amine Kherbouche (6):
  ethdev: enhance rte_eth_(tx|rx)q_info struct
  testpmd: enhance the command to display RX/TX queue information
  virtio: add support for eth_(rxq|txq)_info_get
  e1000: enhance eth_(rxq|txq)_info_get to retrieve more queue
    information
  i40e: enhance eth_(rxq|txq)_info_get to retrieve more queue
    information
  ixgbe: enhance eth_(rxq|txq)_info_get to retrieve more queue
    information

 app/test-pmd/config.c              |    8 ++++++--
 drivers/net/e1000/em_rxtx.c        |    4 ++++
 drivers/net/e1000/igb_rxtx.c       |    4 ++++
 drivers/net/i40e/i40e_rxtx.c       |    4 ++++
 drivers/net/ixgbe/ixgbe_rxtx.c     |    4 ++++
 drivers/net/virtio/virtio_ethdev.c |   28 ++++++++++++++++++++++++++++
 drivers/net/virtio/virtio_ethdev.h |    4 ++++
 lib/librte_ether/rte_ethdev.h      |    4 ++++
 8 files changed, 58 insertions(+), 2 deletions(-)

-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [dpdk-dev] [dpdk-dev, PATCHv6 1/6] ethdev: enhance rte_eth_(tx|rx)q_info struct
  2015-10-19 22:06   ` [dpdk-dev] [dpdk-dev,PATCHv6 0/6] Enhance queue information API Amine Kherbouche
@ 2015-10-19 22:06     ` Amine Kherbouche
  2015-10-19 22:44       ` Stephen Hemminger
  2015-10-20  9:36       ` Ananyev, Konstantin
  2015-10-19 22:06     ` [dpdk-dev] [dpdk-dev, PATCHv6 2/6] testpmd: enhance the command to display RX/TX queue information Amine Kherbouche
                       ` (4 subsequent siblings)
  5 siblings, 2 replies; 43+ messages in thread
From: Amine Kherbouche @ 2015-10-19 22:06 UTC (permalink / raw)
  To: dev; +Cc: amine.kherbouche

Add 2 fields in struct rte_eth_(tx|rx)q_info :
- used_desc : for used queue descriptors
- free_desc : for free queue descriptors
for ability to query more information from queues.

Signed-off-by: Amine Kherbouche <amine.kherbouche@6wind.com>
---
 lib/librte_ether/rte_ethdev.h |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 4d7b6f2..5fc86a0 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -874,6 +874,8 @@ struct rte_eth_rxq_info {
 	struct rte_eth_rxconf conf; /**< queue config parameters. */
 	uint8_t scattered_rx;       /**< scattered packets RX supported. */
 	uint16_t nb_desc;           /**< configured number of RXDs. */
+	uint16_t used_desc;         /**< number of used descriptors */
+	uint16_t free_desc;         /**< number of free descriptors */
 } __rte_cache_aligned;
 
 /**
@@ -883,6 +885,8 @@ struct rte_eth_rxq_info {
 struct rte_eth_txq_info {
 	struct rte_eth_txconf conf; /**< queue config parameters. */
 	uint16_t nb_desc;           /**< configured number of TXDs. */
+	uint16_t used_desc;         /**< number of used descriptors */
+	uint16_t free_desc;         /**< number of free descriptors */
 } __rte_cache_aligned;
 
 struct rte_eth_dev;
-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [dpdk-dev] [dpdk-dev, PATCHv6 2/6] testpmd: enhance the command to display RX/TX queue information
  2015-10-19 22:06   ` [dpdk-dev] [dpdk-dev,PATCHv6 0/6] Enhance queue information API Amine Kherbouche
  2015-10-19 22:06     ` [dpdk-dev] [dpdk-dev, PATCHv6 1/6] ethdev: enhance rte_eth_(tx|rx)q_info struct Amine Kherbouche
@ 2015-10-19 22:06     ` Amine Kherbouche
  2015-10-19 22:06     ` [dpdk-dev] [dpdk-dev, PATCHv6 3/6] virtio: add support for eth_(rxq|txq)_info_get Amine Kherbouche
                       ` (3 subsequent siblings)
  5 siblings, 0 replies; 43+ messages in thread
From: Amine Kherbouche @ 2015-10-19 22:06 UTC (permalink / raw)
  To: dev; +Cc: amine.kherbouche

Display the additional information added in rte_eth_txq_info struct
for queue descriptors.

Signed-off-by: Amine Kherbouche <amine.kherbouche@6wind.com>
---
 app/test-pmd/config.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index aad2ab6..761519f 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -321,7 +321,9 @@ rx_queue_infos_display(portid_t port_id, uint16_t queue_id)
 		(qinfo.conf.rx_deferred_start != 0) ? "on" : "off");
 	printf("\nRX scattered packets: %s",
 		(qinfo.scattered_rx != 0) ? "on" : "off");
-	printf("\nNumber of RXDs: %hu", qinfo.nb_desc);
+	printf("\nNumber of Total RXDs: %hu", qinfo.nb_desc);
+	printf("\nNumber of Used RXDs: %hu",qinfo.used_desc);
+	printf("\nNumber of Free RXDs: %hu",qinfo.free_desc);
 	printf("\n");
 }
 
@@ -351,7 +353,9 @@ tx_queue_infos_display(portid_t port_id, uint16_t queue_id)
 	printf("\nTX flags: %#x", qinfo.conf.txq_flags);
 	printf("\nTX deferred start: %s",
 		(qinfo.conf.tx_deferred_start != 0) ? "on" : "off");
-	printf("\nNumber of TXDs: %hu", qinfo.nb_desc);
+	printf("\nNumber of Total TXDs: %hu", qinfo.nb_desc);
+	printf("\nNumber of Used TXDs: %hu",qinfo.used_desc);
+	printf("\nNumber of Free TXDs: %hu",qinfo.free_desc);
 	printf("\n");
 }
 
-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [dpdk-dev] [dpdk-dev, PATCHv6 3/6] virtio: add support for eth_(rxq|txq)_info_get
  2015-10-19 22:06   ` [dpdk-dev] [dpdk-dev,PATCHv6 0/6] Enhance queue information API Amine Kherbouche
  2015-10-19 22:06     ` [dpdk-dev] [dpdk-dev, PATCHv6 1/6] ethdev: enhance rte_eth_(tx|rx)q_info struct Amine Kherbouche
  2015-10-19 22:06     ` [dpdk-dev] [dpdk-dev, PATCHv6 2/6] testpmd: enhance the command to display RX/TX queue information Amine Kherbouche
@ 2015-10-19 22:06     ` Amine Kherbouche
  2015-10-20  7:31       ` Tan, Jianfeng
  2015-10-19 22:06     ` [dpdk-dev] [dpdk-dev, PATCHv6 4/6] e1000: enhance eth_(rxq|txq)_info_get to retrieve more queue information Amine Kherbouche
                       ` (2 subsequent siblings)
  5 siblings, 1 reply; 43+ messages in thread
From: Amine Kherbouche @ 2015-10-19 22:06 UTC (permalink / raw)
  To: dev; +Cc: amine.kherbouche

In the case of virtio, there are many fields in rte_eth_(tx|rxq)_info
struct that aren't set in this function because those fields are
missed in virtqueue struct.

Signed-off-by: Amine Kherbouche <amine.kherbouche@6wind.com>
---
 drivers/net/virtio/virtio_ethdev.c |   28 ++++++++++++++++++++++++++++
 drivers/net/virtio/virtio_ethdev.h |    4 ++++
 2 files changed, 32 insertions(+)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 465d3cd..6118913 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -580,6 +580,8 @@ static const struct eth_dev_ops virtio_eth_dev_ops = {
 	.mac_addr_add            = virtio_mac_addr_add,
 	.mac_addr_remove         = virtio_mac_addr_remove,
 	.mac_addr_set            = virtio_mac_addr_set,
+	.rxq_info_get            = virtio_rxq_info_get,
+	.txq_info_get            = virtio_txq_info_get,
 };
 
 static inline int
@@ -1574,4 +1576,30 @@ static struct rte_driver rte_virtio_driver = {
 	.init = rte_virtio_pmd_init,
 };
 
+void
+virtio_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+			struct rte_eth_rxq_info *qinfo)
+{
+	struct virtqueue *rxq;
+
+	rxq = dev->data->rx_queues[queue_id];
+
+	qinfo->nb_desc = rxq->vq_nentries;
+	qinfo->used_desc = rxq->vq_nentries - rxq->vq_free_cnt;
+	qinfo->free_desc= rxq->vq_free_cnt;
+}
+
+void
+virtio_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+			struct rte_eth_txq_info *qinfo)
+{
+	struct virtqueue *txq;
+
+	txq = dev->data->tx_queues[queue_id];
+
+	qinfo->nb_desc = txq->vq_nentries;
+	qinfo->used_desc = txq->vq_nentries - txq->vq_free_cnt;
+	qinfo->free_desc= txq->vq_free_cnt;
+}
+
 PMD_REGISTER_DRIVER(rte_virtio_driver);
diff --git a/drivers/net/virtio/virtio_ethdev.h b/drivers/net/virtio/virtio_ethdev.h
index 9026d42..1bbe421 100644
--- a/drivers/net/virtio/virtio_ethdev.h
+++ b/drivers/net/virtio/virtio_ethdev.h
@@ -107,7 +107,11 @@ uint16_t virtio_recv_mergeable_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 
 uint16_t virtio_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 		uint16_t nb_pkts);
+void virtio_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+                        struct rte_eth_rxq_info *qinfo);
 
+void virtio_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+                        struct rte_eth_txq_info *qinfo);
 
 /*
  * The VIRTIO_NET_F_GUEST_TSO[46] features permit the host to send us
-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [dpdk-dev] [dpdk-dev, PATCHv6 4/6] e1000: enhance eth_(rxq|txq)_info_get to retrieve more queue information
  2015-10-19 22:06   ` [dpdk-dev] [dpdk-dev,PATCHv6 0/6] Enhance queue information API Amine Kherbouche
                       ` (2 preceding siblings ...)
  2015-10-19 22:06     ` [dpdk-dev] [dpdk-dev, PATCHv6 3/6] virtio: add support for eth_(rxq|txq)_info_get Amine Kherbouche
@ 2015-10-19 22:06     ` Amine Kherbouche
  2015-10-19 22:06     ` [dpdk-dev] [dpdk-dev, PATCHv6 5/6] i40e: " Amine Kherbouche
  2015-10-19 22:06     ` [dpdk-dev] [dpdk-dev, PATCHv6 6/6] ixgbe: " Amine Kherbouche
  5 siblings, 0 replies; 43+ messages in thread
From: Amine Kherbouche @ 2015-10-19 22:06 UTC (permalink / raw)
  To: dev; +Cc: amine.kherbouche

Enhance both functions of e1000 and igb to retrieve more informations
about queue descriptors according to new adds on rte_eth_(tx|rx)q_info
struct

Signed-off-by: Amine Kherbouche <amine.kherbouche@6wind.com>
---
 drivers/net/e1000/em_rxtx.c  |    4 ++++
 drivers/net/e1000/igb_rxtx.c |    4 ++++
 2 files changed, 8 insertions(+)

diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index 03e1bc2..1ff750b 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -1873,6 +1873,8 @@ em_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 	qinfo->mp = rxq->mb_pool;
 	qinfo->scattered_rx = dev->data->scattered_rx;
 	qinfo->nb_desc = rxq->nb_rx_desc;
+	qinfo->used_desc = (uint16_t)eth_em_rx_queue_count(dev, queue_id);
+	qinfo->free_desc = qinfo->nb_desc - qinfo->used_desc;
 	qinfo->conf.rx_free_thresh = rxq->rx_free_thresh;
 }
 
@@ -1885,6 +1887,8 @@ em_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 	txq = dev->data->tx_queues[queue_id];
 
 	qinfo->nb_desc = txq->nb_tx_desc;
+	qinfo->free_desc = txq->nb_tx_free;
+	qinfo->used_desc = qinfo->nb_desc - qinfo->free_desc;
 
 	qinfo->conf.tx_thresh.pthresh = txq->pthresh;
 	qinfo->conf.tx_thresh.hthresh = txq->hthresh;
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index cca3300..4956075 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -2483,6 +2483,8 @@ igb_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 	qinfo->mp = rxq->mb_pool;
 	qinfo->scattered_rx = dev->data->scattered_rx;
 	qinfo->nb_desc = rxq->nb_rx_desc;
+	qinfo->used_desc = eth_igb_rx_queue_count(dev, rxq->queue_id);
+	qinfo->free_desc =  qinfo->nb_desc - qinfo->used_desc;
 
 	qinfo->conf.rx_free_thresh = rxq->rx_free_thresh;
 	qinfo->conf.rx_drop_en = rxq->drop_en;
@@ -2497,6 +2499,8 @@ igb_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 	txq = dev->data->tx_queues[queue_id];
 
 	qinfo->nb_desc = txq->nb_tx_desc;
+	qinfo->used_desc = txq->tx_tail - txq->tx_head % txq->nb_tx_desc;
+	qinfo->free_desc = qinfo->nb_desc - qinfo->used_desc;
 
 	qinfo->conf.tx_thresh.pthresh = txq->pthresh;
 	qinfo->conf.tx_thresh.hthresh = txq->hthresh;
-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [dpdk-dev] [dpdk-dev, PATCHv6 5/6] i40e: enhance eth_(rxq|txq)_info_get to retrieve more queue information
  2015-10-19 22:06   ` [dpdk-dev] [dpdk-dev,PATCHv6 0/6] Enhance queue information API Amine Kherbouche
                       ` (3 preceding siblings ...)
  2015-10-19 22:06     ` [dpdk-dev] [dpdk-dev, PATCHv6 4/6] e1000: enhance eth_(rxq|txq)_info_get to retrieve more queue information Amine Kherbouche
@ 2015-10-19 22:06     ` Amine Kherbouche
  2015-10-19 22:43       ` Stephen Hemminger
  2015-10-19 22:06     ` [dpdk-dev] [dpdk-dev, PATCHv6 6/6] ixgbe: " Amine Kherbouche
  5 siblings, 1 reply; 43+ messages in thread
From: Amine Kherbouche @ 2015-10-19 22:06 UTC (permalink / raw)
  To: dev; +Cc: amine.kherbouche

According to new fields in struct rte_eth_rxq_info, those are filled to
add additional information about queue descriptors.

Signed-off-by: Amine Kherbouche <amine.kherbouche@6wind.com>
---
 drivers/net/i40e/i40e_rxtx.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index fa1451e..e958d56 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -3075,6 +3075,8 @@ i40e_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 	qinfo->mp = rxq->mp;
 	qinfo->scattered_rx = dev->data->scattered_rx;
 	qinfo->nb_desc = rxq->nb_rx_desc;
+	qinfo->used_desc = (uint16_t)i40e_dev_rx_queue_count(dev, queue_id);
+	qinfo->free_desc = qinfo->nb_desc  - qinfo->used_desc;
 
 	qinfo->conf.rx_free_thresh = rxq->rx_free_thresh;
 	qinfo->conf.rx_drop_en = rxq->drop_en;
@@ -3090,6 +3092,8 @@ i40e_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 	txq = dev->data->tx_queues[queue_id];
 
 	qinfo->nb_desc = txq->nb_tx_desc;
+	qinfo->free_desc = txq->nb_tx_free;
+	qinfo->used_desc = qinfo->nb_desc - qinfo->free_desc;
 
 	qinfo->conf.tx_thresh.pthresh = txq->pthresh;
 	qinfo->conf.tx_thresh.hthresh = txq->hthresh;
-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [dpdk-dev] [dpdk-dev, PATCHv6 6/6] ixgbe: enhance eth_(rxq|txq)_info_get to retrieve more queue information
  2015-10-19 22:06   ` [dpdk-dev] [dpdk-dev,PATCHv6 0/6] Enhance queue information API Amine Kherbouche
                       ` (4 preceding siblings ...)
  2015-10-19 22:06     ` [dpdk-dev] [dpdk-dev, PATCHv6 5/6] i40e: " Amine Kherbouche
@ 2015-10-19 22:06     ` Amine Kherbouche
  5 siblings, 0 replies; 43+ messages in thread
From: Amine Kherbouche @ 2015-10-19 22:06 UTC (permalink / raw)
  To: dev; +Cc: amine.kherbouche

According to new adds on struct rte_eth_rxq_info, some adds are done
to this function to retreive information about used and free queue
descriptors.

Signed-off-by: Amine Kherbouche <amine.kherbouche@6wind.com>
---
 drivers/net/ixgbe/ixgbe_rxtx.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index ba08588..318d50f 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -4641,6 +4641,8 @@ ixgbe_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 	qinfo->mp = rxq->mb_pool;
 	qinfo->scattered_rx = dev->data->scattered_rx;
 	qinfo->nb_desc = rxq->nb_rx_desc;
+	qinfo->used_desc = (uint16_t)ixgbe_dev_rx_queue_count(dev, queue_id);
+	qinfo->free_desc = qinfo->nb_desc - qinfo->used_desc;
 
 	qinfo->conf.rx_free_thresh = rxq->rx_free_thresh;
 	qinfo->conf.rx_drop_en = rxq->drop_en;
@@ -4656,6 +4658,8 @@ ixgbe_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 	txq = dev->data->tx_queues[queue_id];
 
 	qinfo->nb_desc = txq->nb_tx_desc;
+	qinfo->used_desc = txq->nb_tx_used;
+	qinfo->free_desc = txq->nb_tx_free + 1;
 
 	qinfo->conf.tx_thresh.pthresh = txq->pthresh;
 	qinfo->conf.tx_thresh.hthresh = txq->hthresh;
-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [dpdk-dev] [dpdk-dev, PATCHv6 5/6] i40e: enhance eth_(rxq|txq)_info_get to retrieve more queue information
  2015-10-19 22:06     ` [dpdk-dev] [dpdk-dev, PATCHv6 5/6] i40e: " Amine Kherbouche
@ 2015-10-19 22:43       ` Stephen Hemminger
  0 siblings, 0 replies; 43+ messages in thread
From: Stephen Hemminger @ 2015-10-19 22:43 UTC (permalink / raw)
  To: Amine Kherbouche; +Cc: dev

On Tue, 20 Oct 2015 00:06:23 +0200
Amine Kherbouche <amine.kherbouche@6wind.com> wrote:

> According to new fields in struct rte_eth_rxq_info, those are filled to
> add additional information about queue descriptors.
> 
> Signed-off-by: Amine Kherbouche <amine.kherbouche@6wind.com>
> ---
>  drivers/net/i40e/i40e_rxtx.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
> index fa1451e..e958d56 100644
> --- a/drivers/net/i40e/i40e_rxtx.c
> +++ b/drivers/net/i40e/i40e_rxtx.c
> @@ -3075,6 +3075,8 @@ i40e_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
>  	qinfo->mp = rxq->mp;
>  	qinfo->scattered_rx = dev->data->scattered_rx;
>  	qinfo->nb_desc = rxq->nb_rx_desc;
> +	qinfo->used_desc = (uint16_t)i40e_dev_rx_queue_count(dev, queue_id);

Cast here is unnecessary. C does the necessary type conversion.

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [dpdk-dev] [dpdk-dev, PATCHv6 1/6] ethdev: enhance rte_eth_(tx|rx)q_info struct
  2015-10-19 22:06     ` [dpdk-dev] [dpdk-dev, PATCHv6 1/6] ethdev: enhance rte_eth_(tx|rx)q_info struct Amine Kherbouche
@ 2015-10-19 22:44       ` Stephen Hemminger
  2015-10-20  9:52         ` Ananyev, Konstantin
  2015-10-20  9:36       ` Ananyev, Konstantin
  1 sibling, 1 reply; 43+ messages in thread
From: Stephen Hemminger @ 2015-10-19 22:44 UTC (permalink / raw)
  To: Amine Kherbouche; +Cc: dev

On Tue, 20 Oct 2015 00:06:19 +0200
Amine Kherbouche <amine.kherbouche@6wind.com> wrote:

> +	uint16_t used_desc;         /**< number of used descriptors */
> +	uint16_t free_desc;         /**< number of free descriptors */

These two fields are obviously not SMP sfe.
Also, they are redundant with the existing queue_count API?

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [dpdk-dev] [dpdk-dev, PATCHv6 3/6] virtio: add support for eth_(rxq|txq)_info_get
  2015-10-19 22:06     ` [dpdk-dev] [dpdk-dev, PATCHv6 3/6] virtio: add support for eth_(rxq|txq)_info_get Amine Kherbouche
@ 2015-10-20  7:31       ` Tan, Jianfeng
  0 siblings, 0 replies; 43+ messages in thread
From: Tan, Jianfeng @ 2015-10-20  7:31 UTC (permalink / raw)
  To: Amine Kherbouche, dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Amine Kherbouche
> Sent: Tuesday, October 20, 2015 6:06 AM
> To: dev@dpdk.org
> Cc: amine.kherbouche@6wind.com
> Subject: [dpdk-dev] [dpdk-dev, PATCHv6 3/6] virtio: add support for
> eth_(rxq|txq)_info_get
> 
> In the case of virtio, there are many fields in rte_eth_(tx|rxq)_info struct
> that aren't set in this function because those fields are missed in virtqueue
> struct.
> 
> Signed-off-by: Amine Kherbouche <amine.kherbouche@6wind.com>
> ---
>  drivers/net/virtio/virtio_ethdev.c |   28 ++++++++++++++++++++++++++++
>  drivers/net/virtio/virtio_ethdev.h |    4 ++++
>  2 files changed, 32 insertions(+)
> 
> diff --git a/drivers/net/virtio/virtio_ethdev.c
> b/drivers/net/virtio/virtio_ethdev.c
> index 465d3cd..6118913 100644
> --- a/drivers/net/virtio/virtio_ethdev.c
> +++ b/drivers/net/virtio/virtio_ethdev.c
> @@ -580,6 +580,8 @@ static const struct eth_dev_ops virtio_eth_dev_ops =
> {
>  	.mac_addr_add            = virtio_mac_addr_add,
>  	.mac_addr_remove         = virtio_mac_addr_remove,
>  	.mac_addr_set            = virtio_mac_addr_set,
> +	.rxq_info_get            = virtio_rxq_info_get,
> +	.txq_info_get            = virtio_txq_info_get,
>  };
> 
>  static inline int
> @@ -1574,4 +1576,30 @@ static struct rte_driver rte_virtio_driver = {
>  	.init = rte_virtio_pmd_init,
>  };
> 
> +void
> +virtio_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
> +			struct rte_eth_rxq_info *qinfo)
> +{
> +	struct virtqueue *rxq;
> +
> +	rxq = dev->data->rx_queues[queue_id];
> +
> +	qinfo->nb_desc = rxq->vq_nentries;
> +	qinfo->used_desc = rxq->vq_nentries - rxq->vq_free_cnt;


rxq->vq_free_cnt needs to be masked by rx->vq_nentries here?

Thanks,
Jianfeng

> +	qinfo->free_desc= rxq->vq_free_cnt;
> +}
> +
> +void
> +virtio_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
> +			struct rte_eth_txq_info *qinfo)
> +{
> +	struct virtqueue *txq;
> +
> +	txq = dev->data->tx_queues[queue_id];
> +
> +	qinfo->nb_desc = txq->vq_nentries;
> +	qinfo->used_desc = txq->vq_nentries - txq->vq_free_cnt;
> +	qinfo->free_desc= txq->vq_free_cnt;
> +}
> +
>  PMD_REGISTER_DRIVER(rte_virtio_driver);
> diff --git a/drivers/net/virtio/virtio_ethdev.h
> b/drivers/net/virtio/virtio_ethdev.h
> index 9026d42..1bbe421 100644
> --- a/drivers/net/virtio/virtio_ethdev.h
> +++ b/drivers/net/virtio/virtio_ethdev.h
> @@ -107,7 +107,11 @@ uint16_t virtio_recv_mergeable_pkts(void
> *rx_queue, struct rte_mbuf **rx_pkts,
> 
>  uint16_t virtio_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
>  		uint16_t nb_pkts);
> +void virtio_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
> +                        struct rte_eth_rxq_info *qinfo);
> 
> +void virtio_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
> +                        struct rte_eth_txq_info *qinfo);
> 
>  /*
>   * The VIRTIO_NET_F_GUEST_TSO[46] features permit the host to send us
> --
> 1.7.10.4

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [dpdk-dev] [dpdk-dev, PATCHv5, 1/8] ethdev: add new API to retrieve RX/TX queue information
  2015-10-14 11:49     ` Ananyev, Konstantin
  2015-10-14 12:21       ` Amine Kherbouche
@ 2015-10-20  7:53       ` Qiu, Michael
  2015-10-20  8:09         ` Vincent JARDIN
  1 sibling, 1 reply; 43+ messages in thread
From: Qiu, Michael @ 2015-10-20  7:53 UTC (permalink / raw)
  To: Ananyev, Konstantin, Amine Kherbouche, dev

On 2015/10/14 19:50, Ananyev, Konstantin wrote:
> Hi Amine,
>
>> -----Original Message-----
>> From: Amine Kherbouche [mailto:amine.kherbouche@6wind.com]
>> Sent: Wednesday, October 14, 2015 12:40 PM
>> To: Ananyev, Konstantin; dev@dpdk.org
>> Subject: Re: [dpdk-dev, PATCHv5, 1/8] ethdev: add new API to retrieve RX/TX queue information
>>
>>
>>
>> Hi Konstantin
>>> +/**
>>> + * Ethernet device RX queue information structure.
>>> + * Used to retieve information about configured queue.
>>> + */
>>> +struct rte_eth_rxq_info {
>>> +	struct rte_mempool *mp;     /**< mempool used by that queue. */
>>> +	struct rte_eth_rxconf conf; /**< queue config parameters. */
>>> +	uint8_t scattered_rx;       /**< scattered packets RX supported. */
>>> +	uint16_t nb_desc;           /**< configured number of RXDs. */
>> Here i need two more fields in this struct :
>>      uint16_t free_desc : for free queue descriptors
>>      uint16_t used_desc : for used queue descriptors

But as I know it is different all the time, am I right?
If yes, I don't know what's the value of this field.

Thanks,
Michael


>>> +} __rte_cache_aligned;
>


^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [dpdk-dev] [dpdk-dev, PATCHv5, 1/8] ethdev: add new API to retrieve RX/TX queue information
  2015-10-20  7:53       ` Qiu, Michael
@ 2015-10-20  8:09         ` Vincent JARDIN
  2015-10-20  8:32           ` Qiu, Michael
  0 siblings, 1 reply; 43+ messages in thread
From: Vincent JARDIN @ 2015-10-20  8:09 UTC (permalink / raw)
  To: Qiu, Michael, Ananyev, Konstantin, dev; +Cc: Amine Kherbouche

On 20/10/2015 09:53, Qiu, Michael wrote:
> But as I know it is different all the time, am I right?
> If yes, I don't know what's the value of this field.

It can be used to get some snapshot/instant view informations while we 
have to monitor and debug.

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [dpdk-dev] [dpdk-dev, PATCHv5, 1/8] ethdev: add new API to retrieve RX/TX queue information
  2015-10-20  8:09         ` Vincent JARDIN
@ 2015-10-20  8:32           ` Qiu, Michael
  0 siblings, 0 replies; 43+ messages in thread
From: Qiu, Michael @ 2015-10-20  8:32 UTC (permalink / raw)
  To: Vincent JARDIN, Ananyev, Konstantin, dev; +Cc: Amine Kherbouche

On 2015/10/20 16:09, Vincent JARDIN wrote:
> On 20/10/2015 09:53, Qiu, Michael wrote:
>> But as I know it is different all the time, am I right?
>> If yes, I don't know what's the value of this field.
> It can be used to get some snapshot/instant view informations while we 
> have to monitor and debug.

So this field is mainly for debug?

Thanks,
Michael



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [dpdk-dev] [dpdk-dev, PATCHv6 1/6] ethdev: enhance rte_eth_(tx|rx)q_info struct
  2015-10-19 22:06     ` [dpdk-dev] [dpdk-dev, PATCHv6 1/6] ethdev: enhance rte_eth_(tx|rx)q_info struct Amine Kherbouche
  2015-10-19 22:44       ` Stephen Hemminger
@ 2015-10-20  9:36       ` Ananyev, Konstantin
  2015-10-20 15:16         ` Thomas Monjalon
  1 sibling, 1 reply; 43+ messages in thread
From: Ananyev, Konstantin @ 2015-10-20  9:36 UTC (permalink / raw)
  To: Amine Kherbouche, dev

Hi Amine,

> -----Original Message-----
> From: Amine Kherbouche [mailto:amine.kherbouche@6wind.com]
> Sent: Monday, October 19, 2015 11:06 PM
> To: dev@dpdk.org
> Cc: amine.kherbouche@6wind.com; vincent.jardin@6wind.com; Ananyev, Konstantin
> Subject: [dpdk-dev,PATCHv6 1/6] ethdev: enhance rte_eth_(tx|rx)q_info struct
> 
> Add 2 fields in struct rte_eth_(tx|rx)q_info :
> - used_desc : for used queue descriptors
> - free_desc : for free queue descriptors
> for ability to query more information from queues.

As I can see your patch series should be applied on top of mine:
[PATCHv5 0/8] ethdev: add new API to retrieve RX/TX queue information
Which is not yet in the dpdk.org mainline.
I believe that is ok, but then you shouldn't replace previous version with the patch (v5)
with new one, but create a new patch for your changes and clearly state that dependency.

Konstantin

> 
> Signed-off-by: Amine Kherbouche <amine.kherbouche@6wind.com>
> ---
>  lib/librte_ether/rte_ethdev.h |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
> index 4d7b6f2..5fc86a0 100644
> --- a/lib/librte_ether/rte_ethdev.h
> +++ b/lib/librte_ether/rte_ethdev.h
> @@ -874,6 +874,8 @@ struct rte_eth_rxq_info {
>  	struct rte_eth_rxconf conf; /**< queue config parameters. */
>  	uint8_t scattered_rx;       /**< scattered packets RX supported. */
>  	uint16_t nb_desc;           /**< configured number of RXDs. */
> +	uint16_t used_desc;         /**< number of used descriptors */
> +	uint16_t free_desc;         /**< number of free descriptors */
>  } __rte_cache_aligned;
> 
>  /**
> @@ -883,6 +885,8 @@ struct rte_eth_rxq_info {
>  struct rte_eth_txq_info {
>  	struct rte_eth_txconf conf; /**< queue config parameters. */
>  	uint16_t nb_desc;           /**< configured number of TXDs. */
> +	uint16_t used_desc;         /**< number of used descriptors */
> +	uint16_t free_desc;         /**< number of free descriptors */
>  } __rte_cache_aligned;
> 
>  struct rte_eth_dev;
> --
> 1.7.10.4

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [dpdk-dev] [dpdk-dev, PATCHv6 1/6] ethdev: enhance rte_eth_(tx|rx)q_info struct
  2015-10-19 22:44       ` Stephen Hemminger
@ 2015-10-20  9:52         ` Ananyev, Konstantin
  2015-10-20 14:55           ` Amine Kherbouche
  0 siblings, 1 reply; 43+ messages in thread
From: Ananyev, Konstantin @ 2015-10-20  9:52 UTC (permalink / raw)
  To: Stephen Hemminger, Amine Kherbouche; +Cc: dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Stephen Hemminger
> Sent: Monday, October 19, 2015 11:44 PM
> To: Amine Kherbouche
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [dpdk-dev, PATCHv6 1/6] ethdev: enhance rte_eth_(tx|rx)q_info struct
> 
> On Tue, 20 Oct 2015 00:06:19 +0200
> Amine Kherbouche <amine.kherbouche@6wind.com> wrote:
> 
> > +	uint16_t used_desc;         /**< number of used descriptors */
> > +	uint16_t free_desc;         /**< number of free descriptors */
> 
> These two fields are obviously not SMP sfe.

I don't think they have to be.
>From my thinking it is just a snapshot of SW state of the queue, that could be used for statistics/watchdog/debugging purposes.

> Also, they are redundant with the existing queue_count API?

Yep, similar thought here:
In the for Intel HW implementations:
qinfo->used_desc = ixgbe_dev_rx_queue_count(dev, queue_id);
It seems a bit redundant, as if user wants to know HW state it can call rte_eth_rx_queue_count() directly.
>From other side:  rte_eth_rx_queue_count() is quite heavyweight function, as it scans HW descriptors to check their status.
I think it should be better to return here just a snapshot of SW state: how many free/used RXDs are from PMD perspective
(by collecting info from *_rx_queue structure, without reading actual HW registers/descriptors - as you done for TX queue info).

Konstantin

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [dpdk-dev] [dpdk-dev, PATCHv6 1/6] ethdev: enhance rte_eth_(tx|rx)q_info struct
  2015-10-20  9:52         ` Ananyev, Konstantin
@ 2015-10-20 14:55           ` Amine Kherbouche
  0 siblings, 0 replies; 43+ messages in thread
From: Amine Kherbouche @ 2015-10-20 14:55 UTC (permalink / raw)
  To: Ananyev, Konstantin; +Cc: dev

> Yep, similar thought here:
> In the for Intel HW implementations:
> qinfo->used_desc = ixgbe_dev_rx_queue_count(dev, queue_id);
> It seems a bit redundant, as if user wants to know HW state it can call
> rte_eth_rx_queue_count() directly.
> From other side:  rte_eth_rx_queue_count() is quite heavyweight function,
> as it scans HW descriptors to check their status.
> I think it should be better to return here just a snapshot of SW state:
> how many free/used RXDs are from PMD perspective
> (by collecting info from *_rx_queue structure, without reading actual HW
> registers/descriptors - as you done for TX queue info).
>
> Konstantin
>

Yes,

Konstantin is right, it is a light solution to get an snapshot of the state
of the queues.

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [dpdk-dev] [dpdk-dev, PATCHv6 1/6] ethdev: enhance rte_eth_(tx|rx)q_info struct
  2015-10-20  9:36       ` Ananyev, Konstantin
@ 2015-10-20 15:16         ` Thomas Monjalon
  0 siblings, 0 replies; 43+ messages in thread
From: Thomas Monjalon @ 2015-10-20 15:16 UTC (permalink / raw)
  To: Amine Kherbouche; +Cc: dev

2015-10-20 09:36, Ananyev, Konstantin:
> As I can see your patch series should be applied on top of mine:
> [PATCHv5 0/8] ethdev: add new API to retrieve RX/TX queue information
> Which is not yet in the dpdk.org mainline.
> I believe that is ok, but then you shouldn't replace previous version with the patch (v5)
> with new one, but create a new patch for your changes and clearly state that dependency.

Yes, Amine, this is not a new version of Konstantin's patches.
So you must not use v6 and you should mention in the cover letter that it
depends on Konstantin's patches.
Please use v2 next time.

^ permalink raw reply	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2015-10-20 15:17 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-01 19:54 [dpdk-dev] [PATCHv5 0/8] ethdev: add new API to retrieve RX/TX queue information Konstantin Ananyev
2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 1/8] " Konstantin Ananyev
2015-10-14 11:39   ` [dpdk-dev] [dpdk-dev, PATCHv5, " Amine Kherbouche
2015-10-14 11:49     ` Ananyev, Konstantin
2015-10-14 12:21       ` Amine Kherbouche
2015-10-14 12:42         ` Ananyev, Konstantin
2015-10-14 12:47           ` Amine Kherbouche
2015-10-14 12:48             ` Ananyev, Konstantin
2015-10-20  7:53       ` Qiu, Michael
2015-10-20  8:09         ` Vincent JARDIN
2015-10-20  8:32           ` Qiu, Michael
2015-10-14 12:44   ` [dpdk-dev] [PATCHv5 " Remy Horton
2015-10-14 16:09   ` Stephen Hemminger
2015-10-14 18:44     ` Ananyev, Konstantin
2015-10-16 13:16       ` Bruce Richardson
2015-10-19 22:06   ` [dpdk-dev] [dpdk-dev,PATCHv6 0/6] Enhance queue information API Amine Kherbouche
2015-10-19 22:06     ` [dpdk-dev] [dpdk-dev, PATCHv6 1/6] ethdev: enhance rte_eth_(tx|rx)q_info struct Amine Kherbouche
2015-10-19 22:44       ` Stephen Hemminger
2015-10-20  9:52         ` Ananyev, Konstantin
2015-10-20 14:55           ` Amine Kherbouche
2015-10-20  9:36       ` Ananyev, Konstantin
2015-10-20 15:16         ` Thomas Monjalon
2015-10-19 22:06     ` [dpdk-dev] [dpdk-dev, PATCHv6 2/6] testpmd: enhance the command to display RX/TX queue information Amine Kherbouche
2015-10-19 22:06     ` [dpdk-dev] [dpdk-dev, PATCHv6 3/6] virtio: add support for eth_(rxq|txq)_info_get Amine Kherbouche
2015-10-20  7:31       ` Tan, Jianfeng
2015-10-19 22:06     ` [dpdk-dev] [dpdk-dev, PATCHv6 4/6] e1000: enhance eth_(rxq|txq)_info_get to retrieve more queue information Amine Kherbouche
2015-10-19 22:06     ` [dpdk-dev] [dpdk-dev, PATCHv6 5/6] i40e: " Amine Kherbouche
2015-10-19 22:43       ` Stephen Hemminger
2015-10-19 22:06     ` [dpdk-dev] [dpdk-dev, PATCHv6 6/6] ixgbe: " Amine Kherbouche
2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 2/8] i40e: add support for eth_(rxq|txq)_info_get and (rx|tx)_desc_lim Konstantin Ananyev
2015-10-14 12:46   ` Remy Horton
2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 3/8] ixgbe: " Konstantin Ananyev
2015-10-14 12:47   ` Remy Horton
2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 4/8] e1000: " Konstantin Ananyev
2015-10-14 12:48   ` Remy Horton
2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 5/8] fm10k: add HW specific desc_lim data into dev_info Konstantin Ananyev
2015-10-14 12:48   ` Remy Horton
2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 6/8] cxgbe: " Konstantin Ananyev
2015-10-14 12:49   ` Remy Horton
2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 7/8] vmxnet3: " Konstantin Ananyev
2015-10-14 12:49   ` Remy Horton
2015-10-01 19:54 ` [dpdk-dev] [PATCHv5 8/8] testpmd: add new command to display RX/TX queue information Konstantin Ananyev
2015-10-14 12:49   ` Remy Horton

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).