diff mbox series

[net] ipvlan: Fix return value of ipvlan_queue_xmit()

Message ID 20230616033317.26635-1-cambda@linux.alibaba.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net] ipvlan: Fix return value of ipvlan_queue_xmit() | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/fixes_present fail Series targets non-next tree, but doesn't contain any Fixes tags
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 9 this patch: 9
netdev/cc_maintainers warning 3 maintainers not CCed: luwei32@huawei.com fengtao40@huawei.com lucien.xin@gmail.com
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 9 this patch: 9
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 27 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Cambda Zhu June 16, 2023, 3:33 a.m. UTC
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.

Signed-off-by: Cambda Zhu <cambda@linux.alibaba.com>
---
 drivers/net/ipvlan/ipvlan_core.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Eric Dumazet June 16, 2023, 8:05 a.m. UTC | #1
On Fri, Jun 16, 2023 at 5:34 AM Cambda Zhu <cambda@linux.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.
>
> Signed-off-by: Cambda Zhu <cambda@linux.alibaba.com>

Please make sure to CC ipvlan author ?

CC Mahesh

> ---
>  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
>
Cambda Zhu June 16, 2023, 9:05 a.m. UTC | #2
> On Jun 16, 2023, at 16:05, Eric Dumazet <edumazet@google.com> wrote:
> 
> On Fri, Jun 16, 2023 at 5:34 AM Cambda Zhu <cambda@linux.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.
>> 
>> Signed-off-by: Cambda Zhu <cambda@linux.alibaba.com>
> 
> Please make sure to CC ipvlan author ?
> 
> CC Mahesh
> 
>> ---
>> 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

I have resubmitted v1 patch with Fixes tag and CC Mahesh via reply.

Thanks!
Cambda
diff mbox series

Patch

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);