Magnus Karlsson | 423f383 | 2018-05-02 13:01:24 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 |
| 2 | * XDP user-space ring structure |
| 3 | * Copyright(c) 2018 Intel Corporation. |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify it |
| 6 | * under the terms and conditions of the GNU General Public License, |
| 7 | * version 2, as published by the Free Software Foundation. |
| 8 | * |
| 9 | * This program is distributed in the hope it will be useful, but WITHOUT |
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 12 | * more details. |
| 13 | */ |
| 14 | |
| 15 | #ifndef _LINUX_XSK_QUEUE_H |
| 16 | #define _LINUX_XSK_QUEUE_H |
| 17 | |
| 18 | #include <linux/types.h> |
| 19 | #include <linux/if_xdp.h> |
| 20 | |
| 21 | #include "xdp_umem_props.h" |
| 22 | |
| 23 | struct xsk_queue { |
| 24 | struct xdp_umem_props umem_props; |
| 25 | u32 ring_mask; |
| 26 | u32 nentries; |
| 27 | u32 prod_head; |
| 28 | u32 prod_tail; |
| 29 | u32 cons_head; |
| 30 | u32 cons_tail; |
| 31 | struct xdp_ring *ring; |
| 32 | u64 invalid_descs; |
| 33 | }; |
| 34 | |
Magnus Karlsson | 965a9909 | 2018-05-02 13:01:26 +0200 | [diff] [blame^] | 35 | void xskq_set_umem(struct xsk_queue *q, struct xdp_umem_props *umem_props); |
Björn Töpel | b9b6b68 | 2018-05-02 13:01:25 +0200 | [diff] [blame] | 36 | struct xsk_queue *xskq_create(u32 nentries, bool umem_queue); |
Magnus Karlsson | 423f383 | 2018-05-02 13:01:24 +0200 | [diff] [blame] | 37 | void xskq_destroy(struct xsk_queue *q); |
| 38 | |
| 39 | #endif /* _LINUX_XSK_QUEUE_H */ |