Skip to content

Commit 29ab586

Browse files
Arkadi Sharshevskydavem330
authored andcommitted
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: Arkadi Sharshevsky <[email protected]> Reviewed-by: Vivien Didelot <[email protected]> Acked-by: Jiri Pirko <[email protected]> Reviewed-by: Ivan Vecera <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3a83c2a commit 29ab586

File tree

2 files changed

+0
-510
lines changed

2 files changed

+0
-510
lines changed

include/net/switchdev.h

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ struct switchdev_attr {
7474
enum switchdev_obj_id {
7575
SWITCHDEV_OBJ_ID_UNDEFINED,
7676
SWITCHDEV_OBJ_ID_PORT_VLAN,
77-
SWITCHDEV_OBJ_ID_PORT_FDB,
7877
SWITCHDEV_OBJ_ID_PORT_MDB,
7978
};
8079

@@ -97,17 +96,6 @@ struct switchdev_obj_port_vlan {
9796
#define SWITCHDEV_OBJ_PORT_VLAN(obj) \
9897
container_of(obj, struct switchdev_obj_port_vlan, obj)
9998

100-
/* SWITCHDEV_OBJ_ID_PORT_FDB */
101-
struct switchdev_obj_port_fdb {
102-
struct switchdev_obj obj;
103-
unsigned char addr[ETH_ALEN];
104-
u16 vid;
105-
u16 ndm_state;
106-
};
107-
108-
#define SWITCHDEV_OBJ_PORT_FDB(obj) \
109-
container_of(obj, struct switchdev_obj_port_fdb, obj)
110-
11199
/* SWITCHDEV_OBJ_ID_PORT_MDB */
112100
struct switchdev_obj_port_mdb {
113101
struct switchdev_obj obj;
@@ -135,8 +123,6 @@ typedef int switchdev_obj_dump_cb_t(struct switchdev_obj *obj);
135123
* @switchdev_port_obj_add: Add an object to port (see switchdev_obj_*).
136124
*
137125
* @switchdev_port_obj_del: Delete an object from port (see switchdev_obj_*).
138-
*
139-
* @switchdev_port_obj_dump: Dump port objects (see switchdev_obj_*).
140126
*/
141127
struct switchdev_ops {
142128
int (*switchdev_port_attr_get)(struct net_device *dev,
@@ -149,9 +135,6 @@ struct switchdev_ops {
149135
struct switchdev_trans *trans);
150136
int (*switchdev_port_obj_del)(struct net_device *dev,
151137
const struct switchdev_obj *obj);
152-
int (*switchdev_port_obj_dump)(struct net_device *dev,
153-
struct switchdev_obj *obj,
154-
switchdev_obj_dump_cb_t *cb);
155138
};
156139

157140
enum switchdev_notifier_type {
@@ -189,25 +172,10 @@ int switchdev_port_obj_add(struct net_device *dev,
189172
const struct switchdev_obj *obj);
190173
int switchdev_port_obj_del(struct net_device *dev,
191174
const struct switchdev_obj *obj);
192-
int switchdev_port_obj_dump(struct net_device *dev, struct switchdev_obj *obj,
193-
switchdev_obj_dump_cb_t *cb);
194175
int register_switchdev_notifier(struct notifier_block *nb);
195176
int unregister_switchdev_notifier(struct notifier_block *nb);
196177
int call_switchdev_notifiers(unsigned long val, struct net_device *dev,
197178
struct switchdev_notifier_info *info);
198-
int switchdev_port_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
199-
struct net_device *dev, u32 filter_mask,
200-
int nlflags);
201-
int switchdev_port_bridge_setlink(struct net_device *dev,
202-
struct nlmsghdr *nlh, u16 flags);
203-
int switchdev_port_bridge_dellink(struct net_device *dev,
204-
struct nlmsghdr *nlh, u16 flags);
205-
int switchdev_port_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
206-
struct net_device *dev, const unsigned char *addr,
207-
u16 vid, u16 nlm_flags);
208-
int switchdev_port_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],
209-
struct net_device *dev, const unsigned char *addr,
210-
u16 vid);
211179
void switchdev_port_fwd_mark_set(struct net_device *dev,
212180
struct net_device *group_dev,
213181
bool joining);
@@ -246,13 +214,6 @@ static inline int switchdev_port_obj_del(struct net_device *dev,
246214
return -EOPNOTSUPP;
247215
}
248216

249-
static inline int switchdev_port_obj_dump(struct net_device *dev,
250-
const struct switchdev_obj *obj,
251-
switchdev_obj_dump_cb_t *cb)
252-
{
253-
return -EOPNOTSUPP;
254-
}
255-
256217
static inline int register_switchdev_notifier(struct notifier_block *nb)
257218
{
258219
return 0;
@@ -270,42 +231,6 @@ static inline int call_switchdev_notifiers(unsigned long val,
270231
return NOTIFY_DONE;
271232
}
272233

273-
static inline int switchdev_port_bridge_getlink(struct sk_buff *skb, u32 pid,
274-
u32 seq, struct net_device *dev,
275-
u32 filter_mask, int nlflags)
276-
{
277-
return -EOPNOTSUPP;
278-
}
279-
280-
static inline int switchdev_port_bridge_setlink(struct net_device *dev,
281-
struct nlmsghdr *nlh,
282-
u16 flags)
283-
{
284-
return -EOPNOTSUPP;
285-
}
286-
287-
static inline int switchdev_port_bridge_dellink(struct net_device *dev,
288-
struct nlmsghdr *nlh,
289-
u16 flags)
290-
{
291-
return -EOPNOTSUPP;
292-
}
293-
294-
static inline int switchdev_port_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
295-
struct net_device *dev,
296-
const unsigned char *addr,
297-
u16 vid, u16 nlm_flags)
298-
{
299-
return -EOPNOTSUPP;
300-
}
301-
302-
static inline int switchdev_port_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],
303-
struct net_device *dev,
304-
const unsigned char *addr, u16 vid)
305-
{
306-
return -EOPNOTSUPP;
307-
}
308-
309234
static inline bool switchdev_port_same_parent_id(struct net_device *a,
310235
struct net_device *b)
311236
{

0 commit comments

Comments
 (0)