/* * Copyright (c) 2016, Mellanox Technologies, Ltd. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU * General Public License (GPL) Version 2, available from the file * COPYING in the main directory of this source tree, or the * OpenIB.org BSD license below: * * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following * conditions are met: * * - Redistributions of source code must retain the above * copyright notice, this list of conditions and the following * disclaimer. * * - Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE.
*/
void mlx5e_self_test(struct net_device *ndev, struct ethtool_test *etest,
u64 *buf)
{ struct mlx5e_priv *priv = netdev_priv(ndev); int i, count = 0;
mutex_lock(&priv->state_lock);
netdev_info(ndev, "Self test begin..\n");
for (i = 0; i < MLX5E_ST_NUM; i++) { struct mlx5e_st st = mlx5e_sts[i];
if (st.cond_func && st.cond_func(priv)) continue;
netdev_info(ndev, "\t[%d] %s start..\n", i, st.name);
buf[count] = st.st_func(priv);
netdev_info(ndev, "\t[%d] %s end: result(%lld)\n", i, st.name, buf[count]);
count++;
}
mutex_unlock(&priv->state_lock);
for (i = 0; i < count; i++) { if (buf[i]) {
etest->flags |= ETH_TEST_FL_FAILED; break;
}
}
netdev_info(ndev, "Self test out: status flags(0x%x)\n",
etest->flags);
}
int mlx5e_self_test_fill_strings(struct mlx5e_priv *priv, u8 *data)
{ int i, count = 0;
for (i = 0; i < MLX5E_ST_NUM; i++) { struct mlx5e_st st = mlx5e_sts[i];
if (st.cond_func && st.cond_func(priv)) continue; if (data)
ethtool_puts(&data, st.name);
count++;
} return count;
}
int mlx5e_self_test_num(struct mlx5e_priv *priv)
{ return mlx5e_self_test_fill_strings(priv, NULL);
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.16 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.