From: Leon Romanovsky <leon@kernel.org>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [bug report] net/mlx5e: Simulate missing IPsec TX limits hardware functionality
Date: Tue, 30 May 2023 14:36:11 +0300 [thread overview]
Message-ID: <20230530113611.GA231775@unreal> (raw)
In-Reply-To: <3987af55-0068-4a06-acea-c281a59e273a@kili.mountain>
On Tue, May 30, 2023 at 02:26:19PM +0300, Dan Carpenter wrote:
> Hello Leon Romanovsky,
>
> The patch b2f7b01d36a9: "net/mlx5e: Simulate missing IPsec TX limits
> hardware functionality" from Mar 30, 2023, leads to the following
> Smatch static checker warning:
>
> drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c:68 mlx5e_ipsec_handle_tx_limit()
> warn: sleeping in atomic context
>
> drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c
> 57 static void mlx5e_ipsec_handle_tx_limit(struct work_struct *_work)
> 58 {
> 59 struct mlx5e_ipsec_dwork *dwork =
> 60 container_of(_work, struct mlx5e_ipsec_dwork, dwork.work);
> 61 struct mlx5e_ipsec_sa_entry *sa_entry = dwork->sa_entry;
> 62 struct xfrm_state *x = sa_entry->x;
> 63
> 64 spin_lock(&x->lock);
>
> Holding a spinlock.
>
> 65 xfrm_state_check_expire(x);
> 66 if (x->km.state == XFRM_STATE_EXPIRED) {
> 67 sa_entry->attrs.drop = true;
> --> 68 mlx5e_accel_ipsec_fs_modify(sa_entry);
>
> This function call will do some GFP_KERNEL allocations so it sleeps.
Thanks Dan, I have a fix in my queue and will submit it.
Thanks
>
> 69 }
> 70 spin_unlock(&x->lock);
> 71
> 72 if (sa_entry->attrs.drop)
> 73 return;
> 74
> 75 queue_delayed_work(sa_entry->ipsec->wq, &dwork->dwork,
> 76 MLX5_IPSEC_RESCHED);
> 77 }
>
> regards,
> dan carpenter
prev parent reply other threads:[~2023-05-30 11:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-30 11:26 [bug report] net/mlx5e: Simulate missing IPsec TX limits hardware functionality Dan Carpenter
2023-05-30 11:36 ` Leon Romanovsky [this message]
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=20230530113611.GA231775@unreal \
--to=leon@kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=linux-rdma@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.