Re: Alignment of skb->data (Mylex lne390 on jensen-boards)

kuznet@ms2.inr.ac.ru
Fri, 31 Jul 1998 20:23:43 +0400 (MSK DST)


Hello!

> However, would it be possible in future terms to establish an
> alignment-standard for the skb->data pointer before it is handed to the
> block_output method?

Current standard is to align packets so that IP part
started on 16byte boundary. If you device has ll header
of length 4n+2, skb->data is deemed to be aligned on 4n+2
and you will have to copy skb before dmaing.

> And then there are some lines in arp.c and ip_output.c that I don=B4t u=
> nderstand:
> arp.c line 449:
> skb_reserve(skb, (dev->hard_header_len+15)&~15);
> ^^^^^^^
> ip_output.c line 627:
> int hh_len =3D (rt->u.dst.dev->hard_header_len + 15)&~15;
> ^^^^^^^
>
> Does the operation at the and ensure a 16-byte alignment?

Yes, but it aligns IP data, rather than final skb->data.

> Of course it is not easy to hold skb->data aligned, but it may be worth=
> it ...

Now it is impossible if MAC header has wrong length, as it is in ethernet.
F.e. now ethernet drivers on alpha are forced to copy all received
packets to make IP 32bit aligned :-(

Alexey Kuznetsov.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html