Skip to content

Commit 20d2e88

Browse files
ahduyckkuba-moo
authored andcommitted
eth: fbnic: Add initial messaging to notify FW of our presence
After the driver loads we need to get some initial capabilities from the firmware to determine what the device is capable of and what functionality needs to be enabled. Specifically we receive information about the current state of the link and if a BMC is present. After that when we bring the interface up we will need the ability to take ownership from the FW. To do that we will need to notify it that we are taking control before we start configuring the traffic classifier and MAC. Once we have ownership we need to notify the firmware that we are still present and active. To do that we will send a regular heartbeat to the FW. If the FW doesn't receive the heartbeat in a timely fashion it will retake control of the RPC and MAC and assume that the host has gone offline. Signed-off-by: Alexander Duyck <[email protected]> Link: https://patch.msgid.link/172079939458.1778861.8966209942099133957.stgit@ahduyck-xeon-server.home.arpa Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 0cb4c0a commit 20d2e88

File tree

6 files changed

+555
-0
lines changed

6 files changed

+555
-0
lines changed

drivers/net/ethernet/meta/fbnic/fbnic.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,14 @@ struct fbnic_dev {
2626
struct delayed_work service_task;
2727

2828
struct fbnic_fw_mbx mbx[FBNIC_IPC_MBX_INDICES];
29+
struct fbnic_fw_cap fw_cap;
2930
/* Lock protecting Tx Mailbox queue to prevent possible races */
3031
spinlock_t fw_tx_lock;
3132

33+
unsigned long last_heartbeat_request;
34+
unsigned long last_heartbeat_response;
35+
u8 fw_heartbeat_enabled;
36+
3237
u64 dsn;
3338
u32 mps;
3439
u32 readrq;

drivers/net/ethernet/meta/fbnic/fbnic_csr.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
#define DESC_BIT(nr) BIT_ULL(nr)
1313
#define DESC_GENMASK(h, l) GENMASK_ULL(h, l)
1414

15+
/* Defines the minimum firmware version required by the driver */
16+
#define MIN_FW_MAJOR_VERSION 0
17+
#define MIN_FW_MINOR_VERSION 10
18+
#define MIN_FW_BUILD_VERSION 6
19+
#define MIN_FW_VERSION_CODE (MIN_FW_MAJOR_VERSION * (1u << 24) + \
20+
MIN_FW_MINOR_VERSION * (1u << 16) + \
21+
MIN_FW_BUILD_VERSION)
22+
1523
#define PCI_DEVICE_ID_META_FBNIC_ASIC 0x0013
1624

1725
#define FBNIC_CLOCK_FREQ (600 * (1000 * 1000))

0 commit comments

Comments
 (0)