af_packet: Fix lock position 45/10445/2
authorPierre Pfister <ppfister@cisco.com>
Wed, 7 Feb 2018 14:48:21 +0000 (15:48 +0100)
committerDamjan Marion <dmarion.lists@gmail.com>
Wed, 7 Feb 2018 18:46:28 +0000 (18:46 +0000)
commit8cedff2f462ef9deada9aae223868a216c7aa7f2
tree7b71d2dd615fdacc5e1e002b7b9ef08b29c1f1e7
parent815d7d5637fbffd20bf81c74fd59dac8e4fe4d94
af_packet: Fix lock position

In multi-worker cases, af-packet tx was subject to a pretty
serious race condition as the device lock was obtained
after some queue values were read from queue.

Result could go from packet loss to queue inconsistency, leading
to tx being stuck for 'some time'.

The fix is really simple. Finding the problem was not...

Change-Id: Ib18967b7459a8609428a56de934c577cea87b165
Signed-off-by: Pierre Pfister <ppfister@cisco.com>
src/vnet/devices/af_packet/device.c