Linux Audio

Check our new training course

Loading...
Note: File does not exist in v4.6.
 1/* SPDX-License-Identifier: GPL-2.0 */
 2/* Copyright (c) 2019, Intel Corporation. */
 3
 4#ifndef _ICE_XSK_H_
 5#define _ICE_XSK_H_
 6#include "ice_txrx.h"
 7#include "ice.h"
 8
 9struct ice_vsi;
10
11#ifdef CONFIG_XDP_SOCKETS
12int ice_xsk_umem_setup(struct ice_vsi *vsi, struct xdp_umem *umem, u16 qid);
13int ice_clean_rx_irq_zc(struct ice_ring *rx_ring, int budget);
14bool ice_clean_tx_irq_zc(struct ice_ring *xdp_ring, int budget);
15int ice_xsk_wakeup(struct net_device *netdev, u32 queue_id, u32 flags);
16bool ice_alloc_rx_bufs_zc(struct ice_ring *rx_ring, u16 count);
17bool ice_xsk_any_rx_ring_ena(struct ice_vsi *vsi);
18void ice_xsk_clean_rx_ring(struct ice_ring *rx_ring);
19void ice_xsk_clean_xdp_ring(struct ice_ring *xdp_ring);
20#else
21static inline int
22ice_xsk_umem_setup(struct ice_vsi __always_unused *vsi,
23		   struct xdp_umem __always_unused *umem,
24		   u16 __always_unused qid)
25{
26	return -EOPNOTSUPP;
27}
28
29static inline int
30ice_clean_rx_irq_zc(struct ice_ring __always_unused *rx_ring,
31		    int __always_unused budget)
32{
33	return 0;
34}
35
36static inline bool
37ice_clean_tx_irq_zc(struct ice_ring __always_unused *xdp_ring,
38		    int __always_unused budget)
39{
40	return false;
41}
42
43static inline bool
44ice_alloc_rx_bufs_zc(struct ice_ring __always_unused *rx_ring,
45		     u16 __always_unused count)
46{
47	return false;
48}
49
50static inline bool ice_xsk_any_rx_ring_ena(struct ice_vsi __always_unused *vsi)
51{
52	return false;
53}
54
55static inline int
56ice_xsk_wakeup(struct net_device __always_unused *netdev,
57	       u32 __always_unused queue_id, u32 __always_unused flags)
58{
59	return -EOPNOTSUPP;
60}
61
62#define ice_xsk_clean_rx_ring(rx_ring) do {} while (0)
63#define ice_xsk_clean_xdp_ring(xdp_ring) do {} while (0)
64#endif /* CONFIG_XDP_SOCKETS */
65#endif /* !_ICE_XSK_H_ */