net/bnxt: support Rx/Tx burst mode info
authorLance Richardson <lance.richardson@broadcom.com>
Tue, 7 Jul 2020 22:22:24 +0000 (15:22 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Sat, 11 Jul 2020 04:18:52 +0000 (06:18 +0200)
Retrieve burst mode options according to the selected Rx/Tx burst
function name.
Update 20.08 release notes with this information.

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
doc/guides/nics/features/bnxt.ini
doc/guides/rel_notes/release_20_08.rst
drivers/net/bnxt/bnxt_ethdev.c

index 37a99e3..f1f300c 100644 (file)
@@ -9,6 +9,7 @@ Link status          = Y
 Link status event    = Y
 Rx interrupt         = Y
 Queue start/stop     = Y
+Burst mode info      = Y
 MTU update           = Y
 Jumbo frame          = Y
 Scattered Rx         = Y
index 988474c..dc32edb 100644 (file)
@@ -96,6 +96,7 @@ New Features
   * Added support for new resource manager API.
   * Added support for VXLAN encap/decap.
   * Added support for rte_flow_query for COUNT action.
+  * Added support for rx_burst_mode_get and tx_burst_mode_get.
 
 * **Updated Mellanox mlx5 driver.**
 
index e447b74..1dc85e6 100644 (file)
@@ -2668,6 +2668,50 @@ bnxt_txq_info_get_op(struct rte_eth_dev *dev, uint16_t queue_id,
        qinfo->conf.tx_deferred_start = txq->tx_deferred_start;
 }
 
+static int
+bnxt_rx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,
+                      struct rte_eth_burst_mode *mode)
+{
+       eth_rx_burst_t pkt_burst = dev->rx_pkt_burst;
+
+       if (pkt_burst == bnxt_recv_pkts) {
+               snprintf(mode->info, sizeof(mode->info), "%s",
+                        "Scalar");
+               return 0;
+       }
+#ifdef RTE_ARCH_X86
+       if (pkt_burst == bnxt_recv_pkts_vec) {
+               snprintf(mode->info, sizeof(mode->info), "%s",
+                        "Vector SSE");
+               return 0;
+       }
+#endif
+
+       return -EINVAL;
+}
+
+static int
+bnxt_tx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,
+                      struct rte_eth_burst_mode *mode)
+{
+       eth_tx_burst_t pkt_burst = dev->tx_pkt_burst;
+
+       if (pkt_burst == bnxt_xmit_pkts) {
+               snprintf(mode->info, sizeof(mode->info), "%s",
+                        "Scalar");
+               return 0;
+       }
+#ifdef RTE_ARCH_X86
+       if (pkt_burst == bnxt_xmit_pkts_vec) {
+               snprintf(mode->info, sizeof(mode->info), "%s",
+                        "Vector SSE");
+               return 0;
+       }
+#endif
+
+       return -EINVAL;
+}
+
 int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu)
 {
        struct bnxt *bp = eth_dev->data->dev_private;
@@ -4244,6 +4288,8 @@ static const struct eth_dev_ops bnxt_dev_ops = {
        .set_mc_addr_list = bnxt_dev_set_mc_addr_list_op,
        .rxq_info_get = bnxt_rxq_info_get_op,
        .txq_info_get = bnxt_txq_info_get_op,
+       .rx_burst_mode_get = bnxt_rx_burst_mode_get,
+       .tx_burst_mode_get = bnxt_tx_burst_mode_get,
        .dev_led_on = bnxt_dev_led_on_op,
        .dev_led_off = bnxt_dev_led_off_op,
        .xstats_get_by_id = bnxt_dev_xstats_get_by_id_op,