Skip to contentSkip to conversation

net: re-instate some lost vnet_hdr code

PATCH Applied Mark McLoughlin 2 participants 2 messages Jul 8, 2009 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: re-instate some lost vnet_hdr code

Merge commit 211eb5f301 lost the code we had in tap_send_packet() to handle the case of the tapfd having IF_VNET_HDR enabled, but the NIC code not having support for virtio_net_hdr. In this case, we just strip off the header before passing it to the NIC.

Fixes:

http://sourceforge.net/tracker/?func=detail&atid=893831&aid=2817367&group_id=180599
Network doesn't work anymore switching from kvm-86 to kvm-87

---
 net.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
net.c +10 -1
index ac06ea1..19e00e0 100644
@@ -1460,12 +1460,21 @@ static void tap_send(void *opaque)
     int size;
 
     do {
+        uint8_t *buf = s->buf;
+
         size = tap_read_packet(s->fd, s->buf, sizeof(s->buf));
         if (size <= 0) {
             break;
         }
 
-        size = qemu_send_packet_async(s->vc, s->buf, size, tap_send_completed);
+#ifdef IFF_VNET_HDR
+        if (s->has_vnet_hdr && !s->using_vnet_hdr) {
+            buf += sizeof(struct virtio_net_hdr);
+            size -= sizeof(struct virtio_net_hdr);
+        }
+#endif
+
+        size = qemu_send_packet_async(s->vc, buf, size, tap_send_completed);
         if (size == 0) {
             tap_read_poll(s, 0);
         }
Signature · 1 line
1.6.3.3
Applied
#1 lore raw
Quoted 10 lines · Mark McLoughlin

Merge commit 211eb5f301 lost the code we had in tap_send_packet() to handle the case of the tapfd having IF_VNET_HDR enabled, but the NIC code not having support for virtio_net_hdr. In this case, we just strip off the header before passing it to the NIC.

Fixes:

http://sourceforge.net/tracker/?func=detail&atid=893831&aid=2817367&group_id=180599
Network doesn't work anymore switching from kvm-86 to kvm-87

Applied, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function