/* * 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. */ #include <linux/ip.h> #include <linux/udp.h> #include <net/udp.h> #include "en.h" #include "en/port.h" #include "eswitch.h" static int mlx5e_test_health_info(struct mlx5e_priv *priv) { … } static int mlx5e_test_link_state(struct mlx5e_priv *priv) { … } static int mlx5e_test_link_speed(struct mlx5e_priv *priv) { … } struct mlx5ehdr { … }; #ifdef CONFIG_INET /* loopback test */ #define MLX5E_TEST_PKT_SIZE … #define MLX5E_TEST_MAGIC … static struct sk_buff *mlx5e_test_get_udp_skb(struct mlx5e_priv *priv) { … } struct mlx5e_lbt_priv { … }; static int mlx5e_test_loopback_validate(struct sk_buff *skb, struct net_device *ndev, struct packet_type *pt, struct net_device *orig_ndev) { … } static int mlx5e_test_loopback_setup(struct mlx5e_priv *priv, struct mlx5e_lbt_priv *lbtp) { … } static void mlx5e_test_loopback_cleanup(struct mlx5e_priv *priv, struct mlx5e_lbt_priv *lbtp) { … } static int mlx5e_cond_loopback(struct mlx5e_priv *priv) { … } #define MLX5E_LB_VERIFY_TIMEOUT … static int mlx5e_test_loopback(struct mlx5e_priv *priv) { … } #endif mlx5e_st_func; struct mlx5e_st { … }; static struct mlx5e_st mlx5e_sts[] = …; #define MLX5E_ST_NUM … void mlx5e_self_test(struct net_device *ndev, struct ethtool_test *etest, u64 *buf) { … } int mlx5e_self_test_fill_strings(struct mlx5e_priv *priv, u8 *data) { … } int mlx5e_self_test_num(struct mlx5e_priv *priv) { … }