diff options
author | Maciej Fijalkowski <maciej.fijalkowski@intel.com> | 2023-07-19 16:24:04 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-07-19 19:56:49 +0300 |
commit | 1b725b0c8163cfd2d9ab22057df46b487981cfea (patch) | |
tree | 3b92e06efa2c2df4f8c6a64c74f14c9ae2c87416 /include/net/xdp_sock_drv.h | |
parent | b7f72a30e9ac2555b05afc6cfddc9dbc98e1eb8d (diff) | |
download | linux-1b725b0c8163cfd2d9ab22057df46b487981cfea.tar.xz |
xsk: allow core/drivers to test EOP bit
Drivers are used to check for EOP bit whereas AF_XDP operates on
inverted logic - user space indicates that current frag is not the last
one and packet continues. For AF_XDP core needs, add xp_mb_desc() that
will simply test XDP_PKT_CONTD from xdp_desc::options, but in order to
preserve drivers default behavior, introduce an interface for ZC drivers
that will negate xp_mb_desc() result and therefore make it easier to
test EOP bit from during production of HW Tx descriptors.
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Link: https://lore.kernel.org/r/20230719132421.584801-8-maciej.fijalkowski@intel.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/net/xdp_sock_drv.h')
-rw-r--r-- | include/net/xdp_sock_drv.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/net/xdp_sock_drv.h b/include/net/xdp_sock_drv.h index c243f906ebed..0d34cdb5567d 100644 --- a/include/net/xdp_sock_drv.h +++ b/include/net/xdp_sock_drv.h @@ -89,6 +89,11 @@ static inline struct xdp_buff *xsk_buff_alloc(struct xsk_buff_pool *pool) return xp_alloc(pool); } +static inline bool xsk_is_eop_desc(struct xdp_desc *desc) +{ + return !xp_mb_desc(desc); +} + /* Returns as many entries as possible up to max. 0 <= N <= max. */ static inline u32 xsk_buff_alloc_batch(struct xsk_buff_pool *pool, struct xdp_buff **xdp, u32 max) { @@ -241,6 +246,11 @@ static inline struct xdp_buff *xsk_buff_alloc(struct xsk_buff_pool *pool) return NULL; } +static inline bool xsk_is_eop_desc(struct xdp_desc *desc) +{ + return false; +} + static inline u32 xsk_buff_alloc_batch(struct xsk_buff_pool *pool, struct xdp_buff **xdp, u32 max) { return 0; |