@@ -2,6 +2,7 @@
#define IO_URING_TYPES_H
#include <linux/blkdev.h>
+#include <linux/hashtable.h>
#include <linux/task_work.h>
#include <linux/bitmap.h>
#include <linux/llist.h>
@@ -276,6 +277,15 @@ struct io_ring_ctx {
struct xarray personalities;
u32 pers_next;
+#ifdef CONFIG_NET_RX_BUSY_POLL
+ struct list_head napi_list; /* track busy poll napi_id */
+ spinlock_t napi_lock; /* napi_list lock */
+
+ DECLARE_HASHTABLE(napi_ht, 4);
+ unsigned int napi_busy_poll_to; /* napi busy poll default timeout */
+ bool napi_prefer_busy_poll;
+#endif
+
struct {
/*
* We cache a range of free CQEs we can use, once exhausted it
Add the napi fields to the io_ring_ctx data structure. It contains of a list, a hash table and two settings. The settings are the busy poll timeout and prefer busy poll. The list and the hash table operate on the same data structure. The hash table is used when adding elements and the list is used when executing the busy poll loop. Signed-off-by: Stefan Roesch <shr@devkernel.io> --- include/linux/io_uring_types.h | 10 ++++++++++ 1 file changed, 10 insertions(+)