aboutsummaryrefslogtreecommitdiffstats
path: root/net/switchdev
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>2015-09-29 12:07:14 -0400
committerDavid S. Miller <davem@davemloft.net>2015-09-30 00:31:59 -0400
commite02a06b2a7c6e8b43c60ed8e0181172231af13d7 (patch)
tree39b1c8ce892da55be97c2dead2fa046dad516ddd /net/switchdev
parente23b002b23dfdcd12ca982fbc57dcb071a1fee62 (diff)
net: switchdev: move dev in switchdev_fdb_dump
The FDB dump callback requires the related net_device so move it to the struct switchdev_fdb_dump superset instead of using a callback param. With this done, it'll be simpler to change the dump function signature. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/switchdev')
-rw-r--r--net/switchdev/switchdev.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
index 56d34edc7442..c0e2047f8984 100644
--- a/net/switchdev/switchdev.c
+++ b/net/switchdev/switchdev.c
@@ -858,6 +858,7 @@ EXPORT_SYMBOL_GPL(switchdev_port_fdb_del);
858 858
859struct switchdev_fdb_dump { 859struct switchdev_fdb_dump {
860 struct switchdev_obj obj; 860 struct switchdev_obj obj;
861 struct net_device *dev;
861 struct sk_buff *skb; 862 struct sk_buff *skb;
862 struct netlink_callback *cb; 863 struct netlink_callback *cb;
863 int idx; 864 int idx;
@@ -887,7 +888,7 @@ static int switchdev_port_fdb_dump_cb(struct net_device *dev,
887 ndm->ndm_pad2 = 0; 888 ndm->ndm_pad2 = 0;
888 ndm->ndm_flags = NTF_SELF; 889 ndm->ndm_flags = NTF_SELF;
889 ndm->ndm_type = 0; 890 ndm->ndm_type = 0;
890 ndm->ndm_ifindex = dev->ifindex; 891 ndm->ndm_ifindex = dump->dev->ifindex;
891 ndm->ndm_state = obj->u.fdb.ndm_state; 892 ndm->ndm_state = obj->u.fdb.ndm_state;
892 893
893 if (nla_put(dump->skb, NDA_LLADDR, ETH_ALEN, obj->u.fdb.addr)) 894 if (nla_put(dump->skb, NDA_LLADDR, ETH_ALEN, obj->u.fdb.addr))
@@ -927,6 +928,7 @@ int switchdev_port_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb,
927 .id = SWITCHDEV_OBJ_PORT_FDB, 928 .id = SWITCHDEV_OBJ_PORT_FDB,
928 .cb = switchdev_port_fdb_dump_cb, 929 .cb = switchdev_port_fdb_dump_cb,
929 }, 930 },
931 .dev = dev,
930 .skb = skb, 932 .skb = skb,
931 .cb = cb, 933 .cb = cb,
932 .idx = idx, 934 .idx = idx,