diff mbox

[V5,1/9] net: Add vnet_hdr_len related arguments in NetClientState

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

Commit Message

Zhang Chen May 23, 2017, 2:20 p.m. UTC
Add vnet_hdr_len and using_vnet_hdr arguments in NetClientState
that make othermodule get real vnet_hdr_len easily.

Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
---
 include/net/net.h | 2 ++
 net/net.c         | 2 ++
 2 files changed, 4 insertions(+)

Comments

Zhang Chen May 23, 2017, 2:24 p.m. UTC | #1
On 05/23/2017 10:20 PM, Zhang Chen wrote:
> Add vnet_hdr_len and using_vnet_hdr arguments in NetClientState
> that make othermodule get real vnet_hdr_len easily.
>
> Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>

Sorry, I forgot to add the reviewed-by:
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
>   include/net/net.h | 2 ++
>   net/net.c         | 2 ++
>   2 files changed, 4 insertions(+)
>
> diff --git a/include/net/net.h b/include/net/net.h
> index 99b28d5..70edfc0 100644
> --- a/include/net/net.h
> +++ b/include/net/net.h
> @@ -100,6 +100,8 @@ struct NetClientState {
>       unsigned int queue_index;
>       unsigned rxfilter_notify_enabled:1;
>       int vring_enable;
> +    bool using_vnet_hdr;
> +    int vnet_hdr_len;
>       QTAILQ_HEAD(NetFilterHead, NetFilterState) filters;
>   };
>   
> diff --git a/net/net.c b/net/net.c
> index 0ac3b9e..a00a0c9 100644
> --- a/net/net.c
> +++ b/net/net.c
> @@ -472,6 +472,7 @@ void qemu_using_vnet_hdr(NetClientState *nc, bool enable)
>           return;
>       }
>   
> +    nc->using_vnet_hdr = enable;
>       nc->info->using_vnet_hdr(nc, enable);
>   }
>   
> @@ -491,6 +492,7 @@ void qemu_set_vnet_hdr_len(NetClientState *nc, int len)
>           return;
>       }
>   
> +    nc->vnet_hdr_len = len;
>       nc->info->set_vnet_hdr_len(nc, len);
>   }
>
diff mbox

Patch

diff --git a/include/net/net.h b/include/net/net.h
index 99b28d5..70edfc0 100644
--- a/include/net/net.h
+++ b/include/net/net.h
@@ -100,6 +100,8 @@  struct NetClientState {
     unsigned int queue_index;
     unsigned rxfilter_notify_enabled:1;
     int vring_enable;
+    bool using_vnet_hdr;
+    int vnet_hdr_len;
     QTAILQ_HEAD(NetFilterHead, NetFilterState) filters;
 };
 
diff --git a/net/net.c b/net/net.c
index 0ac3b9e..a00a0c9 100644
--- a/net/net.c
+++ b/net/net.c
@@ -472,6 +472,7 @@  void qemu_using_vnet_hdr(NetClientState *nc, bool enable)
         return;
     }
 
+    nc->using_vnet_hdr = enable;
     nc->info->using_vnet_hdr(nc, enable);
 }
 
@@ -491,6 +492,7 @@  void qemu_set_vnet_hdr_len(NetClientState *nc, int len)
         return;
     }
 
+    nc->vnet_hdr_len = len;
     nc->info->set_vnet_hdr_len(nc, len);
 }