fm10k.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* Copyright(c) 2013 - 2018 Intel Corporation. */
  3. #ifndef _FM10K_H_
  4. #define _FM10K_H_
  5. #include <linux/types.h>
  6. #include <linux/etherdevice.h>
  7. #include <linux/cpumask.h>
  8. #include <linux/rtnetlink.h>
  9. #include <linux/if_vlan.h>
  10. #include <linux/pci.h>
  11. #include "fm10k_pf.h"
  12. #include "fm10k_vf.h"
  13. #define FM10K_MAX_JUMBO_FRAME_SIZE 15342 /* Maximum supported size 15K */
  14. #define MAX_QUEUES FM10K_MAX_QUEUES_PF
  15. #define FM10K_MIN_RXD 128
  16. #define FM10K_MAX_RXD 4096
  17. #define FM10K_DEFAULT_RXD 256
  18. #define FM10K_MIN_TXD 128
  19. #define FM10K_MAX_TXD 4096
  20. #define FM10K_DEFAULT_TXD 256
  21. #define FM10K_DEFAULT_TX_WORK 256
  22. #define FM10K_RXBUFFER_256 256
  23. #define FM10K_RX_HDR_LEN FM10K_RXBUFFER_256
  24. #define FM10K_RXBUFFER_2048 2048
  25. #define FM10K_RX_BUFSZ FM10K_RXBUFFER_2048
  26. /* How many Rx Buffers do we bundle into one write to the hardware ? */
  27. #define FM10K_RX_BUFFER_WRITE 16 /* Must be power of 2 */
  28. #define FM10K_MAX_STATIONS 63
  29. struct fm10k_l2_accel {
  30. int size;
  31. u16 count;
  32. u16 dglort;
  33. struct rcu_head rcu;
  34. struct net_device *macvlan[0];
  35. };
  36. enum fm10k_ring_state_t {
  37. __FM10K_TX_DETECT_HANG,
  38. __FM10K_HANG_CHECK_ARMED,
  39. __FM10K_TX_XPS_INIT_DONE,
  40. /* This must be last and is used to calculate BITMAP size */
  41. __FM10K_TX_STATE_SIZE__,
  42. };
  43. #define check_for_tx_hang(ring) \
  44. test_bit(__FM10K_TX_DETECT_HANG, (ring)->state)
  45. #define set_check_for_tx_hang(ring) \
  46. set_bit(__FM10K_TX_DETECT_HANG, (ring)->state)
  47. #define clear_check_for_tx_hang(ring) \
  48. clear_bit(__FM10K_TX_DETECT_HANG, (ring)->state)
  49. struct fm10k_tx_buffer {
  50. struct fm10k_tx_desc *next_to_watch;
  51. struct sk_buff *skb;
  52. unsigned int bytecount;
  53. u16 gso_segs;
  54. u16 tx_flags;
  55. DEFINE_DMA_UNMAP_ADDR(dma);
  56. DEFINE_DMA_UNMAP_LEN(len);
  57. };
  58. struct fm10k_rx_buffer {
  59. dma_addr_t dma;
  60. struct page *page;
  61. u32 page_offset;
  62. };
  63. struct fm10k_queue_stats {
  64. u64 packets;
  65. u64 bytes;
  66. };
  67. struct fm10k_tx_queue_stats {
  68. u64 restart_queue;
  69. u64 csum_err;
  70. u64 tx_busy;
  71. u64 tx_done_old;
  72. u64 csum_good;
  73. };
  74. struct fm10k_rx_queue_stats {
  75. u64 alloc_failed;
  76. u64 csum_err;
  77. u64 errors;
  78. u64 csum_good;
  79. u64 switch_errors;
  80. u64 drops;
  81. u64 pp_errors;
  82. u64 link_errors;
  83. u64 length_errors;
  84. };
  85. struct fm10k_ring {
  86. struct fm10k_q_vector *q_vector;/* backpointer to host q_vector */
  87. struct net_device *netdev; /* netdev ring belongs to */
  88. struct device *dev; /* device for DMA mapping */
  89. struct fm10k_l2_accel __rcu *l2_accel; /* L2 acceleration list */
  90. void *desc; /* descriptor ring memory */
  91. union {
  92. struct fm10k_tx_buffer *tx_buffer;
  93. struct fm10k_rx_buffer *rx_buffer;
  94. };
  95. u32 __iomem *tail;
  96. DECLARE_BITMAP(state, __FM10K_TX_STATE_SIZE__);
  97. dma_addr_t dma; /* phys. address of descriptor ring */
  98. unsigned int size; /* length in bytes */
  99. u8 queue_index; /* needed for queue management */
  100. u8 reg_idx; /* holds the special value that gets
  101. * the hardware register offset
  102. * associated with this ring, which is
  103. * different for DCB and RSS modes
  104. */
  105. u8 qos_pc; /* priority class of queue */
  106. u16 vid; /* default VLAN ID of queue */
  107. u16 count; /* amount of descriptors */
  108. u16 next_to_alloc;
  109. u16 next_to_use;
  110. u16 next_to_clean;
  111. struct fm10k_queue_stats stats;
  112. struct u64_stats_sync syncp;
  113. union {
  114. /* Tx */
  115. struct fm10k_tx_queue_stats tx_stats;
  116. /* Rx */
  117. struct {
  118. struct fm10k_rx_queue_stats rx_stats;
  119. struct sk_buff *skb;
  120. };
  121. };
  122. } ____cacheline_internodealigned_in_smp;
  123. struct fm10k_ring_container {
  124. struct fm10k_ring *ring; /* pointer to linked list of rings */
  125. unsigned int total_bytes; /* total bytes processed this int */
  126. unsigned int total_packets; /* total packets processed this int */
  127. u16 work_limit; /* total work allowed per interrupt */
  128. u16 itr; /* interrupt throttle rate value */
  129. u8 itr_scale; /* ITR adjustment based on PCI speed */
  130. u8 count; /* total number of rings in vector */
  131. };
  132. #define FM10K_ITR_MAX 0x0FFF /* maximum value for ITR */
  133. #define FM10K_ITR_10K 100 /* 100us */
  134. #define FM10K_ITR_20K 50 /* 50us */
  135. #define FM10K_ITR_40K 25 /* 25us */
  136. #define FM10K_ITR_ADAPTIVE 0x8000 /* adaptive interrupt moderation flag */
  137. #define ITR_IS_ADAPTIVE(itr) (!!(itr & FM10K_ITR_ADAPTIVE))
  138. #define FM10K_TX_ITR_DEFAULT FM10K_ITR_40K
  139. #define FM10K_RX_ITR_DEFAULT FM10K_ITR_20K
  140. #define FM10K_ITR_ENABLE (FM10K_ITR_AUTOMASK | FM10K_ITR_MASK_CLEAR)
  141. static inline struct netdev_queue *txring_txq(const struct fm10k_ring *ring)
  142. {
  143. return &ring->netdev->_tx[ring->queue_index];
  144. }
  145. /* iterator for handling rings in ring container */
  146. #define fm10k_for_each_ring(pos, head) \
  147. for (pos = &(head).ring[(head).count]; (--pos) >= (head).ring;)
  148. #define MAX_Q_VECTORS 256
  149. #define MIN_Q_VECTORS 1
  150. enum fm10k_non_q_vectors {
  151. FM10K_MBX_VECTOR,
  152. #define NON_Q_VECTORS_VF NON_Q_VECTORS_PF
  153. NON_Q_VECTORS_PF
  154. };
  155. #define NON_Q_VECTORS(hw) (((hw)->mac.type == fm10k_mac_pf) ? \
  156. NON_Q_VECTORS_PF : \
  157. NON_Q_VECTORS_VF)
  158. #define MIN_MSIX_COUNT(hw) (MIN_Q_VECTORS + NON_Q_VECTORS(hw))
  159. struct fm10k_q_vector {
  160. struct fm10k_intfc *interface;
  161. u32 __iomem *itr; /* pointer to ITR register for this vector */
  162. u16 v_idx; /* index of q_vector within interface array */
  163. struct fm10k_ring_container rx, tx;
  164. struct napi_struct napi;
  165. cpumask_t affinity_mask;
  166. char name[IFNAMSIZ + 9];
  167. #ifdef CONFIG_DEBUG_FS
  168. struct dentry *dbg_q_vector;
  169. #endif /* CONFIG_DEBUG_FS */
  170. struct rcu_head rcu; /* to avoid race with update stats on free */
  171. /* for dynamic allocation of rings associated with this q_vector */
  172. struct fm10k_ring ring[0] ____cacheline_internodealigned_in_smp;
  173. };
  174. enum fm10k_ring_f_enum {
  175. RING_F_RSS,
  176. RING_F_QOS,
  177. RING_F_ARRAY_SIZE /* must be last in enum set */
  178. };
  179. struct fm10k_ring_feature {
  180. u16 limit; /* upper limit on feature indices */
  181. u16 indices; /* current value of indices */
  182. u16 mask; /* Mask used for feature to ring mapping */
  183. u16 offset; /* offset to start of feature */
  184. };
  185. struct fm10k_iov_data {
  186. unsigned int num_vfs;
  187. unsigned int next_vf_mbx;
  188. struct rcu_head rcu;
  189. struct fm10k_vf_info vf_info[0];
  190. };
  191. struct fm10k_udp_port {
  192. struct list_head list;
  193. sa_family_t sa_family;
  194. __be16 port;
  195. };
  196. enum fm10k_macvlan_request_type {
  197. FM10K_UC_MAC_REQUEST,
  198. FM10K_MC_MAC_REQUEST,
  199. FM10K_VLAN_REQUEST
  200. };
  201. struct fm10k_macvlan_request {
  202. enum fm10k_macvlan_request_type type;
  203. struct list_head list;
  204. union {
  205. struct fm10k_mac_request {
  206. u8 addr[ETH_ALEN];
  207. u16 glort;
  208. u16 vid;
  209. } mac;
  210. struct fm10k_vlan_request {
  211. u32 vid;
  212. u8 vsi;
  213. } vlan;
  214. };
  215. bool set;
  216. };
  217. /* one work queue for entire driver */
  218. extern struct workqueue_struct *fm10k_workqueue;
  219. /* The following enumeration contains flags which indicate or enable modified
  220. * driver behaviors. To avoid race conditions, the flags are stored in
  221. * a BITMAP in the fm10k_intfc structure. The BITMAP should be accessed using
  222. * atomic *_bit() operations.
  223. */
  224. enum fm10k_flags_t {
  225. FM10K_FLAG_RESET_REQUESTED,
  226. FM10K_FLAG_RSS_FIELD_IPV4_UDP,
  227. FM10K_FLAG_RSS_FIELD_IPV6_UDP,
  228. FM10K_FLAG_SWPRI_CONFIG,
  229. /* __FM10K_FLAGS_SIZE__ is used to calculate the size of
  230. * interface->flags and must be the last value in this
  231. * enumeration.
  232. */
  233. __FM10K_FLAGS_SIZE__
  234. };
  235. enum fm10k_state_t {
  236. __FM10K_RESETTING,
  237. __FM10K_RESET_DETACHED,
  238. __FM10K_RESET_SUSPENDED,
  239. __FM10K_DOWN,
  240. __FM10K_SERVICE_SCHED,
  241. __FM10K_SERVICE_REQUEST,
  242. __FM10K_SERVICE_DISABLE,
  243. __FM10K_MACVLAN_SCHED,
  244. __FM10K_MACVLAN_REQUEST,
  245. __FM10K_MACVLAN_DISABLE,
  246. __FM10K_LINK_DOWN,
  247. __FM10K_UPDATING_STATS,
  248. /* This value must be last and determines the BITMAP size */
  249. __FM10K_STATE_SIZE__,
  250. };
  251. struct fm10k_intfc {
  252. unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
  253. struct net_device *netdev;
  254. struct fm10k_l2_accel *l2_accel; /* pointer to L2 acceleration list */
  255. struct pci_dev *pdev;
  256. DECLARE_BITMAP(state, __FM10K_STATE_SIZE__);
  257. /* Access flag values using atomic *_bit() operations */
  258. DECLARE_BITMAP(flags, __FM10K_FLAGS_SIZE__);
  259. int xcast_mode;
  260. /* Tx fast path data */
  261. int num_tx_queues;
  262. u16 tx_itr;
  263. /* Rx fast path data */
  264. int num_rx_queues;
  265. u16 rx_itr;
  266. /* TX */
  267. struct fm10k_ring *tx_ring[MAX_QUEUES] ____cacheline_aligned_in_smp;
  268. u64 restart_queue;
  269. u64 tx_busy;
  270. u64 tx_csum_errors;
  271. u64 alloc_failed;
  272. u64 rx_csum_errors;
  273. u64 tx_bytes_nic;
  274. u64 tx_packets_nic;
  275. u64 rx_bytes_nic;
  276. u64 rx_packets_nic;
  277. u64 rx_drops_nic;
  278. u64 rx_overrun_pf;
  279. u64 rx_overrun_vf;
  280. /* Debug Statistics */
  281. u64 hw_sm_mbx_full;
  282. u64 hw_csum_tx_good;
  283. u64 hw_csum_rx_good;
  284. u64 rx_switch_errors;
  285. u64 rx_drops;
  286. u64 rx_pp_errors;
  287. u64 rx_link_errors;
  288. u64 rx_length_errors;
  289. u32 tx_timeout_count;
  290. /* RX */
  291. struct fm10k_ring *rx_ring[MAX_QUEUES];
  292. /* Queueing vectors */
  293. struct fm10k_q_vector *q_vector[MAX_Q_VECTORS];
  294. struct msix_entry *msix_entries;
  295. int num_q_vectors; /* current number of q_vectors for device */
  296. struct fm10k_ring_feature ring_feature[RING_F_ARRAY_SIZE];
  297. /* SR-IOV information management structure */
  298. struct fm10k_iov_data *iov_data;
  299. struct fm10k_hw_stats stats;
  300. struct fm10k_hw hw;
  301. /* Mailbox lock */
  302. spinlock_t mbx_lock;
  303. u32 __iomem *uc_addr;
  304. u32 __iomem *sw_addr;
  305. u16 msg_enable;
  306. u16 tx_ring_count;
  307. u16 rx_ring_count;
  308. struct timer_list service_timer;
  309. struct work_struct service_task;
  310. unsigned long next_stats_update;
  311. unsigned long next_tx_hang_check;
  312. unsigned long last_reset;
  313. unsigned long link_down_event;
  314. bool host_ready;
  315. bool lport_map_failed;
  316. u32 reta[FM10K_RETA_SIZE];
  317. u32 rssrk[FM10K_RSSRK_SIZE];
  318. /* UDP encapsulation port tracking information */
  319. struct list_head vxlan_port;
  320. struct list_head geneve_port;
  321. /* MAC/VLAN update queue */
  322. struct list_head macvlan_requests;
  323. struct delayed_work macvlan_task;
  324. /* MAC/VLAN update queue lock */
  325. spinlock_t macvlan_lock;
  326. #ifdef CONFIG_DEBUG_FS
  327. struct dentry *dbg_intfc;
  328. #endif /* CONFIG_DEBUG_FS */
  329. #ifdef CONFIG_DCB
  330. u8 pfc_en;
  331. #endif
  332. u8 rx_pause;
  333. /* GLORT resources in use by PF */
  334. u16 glort;
  335. u16 glort_count;
  336. /* VLAN ID for updating multicast/unicast lists */
  337. u16 vid;
  338. };
  339. static inline void fm10k_mbx_lock(struct fm10k_intfc *interface)
  340. {
  341. spin_lock(&interface->mbx_lock);
  342. }
  343. static inline void fm10k_mbx_unlock(struct fm10k_intfc *interface)
  344. {
  345. spin_unlock(&interface->mbx_lock);
  346. }
  347. static inline int fm10k_mbx_trylock(struct fm10k_intfc *interface)
  348. {
  349. return spin_trylock(&interface->mbx_lock);
  350. }
  351. /* fm10k_test_staterr - test bits in Rx descriptor status and error fields */
  352. static inline __le32 fm10k_test_staterr(union fm10k_rx_desc *rx_desc,
  353. const u32 stat_err_bits)
  354. {
  355. return rx_desc->d.staterr & cpu_to_le32(stat_err_bits);
  356. }
  357. /* fm10k_desc_unused - calculate if we have unused descriptors */
  358. static inline u16 fm10k_desc_unused(struct fm10k_ring *ring)
  359. {
  360. s16 unused = ring->next_to_clean - ring->next_to_use - 1;
  361. return likely(unused < 0) ? unused + ring->count : unused;
  362. }
  363. #define FM10K_TX_DESC(R, i) \
  364. (&(((struct fm10k_tx_desc *)((R)->desc))[i]))
  365. #define FM10K_RX_DESC(R, i) \
  366. (&(((union fm10k_rx_desc *)((R)->desc))[i]))
  367. #define FM10K_MAX_TXD_PWR 14
  368. #define FM10K_MAX_DATA_PER_TXD (1u << FM10K_MAX_TXD_PWR)
  369. /* Tx Descriptors needed, worst case */
  370. #define TXD_USE_COUNT(S) DIV_ROUND_UP((S), FM10K_MAX_DATA_PER_TXD)
  371. #define DESC_NEEDED (MAX_SKB_FRAGS + 4)
  372. enum fm10k_tx_flags {
  373. /* Tx offload flags */
  374. FM10K_TX_FLAGS_CSUM = 0x01,
  375. };
  376. /* This structure is stored as little endian values as that is the native
  377. * format of the Rx descriptor. The ordering of these fields is reversed
  378. * from the actual ftag header to allow for a single bswap to take care
  379. * of placing all of the values in network order
  380. */
  381. union fm10k_ftag_info {
  382. __le64 ftag;
  383. struct {
  384. /* dglort and sglort combined into a single 32bit desc read */
  385. __le32 glort;
  386. /* upper 16 bits of VLAN are reserved 0 for swpri_type_user */
  387. __le32 vlan;
  388. } d;
  389. struct {
  390. __le16 dglort;
  391. __le16 sglort;
  392. __le16 vlan;
  393. __le16 swpri_type_user;
  394. } w;
  395. };
  396. struct fm10k_cb {
  397. union {
  398. __le64 tstamp;
  399. unsigned long ts_tx_timeout;
  400. };
  401. union fm10k_ftag_info fi;
  402. };
  403. #define FM10K_CB(skb) ((struct fm10k_cb *)(skb)->cb)
  404. /* main */
  405. extern char fm10k_driver_name[];
  406. extern const char fm10k_driver_version[];
  407. int fm10k_init_queueing_scheme(struct fm10k_intfc *interface);
  408. void fm10k_clear_queueing_scheme(struct fm10k_intfc *interface);
  409. __be16 fm10k_tx_encap_offload(struct sk_buff *skb);
  410. netdev_tx_t fm10k_xmit_frame_ring(struct sk_buff *skb,
  411. struct fm10k_ring *tx_ring);
  412. void fm10k_tx_timeout_reset(struct fm10k_intfc *interface);
  413. u64 fm10k_get_tx_pending(struct fm10k_ring *ring, bool in_sw);
  414. bool fm10k_check_tx_hang(struct fm10k_ring *tx_ring);
  415. void fm10k_alloc_rx_buffers(struct fm10k_ring *rx_ring, u16 cleaned_count);
  416. /* PCI */
  417. void fm10k_mbx_free_irq(struct fm10k_intfc *);
  418. int fm10k_mbx_request_irq(struct fm10k_intfc *);
  419. void fm10k_qv_free_irq(struct fm10k_intfc *interface);
  420. int fm10k_qv_request_irq(struct fm10k_intfc *interface);
  421. int fm10k_register_pci_driver(void);
  422. void fm10k_unregister_pci_driver(void);
  423. void fm10k_up(struct fm10k_intfc *interface);
  424. void fm10k_down(struct fm10k_intfc *interface);
  425. void fm10k_update_stats(struct fm10k_intfc *interface);
  426. void fm10k_service_event_schedule(struct fm10k_intfc *interface);
  427. void fm10k_macvlan_schedule(struct fm10k_intfc *interface);
  428. void fm10k_update_rx_drop_en(struct fm10k_intfc *interface);
  429. #ifdef CONFIG_NET_POLL_CONTROLLER
  430. void fm10k_netpoll(struct net_device *netdev);
  431. #endif
  432. /* Netdev */
  433. struct net_device *fm10k_alloc_netdev(const struct fm10k_info *info);
  434. int fm10k_setup_rx_resources(struct fm10k_ring *);
  435. int fm10k_setup_tx_resources(struct fm10k_ring *);
  436. void fm10k_free_rx_resources(struct fm10k_ring *);
  437. void fm10k_free_tx_resources(struct fm10k_ring *);
  438. void fm10k_clean_all_rx_rings(struct fm10k_intfc *);
  439. void fm10k_clean_all_tx_rings(struct fm10k_intfc *);
  440. void fm10k_unmap_and_free_tx_resource(struct fm10k_ring *,
  441. struct fm10k_tx_buffer *);
  442. void fm10k_restore_rx_state(struct fm10k_intfc *);
  443. void fm10k_reset_rx_state(struct fm10k_intfc *);
  444. int fm10k_setup_tc(struct net_device *dev, u8 tc);
  445. int fm10k_open(struct net_device *netdev);
  446. int fm10k_close(struct net_device *netdev);
  447. int fm10k_queue_vlan_request(struct fm10k_intfc *interface, u32 vid,
  448. u8 vsi, bool set);
  449. int fm10k_queue_mac_request(struct fm10k_intfc *interface, u16 glort,
  450. const unsigned char *addr, u16 vid, bool set);
  451. void fm10k_clear_macvlan_queue(struct fm10k_intfc *interface,
  452. u16 glort, bool vlans);
  453. /* Ethtool */
  454. void fm10k_set_ethtool_ops(struct net_device *dev);
  455. void fm10k_write_reta(struct fm10k_intfc *interface, const u32 *indir);
  456. /* IOV */
  457. s32 fm10k_iov_event(struct fm10k_intfc *interface);
  458. s32 fm10k_iov_mbx(struct fm10k_intfc *interface);
  459. void fm10k_iov_suspend(struct pci_dev *pdev);
  460. int fm10k_iov_resume(struct pci_dev *pdev);
  461. void fm10k_iov_disable(struct pci_dev *pdev);
  462. int fm10k_iov_configure(struct pci_dev *pdev, int num_vfs);
  463. s32 fm10k_iov_update_pvid(struct fm10k_intfc *interface, u16 glort, u16 pvid);
  464. int fm10k_ndo_set_vf_mac(struct net_device *netdev, int vf_idx, u8 *mac);
  465. int fm10k_ndo_set_vf_vlan(struct net_device *netdev,
  466. int vf_idx, u16 vid, u8 qos, __be16 vlan_proto);
  467. int fm10k_ndo_set_vf_bw(struct net_device *netdev, int vf_idx,
  468. int __always_unused min_rate, int max_rate);
  469. int fm10k_ndo_get_vf_config(struct net_device *netdev,
  470. int vf_idx, struct ifla_vf_info *ivi);
  471. /* DebugFS */
  472. #ifdef CONFIG_DEBUG_FS
  473. void fm10k_dbg_q_vector_init(struct fm10k_q_vector *q_vector);
  474. void fm10k_dbg_q_vector_exit(struct fm10k_q_vector *q_vector);
  475. void fm10k_dbg_intfc_init(struct fm10k_intfc *interface);
  476. void fm10k_dbg_intfc_exit(struct fm10k_intfc *interface);
  477. void fm10k_dbg_init(void);
  478. void fm10k_dbg_exit(void);
  479. #else
  480. static inline void fm10k_dbg_q_vector_init(struct fm10k_q_vector *q_vector) {}
  481. static inline void fm10k_dbg_q_vector_exit(struct fm10k_q_vector *q_vector) {}
  482. static inline void fm10k_dbg_intfc_init(struct fm10k_intfc *interface) {}
  483. static inline void fm10k_dbg_intfc_exit(struct fm10k_intfc *interface) {}
  484. static inline void fm10k_dbg_init(void) {}
  485. static inline void fm10k_dbg_exit(void) {}
  486. #endif /* CONFIG_DEBUG_FS */
  487. /* DCB */
  488. #ifdef CONFIG_DCB
  489. void fm10k_dcbnl_set_ops(struct net_device *dev);
  490. #else
  491. static inline void fm10k_dcbnl_set_ops(struct net_device *dev) {}
  492. #endif
  493. #endif /* _FM10K_H_ */