代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/dpdk 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 3406502c1af41be568561d74b39417dd2a3a771a Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 21 Oct 2022 15:36:36 +0800
Subject: [PATCH 160/189] net/hns3: add check for L3 and L4 type
When user set 'L3_SRC/DST_ONLY' or 'L4_SRC/DST_ONLY' to 'rss_hf' and
do not specify the packet type, these types will be not set to hardware.
So this patch adds a check for them.
Fixes: 806f1d5ab0e3 ("net/hns3: set RSS hash type input configuration")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
drivers/net/hns3/hns3_rss.c | 31 +++++++++++++++++++++++++++++--
1 file changed, 29 insertions(+), 2 deletions(-)
diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index ea745c791f..ca5a129234 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -400,8 +400,34 @@ hns3_rss_reset_indir_table(struct hns3_hw *hw)
return ret;
}
+static void
+hns3_rss_check_l3l4_types(struct hns3_hw *hw, uint64_t rss_hf)
+{
+ uint64_t ip_mask = RTE_ETH_RSS_IPV4 | RTE_ETH_RSS_FRAG_IPV4 |
+ RTE_ETH_RSS_NONFRAG_IPV4_OTHER |
+ RTE_ETH_RSS_IPV6 | RTE_ETH_RSS_FRAG_IPV6 |
+ RTE_ETH_RSS_NONFRAG_IPV6_OTHER;
+ uint64_t l4_mask = RTE_ETH_RSS_NONFRAG_IPV4_TCP |
+ RTE_ETH_RSS_NONFRAG_IPV4_UDP |
+ RTE_ETH_RSS_NONFRAG_IPV4_SCTP |
+ RTE_ETH_RSS_NONFRAG_IPV6_TCP |
+ RTE_ETH_RSS_NONFRAG_IPV6_UDP |
+ RTE_ETH_RSS_NONFRAG_IPV6_SCTP;
+ uint64_t l3_src_dst_mask = RTE_ETH_RSS_L3_SRC_ONLY |
+ RTE_ETH_RSS_L3_DST_ONLY;
+ uint64_t l4_src_dst_mask = RTE_ETH_RSS_L4_SRC_ONLY |
+ RTE_ETH_RSS_L4_DST_ONLY;
+
+ if (rss_hf & l3_src_dst_mask &&
+ !(rss_hf & ip_mask || rss_hf & l4_mask))
+ hns3_warn(hw, "packet type isn't specified, L3_SRC/DST_ONLY is ignored.");
+
+ if (rss_hf & l4_src_dst_mask && !(rss_hf & l4_mask))
+ hns3_warn(hw, "packet type isn't specified, L4_SRC/DST_ONLY is ignored.");
+}
+
static uint64_t
-hns3_rss_calc_tuple_filed(uint64_t rss_hf)
+hns3_rss_calc_tuple_filed(struct hns3_hw *hw, uint64_t rss_hf)
{
uint64_t l3_only_mask = RTE_ETH_RSS_L3_SRC_ONLY |
RTE_ETH_RSS_L3_DST_ONLY;
@@ -430,6 +456,7 @@ hns3_rss_calc_tuple_filed(uint64_t rss_hf)
!has_l3_l4_only)
tuple |= hns3_set_tuple_table[i].rss_field;
}
+ hns3_rss_check_l3l4_types(hw, rss_hf);
return tuple;
}
@@ -445,7 +472,7 @@ hns3_set_rss_tuple_by_rss_hf(struct hns3_hw *hw, uint64_t rss_hf)
hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_RSS_INPUT_TUPLE, false);
req = (struct hns3_rss_input_tuple_cmd *)desc.data;
- tuple_field = hns3_rss_calc_tuple_filed(rss_hf);
+ tuple_field = hns3_rss_calc_tuple_filed(hw, rss_hf);
req->tuple_field = rte_cpu_to_le_64(tuple_field);
ret = hns3_cmd_send(hw, &desc, 1);
if (ret) {
--
2.23.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。