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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZF5e3t+8yWePd1Lj@corigine.com>
Date: Fri, 12 May 2023 17:44:30 +0200
From: Simon Horman <simon.horman@...igine.com>
To: Magnus Karlsson <magnus.karlsson@...il.com>
Cc: magnus.karlsson@...el.com, bjorn@...nel.org, ast@...nel.org,
	daniel@...earbox.net, netdev@...r.kernel.org,
	maciej.fijalkowski@...el.com, bpf@...r.kernel.org, yhs@...com,
	andrii@...nel.org, martin.lau@...ux.dev, song@...nel.org,
	john.fastabend@...il.com, kpsingh@...nel.org, sdf@...gle.com,
	haoluo@...gle.com, jolsa@...nel.org, tirthendu.sarkar@...el.com
Subject: Re: [PATCH bpf-next 06/10] selftests/xsk: store offset in pkt
 instead of addr

On Fri, May 12, 2023 at 11:20:39AM +0200, Magnus Karlsson wrote:
> From: Magnus Karlsson <magnus.karlsson@...el.com>
> 
> Store the offset in struct pkt instead of the address. This is
> important since address is only meaningful in the context of a packet
> that is stored in a single umem buffer and thus a single Tx
> descriptor. If the packet, in contrast need to be represented by
> multiple buffers in the umem, storing the address makes no sense since
> the packet will consist of multiple buffers in the umem at various
> addresses. This change is in preparation for the upcoming
> multi-buffer support in AF_XDP and the corresponding tests.
> 
> So instead of indicating the address, we instead indicate the offset
> of the packet in the first buffer. The actual address of the buffer is
> allocated from the umem with a new function called
> umem_alloc_buffer(). This also means we can get rid of the
> use_fill_for_addr flag as the addresses fed into the fill ring will
> always be the offset from the pkt specification in the packet stream
> plus the address of the allocated buffer from the umem. No special
> casing needed.
> 
> Signed-off-by: Magnus Karlsson <magnus.karlsson@...el.com>

...

> @@ -1543,9 +1569,8 @@ static bool testapp_unaligned(struct test_spec *test)
>  	test_spec_set_name(test, "UNALIGNED_MODE");
>  	test->ifobj_tx->umem->unaligned_mode = true;
>  	test->ifobj_rx->umem->unaligned_mode = true;
> -	/* Let half of the packets straddle a buffer boundrary */
> +	/* Let half of the packets straddle a 4K buffer boundrary */

nit: if you need to respin for some other reason, then while you are
     changing this line, perhaps s/boundrary/boundary/

>  	pkt_stream_replace_half(test, MIN_PKT_SIZE, -MIN_PKT_SIZE / 2);
> -	test->ifobj_rx->pkt_stream->use_addr_for_fill = true;
>  	testapp_validate_traffic(test);
>  
>  	return true;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ