summaryrefslogtreecommitdiff
path: root/include/net/switchdev.h
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2015-10-14 17:40:51 (GMT)
committerDavid S. Miller <davem@davemloft.net>2015-10-15 13:09:49 (GMT)
commit850d0cbc9171f63f0418afffb0d89a84db927851 (patch)
tree21ecd5e1adb0d14f8c455484d57795d0a86379ea /include/net/switchdev.h
parent0bc05d585d381c30de3fdf955730df31593d2101 (diff)
downloadlinux-850d0cbc9171f63f0418afffb0d89a84db927851.tar.xz
switchdev: remove pointers from switchdev objects
When object is used in deferred work, we cannot use pointers in switchdev object structures because the memory they point at may be already used by someone else. So rather do local copy of the value. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Acked-by: Scott Feldman <sfeldma@gmail.com> Reviewed-by: John Fastabend <john.r.fastabend@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/switchdev.h')
-rw-r--r--include/net/switchdev.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/include/net/switchdev.h b/include/net/switchdev.h
index f7de6f8..f8672d7 100644
--- a/include/net/switchdev.h
+++ b/include/net/switchdev.h
@@ -14,6 +14,7 @@
#include <linux/netdevice.h>
#include <linux/notifier.h>
#include <linux/list.h>
+#include <net/ip_fib.h>
#define SWITCHDEV_F_NO_RECURSE BIT(0)
#define SWITCHDEV_F_SKIP_EOPNOTSUPP BIT(1)
@@ -59,8 +60,6 @@ struct switchdev_attr {
} u;
};
-struct fib_info;
-
enum switchdev_obj_id {
SWITCHDEV_OBJ_ID_UNDEFINED,
SWITCHDEV_OBJ_ID_PORT_VLAN,
@@ -88,7 +87,7 @@ struct switchdev_obj_ipv4_fib {
struct switchdev_obj obj;
u32 dst;
int dst_len;
- struct fib_info *fi;
+ struct fib_info fi;
u8 tos;
u8 type;
u32 nlflags;
@@ -101,7 +100,7 @@ struct switchdev_obj_ipv4_fib {
/* SWITCHDEV_OBJ_ID_PORT_FDB */
struct switchdev_obj_port_fdb {
struct switchdev_obj obj;
- const unsigned char *addr;
+ unsigned char addr[ETH_ALEN];
u16 vid;
u16 ndm_state;
};