net/bnxt: fix flow query count
authorSomnath Kotur <somnath.kotur@broadcom.com>
Mon, 26 Oct 2020 03:56:06 +0000 (20:56 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 3 Nov 2020 22:35:03 +0000 (23:35 +0100)
commit1f3106d44a874bd628c68de7585f156ce67abe9b
treee67d60463afe4b4b5e45aa9df9122d9510a31d2c
parent03c6c9c8941183ef8632339af03db0f32fde667d
net/bnxt: fix flow query count

Fix infinite loop in flow query count.
`nxt_resource_idx` could be zero in some cases which is invalid and
should be part of the while loop condition. Also synchronize access to
the flow db using the fdb_lock

Fixes: 306c2d28e247 ("net/bnxt: support count action in flow query")

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c