bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Björn Töpel" <bjorn.topel@intel.com>
To: "Toke Høiland-Jørgensen" <toke@redhat.com>,
	"Björn Töpel" <bjorn.topel@gmail.com>,
	ast@kernel.org, daniel@iogearbox.net, netdev@vger.kernel.org,
	bpf@vger.kernel.org
Cc: maciej.fijalkowski@intel.com, hawk@kernel.org,
	magnus.karlsson@intel.com, john.fastabend@gmail.com,
	kuba@kernel.org, davem@davemloft.net
Subject: Re: [PATCH bpf-next 1/2] bpf, xdp: per-map bpf_redirect_map functions for XDP
Date: Fri, 19 Feb 2021 18:47:01 +0100	[thread overview]
Message-ID: <b62f3795-0842-95fe-65fc-8b769c77b81c@intel.com> (raw)
In-Reply-To: <87tuq8httg.fsf@toke.dk>

On 2021-02-19 18:05, Toke Høiland-Jørgensen wrote:
> Björn Töpel <bjorn.topel@gmail.com> writes:
> 

[...]


>> @@ -4110,22 +4094,17 @@ static const struct bpf_func_proto bpf_xdp_redirect_proto = {
>>   	.arg2_type      = ARG_ANYTHING,
>>   };
>>   
>> -BPF_CALL_3(bpf_xdp_redirect_map, struct bpf_map *, map, u32, ifindex,
>> -	   u64, flags)
>> +static __always_inline s64 __bpf_xdp_redirect_map(struct bpf_map *map, u32 ifindex, u64 flags,
>> +						  void *lookup_elem(struct bpf_map *map,
>> +								    u32 key))
>>   {
>>   	struct bpf_redirect_info *ri = this_cpu_ptr(&bpf_redirect_info);
>>   
>> -	/* Lower bits of the flags are used as return code on lookup failure */
>>   	if (unlikely(flags > XDP_TX))
>>   		return XDP_ABORTED;
>>   
>> -	ri->tgt_value = __xdp_map_lookup_elem(map, ifindex);
>> +	ri->tgt_value = lookup_elem(map, ifindex);
>>   	if (unlikely(!ri->tgt_value)) {
>> -		/* If the lookup fails we want to clear out the state in the
>> -		 * redirect_info struct completely, so that if an eBPF program
>> -		 * performs multiple lookups, the last one always takes
>> -		 * precedence.
>> -		 */
> 
> Why remove the comments?
>

Ugh, no reason. I'll do a v2. LKP had a warning as well.


Thanks,
Björn

[...]

  reply	other threads:[~2021-02-19 17:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-19 14:59 [PATCH bpf-next 0/2] Optimize bpf_redirect_map()/xdp_do_redirect() Björn Töpel
2021-02-19 14:59 ` [PATCH bpf-next 1/2] bpf, xdp: per-map bpf_redirect_map functions for XDP Björn Töpel
2021-02-19 17:05   ` Toke Høiland-Jørgensen
2021-02-19 17:47     ` Björn Töpel [this message]
2021-02-19 17:08   ` kernel test robot
2021-02-19 18:13   ` kernel test robot
2021-02-19 14:59 ` [PATCH bpf-next 2/2] bpf, xdp: restructure redirect actions Björn Töpel
2021-02-19 17:10   ` Toke Høiland-Jørgensen
2021-02-19 17:49     ` Björn Töpel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b62f3795-0842-95fe-65fc-8b769c77b81c@intel.com \
    --to=bjorn.topel@intel.com \
    --cc=ast@kernel.org \
    --cc=bjorn.topel@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=hawk@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=maciej.fijalkowski@intel.com \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=toke@redhat.com \
    --subject='Re: [PATCH bpf-next 1/2] bpf, xdp: per-map bpf_redirect_map functions for XDP' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).