i40e.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  1. /*******************************************************************************
  2. *
  3. * Intel Ethernet Controller XL710 Family Linux Driver
  4. * Copyright(c) 2013 Intel Corporation.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms and conditions of the GNU General Public License,
  8. * version 2, as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope it will be useful, but WITHOUT
  11. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  13. * more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along with
  16. * this program; if not, write to the Free Software Foundation, Inc.,
  17. * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  18. *
  19. * The full GNU General Public License is included in this distribution in
  20. * the file called "COPYING".
  21. *
  22. * Contact Information:
  23. * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
  24. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  25. *
  26. ******************************************************************************/
  27. #ifndef _I40E_H_
  28. #define _I40E_H_
  29. #include <net/tcp.h>
  30. #include <linux/init.h>
  31. #include <linux/types.h>
  32. #include <linux/errno.h>
  33. #include <linux/module.h>
  34. #include <linux/pci.h>
  35. #include <linux/aer.h>
  36. #include <linux/netdevice.h>
  37. #include <linux/ioport.h>
  38. #include <linux/slab.h>
  39. #include <linux/list.h>
  40. #include <linux/string.h>
  41. #include <linux/in.h>
  42. #include <linux/ip.h>
  43. #include <linux/tcp.h>
  44. #include <linux/sctp.h>
  45. #include <linux/pkt_sched.h>
  46. #include <linux/ipv6.h>
  47. #include <net/checksum.h>
  48. #include <net/ip6_checksum.h>
  49. #include <linux/ethtool.h>
  50. #include <linux/if_vlan.h>
  51. #include "i40e_type.h"
  52. #include "i40e_prototype.h"
  53. #include "i40e_virtchnl.h"
  54. #include "i40e_virtchnl_pf.h"
  55. #include "i40e_txrx.h"
  56. /* Useful i40e defaults */
  57. #define I40E_BASE_PF_SEID 16
  58. #define I40E_BASE_VSI_SEID 512
  59. #define I40E_BASE_VEB_SEID 288
  60. #define I40E_MAX_VEB 16
  61. #define I40E_MAX_NUM_DESCRIPTORS 4096
  62. #define I40E_MAX_REGISTER 0x0038FFFF
  63. #define I40E_DEFAULT_NUM_DESCRIPTORS 512
  64. #define I40E_REQ_DESCRIPTOR_MULTIPLE 32
  65. #define I40E_MIN_NUM_DESCRIPTORS 64
  66. #define I40E_MIN_MSIX 2
  67. #define I40E_DEFAULT_NUM_VMDQ_VSI 8 /* max 256 VSIs */
  68. #define I40E_DEFAULT_QUEUES_PER_VMDQ 2 /* max 16 qps */
  69. #define I40E_DEFAULT_QUEUES_PER_VF 4
  70. #define I40E_DEFAULT_QUEUES_PER_TC 1 /* should be a power of 2 */
  71. #define I40E_FDIR_RING 0
  72. #define I40E_FDIR_RING_COUNT 32
  73. #define I40E_MAX_AQ_BUF_SIZE 4096
  74. #define I40E_AQ_LEN 32
  75. #define I40E_AQ_WORK_LIMIT 16
  76. #define I40E_MAX_USER_PRIORITY 8
  77. #define I40E_DEFAULT_MSG_ENABLE 4
  78. #define I40E_NVM_VERSION_LO_SHIFT 0
  79. #define I40E_NVM_VERSION_LO_MASK (0xf << I40E_NVM_VERSION_LO_SHIFT)
  80. #define I40E_NVM_VERSION_MID_SHIFT 4
  81. #define I40E_NVM_VERSION_MID_MASK (0xff << I40E_NVM_VERSION_MID_SHIFT)
  82. #define I40E_NVM_VERSION_HI_SHIFT 12
  83. #define I40E_NVM_VERSION_HI_MASK (0xf << I40E_NVM_VERSION_HI_SHIFT)
  84. /* magic for getting defines into strings */
  85. #define STRINGIFY(foo) #foo
  86. #define XSTRINGIFY(bar) STRINGIFY(bar)
  87. #ifndef ARCH_HAS_PREFETCH
  88. #define prefetch(X)
  89. #endif
  90. #define I40E_RX_DESC(R, i) \
  91. ((ring_is_16byte_desc_enabled(R)) \
  92. ? (union i40e_32byte_rx_desc *) \
  93. (&(((union i40e_16byte_rx_desc *)((R)->desc))[i])) \
  94. : (&(((union i40e_32byte_rx_desc *)((R)->desc))[i])))
  95. #define I40E_TX_DESC(R, i) \
  96. (&(((struct i40e_tx_desc *)((R)->desc))[i]))
  97. #define I40E_TX_CTXTDESC(R, i) \
  98. (&(((struct i40e_tx_context_desc *)((R)->desc))[i]))
  99. #define I40E_TX_FDIRDESC(R, i) \
  100. (&(((struct i40e_filter_program_desc *)((R)->desc))[i]))
  101. /* default to trying for four seconds */
  102. #define I40E_TRY_LINK_TIMEOUT (4 * HZ)
  103. /* driver state flags */
  104. enum i40e_state_t {
  105. __I40E_TESTING,
  106. __I40E_CONFIG_BUSY,
  107. __I40E_CONFIG_DONE,
  108. __I40E_DOWN,
  109. __I40E_NEEDS_RESTART,
  110. __I40E_SERVICE_SCHED,
  111. __I40E_ADMINQ_EVENT_PENDING,
  112. __I40E_MDD_EVENT_PENDING,
  113. __I40E_VFLR_EVENT_PENDING,
  114. __I40E_RESET_RECOVERY_PENDING,
  115. __I40E_RESET_INTR_RECEIVED,
  116. __I40E_REINIT_REQUESTED,
  117. __I40E_PF_RESET_REQUESTED,
  118. __I40E_CORE_RESET_REQUESTED,
  119. __I40E_GLOBAL_RESET_REQUESTED,
  120. __I40E_FILTER_OVERFLOW_PROMISC,
  121. };
  122. enum i40e_interrupt_policy {
  123. I40E_INTERRUPT_BEST_CASE,
  124. I40E_INTERRUPT_MEDIUM,
  125. I40E_INTERRUPT_LOWEST
  126. };
  127. struct i40e_lump_tracking {
  128. u16 num_entries;
  129. u16 search_hint;
  130. u16 list[0];
  131. #define I40E_PILE_VALID_BIT 0x8000
  132. };
  133. #define I40E_DEFAULT_ATR_SAMPLE_RATE 20
  134. #define I40E_FDIR_MAX_RAW_PACKET_LOOKUP 512
  135. struct i40e_fdir_data {
  136. u16 q_index;
  137. u8 flex_off;
  138. u8 pctype;
  139. u16 dest_vsi;
  140. u8 dest_ctl;
  141. u8 fd_status;
  142. u16 cnt_index;
  143. u32 fd_id;
  144. u8 *raw_packet;
  145. };
  146. #define I40E_DCB_PRIO_TYPE_STRICT 0
  147. #define I40E_DCB_PRIO_TYPE_ETS 1
  148. #define I40E_DCB_STRICT_PRIO_CREDITS 127
  149. #define I40E_MAX_USER_PRIORITY 8
  150. /* DCB per TC information data structure */
  151. struct i40e_tc_info {
  152. u16 qoffset; /* Queue offset from base queue */
  153. u16 qcount; /* Total Queues */
  154. u8 netdev_tc; /* Netdev TC index if netdev associated */
  155. };
  156. /* TC configuration data structure */
  157. struct i40e_tc_configuration {
  158. u8 numtc; /* Total number of enabled TCs */
  159. u8 enabled_tc; /* TC map */
  160. struct i40e_tc_info tc_info[I40E_MAX_TRAFFIC_CLASS];
  161. };
  162. /* struct that defines the Ethernet device */
  163. struct i40e_pf {
  164. struct pci_dev *pdev;
  165. struct i40e_hw hw;
  166. unsigned long state;
  167. unsigned long link_check_timeout;
  168. struct msix_entry *msix_entries;
  169. u16 num_msix_entries;
  170. bool fc_autoneg_status;
  171. u16 eeprom_version;
  172. u16 num_vmdq_vsis; /* num vmdq pools this pf has set up */
  173. u16 num_vmdq_qps; /* num queue pairs per vmdq pool */
  174. u16 num_vmdq_msix; /* num queue vectors per vmdq pool */
  175. u16 num_req_vfs; /* num vfs requested for this vf */
  176. u16 num_vf_qps; /* num queue pairs per vf */
  177. u16 num_tc_qps; /* num queue pairs per TC */
  178. u16 num_lan_qps; /* num lan queues this pf has set up */
  179. u16 num_lan_msix; /* num queue vectors for the base pf vsi */
  180. u16 rss_size; /* num queues in the RSS array */
  181. u16 rss_size_max; /* HW defined max RSS queues */
  182. u16 fdir_pf_filter_count; /* num of guaranteed filters for this PF */
  183. u8 atr_sample_rate;
  184. enum i40e_interrupt_policy int_policy;
  185. u16 rx_itr_default;
  186. u16 tx_itr_default;
  187. u16 msg_enable;
  188. char misc_int_name[IFNAMSIZ + 9];
  189. u16 adminq_work_limit; /* num of admin receive queue desc to process */
  190. int service_timer_period;
  191. struct timer_list service_timer;
  192. struct work_struct service_task;
  193. u64 flags;
  194. #define I40E_FLAG_RX_CSUM_ENABLED (u64)(1 << 1)
  195. #define I40E_FLAG_MSI_ENABLED (u64)(1 << 2)
  196. #define I40E_FLAG_MSIX_ENABLED (u64)(1 << 3)
  197. #define I40E_FLAG_RX_1BUF_ENABLED (u64)(1 << 4)
  198. #define I40E_FLAG_RX_PS_ENABLED (u64)(1 << 5)
  199. #define I40E_FLAG_RSS_ENABLED (u64)(1 << 6)
  200. #define I40E_FLAG_MQ_ENABLED (u64)(1 << 7)
  201. #define I40E_FLAG_VMDQ_ENABLED (u64)(1 << 8)
  202. #define I40E_FLAG_FDIR_REQUIRES_REINIT (u64)(1 << 9)
  203. #define I40E_FLAG_NEED_LINK_UPDATE (u64)(1 << 10)
  204. #define I40E_FLAG_IN_NETPOLL (u64)(1 << 13)
  205. #define I40E_FLAG_16BYTE_RX_DESC_ENABLED (u64)(1 << 14)
  206. #define I40E_FLAG_CLEAN_ADMINQ (u64)(1 << 15)
  207. #define I40E_FLAG_FILTER_SYNC (u64)(1 << 16)
  208. #define I40E_FLAG_PROCESS_MDD_EVENT (u64)(1 << 18)
  209. #define I40E_FLAG_PROCESS_VFLR_EVENT (u64)(1 << 19)
  210. #define I40E_FLAG_SRIOV_ENABLED (u64)(1 << 20)
  211. #define I40E_FLAG_DCB_ENABLED (u64)(1 << 21)
  212. #define I40E_FLAG_FDIR_ENABLED (u64)(1 << 22)
  213. #define I40E_FLAG_FDIR_ATR_ENABLED (u64)(1 << 23)
  214. #define I40E_FLAG_MFP_ENABLED (u64)(1 << 27)
  215. u16 num_tx_queues;
  216. u16 num_rx_queues;
  217. bool stat_offsets_loaded;
  218. struct i40e_hw_port_stats stats;
  219. struct i40e_hw_port_stats stats_offsets;
  220. u32 tx_timeout_count;
  221. u32 tx_timeout_recovery_level;
  222. unsigned long tx_timeout_last_recovery;
  223. u32 hw_csum_rx_error;
  224. u32 led_status;
  225. u16 corer_count; /* Core reset count */
  226. u16 globr_count; /* Global reset count */
  227. u16 empr_count; /* EMP reset count */
  228. u16 pfr_count; /* PF reset count */
  229. struct mutex switch_mutex;
  230. u16 lan_vsi; /* our default LAN VSI */
  231. u16 lan_veb; /* initial relay, if exists */
  232. #define I40E_NO_VEB 0xffff
  233. #define I40E_NO_VSI 0xffff
  234. u16 next_vsi; /* Next unallocated VSI - 0-based! */
  235. struct i40e_vsi **vsi;
  236. struct i40e_veb *veb[I40E_MAX_VEB];
  237. struct i40e_lump_tracking *qp_pile;
  238. struct i40e_lump_tracking *irq_pile;
  239. /* switch config info */
  240. u16 pf_seid;
  241. u16 main_vsi_seid;
  242. u16 mac_seid;
  243. struct i40e_aqc_get_switch_config_data *sw_config;
  244. struct kobject *switch_kobj;
  245. #ifdef CONFIG_DEBUG_FS
  246. struct dentry *i40e_dbg_pf;
  247. #endif /* CONFIG_DEBUG_FS */
  248. /* sr-iov config info */
  249. struct i40e_vf *vf;
  250. int num_alloc_vfs; /* actual number of VFs allocated */
  251. u32 vf_aq_requests;
  252. /* DCBx/DCBNL capability for PF that indicates
  253. * whether DCBx is managed by firmware or host
  254. * based agent (LLDPAD). Also, indicates what
  255. * flavor of DCBx protocol (IEEE/CEE) is supported
  256. * by the device. For now we're supporting IEEE
  257. * mode only.
  258. */
  259. u16 dcbx_cap;
  260. u32 fcoe_hmc_filt_num;
  261. u32 fcoe_hmc_cntx_num;
  262. struct i40e_filter_control_settings filter_settings;
  263. };
  264. struct i40e_mac_filter {
  265. struct list_head list;
  266. u8 macaddr[ETH_ALEN];
  267. #define I40E_VLAN_ANY -1
  268. s16 vlan;
  269. u8 counter; /* number of instances of this filter */
  270. bool is_vf; /* filter belongs to a VF */
  271. bool is_netdev; /* filter belongs to a netdev */
  272. bool changed; /* filter needs to be sync'd to the HW */
  273. };
  274. struct i40e_veb {
  275. struct i40e_pf *pf;
  276. u16 idx;
  277. u16 veb_idx; /* index of VEB parent */
  278. u16 seid;
  279. u16 uplink_seid;
  280. u16 stats_idx; /* index of VEB parent */
  281. u8 enabled_tc;
  282. u16 flags;
  283. u16 bw_limit;
  284. u8 bw_max_quanta;
  285. bool is_abs_credits;
  286. u8 bw_tc_share_credits[I40E_MAX_TRAFFIC_CLASS];
  287. u16 bw_tc_limit_credits[I40E_MAX_TRAFFIC_CLASS];
  288. u8 bw_tc_max_quanta[I40E_MAX_TRAFFIC_CLASS];
  289. struct kobject *kobj;
  290. bool stat_offsets_loaded;
  291. struct i40e_eth_stats stats;
  292. struct i40e_eth_stats stats_offsets;
  293. };
  294. /* struct that defines a VSI, associated with a dev */
  295. struct i40e_vsi {
  296. struct net_device *netdev;
  297. unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
  298. bool netdev_registered;
  299. bool stat_offsets_loaded;
  300. u32 current_netdev_flags;
  301. unsigned long state;
  302. #define I40E_VSI_FLAG_FILTER_CHANGED (1<<0)
  303. #define I40E_VSI_FLAG_VEB_OWNER (1<<1)
  304. unsigned long flags;
  305. struct list_head mac_filter_list;
  306. /* VSI stats */
  307. struct rtnl_link_stats64 net_stats;
  308. struct rtnl_link_stats64 net_stats_offsets;
  309. struct i40e_eth_stats eth_stats;
  310. struct i40e_eth_stats eth_stats_offsets;
  311. u32 tx_restart;
  312. u32 tx_busy;
  313. u32 rx_buf_failed;
  314. u32 rx_page_failed;
  315. /* These are containers of ring pointers, allocated at run-time */
  316. struct i40e_ring **rx_rings;
  317. struct i40e_ring **tx_rings;
  318. u16 work_limit;
  319. /* high bit set means dynamic, use accessor routines to read/write.
  320. * hardware only supports 2us resolution for the ITR registers.
  321. * these values always store the USER setting, and must be converted
  322. * before programming to a register.
  323. */
  324. u16 rx_itr_setting;
  325. u16 tx_itr_setting;
  326. u16 max_frame;
  327. u16 rx_hdr_len;
  328. u16 rx_buf_len;
  329. u8 dtype;
  330. /* List of q_vectors allocated to this VSI */
  331. struct i40e_q_vector **q_vectors;
  332. int num_q_vectors;
  333. int base_vector;
  334. u16 seid; /* HW index of this VSI (absolute index) */
  335. u16 id; /* VSI number */
  336. u16 uplink_seid;
  337. u16 base_queue; /* vsi's first queue in hw array */
  338. u16 alloc_queue_pairs; /* Allocated Tx/Rx queues */
  339. u16 num_queue_pairs; /* Used tx and rx pairs */
  340. u16 num_desc;
  341. enum i40e_vsi_type type; /* VSI type, e.g., LAN, FCoE, etc */
  342. u16 vf_id; /* Virtual function ID for SRIOV VSIs */
  343. struct i40e_tc_configuration tc_config;
  344. struct i40e_aqc_vsi_properties_data info;
  345. /* VSI BW limit (absolute across all TCs) */
  346. u16 bw_limit; /* VSI BW Limit (0 = disabled) */
  347. u8 bw_max_quanta; /* Max Quanta when BW limit is enabled */
  348. /* Relative TC credits across VSIs */
  349. u8 bw_ets_share_credits[I40E_MAX_TRAFFIC_CLASS];
  350. /* TC BW limit credits within VSI */
  351. u16 bw_ets_limit_credits[I40E_MAX_TRAFFIC_CLASS];
  352. /* TC BW limit max quanta within VSI */
  353. u8 bw_ets_max_quanta[I40E_MAX_TRAFFIC_CLASS];
  354. struct i40e_pf *back; /* Backreference to associated PF */
  355. u16 idx; /* index in pf->vsi[] */
  356. u16 veb_idx; /* index of VEB parent */
  357. struct kobject *kobj; /* sysfs object */
  358. /* VSI specific handlers */
  359. irqreturn_t (*irq_handler)(int irq, void *data);
  360. } ____cacheline_internodealigned_in_smp;
  361. struct i40e_netdev_priv {
  362. struct i40e_vsi *vsi;
  363. };
  364. /* struct that defines an interrupt vector */
  365. struct i40e_q_vector {
  366. struct i40e_vsi *vsi;
  367. u16 v_idx; /* index in the vsi->q_vector array. */
  368. u16 reg_idx; /* register index of the interrupt */
  369. struct napi_struct napi;
  370. struct i40e_ring_container rx;
  371. struct i40e_ring_container tx;
  372. u8 num_ringpairs; /* total number of ring pairs in vector */
  373. cpumask_t affinity_mask;
  374. struct rcu_head rcu; /* to avoid race with update stats on free */
  375. char name[IFNAMSIZ + 9];
  376. } ____cacheline_internodealigned_in_smp;
  377. /* lan device */
  378. struct i40e_device {
  379. struct list_head list;
  380. struct i40e_pf *pf;
  381. };
  382. /**
  383. * i40e_fw_version_str - format the FW and NVM version strings
  384. * @hw: ptr to the hardware info
  385. **/
  386. static inline char *i40e_fw_version_str(struct i40e_hw *hw)
  387. {
  388. static char buf[32];
  389. snprintf(buf, sizeof(buf),
  390. "f%d.%d a%d.%d n%02d.%02d.%02d e%08x",
  391. hw->aq.fw_maj_ver, hw->aq.fw_min_ver,
  392. hw->aq.api_maj_ver, hw->aq.api_min_ver,
  393. (hw->nvm.version & I40E_NVM_VERSION_HI_MASK)
  394. >> I40E_NVM_VERSION_HI_SHIFT,
  395. (hw->nvm.version & I40E_NVM_VERSION_MID_MASK)
  396. >> I40E_NVM_VERSION_MID_SHIFT,
  397. (hw->nvm.version & I40E_NVM_VERSION_LO_MASK)
  398. >> I40E_NVM_VERSION_LO_SHIFT,
  399. hw->nvm.eetrack);
  400. return buf;
  401. }
  402. /**
  403. * i40e_netdev_to_pf: Retrieve the PF struct for given netdev
  404. * @netdev: the corresponding netdev
  405. *
  406. * Return the PF struct for the given netdev
  407. **/
  408. static inline struct i40e_pf *i40e_netdev_to_pf(struct net_device *netdev)
  409. {
  410. struct i40e_netdev_priv *np = netdev_priv(netdev);
  411. struct i40e_vsi *vsi = np->vsi;
  412. return vsi->back;
  413. }
  414. static inline void i40e_vsi_setup_irqhandler(struct i40e_vsi *vsi,
  415. irqreturn_t (*irq_handler)(int, void *))
  416. {
  417. vsi->irq_handler = irq_handler;
  418. }
  419. /**
  420. * i40e_rx_is_programming_status - check for programming status descriptor
  421. * @qw: the first quad word of the program status descriptor
  422. *
  423. * The value of in the descriptor length field indicate if this
  424. * is a programming status descriptor for flow director or FCoE
  425. * by the value of I40E_RX_PROG_STATUS_DESC_LENGTH, otherwise
  426. * it is a packet descriptor.
  427. **/
  428. static inline bool i40e_rx_is_programming_status(u64 qw)
  429. {
  430. return I40E_RX_PROG_STATUS_DESC_LENGTH ==
  431. (qw >> I40E_RX_PROG_STATUS_DESC_LENGTH_SHIFT);
  432. }
  433. /* needed by i40e_ethtool.c */
  434. int i40e_up(struct i40e_vsi *vsi);
  435. void i40e_down(struct i40e_vsi *vsi);
  436. extern const char i40e_driver_name[];
  437. extern const char i40e_driver_version_str[];
  438. void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags);
  439. void i40e_update_stats(struct i40e_vsi *vsi);
  440. void i40e_update_eth_stats(struct i40e_vsi *vsi);
  441. struct rtnl_link_stats64 *i40e_get_vsi_stats_struct(struct i40e_vsi *vsi);
  442. int i40e_fetch_switch_configuration(struct i40e_pf *pf,
  443. bool printconfig);
  444. /* needed by i40e_main.c */
  445. void i40e_add_fdir_filter(struct i40e_fdir_data fdir_data,
  446. struct i40e_ring *tx_ring);
  447. void i40e_add_remove_filter(struct i40e_fdir_data fdir_data,
  448. struct i40e_ring *tx_ring);
  449. void i40e_update_fdir_filter(struct i40e_fdir_data fdir_data,
  450. struct i40e_ring *tx_ring);
  451. int i40e_program_fdir_filter(struct i40e_fdir_data *fdir_data,
  452. struct i40e_pf *pf, bool add);
  453. void i40e_set_ethtool_ops(struct net_device *netdev);
  454. struct i40e_mac_filter *i40e_add_filter(struct i40e_vsi *vsi,
  455. u8 *macaddr, s16 vlan,
  456. bool is_vf, bool is_netdev);
  457. void i40e_del_filter(struct i40e_vsi *vsi, u8 *macaddr, s16 vlan,
  458. bool is_vf, bool is_netdev);
  459. int i40e_sync_vsi_filters(struct i40e_vsi *vsi);
  460. struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf, u8 type,
  461. u16 uplink, u32 param1);
  462. int i40e_vsi_release(struct i40e_vsi *vsi);
  463. struct i40e_vsi *i40e_vsi_lookup(struct i40e_pf *pf, enum i40e_vsi_type type,
  464. struct i40e_vsi *start_vsi);
  465. struct i40e_veb *i40e_veb_setup(struct i40e_pf *pf, u16 flags, u16 uplink_seid,
  466. u16 downlink_seid, u8 enabled_tc);
  467. void i40e_veb_release(struct i40e_veb *veb);
  468. i40e_status i40e_vsi_add_pvid(struct i40e_vsi *vsi, u16 vid);
  469. void i40e_vsi_remove_pvid(struct i40e_vsi *vsi);
  470. void i40e_vsi_reset_stats(struct i40e_vsi *vsi);
  471. void i40e_pf_reset_stats(struct i40e_pf *pf);
  472. #ifdef CONFIG_DEBUG_FS
  473. void i40e_dbg_pf_init(struct i40e_pf *pf);
  474. void i40e_dbg_pf_exit(struct i40e_pf *pf);
  475. void i40e_dbg_init(void);
  476. void i40e_dbg_exit(void);
  477. #else
  478. static inline void i40e_dbg_pf_init(struct i40e_pf *pf) {}
  479. static inline void i40e_dbg_pf_exit(struct i40e_pf *pf) {}
  480. static inline void i40e_dbg_init(void) {}
  481. static inline void i40e_dbg_exit(void) {}
  482. #endif /* CONFIG_DEBUG_FS*/
  483. void i40e_irq_dynamic_enable(struct i40e_vsi *vsi, int vector);
  484. void i40e_irq_dynamic_enable_icr0(struct i40e_pf *pf);
  485. int i40e_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd);
  486. void i40e_vlan_stripping_disable(struct i40e_vsi *vsi);
  487. int i40e_vsi_add_vlan(struct i40e_vsi *vsi, s16 vid);
  488. int i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid);
  489. struct i40e_mac_filter *i40e_put_mac_in_vlan(struct i40e_vsi *vsi, u8 *macaddr,
  490. bool is_vf, bool is_netdev);
  491. bool i40e_is_vsi_in_vlan(struct i40e_vsi *vsi);
  492. struct i40e_mac_filter *i40e_find_mac(struct i40e_vsi *vsi, u8 *macaddr,
  493. bool is_vf, bool is_netdev);
  494. void i40e_vlan_stripping_enable(struct i40e_vsi *vsi);
  495. #endif /* _I40E_H_ */