git: 5381f936473b - main - mlx5en: Create TIRs before flowtables.

From: Hans Petter Selasky <hselasky_at_FreeBSD.org>
Date: Tue, 01 Feb 2022 15:24:33 UTC
The branch main has been updated by hselasky:

URL: https://cgit.FreeBSD.org/src/commit/?id=5381f936473b06e3d62da5e0f22119789db8e621

commit 5381f936473b06e3d62da5e0f22119789db8e621
Author:     Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2022-02-01 15:20:14 +0000
Commit:     Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2022-02-01 15:21:16 +0000

    mlx5en: Create TIRs before flowtables.
    
    Because flowtables may redirect traffic to TIRs.
    
    MFC after:      1 week
    Sponsored by:   NVIDIA Networking
---
 sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
index 171777ebba57..eec7c9cc9730 100644
--- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
+++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
@@ -4552,16 +4552,16 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev)
 		goto err_open_drop_rq;
 	}
 
-	err = mlx5e_open_flow_tables(priv);
+	err = mlx5e_open_tirs(priv);
 	if (err) {
-		if_printf(ifp, "%s: mlx5e_open_flow_tables failed (%d)\n", __func__, err);
+		mlx5_en_err(ifp, "mlx5e_open_tirs() failed, %d\n", err);
 		goto err_open_rqt;
 	}
 
-	err = mlx5e_open_tirs(priv);
+	err = mlx5e_open_flow_tables(priv);
 	if (err) {
-		mlx5_en_err(ifp, "mlx5e_open_tirs() failed, %d\n", err);
-		goto err_open_flow_tables;
+		if_printf(ifp, "%s: mlx5e_open_flow_tables failed (%d)\n", __func__, err);
+		goto err_open_tirs;
 	}
 
 	/* set default MTU */
@@ -4699,8 +4699,8 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev)
 
 	return (priv);
 
-err_open_flow_tables:
-	mlx5e_close_flow_tables(priv);
+err_open_tirs:
+	mlx5e_close_tirs(priv);
 
 err_open_rqt:
 	mlx5_core_destroy_rqt(priv->mdev, priv->rqtn, 0);
@@ -4807,8 +4807,8 @@ mlx5e_destroy_ifp(struct mlx5_core_dev *mdev, void *vpriv)
 	ifmedia_removeall(&priv->media);
 	ether_ifdetach(ifp);
 
-	mlx5e_close_tirs(priv);
 	mlx5e_close_flow_tables(priv);
+	mlx5e_close_tirs(priv);
 	mlx5_core_destroy_rqt(priv->mdev, priv->rqtn, 0);
 	mlx5e_close_drop_rq(&priv->drop_rq);
 	mlx5e_tls_cleanup(priv);