linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: saeed.bishara@gmail.com (saeed bishara)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2 v2] mv643xx_eth: use sw csum for big packets
Date: Sun, 20 Jun 2010 06:49:56 -0500	[thread overview]
Message-ID: <AANLkTik1QFcRKy95sLTr6MlPfhEyR84iTCcAzpuSg47D@mail.gmail.com> (raw)
In-Reply-To: <20100614093237.GG14513@mail.wantstofly.org>

On Mon, Jun 14, 2010 at 4:32 AM, Lennert Buytenhek
<buytenh@wantstofly.org> wrote:
> On Sun, Jun 13, 2010 at 10:38:10AM +0300, Saeed Bishara wrote:
>
>> >> >> @@ -2666,6 +2668,9 @@ static int
>> >> >mv643xx_eth_shared_probe(struct platform_device *pdev)
>> >> >> ? ? ? ? ?* Detect hardware parameters.
>> >> >> ? ? ? ? ?*/
>> >> >> ? ? ? ? msp->t_clk = (pd != NULL && pd->t_clk != 0) ? pd->t_clk
>> >> >: 133000000;
>> >> >> + ? ? ? msp->tx_csum_limit = pd->tx_csum_limit ?
>> >> >pd->tx_csum_limit : 9 * 1024;
>> >> >> + ? ? ? /* add header count so we can compare against skb->len */
>> >> >> + ? ? ? msp->tx_csum_limit += ETH_HLEN;
>> >> >> ? ? ? ? infer_hw_params(msp);
>> >> >
>> >> >Is the limit 9 * 1024 + 14 for the whole packet, or 9 *
>> >1024 for the IP
>> >> >part?
>> >>
>> >> the limit is for the IP part, but I thought that adding the
>> >header length, then comparing agains skb->len will be the
>> >same. What do you suggest?
>> >
>> >Right, but for the header length you take 14, while if to include VLAN
>> >tags or DSA tags the header might actually be longer -- how does that
>> >affect the ability of the hardware to compute the checksum?
>> >
>> >I.e. is the restriction "total packet length must be < N + 14 bytes"
>> >or is it "the IP part must be < N bytes and it doesn't matter whether
>> >there are VLAN tags or not"?
>>
>> It's the second option: "the IP part must be < N" regardless to the L2 header.
>
> Then I suppose you want to do something like:
>
> ? ? ? ?int hdr_len;
> ? ? ? ?int tag_bytes;
>
> ? ? ? ?hdr_len = (void *)ip_hdr(skb) - (void *)skb->data;
> ? ? ? ?tag_bytes = hdr_len - 4;
that should be 14 instead of 4, right?
> ? ? ? ?if (skb->len - hdr_len > the limit || unlikely(tag_bytes & ~12)) {
>
> (And then keep the limit as maximum number of bytes in the packet
> starting from the IP header part.)
ok. here is the updated patch:

  reply	other threads:[~2010-06-20 11:49 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-06 12:28 [PATCH 1/2] mv643xx_eth: disable csum offloading if the hw limited by max size Saeed Bishara
2010-06-06 12:28 ` [PATCH 2/2] set packet size limit for the mv643xx csum offloading Saeed Bishara
2010-06-08 17:09   ` Lennert Buytenhek
2010-07-15 20:26   ` Martin Michlmayr
2010-07-16  6:08     ` Lennert Buytenhek
2010-08-31 11:17       ` saeed bishara
2010-08-31 13:13       ` saeed bishara
2010-08-31 16:48         ` Lennert Buytenhek
2010-09-01  7:42           ` saeed bishara
2010-09-01  7:49             ` Lennert Buytenhek
2010-08-13 22:28   ` Maxime Bizon
2010-08-31 11:17     ` saeed bishara
2010-08-31 13:13     ` saeed bishara
2010-06-08 17:08 ` [PATCH 1/2] mv643xx_eth: disable csum offloading if the hw limited by max size Lennert Buytenhek
2010-06-09  8:21   ` Saeed Bishara
2010-06-09  8:51     ` [PATCH 1/2 v2] mv643xx_eth: use sw csum for big packets Saeed Bishara
2010-06-10  6:43       ` Lennert Buytenhek
2010-06-10  7:38         ` Saeed Bishara
2010-06-12  8:31           ` Lennert Buytenhek
2010-06-13  7:38             ` Saeed Bishara
2010-06-14  9:32               ` Lennert Buytenhek
2010-06-20 11:49                 ` saeed bishara [this message]
2010-06-20 11:58                   ` Lennert Buytenhek
2010-06-27  4:22                     ` David Miller
2010-06-09 19:10     ` [PATCH 1/2] mv643xx_eth: disable csum offloading if the hw limited by max size Lennert Buytenhek
2010-06-09 19:22       ` Abhijeet Gole

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTik1QFcRKy95sLTr6MlPfhEyR84iTCcAzpuSg47D@mail.gmail.com \
    --to=saeed.bishara@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).