linux/drivers/net/ethernet/intel/ice/ice_xsk.h
<<
>>
Prefs
   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);
  13void ice_zca_free(struct zero_copy_allocator *zca, unsigned long handle);
  14int ice_clean_rx_irq_zc(struct ice_ring *rx_ring, int budget);
  15bool ice_clean_tx_irq_zc(struct ice_ring *xdp_ring, int budget);
  16int ice_xsk_wakeup(struct net_device *netdev, u32 queue_id, u32 flags);
  17bool ice_alloc_rx_bufs_slow_zc(struct ice_ring *rx_ring, u16 count);
  18bool ice_xsk_any_rx_ring_ena(struct ice_vsi *vsi);
  19void ice_xsk_clean_rx_ring(struct ice_ring *rx_ring);
  20void ice_xsk_clean_xdp_ring(struct ice_ring *xdp_ring);
  21#else
  22static inline int
  23ice_xsk_umem_setup(struct ice_vsi __always_unused *vsi,
  24                   struct xdp_umem __always_unused *umem,
  25                   u16 __always_unused qid)
  26{
  27        return -EOPNOTSUPP;
  28}
  29
  30static inline void
  31ice_zca_free(struct zero_copy_allocator __always_unused *zca,
  32             unsigned long __always_unused handle)
  33{
  34}
  35
  36static inline int
  37ice_clean_rx_irq_zc(struct ice_ring __always_unused *rx_ring,
  38                    int __always_unused budget)
  39{
  40        return 0;
  41}
  42
  43static inline bool
  44ice_clean_tx_irq_zc(struct ice_ring __always_unused *xdp_ring,
  45                    int __always_unused budget)
  46{
  47        return false;
  48}
  49
  50static inline bool
  51ice_alloc_rx_bufs_slow_zc(struct ice_ring __always_unused *rx_ring,
  52                          u16 __always_unused count)
  53{
  54        return false;
  55}
  56
  57static inline bool ice_xsk_any_rx_ring_ena(struct ice_vsi __always_unused *vsi)
  58{
  59        return false;
  60}
  61
  62static inline int
  63ice_xsk_wakeup(struct net_device __always_unused *netdev,
  64               u32 __always_unused queue_id, u32 __always_unused flags)
  65{
  66        return -EOPNOTSUPP;
  67}
  68
  69#define ice_xsk_clean_rx_ring(rx_ring) do {} while (0)
  70#define ice_xsk_clean_xdp_ring(xdp_ring) do {} while (0)
  71#endif /* CONFIG_XDP_SOCKETS */
  72#endif /* !_ICE_XSK_H_ */
  73