From: Vincenzo Maffione <v.maffione@gmail.com>
To: qemu-devel@nongnu.org
Cc: jasowang@redhat.com, Vincenzo Maffione <v.maffione@gmail.com>
Subject: [Qemu-devel] [PATCH v1 1/1] net: tap: allow net frontends to un-negotiate virtio-net header
Date: Fri, 15 Feb 2019 18:46:59 +0100 [thread overview]
Message-ID: <20190215174659.4007-2-v.maffione@gmail.com> (raw)
In-Reply-To: <20190215174659.4007-1-v.maffione@gmail.com>
The implementation of the TAP net backend already supports the case
(s->host_vnet_hdr_len && !s->using_vnet_hdr), which means that
the TAP device is expecting the header, while the net frontend
(emulated device) is not aware of it. This case is handled by
stripping or prepending the (zeroed) header on the fly.
However, the function tap_using_vnet_hdr() has an assert() that
explicitly prevents this situation to happen.
This patch removes the assert(), so that net frontends are
free to un-negotiate the header.
Signed-off-by: Vincenzo Maffione <v.maffione@gmail.com>
---
net/tap.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/net/tap.c b/net/tap.c
index cc8525f154..6f2aca0396 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -264,7 +264,6 @@ static void tap_using_vnet_hdr(NetClientState *nc, bool using_vnet_hdr)
TAPState *s = DO_UPCAST(TAPState, nc, nc);
assert(nc->info->type == NET_CLIENT_DRIVER_TAP);
- assert(!!s->host_vnet_hdr_len == using_vnet_hdr);
s->using_vnet_hdr = using_vnet_hdr;
}
--
2.20.1
next prev parent reply other threads:[~2019-02-15 17:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-15 17:46 [Qemu-devel] [PATCH v1 0/1] Allow TAP to unnegotiate virtio-net header Vincenzo Maffione
2019-02-15 17:46 ` Vincenzo Maffione [this message]
2019-02-18 4:19 ` Jason Wang
2019-02-18 11:53 ` Vincenzo Maffione
2019-02-19 6:48 ` Jason Wang
2019-02-19 8:28 ` Vincenzo Maffione
2019-02-19 9:35 ` Jason Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190215174659.4007-2-v.maffione@gmail.com \
--to=v.maffione@gmail.com \
--cc=jasowang@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).