* [PATCH net-next] net: dsa: tag_8021q: only call skb_push/skb_pull around __skb_vlan_pop
@ 2022-02-15 20:47 Vladimir Oltean
2022-02-17 4:40 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Oltean @ 2022-02-15 20:47 UTC (permalink / raw)
To: netdev
Cc: David S. Miller, Jakub Kicinski, Andrew Lunn, Vivien Didelot,
Florian Fainelli, Mans Rullgard
__skb_vlan_pop() needs skb->data to point at the mac_header, while
skb_vlan_tag_present() and skb_vlan_tag_get() don't, because they don't
look at skb->data at all.
So we can avoid uselessly moving around skb->data for the case where the
VLAN tag was offloaded by the DSA master.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
net/dsa/tag_8021q.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/dsa/tag_8021q.c b/net/dsa/tag_8021q.c
index 27712a81c967..114f663332d0 100644
--- a/net/dsa/tag_8021q.c
+++ b/net/dsa/tag_8021q.c
@@ -577,14 +577,14 @@ void dsa_8021q_rcv(struct sk_buff *skb, int *source_port, int *switch_id)
{
u16 vid, tci;
- skb_push_rcsum(skb, ETH_HLEN);
if (skb_vlan_tag_present(skb)) {
tci = skb_vlan_tag_get(skb);
__vlan_hwaccel_clear_tag(skb);
} else {
+ skb_push_rcsum(skb, ETH_HLEN);
__skb_vlan_pop(skb, &tci);
+ skb_pull_rcsum(skb, ETH_HLEN);
}
- skb_pull_rcsum(skb, ETH_HLEN);
vid = tci & VLAN_VID_MASK;
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net: dsa: tag_8021q: only call skb_push/skb_pull around __skb_vlan_pop
2022-02-15 20:47 [PATCH net-next] net: dsa: tag_8021q: only call skb_push/skb_pull around __skb_vlan_pop Vladimir Oltean
@ 2022-02-17 4:40 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-02-17 4:40 UTC (permalink / raw)
To: Vladimir Oltean
Cc: netdev, davem, kuba, andrew, vivien.didelot, f.fainelli, mans
Hello:
This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 15 Feb 2022 22:47:22 +0200 you wrote:
> __skb_vlan_pop() needs skb->data to point at the mac_header, while
> skb_vlan_tag_present() and skb_vlan_tag_get() don't, because they don't
> look at skb->data at all.
>
> So we can avoid uselessly moving around skb->data for the case where the
> VLAN tag was offloaded by the DSA master.
>
> [...]
Here is the summary with links:
- [net-next] net: dsa: tag_8021q: only call skb_push/skb_pull around __skb_vlan_pop
https://git.kernel.org/netdev/net-next/c/c8620335951d
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-17 4:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-15 20:47 [PATCH net-next] net: dsa: tag_8021q: only call skb_push/skb_pull around __skb_vlan_pop Vladimir Oltean
2022-02-17 4:40 ` patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.