Skip to content

Commit

Permalink
net/hns3: fix VMDq mode check
Browse files Browse the repository at this point in the history
HNS3 PF driver only supports RSS, DCB or NONE multiple queues mode.
Currently, driver doesn't verify the VMDq multi-queue mode completely.
This patch fixes the verification for VMDq mode.

Fixes: 62e3ccc ("net/hns3: support flow control")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
  • Loading branch information
LiHuiSong1 authored and Ferruh Yigit committed Apr 20, 2021
1 parent edba2e3 commit ffd6b0b
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions drivers/net/hns3/hns3_ethdev.c
Expand Up @@ -2222,23 +2222,16 @@ hns3_check_mq_mode(struct rte_eth_dev *dev)
int max_tc = 0;
int i;

dcb_rx_conf = &dev->data->dev_conf.rx_adv_conf.dcb_rx_conf;
dcb_tx_conf = &dev->data->dev_conf.tx_adv_conf.dcb_tx_conf;

if (rx_mq_mode == ETH_MQ_RX_VMDQ_DCB_RSS) {
hns3_err(hw, "ETH_MQ_RX_VMDQ_DCB_RSS is not supported. "
"rx_mq_mode = %d", rx_mq_mode);
return -EINVAL;
}

if (rx_mq_mode == ETH_MQ_RX_VMDQ_DCB ||
tx_mq_mode == ETH_MQ_TX_VMDQ_DCB) {
hns3_err(hw, "ETH_MQ_RX_VMDQ_DCB and ETH_MQ_TX_VMDQ_DCB "
"is not supported. rx_mq_mode = %d, tx_mq_mode = %d",
if ((rx_mq_mode & ETH_MQ_RX_VMDQ_FLAG) ||
(tx_mq_mode == ETH_MQ_TX_VMDQ_DCB ||
tx_mq_mode == ETH_MQ_TX_VMDQ_ONLY)) {
hns3_err(hw, "VMDQ is not supported, rx_mq_mode = %d, tx_mq_mode = %d.",
rx_mq_mode, tx_mq_mode);
return -EINVAL;
return -EOPNOTSUPP;
}

dcb_rx_conf = &dev->data->dev_conf.rx_adv_conf.dcb_rx_conf;
dcb_tx_conf = &dev->data->dev_conf.tx_adv_conf.dcb_tx_conf;
if (rx_mq_mode & ETH_MQ_RX_DCB_FLAG) {
if (dcb_rx_conf->nb_tcs > pf->tc_max) {
hns3_err(hw, "nb_tcs(%u) > max_tc(%u) driver supported.",
Expand Down Expand Up @@ -2297,8 +2290,7 @@ hns3_check_dcb_cfg(struct rte_eth_dev *dev)
return -EOPNOTSUPP;
}

/* Check multiple queue mode */
return hns3_check_mq_mode(dev);
return 0;
}

static int
Expand Down Expand Up @@ -2471,6 +2463,10 @@ hns3_dev_configure(struct rte_eth_dev *dev)
}

hw->adapter_state = HNS3_NIC_CONFIGURING;
ret = hns3_check_mq_mode(dev);
if (ret)
goto cfg_err;

if ((uint32_t)mq_mode & ETH_MQ_RX_DCB_FLAG) {
ret = hns3_check_dcb_cfg(dev);
if (ret)
Expand Down

0 comments on commit ffd6b0b

Please sign in to comment.