LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Salil Mehta <salil.mehta@huawei.com>
To: <davem@davemloft.net>
Cc: <salil.mehta@huawei.com>, <yisen.zhuang@huawei.com>,
<mehta.salil.lnk@gmail.com>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linuxarm@huawei.com>
Subject: [PATCH net-next 8/9] net: hns3: Add *Asserting Reset* mailbox message & handling in VF
Date: Thu, 22 Mar 2018 14:28:59 +0000 [thread overview]
Message-ID: <20180322142900.22860-9-salil.mehta@huawei.com> (raw)
In-Reply-To: <20180322142900.22860-1-salil.mehta@huawei.com>
Reset Asserting message is forwarded by PF to inform VF about
the hardware reset which is about to happen. This might be due
to the earlier VF reset request received by the PF or because PF
for any reason decides to undergo reset. This message results in
VF to go in pending state in which it polls the hardware to
complete the reset and then further resets/tears its own stack.
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
---
drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h | 1 +
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c | 12 ++++++++++++
2 files changed, 13 insertions(+)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h b/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h
index f3e90c2..519e2bd 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h
@@ -11,6 +11,7 @@
enum HCLGE_MBX_OPCODE {
HCLGE_MBX_RESET = 0x01, /* (VF -> PF) assert reset */
+ HCLGE_MBX_ASSERTING_RESET, /* (PF -> VF) PF is asserting reset*/
HCLGE_MBX_SET_UNICAST, /* (VF -> PF) set UC addr */
HCLGE_MBX_SET_MULTICAST, /* (VF -> PF) set MC addr */
HCLGE_MBX_SET_VLAN, /* (VF -> PF) set VLAN */
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c
index 7687911..a286184 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c
@@ -170,6 +170,7 @@ void hclgevf_mbx_handler(struct hclgevf_dev *hdev)
}
break;
case HCLGE_MBX_LINK_STAT_CHANGE:
+ case HCLGE_MBX_ASSERTING_RESET:
/* set this mbx event as pending. This is required as we
* might loose interrupt event when mbx task is busy
* handling. This shall be cleared when mbx task just
@@ -242,6 +243,17 @@ void hclgevf_mbx_async_handler(struct hclgevf_dev *hdev)
hclgevf_update_speed_duplex(hdev, speed, duplex);
break;
+ case HCLGE_MBX_ASSERTING_RESET:
+ /* PF has asserted reset hence VF should go in pending
+ * state and poll for the hardware reset status till it
+ * has been completely reset. After this stack should
+ * eventually be re-initialized.
+ */
+ hdev->nic.reset_level = HNAE3_VF_RESET;
+ set_bit(HCLGEVF_RESET_PENDING, &hdev->reset_state);
+ hclgevf_reset_task_schedule(hdev);
+
+ break;
default:
dev_err(&hdev->pdev->dev,
"fetched unsupported(%d) message from arq\n",
--
2.7.4
next prev parent reply other threads:[~2018-03-22 14:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-22 14:28 [PATCH net-next 0/9] Add support of VF Reset to HNS3 VF driver Salil Mehta
2018-03-22 14:28 ` [PATCH net-next 1/9] net: hns3: Changes to make enet watchdog timeout func common for PF/VF Salil Mehta
2018-03-22 14:28 ` [PATCH net-next 2/9] net: hns3: Add VF Reset Service Task to support event handling Salil Mehta
2018-03-22 14:28 ` [PATCH net-next 3/9] net: hns3: Add VF Reset device state and its handling Salil Mehta
2018-03-22 14:28 ` [PATCH net-next 4/9] net: hns3: Add support to request VF Reset to PF Salil Mehta
2018-03-22 14:28 ` [PATCH net-next 5/9] net: hns3: Add support to reset the enet/ring mgmt layer Salil Mehta
2018-03-22 14:28 ` [PATCH net-next 6/9] net: hns3: Add support to re-initialize the hclge device Salil Mehta
2018-03-22 14:28 ` [PATCH net-next 7/9] net: hns3: Changes to support ARQ(Asynchronous Receive Queue) Salil Mehta
2018-03-22 14:28 ` Salil Mehta [this message]
2018-03-22 14:29 ` [PATCH net-next 9/9] net: hns3: Changes required in PF mailbox to support VF reset Salil Mehta
2018-03-22 19:34 ` [PATCH net-next 0/9] Add support of VF Reset to HNS3 VF driver 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=20180322142900.22860-9-salil.mehta@huawei.com \
--to=salil.mehta@huawei.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=mehta.salil.lnk@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=yisen.zhuang@huawei.com \
--subject='Re: [PATCH net-next 8/9] net: hns3: Add *Asserting Reset* mailbox message & handling in VF' \
/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
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).