git: 16635c7b213a - stable/13 - mlx5en: Make sure the NIC IP addresses are written to firmware on link up.

From: Hans Petter Selasky <hselasky_at_FreeBSD.org>
Date: Fri, 11 Feb 2022 10:15:48 UTC
The branch stable/13 has been updated by hselasky:

URL: https://cgit.FreeBSD.org/src/commit/?id=16635c7b213a8da75bd54cf81abb984f69b0bbc5

commit 16635c7b213a8da75bd54cf81abb984f69b0bbc5
Author:     Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2022-02-10 10:12:21 +0000
Commit:     Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2022-02-11 10:15:00 +0000

    mlx5en: Make sure the NIC IP addresses are written to firmware on link up.
    
    Fixes e059c120b4223fd5ec3af9def21c0519f439fe57 .
    
    PR:             261746
    Sponsored by:   NVIDIA Networking
    
    (cherry picked from commit 04f407a3e5e7bf452768201ace260b575f1a7924)
---
 sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c b/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c
index dab2d4bfda38..5607aad50da5 100644
--- a/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c
+++ b/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c
@@ -1254,7 +1254,7 @@ mlx5e_apply_ifp_addr(struct mlx5e_priv *priv)
 }
 
 static void
-mlx5e_handle_ifp_addr(struct mlx5e_priv *priv)
+mlx5e_handle_ifp_addr(struct mlx5e_priv *priv, bool rx_mode_enable)
 {
 	struct mlx5e_eth_addr_hash_node *hn;
 	struct mlx5e_eth_addr_hash_node *tmp;
@@ -1265,7 +1265,7 @@ mlx5e_handle_ifp_addr(struct mlx5e_priv *priv)
 	mlx5e_for_each_hash_node(hn, tmp, priv->eth_addr.if_mc, i)
 	    hn->action = MLX5E_ACTION_DEL;
 
-	if (test_bit(MLX5E_STATE_FLOW_RULES_READY, &priv->state))
+	if (rx_mode_enable)
 		mlx5e_sync_ifp_addr(priv);
 
 	mlx5e_apply_ifp_addr(priv);
@@ -1302,7 +1302,7 @@ mlx5e_set_rx_mode_core(struct mlx5e_priv *priv, bool rx_mode_enable)
 	if (enable_broadcast)
 		mlx5e_add_eth_addr_rule(priv, &ea->broadcast, MLX5E_FULLMATCH);
 
-	mlx5e_handle_ifp_addr(priv);
+	mlx5e_handle_ifp_addr(priv, rx_mode_enable);
 
 	if (disable_broadcast)
 		mlx5e_del_eth_addr_from_flow_table(priv, &ea->broadcast);