|
From: | Jason Wang |
Subject: | Re: [Qemu-devel] [PATCH V4 01/12] net: Add vnet_hdr_len related arguments in NetClientState |
Date: | Mon, 15 May 2017 16:06:16 +0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
On 2017年05月15日 14:56, Zhang Chen wrote:
On 05/15/2017 11:24 AM, Jason Wang wrote:On 2017年05月14日 05:24, Philippe Mathieu-Daudé wrote:Hi Zhang On 05/11/2017 10:41 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 <address@hidden> --- 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); }For what it's worth, now having those fields in NetClientState it is possible to remove a deref to NetClientInfo in qemu_has_vnet_hdr() and qemu_has_vnet_hdr_len().Anyway, Reviewed-by: Philippe Mathieu-Daudé <address@hidden>Yes and this could be done on top with removing private e.g vnet_hdr_len.Do you means we will remove the qemu_has_vnet_hdr() and qemu_has_vnet_hdr_len() in the future?Thanks Zhang Chen
Yes and e.g both tap and netmap have its private vnet header field. We can remove them too.
Thanks
Thanks .
[Prev in Thread] | Current Thread | [Next in Thread] |