2020-05-21 03:20:51 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
/* Interface for implementing AF_XDP zero-copy support in drivers.
|
|
|
|
* Copyright(c) 2020 Intel Corporation.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _LINUX_XDP_SOCK_DRV_H
|
|
|
|
#define _LINUX_XDP_SOCK_DRV_H
|
|
|
|
|
|
|
|
#include <net/xdp_sock.h>
|
2020-05-21 03:20:53 +08:00
|
|
|
#include <net/xsk_buff_pool.h>
|
2020-05-21 03:20:51 +08:00
|
|
|
|
|
|
|
#ifdef CONFIG_XDP_SOCKETS
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
void xsk_tx_completed(struct xsk_buff_pool *pool, u32 nb_entries);
|
|
|
|
bool xsk_tx_peek_desc(struct xsk_buff_pool *pool, struct xdp_desc *desc);
|
2022-01-26 00:04:43 +08:00
|
|
|
u32 xsk_tx_peek_release_desc_batch(struct xsk_buff_pool *pool, u32 max);
|
2020-08-28 16:26:16 +08:00
|
|
|
void xsk_tx_release(struct xsk_buff_pool *pool);
|
|
|
|
struct xsk_buff_pool *xsk_get_pool_from_qid(struct net_device *dev,
|
|
|
|
u16 queue_id);
|
|
|
|
void xsk_set_rx_need_wakeup(struct xsk_buff_pool *pool);
|
|
|
|
void xsk_set_tx_need_wakeup(struct xsk_buff_pool *pool);
|
|
|
|
void xsk_clear_rx_need_wakeup(struct xsk_buff_pool *pool);
|
|
|
|
void xsk_clear_tx_need_wakeup(struct xsk_buff_pool *pool);
|
|
|
|
bool xsk_uses_need_wakeup(struct xsk_buff_pool *pool);
|
2020-05-21 03:20:51 +08:00
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline u32 xsk_pool_get_headroom(struct xsk_buff_pool *pool)
|
2020-05-21 03:20:53 +08:00
|
|
|
{
|
2020-08-28 16:26:16 +08:00
|
|
|
return XDP_PACKET_HEADROOM + pool->headroom;
|
2020-05-21 03:20:53 +08:00
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline u32 xsk_pool_get_chunk_size(struct xsk_buff_pool *pool)
|
2020-05-21 03:20:53 +08:00
|
|
|
{
|
2020-08-28 16:26:16 +08:00
|
|
|
return pool->chunk_size;
|
2020-05-21 03:20:53 +08:00
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline u32 xsk_pool_get_rx_frame_size(struct xsk_buff_pool *pool)
|
2020-05-21 03:20:53 +08:00
|
|
|
{
|
2020-08-28 16:26:16 +08:00
|
|
|
return xsk_pool_get_chunk_size(pool) - xsk_pool_get_headroom(pool);
|
2020-05-21 03:20:53 +08:00
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline void xsk_pool_set_rxq_info(struct xsk_buff_pool *pool,
|
2020-05-21 03:20:53 +08:00
|
|
|
struct xdp_rxq_info *rxq)
|
|
|
|
{
|
2020-08-28 16:26:16 +08:00
|
|
|
xp_set_rxq_info(pool, rxq);
|
2020-05-21 03:20:53 +08:00
|
|
|
}
|
|
|
|
|
2022-07-07 21:08:42 +08:00
|
|
|
static inline unsigned int xsk_pool_get_napi_id(struct xsk_buff_pool *pool)
|
|
|
|
{
|
|
|
|
#ifdef CONFIG_NET_RX_BUSY_POLL
|
|
|
|
return pool->heads[0].xdp.rxq->napi_id;
|
|
|
|
#else
|
|
|
|
return 0;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline void xsk_pool_dma_unmap(struct xsk_buff_pool *pool,
|
2020-05-21 03:20:53 +08:00
|
|
|
unsigned long attrs)
|
|
|
|
{
|
2020-08-28 16:26:16 +08:00
|
|
|
xp_dma_unmap(pool, attrs);
|
2020-05-21 03:20:53 +08:00
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline int xsk_pool_dma_map(struct xsk_buff_pool *pool,
|
|
|
|
struct device *dev, unsigned long attrs)
|
2020-05-21 03:20:53 +08:00
|
|
|
{
|
2020-08-28 16:26:16 +08:00
|
|
|
struct xdp_umem *umem = pool->umem;
|
|
|
|
|
|
|
|
return xp_dma_map(pool, dev, attrs, umem->pgs, umem->npgs);
|
2020-05-21 03:20:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline dma_addr_t xsk_buff_xdp_get_dma(struct xdp_buff *xdp)
|
|
|
|
{
|
|
|
|
struct xdp_buff_xsk *xskb = container_of(xdp, struct xdp_buff_xsk, xdp);
|
|
|
|
|
|
|
|
return xp_get_dma(xskb);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline dma_addr_t xsk_buff_xdp_get_frame_dma(struct xdp_buff *xdp)
|
|
|
|
{
|
|
|
|
struct xdp_buff_xsk *xskb = container_of(xdp, struct xdp_buff_xsk, xdp);
|
|
|
|
|
|
|
|
return xp_get_frame_dma(xskb);
|
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline struct xdp_buff *xsk_buff_alloc(struct xsk_buff_pool *pool)
|
2020-05-21 03:20:53 +08:00
|
|
|
{
|
2020-08-28 16:26:16 +08:00
|
|
|
return xp_alloc(pool);
|
2020-05-21 03:20:53 +08:00
|
|
|
}
|
|
|
|
|
xsk: Batched buffer allocation for the pool
Add a new driver interface xsk_buff_alloc_batch() offering batched
buffer allocations to improve performance. The new interface takes
three arguments: the buffer pool to allocated from, a pointer to an
array of struct xdp_buff pointers which will contain pointers to the
allocated xdp_buffs, and an unsigned integer specifying the max number
of buffers to allocate. The return value is the actual number of
buffers that the allocator managed to allocate and it will be in the
range 0 <= N <= max, where max is the third parameter to the function.
u32 xsk_buff_alloc_batch(struct xsk_buff_pool *pool, struct xdp_buff **xdp,
u32 max);
A second driver interface is also introduced that need to be used in
conjunction with xsk_buff_alloc_batch(). It is a helper that sets the
size of struct xdp_buff and is used by the NIC Rx irq routine when
receiving a packet. This helper sets the three struct members data,
data_meta, and data_end. The two first ones is in the xsk_buff_alloc()
case set in the allocation routine and data_end is set when a packet
is received in the receive irq function. This unfortunately leads to
worse performance since the xdp_buff is touched twice with a long time
period in between leading to an extra cache miss. Instead, we fill out
the xdp_buff with all 3 fields at one single point in time in the
driver, when the size of the packet is known. Hence this helper. Note
that the driver has to use this helper (or set all three fields
itself) when using xsk_buff_alloc_batch(). xsk_buff_alloc() works as
before and does not require this.
void xsk_buff_set_size(struct xdp_buff *xdp, u32 size);
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20210922075613.12186-3-magnus.karlsson@gmail.com
2021-09-22 15:56:02 +08:00
|
|
|
/* 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)
|
|
|
|
{
|
|
|
|
return xp_alloc_batch(pool, xdp, max);
|
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline bool xsk_buff_can_alloc(struct xsk_buff_pool *pool, u32 count)
|
2020-05-21 03:20:53 +08:00
|
|
|
{
|
2020-08-28 16:26:16 +08:00
|
|
|
return xp_can_alloc(pool, count);
|
2020-05-21 03:20:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline void xsk_buff_free(struct xdp_buff *xdp)
|
|
|
|
{
|
|
|
|
struct xdp_buff_xsk *xskb = container_of(xdp, struct xdp_buff_xsk, xdp);
|
|
|
|
|
|
|
|
xp_free(xskb);
|
|
|
|
}
|
|
|
|
|
2022-07-29 20:13:56 +08:00
|
|
|
static inline void xsk_buff_discard(struct xdp_buff *xdp)
|
|
|
|
{
|
|
|
|
struct xdp_buff_xsk *xskb = container_of(xdp, struct xdp_buff_xsk, xdp);
|
|
|
|
|
|
|
|
xp_release(xskb);
|
|
|
|
}
|
|
|
|
|
xsk: Batched buffer allocation for the pool
Add a new driver interface xsk_buff_alloc_batch() offering batched
buffer allocations to improve performance. The new interface takes
three arguments: the buffer pool to allocated from, a pointer to an
array of struct xdp_buff pointers which will contain pointers to the
allocated xdp_buffs, and an unsigned integer specifying the max number
of buffers to allocate. The return value is the actual number of
buffers that the allocator managed to allocate and it will be in the
range 0 <= N <= max, where max is the third parameter to the function.
u32 xsk_buff_alloc_batch(struct xsk_buff_pool *pool, struct xdp_buff **xdp,
u32 max);
A second driver interface is also introduced that need to be used in
conjunction with xsk_buff_alloc_batch(). It is a helper that sets the
size of struct xdp_buff and is used by the NIC Rx irq routine when
receiving a packet. This helper sets the three struct members data,
data_meta, and data_end. The two first ones is in the xsk_buff_alloc()
case set in the allocation routine and data_end is set when a packet
is received in the receive irq function. This unfortunately leads to
worse performance since the xdp_buff is touched twice with a long time
period in between leading to an extra cache miss. Instead, we fill out
the xdp_buff with all 3 fields at one single point in time in the
driver, when the size of the packet is known. Hence this helper. Note
that the driver has to use this helper (or set all three fields
itself) when using xsk_buff_alloc_batch(). xsk_buff_alloc() works as
before and does not require this.
void xsk_buff_set_size(struct xdp_buff *xdp, u32 size);
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20210922075613.12186-3-magnus.karlsson@gmail.com
2021-09-22 15:56:02 +08:00
|
|
|
static inline void xsk_buff_set_size(struct xdp_buff *xdp, u32 size)
|
|
|
|
{
|
|
|
|
xdp->data = xdp->data_hard_start + XDP_PACKET_HEADROOM;
|
|
|
|
xdp->data_meta = xdp->data;
|
|
|
|
xdp->data_end = xdp->data + size;
|
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline dma_addr_t xsk_buff_raw_get_dma(struct xsk_buff_pool *pool,
|
|
|
|
u64 addr)
|
2020-05-21 03:20:53 +08:00
|
|
|
{
|
2020-08-28 16:26:16 +08:00
|
|
|
return xp_raw_get_dma(pool, addr);
|
2020-05-21 03:20:53 +08:00
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline void *xsk_buff_raw_get_data(struct xsk_buff_pool *pool, u64 addr)
|
2020-05-21 03:20:53 +08:00
|
|
|
{
|
2020-08-28 16:26:16 +08:00
|
|
|
return xp_raw_get_data(pool, addr);
|
2020-05-21 03:20:53 +08:00
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:24 +08:00
|
|
|
static inline void xsk_buff_dma_sync_for_cpu(struct xdp_buff *xdp, struct xsk_buff_pool *pool)
|
2020-05-21 03:20:53 +08:00
|
|
|
{
|
|
|
|
struct xdp_buff_xsk *xskb = container_of(xdp, struct xdp_buff_xsk, xdp);
|
|
|
|
|
2020-08-28 16:26:24 +08:00
|
|
|
if (!pool->dma_need_sync)
|
|
|
|
return;
|
|
|
|
|
2020-05-21 03:20:53 +08:00
|
|
|
xp_dma_sync_for_cpu(xskb);
|
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline void xsk_buff_raw_dma_sync_for_device(struct xsk_buff_pool *pool,
|
2020-05-21 03:20:53 +08:00
|
|
|
dma_addr_t dma,
|
|
|
|
size_t size)
|
|
|
|
{
|
2020-08-28 16:26:16 +08:00
|
|
|
xp_dma_sync_for_device(pool, dma, size);
|
2020-05-21 03:20:53 +08:00
|
|
|
}
|
|
|
|
|
2020-05-21 03:20:51 +08:00
|
|
|
#else
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline void xsk_tx_completed(struct xsk_buff_pool *pool, u32 nb_entries)
|
2020-05-21 03:20:51 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline bool xsk_tx_peek_desc(struct xsk_buff_pool *pool,
|
|
|
|
struct xdp_desc *desc)
|
2020-05-21 03:20:51 +08:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2022-01-26 00:04:43 +08:00
|
|
|
static inline u32 xsk_tx_peek_release_desc_batch(struct xsk_buff_pool *pool, u32 max)
|
2020-11-16 19:12:46 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline void xsk_tx_release(struct xsk_buff_pool *pool)
|
2020-05-21 03:20:51 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:15 +08:00
|
|
|
static inline struct xsk_buff_pool *
|
2020-08-28 16:26:16 +08:00
|
|
|
xsk_get_pool_from_qid(struct net_device *dev, u16 queue_id)
|
2020-05-21 03:20:51 +08:00
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline void xsk_set_rx_need_wakeup(struct xsk_buff_pool *pool)
|
2020-05-21 03:20:51 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline void xsk_set_tx_need_wakeup(struct xsk_buff_pool *pool)
|
2020-05-21 03:20:51 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline void xsk_clear_rx_need_wakeup(struct xsk_buff_pool *pool)
|
2020-05-21 03:20:51 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline void xsk_clear_tx_need_wakeup(struct xsk_buff_pool *pool)
|
2020-05-21 03:20:51 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline bool xsk_uses_need_wakeup(struct xsk_buff_pool *pool)
|
2020-05-21 03:20:51 +08:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline u32 xsk_pool_get_headroom(struct xsk_buff_pool *pool)
|
2020-05-21 03:20:53 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline u32 xsk_pool_get_chunk_size(struct xsk_buff_pool *pool)
|
2020-05-21 03:20:53 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline u32 xsk_pool_get_rx_frame_size(struct xsk_buff_pool *pool)
|
2020-05-21 03:20:53 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline void xsk_pool_set_rxq_info(struct xsk_buff_pool *pool,
|
2020-05-21 03:20:53 +08:00
|
|
|
struct xdp_rxq_info *rxq)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2022-07-07 21:08:42 +08:00
|
|
|
static inline unsigned int xsk_pool_get_napi_id(struct xsk_buff_pool *pool)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline void xsk_pool_dma_unmap(struct xsk_buff_pool *pool,
|
2020-05-21 03:20:53 +08:00
|
|
|
unsigned long attrs)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline int xsk_pool_dma_map(struct xsk_buff_pool *pool,
|
|
|
|
struct device *dev, unsigned long attrs)
|
2020-05-21 03:20:53 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline dma_addr_t xsk_buff_xdp_get_dma(struct xdp_buff *xdp)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline dma_addr_t xsk_buff_xdp_get_frame_dma(struct xdp_buff *xdp)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline struct xdp_buff *xsk_buff_alloc(struct xsk_buff_pool *pool)
|
2020-05-21 03:20:53 +08:00
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
xsk: Batched buffer allocation for the pool
Add a new driver interface xsk_buff_alloc_batch() offering batched
buffer allocations to improve performance. The new interface takes
three arguments: the buffer pool to allocated from, a pointer to an
array of struct xdp_buff pointers which will contain pointers to the
allocated xdp_buffs, and an unsigned integer specifying the max number
of buffers to allocate. The return value is the actual number of
buffers that the allocator managed to allocate and it will be in the
range 0 <= N <= max, where max is the third parameter to the function.
u32 xsk_buff_alloc_batch(struct xsk_buff_pool *pool, struct xdp_buff **xdp,
u32 max);
A second driver interface is also introduced that need to be used in
conjunction with xsk_buff_alloc_batch(). It is a helper that sets the
size of struct xdp_buff and is used by the NIC Rx irq routine when
receiving a packet. This helper sets the three struct members data,
data_meta, and data_end. The two first ones is in the xsk_buff_alloc()
case set in the allocation routine and data_end is set when a packet
is received in the receive irq function. This unfortunately leads to
worse performance since the xdp_buff is touched twice with a long time
period in between leading to an extra cache miss. Instead, we fill out
the xdp_buff with all 3 fields at one single point in time in the
driver, when the size of the packet is known. Hence this helper. Note
that the driver has to use this helper (or set all three fields
itself) when using xsk_buff_alloc_batch(). xsk_buff_alloc() works as
before and does not require this.
void xsk_buff_set_size(struct xdp_buff *xdp, u32 size);
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20210922075613.12186-3-magnus.karlsson@gmail.com
2021-09-22 15:56:02 +08:00
|
|
|
static inline u32 xsk_buff_alloc_batch(struct xsk_buff_pool *pool, struct xdp_buff **xdp, u32 max)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline bool xsk_buff_can_alloc(struct xsk_buff_pool *pool, u32 count)
|
2020-05-21 03:20:53 +08:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void xsk_buff_free(struct xdp_buff *xdp)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2022-07-29 20:13:56 +08:00
|
|
|
static inline void xsk_buff_discard(struct xdp_buff *xdp)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
xsk: Batched buffer allocation for the pool
Add a new driver interface xsk_buff_alloc_batch() offering batched
buffer allocations to improve performance. The new interface takes
three arguments: the buffer pool to allocated from, a pointer to an
array of struct xdp_buff pointers which will contain pointers to the
allocated xdp_buffs, and an unsigned integer specifying the max number
of buffers to allocate. The return value is the actual number of
buffers that the allocator managed to allocate and it will be in the
range 0 <= N <= max, where max is the third parameter to the function.
u32 xsk_buff_alloc_batch(struct xsk_buff_pool *pool, struct xdp_buff **xdp,
u32 max);
A second driver interface is also introduced that need to be used in
conjunction with xsk_buff_alloc_batch(). It is a helper that sets the
size of struct xdp_buff and is used by the NIC Rx irq routine when
receiving a packet. This helper sets the three struct members data,
data_meta, and data_end. The two first ones is in the xsk_buff_alloc()
case set in the allocation routine and data_end is set when a packet
is received in the receive irq function. This unfortunately leads to
worse performance since the xdp_buff is touched twice with a long time
period in between leading to an extra cache miss. Instead, we fill out
the xdp_buff with all 3 fields at one single point in time in the
driver, when the size of the packet is known. Hence this helper. Note
that the driver has to use this helper (or set all three fields
itself) when using xsk_buff_alloc_batch(). xsk_buff_alloc() works as
before and does not require this.
void xsk_buff_set_size(struct xdp_buff *xdp, u32 size);
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20210922075613.12186-3-magnus.karlsson@gmail.com
2021-09-22 15:56:02 +08:00
|
|
|
static inline void xsk_buff_set_size(struct xdp_buff *xdp, u32 size)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline dma_addr_t xsk_buff_raw_get_dma(struct xsk_buff_pool *pool,
|
|
|
|
u64 addr)
|
2020-05-21 03:20:53 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline void *xsk_buff_raw_get_data(struct xsk_buff_pool *pool, u64 addr)
|
2020-05-21 03:20:53 +08:00
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:24 +08:00
|
|
|
static inline void xsk_buff_dma_sync_for_cpu(struct xdp_buff *xdp, struct xsk_buff_pool *pool)
|
2020-05-21 03:20:53 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-08-28 16:26:16 +08:00
|
|
|
static inline void xsk_buff_raw_dma_sync_for_device(struct xsk_buff_pool *pool,
|
2020-05-21 03:20:53 +08:00
|
|
|
dma_addr_t dma,
|
|
|
|
size_t size)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-05-21 03:20:51 +08:00
|
|
|
#endif /* CONFIG_XDP_SOCKETS */
|
|
|
|
|
|
|
|
#endif /* _LINUX_XDP_SOCK_DRV_H */
|