Skip to content

Commit

Permalink
net/hns3: fix VMDq mode check
Browse files Browse the repository at this point in the history
[ upstream commit ffd6b0b ]

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")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
  • Loading branch information
LiHuiSong1 authored and steevenlee committed May 8, 2021
1 parent cdffbfb commit 5eaa5ab
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions drivers/net/hns3/hns3_ethdev.c
Expand Up @@ -2137,23 +2137,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 @@ -2212,8 +2205,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 @@ -2392,6 +2384,9 @@ hns3_dev_configure(struct rte_eth_dev *dev)
ret = -EINVAL;
goto cfg_err;
}
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);
Expand Down

0 comments on commit 5eaa5ab

Please sign in to comment.