/* Update redirection table of hw */
memcpy(hw->rss_info.rss_indirection_tbl, indir,
- sizeof(hw->rss_info.rss_indirection_tbl));
+ sizeof(uint16_t) * size);
return 0;
}
int ret;
lut = rte_zmalloc("hns3_rss_lut",
- HNS3_RSS_IND_TBL_SIZE * sizeof(uint16_t), 0);
+ hw->rss_ind_tbl_size * sizeof(uint16_t), 0);
if (lut == NULL) {
hns3_err(hw, "No hns3_rss_lut memory can be allocated");
return -ENOMEM;
}
- ret = hns3_set_rss_indir_table(hw, lut, HNS3_RSS_IND_TBL_SIZE);
+ ret = hns3_set_rss_indir_table(hw, lut, hw->rss_ind_tbl_size);
if (ret)
hns3_err(hw, "RSS uninit indir table failed: %d", ret);
rte_free(lut);
} else if (rss_hf && rss_cfg->conf.types == 0) {
/* Enable RSS, restore indirection table by hw's config */
ret = hns3_set_rss_indir_table(hw, rss_cfg->rss_indirection_tbl,
- HNS3_RSS_IND_TBL_SIZE);
+ hw->rss_ind_tbl_size);
if (ret)
goto conf_err;
}
struct hns3_adapter *hns = dev->data->dev_private;
struct hns3_hw *hw = &hns->hw;
struct hns3_rss_conf *rss_cfg = &hw->rss_info;
- uint16_t i, indir_size = HNS3_RSS_IND_TBL_SIZE; /* Table size is 512 */
- uint16_t indirection_tbl[HNS3_RSS_IND_TBL_SIZE];
+ uint16_t indirection_tbl[HNS3_RSS_IND_TBL_SIZE_MAX];
uint16_t idx, shift;
+ uint16_t i;
int ret;
- if (reta_size != indir_size || reta_size > ETH_RSS_RETA_SIZE_512) {
+ if (reta_size != hw->rss_ind_tbl_size) {
hns3_err(hw, "The size of hash lookup table configured (%u)"
"doesn't match the number hardware can supported"
- "(%u)", reta_size, indir_size);
+ "(%u)", reta_size, hw->rss_ind_tbl_size);
return -EINVAL;
}
rte_spinlock_lock(&hw->lock);
}
ret = hns3_set_rss_indir_table(hw, indirection_tbl,
- HNS3_RSS_IND_TBL_SIZE);
+ hw->rss_ind_tbl_size);
rte_spinlock_unlock(&hw->lock);
return ret;
struct hns3_adapter *hns = dev->data->dev_private;
struct hns3_hw *hw = &hns->hw;
struct hns3_rss_conf *rss_cfg = &hw->rss_info;
- uint16_t i, indir_size = HNS3_RSS_IND_TBL_SIZE; /* Table size is 512 */
uint16_t idx, shift;
+ uint16_t i;
- if (reta_size != indir_size || reta_size > ETH_RSS_RETA_SIZE_512) {
+ if (reta_size != hw->rss_ind_tbl_size) {
hns3_err(hw, "The size of hash lookup table configured (%u)"
" doesn't match the number hardware can supported"
- "(%u)", reta_size, indir_size);
+ "(%u)", reta_size, hw->rss_ind_tbl_size);
return -EINVAL;
}
rte_spinlock_lock(&hw->lock);
memcpy(rss_cfg->key, hns3_hash_key, HNS3_RSS_KEY_SIZE);
/* Initialize RSS indirection table */
- for (i = 0; i < HNS3_RSS_IND_TBL_SIZE; i++)
+ for (i = 0; i < hw->rss_ind_tbl_size; i++)
rss_cfg->rss_indirection_tbl[i] = i % queue_num;
}
*/
if (((uint32_t)mq_mode & ETH_MQ_RX_RSS_FLAG)) {
ret = hns3_set_rss_indir_table(hw, rss_cfg->rss_indirection_tbl,
- HNS3_RSS_IND_TBL_SIZE);
+ hw->rss_ind_tbl_size);
if (ret)
goto rss_tuple_uninit;
}