[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20150323.223937.150869082277208564.davem@davemloft.net>
Date: Mon, 23 Mar 2015 22:39:37 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: Yuval.Mintz@...gic.com
Cc: netdev@...r.kernel.org, Ariel.Elior@...gic.com
Subject: Re: [PATCH v3 net] bnx2x: Fix statistics locking scheme
From: Yuval Mintz <Yuval.Mintz@...gic.com>
Date: Mon, 23 Mar 2015 10:56:14 +0200
> Statistics' state-machine in bnx2x driver must be synced with various driver
> flows, but its current locking scheme manages to be wasteful [using 2 locks +
> additional local variable] and prone to race-conditions at the same time,
> as the state-machine and 'action' are being accessed under different locks.
>
> In addition, current 'safe exec' isn't in fact safe, since the only guarantee
> it gives is that DMA transactions are over, but ramrods might still be running.
>
> This patch cleans up said logic, leaving us with a single lock for the entire
> flow and removing the possible races.
>
> Changes from v2:
> - Switched into mutex locking from semaphore locking.
> - Release locks on error flows.
>
> Changes from v1:
> Failure to acquire lock fails flow instead of printing a warning and
> allowing access to the critical section.
>
> Signed-off-by: Yuval Mintz <Yuval.Mintz@...gic.com>
> Signed-off-by: Ariel Elior <Ariel.Elior@...gic.com>
Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists