mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nikolay Aleksandrov <nikolay@nvidia.com>
To: Kangmin Park <l4stpr0gr4m@gmail.com>, Roopa Prabhu <roopa@nvidia.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	bridge@lists.linux-foundation.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 net-next] net: bridge: change return type of br_handle_ingress_vlan_tunnel
Date: Mon, 23 Aug 2021 13:00:42 +0300	[thread overview]
Message-ID: <d7931059-4841-a39f-4272-0053d6b61bac@nvidia.com> (raw)
In-Reply-To: <20210823095634.34752-1-l4stpr0gr4m@gmail.com>

On 23/08/2021 12:56, Kangmin Park wrote:
> br_handle_ingress_vlan_tunnel() is only referenced in
> br_handle_frame(). If br_handle_ingress_vlan_tunnel() is called and
> return non-zero value, goto drop in br_handle_frame().
> 
> But, br_handle_ingress_vlan_tunnel() always return 0. So, the
> routines that check the return value and goto drop has no meaning.
> 
> Therefore, change return type of br_handle_ingress_vlan_tunnel() to
> void and remove if statement of br_handle_frame().
> 
> Signed-off-by: Kangmin Park <l4stpr0gr4m@gmail.com>
> ---
> v2:
>  - cleanup instead of modifying ingress function
>  - change prototype of ingress function
>  - cleanup br_handle_frame function
>  - change commit message accordingly
> 
>  net/bridge/br_input.c          |  7 ++-----
>  net/bridge/br_private_tunnel.h |  6 +++---
>  net/bridge/br_vlan_tunnel.c    | 14 +++++++-------
>  3 files changed, 12 insertions(+), 15 deletions(-)
> 
[snip]
> diff --git a/net/bridge/br_vlan_tunnel.c b/net/bridge/br_vlan_tunnel.c
> index 01017448ebde..7d42b2a5be80 100644
> --- a/net/bridge/br_vlan_tunnel.c
> +++ b/net/bridge/br_vlan_tunnel.c
> @@ -158,30 +158,30 @@ void vlan_tunnel_deinit(struct net_bridge_vlan_group *vg)
>  	rhashtable_destroy(&vg->tunnel_hash);
>  }
>  
> -int br_handle_ingress_vlan_tunnel(struct sk_buff *skb,
> -				  struct net_bridge_port *p,
> -				  struct net_bridge_vlan_group *vg)
> +void br_handle_ingress_vlan_tunnel(struct sk_buff *skb,
> +				   struct net_bridge_port *p,
> +				   struct net_bridge_vlan_group *vg)
>  {
>  	struct ip_tunnel_info *tinfo = skb_tunnel_info(skb);
>  	struct net_bridge_vlan *vlan;
>  
>  	if (!vg || !tinfo)
> -		return 0;
> +		return;
>  
>  	/* if already tagged, ignore */
>  	if (skb_vlan_tagged(skb))
> -		return 0;
> +		return;
>  
>  	/* lookup vid, given tunnel id */
>  	vlan = br_vlan_tunnel_lookup(&vg->tunnel_hash, tinfo->key.tun_id);
>  	if (!vlan)
> -		return 0;
> +		return;
>  
>  	skb_dst_drop(skb);
>  
>  	__vlan_hwaccel_put_tag(skb, p->br->vlan_proto, vlan->vid);
>  
> -	return 0;
> +	return;

Please drop this unnecessary return statement at the end of the void function.

>  }
>  
>  int br_handle_egress_vlan_tunnel(struct sk_buff *skb,
> 


      reply	other threads:[~2021-08-23 10:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-23  9:56 Kangmin Park
2021-08-23 10:00 ` Nikolay Aleksandrov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d7931059-4841-a39f-4272-0053d6b61bac@nvidia.com \
    --to=nikolay@nvidia.com \
    --cc=bridge@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=l4stpr0gr4m@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=roopa@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®