]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - drivers/net/ethernet/broadcom/bnxt/bnxt.c
bnxt_en: Improve valid bit checking in firmware response message.
authorMichael Chan <michael.chan@broadcom.com>
Sat, 31 Mar 2018 17:54:15 +0000 (13:54 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sun, 1 Apr 2018 03:24:19 +0000 (23:24 -0400)
commit845adfe40c2a75e67ddae6639fc2b987338b7983
treeee9abc40ff26ae032453e1b94f2e8c8a80c27e8f
parent596f9d55feebdf31c03172fcc82cdec62bb969ea
bnxt_en: Improve valid bit checking in firmware response message.

When firmware sends a DMA response to the driver, the last byte of the
message will be set to 1 to indicate that the whole response is valid.
The driver waits for the message to be valid before reading the message.

The firmware spec allows these response messages to increase in
length by adding new fields to the end of these messages.  The
older spec's valid location may become a new field in a newer
spec.  To guarantee compatibility, the driver should zero the valid
byte before interpreting the entire message so that any new fields not
implemented by the older spec will be read as zero.

For messages that are forwarded to VFs, we need to set the length
and re-instate the valid bit so the VF will see the valid response.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c