diff options
author | Yevgeny Petrilin <yevgenyp@mellanox.co.il> | 2010-08-23 23:46:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-08-24 17:54:51 -0400 |
commit | e7c1c2c46201e46f8ce817196507d2ffd3dafd8e (patch) | |
tree | 33579da64d2c5dc4502518496097dcf9737e9eb4 /drivers/net/mlx4/en_tx.c | |
parent | 3005ad40b95168aad530f1179cff47411b3ea8da (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/en_tx.c')
-rw-r--r-- | drivers/net/mlx4/en_tx.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/mlx4/en_tx.c b/drivers/net/mlx4/en_tx.c index 3deabd1d0357..b875f9c38848 100644 --- a/drivers/net/mlx4/en_tx.c +++ b/drivers/net/mlx4/en_tx.c | |||
@@ -600,6 +600,9 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev) | |||
600 | struct mlx4_wqe_data_seg *data; | 600 | struct mlx4_wqe_data_seg *data; |
601 | struct skb_frag_struct *frag; | 601 | struct skb_frag_struct *frag; |
602 | struct mlx4_en_tx_info *tx_info; | 602 | struct mlx4_en_tx_info *tx_info; |
603 | struct ethhdr *ethh; | ||
604 | u64 mac; | ||
605 | u32 mac_l, mac_h; | ||
603 | int tx_ind = 0; | 606 | int tx_ind = 0; |
604 | int nr_txbb; | 607 | int nr_txbb; |
605 | int desc_size; | 608 | int desc_size; |
@@ -679,6 +682,19 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev) | |||
679 | priv->port_stats.tx_chksum_offload++; | 682 | priv->port_stats.tx_chksum_offload++; |
680 | } | 683 | } |
681 | 684 | ||
685 | if (unlikely(priv->validate_loopback)) { | ||
686 | /* Copy dst mac address to wqe */ | ||
687 | skb_reset_mac_header(skb); | ||
688 | ethh = eth_hdr(skb); | ||
689 | if (ethh && ethh->h_dest) { | ||
690 | mac = mlx4_en_mac_to_u64(ethh->h_dest); | ||
691 | mac_h = (u32) ((mac & 0xffff00000000ULL) >> 16); | ||
692 | mac_l = (u32) (mac & 0xffffffff); | ||
693 | tx_desc->ctrl.srcrb_flags |= cpu_to_be32(mac_h); | ||
694 | tx_desc->ctrl.imm = cpu_to_be32(mac_l); | ||
695 | } | ||
696 | } | ||
697 | |||
682 | /* Handle LSO (TSO) packets */ | 698 | /* Handle LSO (TSO) packets */ |
683 | if (lso_header_size) { | 699 | if (lso_header_size) { |
684 | /* Mark opcode as LSO */ | 700 | /* Mark opcode as LSO */ |