Commit a348292b authored by Florian Fainelli's avatar Florian Fainelli Committed by David S. Miller

net: dsa: Obtain VLAN protocol from skb->protocol

Now that dsa_untag_bridge_pvid() is called after eth_type_trans() we are
guaranteed that skb->protocol will be set to a correct value, thus
allowing us to avoid calling vlan_eth_hdr().
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Reviewed-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1c5ad5a9
...@@ -201,7 +201,6 @@ dsa_slave_to_master(const struct net_device *dev) ...@@ -201,7 +201,6 @@ dsa_slave_to_master(const struct net_device *dev)
static inline struct sk_buff *dsa_untag_bridge_pvid(struct sk_buff *skb) static inline struct sk_buff *dsa_untag_bridge_pvid(struct sk_buff *skb)
{ {
struct dsa_port *dp = dsa_slave_to_port(skb->dev); struct dsa_port *dp = dsa_slave_to_port(skb->dev);
struct vlan_ethhdr *hdr = vlan_eth_hdr(skb);
struct net_device *br = dp->bridge_dev; struct net_device *br = dp->bridge_dev;
struct net_device *dev = skb->dev; struct net_device *dev = skb->dev;
struct net_device *upper_dev; struct net_device *upper_dev;
...@@ -217,7 +216,7 @@ static inline struct sk_buff *dsa_untag_bridge_pvid(struct sk_buff *skb) ...@@ -217,7 +216,7 @@ static inline struct sk_buff *dsa_untag_bridge_pvid(struct sk_buff *skb)
return skb; return skb;
/* Move VLAN tag from data to hwaccel */ /* Move VLAN tag from data to hwaccel */
if (!skb_vlan_tag_present(skb) && hdr->h_vlan_proto == htons(proto)) { if (!skb_vlan_tag_present(skb) && skb->protocol == htons(proto)) {
skb = skb_vlan_untag(skb); skb = skb_vlan_untag(skb);
if (!skb) if (!skb)
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment