From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <542BA419.9000502@lab.ntt.co.jp> Date: Wed, 01 Oct 2014 15:50:01 +0900 From: Toshiaki Makita MIME-Version: 1.0 References: <1412105462-340-1-git-send-email-vyasevic@redhat.com> <1412105462-340-3-git-send-email-vyasevic@redhat.com> In-Reply-To: <1412105462-340-3-git-send-email-vyasevic@redhat.com> Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit Subject: Re: [Bridge] [PATCH v2 net 2/3] bridge: Simplify pvid checks. List-Id: Linux Ethernet Bridging List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Yasevich , netdev@vger.kernel.org Cc: stephen@networkplumber.org, bridge@lists.linux-foundation.org, Vladislav Yasevich 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 > --- > 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Toshiaki Makita Subject: Re: [PATCH v2 net 2/3] bridge: Simplify pvid checks. Date: Wed, 01 Oct 2014 15:50:01 +0900 Message-ID: <542BA419.9000502@lab.ntt.co.jp> References: <1412105462-340-1-git-send-email-vyasevic@redhat.com> <1412105462-340-3-git-send-email-vyasevic@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit Cc: stephen@networkplumber.org, bridge@lists.linux-foundation.org, Vladislav Yasevich To: Vladislav Yasevich , netdev@vger.kernel.org Return-path: In-Reply-To: <1412105462-340-3-git-send-email-vyasevic@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: bridge-bounces@lists.linux-foundation.org Errors-To: bridge-bounces@lists.linux-foundation.org List-Id: netdev.vger.kernel.org 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 > --- > 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