Author: hselasky
Date: Thu Nov 19 10:18:13 2015
New Revision: 291068
URL: https://svnweb.freebsd.org/changeset/base/291068

Log:
  Maintain the "hw_lro" configuration variable correctly.
  
  Setting sysctl dev....conf.hw_lro may fail if the net device lro is
  turned off. Due to the nature of our sysctl handler we need to set the
  values back to 0 and issue an error.
  
  Differential Revision:        https://reviews.freebsd.org/D4177
  Submitted by: Shahar Klein <[email protected]>
  Sponsored by: Mellanox Technologies
  MFC after:    3 days

Modified:
  head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c

Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c
==============================================================================
--- head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Thu Nov 19 10:10:52 2015        
(r291067)
+++ head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Thu Nov 19 10:18:13 2015        
(r291068)
@@ -184,6 +184,13 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG
                }
                if (priv->ifp->if_capenable & IFCAP_LRO)
                        priv->params.hw_lro_en = !!MLX5_CAP_ETH(priv->mdev, 
lro_cap);
+               else {
+                       /* set the correct (0) value to params_ethtool.hw_lro, 
issue a warning and return error */
+                       priv->params_ethtool.hw_lro = 0;
+                       error = EINVAL;
+                       if_printf(priv->ifp, "Can't set HW_LRO to a device with 
LRO turned off");
+                       goto done;
+               }
        }
        else {
                priv->params.hw_lro_en = false;
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to