net/mlx5e: Remove non-essential TLS SQ state bit
authorTariq Toukan <tariqt@nvidia.com>
Tue, 9 Mar 2021 14:30:10 +0000 (16:30 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Fri, 16 Apr 2021 18:47:56 +0000 (11:47 -0700)
Maintaining an SQ state bit to indicate TLS support
has no real need, a simple and fast test [1] for the SKB is
almost equally good.

[1] !skb->sk || !tls_is_sk_tx_device_offloaded(skb->sk)

Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h
drivers/net/ethernet/mellanox/mlx5/core/en_main.c

index e1c51ea..cb4e7aa 100644 (file)
@@ -325,7 +325,6 @@ enum {
        MLX5E_SQ_STATE_RECOVERING,
        MLX5E_SQ_STATE_IPSEC,
        MLX5E_SQ_STATE_AM,
-       MLX5E_SQ_STATE_TLS,
        MLX5E_SQ_STATE_VLAN_NEED_L2_INLINE,
        MLX5E_SQ_STATE_PENDING_XSK_TX,
 };
index cc0efac..cc2851e 100644 (file)
@@ -123,11 +123,9 @@ static inline bool mlx5e_accel_tx_begin(struct net_device *dev,
                mlx5e_udp_gso_handle_tx_skb(skb);
 
 #ifdef CONFIG_MLX5_EN_TLS
-       if (test_bit(MLX5E_SQ_STATE_TLS, &sq->state)) {
-               /* May send SKBs and WQEs. */
-               if (unlikely(!mlx5e_tls_handle_tx_skb(dev, sq, skb, &state->tls)))
-                       return false;
-       }
+       /* May send SKBs and WQEs. */
+       if (unlikely(!mlx5e_tls_handle_tx_skb(dev, sq, skb, &state->tls)))
+               return false;
 #endif
 
 #ifdef CONFIG_MLX5_EN_IPSEC
index 6847e7b..64d6c0f 100644 (file)
@@ -1134,8 +1134,6 @@ static int mlx5e_alloc_txqsq(struct mlx5e_channel *c,
                set_bit(MLX5E_SQ_STATE_VLAN_NEED_L2_INLINE, &sq->state);
        if (MLX5_IPSEC_DEV(c->priv->mdev))
                set_bit(MLX5E_SQ_STATE_IPSEC, &sq->state);
-       if (mlx5_accel_is_tls_device(c->priv->mdev))
-               set_bit(MLX5E_SQ_STATE_TLS, &sq->state);
        if (param->is_mpw)
                set_bit(MLX5E_SQ_STATE_MPWQE, &sq->state);
        sq->stop_room = param->stop_room;