aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ethernet/eth.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index f777e17d28c8..8f032bae60ad 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -179,12 +179,13 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
179 * variants has been configured on the receiving interface, 179 * variants has been configured on the receiving interface,
180 * and if so, set skb->protocol without looking at the packet. 180 * and if so, set skb->protocol without looking at the packet.
181 */ 181 */
182 if (netdev_uses_dsa_tags(dev)) 182 if (unlikely(netdev_uses_dsa_tags(dev)))
183 return htons(ETH_P_DSA); 183 return htons(ETH_P_DSA);
184 if (netdev_uses_trailer_tags(dev)) 184
185 if (unlikely(netdev_uses_trailer_tags(dev)))
185 return htons(ETH_P_TRAILER); 186 return htons(ETH_P_TRAILER);
186 187
187 if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN) 188 if (likely(ntohs(eth->h_proto) >= ETH_P_802_3_MIN))
188 return eth->h_proto; 189 return eth->h_proto;
189 190
190 /* 191 /*
@@ -193,7 +194,7 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
193 * layer. We look for FFFF which isn't a used 802.2 SSAP/DSAP. This 194 * layer. We look for FFFF which isn't a used 802.2 SSAP/DSAP. This
194 * won't work for fault tolerant netware but does for the rest. 195 * won't work for fault tolerant netware but does for the rest.
195 */ 196 */
196 if (skb->len >= 2 && *(unsigned short *)(skb->data) == 0xFFFF) 197 if (unlikely(skb->len >= 2 && *(unsigned short *)(skb->data) == 0xFFFF))
197 return htons(ETH_P_802_3); 198 return htons(ETH_P_802_3);
198 199
199 /* 200 /*