net/sfc: fix reading adapter state without locking
authorIvan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Fri, 23 Jul 2021 13:15:06 +0000 (16:15 +0300)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 23 Jul 2021 21:04:24 +0000 (23:04 +0200)
commit17b0d7b36777341486efc0959d5ed69cf5af5f26
tree4fe73ee8bedb4607dfd0469aa42adcf48b2c98c7
parent9076e855f171e6588d43c0c20956da154b8c4371
net/sfc: fix reading adapter state without locking

Update MAC stats function reads adapter state with MAC stats locking
but without adapter locking. Add adapter locking before calling this
function and remove MAC stats locking since there's no point to have
it together with adapter locking. The second place MAC stats locking
is used is MAC stats reset function. It's called with adapter being
already locked so there's no point to use MAC stats locking anymore.

Fixes: 1caab2f1e68 ("net/sfc: add basic statistics")
Cc: stable@dpdk.org
Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
drivers/net/sfc/sfc.h
drivers/net/sfc/sfc_ethdev.c
drivers/net/sfc/sfc_port.c