Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1235343 > unrolled thread

[PATCH v2 net-next 2/6] net: switchdev: move dev in switchdev_fdb_dump

Started byVivien Didelot <vivien.didelot@savoirfairelinux.com>
First post2015-09-29 18:10 +0200
Last post2015-09-29 18:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 net-next 2/6] net: switchdev: move dev in switchdev_fdb_dump Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2015-09-29 18:10 +0200

#1235343 — [PATCH v2 net-next 2/6] net: switchdev: move dev in switchdev_fdb_dump

FromVivien Didelot <vivien.didelot@savoirfairelinux.com>
Date2015-09-29 18:10 +0200
Subject[PATCH v2 net-next 2/6] net: switchdev: move dev in switchdev_fdb_dump
Message-ID<qe5Dz-2XB-1@gated-at.bofh.it>
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>
---
 net/switchdev/switchdev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
index 56d34ed..c0e2047 100644
--- a/net/switchdev/switchdev.c
+++ b/net/switchdev/switchdev.c
@@ -858,6 +858,7 @@ EXPORT_SYMBOL_GPL(switchdev_port_fdb_del);
 
 struct switchdev_fdb_dump {
 	struct switchdev_obj obj;
+	struct net_device *dev;
 	struct sk_buff *skb;
 	struct netlink_callback *cb;
 	int idx;
@@ -887,7 +888,7 @@ static int switchdev_port_fdb_dump_cb(struct net_device *dev,
 	ndm->ndm_pad2    = 0;
 	ndm->ndm_flags   = NTF_SELF;
 	ndm->ndm_type    = 0;
-	ndm->ndm_ifindex = dev->ifindex;
+	ndm->ndm_ifindex = dump->dev->ifindex;
 	ndm->ndm_state   = obj->u.fdb.ndm_state;
 
 	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,
 			.cb = switchdev_port_fdb_dump_cb,
 		},
+		.dev = dev,
 		.skb = skb,
 		.cb = cb,
 		.idx = idx,
-- 
2.6.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web