From: Stanislav Fomichev <hidden> Date: 2019-10-15 18:31:30
It's useful for implementing EDT related tests (set tstamp, run the
test, see how the tstamp is changed or observe some other parameter).
Note that bpf_ktime_get_ns() helper is using monotonic clock, so for
the BPF programs that compare tstamp against it, tstamp should be
derived from clock_gettime(CLOCK_MONOTONIC, ...).
Signed-off-by: Stanislav Fomichev <redacted>
---
net/bpf/test_run.c | 9 +++++++++
1 file changed, 9 insertions(+)
From: Martin Lau <hidden> Date: 2019-10-15 20:35:41
On Tue, Oct 15, 2019 at 11:31:24AM -0700, Stanislav Fomichev wrote:
It's useful for implementing EDT related tests (set tstamp, run the
test, see how the tstamp is changed or observe some other parameter).
Note that bpf_ktime_get_ns() helper is using monotonic clock, so for
the BPF programs that compare tstamp against it, tstamp should be
derived from clock_gettime(CLOCK_MONOTONIC, ...).
Please provide a cover letter next time. It makes ack-all possible.
Acked-by: Martin KaFai Lau <redacted>
From: Stanislav Fomichev <sdf@fomichev.me> Date: 2019-10-15 20:43:16
On 10/15, Martin Lau wrote:
On Tue, Oct 15, 2019 at 11:31:24AM -0700, Stanislav Fomichev wrote:
quoted
It's useful for implementing EDT related tests (set tstamp, run the
test, see how the tstamp is changed or observe some other parameter).
Note that bpf_ktime_get_ns() helper is using monotonic clock, so for
the BPF programs that compare tstamp against it, tstamp should be
derived from clock_gettime(CLOCK_MONOTONIC, ...).
Please provide a cover letter next time. It makes ack-all possible.
SG, I'll try to add cover letter in the future if that helps.
If I remember correctly, acked-by to the cover letter was not
showing up in the patchwork and people usually do it for each patch
anyway. That's why I didn't bother to do it for this small change.
On Tue, Oct 15, 2019 at 2:26 PM Stanislav Fomichev [off-list ref] wrote:
quoted hunk
It's useful for implementing EDT related tests (set tstamp, run the
test, see how the tstamp is changed or observe some other parameter).
Note that bpf_ktime_get_ns() helper is using monotonic clock, so for
the BPF programs that compare tstamp against it, tstamp should be
derived from clock_gettime(CLOCK_MONOTONIC, ...).
Signed-off-by: Stanislav Fomichev <redacted>
---
net/bpf/test_run.c | 9 +++++++++
1 file changed, 9 insertions(+)
@@ -218,10 +218,18 @@ static int convert___skb_to_skb(struct sk_buff *skb, struct __sk_buff *__skb)if(!range_is_zero(__skb,offsetof(struct__sk_buff,cb)+FIELD_SIZEOF(struct__sk_buff,cb),+offsetof(struct__sk_buff,tstamp)))+return-EINVAL;++/* tstamp is allowed */++if(!range_is_zero(__skb,offsetof(struct__sk_buff,tstamp)++FIELD_SIZEOF(struct__sk_buff,tstamp),
with no context on this particular change whatsoever: isn't this the
same as offsetofend(struct __sk_buff, tstamp)? Same above for cb.
Overall, this seems like the 4th similar check, would it make sense to
add a static array of ranges we want to check for zeros and just loop
over it?..
On Tue, Oct 15, 2019 at 4:15 PM Andrii Nakryiko
[off-list ref] wrote:
On Tue, Oct 15, 2019 at 2:26 PM Stanislav Fomichev [off-list ref] wrote:
quoted
It's useful for implementing EDT related tests (set tstamp, run the
test, see how the tstamp is changed or observe some other parameter).
Note that bpf_ktime_get_ns() helper is using monotonic clock, so for
the BPF programs that compare tstamp against it, tstamp should be
derived from clock_gettime(CLOCK_MONOTONIC, ...).
Signed-off-by: Stanislav Fomichev <redacted>
---
net/bpf/test_run.c | 9 +++++++++
1 file changed, 9 insertions(+)
@@ -218,10 +218,18 @@ static int convert___skb_to_skb(struct sk_buff *skb, struct __sk_buff *__skb)if(!range_is_zero(__skb,offsetof(struct__sk_buff,cb)+FIELD_SIZEOF(struct__sk_buff,cb),+offsetof(struct__sk_buff,tstamp)))+return-EINVAL;++/* tstamp is allowed */++if(!range_is_zero(__skb,offsetof(struct__sk_buff,tstamp)++FIELD_SIZEOF(struct__sk_buff,tstamp),
with no context on this particular change whatsoever: isn't this the
same as offsetofend(struct __sk_buff, tstamp)? Same above for cb.
Overall, this seems like the 4th similar check, would it make sense to
add a static array of ranges we want to check for zeros and just loop
over it?..
I wouldn't bother, but offsetofend() is a good suggestion that
can be done in a followup.
Applied both patches. Thanks
From: Stanislav Fomichev <sdf@fomichev.me> Date: 2019-10-15 23:45:55
On 10/15, Alexei Starovoitov wrote:
On Tue, Oct 15, 2019 at 4:15 PM Andrii Nakryiko
[off-list ref] wrote:
quoted
On Tue, Oct 15, 2019 at 2:26 PM Stanislav Fomichev [off-list ref] wrote:
quoted
It's useful for implementing EDT related tests (set tstamp, run the
test, see how the tstamp is changed or observe some other parameter).
Note that bpf_ktime_get_ns() helper is using monotonic clock, so for
the BPF programs that compare tstamp against it, tstamp should be
derived from clock_gettime(CLOCK_MONOTONIC, ...).
Signed-off-by: Stanislav Fomichev <redacted>
---
net/bpf/test_run.c | 9 +++++++++
1 file changed, 9 insertions(+)
@@ -218,10 +218,18 @@ static int convert___skb_to_skb(struct sk_buff *skb, struct __sk_buff *__skb)if(!range_is_zero(__skb,offsetof(struct__sk_buff,cb)+FIELD_SIZEOF(struct__sk_buff,cb),+offsetof(struct__sk_buff,tstamp)))+return-EINVAL;++/* tstamp is allowed */++if(!range_is_zero(__skb,offsetof(struct__sk_buff,tstamp)++FIELD_SIZEOF(struct__sk_buff,tstamp),
with no context on this particular change whatsoever: isn't this the
same as offsetofend(struct __sk_buff, tstamp)? Same above for cb.
Overall, this seems like the 4th similar check, would it make sense to
add a static array of ranges we want to check for zeros and just loop
over it?..
I wouldn't bother, but offsetofend() is a good suggestion that
can be done in a followup.
Applied both patches. Thanks
Thanks. I'll follow up with offsetofend, sounds like a good suggestion
that can eliminate a bit of copy paste.