提交 5c58d46b 编写于 作者: M Michael Chan 提交者: Zheng Zengkai

bnxt_en: Convert to use netif_level() helpers.

stable inclusion
from stable-5.10.68
commit 639a2eddb7310bf6e76377a2e5610184712204a3
bugzilla: 182671 https://gitee.com/openeuler/kernel/issues/I4EWUH

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=639a2eddb7310bf6e76377a2e5610184712204a3

--------------------------------

[ Upstream commit 871127e6 ]

Use the various netif_level() helpers to simplify the C code.  This was
suggested by Joe Perches.

Cc: Joe Perches <joe@perches.com>
Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/1611642024-3166-1-git-send-email-michael.chan@broadcom.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 cc0ca2d5
...@@ -1305,8 +1305,7 @@ static void bnxt_tpa_start(struct bnxt *bp, struct bnxt_rx_ring_info *rxr, ...@@ -1305,8 +1305,7 @@ static void bnxt_tpa_start(struct bnxt *bp, struct bnxt_rx_ring_info *rxr,
} else { } else {
tpa_info->hash_type = PKT_HASH_TYPE_NONE; tpa_info->hash_type = PKT_HASH_TYPE_NONE;
tpa_info->gso_type = 0; tpa_info->gso_type = 0;
if (netif_msg_rx_err(bp)) netif_warn(bp, rx_err, bp->dev, "TPA packet without valid hash\n");
netdev_warn(bp->dev, "TPA packet without valid hash\n");
} }
tpa_info->flags2 = le32_to_cpu(tpa_start1->rx_tpa_start_cmp_flags2); tpa_info->flags2 = le32_to_cpu(tpa_start1->rx_tpa_start_cmp_flags2);
tpa_info->metadata = le32_to_cpu(tpa_start1->rx_tpa_start_cmp_metadata); tpa_info->metadata = le32_to_cpu(tpa_start1->rx_tpa_start_cmp_metadata);
...@@ -2099,12 +2098,11 @@ static int bnxt_async_event_process(struct bnxt *bp, ...@@ -2099,12 +2098,11 @@ static int bnxt_async_event_process(struct bnxt *bp,
fatal_str = "fatal"; fatal_str = "fatal";
set_bit(BNXT_STATE_FW_FATAL_COND, &bp->state); set_bit(BNXT_STATE_FW_FATAL_COND, &bp->state);
} }
if (netif_msg_hw(bp)) { netif_warn(bp, hw, bp->dev,
netdev_warn(bp->dev, "Firmware %s reset event, data1: 0x%x, data2: 0x%x, min wait %u ms, max wait %u ms\n", "Firmware %s reset event, data1: 0x%x, data2: 0x%x, min wait %u ms, max wait %u ms\n",
fatal_str, data1, data2, fatal_str, data1, data2,
bp->fw_reset_min_dsecs * 100, bp->fw_reset_min_dsecs * 100,
bp->fw_reset_max_dsecs * 100); bp->fw_reset_max_dsecs * 100);
}
set_bit(BNXT_FW_RESET_NOTIFY_SP_EVENT, &bp->sp_event); set_bit(BNXT_FW_RESET_NOTIFY_SP_EVENT, &bp->sp_event);
break; break;
} }
...@@ -2119,13 +2117,11 @@ static int bnxt_async_event_process(struct bnxt *bp, ...@@ -2119,13 +2117,11 @@ static int bnxt_async_event_process(struct bnxt *bp,
if (!fw_health->enabled) if (!fw_health->enabled)
break; break;
if (netif_msg_drv(bp)) netif_info(bp, drv, bp->dev,
netdev_info(bp->dev, "Error recovery info: error recovery[%d], master[%d], reset count[0x%x], health status: 0x%x\n", "Error recovery info: error recovery[%d], master[%d], reset count[0x%x], health status: 0x%x\n",
fw_health->enabled, fw_health->master, fw_health->enabled, fw_health->master,
bnxt_fw_health_readl(bp, bnxt_fw_health_readl(bp, BNXT_FW_RESET_CNT_REG),
BNXT_FW_RESET_CNT_REG), bnxt_fw_health_readl(bp, BNXT_FW_HEALTH_REG));
bnxt_fw_health_readl(bp,
BNXT_FW_HEALTH_REG));
fw_health->tmr_multiplier = fw_health->tmr_multiplier =
DIV_ROUND_UP(fw_health->polling_dsecs * HZ, DIV_ROUND_UP(fw_health->polling_dsecs * HZ,
bp->current_interval * 10); bp->current_interval * 10);
...@@ -2137,11 +2133,9 @@ static int bnxt_async_event_process(struct bnxt *bp, ...@@ -2137,11 +2133,9 @@ static int bnxt_async_event_process(struct bnxt *bp,
goto async_event_process_exit; goto async_event_process_exit;
} }
case ASYNC_EVENT_CMPL_EVENT_ID_DEBUG_NOTIFICATION: case ASYNC_EVENT_CMPL_EVENT_ID_DEBUG_NOTIFICATION:
if (netif_msg_hw(bp)) { netif_notice(bp, hw, bp->dev,
netdev_notice(bp->dev, "Received firmware debug notification, data1: 0x%x, data2: 0x%x\n",
"Received firmware debug notification, data1: 0x%x, data2: 0x%x\n", data1, data2);
data1, data2);
}
goto async_event_process_exit; goto async_event_process_exit;
case ASYNC_EVENT_CMPL_EVENT_ID_RING_MONITOR_MSG: { case ASYNC_EVENT_CMPL_EVENT_ID_RING_MONITOR_MSG: {
struct bnxt_rx_ring_info *rxr; struct bnxt_rx_ring_info *rxr;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册