[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZJXZ8mg5uw8MaKuP@corigine.com>
Date: Fri, 23 Jun 2023 19:44:18 +0200
From: Simon Horman <simon.horman@...igine.com>
To: souradeep chakrabarti <schakrabarti@...ux.microsoft.com>
Cc: kys@...rosoft.com, haiyangz@...rosoft.com, wei.liu@...nel.org,
decui@...rosoft.com, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, longli@...rosoft.com,
sharmaajay@...rosoft.com, leon@...nel.org, cai.huoqing@...ux.dev,
ssengar@...ux.microsoft.com, vkuznets@...hat.com,
tglx@...utronix.de, linux-hyperv@...r.kernel.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-rdma@...r.kernel.org, stable@...r.kernel.org,
schakrabarti@...rosoft.com
Subject: Re: [PATCH V2 net] net: mana: Fix MANA VF unload when host is
unresponsive
On Fri, Jun 23, 2023 at 12:29:15AM -0700, souradeep chakrabarti wrote:
> From: Souradeep Chakrabarti <schakrabarti@...ux.microsoft.com>
>
> This patch addresses the VF unload issue, where mana_dealloc_queues()
> gets stuck in infinite while loop, because of host unresponsiveness.
> It adds a timeout in the while loop, to fix it.
>
> Also this patch adds a new attribute in mana_context, which gets set when
> mana_hwc_send_request() hits a timeout because of host unresponsiveness.
> This flag then helps to avoid the timeouts in successive calls.
>
> Signed-off-by: Souradeep Chakrabarti <schakrabarti@...ux.microsoft.com>
...
> diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c
> index d907727c7b7a..cb2080b3a00c 100644
> --- a/drivers/net/ethernet/microsoft/mana/mana_en.c
> +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
...
> @@ -2348,13 +2351,26 @@ static int mana_dealloc_queues(struct net_device *ndev)
> *
> * Drain all the in-flight TX packets
> */
> +
> + timeout = jiffies + 120 * HZ;
> for (i = 0; i < apc->num_queues; i++) {
> txq = &apc->tx_qp[i].txq;
> -
> - while (atomic_read(&txq->pending_sends) > 0)
> + while (atomic_read(&txq->pending_sends) > 0 &&
> + time_before(jiffies, timeout)) {
> usleep_range(1000, 2000);
> + }
Hi Souradeep,
minor feedback from my side, as it seems there will be a new version anyway:
I think the braces - '{' '}' - are unnecessary above.
...
--
pw-bot: cr
Powered by blists - more mailing lists