diff options
author | Jakub Kicinski <kuba@kernel.org> | 2024-12-10 18:32:34 -0800 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-12-10 18:32:34 -0800 |
commit | 90da34d146383b56e0e0be1ff03bcaf68221e39e (patch) | |
tree | 63c64074a98fa8303d59a012af7b31f0cb010e05 /net/dsa/user.c | |
parent | 4eb0308d78d3891d7d691f719e262cf908bdcb35 (diff) | |
parent | 53a6d8912372fc23ea82cc7a49eb59047aa0a650 (diff) |
Merge branch 'net-prepare-for-removal-of-net-dev_index_head'
Eric Dumazet says:
====================
net: prepare for removal of net->dev_index_head
This series changes rtnl_fdb_dump, last iterator using net->dev_index_head[]
First patch creates ndo_fdb_dump_context structure, to no longer
assume specific layout for the arguments.
Second patch adopts for_each_netdev_dump() in rtnl_fdb_dump(),
while changing two first fields of ndo_fdb_dump_context.
Third patch removes the padding, thus changing the location
of ctx->fdb_idx now that all users agree on how to retrive it.
After this series, the only users of net->dev_index_head
are __dev_get_by_index() and dev_get_by_index_rcu().
We have to evaluate if switching them to dev_by_index xarray
would be sensible.
v1: https://lore.kernel.org/20241207162248.18536-1-edumazet@google.com/T/#m800755d4b16c7f335927a76d9f52ebd37f7f077c
====================
Link: https://patch.msgid.link/20241209100747.2269613-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/dsa/user.c')
-rw-r--r-- | net/dsa/user.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/dsa/user.c b/net/dsa/user.c index 06c30a9e29ff..c736c019e2af 100644 --- a/net/dsa/user.c +++ b/net/dsa/user.c @@ -515,12 +515,13 @@ dsa_user_port_fdb_do_dump(const unsigned char *addr, u16 vid, bool is_static, void *data) { struct dsa_user_dump_ctx *dump = data; + struct ndo_fdb_dump_context *ctx = (void *)dump->cb->ctx; u32 portid = NETLINK_CB(dump->cb->skb).portid; u32 seq = dump->cb->nlh->nlmsg_seq; struct nlmsghdr *nlh; struct ndmsg *ndm; - if (dump->idx < dump->cb->args[2]) + if (dump->idx < ctx->fdb_idx) goto skip; nlh = nlmsg_put(dump->skb, portid, seq, RTM_NEWNEIGH, |