From: Alexander Duyck <alexander.h.duyck@redhat.com>
To: David Laight <David.Laight@ACULAB.COM>,
"'Alexander Duyck'" <alexander.duyck@gmail.com>,
Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"davem@davemloft.net" <davem@davemloft.net>
Subject: Re: [PATCH 0/3] A few minor clean-ups to eth_type_trans
Date: Fri, 01 May 2015 08:34:20 -0700 [thread overview]
Message-ID: <55439CFC.3090406@redhat.com> (raw)
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D1CB2A3B6@AcuExch.aculab.com>
On 05/01/2015 04:30 AM, David Laight wrote:
> From: Alexander Duyck
>> Sent: 01 May 2015 00:12
> ...
>>> Only the comment 'ETH_P_802_3_MIN is aligned to 512' through me off.
>>> It's divisible by 256 that matters.
>> Yeah, it is 0x0600 hex so we can ignore the lower 8 bits, or in the case
>> of little-endian systems the upper 8 bits. I think when I had
>> originally written the patch I was using a mask of 0xFE00, but then I
>> realized that all the compiler cared about is knowing which byte it is
>> supposed to compare against.
> Isn't the limit actually 1500 (0x5dc) not 1536 (0x600).
> Certainly the longest 8802.3 frame has a 'length' field of 1500
> followed by the 3 bytes LLC header and 1497 bytes of 'userdata'.
> (If you do ISO transport nothing is ever word aligned.)
>
> Whether any 'ethertypes' from 0x5dd to 0x5ff were ever allocated
> (and plausibly still in use) is a separate question.
> Some below 1500 were allocated.
>
> David
Actually it comes straight from the IEEE Std 802.3, sections 3.2.6. If
the field value is less than or equal to 1500 (05DC hex), then the field
is length. If the field is greater than or equal to 1536 (0600 hex),
then it is an Ethertype. The region from 1501 to 1535 isn't really
defined in the standard in terms of behavior, but then again if that
value is used it likely isn't an 802.3 frame anyway. For the purposes of
this check all we care about is the 802.3 Ethertypes which the standard
says are at 0x600 and above.
- Alex
next prev parent reply other threads:[~2015-05-01 15:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-30 21:53 [PATCH 0/3] A few minor clean-ups to eth_type_trans Alexander Duyck
2015-04-30 21:53 ` [PATCH 1/3] etherdev: Avoid unnecessary byte swap in check for Ethertype Alexander Duyck
2015-04-30 23:03 ` Eric Dumazet
2015-04-30 23:24 ` Alexander Duyck
2015-05-01 0:13 ` Eric Dumazet
2015-05-01 0:41 ` Alexander Duyck
2015-04-30 21:53 ` [PATCH 2/3] etherdev: Process is_multicast_ether_addr at same size as other operations Alexander Duyck
2015-04-30 21:53 ` [PATCH 3/3] etherdev: Use skb->data to retrieve Ethernet header instead of eth_hdr Alexander Duyck
2015-04-30 22:35 ` [PATCH 0/3] A few minor clean-ups to eth_type_trans Alexei Starovoitov
2015-04-30 23:11 ` Alexander Duyck
2015-05-01 11:30 ` David Laight
2015-05-01 15:34 ` Alexander Duyck [this message]
2015-05-04 2:47 ` David Miller
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=55439CFC.3090406@redhat.com \
--to=alexander.h.duyck@redhat.com \
--cc=David.Laight@ACULAB.COM \
--cc=alexander.duyck@gmail.com \
--cc=alexei.starovoitov@gmail.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 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).