netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next,v2] macvlan: implement .parse_protocol hook function in macvlan_hard_header_ops
@ 2023-12-02 13:06 Zhengchao Shao
  2023-12-02 14:18 ` Willem de Bruijn
  2023-12-05 14:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Zhengchao Shao @ 2023-12-02 13:06 UTC (permalink / raw)
  To: netdev, davem, edumazet, kuba, pabeni
  Cc: weiyongjun1, yuehaibing, shaozhengchao

The .parse_protocol hook function in the macvlan_header_ops structure is
not implemented. As a result, when the AF_PACKET family is used to send
packets, skb->protocol will be set to 0.
Macvlan is a device of type ARPHRD_ETHER (ether_setup). Therefore, use
eth_header_parse_protocol function to obtain the protocol.

Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
---
v2: remove Fixes tag
---
 drivers/net/macvlan.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 88dd8a2245b0..a3cc665757e8 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -609,6 +609,7 @@ static const struct header_ops macvlan_hard_header_ops = {
 	.parse		= eth_header_parse,
 	.cache		= eth_header_cache,
 	.cache_update	= eth_header_cache_update,
+	.parse_protocol	= eth_header_parse_protocol,
 };
 
 static int macvlan_open(struct net_device *dev)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next,v2] macvlan: implement .parse_protocol hook function in macvlan_hard_header_ops
  2023-12-02 13:06 [PATCH net-next,v2] macvlan: implement .parse_protocol hook function in macvlan_hard_header_ops Zhengchao Shao
@ 2023-12-02 14:18 ` Willem de Bruijn
  2023-12-05 14:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Willem de Bruijn @ 2023-12-02 14:18 UTC (permalink / raw)
  To: Zhengchao Shao, netdev, davem, edumazet, kuba, pabeni
  Cc: weiyongjun1, yuehaibing, shaozhengchao

Zhengchao Shao wrote:
> The .parse_protocol hook function in the macvlan_header_ops structure is
> not implemented. As a result, when the AF_PACKET family is used to send
> packets, skb->protocol will be set to 0.
> Macvlan is a device of type ARPHRD_ETHER (ether_setup). Therefore, use
> eth_header_parse_protocol function to obtain the protocol.
> 
> Suggested-by: Eric Dumazet <edumazet@google.com>
> Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>

Reviewed-by: Willem de Bruijn <willemb@google.com>

Macvlan does not use skb->protocol in its ndo_start_xmit often. But
does use it once, in macvlan_broadcast, to not broadcast ETH_P_PAUSE
frames.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next,v2] macvlan: implement .parse_protocol hook function in macvlan_hard_header_ops
  2023-12-02 13:06 [PATCH net-next,v2] macvlan: implement .parse_protocol hook function in macvlan_hard_header_ops Zhengchao Shao
  2023-12-02 14:18 ` Willem de Bruijn
@ 2023-12-05 14:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-12-05 14:40 UTC (permalink / raw)
  To: Zhengchao Shao
  Cc: netdev, davem, edumazet, kuba, pabeni, weiyongjun1, yuehaibing

Hello:

This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Sat, 2 Dec 2023 21:06:58 +0800 you wrote:
> The .parse_protocol hook function in the macvlan_header_ops structure is
> not implemented. As a result, when the AF_PACKET family is used to send
> packets, skb->protocol will be set to 0.
> Macvlan is a device of type ARPHRD_ETHER (ether_setup). Therefore, use
> eth_header_parse_protocol function to obtain the protocol.
> 
> Suggested-by: Eric Dumazet <edumazet@google.com>
> Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
> 
> [...]

Here is the summary with links:
  - [net-next,v2] macvlan: implement .parse_protocol hook function in macvlan_hard_header_ops
    https://git.kernel.org/netdev/net-next/c/cb297cc5e194

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] 3+ messages in thread

end of thread, other threads:[~2023-12-05 14:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-02 13:06 [PATCH net-next,v2] macvlan: implement .parse_protocol hook function in macvlan_hard_header_ops Zhengchao Shao
2023-12-02 14:18 ` Willem de Bruijn
2023-12-05 14:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).