aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/mlx4/mlx4_en.h
diff options
context:
space:
mode:
authorYevgeny Petrilin <yevgenyp@mellanox.co.il>2010-08-23 23:46:18 -0400
committerDavid S. Miller <davem@davemloft.net>2010-08-24 17:54:51 -0400
commite7c1c2c46201e46f8ce817196507d2ffd3dafd8e (patch)
tree33579da64d2c5dc4502518496097dcf9737e9eb4 /drivers/net/mlx4/mlx4_en.h
parent3005ad40b95168aad530f1179cff47411b3ea8da (diff)
mlx4_en: Added self diagnostics test implementation
The selftest includes 5 features: 1. Interrupt test: Executing commands and receiving command completion on all our interrupt vectors. 2. Link test: Verifying we are connected to valid link partner. 3. Speed test: Check that we negotiated link speed correctly. 4. Registers test: Activate HW health check command. 5. Loopback test: Send a packet on loopback interface and catch it on RX side. Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/mlx4/mlx4_en.h')
-rw-r--r--drivers/net/mlx4/mlx4_en.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/mlx4/mlx4_en.h b/drivers/net/mlx4/mlx4_en.h
index edf6523702c0..a09598b2b12e 100644
--- a/drivers/net/mlx4/mlx4_en.h
+++ b/drivers/net/mlx4/mlx4_en.h
@@ -45,6 +45,7 @@
45#include <linux/mlx4/cq.h> 45#include <linux/mlx4/cq.h>
46#include <linux/mlx4/srq.h> 46#include <linux/mlx4/srq.h>
47#include <linux/mlx4/doorbell.h> 47#include <linux/mlx4/doorbell.h>
48#include <linux/mlx4/cmd.h>
48 49
49#include "en_port.h" 50#include "en_port.h"
50 51
@@ -139,10 +140,14 @@ enum {
139 140
140#define SMALL_PACKET_SIZE (256 - NET_IP_ALIGN) 141#define SMALL_PACKET_SIZE (256 - NET_IP_ALIGN)
141#define HEADER_COPY_SIZE (128 - NET_IP_ALIGN) 142#define HEADER_COPY_SIZE (128 - NET_IP_ALIGN)
143#define MLX4_LOOPBACK_TEST_PAYLOAD (HEADER_COPY_SIZE - ETH_HLEN)
142 144
143#define MLX4_EN_MIN_MTU 46 145#define MLX4_EN_MIN_MTU 46
144#define ETH_BCAST 0xffffffffffffULL 146#define ETH_BCAST 0xffffffffffffULL
145 147
148#define MLX4_EN_LOOPBACK_RETRIES 5
149#define MLX4_EN_LOOPBACK_TIMEOUT 100
150
146#ifdef MLX4_EN_PERF_STAT 151#ifdef MLX4_EN_PERF_STAT
147/* Number of samples to 'average' */ 152/* Number of samples to 'average' */
148#define AVG_SIZE 128 153#define AVG_SIZE 128
@@ -356,6 +361,12 @@ struct mlx4_en_rss_context {
356 __be32 rss_key[10]; 361 __be32 rss_key[10];
357}; 362};
358 363
364struct mlx4_en_port_state {
365 int link_state;
366 int link_speed;
367 int transciver;
368};
369
359struct mlx4_en_pkt_stats { 370struct mlx4_en_pkt_stats {
360 unsigned long broadcast; 371 unsigned long broadcast;
361 unsigned long rx_prio[8]; 372 unsigned long rx_prio[8];
@@ -404,6 +415,7 @@ struct mlx4_en_priv {
404 struct vlan_group *vlgrp; 415 struct vlan_group *vlgrp;
405 struct net_device_stats stats; 416 struct net_device_stats stats;
406 struct net_device_stats ret_stats; 417 struct net_device_stats ret_stats;
418 struct mlx4_en_port_state port_state;
407 spinlock_t stats_lock; 419 spinlock_t stats_lock;
408 420
409 unsigned long last_moder_packets; 421 unsigned long last_moder_packets;
@@ -422,6 +434,8 @@ struct mlx4_en_priv {
422 u16 sample_interval; 434 u16 sample_interval;
423 u16 adaptive_rx_coal; 435 u16 adaptive_rx_coal;
424 u32 msg_enable; 436 u32 msg_enable;
437 u32 loopback_ok;
438 u32 validate_loopback;
425 439
426 struct mlx4_hwq_resources res; 440 struct mlx4_hwq_resources res;
427 int link_state; 441 int link_state;
@@ -530,6 +544,11 @@ int mlx4_SET_PORT_qpn_calc(struct mlx4_dev *dev, u8 port, u32 base_qpn,
530 u8 promisc); 544 u8 promisc);
531 545
532int mlx4_en_DUMP_ETH_STATS(struct mlx4_en_dev *mdev, u8 port, u8 reset); 546int mlx4_en_DUMP_ETH_STATS(struct mlx4_en_dev *mdev, u8 port, u8 reset);
547int mlx4_en_QUERY_PORT(struct mlx4_en_dev *mdev, u8 port);
548
549#define MLX4_EN_NUM_SELF_TEST 5
550void mlx4_en_ex_selftest(struct net_device *dev, u32 *flags, u64 *buf);
551u64 mlx4_en_mac_to_u64(u8 *addr);
533 552
534/* 553/*
535 * Globals 554 * Globals