[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <3ED53D84-CD06-49F5-A522-DDBE64F7EE8B@linux.alibaba.com>
Date: Fri, 16 Jun 2023 17:03:28 +0800
From: Cambda Zhu <cambda@...ux.alibaba.com>
To: netdev@...r.kernel.org,
Mahesh Bandewar <maheshb@...gle.com>
Cc: Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>,
"David S. Miller" <davem@...emloft.net>,
David Ahern <dsahern@...nel.org>,
Jakub Kicinski <kuba@...nel.org>,
Lu Wei <luwei32@...wei.com>,
"t.feng" <fengtao40@...wei.com>,
Xin Long <lucien.xin@...il.com>,
Xuan Zhuo <xuanzhuo@...ux.alibaba.com>,
Dust Li <dust.li@...ux.alibaba.com>,
Tony Lu <tonylu@...ux.alibaba.com>
Subject: Re: [PATCH net v1] ipvlan: Fix return value of ipvlan_queue_xmit()
> On Jun 16, 2023, at 14:34, Cambda Zhu <cambda@...ux.alibaba.com> wrote:
>
> The ipvlan_queue_xmit() should return NET_XMIT_XXX,
> but ipvlan_xmit_mode_l2/l3() returns rx_handler_result_t or NET_RX_XXX
> in some cases. The skb to forward could be treated as xmitted
> successfully.
>
> Fixes: 2ad7bf363841 ("ipvlan: Initial check-in of the IPVLAN driver.")
> Signed-off-by: Cambda Zhu <cambda@...ux.alibaba.com>
> ---
> v1:
> - Add Fixes tag.
> ---
> drivers/net/ipvlan/ipvlan_core.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c
> index ab5133eb1d51..e45817caaee8 100644
> --- a/drivers/net/ipvlan/ipvlan_core.c
> +++ b/drivers/net/ipvlan/ipvlan_core.c
> @@ -585,7 +585,8 @@ static int ipvlan_xmit_mode_l3(struct sk_buff *skb, struct net_device *dev)
> consume_skb(skb);
> return NET_XMIT_DROP;
> }
> - return ipvlan_rcv_frame(addr, &skb, true);
> + ipvlan_rcv_frame(addr, &skb, true);
> + return NET_XMIT_SUCCESS;
> }
> }
> out:
> @@ -611,7 +612,8 @@ static int ipvlan_xmit_mode_l2(struct sk_buff *skb, struct net_device *dev)
> consume_skb(skb);
> return NET_XMIT_DROP;
> }
> - return ipvlan_rcv_frame(addr, &skb, true);
> + ipvlan_rcv_frame(addr, &skb, true);
> + return NET_XMIT_SUCCESS;
> }
> }
> skb = skb_share_check(skb, GFP_ATOMIC);
> @@ -623,7 +625,8 @@ static int ipvlan_xmit_mode_l2(struct sk_buff *skb, struct net_device *dev)
> * the skb for the main-dev. At the RX side we just return
> * RX_PASS for it to be processed further on the stack.
> */
> - return dev_forward_skb(ipvlan->phy_dev, skb);
> + dev_forward_skb(ipvlan->phy_dev, skb);
> + return NET_XMIT_SUCCESS;
>
> } else if (is_multicast_ether_addr(eth->h_dest)) {
> skb_reset_mac_header(skb);
> --
> 2.16.6
Add CC Mahesh.
Powered by blists - more mailing lists