]> xenbits.xensource.com Git - people/ssmith/nc2-2.6.27.git/commitdiff
When using vmq posted buffers use offset and size values sent by
authorSteven Smith <ssmith@weybridge.uk.xensource.com>
Fri, 11 Sep 2009 15:30:25 +0000 (16:30 +0100)
committerSteven Smith <ssmith@weybridge.uk.xensource.com>
Fri, 11 Sep 2009 15:30:25 +0000 (16:30 +0100)
guest instead of using constants 0 and PAGE_SIZE.

Signed-off-by: Jose Renato Santos <jsantos@hpl.hp.com>
drivers/xen/netchannel2/vmq.c

index b98d910e4504a5766d3c0a385a3ddcd59771d9d9..0d0b950cfd6d94298a9e111489e75d326198696c 100644 (file)
@@ -637,6 +637,7 @@ struct sk_buff *vmq_alloc_skb(struct net_device *netdevice, int queue_id,
        int nr_bufs, i;
        unsigned int cons;
        unsigned int prod;
+       struct nc2_tx_buffer *txbuf;
 
        /* get the netchannel2 interface corresponding to this queue */
         nc = netdev_priv(nc2_vmq_queue_to_vif(netdevice, queue_id));
@@ -671,8 +672,9 @@ struct sk_buff *vmq_alloc_skb(struct net_device *netdevice, int queue_id,
                /* FIX ME: This can be simplified */
                skb_shinfo(skb)->frags[i].page = 
                        virt_to_page(vmq_idx_to_kaddr(vmq,idx));
-               skb_shinfo(skb)->frags[i].page_offset = 0;
-               skb_shinfo(skb)->frags[i].size = PAGE_SIZE;
+               txbuf = vmq->buffer[idx].buf;
+               skb_shinfo(skb)->frags[i].page_offset = txbuf->off_in_page;
+               skb_shinfo(skb)->frags[i].size = txbuf->size;
                skb_shinfo(skb)->nr_frags++;
                skb->dev = netdevice;
                cons++;