Skip to content

Instantly share code, notes, and snippets.

@displague
Last active August 29, 2015 14:08
Show Gist options
  • Save displague/d856614e449e270fad5b to your computer and use it in GitHub Desktop.
Save displague/d856614e449e270fad5b to your computer and use it in GitHub Desktop.
--- a/drivers/net/xen-netfront.c 2014-10-31 15:33:16.000000000 -0400
+++ b/drivers/net/xen-netfront.c 2014-10-31 15:36:04.000000000 -0400
@@ -497,7 +497,13 @@
offset = frag->page_offset;
/* Data must not cross a page boundary. */
- BUG_ON(len + offset > PAGE_SIZE<<compound_order(page));
+ // BUG_ON(len + offset > PAGE_SIZE<<compound_order(page));
+ if (len + offset > PAGE_SIZE<<compound_order(page)) {
+ netdev_err(queue->info->netdev, "len %d offset %d order %d PageHead %d i %d nr_frags %d \n",
+ len, offset, compound_order(page),
+ PageHead(page), i, skb_shinfo(skb)->nr_frags);
+ BUG();
+ }
/* Skip unused frames from start of page */
page += offset >> PAGE_SHIFT;
@displague
Copy link
Author

drivers/net/xen-netfront.c: In function ‘xennet_make_frags’:
drivers/net/xen-netfront.c:504:27: warning: passing argument 1 of ‘netdev_err’ from incompatible pointer type [enabled by default]
In file included from drivers/net/xen-netfront.c:36:0:
include/linux/netdevice.h:3535:5: note: expected ‘const struct net_device *’ but argument is of type ‘struct xenbus_device *’

@displague
Copy link
Author

Fixing by using queue->info->netdev instead of dev (previously considered queue->info->xbdev)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment