[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150930104102.GD2098@nanopsycho.orion>
Date: Wed, 30 Sep 2015 12:41:02 +0200
From: Jiri Pirko <jiri@...nulli.us>
To: Vivien Didelot <vivien.didelot@...oirfairelinux.com>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel@...oirfairelinux.com,
"David S. Miller" <davem@...emloft.net>,
Scott Feldman <sfeldma@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
Andrew Lunn <andrew@...n.ch>
Subject: Re: [PATCH v2 net-next 4/6] net: switchdev: pass callback to dump
operation
Tue, Sep 29, 2015 at 06:07:16PM CEST, vivien.didelot@...oirfairelinux.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@...oirfairelinux.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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists