fm10k.h 17 KB

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