From: Pete Heist <pete@heistp.net>
To: "Toke Høiland-Jørgensen" <toke@toke.dk>
Cc: Jonathan Morton <chromatix99@gmail.com>,
Cake List <cake@lists.bufferbloat.net>
Subject: Re: [Cake] issue with Cake and bpf filter
Date: Wed, 22 Aug 2018 12:32:41 +0200 [thread overview]
Message-ID: <5D0CA99B-C471-4CA2-BBF4-CDF573262F2F@heistp.net> (raw)
In-Reply-To: <87in4290ae.fsf@toke.dk>
> On Aug 22, 2018, at 12:13 PM, Toke Høiland-Jørgensen <toke@toke.dk> wrote:
>
> Jonathan Morton <chromatix99@gmail.com> writes:
>
>>> On 22 Aug, 2018, at 12:51 pm, Pete Heist <pete@heistp.net> wrote:
>>>
>>> "math between pkt pointer and 4294901760 is not allowed"
>>
>> As a possible clue here, 4294901760 == (2^32) - (2^16).
>>
>> I suspect both errors are being caused by the call to memcpy(). This
>> potentially inlines a substantial amount of code which may not be
>> eBPF-clean.
>
> Yeah, I think this is a good guess. You could try using
> __builtin_memcpy() instead; that may do fewer pointer shenanigans than
> the function-header-defined one...
Thanks for those ideas. It sounded good to me too, but __builtin_memcpy does the same, as does replacing memcpy with a manually unrolled loop (committed as IPV6_SUPPORT_V3).
Backing up, I’m not even sure why I have to put the IPv6 address on the stack. For IPv4, I just have a pointer to a “struct iphdr” set at an offset from head, not on the stack at all, and it works fine to reference &ip4->daddr directly. For IPv6 (IPV6_SUPPORT_V1), it doesn’t. I have to look at that (2^32) - (2^16) value, seems key, and I might find some clues in the example Dave sent. Or understand the bytecode… :)
prev parent reply other threads:[~2018-08-22 10:32 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-12 8:17 Pete Heist
2018-08-12 10:23 ` Pete Heist
2018-08-12 13:41 ` Jonathan Morton
2018-08-12 19:42 ` Toke Høiland-Jørgensen
2018-08-12 21:34 ` Jonathan Morton
2018-08-13 0:21 ` Jonathan Morton
2018-08-13 5:44 ` Jonathan Morton
2018-08-13 11:01 ` Toke Høiland-Jørgensen
2018-08-21 11:25 ` Toke Høiland-Jørgensen
2018-08-21 21:06 ` Pete Heist
2018-08-21 21:17 ` Toke Høiland-Jørgensen
2018-08-21 21:46 ` Pete Heist
2018-08-22 9:49 ` Toke Høiland-Jørgensen
2018-08-22 9:41 ` Toke Høiland-Jørgensen
2018-08-22 6:17 ` Jonathan Morton
2018-08-22 9:30 ` Pete Heist
2018-08-22 9:37 ` Toke Høiland-Jørgensen
2018-08-22 9:51 ` Pete Heist
2018-08-22 10:00 ` Jonathan Morton
2018-08-22 10:13 ` Toke Høiland-Jørgensen
2018-08-22 10:32 ` Pete Heist [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
List information: https://lists.bufferbloat.net/postorius/lists/cake.lists.bufferbloat.net/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5D0CA99B-C471-4CA2-BBF4-CDF573262F2F@heistp.net \
--to=pete@heistp.net \
--cc=cake@lists.bufferbloat.net \
--cc=chromatix99@gmail.com \
--cc=toke@toke.dk \
/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