Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 May 2019 18:26:14 +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-11@freebsd.org
Subject:   svn commit: r347877 - stable/11/sys/dev/mlx5/mlx5_en
Message-ID:  <201905161826.x4GIQE1S040781@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Thu May 16 18:26:14 2019
New Revision: 347877
URL: https://svnweb.freebsd.org/changeset/base/347877

Log:
  MFC r347321:
  Undo previous steps upon returning failure in mlx5en(4).
  
  Else flowtable resources may not be properly freed.
  
  Sponsored by:	Mellanox Technologies

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

Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c
==============================================================================
--- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c	Thu May 16 18:25:26 2019	(r347876)
+++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c	Thu May 16 18:26:14 2019	(r347877)
@@ -633,7 +633,11 @@ mlx5e_add_any_vid_rules(struct mlx5e_priv *priv)
 	if (err)
 		return (err);
 
-	return (mlx5e_add_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_ANY_STAG_VID, 0));
+	err = mlx5e_add_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_ANY_STAG_VID, 0);
+	if (err)
+		mlx5e_del_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_ANY_CTAG_VID, 0);
+
+	return (err);
 }
 
 void
@@ -701,19 +705,22 @@ mlx5e_add_all_vlan_rules(struct mlx5e_priv *priv)
 		err = mlx5e_add_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_MATCH_VID,
 					  i);
 		if (err)
-			return (err);
+			goto error;
 	}
 
 	err = mlx5e_add_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_UNTAGGED, 0);
 	if (err)
-		return (err);
+		goto error;
 
 	if (priv->vlan.filter_disabled) {
 		err = mlx5e_add_any_vid_rules(priv);
 		if (err)
-			return (err);
+			goto error;
 	}
 	return (0);
+error:
+	mlx5e_del_all_vlan_rules(priv);
+	return (err);
 }
 
 void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905161826.x4GIQE1S040781>