public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Nicolas Schichan <nschichan@freebox.fr>,
	Alexei Starovoitov <ast@plumgrid.com>,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/6] test_bpf: allow tests to specify an skb fragment.
Date: Mon, 03 Aug 2015 17:29:40 +0200	[thread overview]
Message-ID: <55BF88E4.2050307@iogearbox.net> (raw)
In-Reply-To: <1438610528-14245-3-git-send-email-nschichan@freebox.fr>

On 08/03/2015 04:02 PM, Nicolas Schichan wrote:
> This introduce a new test->aux flag (FLAG_SKB_FRAG) to tell the
> populate_skb() function to add a fragment to the test skb containing
> the data specified in test->frag_data).
>
> Signed-off-by: Nicolas Schichan <nschichan@freebox.fr>
> Acked-by: Alexei Starovoitov <ast@plumgrid.com>

Acked-by: Daniel Borkmann <daniel@iogearbox.net>

I'm good with this change here, just a comment below in general.

>   enum {
>   	CLASSIC  = BIT(6),	/* Old BPF instructions only. */
> @@ -81,6 +83,7 @@ struct bpf_test {
>   		__u32 result;
>   	} test[MAX_SUBTESTS];
>   	int (*fill_helper)(struct bpf_test *self);
> +	__u8 frag_data[MAX_DATA];
>   };

We now have 286 tests, which is awesome!

Perhaps, we need to start thinking of a better test description method
soonish as the test_bpf.ko module grew to ~1.6M, i.e. whenever we add
to struct bpf_test, it adds memory overhead upon all test cases.

>   /* Large test cases need separate allocation and fill handler. */
> @@ -4525,6 +4528,10 @@ static struct sk_buff *populate_skb(char *buf, int size)
>
>   static void *generate_test_data(struct bpf_test *test, int sub)
>   {
> +	struct sk_buff *skb;
> +	struct page *page;
> +	void *ptr;
> +
>   	if (test->aux & FLAG_NO_DATA)
>   		return NULL;
>
> @@ -4532,7 +4539,36 @@ static void *generate_test_data(struct bpf_test *test, int sub)
>   	 * subtests generate skbs of different sizes based on
>   	 * the same data.
>   	 */
> -	return populate_skb(test->data, test->test[sub].data_size);
> +	skb = populate_skb(test->data, test->test[sub].data_size);
> +	if (!skb)
> +		return NULL;
> +
> +	if (test->aux & FLAG_SKB_FRAG) {

Really minor nit: declaration of page, ptr could have been only in this block.

  reply	other threads:[~2015-08-03 15:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-03 14:02 [PATCH 0/6] test_bpf improvements Nicolas Schichan
2015-08-03 14:02 ` [PATCH 1/6] test_bpf: avoid oopsing the kernel when generate_test_data() fails Nicolas Schichan
2015-08-03 14:48   ` Daniel Borkmann
2015-08-03 14:02 ` [PATCH 2/6] test_bpf: allow tests to specify an skb fragment Nicolas Schichan
2015-08-03 15:29   ` Daniel Borkmann [this message]
2015-08-03 16:38     ` Nicolas Schichan
2015-08-03 17:37       ` Daniel Borkmann
2015-08-03 14:02 ` [PATCH 3/6] test_bpf: test LD_ABS and LD_IND instructions on fragmented skbs Nicolas Schichan
2015-08-03 15:00   ` Daniel Borkmann
2015-08-03 14:02 ` [PATCH 4/6] test_bpf: add module parameters to filter the tests to run Nicolas Schichan
2015-08-03 15:58   ` Daniel Borkmann
2015-08-03 16:23     ` Nicolas Schichan
2015-08-03 16:34       ` Daniel Borkmann
2015-08-03 14:02 ` [PATCH 5/6] test_bpf: add more tests for LD_ABS and LD_IND Nicolas Schichan
2015-08-03 15:02   ` Daniel Borkmann
2015-08-03 14:02 ` [PATCH 6/6] test_bpf: add tests checking that JIT/interpreter sets A and X to 0 Nicolas Schichan
2015-08-03 15:03   ` Daniel Borkmann

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=55BF88E4.2050307@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=ast@plumgrid.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nschichan@freebox.fr \
    /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