]> git.baikalelectronics.ru Git - kernel.git/commit
nfp: disallow sharing mutexes on the same machine
authorJakub Kicinski <jakub.kicinski@netronome.com>
Wed, 22 Mar 2017 00:59:07 +0000 (17:59 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Mar 2017 19:59:06 +0000 (12:59 -0700)
commita3e7b8248ff15b3f047f3cd7a4fb4e22bd80127c
treea3eb5da2f54c90c77e13d2f226ee6b8fb32e73cf
parentc4cc65ad3264eed0d4f939a533660de8fd4c8c88
nfp: disallow sharing mutexes on the same machine

NFP can be connected to multiple machines via PCI or other buses.
Access to hardware resources is arbitrated using locks residing
in device memory.  Currently nfpcore only respects the mutexes
when it comes to inter-host locking, but if we try to acquire
the same lock again, on one host - it will simply return success
because owner of the lock is already set to that host.

This makes the locks useless for arbitration within one host
and unfair because whichever host grabbed the lock will have
a chance to reacquire it without others getting a shot.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cppcore.c