mlx4_en.h 16 KB

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