Subject: Re: [PATCH v2 bpf-next 2/3] selftests/bpf: Add BPF_FIB_LOOKUP_MARK tests

From: Martin KaFai Lau <[email-masked]>
Date: Tue, 26 Mar 2024 14:51:39 -0700

On 3/26/24 3:17 AM, Anton Protopopov wrote:
> +	{ .desc = "IPv4 policy routing, mark points to a policy, but no flag",
> +	  .daddr = IPV4_REMOTE_DST, .expected_ret = BPF_FIB_LKUP_RET_SUCCESS,
> +	  .expected_dst = IPV4_GW1,
> +	  .lookup_flags = BPF_FIB_LOOKUP_SKIP_NEIGH,
> +	  .mark = MARK, },

[ ... ]

> +	{ .desc = "IPv6 policy routing, mark points to a policy, but no flag",
> +	  .daddr = IPV6_REMOTE_DST, .expected_ret = BPF_FIB_LKUP_RET_SUCCESS,
> +	  .expected_dst = IPV6_GW1,
> +	  .lookup_flags = BPF_FIB_LOOKUP_SKIP_NEIGH,
> +	  .mark = MARK, },
>   };

[ ... ]

> @@ -159,6 +221,9 @@ static int set_lookup_params(struct bpf_fib_lookup *params, const struct fib_loo
>   	params->ifindex = ifindex;
>   	params->tbid = test->tbid;
>   
> +	if (test->lookup_flags & BPF_FIB_LOOKUP_MARK)

Removed this "& BPF_FIB_LOOKUP_MARK" test. Always set the params->mark 
regardless of test->lookup_flags. This should be the intention of the above "... 
mark points to a policy, but no flag" tests.

Applied. Thanks.

> +		params->mark = test->mark;
> +