From: Stephen Hemminger <shemminger@osdl.org>
To: Ben Greear <greearb@candelatech.com>,
"David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: [PATCH] VLAN code can use the faster ether_compare_addr
Date: Fri, 14 Jul 2006 14:27:38 -0700 [thread overview]
Message-ID: <20060714142738.265a7a98@localhost.localdomain> (raw)
The inline function compare_ether_addr is faster than memcmp.
Also, don't need to drag in proc_fs.h, the only reference to proc_dir_entry
is a pointer so the declaration is needed here.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
---
include/linux/if_vlan.h | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
1738bd3d785bb3f9fa24e26f98b8d86e7783eadf
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index eef0876..383627a 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -23,8 +23,8 @@ struct vlan_collection;
struct vlan_dev_info;
struct hlist_node;
-#include <linux/proc_fs.h> /* for proc_dir_entry */
#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
#define VLAN_HLEN 4 /* The additional bytes (on top of the Ethernet header)
* that VLAN requires.
@@ -185,7 +185,8 @@ static inline int __vlan_hwaccel_rx(stru
* This allows the VLAN to have a different MAC than the underlying
* device, and still route correctly.
*/
- if (!memcmp(eth_hdr(skb)->h_dest, skb->dev->dev_addr, ETH_ALEN))
+ if (!compare_ether_addr(eth_hdr(skb)->h_dest,
+ skb->dev->dev_addr))
skb->pkt_type = PACKET_HOST;
break;
};
--
1.2.4
next reply other threads:[~2006-07-14 21:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-14 21:27 Stephen Hemminger [this message]
2006-07-14 21:36 ` [PATCH] VLAN code can use the faster ether_compare_addr Ben Greear
2006-07-14 23:34 ` 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=20060714142738.265a7a98@localhost.localdomain \
--to=shemminger@osdl.org \
--cc=davem@davemloft.net \
--cc=greearb@candelatech.com \
--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).