[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080513.224633.229128314.davem@davemloft.net>
Date: Tue, 13 May 2008 22:46:33 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: bshanth@...il.com
Cc: netdev@...r.kernel.org
Subject: Re: ip_finish_outpu2 question
From: Prashanth <bshanth@...il.com>
Date: Wed, 14 May 2008 10:53:36 +0530
> So skb->data will be pointing to an unaligned memory address;
> atleast for the ethernet case which has 14 Bytes header length.
That's correct.
> because of this my chip is not allowing to do DMA for unaligned
> memory address.
Most chips have an "packet offset" parameter you can feed into the TX
descriptor, and you align the DMA address that is given to the
chip. This allows the chip to do an aligned DMA fetch yet still
be agnostic the the alignment of the packet given to it by the
networking stack.
> So is it not better
> to do skb_push() for 16 bytes and make skb->data aligned?
If we did that skb->data would point to the two garbage bytes
in front of the ethernet header.
> In ip_finish_output2() function it's better to do skb_push() for
> aligned length. And let others access the ethernet header by adding
> HH_DATA_OFF() to it. Do we face any problems by doing this.
No, that would punish good hardware which can handle arbitrary
TX packet alignment for the sake of bad hardware.
--
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