svn commit: r352995 - head/sys/dev/mlx5/mlx5_en

Hans Petter Selasky hselasky at FreeBSD.org
Wed Oct 2 11:02:56 UTC 2019


Author: hselasky
Date: Wed Oct  2 11:02:54 2019
New Revision: 352995
URL: https://svnweb.freebsd.org/changeset/base/352995

Log:
  Only update lossy buffers config when manual PFC configuration was done
  in mlx5en(4).
  
  Submitted by:	kib@
  MFC after:	3 days
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_en/en.h
  head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
  head/sys/dev/mlx5/mlx5_en/mlx5_en_port_buffer.c

Modified: head/sys/dev/mlx5/mlx5_en/en.h
==============================================================================
--- head/sys/dev/mlx5/mlx5_en/en.h	Wed Oct  2 11:01:05 2019	(r352994)
+++ head/sys/dev/mlx5/mlx5_en/en.h	Wed Oct  2 11:02:54 2019	(r352995)
@@ -1046,6 +1046,7 @@ struct mlx5e_priv {
 	u_int	clbr_gen;
 
 	struct mlx5e_dcbx dcbx;
+	bool	sw_is_port_buf_owner;
 
 	struct pfil_head *pfil;
 	struct mlx5e_channel channel[];

Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==============================================================================
--- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c	Wed Oct  2 11:01:05 2019	(r352994)
+++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c	Wed Oct  2 11:02:54 2019	(r352995)
@@ -3903,7 +3903,7 @@ mlx5e_sysctl_rx_priority_flow_control(SYSCTL_HANDLER_A
 	/* check if update is required */
 	if (rx_pfc != priv->params.rx_priority_flow_control) {
 		err = -mlx5e_set_port_pfc(priv);
-		if (err == 0)
+		if (err == 0 && priv->sw_is_port_buf_owner)
 			err = mlx5e_update_buf_lossy(priv);
 	}
 done:

Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_port_buffer.c
==============================================================================
--- head/sys/dev/mlx5/mlx5_en/mlx5_en_port_buffer.c	Wed Oct  2 11:01:05 2019	(r352994)
+++ head/sys/dev/mlx5/mlx5_en/mlx5_en_port_buffer.c	Wed Oct  2 11:02:54 2019	(r352995)
@@ -263,6 +263,7 @@ int mlx5e_port_manual_buffer_config(struct mlx5e_priv 
 		if (err)
 			return err;
 
+		priv->sw_is_port_buf_owner = true;
 		err = update_buffer_lossy(mtu, pfc->pfc_en, buffer, xoff,
 					  &port_buffer, &update_buffer);
 		if (err)
@@ -316,13 +317,16 @@ int mlx5e_port_manual_buffer_config(struct mlx5e_priv 
 
 	/* Apply the settings */
 	if (update_buffer) {
+		priv->sw_is_port_buf_owner = true;
 		err = port_set_buffer(priv, &port_buffer);
 		if (err)
 			return err;
 	}
 
-	if (update_prio2buffer)
+	if (update_prio2buffer) {
+		priv->sw_is_port_buf_owner = true;
 		err = mlx5e_port_set_priority2buffer(priv->mdev, prio2buffer);
+	}
 
 	return err;
 }


More information about the svn-src-all mailing list