public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 net-next 0/6] net: switchdev: use specific switchdev_obj_*
@ 2015-09-29 16:07 Vivien Didelot
  2015-09-29 16:07 ` [PATCH v2 net-next 1/6] net: switchdev: remove dev in port_vlan_dump_put Vivien Didelot
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Vivien Didelot @ 2015-09-29 16:07 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, kernel, David S. Miller, Scott Feldman, Jiri Pirko,
	Florian Fainelli, Andrew Lunn, Vivien Didelot

This patchset changes switchdev add, del, dump operations from this:

    int     (*switchdev_port_obj_add)(struct net_device *dev,
                                      struct switchdev_obj *obj,
                                      struct switchdev_trans *trans);
    int     (*switchdev_port_obj_del)(struct net_device *dev,
                                      struct switchdev_obj *obj);
    int     (*switchdev_port_obj_dump)(struct net_device *dev,
                                      struct switchdev_obj *obj);

to something similar to the notifier_call callback of a notifier_block:

    int     (*switchdev_port_obj_add)(struct net_device *dev,
                                      enum switchdev_obj_id id,
                                      const void *obj,
                                      struct switchdev_trans *trans);                                                             
    int     (*switchdev_port_obj_del)(struct net_device *dev,
                                      enum switchdev_obj_id id,
                                      const void *obj);
    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 (e.g. switchdev_obj_fdb) instead of the generic switchdev_obj one.

This will simplify pushing the callback function down to the drivers.

The first 3 patches get rid of the dev parameter of the dump callback, since it
is not always neeeded (e.g. vlan_dump) and some drivers (such as DSA drivers)
may not have easy access to it.

Patches 4 and 5 implement the change in the switchdev operations and its users.

Patch 6 extracts the inner switchdev_obj_* structures from switchdev_obj and
removes this last one.

v2: fix error spotted by kbuild (extra ';' inline switchdev_port_obj_dump).

Vivien Didelot (6):
  net: switchdev: remove dev in port_vlan_dump_put
  net: switchdev: move dev in switchdev_fdb_dump
  net: switchdev: remove dev from switchdev_obj cb
  net: switchdev: pass callback to dump operation
  net: switchdev: abstract object in add/del ops
  net: switchdev: extract struct switchdev_obj_*

 drivers/net/ethernet/rocker/rocker.c |  42 ++++----
 include/net/switchdev.h              |  80 ++++++++-------
 net/bridge/br_fdb.c                  |  11 +--
 net/bridge/br_vlan.c                 |  24 ++---
 net/dsa/slave.c                      |  46 +++++----
 net/switchdev/switchdev.c            | 184 ++++++++++++++++-------------------
 6 files changed, 186 insertions(+), 201 deletions(-)

-- 
2.6.0

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-09-30 15:00 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox