summaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/device/format.c
diff options
context:
space:
mode:
authorChenmin Sun <chenmin.sun@intel.com>2020-03-06 23:09:32 +0800
committerDamjan Marion <dmarion@me.com>2020-03-12 17:50:11 +0000
commitf3468975d837fbe07c11c55d6ce7a6bf756ea2d8 (patch)
tree14f660110fdb6aa4f6fac88ae11d7ad0b4ae0839 /src/plugins/dpdk/device/format.c
parent30fa5d1e17d59e7a48e19c03029fe0028c17fc6a (diff)
dpdk: tx/rx burst function description refactor
DPDK provides two new APIs to retrieve information about the Tx/Rx packet burst mode: rte_eth_tx_burst_mode_get rte_eth_rx_burst_mode_get This patch leverages these two APIs to describe the tx/rx mode. Currently, Intel X710/E810 and Mellanox Mlx5 support the new APIs. For NICs that don't support the new APIs, still use the original way to print their tx/rx function name Type: refactor Signed-off-by: Chenmin Sun <chenmin.sun@intel.com> Change-Id: Ibe47f5debe3b3f17f462fbf9834394e22845cc08
Diffstat (limited to 'src/plugins/dpdk/device/format.c')
-rw-r--r--src/plugins/dpdk/device/format.c37
1 files changed, 31 insertions, 6 deletions
diff --git a/src/plugins/dpdk/device/format.c b/src/plugins/dpdk/device/format.c
index 0db58d8ec2f..693f92d4a81 100644
--- a/src/plugins/dpdk/device/format.c
+++ b/src/plugins/dpdk/device/format.c
@@ -568,6 +568,7 @@ format_dpdk_device (u8 * s, va_list * args)
u32 indent = format_get_indent (s);
f64 now = vlib_time_now (dm->vlib_main);
struct rte_eth_dev_info di;
+ struct rte_eth_burst_mode mode;
dpdk_update_counters (xd, now);
dpdk_update_link_state (xd, now);
@@ -666,12 +667,36 @@ format_dpdk_device (u8 * s, va_list * args)
format_dpdk_rss_hf_name, di.flow_type_rss_offloads,
format_white_space, indent + 2,
format_dpdk_rss_hf_name, rss_conf.rss_hf);
- s = format (s, "%Utx burst function: %s\n",
- format_white_space, indent + 2,
- ptr2sname (rte_eth_devices[xd->port_id].tx_pkt_burst));
- s = format (s, "%Urx burst function: %s\n",
- format_white_space, indent + 2,
- ptr2sname (rte_eth_devices[xd->port_id].rx_pkt_burst));
+
+ if (rte_eth_tx_burst_mode_get (xd->port_id, 0, &mode) == 0)
+ {
+ s = format (s, "%Utx burst mode: %s%s\n",
+ format_white_space, indent + 2,
+ mode.info,
+ mode.flags & RTE_ETH_BURST_FLAG_PER_QUEUE ?
+ " (per queue)" : "");
+ }
+ else
+ {
+ s = format (s, "%Utx burst function: %s\n",
+ format_white_space, indent + 2,
+ ptr2sname (rte_eth_devices[xd->port_id].tx_pkt_burst));
+ }
+
+ if (rte_eth_rx_burst_mode_get (xd->port_id, 0, &mode) == 0)
+ {
+ s = format (s, "%Urx burst mode: %s%s\n",
+ format_white_space, indent + 2,
+ mode.info,
+ mode.flags & RTE_ETH_BURST_FLAG_PER_QUEUE ?
+ " (per queue)" : "");
+ }
+ else
+ {
+ s = format (s, "%Urx burst function: %s\n",
+ format_white_space, indent + 2,
+ ptr2sname (rte_eth_devices[xd->port_id].rx_pkt_burst));
+ }
}
/* $$$ MIB counters */