lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5655574a-71b5-79df-890e-81f3bd5e1cc2@redhat.com>
Date:   Tue, 21 Mar 2023 14:29:04 +0100
From:   Jesper Dangaard Brouer <jbrouer@...hat.com>
To:     Stanislav Fomichev <sdf@...gle.com>
Cc:     brouer@...hat.com, bpf@...r.kernel.org, netdev@...r.kernel.org,
        martin.lau@...nel.org, ast@...nel.org, daniel@...earbox.net,
        alexandr.lobakin@...el.com, larysa.zaremba@...el.com,
        xdp-hints@...-project.net, anthony.l.nguyen@...el.com,
        yoong.siang.song@...el.com, boon.leong.ong@...el.com
Subject: Re: [PATCH bpf-next V1 3/7] selftests/bpf: xdp_hw_metadata track more
 timestamps


On 17/03/2023 22.09, Stanislav Fomichev wrote:
>> diff --git a/tools/testing/selftests/bpf/progs/xdp_hw_metadata.c 
>> b/tools/testing/selftests/bpf/progs/xdp_hw_metadata.c
>> index 4c55b4d79d3d..f2a3b70a9882 100644
>> --- a/tools/testing/selftests/bpf/progs/xdp_hw_metadata.c
>> +++ b/tools/testing/selftests/bpf/progs/xdp_hw_metadata.c
>> @@ -69,9 +69,11 @@ int rx(struct xdp_md *ctx)
>>           return XDP_PASS;
>>       }
> 
>> -    if (!bpf_xdp_metadata_rx_timestamp(ctx, &meta->rx_timestamp))
>> -        bpf_printk("populated rx_timestamp with %llu", meta->rx_timestamp);
>> -    else
>> +    if (!bpf_xdp_metadata_rx_timestamp(ctx, &meta->rx_timestamp)) {
>> +        meta->xdp_timestamp = bpf_ktime_get_tai_ns();
>> +        bpf_printk("populated rx_timestamp with  %llu", meta->rx_timestamp);
>> +        bpf_printk("populated xdp_timestamp with %llu", meta->xdp_timestamp);
>> +    } else
>>           meta->rx_timestamp = 0; /* Used by AF_XDP as not avail signal */
> 
> Nit: curly braces around else {} block as well?

Good point, fixed in V2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ