@@ -729,6 +729,11 @@ static void tap_using_vnet_hdr(NetClientState *nc, bool using_vnet_hdr)
{
}
+static void tap_get_using_vnet_hdr(NetClientState *nc)
+{
+ return false;
+}
+
static void tap_set_offload(NetClientState *nc, int csum, int tso4,
int tso6, int ecn, int ufo)
{
@@ -744,6 +749,11 @@ static bool tap_has_vnet_hdr_len(NetClientState *nc, int len)
return false;
}
+static int tap_get_vnet_hdr_len(NetClientState *nc)
+{
+ return 0;
+}
+
static void tap_set_vnet_hdr_len(NetClientState *nc, int len)
{
abort();
@@ -757,7 +767,9 @@ static NetClientInfo net_tap_win32_info = {
.has_ufo = tap_has_ufo,
.has_vnet_hdr = tap_has_vnet_hdr,
.has_vnet_hdr_len = tap_has_vnet_hdr_len,
+ .get_vnet_hdr_len = tap_get_vnet_hdr_len,
.using_vnet_hdr = tap_using_vnet_hdr,
+ .get_using_vnet_hdr = tap_get_using_vnet_hdr,
.set_offload = tap_set_offload,
.set_vnet_hdr_len = tap_set_vnet_hdr_len,
};
@@ -246,6 +246,15 @@ static bool tap_has_vnet_hdr_len(NetClientState *nc, int len)
return !!tap_probe_vnet_hdr_len(s->fd, len);
}
+static int tap_get_vnet_hdr_len(NetClientState *nc)
+{
+ TAPState *s = DO_UPCAST(TAPState, nc, nc);
+
+ assert(nc->info->type == NET_CLIENT_DRIVER_TAP);
+
+ return s->host_vnet_hdr_len;
+}
+
static void tap_set_vnet_hdr_len(NetClientState *nc, int len)
{
TAPState *s = DO_UPCAST(TAPState, nc, nc);
@@ -268,6 +277,15 @@ static void tap_using_vnet_hdr(NetClientState *nc, bool using_vnet_hdr)
s->using_vnet_hdr = using_vnet_hdr;
}
+static bool tap_get_using_vnet_hdr(NetClientState *nc)
+{
+ TAPState *s = DO_UPCAST(TAPState, nc, nc);
+
+ assert(nc->info->type == NET_CLIENT_DRIVER_TAP);
+
+ return s->using_vnet_hdr;
+}
+
static int tap_set_vnet_le(NetClientState *nc, bool is_le)
{
TAPState *s = DO_UPCAST(TAPState, nc, nc);
@@ -354,7 +372,9 @@ static NetClientInfo net_tap_info = {
.has_ufo = tap_has_ufo,
.has_vnet_hdr = tap_has_vnet_hdr,
.has_vnet_hdr_len = tap_has_vnet_hdr_len,
+ .get_vnet_hdr_len = tap_get_vnet_hdr_len,
.using_vnet_hdr = tap_using_vnet_hdr,
+ .get_using_vnet_hdr = tap_get_using_vnet_hdr,
.set_offload = tap_set_offload,
.set_vnet_hdr_len = tap_set_vnet_hdr_len,
.set_vnet_le = tap_set_vnet_le,
Make tap backend support get_vnet_hdr_len. Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com> --- net/tap-win32.c | 12 ++++++++++++ net/tap.c | 20 ++++++++++++++++++++ 2 files changed, 32 insertions(+)