Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Dec 2015 09:57:42 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r292190 - stable/10/sys/dev/mlx5/mlx5_en
Message-ID:  <201512140957.tBE9vgfp023492@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Mon Dec 14 09:57:42 2015
New Revision: 292190
URL: https://svnweb.freebsd.org/changeset/base/292190

Log:
  MFC r291931:
  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.
  
  Submitted by:	Shahar Klein <shahark@mellanox.com>
  Sponsored by:	Mellanox Technologies
  Differential Revision:	https://reviews.freebsd.org/D4408

Modified:
  stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==============================================================================
--- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c	Mon Dec 14 09:55:14 2015	(r292189)
+++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c	Mon Dec 14 09:57:42 2015	(r292190)
@@ -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?201512140957.tBE9vgfp023492>