public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@toke•dk>
To: David Beckett <david.beckett@netronome•com>, netdev@vger•kernel.org
Subject: Re: [PATCH bpf-next v2 2/2] samples/bpf: Add xdp_sample_pkts example
Date: Wed, 06 Jun 2018 14:28:43 +0200	[thread overview]
Message-ID: <87po14yu84.fsf@toke.dk> (raw)
In-Reply-To: <1448c449-b853-b2df-2654-44c9c52adfe4@netronome.com>

David Beckett <david.beckett@netronome•com> writes:

> On 04/06/18 17:33, Toke Høiland-Jørgensen wrote:
>> +
>> +#define SAMPLE_SIZE 64ul
>> +
> The program currently cannot sample minimum sized packets, as the 4 Byte 
> crc checksum isnt present in ctx,
> may be better to use 60ul sample size to allow for these packets to be 
> processed?

Right. However, this also reminds me that I wanted to make the sampling
size dynamic, so it is possible to dump packets that are smaller than
the configured SAMPLE_SIZE. Will fix :)

>> +	if (data + SAMPLE_SIZE < data_end) {
>> +		/* The XDP perf_event_output handler will use the upper 32 bits
>> +		 * of the flags argument as a number of bytes to include of the
> I may be wrong on this but should this also be <= to allow for packets 
> at SAMPLE_SIZE to be sampled?

Yes, you are right, but that goes away with the change I mentioned above.

-Toke

  reply	other threads:[~2018-06-06 12:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-04 16:33 [PATCH bpf-next v2 1/2] trace_helpers.c: Add helpers to poll multiple perf FDs for events Toke Høiland-Jørgensen
2018-06-04 16:33 ` [PATCH bpf-next v2 2/2] samples/bpf: Add xdp_sample_pkts example Toke Høiland-Jørgensen
2018-06-04 22:32   ` Jakub Kicinski
2018-06-04 23:43     ` Daniel Borkmann
2018-06-05  9:20       ` Toke Høiland-Jørgensen
2018-06-06 11:40   ` David Beckett
2018-06-06 12:28     ` Toke Høiland-Jørgensen [this message]
2018-06-04 22:26 ` [PATCH bpf-next v2 1/2] trace_helpers.c: Add helpers to poll multiple perf FDs for events Jakub Kicinski
2018-06-04 23:42   ` Daniel Borkmann
2018-06-05  9:22     ` Toke Høiland-Jørgensen
2018-06-05  9:27       ` 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=87po14yu84.fsf@toke.dk \
    --to=toke@toke$(echo .)dk \
    --cc=david.beckett@netronome$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /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