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

[Xen-changelog] [linux-2.6.18-xen] net{back,front}: minor cleanup


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-linux-2.6.18-xen <patchbot@xxxxxxx>
  • Date: Wed, 16 Oct 2013 13:33:02 +0000
  • Delivery-date: Wed, 16 Oct 2013 13:33:12 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1381928543 -7200
# Node ID aea020fc95cbb50dbb4063897d88d7898d7f77b2
# Parent  b94250095e987b539baa08c82d0f2861fa3c85fe
net{back,front}: minor cleanup

- use PFN_UP() instead of open coding it
- make xennet_get_extras() static
- tighten packing of struct netbk_rx_meta
- guard GNTTABOP_unmap_and_replace by CONFIG_XEN_COMPAT check (mostly
  for documentation purposes)

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---


diff -r b94250095e98 -r aea020fc95cb drivers/xen/netback/netback.c
--- a/drivers/xen/netback/netback.c     Tue Sep 10 12:06:11 2013 +0200
+++ b/drivers/xen/netback/netback.c     Wed Oct 16 15:02:23 2013 +0200
@@ -46,7 +46,7 @@
 
 struct netbk_rx_meta {
        skb_frag_t frag;
-       int id;
+       u16 id;
        u8 copy:1;
 };
 
@@ -1726,10 +1726,12 @@ static int __init netback_init(void)
 
        netbk_copy_skb_mode = NETBK_DONT_COPY_SKB;
        if (MODPARM_copy_skb) {
+#if CONFIG_XEN_COMPAT < 0x030200
                if (HYPERVISOR_grant_table_op(GNTTABOP_unmap_and_replace,
                                              NULL, 0))
                        netbk_copy_skb_mode = NETBK_ALWAYS_COPY_SKB;
                else
+#endif
                        netbk_copy_skb_mode = NETBK_DELAYED_COPY_SKB;
        }
 
diff -r b94250095e98 -r aea020fc95cb drivers/xen/netfront/netfront.c
--- a/drivers/xen/netfront/netfront.c   Tue Sep 10 12:06:11 2013 +0200
+++ b/drivers/xen/netfront/netfront.c   Wed Oct 16 15:02:23 2013 +0200
@@ -33,6 +33,7 @@
 #include <linux/module.h>
 #include <linux/version.h>
 #include <linux/kernel.h>
+#include <linux/pfn.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/string.h>
@@ -971,7 +972,7 @@ static int network_start_xmit(struct sk_
                goto drop;
        }
 
-       frags += (offset + len + PAGE_SIZE - 1) / PAGE_SIZE;
+       frags += PFN_UP(offset + len);
        if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
                printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
                       frags);
@@ -1102,9 +1103,8 @@ static void xennet_move_rx_slot(struct n
        np->rx.req_prod_pvt++;
 }
 
-int xennet_get_extras(struct netfront_info *np,
-                     struct netif_extra_info *extras, RING_IDX rp)
-
+static int xennet_get_extras(struct netfront_info *np,
+                            struct netif_extra_info *extras, RING_IDX rp)
 {
        struct netif_extra_info *extra;
        RING_IDX cons = np->rx.rsp_cons;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
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®.