]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Add support for canceling cached_cons advance
authorLi RongQing <lirongqing@baidu.com>
Tue, 24 Nov 2020 07:21:14 +0000 (15:21 +0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 25 Nov 2020 12:18:47 +0000 (13:18 +0100)
commit994b6fed70c1c8dce1aaf888e383bbabd94ef9f9
tree96e63b5d852f2863129b502775d7da57e0255995
parent7acc674b6437c9b2c16031cca25712ac38a95b34
libbpf: Add support for canceling cached_cons advance

Add a new function for returning descriptors the user received
after an xsk_ring_cons__peek call. After the application has
gotten a number of descriptors from a ring, it might not be able
to or want to process them all for various reasons. Therefore,
it would be useful to have an interface for returning or
cancelling a number of them so that they are returned to the ring.

This patch adds a new function called xsk_ring_cons__cancel that
performs this operation on nb descriptors counted from the end of
the batch of descriptors that was received through the peek call.

Signed-off-by: Li RongQing <lirongqing@baidu.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
[ Magnus Karlsson: rewrote changelog ]
Acked-by: Magnus Karlsson <magnus.karlsson@intel.com>
Link: https://lore.kernel.org/bpf/1606202474-8119-1-git-send-email-lirongqing@baidu.com
tools/lib/bpf/xsk.h