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_pool_setup(struct ice_vsi *vsi, struct xsk_buff_pool *pool,
  13                       u16 qid);
  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_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_pool_setup(struct ice_vsi __always_unused *vsi,
  24                   struct xsk_buff_pool __always_unused *pool,
  25                   u16 __always_unused qid)
  26{
  27        return -EOPNOTSUPP;
  28}
  29
  30static inline int
  31ice_clean_rx_irq_zc(struct ice_ring __always_unused *rx_ring,
  32                    int __always_unused budget)
  33{
  34        return 0;
  35}
  36
  37static inline bool
  38ice_clean_tx_irq_zc(struct ice_ring __always_unused *xdp_ring,
  39                    int __always_unused budget)
  40{
  41        return false;
  42}
  43
  44static inline bool
  45ice_alloc_rx_bufs_zc(struct ice_ring __always_unused *rx_ring,
  46                     u16 __always_unused count)
  47{
  48        return false;
  49}
  50
  51static inline bool ice_xsk_any_rx_ring_ena(struct ice_vsi __always_unused *vsi)
  52{
  53        return false;
  54}
  55
  56static inline int
  57ice_xsk_wakeup(struct net_device __always_unused *netdev,
  58               u32 __always_unused queue_id, u32 __always_unused flags)
  59{
  60        return -EOPNOTSUPP;
  61}
  62
  63static inline void ice_xsk_clean_rx_ring(struct ice_ring *rx_ring) { }
  64static inline void ice_xsk_clean_xdp_ring(struct ice_ring *xdp_ring) { }
  65#endif /* CONFIG_XDP_SOCKETS */
  66#endif /* !_ICE_XSK_H_ */
  67