public inbox for netdev@vger.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: [PATCH v3 net-next 1/3] bridge: Add a default_pvid sysfs attribute
Date: Fri, 03 Oct 2014 10:08:10 +0900	[thread overview]
Message-ID: <542DF6FA.4050107@lab.ntt.co.jp> (raw)
In-Reply-To: <1412294070-11930-2-git-send-email-vyasevic@redhat.com>

On 2014/10/03 8:54, Vladislav Yasevich wrote:
> This patch allows the user to set and retrieve default_pvid
> value.  A new value can only be stored when vlan filtering
> is disabled.
> 
> Signed-off-by: Vladislav Yasevich <vyasevic@redhat•com>
> ---
...
> +int br_vlan_set_default_pvid(struct net_bridge *br, unsigned long val)
> +{
> +	u16 pvid = val;
> +	int err = 0;
> +
> +	if (!val || val >= VLAN_VID_MASK)
> +		return -EINVAL;
> +
> +	if (!rtnl_trylock())
> +		return restart_syscall();
> +
> +	if (pvid == br->default_pvid)
> +		goto unlock;
> +
> +	/* Only allow default pvid change when filtering is disabled */
> +	if (br->vlan_enabled) {
> +		pr_info_once("Please disable vlan filtering to change default_pvid\n");
> +		err = -EPERM;
> +		goto unlock;
> +	}
> +
> +	br->default_pvid = vid;

typo: s/vid/pvid/

Thanks,
Toshiaki Makita

  reply	other threads:[~2014-10-03  1:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-02 23:54 [PATCH v3 net-next 0/3] bridge: Add vlan filtering support for default pvid Vladislav Yasevich
2014-10-02 23:54 ` [PATCH v3 net-next 1/3] bridge: Add a default_pvid sysfs attribute Vladislav Yasevich
2014-10-03  1:08   ` Toshiaki Makita [this message]
2014-10-03 13:42     ` Vlad Yasevich
2014-10-03 14:31       ` Toshiaki Makita
2014-10-02 23:54 ` [PATCH v3 net-next 2/3] bridge: Simplify pvid checks Vladislav Yasevich
2014-10-03  1:11   ` Toshiaki Makita
2014-10-02 23:54 ` [PATCH v3 net-next 3/3] bridge: Add filtering support for default_pvid Vladislav Yasevich
2014-10-03  1:11   ` Toshiaki Makita
2014-10-03  4:41   ` Cong Wang
2014-10-03 13:37     ` Vlad Yasevich
2014-10-03 16:42       ` Cong Wang

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=542DF6FA.4050107@lab.ntt.co.jp \
    --to=makita.toshiaki@lab$(echo .)ntt.co.jp \
    --cc=bridge@lists$(echo .)linux-foundation.org \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=stephen@networkplumber$(echo .)org \
    --cc=vyasevic@redhat$(echo .)com \
    --cc=vyasevich@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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