From: Saeed Mahameed <saeedm@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Jakub Kicinski <jakub.kicinski@netronome.com>,
Tariq Toukan <tariqt@mellanox.com>,
Saeed Mahameed <saeedm@mellanox.com>
Subject: [net 7/9] net/mlx5e: kTLS, Call WARN_ONCE on netdev mismatch
Date: Thu, 25 Jul 2019 20:36:48 +0000 [thread overview]
Message-ID: <20190725203618.11011-8-saeedm@mellanox.com> (raw)
In-Reply-To: <20190725203618.11011-1-saeedm@mellanox.com>
From: Tariq Toukan <tariqt@mellanox.com>
A netdev mismatch in the processed TLS SKB should not occur,
and indicates a kernel bug.
Add WARN_ONCE to spot such cases.
Fixes: d2ead1f360e8 ("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>
---
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c
index ea032f54197e..3766545ce259 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c
@@ -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);
--
2.21.0
next prev parent reply other threads:[~2019-07-25 20:36 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-25 20:36 [pull request][net 0/9] Mellanox, mlx5 fixes 2019-07-25 Saeed Mahameed
2019-07-25 20:36 ` [net 1/9] net/mlx5: Use reversed order when unregister devices Saeed Mahameed
2019-07-25 20:36 ` [net 2/9] net/mlx5: Add missing RDMA_RX capabilities Saeed Mahameed
2019-07-25 20:36 ` [net 3/9] net/mlx5: Fix modify_cq_in alignment Saeed Mahameed
2019-07-25 20:36 ` [net 4/9] net/mlx5e: Fix wrong max num channels indication Saeed Mahameed
2019-07-25 20:36 ` [net 5/9] net/mlx5e: Fix matching of speed to PRM link modes Saeed Mahameed
2019-07-25 20:36 ` [net 6/9] net/mlx5e: Prevent encap flow counter update async to user query Saeed Mahameed
2019-07-25 20:36 ` Saeed Mahameed [this message]
2019-07-25 20:48 ` [net 7/9] net/mlx5e: kTLS, Call WARN_ONCE on netdev mismatch Jakub Kicinski
2019-07-25 20:49 ` Jakub Kicinski
2019-07-26 21:41 ` Saeed Mahameed
2019-07-25 20:36 ` [net 8/9] nfp: tls: rename tls packet counters Saeed Mahameed
2019-07-25 20:50 ` Jakub Kicinski
2019-07-25 20:36 ` [net 9/9] Documentation: TLS: fix stat counters description Saeed Mahameed
2019-07-25 20:53 ` Jakub Kicinski
2019-07-26 21:34 ` [pull request][net 0/9] Mellanox, mlx5 fixes 2019-07-25 David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190725203618.11011-8-saeedm@mellanox.com \
--to=saeedm@mellanox.com \
--cc=davem@davemloft.net \
--cc=jakub.kicinski@netronome.com \
--cc=netdev@vger.kernel.org \
--cc=tariqt@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox