From 6f60ca5e5ef386ae362676b1e8f6678cfae36e63 Mon Sep 17 00:00:00 2001 From: Yongseok Koh Date: Mon, 20 Mar 2017 16:04:33 -0700 Subject: [PATCH] ethdev: remove requirement of aligned RETA size In rte_eth_check_reta_mask(), it is required to align the size of the RETA table to RTE_RETA_GROUP_SIZE but as the size can be less than the limit, this should be removed. The change is also applied to a command of testpmd. Signed-off-by: Yongseok Koh --- app/test-pmd/cmdline.c | 4 +++- lib/librte_ether/rte_ethdev.c | 8 +------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 66cd09a0ff..2e23e20484 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -2081,7 +2081,9 @@ showport_parse_reta_config(struct rte_eth_rss_reta_entry64 *conf, char s[256]; char *end; char *str_fld[8]; - uint16_t i, num = nb_entries / RTE_RETA_GROUP_SIZE; + uint16_t i; + uint16_t num = (nb_entries + RTE_RETA_GROUP_SIZE - 1) / + RTE_RETA_GROUP_SIZE; int ret; p = strchr(p0, '('); diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index c327c2281c..f90f102445 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -1949,13 +1949,7 @@ rte_eth_check_reta_mask(struct rte_eth_rss_reta_entry64 *reta_conf, if (!reta_conf) return -EINVAL; - if (reta_size != RTE_ALIGN(reta_size, RTE_RETA_GROUP_SIZE)) { - RTE_PMD_DEBUG_TRACE("Invalid reta size, should be %u aligned\n", - RTE_RETA_GROUP_SIZE); - return -EINVAL; - } - - num = reta_size / RTE_RETA_GROUP_SIZE; + num = (reta_size + RTE_RETA_GROUP_SIZE - 1) / RTE_RETA_GROUP_SIZE; for (i = 0; i < num; i++) { if (reta_conf[i].mask) return 0; -- 2.20.1