All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
To: Petr Machata <petrm@mellanox.com>,
	netdev@vger.kernel.org, devel@driverdev.osuosl.org,
	bridge@lists.linux-foundation.org
Cc: jiri@mellanox.com, idosch@mellanox.com, davem@davemloft.net,
	razvan.stefanescu@nxp.com, gregkh@linuxfoundation.org,
	stephen@networkplumber.org, andrew@lunn.ch, f.fainelli@gmail.com,
	nikolay@cumulusnetworks.com
Subject: Re: [PATCH net-next 1/7] net: bridge: Extract boilerplate around switchdev_port_obj_*()
Date: Fri, 25 May 2018 12:10:57 -0400	[thread overview]
Message-ID: <87d0xjzpf2.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: <af1bed5ce2b236544edd591b8cfb8425c2cb5ca0.1527173527.git.petrm@mellanox.com>

Hi Petr,

Petr Machata <petrm@mellanox.com> writes:

> -static int __vlan_vid_add(struct net_device *dev, struct net_bridge *br,
> -			  u16 vid, u16 flags)
> +static int br_switchdev_port_obj_add(struct net_device *dev, u16 vid, u16 flags)
>  {
>  	struct switchdev_obj_port_vlan v = {
>  		.obj.orig_dev = dev,
> @@ -89,12 +88,29 @@ static int __vlan_vid_add(struct net_device *dev, struct net_bridge *br,
>  		.vid_begin = vid,
>  		.vid_end = vid,
>  	};
> -	int err;
>  
> +	return switchdev_port_obj_add(dev, &v.obj);
> +}
> +
> +static int br_switchdev_port_obj_del(struct net_device *dev, u16 vid)
> +{
> +	struct switchdev_obj_port_vlan v = {
> +		.obj.orig_dev = dev,
> +		.obj.id = SWITCHDEV_OBJ_ID_PORT_VLAN,
> +		.vid_begin = vid,
> +		.vid_end = vid,
> +	};
> +
> +	return switchdev_port_obj_del(dev, &v.obj);
> +}

Shouldn't they be br_switchdev_port_vlan_add (or similar) implemented in
net/bridge/br_switchdev.c instead, since they are VLAN specific?

Other than that, the change looks good!

Thanks,

        Vivien

WARNING: multiple messages have this Message-ID (diff)
From: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
To: Petr Machata <petrm@mellanox.com>,
	netdev@vger.kernel.org, devel@driverdev.osuosl.org,
	bridge@lists.linux-foundation.org
Cc: f.fainelli@gmail.com, andrew@lunn.ch,
	nikolay@cumulusnetworks.com, gregkh@linuxfoundation.org,
	idosch@mellanox.com, jiri@mellanox.com,
	razvan.stefanescu@nxp.com, davem@davemloft.net
Subject: Re: [Bridge] [PATCH net-next 1/7] net: bridge: Extract boilerplate around switchdev_port_obj_*()
Date: Fri, 25 May 2018 12:10:57 -0400	[thread overview]
Message-ID: <87d0xjzpf2.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: <af1bed5ce2b236544edd591b8cfb8425c2cb5ca0.1527173527.git.petrm@mellanox.com>

Hi Petr,

Petr Machata <petrm@mellanox.com> writes:

> -static int __vlan_vid_add(struct net_device *dev, struct net_bridge *br,
> -			  u16 vid, u16 flags)
> +static int br_switchdev_port_obj_add(struct net_device *dev, u16 vid, u16 flags)
>  {
>  	struct switchdev_obj_port_vlan v = {
>  		.obj.orig_dev = dev,
> @@ -89,12 +88,29 @@ static int __vlan_vid_add(struct net_device *dev, struct net_bridge *br,
>  		.vid_begin = vid,
>  		.vid_end = vid,
>  	};
> -	int err;
>  
> +	return switchdev_port_obj_add(dev, &v.obj);
> +}
> +
> +static int br_switchdev_port_obj_del(struct net_device *dev, u16 vid)
> +{
> +	struct switchdev_obj_port_vlan v = {
> +		.obj.orig_dev = dev,
> +		.obj.id = SWITCHDEV_OBJ_ID_PORT_VLAN,
> +		.vid_begin = vid,
> +		.vid_end = vid,
> +	};
> +
> +	return switchdev_port_obj_del(dev, &v.obj);
> +}

Shouldn't they be br_switchdev_port_vlan_add (or similar) implemented in
net/bridge/br_switchdev.c instead, since they are VLAN specific?

Other than that, the change looks good!

Thanks,

        Vivien

  parent reply	other threads:[~2018-05-25 16:10 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-24 15:09 [PATCH net-next 0/7] net: bridge: Notify about bridge VLANs Petr Machata
2018-05-24 15:09 ` [Bridge] " Petr Machata
2018-05-24 15:10 ` [PATCH net-next 1/7] net: bridge: Extract boilerplate around switchdev_port_obj_*() Petr Machata
2018-05-24 15:10   ` [Bridge] " Petr Machata
2018-05-25 12:04   ` Nikolay Aleksandrov
2018-05-25 12:04     ` [Bridge] " Nikolay Aleksandrov
2018-05-25 16:10   ` Vivien Didelot [this message]
2018-05-25 16:10     ` Vivien Didelot
2018-05-25 16:56     ` Petr Machata
2018-05-25 16:56       ` [Bridge] " Petr Machata
2018-05-24 15:10 ` [PATCH net-next 2/7] mlxsw: spectrum_switchdev: Ignore bridge VLAN events Petr Machata
2018-05-24 15:10   ` [Bridge] " Petr Machata
2018-05-24 15:10 ` [PATCH net-next 3/7] rocker: rocker_main: " Petr Machata
2018-05-24 15:10   ` [Bridge] " Petr Machata
2018-05-24 15:10 ` [PATCH net-next 4/7] dsa: port: " Petr Machata
2018-05-24 15:10   ` [Bridge] " Petr Machata
2018-05-25 16:11   ` Vivien Didelot
2018-05-25 16:11     ` [Bridge] " Vivien Didelot
2018-05-24 15:10 ` [PATCH net-next 5/7] staging: fsl-dpaa2: ethsw: " Petr Machata
2018-05-24 15:10   ` [Bridge] " Petr Machata
2018-05-24 15:10 ` [PATCH net-next 6/7] net: bridge: Notify about bridge VLANs Petr Machata
2018-05-24 15:10   ` [Bridge] " Petr Machata
2018-05-25 12:08   ` Nikolay Aleksandrov
2018-05-25 12:08     ` [Bridge] " Nikolay Aleksandrov
2018-05-25 16:17   ` Vivien Didelot
2018-05-25 16:17     ` [Bridge] " Vivien Didelot
2018-05-25 17:00     ` Petr Machata
2018-05-25 17:00       ` [Bridge] " Petr Machata
2018-05-26 14:54       ` Vivien Didelot
2018-05-26 14:54         ` [Bridge] " Vivien Didelot
2018-05-28  8:20         ` Petr Machata
2018-05-28  8:20           ` [Bridge] " Petr Machata
2018-05-24 15:10 ` [PATCH net-next 7/7] mlxsw: spectrum_switchdev: Schedule respin during trans prepare Petr Machata
2018-05-24 15:10   ` [Bridge] " Petr Machata
2018-05-24 17:20 ` [PATCH net-next 0/7] net: bridge: Notify about bridge VLANs Florian Fainelli
2018-05-24 17:20   ` [Bridge] " Florian Fainelli
2018-05-25  3:40   ` Florian Fainelli
2018-05-25  3:40     ` [Bridge] " Florian Fainelli
2018-05-25 16:31     ` Vivien Didelot
2018-05-25 16:31       ` [Bridge] " Vivien Didelot
2018-05-25 10:09   ` Petr Machata
2018-05-25 10:09     ` [Bridge] " Petr Machata
2018-05-25 12:33     ` Ilias Apalodimas
2018-05-25 12:33       ` [Bridge] " Ilias Apalodimas
2018-05-25  3:41 ` Florian Fainelli
2018-05-25  3:41   ` [Bridge] " Florian Fainelli

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=87d0xjzpf2.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me \
    --to=vivien.didelot@savoirfairelinux.com \
    --cc=andrew@lunn.ch \
    --cc=bridge@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=devel@driverdev.osuosl.org \
    --cc=f.fainelli@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=idosch@mellanox.com \
    --cc=jiri@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@cumulusnetworks.com \
    --cc=petrm@mellanox.com \
    --cc=razvan.stefanescu@nxp.com \
    --cc=stephen@networkplumber.org \
    /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.