From: Florian Fainelli <f.fainelli@gmail•com>
To: Jiri Pirko <jiri@resnulli•us>, netdev@vger•kernel.org
Cc: davem@davemloft•net, idosch@mellanox•com, eladr@mellanox•com,
sfeldma@gmail•com, simon.horman@netronome•com,
Jiri Pirko <jiri@mellanox•com>
Subject: Re: [patch net-next 3/6] net: add netif_is_ovs_master helper with IFF_OPENVSWITCH private flag
Date: Wed, 26 Aug 2015 10:24:55 -0700 [thread overview]
Message-ID: <55DDF667.20801@gmail.com> (raw)
In-Reply-To: <1440606998-11072-4-git-send-email-jiri@resnulli.us>
On 26/08/15 09:36, Jiri Pirko wrote:
> From: Jiri Pirko <jiri@mellanox•com>
>
> Add this helper so code can easily figure out if netdev is openswitch.
>
> Signed-off-by: Jiri Pirko <jiri@mellanox•com>
> ---
> include/linux/netdevice.h | 8 ++++++++
> net/openvswitch/vport-internal_dev.c | 2 +-
> 2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index be625f4..0a884e6 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -1264,6 +1264,7 @@ struct net_device_ops {
> * @IFF_MACVLAN: Macvlan device
> * @IFF_VRF_MASTER: device is a VRF master
> * @IFF_NO_QUEUE: device can run without qdisc attached
> + * @IFF_VRF_OPENVSWITCH: device is a Open vSwitch master
Typo, the flag you introduced is named IFF_OPENVSWITCH, not VFR_OPENSWITCH.
> */
> enum netdev_priv_flags {
> IFF_802_1Q_VLAN = 1<<0,
> @@ -1293,6 +1294,7 @@ enum netdev_priv_flags {
> IFF_IPVLAN_SLAVE = 1<<24,
> IFF_VRF_MASTER = 1<<25,
> IFF_NO_QUEUE = 1<<26,
> + IFF_OPENVSWITCH = 1<<27,
> };
>
> #define IFF_802_1Q_VLAN IFF_802_1Q_VLAN
> @@ -1322,6 +1324,7 @@ enum netdev_priv_flags {
> #define IFF_IPVLAN_SLAVE IFF_IPVLAN_SLAVE
> #define IFF_VRF_MASTER IFF_VRF_MASTER
> #define IFF_NO_QUEUE IFF_NO_QUEUE
> +#define IFF_OPENVSWITCH IFF_OPENVSWITCH
>
> /**
> * struct net_device - The DEVICE structure.
> @@ -3853,6 +3856,11 @@ static inline bool netif_is_bridge_master(const struct net_device *dev)
> return dev->priv_flags & IFF_EBRIDGE;
> }
>
> +static inline bool netif_is_ovs_master(const struct net_device *dev)
> +{
> + return dev->priv_flags & IFF_OPENVSWITCH;
> +}
> +
> static inline bool netif_index_is_vrf(struct net *net, int ifindex)
> {
> bool rc = false;
> diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c
> index c058bbf..80b3e12 100644
> --- a/net/openvswitch/vport-internal_dev.c
> +++ b/net/openvswitch/vport-internal_dev.c
> @@ -135,7 +135,7 @@ static void do_setup(struct net_device *netdev)
> netdev->netdev_ops = &internal_dev_netdev_ops;
>
> netdev->priv_flags &= ~IFF_TX_SKB_SHARING;
> - netdev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
> + netdev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_OPENVSWITCH;
> netdev->destructor = internal_dev_destructor;
> netdev->ethtool_ops = &internal_dev_ethtool_ops;
> netdev->rtnl_link_ops = &internal_dev_link_ops;
>
--
Florian
next prev parent reply other threads:[~2015-08-26 17:27 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-26 16:36 [patch net-next 0/6] rocker: make master change handling nicer Jiri Pirko
2015-08-26 16:36 ` [patch net-next 1/6] net: introduce change upper device notifier change info Jiri Pirko
2015-08-26 16:36 ` [patch net-next 2/6] net: add netif_is_bridge_master helper Jiri Pirko
2015-08-26 16:36 ` [patch net-next 3/6] net: add netif_is_ovs_master helper with IFF_OPENVSWITCH private flag Jiri Pirko
2015-08-26 17:24 ` Florian Fainelli [this message]
2015-08-27 5:40 ` Jiri Pirko
2015-08-26 17:43 ` Scott Feldman
2015-08-27 5:43 ` Jiri Pirko
2015-08-27 6:23 ` Scott Feldman
2015-08-27 6:30 ` Jiri Pirko
2015-08-27 6:30 ` Jiri Pirko
2015-08-27 7:51 ` Scott Feldman
2015-08-27 8:01 ` Jiri Pirko
2015-08-26 16:36 ` [patch net-next 4/6] net: kill long time unused bonding private flags Jiri Pirko
2015-08-26 16:36 ` [patch net-next 5/6] rocker: use new helper to figure out master kind Jiri Pirko
2015-08-26 17:56 ` Scott Feldman
2015-08-26 16:36 ` [patch net-next 6/6] rocker: use change upper info Jiri Pirko
2015-08-26 17:55 ` Scott Feldman
2015-08-26 18:00 ` [patch net-next 0/6] rocker: make master change handling nicer Scott Feldman
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=55DDF667.20801@gmail.com \
--to=f.fainelli@gmail$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=eladr@mellanox$(echo .)com \
--cc=idosch@mellanox$(echo .)com \
--cc=jiri@mellanox$(echo .)com \
--cc=jiri@resnulli$(echo .)us \
--cc=netdev@vger$(echo .)kernel.org \
--cc=sfeldma@gmail$(echo .)com \
--cc=simon.horman@netronome$(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