net/hns3: fix HW exception for unbalanced Rx/Tx queues
authorChengchang Tang <tangchengchang@huawei.com>
Fri, 20 Nov 2020 11:27:34 +0000 (19:27 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 20 Nov 2020 20:10:05 +0000 (21:10 +0100)
commita1e7e04bacdaed5fbfb041682763ae0a9032345b
treee9a943a76019505b626fb64a483b3c5cab55941b
parent1c359bae182fc64b30fda3777a6c8f8cad7823ab
net/hns3: fix HW exception for unbalanced Rx/Tx queues

For kupeng 930, there are 3 registers to control the enable
status of a TQP(i.e. task queue pair, include a txq and a rxq).
One of them controls whether the TQP is enabled, and the other
two controls whether the rxq and txq are enabled. The registers
used to control the enabled status of the rxq and txq are enabled
by default. Therefore, after the TQP is enabled, the rxq and txq
are enabled by default.

Currently, when the number of rxq is not equal to the number of txq, the
unused rxqs or txqs are not disabled by driver, so these unused queues
will be enabled in this situation.  And the related HW rings have not
been initialized which could lead to a hardware exception.

This patch fix it by disable these unused queues during enable the TQPs.

Fixes: fa29fe45a7b4 ("net/hns3: support queue start and stop")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
drivers/net/hns3/hns3_rxtx.c