public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel@savoirfairelinux.com,
	"David S. Miller" <davem@davemloft.net>,
	Scott Feldman <sfeldma@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Andrew Lunn <andrew@lunn.ch>
Subject: Re: [PATCH v2 net-next 4/6] net: switchdev: pass callback to dump operation
Date: Wed, 30 Sep 2015 12:41:02 +0200	[thread overview]
Message-ID: <20150930104102.GD2098@nanopsycho.orion> (raw)
In-Reply-To: <1443542838-19234-5-git-send-email-vivien.didelot@savoirfairelinux.com>

Tue, Sep 29, 2015 at 06:07:16PM CEST, vivien.didelot@savoirfairelinux.com wrote:
>Similar to the notifier_call callback of a notifier_block, change the
>function signature of switchdev dump operation to:
>
>    int switchdev_port_obj_dump(struct net_device *dev,
>                                enum switchdev_obj_id id, void *obj,
>                                int (*cb)(void *obj));
>
>This allows the caller to pass and expect back a specific
>switchdev_obj_* structure instead of the generic switchdev_obj one.
>
>Drivers implementation of dump operation can now expect this specific
>structure and call the callback with it. Drivers have been changed
>accordingly.
>
>Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
>---
> drivers/net/ethernet/rocker/rocker.c | 21 +++++++++--------
> include/net/switchdev.h              |  9 +++++---
> net/dsa/slave.c                      | 26 +++++++++++----------
> net/switchdev/switchdev.c            | 45 ++++++++++++++++++------------------
> 4 files changed, 53 insertions(+), 48 deletions(-)
>
>diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c
>index 78fd443..107adb6 100644
>--- a/drivers/net/ethernet/rocker/rocker.c
>+++ b/drivers/net/ethernet/rocker/rocker.c
>@@ -4538,10 +4538,10 @@ static int rocker_port_obj_del(struct net_device *dev,
> }
> 
> static int rocker_port_fdb_dump(const struct rocker_port *rocker_port,
>-				struct switchdev_obj *obj)
>+				struct switchdev_obj_fdb *fdb,
>+				int (*cb)(void *obj))

                                ^^^^^^^^^^^^^^^^^^^^ we should have some
				typedef for this.

  reply	other threads:[~2015-09-30 10:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-29 16:07 [PATCH v2 net-next 0/6] net: switchdev: use specific switchdev_obj_* Vivien Didelot
2015-09-29 16:07 ` [PATCH v2 net-next 1/6] net: switchdev: remove dev in port_vlan_dump_put Vivien Didelot
2015-09-29 16:07 ` [PATCH v2 net-next 2/6] net: switchdev: move dev in switchdev_fdb_dump Vivien Didelot
2015-09-29 16:07 ` [PATCH v2 net-next 3/6] net: switchdev: remove dev from switchdev_obj cb Vivien Didelot
2015-09-29 16:07 ` [PATCH v2 net-next 4/6] net: switchdev: pass callback to dump operation Vivien Didelot
2015-09-30 10:41   ` Jiri Pirko [this message]
2015-09-29 16:07 ` [PATCH v2 net-next 5/6] net: switchdev: abstract object in add/del ops Vivien Didelot
2015-09-29 16:07 ` [PATCH v2 net-next 6/6] net: switchdev: extract struct switchdev_obj_* Vivien Didelot
2015-09-30 10:36   ` Jiri Pirko
2015-09-30 14:58     ` Scott Feldman
2015-09-30 15:00       ` Jiri Pirko
2015-09-30  4:32 ` [PATCH v2 net-next 0/6] net: switchdev: use specific switchdev_obj_* David Miller
2015-09-30 10:45 ` Jiri Pirko

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=20150930104102.GD2098@nanopsycho.orion \
    --to=jiri@resnulli.us \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kernel@savoirfairelinux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sfeldma@gmail.com \
    --cc=vivien.didelot@savoirfairelinux.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