netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Ido Schimmel <idosch@mellanox.com>
Cc: netdev@vger.kernel.org, bridge@lists.linux-foundation.org,
	davem@davemloft.net, jiri@mellanox.com, petrm@mellanox.com,
	nikolay@cumulusnetworks.com, mlxsw@mellanox.com
Subject: Re: [PATCH net-next v2 1/6] net: bridge: Publish bridge accessor functions
Date: Fri, 27 Apr 2018 09:28:29 -0700	[thread overview]
Message-ID: <20180427092829.1673ed74@xeon-e3> (raw)
In-Reply-To: <20180427151111.22099-2-idosch@mellanox.com>

On Fri, 27 Apr 2018 18:11:06 +0300
Ido Schimmel <idosch@mellanox.com> wrote:

> +int br_vlan_pvid_rtnl(const struct net_device *dev, u16 *p_pvid)
> +{
> +	struct net_bridge_vlan_group *vg;
> +
> +	ASSERT_RTNL();
> +	if (netif_is_bridge_master(dev))
> +		vg = br_vlan_group(netdev_priv(dev));
> +	else
> +		return -EINVAL;
> +
> +	*p_pvid = br_get_pvid(vg);
> +	return 0;
> +}
> +EXPORT_SYMBOL_GPL(br_vlan_pvid_rtnl);


Unless there is a RCU version, no need for _rtnl suffix.

Minor style issue, why not make error then go on and return -1 on error.



int br_vlan_pvid(const struct net_device *dev)
{
	const struct net_bridge_vlan_group *vg;

	ASSERT_RTNL();

	if (!netif_is_bridge_master(dev))
		return -1;

	vg = br_vlan_group(netdev_priv(dev));
	return br_get_pvid(vg);
}

  parent reply	other threads:[~2018-04-27 16:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-27 15:11 [PATCH net-next v2 0/6] mlxsw: SPAN: Support routes pointing at bridges Ido Schimmel
2018-04-27 15:11 ` [PATCH net-next v2 1/6] net: bridge: Publish bridge accessor functions Ido Schimmel
2018-04-27 15:38   ` Nikolay Aleksandrov
2018-04-27 16:08     ` Petr Machata
2018-04-27 16:11       ` Nikolay Aleksandrov
2018-04-27 16:28   ` Stephen Hemminger [this message]
2018-04-27 16:36     ` Petr Machata
2018-04-27 15:11 ` [PATCH net-next v2 2/6] mlxsw: spectrum: Extract mlxsw_sp_stp_spms_state() Ido Schimmel
2018-04-27 15:11 ` [PATCH net-next v2 3/6] mlxsw: spectrum_switchdev: Publish two functions Ido Schimmel
2018-04-27 15:11 ` [PATCH net-next v2 4/6] mlxsw: spectrum: Register SPAN before switchdev Ido Schimmel
2018-04-27 15:11 ` [PATCH net-next v2 5/6] mlxsw: Respin SPAN on switchdev events Ido Schimmel
2018-04-27 15:11 ` [PATCH net-next v2 6/6] mlxsw: spectrum_span: Allow bridge for gretap mirror Ido Schimmel
2018-04-27 15:39   ` Nikolay Aleksandrov
2018-04-28  0:28 ` [PATCH net-next v2 0/6] mlxsw: SPAN: Support routes pointing at bridges 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=20180427092829.1673ed74@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=bridge@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=idosch@mellanox.com \
    --cc=jiri@mellanox.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@cumulusnetworks.com \
    --cc=petrm@mellanox.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;
as well as URLs for NNTP newsgroup(s).