net: dsa: create a helper for locating EtherType DSA headers on TX
Create a similar helper for locating the offset to the DSA header relative to skb->data, and make the existing EtherType header taggers to use it. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
5d928ff486
commit
a72808b658
@ -521,6 +521,15 @@ static inline void *dsa_etype_header_pos_rx(struct sk_buff *skb)
|
||||
return skb->data - 2;
|
||||
}
|
||||
|
||||
/* On TX, skb->data points to skb_mac_header(skb), which means that EtherType
|
||||
* header taggers start exactly where the EtherType is (the EtherType is
|
||||
* treated as part of the DSA header).
|
||||
*/
|
||||
static inline void *dsa_etype_header_pos_tx(struct sk_buff *skb)
|
||||
{
|
||||
return skb->data + 2 * ETH_ALEN;
|
||||
}
|
||||
|
||||
/* switch.c */
|
||||
int dsa_switch_register_notifier(struct dsa_switch *ds);
|
||||
void dsa_switch_unregister_notifier(struct dsa_switch *ds);
|
||||
|
Reference in New Issue
Block a user