From: Salil Mehta <salil.mehta@huawei.com>
To: <davem@davemloft.net>
Cc: <salil.mehta@huawei.com>, <yisen.zhuang@huawei.com>,
<lipeng321@huawei.com>, <mehta.salil@opnsrc.net>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linuxarm@huawei.com>, Shiju Jose <shiju.jose@huawei.com>
Subject: [PATCH net-next 06/14] net: hns3: add optimization in the hclge_hw_error_set_state
Date: Fri, 7 Dec 2018 21:08:03 +0000 [thread overview]
Message-ID: <20181207210811.23844-7-salil.mehta@huawei.com> (raw)
In-Reply-To: <20181207210811.23844-1-salil.mehta@huawei.com>
From: Shiju Jose <shiju.jose@huawei.com>
1. This patch adds minor loop optimization in the
hclge_hw_error_set_state function.
2. Adds logging module's name if it fails to configure the
error interrupts.
Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
---
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c
index 2d07be8..d1c9f7a 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c
@@ -586,18 +586,16 @@ static const struct hclge_hw_blk hw_blk[] = {
int hclge_hw_error_set_state(struct hclge_dev *hdev, bool state)
{
+ const struct hclge_hw_blk *module = hw_blk;
int ret = 0;
- int i = 0;
- while (hw_blk[i].name) {
- if (!hw_blk[i].config_err_int) {
- i++;
- continue;
+ while (module->name) {
+ if (module->config_err_int) {
+ ret = module->config_err_int(hdev, state);
+ if (ret)
+ return ret;
}
- ret = hw_blk[i].config_err_int(hdev, state);
- if (ret)
- return ret;
- i++;
+ module++;
}
return ret;
--
2.7.4
next prev parent reply other threads:[~2018-12-07 21:09 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-07 21:07 [PATCH net-next 00/14] net: hns3: Additions/optimizations related to HNS3 H/W err handling Salil Mehta
2018-12-07 21:07 ` [PATCH net-next 01/14] net: hns3: remove existing process error functions and reorder hw_blk table Salil Mehta
2018-12-07 21:07 ` [PATCH net-next 02/14] net: hns3: rename enable error interrupt functions Salil Mehta
2018-12-07 21:08 ` [PATCH net-next 03/14] net: hns3: re-enable error interrupts on hw reset Salil Mehta
2018-12-07 21:08 ` [PATCH net-next 04/14] net: hns3: deletes unnecessary settings of the descriptor data Salil Mehta
2018-12-07 21:08 ` [PATCH net-next 05/14] net: hns3: rename process_hw_error function Salil Mehta
2018-12-07 21:08 ` Salil Mehta [this message]
2018-12-07 21:08 ` [PATCH net-next 07/14] net: hns3: add handling of hw ras errors using new set of commands Salil Mehta
2018-12-07 21:08 ` [PATCH net-next 08/14] net: hns3: deleted logging 1 bit errors Salil Mehta
2018-12-07 21:08 ` [PATCH net-next 09/14] net: hns3: add handling of hw errors reported through MSIX Salil Mehta
2018-12-07 21:08 ` [PATCH net-next 10/14] net: hns3: add handling of hw errors of MAC Salil Mehta
2018-12-07 21:08 ` [PATCH net-next 11/14] net: hns3: handle hw errors of PPP PF Salil Mehta
2018-12-07 21:08 ` [PATCH net-next 12/14] net: hns3: handle hw errors of PPU(RCB) Salil Mehta
2018-12-07 21:08 ` [PATCH net-next 13/14] net: hns3: handle hw errors of SSU Salil Mehta
2018-12-07 21:08 ` [PATCH net-next 14/14] net: hns3: add handling of RDMA RAS errors Salil Mehta
2018-12-08 0:03 ` [PATCH net-next 00/14] net: hns3: Additions/optimizations related to HNS3 H/W err handling David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181207210811.23844-7-salil.mehta@huawei.com \
--to=salil.mehta@huawei.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=lipeng321@huawei.com \
--cc=mehta.salil@opnsrc.net \
--cc=netdev@vger.kernel.org \
--cc=shiju.jose@huawei.com \
--cc=yisen.zhuang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).