Commit 29ab586c authored by Arkadi Sharshevsky's avatar Arkadi Sharshevsky Committed by David S. Miller

net: switchdev: Remove bridge bypass support from switchdev

Currently the bridge port flags, vlans, FDBs and MDBs can be offloaded
through the bridge code, making the switchdev's SELF bridge bypass
implementation to be redundant. This implies several changes:
- No need for dump infra in switchdev, DSA's special case is handled
  privately.
- Remove obj_dump from switchdev_ops.
- FDBs are removed from obj_add/del routines, due to the fact that they
  are offloaded through the bridge notification chain.
- The switchdev_port_bridge_xx() and switchdev_port_fdb_xx() functions
  can be removed.
Signed-off-by: default avatarArkadi Sharshevsky <arkadis@mellanox.com>
Reviewed-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
Reviewed-by: default avatarIvan Vecera <ivecera@redhat.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3a83c2a7
...@@ -74,7 +74,6 @@ struct switchdev_attr { ...@@ -74,7 +74,6 @@ struct switchdev_attr {
enum switchdev_obj_id { enum switchdev_obj_id {
SWITCHDEV_OBJ_ID_UNDEFINED, SWITCHDEV_OBJ_ID_UNDEFINED,
SWITCHDEV_OBJ_ID_PORT_VLAN, SWITCHDEV_OBJ_ID_PORT_VLAN,
SWITCHDEV_OBJ_ID_PORT_FDB,
SWITCHDEV_OBJ_ID_PORT_MDB, SWITCHDEV_OBJ_ID_PORT_MDB,
}; };
...@@ -97,17 +96,6 @@ struct switchdev_obj_port_vlan { ...@@ -97,17 +96,6 @@ struct switchdev_obj_port_vlan {
#define SWITCHDEV_OBJ_PORT_VLAN(obj) \ #define SWITCHDEV_OBJ_PORT_VLAN(obj) \
container_of(obj, struct switchdev_obj_port_vlan, obj) container_of(obj, struct switchdev_obj_port_vlan, obj)
/* SWITCHDEV_OBJ_ID_PORT_FDB */
struct switchdev_obj_port_fdb {
struct switchdev_obj obj;
unsigned char addr[ETH_ALEN];
u16 vid;
u16 ndm_state;
};
#define SWITCHDEV_OBJ_PORT_FDB(obj) \
container_of(obj, struct switchdev_obj_port_fdb, obj)
/* SWITCHDEV_OBJ_ID_PORT_MDB */ /* SWITCHDEV_OBJ_ID_PORT_MDB */
struct switchdev_obj_port_mdb { struct switchdev_obj_port_mdb {
struct switchdev_obj obj; struct switchdev_obj obj;
...@@ -135,8 +123,6 @@ typedef int switchdev_obj_dump_cb_t(struct switchdev_obj *obj); ...@@ -135,8 +123,6 @@ typedef int switchdev_obj_dump_cb_t(struct switchdev_obj *obj);
* @switchdev_port_obj_add: Add an object to port (see switchdev_obj_*). * @switchdev_port_obj_add: Add an object to port (see switchdev_obj_*).
* *
* @switchdev_port_obj_del: Delete an object from port (see switchdev_obj_*). * @switchdev_port_obj_del: Delete an object from port (see switchdev_obj_*).
*
* @switchdev_port_obj_dump: Dump port objects (see switchdev_obj_*).
*/ */
struct switchdev_ops { struct switchdev_ops {
int (*switchdev_port_attr_get)(struct net_device *dev, int (*switchdev_port_attr_get)(struct net_device *dev,
...@@ -149,9 +135,6 @@ struct switchdev_ops { ...@@ -149,9 +135,6 @@ struct switchdev_ops {
struct switchdev_trans *trans); struct switchdev_trans *trans);
int (*switchdev_port_obj_del)(struct net_device *dev, int (*switchdev_port_obj_del)(struct net_device *dev,
const struct switchdev_obj *obj); const struct switchdev_obj *obj);
int (*switchdev_port_obj_dump)(struct net_device *dev,
struct switchdev_obj *obj,
switchdev_obj_dump_cb_t *cb);
}; };
enum switchdev_notifier_type { enum switchdev_notifier_type {
...@@ -189,25 +172,10 @@ int switchdev_port_obj_add(struct net_device *dev, ...@@ -189,25 +172,10 @@ int switchdev_port_obj_add(struct net_device *dev,
const struct switchdev_obj *obj); const struct switchdev_obj *obj);
int switchdev_port_obj_del(struct net_device *dev, int switchdev_port_obj_del(struct net_device *dev,
const struct switchdev_obj *obj); const struct switchdev_obj *obj);
int switchdev_port_obj_dump(struct net_device *dev, struct switchdev_obj *obj,
switchdev_obj_dump_cb_t *cb);
int register_switchdev_notifier(struct notifier_block *nb); int register_switchdev_notifier(struct notifier_block *nb);
int unregister_switchdev_notifier(struct notifier_block *nb); int unregister_switchdev_notifier(struct notifier_block *nb);
int call_switchdev_notifiers(unsigned long val, struct net_device *dev, int call_switchdev_notifiers(unsigned long val, struct net_device *dev,
struct switchdev_notifier_info *info); struct switchdev_notifier_info *info);
int switchdev_port_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
struct net_device *dev, u32 filter_mask,
int nlflags);
int switchdev_port_bridge_setlink(struct net_device *dev,
struct nlmsghdr *nlh, u16 flags);
int switchdev_port_bridge_dellink(struct net_device *dev,
struct nlmsghdr *nlh, u16 flags);
int switchdev_port_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
struct net_device *dev, const unsigned char *addr,
u16 vid, u16 nlm_flags);
int switchdev_port_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],
struct net_device *dev, const unsigned char *addr,
u16 vid);
void switchdev_port_fwd_mark_set(struct net_device *dev, void switchdev_port_fwd_mark_set(struct net_device *dev,
struct net_device *group_dev, struct net_device *group_dev,
bool joining); bool joining);
...@@ -246,13 +214,6 @@ static inline int switchdev_port_obj_del(struct net_device *dev, ...@@ -246,13 +214,6 @@ static inline int switchdev_port_obj_del(struct net_device *dev,
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
static inline int switchdev_port_obj_dump(struct net_device *dev,
const struct switchdev_obj *obj,
switchdev_obj_dump_cb_t *cb)
{
return -EOPNOTSUPP;
}
static inline int register_switchdev_notifier(struct notifier_block *nb) static inline int register_switchdev_notifier(struct notifier_block *nb)
{ {
return 0; return 0;
...@@ -270,42 +231,6 @@ static inline int call_switchdev_notifiers(unsigned long val, ...@@ -270,42 +231,6 @@ static inline int call_switchdev_notifiers(unsigned long val,
return NOTIFY_DONE; return NOTIFY_DONE;
} }
static inline int switchdev_port_bridge_getlink(struct sk_buff *skb, u32 pid,
u32 seq, struct net_device *dev,
u32 filter_mask, int nlflags)
{
return -EOPNOTSUPP;
}
static inline int switchdev_port_bridge_setlink(struct net_device *dev,
struct nlmsghdr *nlh,
u16 flags)
{
return -EOPNOTSUPP;
}
static inline int switchdev_port_bridge_dellink(struct net_device *dev,
struct nlmsghdr *nlh,
u16 flags)
{
return -EOPNOTSUPP;
}
static inline int switchdev_port_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
struct net_device *dev,
const unsigned char *addr,
u16 vid, u16 nlm_flags)
{
return -EOPNOTSUPP;
}
static inline int switchdev_port_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],
struct net_device *dev,
const unsigned char *addr, u16 vid)
{
return -EOPNOTSUPP;
}
static inline bool switchdev_port_same_parent_id(struct net_device *a, static inline bool switchdev_port_same_parent_id(struct net_device *a,
struct net_device *b) struct net_device *b)
{ {
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment