From: Hyman Huang(黄勇) <huang...@chinatelecom.cn> Add netdev information into output of hmp command hmp_info_network so developers can analyze interface capability more easily.
Signed-off-by: Hyman Huang(黄勇) <huang...@chinatelecom.cn> --- net/net.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/net/net.c b/net/net.c index c27ebfa..9325628 100644 --- a/net/net.c +++ b/net/net.c @@ -1330,6 +1330,21 @@ void print_net_client(Monitor *mon, NetClientState *nc) nc->queue_index, NetClientDriver_str(nc->info->type), nc->info_str); + if (nc->info->type != NET_CLIENT_DRIVER_NIC) { + NetDevInfo *info = query_netdev(nc); + if (info) { + monitor_printf(mon, "netdev info: ufo=%s, vnet-hdr=%s, " + "vnet-hdr-len=%s", info->ufo ? "on" : "off", + info->vnet_hdr ? "on" : "off", + info->vnet_hdr_len ? "on" : "off"); + if (info->has_acked_features) { + monitor_printf(mon, ", acked-features=0x%" PRIx64, + info->acked_features); + } + monitor_printf(mon, "\n"); + g_free(info); + } + } if (!QTAILQ_EMPTY(&nc->filters)) { monitor_printf(mon, "filters:\n"); } -- 1.8.3.1