Re: [PATCH bpf-next 06/10] selftests/xsk: store offset in pkt instead of addr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 12, 2023 at 11:20:39AM +0200, Magnus Karlsson wrote:
> From: Magnus Karlsson <magnus.karlsson@xxxxxxxxx>
> 
> 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@xxxxxxxxx>

...

> @@ -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;




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux