netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/6] net: dsa: push switchdev prepare phase in FDB ops
@ 2015-10-07 23:48 Vivien Didelot
  2015-10-07 23:48 ` [PATCH net-next 1/6] net: dsa: add uses_hw_tag Vivien Didelot
                   ` (6 more replies)
  0 siblings, 7 replies; 23+ messages in thread
From: Vivien Didelot @ 2015-10-07 23:48 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, kernel, David S. Miller, Scott Feldman, Jiri Pirko,
	Florian Fainelli, Andrew Lunn, Neil Armstrong, Sergei Shtylyov,
	Vivien Didelot

This patchset pushes the switchdev prepare phase for the FDB add and del
operations down to the DSA drivers. Currently only mv88e6xxx is affected.

Since the dump requires a bit of refactoring in the driver, it'll come in a
future patchset.

The first 3 patches removes the dsa.h include from linux/netdevice.h, which
broke the inclusion of switchdev.h in dsa.h.

The last 3 patches add port_fdb_prepare and change port_fdb_add and
port_fdb_del to use the switchdev FDB object structure.

To be more specific about the include dependency issue, here's a snippet of
what happens currently if you include switchdev.h in dsa.h:

[...]
    include/net/switchdev.h:52:30: error: field ‘ppid’ has incomplete type
       struct netdev_phys_item_id ppid; /* PORT_PARENT_ID */
                                  ^
    include/net/switchdev.h:185:14: warning: ‘struct nlmsghdr’ declared inside parameter list [enabled by default]
           struct nlmsghdr *nlh, u16 flags);
                  ^
    include/net/switchdev.h:195:7: warning: ‘struct ndmsg’ declared inside parameter list [enabled by default]
    include/net/switchdev.h:198:7: warning: ‘struct nlattr’ declared inside parameter list [enabled by default]
           u16 vid);
           ^
    include/net/switchdev.h:201:15: warning: ‘struct netlink_callback’ declared inside parameter list [enabled by default]
            struct net_device *filter_dev, int idx);
                   ^
[...]

Removing the dsa.h include from linux/netdevice.h gets rid of these errors but
then the DSA code complains if you don't include it in dsa_priv.h:

[...]
net/dsa/slave.c: In function ‘dsa_slave_set_mac_address’:
net/dsa/slave.c:178:39: error: dereferencing pointer to incomplete type
  struct net_device *master = p->parent->dst->master_netdev;
                                       ^
In file included from include/linux/list.h:8:0,
                 from net/dsa/slave.c:11:
net/dsa/slave.c: In function ‘dsa_bridge_check_vlan_range’:
net/dsa/slave.c:209:26: error: ‘DSA_MAX_PORTS’ undeclared (first use in this function)
  DECLARE_BITMAP(members, DSA_MAX_PORTS);
                          ^
net/dsa/slave.c:209:26: note: each undeclared identifier is reported only once for each function it appears in
  DECLARE_BITMAP(members, DSA_MAX_PORTS);
                          ^
include/linux/kernel.h:67:30: note: in definition of macro ‘DIV_ROUND_UP’
 #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
                              ^
include/linux/types.h:10:21: note: in expansion of macro ‘BITS_TO_LONGS’
  unsigned long name[BITS_TO_LONGS(bits)]
                     ^
net/dsa/slave.c:209:2: note: in expansion of macro ‘DECLARE_BITMAP’
  DECLARE_BITMAP(members, DSA_MAX_PORTS);
  ^
net/dsa/slave.c:1190:7: error: ‘DSA_TAG_PROTO_EDSA’ undeclared (first use in this function)
  case DSA_TAG_PROTO_EDSA:
       ^
net/dsa/slave.c: In function ‘dsa_slave_get_iflink’:
net/dsa/slave.c:64:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
[...]


Thanks,
-v

Vivien Didelot (6):
  net: dsa: add uses_hw_tag
  net: dsa: include dsa.h in dsa_priv.h
  net: remove dsa.h include from linux/netdevice.h
  net: dsa: add port_fdb_prepare
  net: dsa: push prepare phase in port_fdb_add
  net: dsa: use switchdev obj in port_fdb_del

 drivers/net/dsa/mv88e6171.c |  1 +
 drivers/net/dsa/mv88e6352.c |  1 +
 drivers/net/dsa/mv88e6xxx.c | 23 +++++++++++++++++------
 drivers/net/dsa/mv88e6xxx.h |  8 ++++++--
 include/linux/netdevice.h   |  9 ++++++---
 include/net/dsa.h           | 14 +++++++-------
 net/dsa/dsa.c               |  1 +
 net/dsa/dsa_priv.h          |  1 +
 net/dsa/slave.c             | 11 +++++++----
 9 files changed, 47 insertions(+), 22 deletions(-)

-- 
2.6.0

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

end of thread, other threads:[~2015-10-10 23:35 UTC | newest]

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).