net: vlan: introduce skb_vlan_eth_hdr()
authorVladimir Oltean <vladimir.oltean@nxp.com>
Thu, 20 Apr 2023 22:55:54 +0000 (01:55 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sun, 23 Apr 2023 13:16:44 +0000 (14:16 +0100)
commit1f5020acb33f926030f62563c86dffca35c7b701
tree123303fc527865ea9fc64c52fa6e67fad1e3f962
parentf90615ada0b1e21a9d93ff89b04549fd7a92c92b
net: vlan: introduce skb_vlan_eth_hdr()

Similar to skb_eth_hdr() introduced in commit 96cc4b69581d ("macvlan: do
not assume mac_header is set in macvlan_broadcast()"), let's introduce a
skb_vlan_eth_hdr() helper which can be used in TX-only code paths to get
to the VLAN header based on skb->data rather than based on the
skb_mac_header(skb).

We also consolidate the drivers that dereference skb->data to go through
this helper.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 files changed:
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
drivers/net/ethernet/emulex/benet/be_main.c
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
drivers/net/ethernet/intel/i40e/i40e_txrx.c
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
drivers/net/ethernet/sfc/tx_tso.c
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
drivers/staging/gdm724x/gdm_lte.c
include/linux/if_vlan.h
net/batman-adv/soft-interface.c