Mailing List Archive

Fix the request size for a full page-sized skbuff in netfront
# HG changeset patch
# User kaf24@firebug.cl.cam.ac.uk
# Node ID c976c1ff806aa46c989fb5b1d84b311519fb0456
# Parent 4e9c643968ffd0526258dc1ae7d1fee6123be718
Fix the request size for a full page-sized skbuff in netfront
driver (must allow 16 bytes for dev_alloc_skb headroom).

Signed-off-by: Keir Fraser <keir@xensource.com>

diff -r 4e9c643968ff -r c976c1ff806a linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Tue Dec 6 14:02:54 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Tue Dec 6 14:52:15 2005
@@ -535,8 +535,12 @@
*/
batch_target = np->rx_target - (req_prod - np->rx.rsp_cons);
for (i = skb_queue_len(&np->rx_batch); i < batch_target; i++) {
+ /*
+ * Subtract dev_alloc_skb headroom (16 bytes) and shared info
+ * tailroom then round down to SKB_DATA_ALIGN boundary.
+ */
skb = alloc_xen_skb(
- (PAGE_SIZE - sizeof(struct skb_shared_info)) &
+ (PAGE_SIZE - 16 - sizeof(struct skb_shared_info)) &
(-SKB_DATA_ALIGN(1)));
if (skb == NULL)
break;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog
Fix the request size for a full page-sized skbuff in netfront [ In reply to ]
# HG changeset patch
# User kaf24@firebug.cl.cam.ac.uk
# Node ID d64dbb48684c4a6cc84f778a4faf1ba7fc75b9f0
# Parent 7a03820bbbf32636ee539d6fca9ae45c25a84b78
Fix the request size for a full page-sized skbuff in netfront
driver (must allow 16 bytes for dev_alloc_skb headroom).

Signed-off-by: Keir Fraser <keir@xensource.com>

xen-unstable cset: c976c1ff806aa46c989fb5b1d84b311519fb0456
committer: Robert Read <robert@xensource.com>

diff -r 7a03820bbbf3 -r d64dbb48684c linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Tue Dec 6 06:02:54 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Tue Dec 6 06:52:15 2005
@@ -535,8 +535,12 @@
*/
batch_target = np->rx_target - (req_prod - np->rx.rsp_cons);
for (i = skb_queue_len(&np->rx_batch); i < batch_target; i++) {
+ /*
+ * Subtract dev_alloc_skb headroom (16 bytes) and shared info
+ * tailroom then round down to SKB_DATA_ALIGN boundary.
+ */
skb = alloc_xen_skb(
- (PAGE_SIZE - sizeof(struct skb_shared_info)) &
+ (PAGE_SIZE - 16 - sizeof(struct skb_shared_info)) &
(-SKB_DATA_ALIGN(1)));
if (skb == NULL)
break;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog