Commit 989f7178 authored by Jian Shen's avatar Jian Shen Committed by David S. Miller

net: hns3: fix missing rule state assignment

Currently, when adding flow director rule, it missed to set
rule state. Which may cause the rule state in software is
unconsistent with hardware.

Fixes: fc4243b8 ("net: hns3: refactor flow director configuration")
Signed-off-by: default avatarJian Shen <shenjian15@huawei.com>
Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a180be79
...@@ -6439,7 +6439,8 @@ static int hclge_add_fd_entry_common(struct hclge_dev *hdev, ...@@ -6439,7 +6439,8 @@ static int hclge_add_fd_entry_common(struct hclge_dev *hdev,
if (ret) if (ret)
goto out; goto out;
hclge_update_fd_list(hdev, HCLGE_FD_ACTIVE, rule->location, rule); rule->state = HCLGE_FD_ACTIVE;
hclge_update_fd_list(hdev, rule->state, rule->location, rule);
hdev->fd_active_type = rule->rule_type; hdev->fd_active_type = rule->rule_type;
out: out:
...@@ -7002,6 +7003,7 @@ static void hclge_fd_build_arfs_rule(const struct hclge_fd_rule_tuples *tuples, ...@@ -7002,6 +7003,7 @@ static void hclge_fd_build_arfs_rule(const struct hclge_fd_rule_tuples *tuples,
rule->action = 0; rule->action = 0;
rule->vf_id = 0; rule->vf_id = 0;
rule->rule_type = HCLGE_FD_ARFS_ACTIVE; rule->rule_type = HCLGE_FD_ARFS_ACTIVE;
rule->state = HCLGE_FD_TO_ADD;
if (tuples->ether_proto == ETH_P_IP) { if (tuples->ether_proto == ETH_P_IP) {
if (tuples->ip_proto == IPPROTO_TCP) if (tuples->ip_proto == IPPROTO_TCP)
rule->flow_type = TCP_V4_FLOW; rule->flow_type = TCP_V4_FLOW;
...@@ -7064,8 +7066,7 @@ static int hclge_add_fd_entry_by_arfs(struct hnae3_handle *handle, u16 queue_id, ...@@ -7064,8 +7066,7 @@ static int hclge_add_fd_entry_by_arfs(struct hnae3_handle *handle, u16 queue_id,
rule->arfs.flow_id = flow_id; rule->arfs.flow_id = flow_id;
rule->queue_id = queue_id; rule->queue_id = queue_id;
hclge_fd_build_arfs_rule(&new_tuples, rule); hclge_fd_build_arfs_rule(&new_tuples, rule);
hclge_update_fd_list(hdev, HCLGE_FD_TO_ADD, rule->location, hclge_update_fd_list(hdev, rule->state, rule->location, rule);
rule);
hdev->fd_active_type = HCLGE_FD_ARFS_ACTIVE; hdev->fd_active_type = HCLGE_FD_ARFS_ACTIVE;
} else if (rule->queue_id != queue_id) { } else if (rule->queue_id != queue_id) {
rule->queue_id = queue_id; rule->queue_id = queue_id;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment