[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1270502993.9013.36.camel@edumazet-laptop>
Date: Mon, 05 Apr 2010 23:29:53 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: John Linn <john.linn@...inx.com>
Cc: netdev@...r.kernel.org, linuxppc-dev@...abs.org,
grant.likely@...retlab.ca, jwboyer@...ux.vnet.ibm.com,
john.williams@...alogix.com, michal.simek@...alogix.com,
John Tyner <jtyner@...ucr.edu>
Subject: Re: [PATCH] [V3] Add non-Virtex5 support for LL TEMAC driver
Le lundi 05 avril 2010 à 15:11 -0600, John Linn a écrit :
> This patch adds support for using the LL TEMAC Ethernet driver on
> non-Virtex 5 platforms by adding support for accessing the Soft DMA
> registers as if they were memory mapped instead of solely through the
> DCR's (available on the Virtex 5).
>
> The patch also updates the driver so that it runs on the MicroBlaze.
> The changes were tested on the PowerPC 440, PowerPC 405, and the
> MicroBlaze platforms.
>
> Signed-off-by: John Tyner <jtyner@...ucr.edu>
> Signed-off-by: John Linn <john.linn@...inx.com>
>
> ---
> +/* Align the IP data in the packet on word boundaries as MicroBlaze
> + * needs it.
> + */
> +
> #define XTE_ALIGN 32
> -#define BUFFER_ALIGN(adr) ((XTE_ALIGN - ((u32) adr)) % XTE_ALIGN)
> +#define BUFFER_ALIGN(adr) ((34 - ((u32) adr)) % XTE_ALIGN)
>
Very interesting way of doing this, but why such convoluted thing ?
Because of the % 32, this is equivalent to :
#define BUFFER_ALIGN(adr) ((2 - ((u32) adr)) % XTE_ALIGN)
But wait, dont we recognise the magic constant NET_IP_ALIGN ?
So, I ask, cant you use netdev_alloc_skb_ip_align() in this driver ?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists