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-devel

RE: [Xen-devel] [PATCH 2/2] netfront skb padding

To: "Jon Mason" <jdmason@xxxxxxxxxx>, "Xen Mailing List" <xen-devel@xxxxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] [PATCH 2/2] netfront skb padding
From: "Ian Pratt" <m+Ian.Pratt@xxxxxxxxxxxx>
Date: Wed, 9 Feb 2005 02:12:30 -0000
Cc: <ian.pratt@xxxxxxxxxxxx>
Delivery-date: Wed, 09 Feb 2005 02:13:17 +0000
Envelope-to: xen+James.Bulpin@xxxxxxxxxxxx
List-archive: <http://sourceforge.net/mailarchive/forum.php?forum=xen-devel>
List-help: <mailto:xen-devel-request@lists.sourceforge.net?subject=help>
List-id: List for Xen developers <xen-devel.lists.sourceforge.net>
List-post: <mailto:xen-devel@lists.sourceforge.net>
List-subscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=subscribe>
List-unsubscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=unsubscribe>
Sender: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx
Thread-index: AcUOS2zwSut/7cYMRG2pmZlscIitowAARYnA
Thread-topic: [Xen-devel] [PATCH 2/2] netfront skb padding
 
> It appears that when alloc'ing a skb, it is bring padded by 
> an arbitrarily 
> (and excessive) long value.  The value for this padding 
> really only needs to 
> be 24.  24 = 14 for the ethernet header + 2 for the cache 
> alignment + 4 for 
> the CRC + 4 for the VLAN flags.

Given that we're allocating page sized buffers the current situation
doesn't cost us anything.

Infact, what happens if the packet gets encapsulated e.g. by etherip
etc? Is Linux smart enough to be able to put the extra headers on
in-place if there is enough head room?

If so, the current situation is positively better.

Ian

> Tested on Xen 2.0.3 and linux 2.6.10 kernel.
> 
> Signed-off-by: Jon Mason <jdmason@xxxxxxxxxx>
> ---
> 
> --- drivers/xen/netfront/netfront.c.new 2005-02-08 
> 19:09:31.368834000 -0600
> +++ drivers/xen/netfront/netfront.c 2005-02-08 
> 19:09:24.738834000 -0600
> @@ -50,6 +50,8 @@
>  #include <asm-xen/balloon.h>
>  #include <asm/page.h>
>  
> +#define NETFRONT_VERSION "1.1"
> +
>  #ifndef __GFP_NOWARN
>  #define __GFP_NOWARN 0
>  #endif
> @@ -62,8 +64,11 @@
>          skb_shinfo(_skb)->frag_list = NULL;           \
>      } while (0)
>  
> -/* Allow headroom on each rx pkt for Ethernet header, 
> alignment padding, ... */
> -#define RX_HEADROOM 200
> +/* 
> + * Allow headroom on each rx pkt for Ethernet header, 
> alignment padding, 
> + * CRC, and VLAN 
> + */
> +#define RX_HEADROOM ETH_HLEN + NET_IP_ALIGN + 8 
>  
>  /*
>   * If the backend driver is pipelining transmit requests 
> then we can be very
> @@ -1248,7 +1253,8 @@ static int __init netif_init(void)
>      if (xen_start_info.flags & SIF_INITDOMAIN)
>          return 0;
>  
> -    IPRINTK("Initialising virtual ethernet driver.\n");
> +    IPRINTK("Initialising virtual ethernet driver, version %s\n", 
> +      NETFRONT_VERSION);
>      INIT_LIST_HEAD(&dev_list);
>      (void)register_inetaddr_notifier(&notifier_inetdev);
>      netctrl_init();
> 
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from 
> real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/xen-devel
> 


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel