i40e.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558
  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 <linux/version.h>
  48. #include <net/checksum.h>
  49. #include <net/ip6_checksum.h>
  50. #include <linux/ethtool.h>
  51. #include <linux/if_vlan.h>
  52. #include "i40e_type.h"
  53. #include "i40e_prototype.h"
  54. #include "i40e_virtchnl.h"
  55. #include "i40e_virtchnl_pf.h"
  56. #include "i40e_txrx.h"
  57. /* Useful i40e defaults */
  58. #define I40E_BASE_PF_SEID 16
  59. #define I40E_BASE_VSI_SEID 512
  60. #define I40E_BASE_VEB_SEID 288
  61. #define I40E_MAX_VEB 16
  62. #define I40E_MAX_NUM_DESCRIPTORS 4096
  63. #define I40E_MAX_REGISTER 0x0038FFFF
  64. #define I40E_DEFAULT_NUM_DESCRIPTORS 512
  65. #define I40E_REQ_DESCRIPTOR_MULTIPLE 32
  66. #define I40E_MIN_NUM_DESCRIPTORS 64
  67. #define I40E_MIN_MSIX 2
  68. #define I40E_DEFAULT_NUM_VMDQ_VSI 8 /* max 256 VSIs */
  69. #define I40E_DEFAULT_QUEUES_PER_VMDQ 2 /* max 16 qps */
  70. #define I40E_DEFAULT_QUEUES_PER_VF 4
  71. #define I40E_DEFAULT_QUEUES_PER_TC 1 /* should be a power of 2 */
  72. #define I40E_FDIR_RING 0
  73. #define I40E_FDIR_RING_COUNT 32
  74. #define I40E_MAX_AQ_BUF_SIZE 4096
  75. #define I40E_AQ_LEN 32
  76. #define I40E_AQ_WORK_LIMIT 16
  77. #define I40E_MAX_USER_PRIORITY 8
  78. #define I40E_DEFAULT_MSG_ENABLE 4
  79. #define I40E_NVM_VERSION_LO_SHIFT 0
  80. #define I40E_NVM_VERSION_LO_MASK (0xf << I40E_NVM_VERSION_LO_SHIFT)
  81. #define I40E_NVM_VERSION_MID_SHIFT 4
  82. #define I40E_NVM_VERSION_MID_MASK (0xff << I40E_NVM_VERSION_MID_SHIFT)
  83. #define I40E_NVM_VERSION_HI_SHIFT 12
  84. #define I40E_NVM_VERSION_HI_MASK (0xf << I40E_NVM_VERSION_HI_SHIFT)
  85. /* magic for getting defines into strings */
  86. #define STRINGIFY(foo) #foo
  87. #define XSTRINGIFY(bar) STRINGIFY(bar)
  88. #ifndef ARCH_HAS_PREFETCH
  89. #define prefetch(X)
  90. #endif
  91. #define I40E_RX_DESC(R, i) \
  92. ((ring_is_16byte_desc_enabled(R)) \
  93. ? (union i40e_32byte_rx_desc *) \
  94. (&(((union i40e_16byte_rx_desc *)((R)->desc))[i])) \
  95. : (&(((union i40e_32byte_rx_desc *)((R)->desc))[i])))
  96. #define I40E_TX_DESC(R, i) \
  97. (&(((struct i40e_tx_desc *)((R)->desc))[i]))
  98. #define I40E_TX_CTXTDESC(R, i) \
  99. (&(((struct i40e_tx_context_desc *)((R)->desc))[i]))
  100. #define I40E_TX_FDIRDESC(R, i) \
  101. (&(((struct i40e_filter_program_desc *)((R)->desc))[i]))
  102. /* default to trying for four seconds */
  103. #define I40E_TRY_LINK_TIMEOUT (4 * HZ)
  104. /* driver state flags */
  105. enum i40e_state_t {
  106. __I40E_TESTING,
  107. __I40E_CONFIG_BUSY,
  108. __I40E_CONFIG_DONE,
  109. __I40E_DOWN,
  110. __I40E_NEEDS_RESTART,
  111. __I40E_SERVICE_SCHED,
  112. __I40E_ADMINQ_EVENT_PENDING,
  113. __I40E_MDD_EVENT_PENDING,
  114. __I40E_VFLR_EVENT_PENDING,
  115. __I40E_RESET_RECOVERY_PENDING,
  116. __I40E_RESET_INTR_RECEIVED,
  117. __I40E_REINIT_REQUESTED,
  118. __I40E_PF_RESET_REQUESTED,
  119. __I40E_CORE_RESET_REQUESTED,
  120. __I40E_GLOBAL_RESET_REQUESTED,
  121. __I40E_FILTER_OVERFLOW_PROMISC,
  122. };
  123. enum i40e_interrupt_policy {
  124. I40E_INTERRUPT_BEST_CASE,
  125. I40E_INTERRUPT_MEDIUM,
  126. I40E_INTERRUPT_LOWEST
  127. };
  128. struct i40e_lump_tracking {
  129. u16 num_entries;
  130. u16 search_hint;
  131. u16 list[0];
  132. #define I40E_PILE_VALID_BIT 0x8000
  133. };
  134. #define I40E_DEFAULT_ATR_SAMPLE_RATE 20
  135. #define I40E_FDIR_MAX_RAW_PACKET_LOOKUP 512
  136. struct i40e_fdir_data {
  137. u16 q_index;
  138. u8 flex_off;
  139. u8 pctype;
  140. u16 dest_vsi;
  141. u8 dest_ctl;
  142. u8 fd_status;
  143. u16 cnt_index;
  144. u32 fd_id;
  145. u8 *raw_packet;
  146. };
  147. #define I40E_DCB_PRIO_TYPE_STRICT 0
  148. #define I40E_DCB_PRIO_TYPE_ETS 1
  149. #define I40E_DCB_STRICT_PRIO_CREDITS 127
  150. #define I40E_MAX_USER_PRIORITY 8
  151. /* DCB per TC information data structure */
  152. struct i40e_tc_info {
  153. u16 qoffset; /* Queue offset from base queue */
  154. u16 qcount; /* Total Queues */
  155. u8 netdev_tc; /* Netdev TC index if netdev associated */
  156. };
  157. /* TC configuration data structure */
  158. struct i40e_tc_configuration {
  159. u8 numtc; /* Total number of enabled TCs */
  160. u8 enabled_tc; /* TC map */
  161. struct i40e_tc_info tc_info[I40E_MAX_TRAFFIC_CLASS];
  162. };
  163. /* struct that defines the Ethernet device */
  164. struct i40e_pf {
  165. struct pci_dev *pdev;
  166. struct i40e_hw hw;
  167. unsigned long state;
  168. unsigned long link_check_timeout;
  169. struct msix_entry *msix_entries;
  170. u16 num_msix_entries;
  171. bool fc_autoneg_status;
  172. u16 eeprom_version;
  173. u16 num_vmdq_vsis; /* num vmdq pools this pf has set up */
  174. u16 num_vmdq_qps; /* num queue pairs per vmdq pool */
  175. u16 num_vmdq_msix; /* num queue vectors per vmdq pool */
  176. u16 num_req_vfs; /* num vfs requested for this vf */
  177. u16 num_vf_qps; /* num queue pairs per vf */
  178. u16 num_tc_qps; /* num queue pairs per TC */
  179. u16 num_lan_qps; /* num lan queues this pf has set up */
  180. u16 num_lan_msix; /* num queue vectors for the base pf vsi */
  181. u16 rss_size; /* num queues in the RSS array */
  182. u16 rss_size_max; /* HW defined max RSS queues */
  183. u16 fdir_pf_filter_count; /* num of guaranteed filters for this PF */
  184. u8 atr_sample_rate;
  185. enum i40e_interrupt_policy int_policy;
  186. u16 rx_itr_default;
  187. u16 tx_itr_default;
  188. u16 msg_enable;
  189. char misc_int_name[IFNAMSIZ + 9];
  190. u16 adminq_work_limit; /* num of admin receive queue desc to process */
  191. int service_timer_period;
  192. struct timer_list service_timer;
  193. struct work_struct service_task;
  194. u64 flags;
  195. #define I40E_FLAG_RX_CSUM_ENABLED (u64)(1 << 1)
  196. #define I40E_FLAG_MSI_ENABLED (u64)(1 << 2)
  197. #define I40E_FLAG_MSIX_ENABLED (u64)(1 << 3)
  198. #define I40E_FLAG_RX_1BUF_ENABLED (u64)(1 << 4)
  199. #define I40E_FLAG_RX_PS_ENABLED (u64)(1 << 5)
  200. #define I40E_FLAG_RSS_ENABLED (u64)(1 << 6)
  201. #define I40E_FLAG_MQ_ENABLED (u64)(1 << 7)
  202. #define I40E_FLAG_VMDQ_ENABLED (u64)(1 << 8)
  203. #define I40E_FLAG_FDIR_REQUIRES_REINIT (u64)(1 << 9)
  204. #define I40E_FLAG_NEED_LINK_UPDATE (u64)(1 << 10)
  205. #define I40E_FLAG_IN_NETPOLL (u64)(1 << 13)
  206. #define I40E_FLAG_16BYTE_RX_DESC_ENABLED (u64)(1 << 14)
  207. #define I40E_FLAG_CLEAN_ADMINQ (u64)(1 << 15)
  208. #define I40E_FLAG_FILTER_SYNC (u64)(1 << 16)
  209. #define I40E_FLAG_PROCESS_MDD_EVENT (u64)(1 << 18)
  210. #define I40E_FLAG_PROCESS_VFLR_EVENT (u64)(1 << 19)
  211. #define I40E_FLAG_SRIOV_ENABLED (u64)(1 << 20)
  212. #define I40E_FLAG_DCB_ENABLED (u64)(1 << 21)
  213. #define I40E_FLAG_FDIR_ENABLED (u64)(1 << 22)
  214. #define I40E_FLAG_FDIR_ATR_ENABLED (u64)(1 << 23)
  215. #define I40E_FLAG_MFP_ENABLED (u64)(1 << 27)
  216. u16 num_tx_queues;
  217. u16 num_rx_queues;
  218. bool stat_offsets_loaded;
  219. struct i40e_hw_port_stats stats;
  220. struct i40e_hw_port_stats stats_offsets;
  221. u32 tx_timeout_count;
  222. u32 tx_timeout_recovery_level;
  223. unsigned long tx_timeout_last_recovery;
  224. u32 hw_csum_rx_error;
  225. u32 led_status;
  226. u16 corer_count; /* Core reset count */
  227. u16 globr_count; /* Global reset count */
  228. u16 empr_count; /* EMP reset count */
  229. u16 pfr_count; /* PF reset count */
  230. struct mutex switch_mutex;
  231. u16 lan_vsi; /* our default LAN VSI */
  232. u16 lan_veb; /* initial relay, if exists */
  233. #define I40E_NO_VEB 0xffff
  234. #define I40E_NO_VSI 0xffff
  235. u16 next_vsi; /* Next unallocated VSI - 0-based! */
  236. struct i40e_vsi **vsi;
  237. struct i40e_veb *veb[I40E_MAX_VEB];
  238. struct i40e_lump_tracking *qp_pile;
  239. struct i40e_lump_tracking *irq_pile;
  240. /* switch config info */
  241. u16 pf_seid;
  242. u16 main_vsi_seid;
  243. u16 mac_seid;
  244. struct i40e_aqc_get_switch_config_data *sw_config;
  245. struct kobject *switch_kobj;
  246. #ifdef CONFIG_DEBUG_FS
  247. struct dentry *i40e_dbg_pf;
  248. #endif /* CONFIG_DEBUG_FS */
  249. /* sr-iov config info */
  250. struct i40e_vf *vf;
  251. int num_alloc_vfs; /* actual number of VFs allocated */
  252. u32 vf_aq_requests;
  253. /* DCBx/DCBNL capability for PF that indicates
  254. * whether DCBx is managed by firmware or host
  255. * based agent (LLDPAD). Also, indicates what
  256. * flavor of DCBx protocol (IEEE/CEE) is supported
  257. * by the device. For now we're supporting IEEE
  258. * mode only.
  259. */
  260. u16 dcbx_cap;
  261. u32 fcoe_hmc_filt_num;
  262. u32 fcoe_hmc_cntx_num;
  263. struct i40e_filter_control_settings filter_settings;
  264. };
  265. struct i40e_mac_filter {
  266. struct list_head list;
  267. u8 macaddr[ETH_ALEN];
  268. #define I40E_VLAN_ANY -1
  269. s16 vlan;
  270. u8 counter; /* number of instances of this filter */
  271. bool is_vf; /* filter belongs to a VF */
  272. bool is_netdev; /* filter belongs to a netdev */
  273. bool changed; /* filter needs to be sync'd to the HW */
  274. };
  275. struct i40e_veb {
  276. struct i40e_pf *pf;
  277. u16 idx;
  278. u16 veb_idx; /* index of VEB parent */
  279. u16 seid;
  280. u16 uplink_seid;
  281. u16 stats_idx; /* index of VEB parent */
  282. u8 enabled_tc;
  283. u16 flags;
  284. u16 bw_limit;
  285. u8 bw_max_quanta;
  286. bool is_abs_credits;
  287. u8 bw_tc_share_credits[I40E_MAX_TRAFFIC_CLASS];
  288. u16 bw_tc_limit_credits[I40E_MAX_TRAFFIC_CLASS];
  289. u8 bw_tc_max_quanta[I40E_MAX_TRAFFIC_CLASS];
  290. struct kobject *kobj;
  291. bool stat_offsets_loaded;
  292. struct i40e_eth_stats stats;
  293. struct i40e_eth_stats stats_offsets;
  294. };
  295. /* struct that defines a VSI, associated with a dev */
  296. struct i40e_vsi {
  297. struct net_device *netdev;
  298. unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
  299. bool netdev_registered;
  300. bool stat_offsets_loaded;
  301. u32 current_netdev_flags;
  302. unsigned long state;
  303. #define I40E_VSI_FLAG_FILTER_CHANGED (1<<0)
  304. #define I40E_VSI_FLAG_VEB_OWNER (1<<1)
  305. unsigned long flags;
  306. struct list_head mac_filter_list;
  307. /* VSI stats */
  308. struct rtnl_link_stats64 net_stats;
  309. struct rtnl_link_stats64 net_stats_offsets;
  310. struct i40e_eth_stats eth_stats;
  311. struct i40e_eth_stats eth_stats_offsets;
  312. u32 tx_restart;
  313. u32 tx_busy;
  314. u32 rx_buf_failed;
  315. u32 rx_page_failed;
  316. /* These are arrays of rings, allocated at run-time */
  317. struct i40e_ring *rx_rings;
  318. struct i40e_ring *tx_rings;
  319. u16 work_limit;
  320. /* high bit set means dynamic, use accessor routines to read/write.
  321. * hardware only supports 2us resolution for the ITR registers.
  322. * these values always store the USER setting, and must be converted
  323. * before programming to a register.
  324. */
  325. u16 rx_itr_setting;
  326. u16 tx_itr_setting;
  327. u16 max_frame;
  328. u16 rx_hdr_len;
  329. u16 rx_buf_len;
  330. u8 dtype;
  331. /* List of q_vectors allocated to this VSI */
  332. struct i40e_q_vector *q_vectors;
  333. int num_q_vectors;
  334. int base_vector;
  335. u16 seid; /* HW index of this VSI (absolute index) */
  336. u16 id; /* VSI number */
  337. u16 uplink_seid;
  338. u16 base_queue; /* vsi's first queue in hw array */
  339. u16 alloc_queue_pairs; /* Allocated Tx/Rx queues */
  340. u16 num_queue_pairs; /* Used tx and rx pairs */
  341. u16 num_desc;
  342. enum i40e_vsi_type type; /* VSI type, e.g., LAN, FCoE, etc */
  343. u16 vf_id; /* Virtual function ID for SRIOV VSIs */
  344. struct i40e_tc_configuration tc_config;
  345. struct i40e_aqc_vsi_properties_data info;
  346. /* VSI BW limit (absolute across all TCs) */
  347. u16 bw_limit; /* VSI BW Limit (0 = disabled) */
  348. u8 bw_max_quanta; /* Max Quanta when BW limit is enabled */
  349. /* Relative TC credits across VSIs */
  350. u8 bw_ets_share_credits[I40E_MAX_TRAFFIC_CLASS];
  351. /* TC BW limit credits within VSI */
  352. u16 bw_ets_limit_credits[I40E_MAX_TRAFFIC_CLASS];
  353. /* TC BW limit max quanta within VSI */
  354. u8 bw_ets_max_quanta[I40E_MAX_TRAFFIC_CLASS];
  355. struct i40e_pf *back; /* Backreference to associated PF */
  356. u16 idx; /* index in pf->vsi[] */
  357. u16 veb_idx; /* index of VEB parent */
  358. struct kobject *kobj; /* sysfs object */
  359. /* VSI specific handlers */
  360. irqreturn_t (*irq_handler)(int irq, void *data);
  361. } ____cacheline_internodealigned_in_smp;
  362. struct i40e_netdev_priv {
  363. struct i40e_vsi *vsi;
  364. };
  365. /* struct that defines an interrupt vector */
  366. struct i40e_q_vector {
  367. struct i40e_vsi *vsi;
  368. u16 v_idx; /* index in the vsi->q_vector array. */
  369. u16 reg_idx; /* register index of the interrupt */
  370. struct napi_struct napi;
  371. struct i40e_ring_container rx;
  372. struct i40e_ring_container tx;
  373. u8 num_ringpairs; /* total number of ring pairs in vector */
  374. char name[IFNAMSIZ + 9];
  375. cpumask_t affinity_mask;
  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. int i40e_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd);
  485. void i40e_vlan_stripping_disable(struct i40e_vsi *vsi);
  486. int i40e_vsi_add_vlan(struct i40e_vsi *vsi, s16 vid);
  487. int i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid);
  488. struct i40e_mac_filter *i40e_put_mac_in_vlan(struct i40e_vsi *vsi, u8 *macaddr,
  489. bool is_vf, bool is_netdev);
  490. bool i40e_is_vsi_in_vlan(struct i40e_vsi *vsi);
  491. struct i40e_mac_filter *i40e_find_mac(struct i40e_vsi *vsi, u8 *macaddr,
  492. bool is_vf, bool is_netdev);
  493. void i40e_vlan_stripping_enable(struct i40e_vsi *vsi);
  494. #endif /* _I40E_H_ */