mlx4_en.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  1. /*
  2. * Copyright (c) 2007 Mellanox Technologies. All rights reserved.
  3. *
  4. * This software is available to you under a choice of one of two
  5. * licenses. You may choose to be licensed under the terms of the GNU
  6. * General Public License (GPL) Version 2, available from the file
  7. * COPYING in the main directory of this source tree, or the
  8. * OpenIB.org BSD license below:
  9. *
  10. * Redistribution and use in source and binary forms, with or
  11. * without modification, are permitted provided that the following
  12. * conditions are met:
  13. *
  14. * - Redistributions of source code must retain the above
  15. * copyright notice, this list of conditions and the following
  16. * disclaimer.
  17. *
  18. * - Redistributions in binary form must reproduce the above
  19. * copyright notice, this list of conditions and the following
  20. * disclaimer in the documentation and/or other materials
  21. * provided with the distribution.
  22. *
  23. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  24. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  25. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  26. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  27. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  28. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  29. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  30. * SOFTWARE.
  31. *
  32. */
  33. #ifndef _MLX4_EN_H_
  34. #define _MLX4_EN_H_
  35. #include <linux/compiler.h>
  36. #include <linux/list.h>
  37. #include <linux/mutex.h>
  38. #include <linux/netdevice.h>
  39. #include <linux/inet_lro.h>
  40. #include <linux/mlx4/device.h>
  41. #include <linux/mlx4/qp.h>
  42. #include <linux/mlx4/cq.h>
  43. #include <linux/mlx4/srq.h>
  44. #include <linux/mlx4/doorbell.h>
  45. #include "en_port.h"
  46. #define DRV_NAME "mlx4_en"
  47. #define DRV_VERSION "1.4.0"
  48. #define DRV_RELDATE "Sep 2008"
  49. #define MLX4_EN_MSG_LEVEL (NETIF_MSG_LINK | NETIF_MSG_IFDOWN)
  50. #define mlx4_dbg(mlevel, priv, format, arg...) \
  51. if (NETIF_MSG_##mlevel & priv->msg_enable) \
  52. printk(KERN_DEBUG "%s %s: " format , DRV_NAME ,\
  53. (dev_name(&priv->mdev->pdev->dev)) , ## arg)
  54. #define mlx4_err(mdev, format, arg...) \
  55. printk(KERN_ERR "%s %s: " format , DRV_NAME ,\
  56. (dev_name(&mdev->pdev->dev)) , ## arg)
  57. #define mlx4_info(mdev, format, arg...) \
  58. printk(KERN_INFO "%s %s: " format , DRV_NAME ,\
  59. (dev_name(&mdev->pdev->dev)) , ## arg)
  60. #define mlx4_warn(mdev, format, arg...) \
  61. printk(KERN_WARNING "%s %s: " format , DRV_NAME ,\
  62. (dev_name(&mdev->pdev->dev)) , ## arg)
  63. /*
  64. * Device constants
  65. */
  66. #define MLX4_EN_PAGE_SHIFT 12
  67. #define MLX4_EN_PAGE_SIZE (1 << MLX4_EN_PAGE_SHIFT)
  68. #define MAX_TX_RINGS 16
  69. #define MAX_RX_RINGS 16
  70. #define MAX_RSS_MAP_SIZE 64
  71. #define RSS_FACTOR 2
  72. #define TXBB_SIZE 64
  73. #define HEADROOM (2048 / TXBB_SIZE + 1)
  74. #define MAX_LSO_HDR_SIZE 92
  75. #define STAMP_STRIDE 64
  76. #define STAMP_DWORDS (STAMP_STRIDE / 4)
  77. #define STAMP_SHIFT 31
  78. #define STAMP_VAL 0x7fffffff
  79. #define STATS_DELAY (HZ / 4)
  80. /* Typical TSO descriptor with 16 gather entries is 352 bytes... */
  81. #define MAX_DESC_SIZE 512
  82. #define MAX_DESC_TXBBS (MAX_DESC_SIZE / TXBB_SIZE)
  83. /*
  84. * OS related constants and tunables
  85. */
  86. #define MLX4_EN_WATCHDOG_TIMEOUT (15 * HZ)
  87. #define MLX4_EN_ALLOC_ORDER 2
  88. #define MLX4_EN_ALLOC_SIZE (PAGE_SIZE << MLX4_EN_ALLOC_ORDER)
  89. #define MLX4_EN_MAX_LRO_DESCRIPTORS 32
  90. /* Receive fragment sizes; we use at most 4 fragments (for 9600 byte MTU
  91. * and 4K allocations) */
  92. enum {
  93. FRAG_SZ0 = 512 - NET_IP_ALIGN,
  94. FRAG_SZ1 = 1024,
  95. FRAG_SZ2 = 4096,
  96. FRAG_SZ3 = MLX4_EN_ALLOC_SIZE
  97. };
  98. #define MLX4_EN_MAX_RX_FRAGS 4
  99. /* Minimum ring size for our page-allocation sceme to work */
  100. #define MLX4_EN_MIN_RX_SIZE (MLX4_EN_ALLOC_SIZE / SMP_CACHE_BYTES)
  101. #define MLX4_EN_MIN_TX_SIZE (4096 / TXBB_SIZE)
  102. #define MLX4_EN_TX_RING_NUM 9
  103. #define MLX4_EN_DEF_TX_RING_SIZE 1024
  104. #define MLX4_EN_DEF_RX_RING_SIZE 1024
  105. /* Target number of bytes to coalesce with interrupt moderation */
  106. #define MLX4_EN_RX_COAL_TARGET 0x20000
  107. #define MLX4_EN_RX_COAL_TIME 0x10
  108. #define MLX4_EN_TX_COAL_PKTS 5
  109. #define MLX4_EN_TX_COAL_TIME 0x80
  110. #define MLX4_EN_RX_RATE_LOW 400000
  111. #define MLX4_EN_RX_COAL_TIME_LOW 0
  112. #define MLX4_EN_RX_RATE_HIGH 450000
  113. #define MLX4_EN_RX_COAL_TIME_HIGH 128
  114. #define MLX4_EN_RX_SIZE_THRESH 1024
  115. #define MLX4_EN_RX_RATE_THRESH (1000000 / MLX4_EN_RX_COAL_TIME_HIGH)
  116. #define MLX4_EN_SAMPLE_INTERVAL 0
  117. #define MLX4_EN_AUTO_CONF 0xffff
  118. #define MLX4_EN_DEF_RX_PAUSE 1
  119. #define MLX4_EN_DEF_TX_PAUSE 1
  120. /* Interval between sucessive polls in the Tx routine when polling is used
  121. instead of interrupts (in per-core Tx rings) - should be power of 2 */
  122. #define MLX4_EN_TX_POLL_MODER 16
  123. #define MLX4_EN_TX_POLL_TIMEOUT (HZ / 4)
  124. #define ETH_LLC_SNAP_SIZE 8
  125. #define SMALL_PACKET_SIZE (256 - NET_IP_ALIGN)
  126. #define HEADER_COPY_SIZE (128 - NET_IP_ALIGN)
  127. #define MLX4_EN_MIN_MTU 46
  128. #define ETH_BCAST 0xffffffffffffULL
  129. #ifdef MLX4_EN_PERF_STAT
  130. /* Number of samples to 'average' */
  131. #define AVG_SIZE 128
  132. #define AVG_FACTOR 1024
  133. #define NUM_PERF_STATS NUM_PERF_COUNTERS
  134. #define INC_PERF_COUNTER(cnt) (++(cnt))
  135. #define ADD_PERF_COUNTER(cnt, add) ((cnt) += (add))
  136. #define AVG_PERF_COUNTER(cnt, sample) \
  137. ((cnt) = ((cnt) * (AVG_SIZE - 1) + (sample) * AVG_FACTOR) / AVG_SIZE)
  138. #define GET_PERF_COUNTER(cnt) (cnt)
  139. #define GET_AVG_PERF_COUNTER(cnt) ((cnt) / AVG_FACTOR)
  140. #else
  141. #define NUM_PERF_STATS 0
  142. #define INC_PERF_COUNTER(cnt) do {} while (0)
  143. #define ADD_PERF_COUNTER(cnt, add) do {} while (0)
  144. #define AVG_PERF_COUNTER(cnt, sample) do {} while (0)
  145. #define GET_PERF_COUNTER(cnt) (0)
  146. #define GET_AVG_PERF_COUNTER(cnt) (0)
  147. #endif /* MLX4_EN_PERF_STAT */
  148. /*
  149. * Configurables
  150. */
  151. enum cq_type {
  152. RX = 0,
  153. TX = 1,
  154. };
  155. /*
  156. * Useful macros
  157. */
  158. #define ROUNDUP_LOG2(x) ilog2(roundup_pow_of_two(x))
  159. #define XNOR(x, y) (!(x) == !(y))
  160. #define ILLEGAL_MAC(addr) (addr == 0xffffffffffffULL || addr == 0x0)
  161. struct mlx4_en_tx_info {
  162. struct sk_buff *skb;
  163. u32 nr_txbb;
  164. u8 linear;
  165. u8 data_offset;
  166. };
  167. #define MLX4_EN_BIT_DESC_OWN 0x80000000
  168. #define CTRL_SIZE sizeof(struct mlx4_wqe_ctrl_seg)
  169. #define MLX4_EN_MEMTYPE_PAD 0x100
  170. #define DS_SIZE sizeof(struct mlx4_wqe_data_seg)
  171. struct mlx4_en_tx_desc {
  172. struct mlx4_wqe_ctrl_seg ctrl;
  173. union {
  174. struct mlx4_wqe_data_seg data; /* at least one data segment */
  175. struct mlx4_wqe_lso_seg lso;
  176. struct mlx4_wqe_inline_seg inl;
  177. };
  178. };
  179. #define MLX4_EN_USE_SRQ 0x01000000
  180. struct mlx4_en_rx_alloc {
  181. struct page *page;
  182. u16 offset;
  183. };
  184. struct mlx4_en_tx_ring {
  185. struct mlx4_hwq_resources wqres;
  186. u32 size ; /* number of TXBBs */
  187. u32 size_mask;
  188. u16 stride;
  189. u16 cqn; /* index of port CQ associated with this ring */
  190. u32 prod;
  191. u32 cons;
  192. u32 buf_size;
  193. u32 doorbell_qpn;
  194. void *buf;
  195. u16 poll_cnt;
  196. int blocked;
  197. struct mlx4_en_tx_info *tx_info;
  198. u8 *bounce_buf;
  199. u32 last_nr_txbb;
  200. struct mlx4_qp qp;
  201. struct mlx4_qp_context context;
  202. int qpn;
  203. enum mlx4_qp_state qp_state;
  204. struct mlx4_srq dummy;
  205. unsigned long bytes;
  206. unsigned long packets;
  207. spinlock_t comp_lock;
  208. };
  209. struct mlx4_en_rx_desc {
  210. struct mlx4_wqe_srq_next_seg next;
  211. /* actual number of entries depends on rx ring stride */
  212. struct mlx4_wqe_data_seg data[0];
  213. };
  214. struct mlx4_en_rx_ring {
  215. struct mlx4_srq srq;
  216. struct mlx4_hwq_resources wqres;
  217. struct mlx4_en_rx_alloc page_alloc[MLX4_EN_MAX_RX_FRAGS];
  218. struct net_lro_mgr lro;
  219. u32 size ; /* number of Rx descs*/
  220. u32 actual_size;
  221. u32 size_mask;
  222. u16 stride;
  223. u16 log_stride;
  224. u16 cqn; /* index of port CQ associated with this ring */
  225. u32 prod;
  226. u32 cons;
  227. u32 buf_size;
  228. int need_refill;
  229. int full;
  230. void *buf;
  231. void *rx_info;
  232. unsigned long bytes;
  233. unsigned long packets;
  234. };
  235. static inline int mlx4_en_can_lro(__be16 status)
  236. {
  237. return (status & cpu_to_be16(MLX4_CQE_STATUS_IPV4 |
  238. MLX4_CQE_STATUS_IPV4F |
  239. MLX4_CQE_STATUS_IPV6 |
  240. MLX4_CQE_STATUS_IPV4OPT |
  241. MLX4_CQE_STATUS_TCP |
  242. MLX4_CQE_STATUS_UDP |
  243. MLX4_CQE_STATUS_IPOK)) ==
  244. cpu_to_be16(MLX4_CQE_STATUS_IPV4 |
  245. MLX4_CQE_STATUS_IPOK |
  246. MLX4_CQE_STATUS_TCP);
  247. }
  248. struct mlx4_en_cq {
  249. struct mlx4_cq mcq;
  250. struct mlx4_hwq_resources wqres;
  251. int ring;
  252. spinlock_t lock;
  253. struct net_device *dev;
  254. struct napi_struct napi;
  255. /* Per-core Tx cq processing support */
  256. struct timer_list timer;
  257. int size;
  258. int buf_size;
  259. unsigned vector;
  260. enum cq_type is_tx;
  261. u16 moder_time;
  262. u16 moder_cnt;
  263. struct mlx4_cqe *buf;
  264. #define MLX4_EN_OPCODE_ERROR 0x1e
  265. };
  266. struct mlx4_en_port_profile {
  267. u32 flags;
  268. u32 tx_ring_num;
  269. u32 rx_ring_num;
  270. u32 tx_ring_size;
  271. u32 rx_ring_size;
  272. u8 rx_pause;
  273. u8 rx_ppp;
  274. u8 tx_pause;
  275. u8 tx_ppp;
  276. };
  277. struct mlx4_en_profile {
  278. int rss_xor;
  279. int num_lro;
  280. u8 rss_mask;
  281. u32 active_ports;
  282. u32 small_pkt_int;
  283. u8 no_reset;
  284. struct mlx4_en_port_profile prof[MLX4_MAX_PORTS + 1];
  285. };
  286. struct mlx4_en_dev {
  287. struct mlx4_dev *dev;
  288. struct pci_dev *pdev;
  289. struct mutex state_lock;
  290. struct net_device *pndev[MLX4_MAX_PORTS + 1];
  291. u32 port_cnt;
  292. bool device_up;
  293. struct mlx4_en_profile profile;
  294. u32 LSO_support;
  295. struct workqueue_struct *workqueue;
  296. struct device *dma_device;
  297. void __iomem *uar_map;
  298. struct mlx4_uar priv_uar;
  299. struct mlx4_mr mr;
  300. u32 priv_pdn;
  301. spinlock_t uar_lock;
  302. };
  303. struct mlx4_en_rss_map {
  304. int size;
  305. int base_qpn;
  306. u16 map[MAX_RSS_MAP_SIZE];
  307. struct mlx4_qp qps[MAX_RSS_MAP_SIZE];
  308. enum mlx4_qp_state state[MAX_RSS_MAP_SIZE];
  309. struct mlx4_qp indir_qp;
  310. enum mlx4_qp_state indir_state;
  311. };
  312. struct mlx4_en_rss_context {
  313. __be32 base_qpn;
  314. __be32 default_qpn;
  315. u16 reserved;
  316. u8 hash_fn;
  317. u8 flags;
  318. __be32 rss_key[10];
  319. };
  320. struct mlx4_en_pkt_stats {
  321. unsigned long broadcast;
  322. unsigned long rx_prio[8];
  323. unsigned long tx_prio[8];
  324. #define NUM_PKT_STATS 17
  325. };
  326. struct mlx4_en_port_stats {
  327. unsigned long lro_aggregated;
  328. unsigned long lro_flushed;
  329. unsigned long lro_no_desc;
  330. unsigned long tso_packets;
  331. unsigned long queue_stopped;
  332. unsigned long wake_queue;
  333. unsigned long tx_timeout;
  334. unsigned long rx_alloc_failed;
  335. unsigned long rx_chksum_good;
  336. unsigned long rx_chksum_none;
  337. unsigned long tx_chksum_offload;
  338. #define NUM_PORT_STATS 11
  339. };
  340. struct mlx4_en_perf_stats {
  341. u32 tx_poll;
  342. u64 tx_pktsz_avg;
  343. u32 inflight_avg;
  344. u16 tx_coal_avg;
  345. u16 rx_coal_avg;
  346. u32 napi_quota;
  347. #define NUM_PERF_COUNTERS 6
  348. };
  349. struct mlx4_en_frag_info {
  350. u16 frag_size;
  351. u16 frag_prefix_size;
  352. u16 frag_stride;
  353. u16 frag_align;
  354. u16 last_offset;
  355. };
  356. struct mlx4_en_priv {
  357. struct mlx4_en_dev *mdev;
  358. struct mlx4_en_port_profile *prof;
  359. struct net_device *dev;
  360. struct vlan_group *vlgrp;
  361. struct net_device_stats stats;
  362. struct net_device_stats ret_stats;
  363. spinlock_t stats_lock;
  364. unsigned long last_moder_packets;
  365. unsigned long last_moder_tx_packets;
  366. unsigned long last_moder_bytes;
  367. unsigned long last_moder_jiffies;
  368. int last_moder_time;
  369. u16 rx_usecs;
  370. u16 rx_frames;
  371. u16 tx_usecs;
  372. u16 tx_frames;
  373. u32 pkt_rate_low;
  374. u16 rx_usecs_low;
  375. u32 pkt_rate_high;
  376. u16 rx_usecs_high;
  377. u16 sample_interval;
  378. u16 adaptive_rx_coal;
  379. u32 msg_enable;
  380. struct mlx4_hwq_resources res;
  381. int link_state;
  382. int last_link_state;
  383. bool port_up;
  384. int port;
  385. int registered;
  386. int allocated;
  387. int stride;
  388. int rx_csum;
  389. u64 mac;
  390. int mac_index;
  391. unsigned max_mtu;
  392. int base_qpn;
  393. struct mlx4_en_rss_map rss_map;
  394. u16 tx_prio_map[8];
  395. u32 flags;
  396. #define MLX4_EN_FLAG_PROMISC 0x1
  397. u32 tx_ring_num;
  398. u32 rx_ring_num;
  399. u32 rx_skb_size;
  400. struct mlx4_en_frag_info frag_info[MLX4_EN_MAX_RX_FRAGS];
  401. u16 num_frags;
  402. u16 log_rx_info;
  403. struct mlx4_en_tx_ring tx_ring[MAX_TX_RINGS];
  404. struct mlx4_en_rx_ring rx_ring[MAX_RX_RINGS];
  405. struct mlx4_en_cq tx_cq[MAX_TX_RINGS];
  406. struct mlx4_en_cq rx_cq[MAX_RX_RINGS];
  407. struct work_struct mcast_task;
  408. struct work_struct mac_task;
  409. struct delayed_work refill_task;
  410. struct work_struct watchdog_task;
  411. struct work_struct linkstate_task;
  412. struct delayed_work stats_task;
  413. struct mlx4_en_perf_stats pstats;
  414. struct mlx4_en_pkt_stats pkstats;
  415. struct mlx4_en_port_stats port_stats;
  416. struct dev_mc_list *mc_list;
  417. struct mlx4_en_stat_out_mbox hw_stats;
  418. };
  419. void mlx4_en_destroy_netdev(struct net_device *dev);
  420. int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
  421. struct mlx4_en_port_profile *prof);
  422. int mlx4_en_start_port(struct net_device *dev);
  423. void mlx4_en_stop_port(struct net_device *dev);
  424. void mlx4_en_free_resources(struct mlx4_en_priv *priv);
  425. int mlx4_en_alloc_resources(struct mlx4_en_priv *priv);
  426. int mlx4_en_get_profile(struct mlx4_en_dev *mdev);
  427. int mlx4_en_create_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq,
  428. int entries, int ring, enum cq_type mode);
  429. void mlx4_en_destroy_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq);
  430. int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq);
  431. void mlx4_en_deactivate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq);
  432. int mlx4_en_set_cq_moder(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq);
  433. int mlx4_en_arm_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq);
  434. void mlx4_en_poll_tx_cq(unsigned long data);
  435. void mlx4_en_tx_irq(struct mlx4_cq *mcq);
  436. int mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev);
  437. int mlx4_en_create_tx_ring(struct mlx4_en_priv *priv, struct mlx4_en_tx_ring *ring,
  438. u32 size, u16 stride);
  439. void mlx4_en_destroy_tx_ring(struct mlx4_en_priv *priv, struct mlx4_en_tx_ring *ring);
  440. int mlx4_en_activate_tx_ring(struct mlx4_en_priv *priv,
  441. struct mlx4_en_tx_ring *ring,
  442. int cq, int srqn);
  443. void mlx4_en_deactivate_tx_ring(struct mlx4_en_priv *priv,
  444. struct mlx4_en_tx_ring *ring);
  445. int mlx4_en_create_rx_ring(struct mlx4_en_priv *priv,
  446. struct mlx4_en_rx_ring *ring,
  447. u32 size, u16 stride);
  448. void mlx4_en_destroy_rx_ring(struct mlx4_en_priv *priv,
  449. struct mlx4_en_rx_ring *ring);
  450. int mlx4_en_activate_rx_rings(struct mlx4_en_priv *priv);
  451. void mlx4_en_deactivate_rx_ring(struct mlx4_en_priv *priv,
  452. struct mlx4_en_rx_ring *ring);
  453. int mlx4_en_process_rx_cq(struct net_device *dev,
  454. struct mlx4_en_cq *cq,
  455. int budget);
  456. int mlx4_en_poll_rx_cq(struct napi_struct *napi, int budget);
  457. void mlx4_en_fill_qp_context(struct mlx4_en_priv *priv, int size, int stride,
  458. int is_tx, int rss, int qpn, int cqn, int srqn,
  459. struct mlx4_qp_context *context);
  460. int mlx4_en_map_buffer(struct mlx4_buf *buf);
  461. void mlx4_en_unmap_buffer(struct mlx4_buf *buf);
  462. void mlx4_en_calc_rx_buf(struct net_device *dev);
  463. void mlx4_en_set_default_rss_map(struct mlx4_en_priv *priv,
  464. struct mlx4_en_rss_map *rss_map,
  465. int num_entries, int num_rings);
  466. void mlx4_en_set_prio_map(struct mlx4_en_priv *priv, u16 *prio_map, u32 ring_num);
  467. int mlx4_en_config_rss_steer(struct mlx4_en_priv *priv);
  468. void mlx4_en_release_rss_steer(struct mlx4_en_priv *priv);
  469. int mlx4_en_free_tx_buf(struct net_device *dev, struct mlx4_en_tx_ring *ring);
  470. void mlx4_en_rx_refill(struct work_struct *work);
  471. void mlx4_en_rx_irq(struct mlx4_cq *mcq);
  472. int mlx4_SET_MCAST_FLTR(struct mlx4_dev *dev, u8 port, u64 mac, u64 clear, u8 mode);
  473. int mlx4_SET_VLAN_FLTR(struct mlx4_dev *dev, u8 port, struct vlan_group *grp);
  474. int mlx4_SET_PORT_general(struct mlx4_dev *dev, u8 port, int mtu,
  475. u8 pptx, u8 pfctx, u8 pprx, u8 pfcrx);
  476. int mlx4_SET_PORT_qpn_calc(struct mlx4_dev *dev, u8 port, u32 base_qpn,
  477. u8 promisc);
  478. int mlx4_en_DUMP_ETH_STATS(struct mlx4_en_dev *mdev, u8 port, u8 reset);
  479. /*
  480. * Globals
  481. */
  482. extern const struct ethtool_ops mlx4_en_ethtool_ops;
  483. #endif