ethdev: support getting Rx buffer size in Rx queue info
authorChengchang Tang <tangchengchang@huawei.com>
Mon, 21 Sep 2020 13:22:37 +0000 (21:22 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 21 Sep 2020 16:05:38 +0000 (18:05 +0200)
Add a field named rx_buf_size in rte_eth_rxq_info to indicate the buffer
size used in receiving packets for HW.

In this way, upper-layer users can get this information by calling
rte_eth_rx_queue_info_get.

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Reviewed-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
app/proc-info/main.c
app/test-pmd/config.c
doc/guides/rel_notes/deprecation.rst
lib/librte_ethdev/rte_ethdev.h

index 0b030d3..64fb83b 100644 (file)
@@ -708,15 +708,20 @@ show_port(void)
                for (j = 0; j < dev_info.nb_rx_queues; j++) {
                        ret = rte_eth_rx_queue_info_get(i, j, &queue_info);
                        if (ret == 0) {
-                               printf("\t  -- queue %d rx scatter %d"
-                                               " descriptors %d"
-                                               " offloads 0x%"PRIx64
-                                               " mempool socket %d\n",
+                               printf("\t  -- queue %u rx scatter %u"
+                                               " descriptors %u"
+                                               " offloads 0x%" PRIx64
+                                               " mempool socket %d",
                                                j,
                                                queue_info.scattered_rx,
                                                queue_info.nb_desc,
                                                queue_info.conf.offloads,
                                                queue_info.mp->socket_id);
+
+                               if (queue_info.rx_buf_size != 0)
+                                       printf(" rx buffer size %u",
+                                               queue_info.rx_buf_size);
+                               printf("\n");
                        }
                }
 
index b6eb2a5..2d9a456 100644 (file)
@@ -452,6 +452,8 @@ 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");
+       if (qinfo.rx_buf_size != 0)
+               printf("\nRX buffer size: %hu", qinfo.rx_buf_size);
        printf("\nNumber of RXDs: %hu", qinfo.nb_desc);
 
        if (rte_eth_rx_burst_mode_get(port_id, queue_id, &mode) == 0)
index 5f568f4..95a31c7 100644 (file)
@@ -167,11 +167,6 @@ Deprecation Notices
   specified lengths into the buffers allocated from the specified
   memory pools. The backward compatibility to existing API is preserved.
 
-* ethdev: The ``struct rte_eth_rxq_info`` will be modified to include
-  a new optional field, indicating the buffer size used in receiving packets
-  for HW. This change is planned for 20.11. For more details:
-  https://mails.dpdk.org/archives/dev/2020-July/176135.html.
-
 * ethdev: ``rx_descriptor_done`` dev_ops and ``rte_eth_rx_descriptor_done``
   will be removed in 21.11.
   Existing ``rte_eth_rx_descriptor_status`` and ``rte_eth_tx_descriptor_status``
index c6560f2..645a186 100644 (file)
@@ -1452,6 +1452,7 @@ 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 rx_buf_size;       /**< hardware receive buffer size. */
 } __rte_cache_min_aligned;
 
 /**