Commit b31f7a8b authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch 'nexthop-various-cleanups'

Ido Schimmel says:

====================
nexthop: Various cleanups

Benefit from recent bug fixes and simplify the nexthop dump code.

No regressions in existing tests:

 # ./fib_nexthops.sh
 [...]
 Tests passed: 234
 Tests failed:   0
====================

Link: https://lore.kernel.org/r/20230813164856.2379822-1-idosch@nvidia.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 1e02d758 db1428f6
...@@ -3209,7 +3209,6 @@ static int rtm_dump_walk_nexthops(struct sk_buff *skb, ...@@ -3209,7 +3209,6 @@ static int rtm_dump_walk_nexthops(struct sk_buff *skb,
return err; return err;
} }
ctx->idx++;
return 0; return 0;
} }
...@@ -3337,7 +3336,6 @@ static int nh_valid_dump_bucket_req(const struct nlmsghdr *nlh, ...@@ -3337,7 +3336,6 @@ static int nh_valid_dump_bucket_req(const struct nlmsghdr *nlh,
struct rtm_dump_res_bucket_ctx { struct rtm_dump_res_bucket_ctx {
struct rtm_dump_nh_ctx nh; struct rtm_dump_nh_ctx nh;
u16 bucket_index; u16 bucket_index;
u32 done_nh_idx; /* 1 + the index of the last fully processed NH. */
}; };
static struct rtm_dump_res_bucket_ctx * static struct rtm_dump_res_bucket_ctx *
...@@ -3366,9 +3364,6 @@ static int rtm_dump_nexthop_bucket_nh(struct sk_buff *skb, ...@@ -3366,9 +3364,6 @@ static int rtm_dump_nexthop_bucket_nh(struct sk_buff *skb,
u16 bucket_index; u16 bucket_index;
int err; int err;
if (dd->ctx->nh.idx < dd->ctx->done_nh_idx)
return 0;
nhg = rtnl_dereference(nh->nh_grp); nhg = rtnl_dereference(nh->nh_grp);
res_table = rtnl_dereference(nhg->res_table); res_table = rtnl_dereference(nhg->res_table);
for (bucket_index = dd->ctx->bucket_index; for (bucket_index = dd->ctx->bucket_index;
...@@ -3395,7 +3390,6 @@ static int rtm_dump_nexthop_bucket_nh(struct sk_buff *skb, ...@@ -3395,7 +3390,6 @@ static int rtm_dump_nexthop_bucket_nh(struct sk_buff *skb,
return err; return err;
} }
dd->ctx->done_nh_idx = dd->ctx->nh.idx + 1;
dd->ctx->bucket_index = 0; dd->ctx->bucket_index = 0;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment