net/bnxt: check flush status during ring free
authorAjit Khaparde <ajit.khaparde@broadcom.com>
Thu, 4 Mar 2021 09:07:26 +0000 (14:37 +0530)
committerAjit Khaparde <ajit.khaparde@broadcom.com>
Fri, 12 Mar 2021 06:13:27 +0000 (07:13 +0100)
commit4fb6ab3f866d64e72d4bfd1a15ce5127f8fb0043
treeab0cf600a83bd48b5dc00c9d32acce9f2e13b580
parent0f4d2afb09d1a4605ae8b636f3e11edccf3c9f07
net/bnxt: check flush status during ring free

When host SW issues a HWRM_RING_FREE for Tx/Rx/AGG ring in HW,
the FW flushes the BDs associated with the ring and performs other
cleanup in the HW. The host software should ideally check for an
indication from the FW indicating this step has been completed
successfully to avoid unexpected errors during cleanup.

The FW issues a HWRM_DONE response to the RING_FREE request on
the corresponding CQ ring. Poll the CQs during cleanup and
ensure the HWRM_FREE command is completed not just based on the
value of valid bit but also the HWRM_DONE response for the ring.

If the HWRM_DONE response is not seen, force the cleanup to
complete just based on the valid bit.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
drivers/net/bnxt/bnxt_hwrm.c
drivers/net/bnxt/bnxt_hwrm.h
drivers/net/bnxt/bnxt_rxr.c
drivers/net/bnxt/bnxt_rxr.h
drivers/net/bnxt/bnxt_txr.c
drivers/net/bnxt/bnxt_txr.h