net/bnxt: fix scalar Rx datapath on Thor
authorSomnath Kotur <somnath.kotur@broadcom.com>
Wed, 3 Nov 2021 16:04:32 +0000 (21:34 +0530)
committerAjit Khaparde <ajit.khaparde@broadcom.com>
Fri, 5 Nov 2021 01:00:49 +0000 (02:00 +0100)
commit7e8d5583f7d34bcf7fe8fe9a5806b7d8366ded27
tree3d5f9214f05a20fe20f6a14efc77f45468be14a6
parentf2c730d423702fb9efbf778225fc7bcbb153fcb3
net/bnxt: fix scalar Rx datapath on Thor

The patch introduced by
commit 657c2a7f1dd4 ("net/bnxt: create aggregation rings when needed")
ended up shortening the return code path from the function thereby
resulting in not executing the line of code at the end of the function
that was resetting the next consumer index to 0.
This would result in an application crash when error recovery or other
port stop/start scenarios were invoked on Thor which is what this
commit 61cd4384fabf ("net/bnxt: fix crash after port stop/start")
was addressing.
Fix it by moving the resetting line of code before the return path
in the case when aggregation rings are not used (default case).

Fixes: 657c2a7f1dd4 ("net/bnxt: create aggregation rings when needed")

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