diff mbox

[V3,03/10] net/netmap.c: Add netmap_get_vnet_hdr_len function

Message ID 1493372840-24551-4-git-send-email-zhangchen.fnst@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Zhang Chen April 28, 2017, 9:47 a.m. UTC
Make netmap support get_vnet_hdr_len.

Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
---
 net/netmap.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox

Patch

diff --git a/net/netmap.c b/net/netmap.c
index 2d11a8f..694c340 100644
--- a/net/netmap.c
+++ b/net/netmap.c
@@ -360,6 +360,13 @@  static bool netmap_has_vnet_hdr_len(NetClientState *nc, int len)
     return true;
 }
 
+static int netmap_get_vnet_hdr_len(NetClientState *nc)
+{
+    NetmapState *s = DO_UPCAST(NetmapState, nc, nc);
+
+    return s->vnet_hdr_len;
+}
+
 /* A netmap interface that supports virtio-net headers always
  * supports UFO, so we use this callback also for the has_ufo hook. */
 static bool netmap_has_vnet_hdr(NetClientState *nc)
@@ -409,6 +416,7 @@  static NetClientInfo net_netmap_info = {
     .has_ufo = netmap_has_vnet_hdr,
     .has_vnet_hdr = netmap_has_vnet_hdr,
     .has_vnet_hdr_len = netmap_has_vnet_hdr_len,
+    .get_vnet_hdr_len = netmap_get_vnet_hdr_len,
     .using_vnet_hdr = netmap_using_vnet_hdr,
     .set_offload = netmap_set_offload,
     .set_vnet_hdr_len = netmap_set_vnet_hdr_len,