Commit e02a06b2 authored by Vivien Didelot's avatar Vivien Didelot Committed by David S. Miller
Browse files

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: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e23b002b
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -858,6 +858,7 @@ EXPORT_SYMBOL_GPL(switchdev_port_fdb_del);


struct switchdev_fdb_dump {
struct switchdev_fdb_dump {
	struct switchdev_obj obj;
	struct switchdev_obj obj;
	struct net_device *dev;
	struct sk_buff *skb;
	struct sk_buff *skb;
	struct netlink_callback *cb;
	struct netlink_callback *cb;
	int idx;
	int idx;
@@ -887,7 +888,7 @@ static int switchdev_port_fdb_dump_cb(struct net_device *dev,
	ndm->ndm_pad2    = 0;
	ndm->ndm_pad2    = 0;
	ndm->ndm_flags   = NTF_SELF;
	ndm->ndm_flags   = NTF_SELF;
	ndm->ndm_type    = 0;
	ndm->ndm_type    = 0;
	ndm->ndm_ifindex = dev->ifindex;
	ndm->ndm_ifindex = dump->dev->ifindex;
	ndm->ndm_state   = obj->u.fdb.ndm_state;
	ndm->ndm_state   = obj->u.fdb.ndm_state;


	if (nla_put(dump->skb, NDA_LLADDR, ETH_ALEN, obj->u.fdb.addr))
	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,
			.id = SWITCHDEV_OBJ_PORT_FDB,
			.id = SWITCHDEV_OBJ_PORT_FDB,
			.cb = switchdev_port_fdb_dump_cb,
			.cb = switchdev_port_fdb_dump_cb,
		},
		},
		.dev = dev,
		.skb = skb,
		.skb = skb,
		.cb = cb,
		.cb = cb,
		.idx = idx,
		.idx = idx,