34 #include <linux/kernel.h>
35 #include <linux/ethtool.h>
36 #include <linux/netdevice.h>
62 en_err(priv,
"-LOOPBACK_TEST_XMIT- failed to create skb for xmit\n");
68 packet = (
unsigned char *)
skb_put(skb, packet_size);
72 skb_set_mac_header(skb, 0);
73 for (i = 0; i < packet_size; ++
i)
74 packet[i] = (
unsigned char)(i & 0xff);
81 static int mlx4_en_test_loopback(
struct mlx4_en_priv *priv)
91 if (mlx4_en_test_loopback_xmit(priv)) {
92 en_err(priv,
"Transmitting loopback packet failed\n");
93 goto mlx4_en_test_loopback_exit;
105 en_err(priv,
"Loopback packet didn't arrive\n");
107 mlx4_en_test_loopback_exit:
124 static int mlx4_en_test_speed(
struct mlx4_en_priv *priv)
148 carrier_ok = netif_carrier_ok(dev);
156 for (i = 0; i < priv->
tx_ring_num && carrier_ok; i++) {
162 if (priv->
mdev->dev->caps.flags &
164 buf[3] = mlx4_en_test_registers(priv);
165 buf[4] = mlx4_en_test_loopback(priv);
173 buf[1] = mlx4_en_test_link(priv);
174 buf[2] = mlx4_en_test_speed(priv);