Skip to content

Commit

Permalink
net/hns3: remove reset log in secondary
Browse files Browse the repository at this point in the history
[ upstream commit 5394df455749f60614a19d791d1d73c26b74dea1 ]

The reset event is checked and done in primary. And the secondary
doesn't check and display reset log. There is a patch to remove the
check code for secondary. please see commit a8f1f7c ("net/hns3:
fix crash when secondary process access FW")

This patch removes the redundant log print of reset.

Fixes: a8f1f7c ("net/hns3: fix crash when secondary process access FW")

Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
  • Loading branch information
Dengdui Huang authored and bluca committed Nov 8, 2023
1 parent 0e1cff3 commit aca18a7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
11 changes: 5 additions & 6 deletions drivers/net/hns3/hns3_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -5481,14 +5481,13 @@ hns3_is_reset_pending(struct hns3_adapter *hns)
enum hns3_reset_level reset;

/*
* Check the registers to confirm whether there is reset pending.
* Note: This check may lead to schedule reset task, but only primary
* process can process the reset event. Therefore, limit the
* checking under only primary process.
* Only primary can process can process the reset event,
* so don't check reset event in secondary.
*/
if (rte_eal_process_type() == RTE_PROC_PRIMARY)
hns3_check_event_cause(hns, NULL);
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return false;

hns3_check_event_cause(hns, NULL);
reset = hns3_get_reset_level(hns, &hw->reset.pending);
if (hw->reset.level != HNS3_NONE_RESET && hw->reset.level < reset) {
hns3_warn(hw, "High level reset %d is pending", reset);
Expand Down
11 changes: 5 additions & 6 deletions drivers/net/hns3/hns3_ethdev_vf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2308,14 +2308,13 @@ hns3vf_is_reset_pending(struct hns3_adapter *hns)
return false;

/*
* Check the registers to confirm whether there is reset pending.
* Note: This check may lead to schedule reset task, but only primary
* process can process the reset event. Therefore, limit the
* checking under only primary process.
* Only primary can process can process the reset event,
* so don't check reset event in secondary.
*/
if (rte_eal_process_type() == RTE_PROC_PRIMARY)
hns3vf_check_event_cause(hns, NULL);
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return false;

hns3vf_check_event_cause(hns, NULL);
reset = hns3vf_get_reset_level(hw, &hw->reset.pending);
if (hw->reset.level != HNS3_NONE_RESET && hw->reset.level < reset) {
hns3_warn(hw, "High level reset %d is pending", reset);
Expand Down

0 comments on commit aca18a7

Please sign in to comment.