public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@redhat•com>
To: Andrii Nakryiko <andrii.nakryiko@gmail•com>
Cc: Alexei Starovoitov <ast@kernel•org>,
	Daniel Borkmann <daniel@iogearbox•net>,
	Andrii Nakryiko <andrii@kernel•org>,
	Martin KaFai Lau <kafai@fb•com>, Song Liu <songliubraving@fb•com>,
	Yonghong Song <yhs@fb•com>,
	John Fastabend <john.fastabend@gmail•com>,
	KP Singh <kpsingh@kernel•org>,
	Stanislav Fomichev <sdf@google•com>,
	"David S. Miller" <davem@davemloft•net>,
	Jesper Dangaard Brouer <brouer@redhat•com>,
	Andrea Arcangeli <aarcange@redhat•com>,
	Clark Williams <williams@redhat•com>, bpf <bpf@vger•kernel.org>,
	Networking <netdev@vger•kernel.org>
Subject: Re: [PATCH bpf v2 2/2] bpf/selftests: test that kernel rejects a TCP CC with an invalid license
Date: Fri, 26 Mar 2021 19:25:53 +0100	[thread overview]
Message-ID: <874kgxbwlq.fsf@toke.dk> (raw)
In-Reply-To: <CAEf4BzaucswGy+LiXQC0q_zgQEOTtRJ3GQtaeq7CwJJW9EzGig@mail.gmail.com>

Andrii Nakryiko <andrii.nakryiko@gmail•com> writes:


>> Ah, thanks! I always get confused about CHECK() as well! Maybe it should
>> be renamed to ASSERT()? But that would require flipping all the if()
>> statements around them as well :/
>
> Exactly, it's the opposite of assert (ASSERT_NOT %-), that
> CHECK(!found) is "assert not not found", right?) and it throws me off
> every. single. time.

Yup, me too, I have to basically infer the right meaning from the
surrounding if statements (i.e., whether it triggers an error path or
not).

> Ideally we complete the set of ASSERT_XXX() macros and convert as much
> as possible to that. We can also have just generic ASSERT() for all
> other complicated cases.

Totally on board with that! I'll try to remember to fix any selftests I
fiddle with (and not introduce any new uses of CHECK() of course).

-Toke


      reply	other threads:[~2021-03-26 18:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-25 21:11 [PATCH bpf v2 1/2] bpf: enforce that struct_ops programs be GPL-only Toke Høiland-Jørgensen
2021-03-25 21:11 ` [PATCH bpf v2 2/2] bpf/selftests: test that kernel rejects a TCP CC with an invalid license Toke Høiland-Jørgensen
2021-03-25 22:58   ` Martin KaFai Lau
2021-03-26  4:04   ` Andrii Nakryiko
2021-03-26  9:43     ` Toke Høiland-Jørgensen
2021-03-26 18:14       ` Andrii Nakryiko
2021-03-26 18:25         ` Toke Høiland-Jørgensen [this message]

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=874kgxbwlq.fsf@toke.dk \
    --to=toke@redhat$(echo .)com \
    --cc=aarcange@redhat$(echo .)com \
    --cc=andrii.nakryiko@gmail$(echo .)com \
    --cc=andrii@kernel$(echo .)org \
    --cc=ast@kernel$(echo .)org \
    --cc=bpf@vger$(echo .)kernel.org \
    --cc=brouer@redhat$(echo .)com \
    --cc=daniel@iogearbox$(echo .)net \
    --cc=davem@davemloft$(echo .)net \
    --cc=john.fastabend@gmail$(echo .)com \
    --cc=kafai@fb$(echo .)com \
    --cc=kpsingh@kernel$(echo .)org \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=sdf@google$(echo .)com \
    --cc=songliubraving@fb$(echo .)com \
    --cc=williams@redhat$(echo .)com \
    --cc=yhs@fb$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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