Skip to content

Conversation

kernel-patches-daemon-bpf[bot]
Copy link

Pull request for series with
subject: xsk: fix immature cq descriptor production
version: 7
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=997014

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 5aa00f0
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=997014
version: 7

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: c7d19d1
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=997014
version: 7

Eryk reported an issue that I have put under Closes: tag, related to
umem addrs being prematurely produced onto pool's completion queue.
Let us make the skb's destructor responsible for producing all addrs
that given skb used.

Commit from fixes tag introduced the buggy behavior, it was not broken
from day 1, but rather when XSK multi-buffer got introduced.

In order to mitigate performance impact as much as possible, mimic the
linear and frag parts within skb by storing the first address from XSK
descriptor at sk_buff::destructor_arg. For fragments, store them at ::cb
via list. The nodes that will go onto list will be allocated via
kmem_cache. xsk_destruct_skb() will consume address stored at
::destructor_arg and optionally go through list from ::cb, if count of
descriptors associated with this particular skb is bigger than 1.

Previous approach where whole array for storing UMEM addresses from XSK
descriptors was pre-allocated during first fragment processing yielded
too big performance regression for 64b traffic. In current approach
impact is much reduced on my tests and for jumbo frames I observed
traffic being slower by at most 9%.

Magnus suggested to have this way of processing special cased for
XDP_SHARED_UMEM, so we would identify this during bind and set different
hooks for 'backpressure mechanism' on CQ and for skb destructor, but
given that results looked promising on my side I decided to have a
single data path for XSK generic Tx. I suppose other auxiliary stuff
such as helpers introduced in this patch would have to land as well in
order to make it work, so we might have ended up with more noisy diff.

Fixes: b7f72a3 ("xsk: introduce wrappers and helpers for supporting multi-buffer in Tx path")
Reported-by: Eryk Kubanski <[email protected]>
Closes: https://lore.kernel.org/netdev/[email protected]/
Signed-off-by: Maciej Fijalkowski <[email protected]>
@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 71ca59e
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=997014
version: 7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant