All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jim Baxter <jim_baxter@mentor.com>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Frank Li <Frank.Li@freescale.com>,
	Fugang Duan <B38611@freescale.com>, <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next v2 1/1] net: fec: Enable imx6 enet checksum acceleration.
Date: Wed, 17 Apr 2013 15:43:04 +0100	[thread overview]
Message-ID: <516EB4F8.2090004@mentor.com> (raw)
In-Reply-To: <1366152097.2645.63.camel@bwh-desktop.uk.solarflarecom.com>

On 16/04/13 23:41, Ben Hutchings wrote:
> On Tue, 2013-04-16 at 23:15 +0100, Jim Baxter wrote:
>> On 16/04/13 16:39, Ben Hutchings wrote:
> [...]
>>>> @@ -818,6 +890,19 @@ fec_enet_rx(struct net_device *ndev, int budget)
>>>>  				spin_unlock_irqrestore(&fep->tmreg_lock, flags);
>>>>  			}
>>>>  
>>>> +			if (fep->bufdesc_ex &&
>>>> +				(fep->csum_flags & FLAG_RX_CSUM_ENABLED)) {
>>>> +				struct bufdesc_ex *ebdp =
>>>> +					(struct bufdesc_ex *)bdp;
>>>> +				if (!(ebdp->cbd_esc & FLAG_RX_CSUM_ENABLED)) {
>>>> +					/* don't check it */
>>>> +					skb->ip_summed = CHECKSUM_UNNECESSARY;
>>>
>>> This looks very strange.  Presumably the RX_ICE and RX_PCR flags
>>> indicate checksum errors, and therefore !(ebdp->cbd_esc &
>>> FLAG_RX_CSUM_ENABLED) means the checksum(s) are good?  This would be
>>> clearer if you defined FLAG_RX_CSUM_ERROR as well (with the same numeric
>>> value).
>>>
>> Agreed, that would be clearer.
>>>> +				} else {
>>>> +					ndev->stats.rx_errors++;
>>>
>>> Layer 3 and 4 errors should not be counted in the net device stats.
>>>
>> Ok, are they just for Levls 1 and  2?
> [...]
> 
> Right, that's my understanding.  Our job as driver writers is to
> validate at layer 1 and 2 (FCS error, length error, MAC filtering).
> Checksum validation at layers 3 and 4 is an optimisation and the kernel
> stack takes care of counting checksum errors.
> 
> Ben.
> 

Thanks for that information Ben, that is good to know.

Has anyone used ping6 or iperf -V, whilst debugging I have found that
the packets being sent are of protocol 0x0800 when using those commands.

Jim

      reply	other threads:[~2013-04-17 14:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-16 10:36 [PATCH net-next v2 1/1] net: fec: Enable imx6 enet checksum acceleration Jim Baxter
2013-04-16 12:35 ` David Miller
2013-04-16 14:09   ` Jim Baxter
2013-04-16 18:00     ` David Miller
2013-04-16 22:16       ` Jim Baxter
2013-04-16 13:50 ` Eric Dumazet
2013-04-16 15:30   ` Jim Baxter
2013-04-16 15:39 ` Ben Hutchings
2013-04-16 22:15   ` Jim Baxter
2013-04-16 22:41     ` Ben Hutchings
2013-04-17 14:43       ` Jim Baxter [this message]

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=516EB4F8.2090004@mentor.com \
    --to=jim_baxter@mentor.com \
    --cc=B38611@freescale.com \
    --cc=Frank.Li@freescale.com \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.