All of lore.kernel.org
 help / color / mirror / Atom feed
From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
To: Vladislav Yasevich <vyasevich@gmail.com>, netdev@vger.kernel.org
Cc: stephen@networkplumber.org, bridge@lists.linux-foundation.org,
	Vladislav Yasevich <vyasevic@redhat.com>
Subject: Re: [Bridge] [PATCH v2 net 2/3] bridge: Simplify pvid checks.
Date: Wed, 01 Oct 2014 15:50:01 +0900	[thread overview]
Message-ID: <542BA419.9000502@lab.ntt.co.jp> (raw)
In-Reply-To: <1412105462-340-3-git-send-email-vyasevic@redhat.com>

On 2014/10/01 4:31, Vladislav Yasevich wrote:
> Currently, if the pvid is not set, we return an illegal vlan value
> even though the pvid value is set to 0.  Since pvid of 0 is currently
> invalid, just return 0 instead.  This makes the current and future
> checks simpler.
> 
> Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
> ---
>  net/bridge/br_private.h | 2 +-
>  net/bridge/br_vlan.c    | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
> index 6fe8680..873d9da 100644
> --- a/net/bridge/br_private.h
> +++ b/net/bridge/br_private.h
> @@ -647,7 +647,7 @@ static inline u16 br_get_pvid(const struct net_port_vlans *v)
>  	 * vid wasn't set
>  	 */

The comment above should be changed as well.

>  	smp_rmb();
> -	return v->pvid ?: VLAN_N_VID;
> +	return v->pvid;
>  }

Should fix br_get_pvid() when CONFIG_BRIDGE_VLAN_FILTERING=n?
It returns VLAN_N_VID, which might be confusing.

Thanks,
Toshiaki Makita


WARNING: multiple messages have this Message-ID (diff)
From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
To: Vladislav Yasevich <vyasevich@gmail.com>, netdev@vger.kernel.org
Cc: stephen@networkplumber.org, bridge@lists.linux-foundation.org,
	Vladislav Yasevich <vyasevic@redhat.com>
Subject: Re: [PATCH v2 net 2/3] bridge: Simplify pvid checks.
Date: Wed, 01 Oct 2014 15:50:01 +0900	[thread overview]
Message-ID: <542BA419.9000502@lab.ntt.co.jp> (raw)
In-Reply-To: <1412105462-340-3-git-send-email-vyasevic@redhat.com>

On 2014/10/01 4:31, Vladislav Yasevich wrote:
> Currently, if the pvid is not set, we return an illegal vlan value
> even though the pvid value is set to 0.  Since pvid of 0 is currently
> invalid, just return 0 instead.  This makes the current and future
> checks simpler.
> 
> Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
> ---
>  net/bridge/br_private.h | 2 +-
>  net/bridge/br_vlan.c    | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
> index 6fe8680..873d9da 100644
> --- a/net/bridge/br_private.h
> +++ b/net/bridge/br_private.h
> @@ -647,7 +647,7 @@ static inline u16 br_get_pvid(const struct net_port_vlans *v)
>  	 * vid wasn't set
>  	 */

The comment above should be changed as well.

>  	smp_rmb();
> -	return v->pvid ?: VLAN_N_VID;
> +	return v->pvid;
>  }

Should fix br_get_pvid() when CONFIG_BRIDGE_VLAN_FILTERING=n?
It returns VLAN_N_VID, which might be confusing.

Thanks,
Toshiaki Makita

  reply	other threads:[~2014-10-01  6:50 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-30 19:30 [Bridge] [PATCH v2 net 0/3] bridge: Add vlan filtering support for default pvid Vladislav Yasevich
2014-09-30 19:30 ` Vladislav Yasevich
2014-09-30 19:31 ` [Bridge] [PATCH v2 net 1/3] bridge: Add a default_pvid sysfs attribute Vladislav Yasevich
2014-09-30 19:31   ` Vladislav Yasevich
2014-10-01  6:45   ` [Bridge] " Toshiaki Makita
2014-10-01  6:45     ` Toshiaki Makita
2014-09-30 19:31 ` [Bridge] [PATCH v2 net 2/3] bridge: Simplify pvid checks Vladislav Yasevich
2014-09-30 19:31   ` Vladislav Yasevich
2014-10-01  6:50   ` Toshiaki Makita [this message]
2014-10-01  6:50     ` Toshiaki Makita
2014-09-30 19:31 ` [Bridge] [PATCH v2 net 3/3] bridge: Add filtering support for default_pvid Vladislav Yasevich
2014-09-30 19:31   ` Vladislav Yasevich
2014-10-01  6:54   ` [Bridge] " Toshiaki Makita
2014-10-01  6:54     ` Toshiaki Makita
2014-09-30 21:07 ` [Bridge] [PATCH v2 net 0/3] bridge: Add vlan filtering support for default pvid David Miller
2014-09-30 21:07   ` David Miller
2014-09-30 23:16   ` [Bridge] " Vlad Yasevich
2014-09-30 23:16     ` Vlad Yasevich
2014-10-02  1:53 ` [Bridge] " David Miller
2014-10-02  1:53   ` David Miller

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=542BA419.9000502@lab.ntt.co.jp \
    --to=makita.toshiaki@lab.ntt.co.jp \
    --cc=bridge@lists.linux-foundation.org \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=vyasevic@redhat.com \
    --cc=vyasevich@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.