mlx4_en.h 16 KB

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