blob: f1a5a9a3634d96633d582491f802ddfb34d5f72f [file] [log] [blame]
Thomas Gleixner2874c5f2019-05-27 08:55:01 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Jiri Pirko007f7902014-11-28 14:34:17 +01002/*
3 * include/net/switchdev.h - Switch device API
Jiri Pirko7ea6eb32015-09-24 10:02:41 +02004 * Copyright (c) 2014-2015 Jiri Pirko <jiri@resnulli.us>
Scott Feldmanf8f21472015-03-09 13:59:09 -07005 * Copyright (c) 2014-2015 Scott Feldman <sfeldma@gmail.com>
Jiri Pirko007f7902014-11-28 14:34:17 +01006 */
7#ifndef _LINUX_SWITCHDEV_H_
8#define _LINUX_SWITCHDEV_H_
9
10#include <linux/netdevice.h>
Jiri Pirko03bf0c22015-01-15 23:49:36 +010011#include <linux/notifier.h>
Jiri Pirko7ea6eb32015-09-24 10:02:41 +020012#include <linux/list.h>
Jiri Pirko850d0cb2015-10-14 19:40:51 +020013#include <net/ip_fib.h>
Jiri Pirko03bf0c22015-01-15 23:49:36 +010014
Scott Feldman30943332015-05-10 09:47:48 -070015#define SWITCHDEV_F_NO_RECURSE BIT(0)
Scott Feldman464314e2015-10-08 19:23:18 -070016#define SWITCHDEV_F_SKIP_EOPNOTSUPP BIT(1)
Jiri Pirko0bc05d52015-10-14 19:40:50 +020017#define SWITCHDEV_F_DEFER BIT(2)
Scott Feldman30943332015-05-10 09:47:48 -070018
Scott Feldman30943332015-05-10 09:47:48 -070019enum switchdev_attr_id {
Jiri Pirko1f868392015-10-01 11:03:42 +020020 SWITCHDEV_ATTR_ID_UNDEFINED,
Jiri Pirko1f868392015-10-01 11:03:42 +020021 SWITCHDEV_ATTR_ID_PORT_STP_STATE,
22 SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS,
Florian Fainelli746dc182019-02-20 16:58:19 -080023 SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS,
Nogah Frankel6d549642017-02-09 14:54:42 +010024 SWITCHDEV_ATTR_ID_PORT_MROUTER,
Scott Feldmanf55ac582015-10-08 19:23:17 -070025 SWITCHDEV_ATTR_ID_BRIDGE_AGEING_TIME,
Elad Raz81435c32016-01-06 13:01:05 +010026 SWITCHDEV_ATTR_ID_BRIDGE_VLAN_FILTERING,
Danielle Ratson22ec19f32020-11-29 14:54:05 +020027 SWITCHDEV_ATTR_ID_BRIDGE_VLAN_PROTOCOL,
Nogah Frankel147c1e92017-02-09 14:54:40 +010028 SWITCHDEV_ATTR_ID_BRIDGE_MC_DISABLED,
Yotam Gigi77041422017-10-09 11:15:31 +020029 SWITCHDEV_ATTR_ID_BRIDGE_MROUTER,
Horatiu Vulturc284b542020-04-26 15:22:03 +020030 SWITCHDEV_ATTR_ID_MRP_PORT_ROLE,
Scott Feldman30943332015-05-10 09:47:48 -070031};
32
Vladimir Olteane18f4c12021-02-12 17:15:55 +020033struct switchdev_brport_flags {
34 unsigned long val;
35 unsigned long mask;
36};
37
Scott Feldman30943332015-05-10 09:47:48 -070038struct switchdev_attr {
Ido Schimmel6ff64f62015-12-15 16:03:35 +010039 struct net_device *orig_dev;
Scott Feldman30943332015-05-10 09:47:48 -070040 enum switchdev_attr_id id;
Scott Feldman30943332015-05-10 09:47:48 -070041 u32 flags;
Elad Raz7ceb2af2016-04-21 12:52:43 +020042 void *complete_priv;
43 void (*complete)(struct net_device *dev, int err, void *priv);
Scott Feldmanf8e20a92015-05-10 09:47:49 -070044 union {
Scott Feldman35636062015-05-10 09:47:51 -070045 u8 stp_state; /* PORT_STP_STATE */
Vladimir Olteane18f4c12021-02-12 17:15:55 +020046 struct switchdev_brport_flags brport_flags; /* PORT_BRIDGE_FLAGS */
Nogah Frankel6d549642017-02-09 14:54:42 +010047 bool mrouter; /* PORT_MROUTER */
Vivien Dideloteabfdda2016-07-18 15:02:06 -040048 clock_t ageing_time; /* BRIDGE_AGEING_TIME */
Elad Raz81435c32016-01-06 13:01:05 +010049 bool vlan_filtering; /* BRIDGE_VLAN_FILTERING */
Danielle Ratson22ec19f32020-11-29 14:54:05 +020050 u16 vlan_protocol; /* BRIDGE_VLAN_PROTOCOL */
Nogah Frankel147c1e92017-02-09 14:54:40 +010051 bool mc_disabled; /* MC_DISABLED */
Horatiu Vulturc284b542020-04-26 15:22:03 +020052 u8 mrp_port_role; /* MRP_PORT_ROLE */
Scott Feldman42275bd2015-05-13 11:16:50 -070053 } u;
Scott Feldman30943332015-05-10 09:47:48 -070054};
55
Scott Feldman491d0f12015-05-10 09:47:52 -070056enum switchdev_obj_id {
Jiri Pirko57d80832015-10-01 11:03:41 +020057 SWITCHDEV_OBJ_ID_UNDEFINED,
58 SWITCHDEV_OBJ_ID_PORT_VLAN,
Elad Raz4d41e1252016-01-10 21:06:22 +010059 SWITCHDEV_OBJ_ID_PORT_MDB,
Andrew Lunn47d5b6d2017-11-09 23:10:59 +010060 SWITCHDEV_OBJ_ID_HOST_MDB,
Horatiu Vulturc284b542020-04-26 15:22:03 +020061 SWITCHDEV_OBJ_ID_MRP,
62 SWITCHDEV_OBJ_ID_RING_TEST_MRP,
63 SWITCHDEV_OBJ_ID_RING_ROLE_MRP,
64 SWITCHDEV_OBJ_ID_RING_STATE_MRP,
Horatiu Vulturcf7c5272020-07-14 09:34:47 +020065 SWITCHDEV_OBJ_ID_IN_TEST_MRP,
66 SWITCHDEV_OBJ_ID_IN_ROLE_MRP,
67 SWITCHDEV_OBJ_ID_IN_STATE_MRP,
Scott Feldman491d0f12015-05-10 09:47:52 -070068};
69
Jiri Pirko648b4a92015-10-01 11:03:45 +020070struct switchdev_obj {
Vladimir Oltean4f2673b2021-03-23 01:51:44 +020071 struct list_head list;
Ido Schimmel6ff64f62015-12-15 16:03:35 +010072 struct net_device *orig_dev;
Jiri Pirko9e8f4a52015-10-01 11:03:46 +020073 enum switchdev_obj_id id;
Jiri Pirko4d429c52015-10-14 19:40:52 +020074 u32 flags;
Elad Raz7ceb2af2016-04-21 12:52:43 +020075 void *complete_priv;
76 void (*complete)(struct net_device *dev, int err, void *priv);
Jiri Pirko648b4a92015-10-01 11:03:45 +020077};
78
Jiri Pirko57d80832015-10-01 11:03:41 +020079/* SWITCHDEV_OBJ_ID_PORT_VLAN */
Jiri Pirko8f24f302015-10-01 11:03:43 +020080struct switchdev_obj_port_vlan {
Jiri Pirko648b4a92015-10-01 11:03:45 +020081 struct switchdev_obj obj;
Vivien Didelot44bbcf52015-09-29 12:07:18 -040082 u16 flags;
Vladimir Olteanb7a9e0d2021-01-09 02:01:46 +020083 u16 vid;
Vivien Didelot44bbcf52015-09-29 12:07:18 -040084};
85
Petr Machataec394af2018-11-22 23:28:07 +000086#define SWITCHDEV_OBJ_PORT_VLAN(OBJ) \
87 container_of((OBJ), struct switchdev_obj_port_vlan, obj)
Jiri Pirko648b4a92015-10-01 11:03:45 +020088
Elad Raz4d41e1252016-01-10 21:06:22 +010089/* SWITCHDEV_OBJ_ID_PORT_MDB */
90struct switchdev_obj_port_mdb {
91 struct switchdev_obj obj;
92 unsigned char addr[ETH_ALEN];
93 u16 vid;
94};
95
Petr Machataec394af2018-11-22 23:28:07 +000096#define SWITCHDEV_OBJ_PORT_MDB(OBJ) \
97 container_of((OBJ), struct switchdev_obj_port_mdb, obj)
Elad Raz4d41e1252016-01-10 21:06:22 +010098
Horatiu Vulturc284b542020-04-26 15:22:03 +020099
Horatiu Vulturc284b542020-04-26 15:22:03 +0200100/* SWITCHDEV_OBJ_ID_MRP */
101struct switchdev_obj_mrp {
102 struct switchdev_obj obj;
103 struct net_device *p_port;
104 struct net_device *s_port;
105 u32 ring_id;
Horatiu Vultur4b3a61b2020-05-30 18:09:47 +0000106 u16 prio;
Horatiu Vulturc284b542020-04-26 15:22:03 +0200107};
108
109#define SWITCHDEV_OBJ_MRP(OBJ) \
110 container_of((OBJ), struct switchdev_obj_mrp, obj)
111
112/* SWITCHDEV_OBJ_ID_RING_TEST_MRP */
113struct switchdev_obj_ring_test_mrp {
114 struct switchdev_obj obj;
115 /* The value is in us and a value of 0 represents to stop */
116 u32 interval;
117 u8 max_miss;
118 u32 ring_id;
119 u32 period;
Horatiu Vulturc6676e72020-05-30 18:09:48 +0000120 bool monitor;
Horatiu Vulturc284b542020-04-26 15:22:03 +0200121};
122
123#define SWITCHDEV_OBJ_RING_TEST_MRP(OBJ) \
124 container_of((OBJ), struct switchdev_obj_ring_test_mrp, obj)
125
126/* SWICHDEV_OBJ_ID_RING_ROLE_MRP */
127struct switchdev_obj_ring_role_mrp {
128 struct switchdev_obj obj;
129 u8 ring_role;
130 u32 ring_id;
Horatiu Vulturc513efa2021-02-16 22:41:59 +0100131 u8 sw_backup;
Horatiu Vulturc284b542020-04-26 15:22:03 +0200132};
133
134#define SWITCHDEV_OBJ_RING_ROLE_MRP(OBJ) \
135 container_of((OBJ), struct switchdev_obj_ring_role_mrp, obj)
136
137struct switchdev_obj_ring_state_mrp {
138 struct switchdev_obj obj;
139 u8 ring_state;
140 u32 ring_id;
141};
142
143#define SWITCHDEV_OBJ_RING_STATE_MRP(OBJ) \
144 container_of((OBJ), struct switchdev_obj_ring_state_mrp, obj)
145
Horatiu Vulturcf7c5272020-07-14 09:34:47 +0200146/* SWITCHDEV_OBJ_ID_IN_TEST_MRP */
147struct switchdev_obj_in_test_mrp {
148 struct switchdev_obj obj;
149 /* The value is in us and a value of 0 represents to stop */
150 u32 interval;
151 u32 in_id;
152 u32 period;
153 u8 max_miss;
154};
155
156#define SWITCHDEV_OBJ_IN_TEST_MRP(OBJ) \
157 container_of((OBJ), struct switchdev_obj_in_test_mrp, obj)
158
159/* SWICHDEV_OBJ_ID_IN_ROLE_MRP */
160struct switchdev_obj_in_role_mrp {
161 struct switchdev_obj obj;
162 struct net_device *i_port;
163 u32 ring_id;
164 u16 in_id;
165 u8 in_role;
Horatiu Vulturc513efa2021-02-16 22:41:59 +0100166 u8 sw_backup;
Horatiu Vulturcf7c5272020-07-14 09:34:47 +0200167};
168
169#define SWITCHDEV_OBJ_IN_ROLE_MRP(OBJ) \
170 container_of((OBJ), struct switchdev_obj_in_role_mrp, obj)
171
172struct switchdev_obj_in_state_mrp {
173 struct switchdev_obj obj;
174 u32 in_id;
175 u8 in_state;
176};
177
178#define SWITCHDEV_OBJ_IN_STATE_MRP(OBJ) \
179 container_of((OBJ), struct switchdev_obj_in_state_mrp, obj)
180
Jiri Pirko648b4a92015-10-01 11:03:45 +0200181typedef int switchdev_obj_dump_cb_t(struct switchdev_obj *obj);
182
Jiri Pirkoebb9a032015-05-10 09:47:46 -0700183enum switchdev_notifier_type {
Arkadi Sharshevsky6b26b512017-06-08 08:44:14 +0200184 SWITCHDEV_FDB_ADD_TO_BRIDGE = 1,
185 SWITCHDEV_FDB_DEL_TO_BRIDGE,
186 SWITCHDEV_FDB_ADD_TO_DEVICE,
187 SWITCHDEV_FDB_DEL_TO_DEVICE,
Arkadi Sharshevsky9fe8bce2017-06-08 08:44:15 +0200188 SWITCHDEV_FDB_OFFLOADED,
Alexandra Winterd05e8e62020-09-10 19:23:48 +0200189 SWITCHDEV_FDB_FLUSH_TO_BRIDGE,
Petr Machata9a997352018-10-17 08:53:22 +0000190
Petr Machataaa4efe22018-11-22 23:28:38 +0000191 SWITCHDEV_PORT_OBJ_ADD, /* Blocking. */
192 SWITCHDEV_PORT_OBJ_DEL, /* Blocking. */
Florian Fainelli1cb33af2019-02-27 11:44:25 -0800193 SWITCHDEV_PORT_ATTR_SET, /* May be blocking . */
Petr Machataaa4efe22018-11-22 23:28:38 +0000194
Petr Machata5728ae02018-11-21 08:02:39 +0000195 SWITCHDEV_VXLAN_FDB_ADD_TO_BRIDGE,
196 SWITCHDEV_VXLAN_FDB_DEL_TO_BRIDGE,
Petr Machata9a997352018-10-17 08:53:22 +0000197 SWITCHDEV_VXLAN_FDB_ADD_TO_DEVICE,
198 SWITCHDEV_VXLAN_FDB_DEL_TO_DEVICE,
Petr Machata0efe1172018-10-17 08:53:26 +0000199 SWITCHDEV_VXLAN_FDB_OFFLOADED,
Jiri Pirko3aeb6612015-01-15 23:49:37 +0100200};
201
Jiri Pirkoebb9a032015-05-10 09:47:46 -0700202struct switchdev_notifier_info {
Jiri Pirko03bf0c22015-01-15 23:49:36 +0100203 struct net_device *dev;
Petr Machata479c86d2018-12-12 17:02:54 +0000204 struct netlink_ext_ack *extack;
Jiri Pirko03bf0c22015-01-15 23:49:36 +0100205};
206
Jiri Pirkoebb9a032015-05-10 09:47:46 -0700207struct switchdev_notifier_fdb_info {
208 struct switchdev_notifier_info info; /* must be first */
Jiri Pirko3aeb6612015-01-15 23:49:37 +0100209 const unsigned char *addr;
210 u16 vid;
Ido Schimmele9ba0fb2018-10-17 08:53:29 +0000211 u8 added_by_user:1,
Vladimir Oltean2c4eca32021-04-14 19:52:56 +0300212 is_local:1,
Ido Schimmele9ba0fb2018-10-17 08:53:29 +0000213 offloaded:1;
Jiri Pirko3aeb6612015-01-15 23:49:37 +0100214};
215
Petr Machataaa4efe22018-11-22 23:28:38 +0000216struct switchdev_notifier_port_obj_info {
217 struct switchdev_notifier_info info; /* must be first */
218 const struct switchdev_obj *obj;
Petr Machataaa4efe22018-11-22 23:28:38 +0000219 bool handled;
220};
221
Florian Fainelli1cb33af2019-02-27 11:44:25 -0800222struct switchdev_notifier_port_attr_info {
223 struct switchdev_notifier_info info; /* must be first */
224 const struct switchdev_attr *attr;
Florian Fainelli1cb33af2019-02-27 11:44:25 -0800225 bool handled;
226};
227
Jiri Pirko03bf0c22015-01-15 23:49:36 +0100228static inline struct net_device *
Jiri Pirkoebb9a032015-05-10 09:47:46 -0700229switchdev_notifier_info_to_dev(const struct switchdev_notifier_info *info)
Jiri Pirko03bf0c22015-01-15 23:49:36 +0100230{
231 return info->dev;
232}
Jiri Pirko007f7902014-11-28 14:34:17 +0100233
Petr Machata479c86d2018-12-12 17:02:54 +0000234static inline struct netlink_ext_ack *
235switchdev_notifier_info_to_extack(const struct switchdev_notifier_info *info)
236{
237 return info->extack;
238}
239
Jiri Pirko007f7902014-11-28 14:34:17 +0100240#ifdef CONFIG_NET_SWITCHDEV
241
Jiri Pirko793f4012015-10-14 19:40:48 +0200242void switchdev_deferred_process(void);
Scott Feldman30943332015-05-10 09:47:48 -0700243int switchdev_port_attr_set(struct net_device *dev,
Vladimir Olteandcbdf132021-02-13 22:43:17 +0200244 const struct switchdev_attr *attr,
245 struct netlink_ext_ack *extack);
Jiri Pirko9e8f4a52015-10-01 11:03:46 +0200246int switchdev_port_obj_add(struct net_device *dev,
Petr Machata69b73202018-12-12 17:02:52 +0000247 const struct switchdev_obj *obj,
248 struct netlink_ext_ack *extack);
Jiri Pirko9e8f4a52015-10-01 11:03:46 +0200249int switchdev_port_obj_del(struct net_device *dev,
Jiri Pirko648b4a92015-10-01 11:03:45 +0200250 const struct switchdev_obj *obj);
Petr Machataa93e3b12018-11-22 23:28:25 +0000251
Jiri Pirkoebb9a032015-05-10 09:47:46 -0700252int register_switchdev_notifier(struct notifier_block *nb);
253int unregister_switchdev_notifier(struct notifier_block *nb);
254int call_switchdev_notifiers(unsigned long val, struct net_device *dev,
Petr Machata66859872019-01-16 23:06:56 +0000255 struct switchdev_notifier_info *info,
256 struct netlink_ext_ack *extack);
Petr Machataa93e3b12018-11-22 23:28:25 +0000257
258int register_switchdev_blocking_notifier(struct notifier_block *nb);
259int unregister_switchdev_blocking_notifier(struct notifier_block *nb);
260int call_switchdev_blocking_notifiers(unsigned long val, struct net_device *dev,
Petr Machata479c86d2018-12-12 17:02:54 +0000261 struct switchdev_notifier_info *info,
262 struct netlink_ext_ack *extack);
Petr Machataa93e3b12018-11-22 23:28:25 +0000263
Scott Feldman1a3b2ec2015-07-18 18:24:50 -0700264void switchdev_port_fwd_mark_set(struct net_device *dev,
265 struct net_device *group_dev,
266 bool joining);
Scott Feldman5e8d9042015-03-05 21:21:15 -0800267
Petr Machataf30f0602018-11-22 23:29:44 +0000268int switchdev_handle_port_obj_add(struct net_device *dev,
269 struct switchdev_notifier_port_obj_info *port_obj_info,
270 bool (*check_cb)(const struct net_device *dev),
271 int (*add_cb)(struct net_device *dev,
272 const struct switchdev_obj *obj,
Petr Machata69213512018-12-12 17:02:56 +0000273 struct netlink_ext_ack *extack));
Petr Machataf30f0602018-11-22 23:29:44 +0000274int switchdev_handle_port_obj_del(struct net_device *dev,
275 struct switchdev_notifier_port_obj_info *port_obj_info,
276 bool (*check_cb)(const struct net_device *dev),
277 int (*del_cb)(struct net_device *dev,
278 const struct switchdev_obj *obj));
279
Florian Fainelli1cb33af2019-02-27 11:44:25 -0800280int switchdev_handle_port_attr_set(struct net_device *dev,
281 struct switchdev_notifier_port_attr_info *port_attr_info,
282 bool (*check_cb)(const struct net_device *dev),
283 int (*set_cb)(struct net_device *dev,
Vladimir Oltean4c08c582021-02-12 17:15:51 +0200284 const struct switchdev_attr *attr,
285 struct netlink_ext_ack *extack));
Jiri Pirko007f7902014-11-28 14:34:17 +0100286#else
287
Jiri Pirko793f4012015-10-14 19:40:48 +0200288static inline void switchdev_deferred_process(void)
289{
290}
291
Scott Feldman30943332015-05-10 09:47:48 -0700292static inline int switchdev_port_attr_set(struct net_device *dev,
Vladimir Oltean419dfae2021-02-15 23:09:11 +0200293 const struct switchdev_attr *attr,
294 struct netlink_ext_ack *extack)
Scott Feldman30943332015-05-10 09:47:48 -0700295{
296 return -EOPNOTSUPP;
297}
298
Scott Feldman491d0f12015-05-10 09:47:52 -0700299static inline int switchdev_port_obj_add(struct net_device *dev,
Petr Machata69b73202018-12-12 17:02:52 +0000300 const struct switchdev_obj *obj,
301 struct netlink_ext_ack *extack)
Scott Feldman491d0f12015-05-10 09:47:52 -0700302{
303 return -EOPNOTSUPP;
304}
305
306static inline int switchdev_port_obj_del(struct net_device *dev,
Jiri Pirko648b4a92015-10-01 11:03:45 +0200307 const struct switchdev_obj *obj)
Scott Feldman491d0f12015-05-10 09:47:52 -0700308{
309 return -EOPNOTSUPP;
310}
311
Jiri Pirkoebb9a032015-05-10 09:47:46 -0700312static inline int register_switchdev_notifier(struct notifier_block *nb)
Jiri Pirko03bf0c22015-01-15 23:49:36 +0100313{
314 return 0;
315}
316
Jiri Pirkoebb9a032015-05-10 09:47:46 -0700317static inline int unregister_switchdev_notifier(struct notifier_block *nb)
Jiri Pirko03bf0c22015-01-15 23:49:36 +0100318{
319 return 0;
320}
321
Jiri Pirkoebb9a032015-05-10 09:47:46 -0700322static inline int call_switchdev_notifiers(unsigned long val,
323 struct net_device *dev,
Petr Machata66859872019-01-16 23:06:56 +0000324 struct switchdev_notifier_info *info,
325 struct netlink_ext_ack *extack)
Jiri Pirko03bf0c22015-01-15 23:49:36 +0100326{
327 return NOTIFY_DONE;
328}
329
Petr Machataa93e3b12018-11-22 23:28:25 +0000330static inline int
331register_switchdev_blocking_notifier(struct notifier_block *nb)
332{
333 return 0;
334}
335
336static inline int
337unregister_switchdev_blocking_notifier(struct notifier_block *nb)
338{
339 return 0;
340}
341
342static inline int
343call_switchdev_blocking_notifiers(unsigned long val,
344 struct net_device *dev,
Petr Machata479c86d2018-12-12 17:02:54 +0000345 struct switchdev_notifier_info *info,
346 struct netlink_ext_ack *extack)
Petr Machataa93e3b12018-11-22 23:28:25 +0000347{
348 return NOTIFY_DONE;
349}
350
Petr Machataf30f0602018-11-22 23:29:44 +0000351static inline int
352switchdev_handle_port_obj_add(struct net_device *dev,
353 struct switchdev_notifier_port_obj_info *port_obj_info,
354 bool (*check_cb)(const struct net_device *dev),
355 int (*add_cb)(struct net_device *dev,
356 const struct switchdev_obj *obj,
Petr Machata69213512018-12-12 17:02:56 +0000357 struct netlink_ext_ack *extack))
Petr Machataf30f0602018-11-22 23:29:44 +0000358{
359 return 0;
360}
361
362static inline int
363switchdev_handle_port_obj_del(struct net_device *dev,
364 struct switchdev_notifier_port_obj_info *port_obj_info,
365 bool (*check_cb)(const struct net_device *dev),
366 int (*del_cb)(struct net_device *dev,
367 const struct switchdev_obj *obj))
368{
369 return 0;
370}
371
Florian Fainelli1cb33af2019-02-27 11:44:25 -0800372static inline int
373switchdev_handle_port_attr_set(struct net_device *dev,
374 struct switchdev_notifier_port_attr_info *port_attr_info,
375 bool (*check_cb)(const struct net_device *dev),
376 int (*set_cb)(struct net_device *dev,
Vladimir Oltean4c08c582021-02-12 17:15:51 +0200377 const struct switchdev_attr *attr,
378 struct netlink_ext_ack *extack))
Florian Fainelli1cb33af2019-02-27 11:44:25 -0800379{
380 return 0;
381}
Jiri Pirko007f7902014-11-28 14:34:17 +0100382#endif
383
384#endif /* _LINUX_SWITCHDEV_H_ */