netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tun: virtio net is not compatible with LRO
@ 2009-06-03  5:23 Chris Wright
  2009-06-03  7:22 ` Rusty Russell
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Wright @ 2009-06-03  5:23 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Herbert Xu, Rusty Russell

The current failure mode for an LRO device bridged to a virtio device
(common for KVM) is BUG().  Rather than crashing the host, we can at
least limp along and give a warning.  lro_flush() will set gso_size,
but no corresponding gso_type, unlike gro which will eventually call
->gro_complete and set up proper gso_type.

Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
 drivers/net/tun.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 735bf41..17c4516 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -717,8 +717,15 @@ static __inline__ ssize_t tun_put_user(struct tun_struct *tun,
 				gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV4;
 			else if (sinfo->gso_type & SKB_GSO_TCPV6)
 				gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV6;
-			else
-				BUG();
+			else {
+				WARN_ONCE(1, "%s: hdr_len %d gso_size %d "
+					   "gso_type %x.  virtio is not "
+					   "compatible with LRO, verify NIC "
+					    "isn't using LRO", __func__,
+					    gso.hdr_len, gso.gso_size,
+					    sinfo->gso_type);
+				return -EINVAL;
+			}
 			if (sinfo->gso_type & SKB_GSO_TCP_ECN)
 				gso.gso_type |= VIRTIO_NET_HDR_GSO_ECN;
 		} else

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-06-03  7:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-03  5:23 [PATCH] tun: virtio net is not compatible with LRO Chris Wright
2009-06-03  7:22 ` Rusty Russell
2009-06-03  7:59   ` Herbert Xu

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).