Date: Mon, 7 Dec 2015 10:57:42 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291931 - head/sys/dev/mlx5/mlx5_en Message-ID: <201512071057.tB7AvgkK003548@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Mon Dec 7 10:57:42 2015 New Revision: 291931 URL: https://svnweb.freebsd.org/changeset/base/291931 Log: The firmware no longer supports setting a port MTU of zero bytes. Set the port MTU and then query it and report if any problems instead. MFC after: 1 week Submitted by: Shahar Klein <shahark@mellanox.com> Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4408 Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Dec 7 10:24:40 2015 (r291930) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Dec 7 10:57:42 2015 (r291931) @@ -2005,32 +2005,15 @@ mlx5e_set_dev_port_mtu(struct ifnet *ifp struct mlx5e_priv *priv = ifp->if_softc; struct mlx5_core_dev *mdev = priv->mdev; int hw_mtu; - int min_mtu; int err; - /* - * Trying to set MTU to zero, in order - * to find out the FW's minimal MTU - */ - err = mlx5_set_port_mtu(mdev, 0); - if (err) - return (err); - err = mlx5_query_port_oper_mtu(mdev, &min_mtu); + err = mlx5_set_port_mtu(mdev, MLX5E_SW2HW_MTU(sw_mtu)); if (err) { - if_printf(ifp, "Query port minimal MTU failed\n"); + if_printf(ifp, "%s: mlx5_set_port_mtu failed setting %d, err=%d\n", + __func__, sw_mtu, err); return (err); } - - if (sw_mtu < MLX5E_HW2SW_MTU(min_mtu)) { - ifp->if_mtu = sw_mtu; - return (0); - } - - err = mlx5_set_port_mtu(mdev, MLX5E_SW2HW_MTU(sw_mtu)); - if (err) - return (err); - err = mlx5_query_port_oper_mtu(mdev, &hw_mtu); if (!err) { ifp->if_mtu = MLX5E_HW2SW_MTU(hw_mtu);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201512071057.tB7AvgkK003548>