mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel@savoirfairelinux.com,
	"David S. Miller" <davem@davemloft.net>,
	Scott Feldman <sfeldma@gmail.com>, Jiri Pirko <jiri@resnulli.us>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Subject: Re: [PATCH net-next 4/6] net: dsa: add port_fdb_prepare
Date: Thu, 8 Oct 2015 08:55:25 -0400	[thread overview]
Message-ID: <20151008125524.GA1275@ketchup.mtl.sfl> (raw)
In-Reply-To: <20151008002543.GB31267@lunn.ch>

Hi Andrew,

On Oct. Thursday 08 (41) 02:25 AM, Andrew Lunn wrote:
> On Wed, Oct 07, 2015 at 07:48:29PM -0400, Vivien Didelot wrote:
> > Push the prepare phase for FDB operations down to the DSA drivers, with
> > a new port_fdb_prepare function. Currently only mv88e6xxx is affected.
> > 
> > Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
> > ---
> >  drivers/net/dsa/mv88e6171.c |  1 +
> >  drivers/net/dsa/mv88e6352.c |  1 +
> >  drivers/net/dsa/mv88e6xxx.c | 10 ++++++++++
> >  drivers/net/dsa/mv88e6xxx.h |  3 +++
> >  include/net/dsa.h           |  4 ++++
> >  net/dsa/slave.c             |  7 +++++--
> >  6 files changed, 24 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/net/dsa/mv88e6171.c b/drivers/net/dsa/mv88e6171.c
> > index c95cfab..ca3330a 100644
> > --- a/drivers/net/dsa/mv88e6171.c
> > +++ b/drivers/net/dsa/mv88e6171.c
> > @@ -121,6 +121,7 @@ struct dsa_switch_driver mv88e6171_switch_driver = {
> >  	.port_vlan_add		= mv88e6xxx_port_vlan_add,
> >  	.port_vlan_del		= mv88e6xxx_port_vlan_del,
> >  	.vlan_getnext		= mv88e6xxx_vlan_getnext,
> > +	.port_fdb_prepare	= mv88e6xxx_port_fdb_prepare,
> 
> Hi Vivien
> 
> Bike shedding a bit, but i would call this
> mv88e6xxx_port_fdb_prepare_add.

I think port_fdb_prepare is fine because it is the only step that
actually needs the 2-phase model. del and dump are safe and don't need
pre-check.

> >  	.port_fdb_add		= mv88e6xxx_port_fdb_add,
> >  	.port_fdb_del		= mv88e6xxx_port_fdb_del,
> >  	.port_fdb_getnext	= mv88e6xxx_port_fdb_getnext,
> 
> Taking a theoretical example, say mv88e6xxx_port_fdb_getnext needed a
> prepare call to allocate memory to put the returned ATU into. What
> would you call that?
> 
> mv88e6xxx_port_fdb_prepare_add and mv88e6xxx_port_fdb_prepare_getnext
> just seems unambiguous and future proof.

the switchdev dump operation is called just once, so no preparation is
implied (from the switchdev point of view). It is the responsability of
the driver to call the switchdev dump callback itself.

Thanks,
-v

  reply	other threads:[~2015-10-08 13:02 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-07 23:48 [PATCH net-next 0/6] net: dsa: push switchdev prepare phase in FDB ops Vivien Didelot
2015-10-07 23:48 ` [PATCH net-next 1/6] net: dsa: add uses_hw_tag Vivien Didelot
2015-10-07 23:48 ` [PATCH net-next 2/6] net: dsa: include dsa.h in dsa_priv.h Vivien Didelot
2015-10-07 23:48 ` [PATCH net-next 3/6] net: remove dsa.h include from linux/netdevice.h Vivien Didelot
2015-10-08  9:04   ` kbuild test robot
2015-10-08  9:18     ` Jiri Pirko
2015-10-08 10:37       ` Wei Xu
     [not found]       ` <56165D5F.7050300@hisilicon.com>
2015-10-08 12:18         ` Jiri Pirko
2015-10-08 12:36           ` huangdaode
2015-10-10 23:35   ` kbuild test robot
2015-10-07 23:48 ` [PATCH net-next 4/6] net: dsa: add port_fdb_prepare Vivien Didelot
2015-10-08  0:25   ` Andrew Lunn
2015-10-08 12:55     ` Vivien Didelot [this message]
2015-10-08 15:07       ` Andrew Lunn
2015-10-08  6:19   ` Scott Feldman
2015-10-07 23:48 ` [PATCH net-next 5/6] net: dsa: push prepare phase in port_fdb_add Vivien Didelot
2015-10-08  6:19   ` Scott Feldman
2015-10-07 23:48 ` [PATCH net-next 6/6] net: dsa: use switchdev obj in port_fdb_del Vivien Didelot
2015-10-08  6:20   ` Scott Feldman
2015-10-08 12:28 ` [PATCH net-next 0/6] net: dsa: push switchdev prepare phase in FDB ops David Miller
2015-10-08 13:32   ` Vivien Didelot
2015-10-08 13:47     ` Jiri Pirko
2015-10-08 14:11       ` Vivien Didelot

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=20151008125524.GA1275@ketchup.mtl.sfl \
    --to=vivien.didelot@savoirfairelinux.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=jiri@resnulli.us \
    --cc=kernel@savoirfairelinux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=narmstrong@baylibre.com \
    --cc=netdev@vger.kernel.org \
    --cc=sergei.shtylyov@cogentembedded.com \
    --cc=sfeldma@gmail.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

all inboxes | Powered by JetHome®