[PATCH net-next 0/6] net: dsa: push switchdev prepare phase in FDB ops
From: Vivien Didelot
Date: Wed Oct 07 2015 - 19:50:58 EST
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/