From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Roman Gushchin <guro@fb.com>
Cc: netdev@vger.kernel.org, Song Liu <songliubraving@fb.com>,
linux-kernel@vger.kernel.org, kernel-team@fb.com,
Daniel Borkmann <daniel@iogearbox.net>,
Alexei Starovoitov <ast@kernel.org>
Subject: Re: [PATCH v3 bpf-next 10/10] selftests/bpf: cgroup local storage-based network counters
Date: Fri, 28 Sep 2018 12:28:16 +0200 [thread overview]
Message-ID: <20180928102814.voj6bsuslxh6ms37@ast-mbp.dhcp.thefacebook.com> (raw)
In-Reply-To: <20180928100817.GC9018@castle.DHCP.thefacebook.com>
On Fri, Sep 28, 2018 at 11:08:29AM +0100, Roman Gushchin wrote:
> > > + /* Some packets can be still in per-cpu cache, but not more than
> > > + * MAX_PERCPU_PACKETS.
> > > + */
> > > + packets = netcnt.packets;
> > > + for (cpu = 0; cpu < nproc; cpu++) {
> > > + if (percpu_netcnt[cpu].packets > 32) {
> >
> > pls use MAX_PERCPU_PACKETS in the above check.
> > could you also double check that if that #define is changed to 1k or so
> > the exact "!= 10000" check below still works as expected?
>
> Do you mean adding a new test with a different MAX_PERCPU_PACKETS?
good idea! If it's easy to compile the same source twice with different
MAX_PERCPU_PACKETS that would certainly make the test stronger.
Not sure how feasible though.
>
> >
> > > + printf("Unexpected percpu value: %llu\n",
> > > + percpu_netcnt[cpu].packets);
> > > + goto err;
> >
> > > + }
> > > +
> > > + packets += percpu_netcnt[cpu].packets;
> > > + }
> > > +
> > > + /* No packets should be lost */
> > > + if (packets != 10000) {
> > > + printf("Unexpected packet count: %lu\n", packets);
> > > + goto err;
> > > + }
> > > +
> > > + /* Let's check that bytes counter value is reasonable */
> > > + if (netcnt.bytes < packets * 500 || netcnt.bytes > packets * 1500) {
> >
> > since packet count is accurate why byte count would vary ?
>
> Tbh I'm not sure if the size of the packet here can vary depending
> on the environment. Is there a nice way to get the expected size?
ping packets should be fixed size depending on v4 vs v6.
If 'ping -6' is used, it will force ipv6.
next prev parent reply other threads:[~2018-09-28 10:28 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-26 11:33 [PATCH v3 bpf-next 00/10] bpf: per-cpu cgroup local storage Roman Gushchin
2018-09-26 11:33 ` [PATCH v3 bpf-next 01/10] bpf: extend cgroup bpf core to allow multiple cgroup storage types Roman Gushchin
2018-09-26 11:33 ` [PATCH v3 bpf-next 02/10] bpf: rework cgroup storage pointer passing Roman Gushchin
2018-09-26 11:33 ` [PATCH v3 bpf-next 03/10] bpf: introduce per-cpu cgroup local storage Roman Gushchin
2018-09-26 16:13 ` Song Liu
2018-09-28 8:45 ` Alexei Starovoitov
2018-09-28 10:03 ` Roman Gushchin
2018-09-28 10:25 ` Alexei Starovoitov
2018-09-28 12:03 ` Daniel Borkmann
2018-09-26 11:33 ` [PATCH v3 bpf-next 04/10] bpf: don't allow create maps of per-cpu cgroup local storages Roman Gushchin
2018-09-26 11:33 ` [PATCH v3 bpf-next 05/10] bpf: sync include/uapi/linux/bpf.h to tools/include/uapi/linux/bpf.h Roman Gushchin
2018-09-26 11:33 ` [PATCH v3 bpf-next 06/10] bpftool: add support for PERCPU_CGROUP_STORAGE maps Roman Gushchin
2018-09-26 11:33 ` [PATCH v3 bpf-next 07/10] selftests/bpf: add verifier per-cpu cgroup storage tests Roman Gushchin
2018-09-26 11:33 ` [PATCH v3 bpf-next 08/10] selftests/bpf: extend the storage test to test per-cpu cgroup storage Roman Gushchin
2018-09-26 11:33 ` [PATCH v3 bpf-next 09/10] samples/bpf: extend test_cgrp2_attach2 test to use " Roman Gushchin
2018-09-26 11:33 ` [PATCH v3 bpf-next 10/10] selftests/bpf: cgroup local storage-based network counters Roman Gushchin
2018-09-28 8:53 ` Alexei Starovoitov
2018-09-28 10:08 ` Roman Gushchin
2018-09-28 10:28 ` Alexei Starovoitov [this message]
2018-09-28 10:37 ` Roman Gushchin
2018-09-28 10:40 ` Alexei Starovoitov
2018-09-27 21:13 ` [PATCH v3 bpf-next 00/10] bpf: per-cpu cgroup local storage 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=20180928102814.voj6bsuslxh6ms37@ast-mbp.dhcp.thefacebook.com \
--to=alexei.starovoitov@gmail.com \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=guro@fb.com \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=songliubraving@fb.com \
/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).