From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from digidescorp.com (mail.digidescorp.com [66.244.163.200]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 65BF2B7D16 for ; Wed, 7 Apr 2010 01:13:27 +1000 (EST) Received: from [10.10.6.102] by digidescorp.com (Cipher SSLv3:RC4-MD5:128) (MDaemon PRO v10.1.1) with ESMTP id md50001246428.msg for ; Tue, 06 Apr 2010 10:08:08 -0500 Subject: RE: [PATCH] [V3] Add non-Virtex5 support for LL TEMAC driver From: "Steven J. Magnani" To: John Linn In-Reply-To: <7a42d507-bf50-40f3-a2a0-8de682b314d7@SG2EHSMHS017.ehs.local> References: <1270502993.9013.36.camel@edumazet-laptop> <7a42d507-bf50-40f3-a2a0-8de682b314d7@SG2EHSMHS017.ehs.local> Content-Type: text/plain Date: Tue, 06 Apr 2010 10:08:02 -0500 Message-Id: <1270566482.3949.4.camel@iscandar.digidescorp.com> Mime-Version: 1.0 Cc: Eric Dumazet , michal.simek@petalogix.com, netdev@vger.kernel.org, John Tyner , linuxppc-dev@ozlabs.org, john.williams@petalogix.com Reply-To: steve@digidescorp.com List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Mon, 2010-04-05 at 15:33 -0600, John Linn wrote: > > > +/* 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 ? > > Grant might have insight into why this started this way, I just updated to help with MicroBlaze alignment. > > > > > 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 ? > > That should work. I switched to that in the older xilinx_lltemac driver without any problem. ------------------------------------------------------------------------ Steven J. Magnani "I claim this network for MARS! www.digidescorp.com Earthling, return my space modulator!" #include