VLAN code can use the faster ether_compare_addr
Subsystems (2)
PATCH 1/1 VLAN code can use the faster ether_compare_addr
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.
---
include/linux/if_vlan.h | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
1738bd3d785bb3f9fa24e26f98b8d86e7783eadf
include/linux/if_vlan.h +3 -2
@@ -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 ; };
Signature · 1 line
1.2.4
Quoted 3 lines · Stephen Hemminger
The inline function
compare_ether_addris faster than memcmp. Also, don't need to drag inproc_fs.h, the only reference toproc_dir_entryis a pointer so the declaration is needed here.
Looks fine to me.
Ben
Quoted 33 lines
Signed-off-by Stephen Hemminger <[email protected]>---
include/linux/if_vlan.h | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
1738bd3d785bb3f9fa24e26f98b8d86e7783eadfinclude/linux/if_vlan.h +3
-2@@ -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 ; };
Signature · 2 lines
Ben Greear <[email protected]> Candela Technologies Inc http://www.candelatech.com
David Miller
maintainerFrom: Ben Greear <[email protected]>
Date: Fri, 14 Jul 2006 14:36:17 -0700
Quoted 6 lines
Quoted 3 lines · Stephen Hemminger
The inline function
compare_ether_addris faster than memcmp. Also, don't need to drag inproc_fs.h, the only reference toproc_dir_entryis a pointer so the declaration is needed here.Looks fine to me.
To me too, applied, thanks a lot.