lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <89435045-2413-4cb9-4897-a251f5bd382e@amd.com>
Date: Sat, 25 Nov 2023 08:53:19 -0600
From: Tom Lendacky <thomas.lendacky@....com>
To: Raju Rangoju <Raju.Rangoju@....com>, netdev@...r.kernel.org
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
 pabeni@...hat.com, Shyam-sundar.S-k@....com
Subject: Re: [PATCH net 2/3] amd-xgbe: handle the corner-case during tx
 completion

On 11/21/23 13:14, Raju Rangoju wrote:
> The existing implementation uses software logic to accumulate tx
> completions until the specified time (1ms) is met and then poll them.
> However, there exists a tiny gap which leads to a race between
> resetting and checking the tx_activate flag. Due to this the tx
> completions are not reported to upper layer and tx queue timeout
> kicks-in restarting the device.
> 
> To address this, introduce a tx cleanup mechanism as part of the
> periodic maintenance process.

This looks to just be a work-around that happens to work (for now) and the 
actual race condition should be fixed.

Thanks,
Tom

> 
> Fixes: c5aa9e3b8156 ("amd-xgbe: Initial AMD 10GbE platform driver")
> Acked-by: Shyam Sundar S K <Shyam-sundar.S-k@....com>
> Signed-off-by: Raju Rangoju <Raju.Rangoju@....com>
> ---
>   drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 14 ++++++++++++++
>   1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
> index 614c0278419b..6b73648b3779 100644
> --- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
> +++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
> @@ -682,10 +682,24 @@ static void xgbe_service(struct work_struct *work)
>   static void xgbe_service_timer(struct timer_list *t)
>   {
>   	struct xgbe_prv_data *pdata = from_timer(pdata, t, service_timer);
> +	struct xgbe_channel *channel;
> +	unsigned int i;
>   
>   	queue_work(pdata->dev_workqueue, &pdata->service_work);
>   
>   	mod_timer(&pdata->service_timer, jiffies + HZ);
> +
> +	if (!pdata->tx_usecs)
> +		return;
> +
> +	for (i = 0; i < pdata->channel_count; i++) {
> +		channel = pdata->channel[i];
> +		if (!channel->tx_ring || channel->tx_timer_active)
> +			break;
> +		channel->tx_timer_active = 1;
> +		mod_timer(&channel->tx_timer,
> +			  jiffies + usecs_to_jiffies(pdata->tx_usecs));
> +	}
>   }
>   
>   static void xgbe_init_timers(struct xgbe_prv_data *pdata)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ