qed: Support management-based resource locking
authorTomer Tayar <Tomer.Tayar@cavium.com>
Tue, 28 Mar 2017 12:12:54 +0000 (15:12 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 Mar 2017 01:05:23 +0000 (18:05 -0700)
commit95691c9cea3b14778bf699dcc1563cdc0c441105
tree5d7dac5adc2c36e30114851ba0f8cfe26a6a4ad5
parent18a69e368b22817575d2052b2c8dd8427bb4f827
qed: Support management-based resource locking

Global locking can't properly be used to synchronize between different
PFs in all scenarios, as those instances might reside in different
logical partitions [e.g., when a PF is assigned via PDA to some VM].

The management firmware provides a generic infrastructure for
device locks. For each 'resource', it's guaranteed it could be acquired
by at most a single PF at any given time [or by management firmware].

This patch adds the necessary logic in qed for utilizing said
infrastructure, implementing lock/unlock internal APIs.

Signed-off-by: Tomer Tayar <Tomer.Tayar@cavium.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qed/qed_hsi.h
drivers/net/ethernet/qlogic/qed/qed_mcp.c
drivers/net/ethernet/qlogic/qed/qed_mcp.h