From fd81968387634571845e879e7b5d64c5cfa8880d Mon Sep 17 00:00:00 2001 From: "Wei Hu (Xavier)" Date: Tue, 22 Sep 2020 20:03:28 +0800 Subject: [PATCH] net/hns3: fix configuring device with RSS enabled Currently, when running the following commands in the CLI of testpmd application, the driver reports an -EINVAL error when performing the No.3 step. 1) flow create 0 ingress pattern end actions rss key func simple_xor types all end / end 2) flow flush 0 3) port config dcb vt off pfc off The root cause as below: In the No.2 step, when RSS rules is flushed, we set the the flag hw->rss_dis_flag with true to indicate RSS id disabled. And in the No.3 step, calling rte_eth_dev_configure API function, the internal function named hns3_dev_rss_hash_update check hw->rss_dis_flag is true and return -EINVAL. When user calls the rte_eth_dev_configure API function with the input parameter dev_conf->rxmode.mq_mode having ETH_MQ_RX_RSS_FLAG to enable RSS, driver should set internal flag hw->rss_dis_flag with false to indicate RSS is enabled in the '.dev_configure' ops implementation function named hns3_dev_configure and hns3vf_dev_configure. Fixes: 5e782bc2570c ("net/hns3: fix configuring RSS hash when rules are flushed") Cc: stable@dpdk.org Signed-off-by: Lijun Ou Signed-off-by: Wei Hu (Xavier) --- drivers/net/hns3/hns3_ethdev.c | 1 + drivers/net/hns3/hns3_ethdev_vf.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index 10cfc5d47d..99bcc7a9a4 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -2326,6 +2326,7 @@ hns3_dev_configure(struct rte_eth_dev *dev) if ((uint32_t)mq_mode & ETH_MQ_RX_RSS_FLAG) { conf->rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH; rss_conf = conf->rx_adv_conf.rss_conf; + hw->rss_dis_flag = false; if (rss_conf.rss_key == NULL) { rss_conf.rss_key = rss_cfg->key; rss_conf.rss_key_len = HNS3_RSS_KEY_SIZE; diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c index cb2747b132..4c73441116 100644 --- a/drivers/net/hns3/hns3_ethdev_vf.c +++ b/drivers/net/hns3/hns3_ethdev_vf.c @@ -783,6 +783,7 @@ hns3vf_dev_configure(struct rte_eth_dev *dev) /* When RSS is not configured, redirect the packet queue 0 */ if ((uint32_t)mq_mode & ETH_MQ_RX_RSS_FLAG) { conf->rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH; + hw->rss_dis_flag = false; rss_conf = conf->rx_adv_conf.rss_conf; if (rss_conf.rss_key == NULL) { rss_conf.rss_key = rss_cfg->key; -- 2.20.1