From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D26D2A0547; Mon, 19 Apr 2021 10:57:20 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 96C7B40683; Mon, 19 Apr 2021 10:57:20 +0200 (CEST) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by mails.dpdk.org (Postfix) with ESMTP id 90E1040040 for ; Mon, 19 Apr 2021 10:57:19 +0200 (CEST) Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FP0x72hhgzpZMp; Mon, 19 Apr 2021 16:54:19 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.498.0; Mon, 19 Apr 2021 16:57:16 +0800 From: Lijun Ou To: , CC: , Date: Mon, 19 Apr 2021 16:57:30 +0800 Message-ID: <1618822650-50500-1-git-send-email-oulijun@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1618797806-64536-1-git-send-email-oulijun@huawei.com> References: <1618797806-64536-1-git-send-email-oulijun@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH v7] ethdev: add queue state when retrieve queue information X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Signed-off-by: Lijun Ou Acked-by: Konstantin Ananyev --- V6->V7: - reword the note title for "New Feature" - use Rx/Tx queue instead of rxq/txq queue V5->V6: - add updated update libabigail.abignore V4->V5: - add acked-by - add a note to the "New features" section to annouce the new feature. V3->V4: - update libabigail.abignore for removing the CI warnings V2->V3: - rewrite the commit log and delete the part Note - rewrite tht comments for queue state - move the queue_state definition locations V1->V2: - move queue state defines to public file --- devtools/libabigail.abignore | 12 +++++++++++- doc/guides/rel_notes/release_21_05.rst | 6 ++++++ lib/librte_ethdev/ethdev_driver.h | 7 ------- lib/librte_ethdev/rte_ethdev.c | 3 +++ lib/librte_ethdev/rte_ethdev.h | 9 +++++++++ 5 files changed, 29 insertions(+), 8 deletions(-) diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore index 6c0b389..d8082cf 100644 --- a/devtools/libabigail.abignore +++ b/devtools/libabigail.abignore @@ -19,4 +19,14 @@ ; Ignore fields inserted in cacheline boundary of rte_cryptodev [suppress_type] name = rte_cryptodev - has_data_member_inserted_between = {offset_after(attached), end} \ No newline at end of file + 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} diff --git a/doc/guides/rel_notes/release_21_05.rst b/doc/guides/rel_notes/release_21_05.rst index 58272e1..05b2f0c 100644 --- a/doc/guides/rel_notes/release_21_05.rst +++ b/doc/guides/rel_notes/release_21_05.rst @@ -81,6 +81,12 @@ New Features 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.** Currently meter algorithms only supports bytes per second(BPS). diff --git a/lib/librte_ethdev/ethdev_driver.h b/lib/librte_ethdev/ethdev_driver.h index 113129d..40e474a 100644 --- a/lib/librte_ethdev/ethdev_driver.h +++ b/lib/librte_ethdev/ethdev_driver.h @@ -952,13 +952,6 @@ struct eth_dev_ops { }; /** - * 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. * diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index c73d263..d5adf4f 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -5038,6 +5038,8 @@ rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, 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]; + return 0; } @@ -5078,6 +5080,7 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, 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]; return 0; } diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index 3b773b6..a0d01d2 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -1588,6 +1588,13 @@ struct rte_eth_dev_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 + +/** * Ethernet device RX queue information structure. * Used to retrieve information about configured queue. */ @@ -1595,6 +1602,7 @@ 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. */ + 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; @@ -1606,6 +1614,7 @@ 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. */ + uint8_t queue_state; /**< one of RTE_ETH_QUEUE_STATE_*. */ } __rte_cache_min_aligned; /* Generic Burst mode flag definition, values can be ORed. */ -- 2.7.4