lkml.org 
[lkml]   [2013]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] net: gainfar: fix race between issuing and completing Tx
From
From: Nikita Yushchenko <nyushchenko@dev.rtsoft.ru>
Date: Fri, 6 Dec 2013 16:35:59 +0400

> gfar_poll() checked Tx queue status without locking, thus allowing
> gfar_start_xmit() to alter it in parallel, which caused hang on every
> other nfsroot boot with RT enabled.
>
> This patch raises locking from gfar_clean_tx_ring() up to gfar_poll().
> With this change applied, hangs are no longer reproduced.
>
> Signed-off-by: Nikita Yushchenko <nyushchenko@dev.rtsoft.ru>

This is not sufficient.

You've left a huge comment in gfar_start_xmit() which explains that
the current locking is correct.

Whoever wrote that comment thought there were no problems with the
current arrangement.

If you want to change it, you have to adjust this comment, and also
explain exactly what races without your proposed change.

If you are going to take this lock, you might want to consider using
netif_tx_lock() since that is held across the entirety of any
netdev_ops->ndo_start_xmit() invocation.


\
 
 \ /
  Last update: 2013-12-10 02:41    [W:0.032 / U:0.540 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site