Hi!
Am Freitag, 4. Februar 2005 08:28 schrieben Sie:
> On Wednesday 26 January 2005 1:30 pm, you wrote:
> > Am Mittwoch, 26. Januar 2005 21:39 schrieben Sie:
> > > And it's _demonstrably false_ that IP packets are always aligned on
> > > such boundaries.  Remember, lots of other ARM platforms (v4 and v5)
> > > are already working fine.  Yours seems to be the exception.
> >
> > Perhaps because its a ARM9TDMI without MMU [sic!]?
>
> That shouldn't matter either.  Even though your CPU has a 32 bit memory
> interface.  Though I suspect the issue is lurking somewhere in that
> vicinity.  For example, maybe you're mis-handling unaligned access
> traps that the other ARM processors won't need to issue?
Part of my .config:
# CONFIG_ALIGNMENT_TRAP is not set
It's deactivated because we dont have Coprocessor Register 15.

> > The I found out the the packet is dropped because the IP-Header checksum
> > could not be verified. The IP-Header checksum could only be successfully
> > verified when the packet is aligned.
> >
> > After aligning the packet i get 0% packet loss in ping.
>
> So, _why_ does the checksum not compute correctly on your system,
> while it does on other ARM platforms?
>
> Given that you found this problem affecting at least two different
> network drivers -- ones that work on other ARM boards!! -- it seems
> likely to me that the problem is specific to your hardware, or to
> your board support package.
We also had these alignment problems with the pure ethernet interfaces. 
The driver is part of uClinux patch and called:
CONFIG_P2001_ETH=y

> Remember, <asm/checksum.h> only says that it's "best" to have the
> packet aligned on a 32 bit boundary ... it's NOT mandatory.  And
> in <linux/skbuff.h> it's pointed out that sometimes it's more
> important to have the DMA transfer be aligned than the checksum;
> one example would be on Intel's PXA 255 ARM/XScale processor,
> where the DMA engine insists on 16 byte buffer alignment.
>
>
> That said, if you can come up with a better patch, I'd consider it.
> On some systems it seems like it'd affect performance.
>
> (Even though it clearly just papers over some more basic problem on
> your system.  Which for now I'll assume is broken handling of kernel
> mode unaligned accesses!)
>
> Three problems raised with what you sent:  
> (a) #ifdef ARM is clearly  wrong
I just kicked it out
> ; and as Sergey said, (b) the right value is NET_IP_ALIGN as defined 
> in <linux/skbuff.h>, 
Yeah thats much better
> plus (c) you need to increase the size of the 
> buffer specified in alloc_skb() to account for this wasted space.
Of course.

Regards
Thomas

-- 
Wo kämen wir hin, wenn alle sagten, wo kämen wir hin,
und niemand ginge, um einmal zu schauen, wohin man käme,
wenn man ginge.
«Kurt Marti»
--- drivers/usb/gadget/ether.c_ori	2005-01-26 18:22:17.000000000 +0100
+++ drivers/usb/gadget/ether.c	2005-01-26 19:39:41.000000000 +0100
@@ -1762,10 +1762,16 @@ rx_submit (struct eth_dev *dev, struct u
 #endif	
 	size -= size % dev->out_ep->maxpacket;
 
-	if ((skb = alloc_skb (size, gfp_flags)) == 0) {
+	if ((skb = alloc_skb (size + NET_IP_ALIGN, gfp_flags)) == 0) {
 		DEBUG (dev, "no rx skb\n");
 		goto enomem;
 	}
+	
+	/* IP-Packets should be align to 32-Bit
+	 * The 14Byte long ethernet-header disturbs
+	 * this when skb is align to 32-Bit.
+	 */
+	skb_reserve(skb, NET_IP_ALIGN);
 
 	req->buf = skb->data;
 	req->length = size;

Reply via email to