[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-3.0.5-testing] netback: Copy skbuffs that are presented to the start_xmit() function



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1177342623 -3600
# Node ID 6139337e26903d18edc1ff9ce4df1f1b0cfa76f2
# Parent  6f4735ba9b07f1893f071683f416c6b233d24df3
netback: Copy skbuffs that are presented to the start_xmit() function
with a multi-page head buffer. The new skbuff will not have a
multi-page head buffer, which is a necessary restriction until this is
supported by the internals of the netback driver.
Signed-off-by: Steven Smith <ssmith@xxxxxxxxxxxxx>
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 linux-2.6-xen-sparse/drivers/xen/netback/netback.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff -r 6f4735ba9b07 -r 6139337e2690 
linux-2.6-xen-sparse/drivers/xen/netback/netback.c
--- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c        Sat Apr 21 
14:12:09 2007 -0700
+++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c        Mon Apr 23 
16:37:03 2007 +0100
@@ -252,8 +252,11 @@ int netif_be_start_xmit(struct sk_buff *
        /*
         * Copy the packet here if it's destined for a flipping interface
         * but isn't flippable (e.g. extra references to data).
+        * XXX For now we also copy skbuffs whose head crosses a page
+        * boundary, because netbk_gop_skb can't handle them.
         */
-       if (!netif->copying_receiver) {
+       if (!netif->copying_receiver ||
+           ((skb_headlen(skb) + offset_in_page(skb->data)) >= PAGE_SIZE)) {
                struct sk_buff *nskb = netbk_copy_skb(skb);
                if ( unlikely(nskb == NULL) )
                        goto drop;
@@ -425,8 +428,9 @@ static void netbk_gop_skb(struct sk_buff
        }
 
        /*
-        * This must occur at the end to ensure that we don't trash
-        * skb_shinfo until we're done.
+        * This must occur at the end to ensure that we don't trash skb_shinfo
+        * until we're done. We know that the head doesn't cross a page
+        * boundary because such packets get copied in netif_be_start_xmit.
         */
        head_meta->id = netbk_gop_frag(netif, head_meta, 0, npo,
                                       virt_to_page(skb->data),

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.