Netdev List
 help / color / mirror / Atom feed
* [PATCH] Don't allow sharing of tx skbs on xen-netfront
@ 2011-11-14 19:22 Neil Horman
  2011-11-14 19:27 ` David Miller
  2011-11-17 15:20 ` Ian Campbell
  0 siblings, 2 replies; 11+ messages in thread
From: Neil Horman @ 2011-11-14 19:22 UTC (permalink / raw)
  To: netdev
  Cc: Neil Horman, David S. Miller, Jeremy Fitzhardinge,
	Konrad Rzeszutek Wilk, xen-devel

It was pointed out to me recently that the xen-netfront driver can't safely
support shared skbs on transmit, since, while it doesn't maintain skb state
directly, it does pass a pointer to the skb to the hypervisor via a list, and
the hypervisor may expect the contents of the skb to remain stable.  Clearing
the IFF_TX_SKB_SHARING flag after the call to alloc_etherdev to make it safe.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: "David S. Miller" <davem@davemloft.net>
CC: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
CC: xen-devel@lists.xensource.com
---
 drivers/net/xen-netfront.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 226faab..fb1077b 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1252,6 +1252,12 @@ static struct net_device * __devinit xennet_create_dev(struct xenbus_device *dev
 		return ERR_PTR(-ENOMEM);
 	}
 
+	/*
+	 * Since frames remain on a queue after a return from xennet_start_xmit,
+	 * we can't support tx shared skbs
+	 */
+	netdev->priv_flags &= ~IFF_TX_SKB_SHARING;
+
 	np                   = netdev_priv(netdev);
 	np->xbdev            = dev;
 
-- 
1.7.6.4

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

end of thread, other threads:[~2011-11-18 12:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-14 19:22 [PATCH] Don't allow sharing of tx skbs on xen-netfront Neil Horman
2011-11-14 19:27 ` David Miller
2011-11-14 19:32   ` Neil Horman
2011-11-17 15:20 ` Ian Campbell
2011-11-17 19:25   ` Neil Horman
2011-11-17 20:17     ` Ian Campbell
2011-11-17 20:45       ` Neil Horman
2011-11-18 10:30         ` Ian Campbell
2011-11-18 11:48           ` Neil Horman
2011-11-18 11:53             ` Ian Campbell
2011-11-18 12:09               ` Neil Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox