OSDN Git Service

octeontx2-af: Wait for TX link idle for credits change
authorNithin Dabilpuram <ndabilpuram@marvell.com>
Wed, 25 Aug 2021 05:46:21 +0000 (11:16 +0530)
committerDavid S. Miller <davem@davemloft.net>
Wed, 25 Aug 2021 11:05:54 +0000 (12:05 +0100)
commit1c74b89171c39eabc0faba7eb0500c3d73a0e1d1
treeb7a87780c3cbbf08114e3b0c91075cb6950bd506
parent906999c9b653dc27d22d9a7f53a5a6637c0e670e
octeontx2-af: Wait for TX link idle for credits change

NIX_AF_TX_LINKX_NORM_CREDIT holds running counter of
tx credits available per link. But, tx credits should be
configured based on MTU config. So MTU change needs tx
credit count update.

An issue exists whereby when both PF & VF are enabled and
PF traffic is flowing, if VF requests for MTU update,
updating the NORM_CREDIT register will lead to corruption
of credit count and subsequent deadlock of tx link as
the NORM_CREDIT register holds running count.

This patch provides workaround by pausing link traffic
using NIX_AF_TL1X_SW_XOFF, waiting for existing packets to
drain, and used credits be returned before updating new
credit count.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
Signed-off-by: Geetha sowjanya <gakula@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/octeontx2/af/rvu.h
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c