WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [linux-2.6.18-xen] xen/netback: Always pull through PKT_

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] xen/netback: Always pull through PKT_PROT_LEN bytes into the linear part of an skb
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 17 Dec 2010 08:50:11 -0800
Delivery-date: Fri, 17 Dec 2010 08:50:22 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1292604058 0
# Node ID 072d5b122c53852b4b09c33fdd63b6ca4b1c58e7
# Parent  5a403282fd93f8df9e7953358bf5c118daf033b9
xen/netback: Always pull through PKT_PROT_LEN bytes into the linear part of an 
skb

Previously PKT_PROT_LEN would only have an effect on the first
fragment.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

xen/netback: try to pull a minimum of 72 bytes into the skb data area

... when receiving a packet into netback.  The previous number, 64,
tended to place a fragment boundary in the middle of the TCP header
options and led to unnecessary fragmentation in Windows <-> Windows
networking.

xen/netback: Re-define PKT_PROT_LEN to be bigger.

Re-define PKT_PROT_LEN to be big enough to handle maximal IPv4 and TCP
options and phrase the definition so that it's reasonably obvious
that's what it's for.

Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 drivers/xen/netback/netback.c |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletion(-)

diff -r 5a403282fd93 -r 072d5b122c53 drivers/xen/netback/netback.c
--- a/drivers/xen/netback/netback.c     Fri Dec 17 10:09:15 2010 +0000
+++ b/drivers/xen/netback/netback.c     Fri Dec 17 16:40:58 2010 +0000
@@ -35,6 +35,8 @@
  */
 
 #include "common.h"
+#include <linux/if_vlan.h>
+#include <linux/tcp.h>
 #include <xen/balloon.h>
 #include <xen/interface/memory.h>
 
@@ -105,7 +107,14 @@ static inline int netif_page_index(struc
        return idx;
 }
 
-#define PKT_PROT_LEN 64
+/*
+ * This is the amount of packet we copy rather than map, so that the
+ * guest can't fiddle with the contents of the headers while we do
+ * packet processing on them (netfilter, routing, etc).
+ */
+#define PKT_PROT_LEN    (ETH_HLEN + VLAN_HLEN + \
+                        sizeof(struct iphdr) + MAX_IPOPTLEN + \
+                        sizeof(struct tcphdr) + 40 /* MAX_TCP_OPTION_SPACE */)
 
 static struct pending_tx_info {
        netif_tx_request_t req;
@@ -1457,6 +1466,16 @@ static void net_tx_action(unsigned long 
 
                netbk_fill_frags(skb);
 
+               /*
+                * If the initial fragment was < PKT_PROT_LEN then
+                * pull through some bytes from the other fragments to
+                * increase the linear region to PKT_PROT_LEN bytes.
+                */
+               if (skb_headlen(skb) < PKT_PROT_LEN && skb_is_nonlinear(skb)) {
+                       int target = min_t(int, skb->len, PKT_PROT_LEN);
+                       __pskb_pull_tail(skb, target - skb_headlen(skb));
+               }
+
                skb->dev      = netif->dev;
                skb->protocol = eth_type_trans(skb, skb->dev);
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] xen/netback: Always pull through PKT_PROT_LEN bytes into the linear part of an skb, Xen patchbot-linux-2.6.18-xen <=