[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <6A7B6A47-7453-4D30-938E-B4AEC55906CE@linux.alibaba.com>
Date: Fri, 16 Jun 2023 17:40:29 +0800
From: Cambda Zhu <cambda@...ux.alibaba.com>
To: Simon Horman <simon.horman@...igine.com>
Cc: netdev@...r.kernel.org,
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 17:11, Simon Horman <simon.horman@...igine.com> wrote:
>
> On Fri, Jun 16, 2023 at 02:34:36PM +0800, Cambda Zhu 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>
>
> Hi Cambda Zhu,
>
> ipvlan_rcv_frame can return two distinct values - RX_HANDLER_CONSUMED and
> RX_HANDLER_ANOTHER. Is it correct to treat these both as NET_XMIT_SUCCESS
> in the xmit path? If so, perhaps it would be useful to explain why
> in the commit message.
The ipvlan_rcv_frame() will only return RX_HANDLER_CONSUMED in
ipvlan_xmit_mode_l2/l3() for local is true. It's equal to NET_XMIT_SUCCESS.
The dev_forward_skb() can return NET_RX_SUCCESS and NET_RX_DROP, and
returning NET_RX_DROP(NET_XMIT_DROP) will increase both ipvlan and
ipvlan->phy_dev drops counter. I think the drops should belong to
the rcv side, and the xmit side should return NET_XMIT_SUCCESS even
if rcv failed. However, I'm not sure if my opinion is right.
Thanks,
Cambda
Powered by blists - more mailing lists