git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/hns3: replace max private macro
[dpdk.git]
/
drivers
/
net
/
hns3
/
hns3_flow.c
diff --git
a/drivers/net/hns3/hns3_flow.c
b/drivers/net/hns3/hns3_flow.c
index
53708d2
..
7ec46ae
100644
(file)
--- a/
drivers/net/hns3/hns3_flow.c
+++ b/
drivers/net/hns3/hns3_flow.c
@@
-1287,6
+1287,7
@@
hns3_parse_rss_filter(struct rte_eth_dev *dev,
case RTE_ETH_HASH_FUNCTION_DEFAULT:
case RTE_ETH_HASH_FUNCTION_TOEPLITZ:
case RTE_ETH_HASH_FUNCTION_SIMPLE_XOR:
case RTE_ETH_HASH_FUNCTION_DEFAULT:
case RTE_ETH_HASH_FUNCTION_TOEPLITZ:
case RTE_ETH_HASH_FUNCTION_SIMPLE_XOR:
+ case RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ:
break;
default:
return rte_flow_error_set(error, ENOTSUP,
break;
default:
return rte_flow_error_set(error, ENOTSUP,
@@
-1333,6
+1334,7
@@
hns3_disable_rss(struct hns3_hw *hw)
/* Disable RSS */
hw->rss_info.conf.types = 0;
/* Disable RSS */
hw->rss_info.conf.types = 0;
+ hw->rss_dis_flag = true;
return 0;
}
return 0;
}
@@
-1364,6
+1366,9
@@
hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function *func,
case RTE_ETH_HASH_FUNCTION_SIMPLE_XOR:
*hash_algo = HNS3_RSS_HASH_ALGO_SIMPLE;
break;
case RTE_ETH_HASH_FUNCTION_SIMPLE_XOR:
*hash_algo = HNS3_RSS_HASH_ALGO_SIMPLE;
break;
+ case RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ:
+ *hash_algo = HNS3_RSS_HASH_ALGO_SYMMETRIC_TOEP;
+ break;
default:
hns3_err(hw, "Invalid RSS algorithm configuration(%u)",
algo_func);
default:
hns3_err(hw, "Invalid RSS algorithm configuration(%u)",
algo_func);
@@
-1377,9
+1382,6
@@
hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function *func,
static int
hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
{
static int
hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
{
- uint8_t hash_algo =
- (hw->rss_info.conf.func == RTE_ETH_HASH_FUNCTION_TOEPLITZ ?
- HNS3_RSS_HASH_ALGO_TOEPLITZ : HNS3_RSS_HASH_ALGO_SIMPLE);
struct hns3_rss_tuple_cfg *tuple;
int ret;
struct hns3_rss_tuple_cfg *tuple;
int ret;
@@
-1387,11
+1389,12
@@
hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
hns3_parse_rss_key(hw, rss_config);
/* Parse hash algorithm */
hns3_parse_rss_key(hw, rss_config);
/* Parse hash algorithm */
- ret = hns3_parse_rss_algorithm(hw, &rss_config->func, &hash_algo);
+ ret = hns3_parse_rss_algorithm(hw, &rss_config->func,
+ &hw->rss_info.hash_algo);
if (ret)
return ret;
if (ret)
return ret;
- ret = hns3_set_rss_algo_key(hw,
hash_algo,
rss_config->key);
+ ret = hns3_set_rss_algo_key(hw, rss_config->key);
if (ret)
return ret;
if (ret)
return ret;
@@
-1474,8
+1477,18
@@
hns3_config_rss_filter(struct rte_eth_dev *dev,
return -EINVAL;
}
return -EINVAL;
}
+ if (rss_flow_conf.key_len &&
+ rss_flow_conf.key_len > RTE_DIM(rss_info->key)) {
+ hns3_err(hw,
+ "input hash key(%u) greater than supported len(%zu)",
+ rss_flow_conf.key_len, RTE_DIM(rss_info->key));
+ return -EINVAL;
+ }
+
/* Filter the unsupported flow types */
/* Filter the unsupported flow types */
- flow_types = rss_flow_conf.types & HNS3_ETH_RSS_SUPPORT;
+ flow_types = conf->conf.types ?
+ rss_flow_conf.types & HNS3_ETH_RSS_SUPPORT :
+ hw->rss_info.conf.types;
if (flow_types != rss_flow_conf.types)
hns3_warn(hw, "modified RSS types based on hardware support, "
"requested:%" PRIx64 " configured:%" PRIx64,
if (flow_types != rss_flow_conf.types)
hns3_warn(hw, "modified RSS types based on hardware support, "
"requested:%" PRIx64 " configured:%" PRIx64,
@@
-1483,9
+1496,6
@@
hns3_config_rss_filter(struct rte_eth_dev *dev,
/* Update the useful flow types */
rss_flow_conf.types = flow_types;
/* Update the useful flow types */
rss_flow_conf.types = flow_types;
- if ((rss_flow_conf.types & ETH_RSS_PROTO_MASK) == 0)
- return hns3_disable_rss(hw);
-
rss_info = &hw->rss_info;
if (!add) {
if (hns3_action_rss_same(&rss_info->conf, &rss_flow_conf)) {
rss_info = &hw->rss_info;
if (!add) {
if (hns3_action_rss_same(&rss_info->conf, &rss_flow_conf)) {