On 1/28/21 5:49 AM, Petr Machata wrote:
> Requests to dump nexthops have many attributes in common with those that
> requests to dump buckets of resilient NH groups will have. In order to make
> reuse of this code simpler, convert the code to use a single structure with
> filtering configuration instead of passing around the parameters one by
> one.
> 
> Signed-off-by: Petr Machata <pe...@nvidia.com>
> Reviewed-by: Ido Schimmel <ido...@nvidia.com>
> ---
>  net/ipv4/nexthop.c | 44 ++++++++++++++++++++++++--------------------
>  1 file changed, 24 insertions(+), 20 deletions(-)
> 
> diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c
> index 7149b12c4703..ad48e5d71bf9 100644
> --- a/net/ipv4/nexthop.c
> +++ b/net/ipv4/nexthop.c
> @@ -1971,16 +1971,23 @@ static int rtm_get_nexthop(struct sk_buff *in_skb, 
> struct nlmsghdr *nlh,
>       goto out;
>  }
>  
> -static bool nh_dump_filtered(struct nexthop *nh, int dev_idx, int master_idx,
> -                          bool group_filter, u8 family)
> +struct nh_dump_filter {
> +     int dev_idx;
> +     int master_idx;
> +     bool group_filter;
> +     bool fdb_filter;
> +};
> +

I should have made that a struct from the beginning.

Reviewed-by: David Ahern <dsah...@kernel.org>

Reply via email to