From: Chris Metcalf <cmetcalf@tilera•com>
To: Eric Dumazet <eric.dumazet@gmail•com>
Cc: Joe Perches <joe@perches•com>,
Tobias Klauser <tklauser@distanz•ch>,
David Miller <davem@davemloft•net>, <netdev@vger•kernel.org>
Subject: Re: [PATCH net-next-2.6] etherdevice.h: Add is_unicast_ether_addr function
Date: Thu, 13 Jan 2011 11:38:42 -0500 [thread overview]
Message-ID: <4D2F2A92.7020909@tilera.com> (raw)
In-Reply-To: <1294908916.3570.21.camel@edumazet-laptop>
On 1/13/2011 3:55 AM, Eric Dumazet wrote:
> Le jeudi 13 janvier 2011 à 00:24 -0800, Joe Perches a écrit :
>> On Thu, 2011-01-13 at 09:14 +0100, Tobias Klauser wrote:
>>> >From a check for !is_multicast_ether_addr it is not always obvious that
>>> we're checking for a unicast address. So add this helper function to
>>> make those code paths easier to read.
>>> include/linux/etherdevice.h | 11 +++++++++++
>> []
>>> /**
>>> + * is_unicast_ether_addr - Determine if the Ethernet address is unicast
>>> + * @addr: Pointer to a six-byte array containing the Ethernet address
>>> + *
>>> + * Return true if the address is a unicast address.
>>> + */
>>> +static inline int is_unicast_ether_addr(const u8 *addr)
>>> +{
>>> + return !is_multicast_ether_addr(addr);
>>> +}
>> Can't you simply use is_valid_ether_addr?
>>
>> I can't think of much reason that a new function for
>> !multicast without the !is_zero is needed.
>>
> performance ?
>
> is_valid_ether_addr() is used at device init time, not when receiving
> packets.
>
> I am not sure we _need_ to check for is_zero_ether_addr() each time we
> receive a packet.
>
> Either a MAC is unicast or multicast.
>
> A zero address is not multicast for sure.
I agree - the is_zero_ether_addr() check seems pointless in the context of
the running interface.
Also, I think a static inline is better form than a #define, all things
being equal.
So, I like Tobias' reworked patches. I can take them into the Tilera tree,
but I'd prefer David Miller take them into the net tree if he is agreeable,
since it now includes changes to generic networking code. If you take the
latter approach you can include my:
Acked-by: Chris Metcalf <cmetcalf@tilera•com>
--
Chris Metcalf, Tilera Corp.
http://www.tilera.com
next prev parent reply other threads:[~2011-01-13 16:38 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-12 9:31 [PATCH net-next-2.6] netdev: tilepro: Use is_multicast_ether_addr helper Tobias Klauser
2011-01-12 17:49 ` Chris Metcalf
2011-01-13 2:45 ` David Miller
2011-01-13 6:58 ` Tobias Klauser
2011-01-13 7:42 ` David Miller
2011-01-13 8:13 ` Tobias Klauser
2011-01-13 8:14 ` [PATCH net-next-2.6] etherdevice.h: Add is_unicast_ether_addr function Tobias Klauser
2011-01-13 8:24 ` Joe Perches
2011-01-13 8:35 ` Tobias Klauser
2011-01-13 8:43 ` Joe Perches
2011-01-13 8:55 ` Eric Dumazet
2011-01-13 16:38 ` Chris Metcalf [this message]
2011-01-13 20:35 ` David Miller
2011-01-14 5:51 ` David Miller
2011-01-13 8:15 ` [PATCH v2 net-next-2.6] netdev: tilepro: Use is_unicast_ether_addr helper Tobias Klauser
2011-01-14 5:51 ` 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=4D2F2A92.7020909@tilera.com \
--to=cmetcalf@tilera$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=eric.dumazet@gmail$(echo .)com \
--cc=joe@perches$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=tklauser@distanz$(echo .)ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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