Skip to contentSkip to conversation

bridge: is PACKET_LOOPBACK unlikely()?

RFC In review Simon Horman 2 participants 2 messages Aug 23, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 bridge: is PACKET_LOOPBACK unlikely()?

While looking at using netdev_rx_handler_register for openvswitch Jesse Gross suggested that an unlikely() might be worthwhile in that code. I'm interested to see if its appropriate for the bridge code.

net/bridge/br_input.c +1 -1
Index: net-next-2.6/net/bridge/br_input.c
===================================================================
@@ -141,7 +141,7 @@ struct sk_buff *br_handle_frame(struct s
 	const unsigned char *dest = eth_hdr(skb)->h_dest;
 	int (*rhook)(struct sk_buff *skb);
 
-	if (skb->pkt_type == PACKET_LOOPBACK)
+	if (unlikely(skb->pkt_type == PACKET_LOOPBACK))
 		return skb;
 
 	if (!is_valid_ether_addr(eth_hdr(skb)->h_source))
maintainer
#1 lore raw

From: Simon Horman <[email protected]>
Date: Mon, 23 Aug 2010 12:35:32 +0900

Quoted 6 lines

While looking at using netdev_rx_handler_register for openvswitch Jesse Gross suggested that an unlikely() might be worthwhile in that code. I'm interested to see if its appropriate for the bridge code.

Seems reasonable to me, applied to net-next-2.6