Currently, upper-layer application could get queue state only
through pointers such as dev->data->tx_queue_state[queue_id],
this is not the recommended way to access it. So this patch
add get queue state when call rte_eth_rx_queue_info_get and
rte_eth_tx_queue_info_get API.
Note: After add queue_state field, the 'struct rte_eth_rxq_info' size
remains 128B, and the 'struct rte_eth_txq_info' size remains 64B, so
it could be ABI compatible.
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
[suppress_type]
name = rte_eventdev
has_data_member_inserted_between = {offset_after(attached), end}
[suppress_type]
name = rte_eventdev
has_data_member_inserted_between = {offset_after(attached), end}
+
+; Ignore fields inserted in alignment hole of rte_eth_rxq_info
+[suppress_type]
+ name = rte_eth_rxq_info
+ has_data_member_inserted_at = offset_after(scattered_rx)
+
+; Ignore fields inserted in cacheline boundary of rte_eth_txq_info
+[suppress_type]
+ name = rte_eth_txq_info
+ has_data_member_inserted_between = {offset_after(nb_desc), end}
representor=[[c#]pf#]sf# sf[0,2-1023] /* 1023 SFs. */
representor=[c#]pf# c2pf[0,1] /* 2 PFs on controller 2. */
representor=[[c#]pf#]sf# sf[0,2-1023] /* 1023 SFs. */
representor=[c#]pf# c2pf[0,1] /* 2 PFs on controller 2. */
+* **Added queue state in queried Rx/Tx queue info.**
+
+ * Added new field ``queue_state`` to ``rte_eth_rxq_info`` structure to
+ provide indicated Rx queue state.
+ * Added new field ``queue_state`` to ``rte_eth_txq_info`` structure to
+ provide indicated Tx queue state.
+
* **Added support for meter PPS profile.**
Added packet mode in the meter profile parameters data structures
* **Added support for meter PPS profile.**
Added packet mode in the meter profile parameters data structures
/**< Get representor info. */
};
/**< Get representor info. */
};
-/**
- * RX/TX queue states
- */
-#define RTE_ETH_QUEUE_STATE_STOPPED 0
-#define RTE_ETH_QUEUE_STATE_STARTED 1
-#define RTE_ETH_QUEUE_STATE_HAIRPIN 2
-
/**
* @internal
* Check if the selected Rx queue is hairpin queue.
/**
* @internal
* Check if the selected Rx queue is hairpin queue.
memset(qinfo, 0, sizeof(*qinfo));
dev->dev_ops->rxq_info_get(dev, queue_id, qinfo);
memset(qinfo, 0, sizeof(*qinfo));
dev->dev_ops->rxq_info_get(dev, queue_id, qinfo);
+ qinfo->queue_state = dev->data->rx_queue_state[queue_id];
+
memset(qinfo, 0, sizeof(*qinfo));
dev->dev_ops->txq_info_get(dev, queue_id, qinfo);
memset(qinfo, 0, sizeof(*qinfo));
dev->dev_ops->txq_info_get(dev, queue_id, qinfo);
+ qinfo->queue_state = dev->data->tx_queue_state[queue_id];
void *reserved_ptrs[2]; /**< Reserved for future fields */
};
void *reserved_ptrs[2]; /**< Reserved for future fields */
};
+/**
+ * RX/TX queue states
+ */
+#define RTE_ETH_QUEUE_STATE_STOPPED 0
+#define RTE_ETH_QUEUE_STATE_STARTED 1
+#define RTE_ETH_QUEUE_STATE_HAIRPIN 2
+
/**
* Ethernet device RX queue information structure.
* Used to retrieve information about configured queue.
/**
* Ethernet device RX queue information structure.
* Used to retrieve information about configured queue.
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. */
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. */
+ uint8_t queue_state; /**< one of RTE_ETH_QUEUE_STATE_*. */
uint16_t nb_desc; /**< configured number of RXDs. */
uint16_t rx_buf_size; /**< hardware receive buffer size. */
} __rte_cache_min_aligned;
uint16_t nb_desc; /**< configured number of RXDs. */
uint16_t rx_buf_size; /**< hardware receive buffer size. */
} __rte_cache_min_aligned;
struct rte_eth_txq_info {
struct rte_eth_txconf conf; /**< queue config parameters. */
uint16_t nb_desc; /**< configured number of TXDs. */
struct rte_eth_txq_info {
struct rte_eth_txconf conf; /**< queue config parameters. */
uint16_t nb_desc; /**< configured number of TXDs. */
+ uint8_t queue_state; /**< one of RTE_ETH_QUEUE_STATE_*. */
} __rte_cache_min_aligned;
/* Generic Burst mode flag definition, values can be ORed. */
} __rte_cache_min_aligned;
/* Generic Burst mode flag definition, values can be ORed. */