Skip to content

Commit

Permalink
net/hns3: remove unnecessary RSS switch
Browse files Browse the repository at this point in the history
[ upstream commit ec16914 ]

Whether the RSS is enabled depends on RTE_ETH_MQ_RX_RSS_FLAG and packet
tuple are enabled. So the RSS switch is unnecessary.

Fixes: 5e782bc ("net/hns3: fix configuring RSS hash when rules are flushed")
Fixes: fd81968 ("net/hns3: fix configuring device with RSS enabled")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
  • Loading branch information
LiHuiSong1 authored and kevintraynor committed May 24, 2022
1 parent 15b794b commit 66b7e33
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 9 deletions.
2 changes: 0 additions & 2 deletions drivers/net/hns3/hns3_ethdev.c
Expand Up @@ -2030,7 +2030,6 @@ hns3_dev_configure(struct rte_eth_dev *dev)
if ((uint32_t)mq_mode & RTE_ETH_MQ_RX_RSS_FLAG) {
conf->rxmode.offloads |= RTE_ETH_RX_OFFLOAD_RSS_HASH;
rss_conf = conf->rx_adv_conf.rss_conf;
hw->rss_dis_flag = false;
ret = hns3_dev_rss_hash_update(dev, &rss_conf);
if (ret)
goto cfg_err;
Expand Down Expand Up @@ -2849,7 +2848,6 @@ hns3_get_board_configuration(struct hns3_hw *hw)

hw->mac.media_type = cfg.media_type;
hw->rss_size_max = cfg.rss_size_max;
hw->rss_dis_flag = false;
memcpy(hw->mac.mac_addr, cfg.mac_addr, RTE_ETHER_ADDR_LEN);
hw->mac.phy_addr = cfg.phy_addr;
hw->num_tx_desc = cfg.tqp_desc_num;
Expand Down
1 change: 0 additions & 1 deletion drivers/net/hns3/hns3_ethdev.h
Expand Up @@ -530,7 +530,6 @@ struct hns3_hw {

/* The configuration info of RSS */
struct hns3_rss_conf rss_info;
bool rss_dis_flag; /* disable rss flag. true: disable, false: enable */
uint16_t rss_ind_tbl_size;
uint16_t rss_key_size;

Expand Down
2 changes: 0 additions & 2 deletions drivers/net/hns3/hns3_ethdev_vf.c
Expand Up @@ -496,7 +496,6 @@ hns3vf_dev_configure(struct rte_eth_dev *dev)
/* When RSS is not configured, redirect the packet queue 0 */
if ((uint32_t)mq_mode & RTE_ETH_MQ_RX_RSS_FLAG) {
conf->rxmode.offloads |= RTE_ETH_RX_OFFLOAD_RSS_HASH;
hw->rss_dis_flag = false;
rss_conf = conf->rx_adv_conf.rss_conf;
ret = hns3_dev_rss_hash_update(dev, &rss_conf);
if (ret)
Expand Down Expand Up @@ -1031,7 +1030,6 @@ hns3vf_get_configuration(struct hns3_hw *hw)
int ret;

hw->mac.media_type = HNS3_MEDIA_TYPE_NONE;
hw->rss_dis_flag = false;

/* Get device capability */
ret = hns3vf_get_capability(hw);
Expand Down
1 change: 0 additions & 1 deletion drivers/net/hns3/hns3_flow.c
Expand Up @@ -1401,7 +1401,6 @@ hns3_disable_rss(struct hns3_hw *hw)
ret = hns3_set_rss_tuple_by_rss_hf(hw, 0);
if (ret)
return ret;
hw->rss_dis_flag = true;

return 0;
}
Expand Down
3 changes: 0 additions & 3 deletions drivers/net/hns3/hns3_rss.c
Expand Up @@ -381,9 +381,6 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev,
uint8_t *key = rss_conf->rss_key;
int ret;

if (hw->rss_dis_flag)
return -EINVAL;

if (key && key_len != HNS3_RSS_KEY_SIZE) {
hns3_err(hw, "the hash key len(%u) is invalid, must be %u",
key_len, HNS3_RSS_KEY_SIZE);
Expand Down

0 comments on commit 66b7e33

Please sign in to comment.