netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: netdev@vger.kernel.org,
	Jesper Dangaard Brouer <brouer@redhat.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Alexei Starovoitov <ast@kernel.org>,
	David Miller <davem@davemloft.net>,
	Jonathan Lemon <jonathan.lemon@gmail.com>
Subject: Re: [PATCH bpf-next v3 2/3] bpf_xdp_redirect_map: Perform map lookup in eBPF helper
Date: Wed, 12 Jun 2019 11:49:17 +0200	[thread overview]
Message-ID: <87k1drf80y.fsf@toke.dk> (raw)
In-Reply-To: <20190611144818.7cf159c3@cakuba.netronome.com>

Jakub Kicinski <jakub.kicinski@netronome.com> writes:

> On Tue, 11 Jun 2019 17:44:00 +0200, Toke Høiland-Jørgensen wrote:
>> +#define XDP_REDIRECT_INVALID_MASK (XDP_ABORTED | XDP_DROP | XDP_PASS | XDP_TX)
>
> It feels a little strange to OR in values which are not bits, even if
> it happens to work today (since those are values of 0, 1, 2, 3)...

Yeah, I agree. But it also nicely expresses the extent in code.
Otherwise that would need to be in a comment, like

// we allow return codes of ABORTED/DROP/PASS/TX
#define XDP_REDIRECT_INVALID_MASK 3


Or do you have a better idea?

-Toke

  reply	other threads:[~2019-06-12  9:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-11 15:44 [PATCH bpf-next v3 0/3] xdp: Allow lookup into devmaps before redirect Toke Høiland-Jørgensen
2019-06-11 15:44 ` [PATCH bpf-next v3 3/3] devmap: Allow map lookups from eBPF Toke Høiland-Jørgensen
2019-06-11 15:44 ` [PATCH bpf-next v3 1/3] devmap/cpumap: Use flush list instead of bitmap Toke Høiland-Jørgensen
2019-06-13  5:51   ` Andrii Nakryiko
2019-06-13 11:02     ` Toke Høiland-Jørgensen
2019-06-11 15:44 ` [PATCH bpf-next v3 2/3] bpf_xdp_redirect_map: Perform map lookup in eBPF helper Toke Høiland-Jørgensen
2019-06-11 18:00   ` Jesper Dangaard Brouer
2019-06-11 18:17     ` Toke Høiland-Jørgensen
2019-06-12 20:01       ` Maciej Fijalkowski
2019-06-12 21:33         ` Toke Høiland-Jørgensen
2019-06-11 21:48   ` Jakub Kicinski
2019-06-12  9:49     ` Toke Høiland-Jørgensen [this message]
2019-06-12 19:45       ` Jakub Kicinski

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=87k1drf80y.fsf@toke.dk \
    --to=toke@redhat.com \
    --cc=ast@kernel.org \
    --cc=brouer@redhat.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=jakub.kicinski@netronome.com \
    --cc=jonathan.lemon@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).