i40e.h 18 KB

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