Trivial patch to fix the comments in netback.c Signed-off-by: Jon Mason <jdmason@us.ibm.com> --- --- drivers/xen/netback/netback.c.orig 2005-02-08 13:12:03.000000000 -0600 +++ drivers/xen/netback/netback.c 2005-02-08 13:23:06.788834000 -0600 @@ -1,11 +1,11 @@ /****************************************************************************** - * arch/xen/drivers/netif/backend/main.c + * drivers/xen/netback/netback.c * - * Back-end of the driver for virtual block devices. This portion of the - * driver exports a ''unified'' block-device interface that can be accessed + * Back-end of the driver for virtual network devices. This portion of the + * driver exports a ''unified'' network-device interface that can be accessed * by any operating system that implements a compatible front end. A * reference front-end implementation can be found in: - * arch/xen/drivers/netif/frontend + * drivers/xen/netfront/netfront.c * * Copyright (c) 2002-2004, K A Fraser */ ------------------------------------------------------- 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@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
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. Tested on Xen 2.0.3 and linux 2.6.10 kernel. Signed-off-by: Jon Mason <jdmason@us.ibm.com> --- --- 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(¬ifier_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@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
Jon Mason
2005-Feb-09 17:20 UTC
[Xen-devel] [PATCH 1/2] netfront coding style clean-up (trivial)
Resending, as it appears that the original didn''t go out. ----- My attempt at conforming netfront.c to the Linux Coding Style (according to Documentation/CodingStyle). Patch attached (as it appears my spacing is off). Signed-off-by: Jon Mason <jdmason@us.ibm.com>
Mark Williamson
2005-Feb-09 19:31 UTC
Re: [Xen-devel] [PATCH 1/2] netfront coding style clean-up (trivial)
> Thanks. Isn''t there some tool which does this sort of thing > automatically?GNU Indent is recommended in the Linux coding style guide, which also includes suitable runes for making it do generally the right thing. I''ve not used it myself. Cheers, Mark> We''ve had bugs introduced before by so-called > coding style cleanups, so I''d prefer if there wasn''t a human > doing most of the editing. (Though I''m sure you''ve been careful) > > BTW, core xen doesn''t actually use the Linux Coding Style, as we > prefer to have soft 4 space tabs rather than hard tabs. (''bsd'' > style in emacs) > > [This is not a cue to start a coding style flame war!] > > Ian > > > ------------------------------------------------------- > 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@lists.sourceforge.net > 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_id=6595&alloc_id=14396&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
Ian Pratt
2005-Feb-09 19:34 UTC
Re: [Xen-devel] [PATCH 1/2] netfront coding style clean-up (trivial)
> Resending, as it appears that the original didn''t go out. > > > ----- > My attempt at conforming netfront.c to the Linux Coding Style (according to > Documentation/CodingStyle). > > Patch attached (as it appears my spacing is off).Thanks. Isn''t there some tool which does this sort of thing automatically? We''ve had bugs introduced before by so-called coding style cleanups, so I''d prefer if there wasn''t a human doing most of the editing. (Though I''m sure you''ve been careful) BTW, core xen doesn''t actually use the Linux Coding Style, as we prefer to have soft 4 space tabs rather than hard tabs. (''bsd'' style in emacs) [This is not a cue to start a coding style flame war!] Ian ------------------------------------------------------- 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@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
Jon Mason
2005-Feb-09 19:41 UTC
Re: [Xen-devel] [PATCH 1/2] netfront coding style clean-up (trivial)
> Thanks. Isn''t there some tool which does this sort of thing > automatically? We''ve had bugs introduced before by so-called > coding style cleanups, so I''d prefer if there wasn''t a human > doing most of the editing. (Though I''m sure you''ve been careful)No, I did it by hand (in an effort to learn the code). While not outside the realm of possibility, I would doubt there are any errors. I am running with the patch currently (xen 2.0.4 and linux-2.6.10) without any problems. -- Jon Mason jdmason@us.ibm.com ------------------------------------------------------- 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@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
Ryan Harper
2005-Feb-09 19:43 UTC
Re: [Xen-devel] [PATCH 1/2] netfront coding style clean-up (trivial)
* Ian Pratt <Ian.Pratt@cl.cam.ac.uk> [2005-02-09 12:37]:> > Resending, as it appears that the original didn''t go out. > > > > > > ----- > > My attempt at conforming netfront.c to the Linux Coding Style (according to > > Documentation/CodingStyle). > > > > Patch attached (as it appears my spacing is off). > > Thanks. Isn''t there some tool which does this sort of thinglinux-2.?.?/scripts/Lindent which wraps `which indent` Ryan Harper ------------------------------------------------------- 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@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel