Skip to content

Commit

Permalink
net/mlx5e: kTLS, Call WARN_ONCE on netdev mismatch
Browse files Browse the repository at this point in the history
A netdev mismatch in the processed TLS SKB should not occur,
and indicates a kernel bug.
Add WARN_ONCE to spot such cases.

Fixes: d2ead1f ("net/mlx5e: Add kTLS TX HW offload support")
Suggested-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
  • Loading branch information
Tariq Toukan authored and Saeed Mahameed committed Jul 25, 2019
1 parent 90bb769 commit 304ecc9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ struct sk_buff *mlx5e_ktls_handle_tx_skb(struct net_device *netdev,
goto out;

tls_ctx = tls_get_ctx(skb->sk);
if (unlikely(tls_ctx->netdev != netdev))
if (unlikely(WARN_ON_ONCE(tls_ctx->netdev != netdev)))
goto err_out;

priv_tx = mlx5e_get_ktls_tx_priv_ctx(tls_ctx);
Expand Down

0 comments on commit 304ecc9

Please sign in to comment.