From: David Brownell [mailto:[email protected]]
Sent: Monday, April 13, 2009 10:28 PM
>
> > > Isn't the issue that NET_IP_ALIGN is supposed to resolve,
> > > when properly used by network drivers?
> >
> > Looking at the documentation for that macro, drivers are supposed
> > to call skb_reserve() with NET_IP_ALIGN as argument. The patch is
> > doing the same, just not using the macro NET_IP_ALIGN.
> >
> > Maybe I will define the EMAC_L3_ALIGN macro as
> >
> > #define EMAC_L3_ALIGN(size)    ((NET_IP_ALIGN - (size)) & 0x3)
> >
> > to be more clear?
>
> I'm actually wondering why the EMAC_L3_ALIGN macro is needed
> at all.  Doesn't NET_IP_ALIGN -- used correctly -- resolve the
> issue completely?  See how other drivers are doing it.
>
> You're allocating an skb, and reserving some "extra" space at
> the beginning.  The normal procedure is more or less to reserve
> NET_IP_ALIGN bytes, to achieve proper alignment.

Quite right; I think the extra space stuff is a vestige of driver 
implementation on previous kernel (actually probably a different OS) where the 
allocator did not guarantee cache line alignment for skb data. alloc_skb boils 
down to kmalloc which guarantees cache aligned allocation so it should be safe 
to remove the provision for extra space.

I will submit a separate patch for that. IP header alignment patch should be 
straight forward then.

Thanks,
Sekhar
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to