On Thu, 2019-07-25 at 13:49 -0700, Jakub Kicinski wrote: > On Thu, 25 Jul 2019 20:36:48 +0000, Saeed Mahameed wrote: > > From: Tariq Toukan <tar...@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.kicin...@netronome.com> > > Signed-off-by: Tariq Toukan <tar...@mellanox.com> > > Signed-off-by: Saeed Mahameed <sae...@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))) > > Ah, nit: the unlikely is probably unnecessary but that's no big deal. > > #define WARN_ON_ONCE(condition) ({ \ > static int __warned; \ > int __ret_warn_once = !!(condition); \ > \ > if (unlikely(__ret_warn_once && !__warned)) { \ > __warned = true; \ > WARN_ON(1); \ > } \ > unlikely(__ret_warn_once); \ > }) >
indeed, i see Dave already accepted this, will fix in net-next. Thanks Jakub !