linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Huazhong Tan <tanhuazhong@huawei.com>
To: <davem@davemloft.net>, <eric.dumazet@gmail.com>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<huangdaode@hisilicon.com>, <yisen.zhuang@huawei.com>,
	<salil.mehta@huawei.com>, <linuxarm@huawei.com>,
	Peng Li <lipeng321@huawei.com>, Wei Hu <xavier.huwei@huawei.com>,
	Huazhong Tan <tanhuazhong@huawei.com>
Subject: [PATCH V2 net-next 01/12] net: hns3: add calling roce callback function when link status change
Date: Wed, 23 Jan 2019 07:39:27 +0800	[thread overview]
Message-ID: <20190122233938.7188-2-tanhuazhong@huawei.com> (raw)
In-Reply-To: <20190122233938.7188-1-tanhuazhong@huawei.com>

From: Peng Li <lipeng321@huawei.com>

This patch adds calling roce callback function when link status
change.

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c   | 6 ++++++
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 5 +++++
 2 files changed, 11 insertions(+)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 00d7acb4d45a..35fb0c54b986 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -2105,7 +2105,9 @@ static int hclge_get_mac_phy_link(struct hclge_dev *hdev)
 
 static void hclge_update_link_status(struct hclge_dev *hdev)
 {
+	struct hnae3_client *rclient = hdev->roce_client;
 	struct hnae3_client *client = hdev->nic_client;
+	struct hnae3_handle *rhandle;
 	struct hnae3_handle *handle;
 	int state;
 	int i;
@@ -2117,6 +2119,10 @@ static void hclge_update_link_status(struct hclge_dev *hdev)
 		for (i = 0; i < hdev->num_vmdq_vport + 1; i++) {
 			handle = &hdev->vport[i].nic;
 			client->ops->link_status_change(handle, state);
+			rhandle = &hdev->vport[i].roce;
+			if (rclient && rclient->ops->link_status_change)
+				rclient->ops->link_status_change(rhandle,
+								 state);
 		}
 		hdev->hw.mac.link = state;
 	}
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
index bb9f45200ef5..989f08377d58 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
@@ -349,16 +349,21 @@ static void hclgevf_request_link_info(struct hclgevf_dev *hdev)
 
 void hclgevf_update_link_status(struct hclgevf_dev *hdev, int link_state)
 {
+	struct hnae3_handle *rhandle = &hdev->roce;
 	struct hnae3_handle *handle = &hdev->nic;
+	struct hnae3_client *rclient;
 	struct hnae3_client *client;
 
 	client = handle->client;
+	rclient = hdev->roce_client;
 
 	link_state =
 		test_bit(HCLGEVF_STATE_DOWN, &hdev->state) ? 0 : link_state;
 
 	if (link_state != hdev->hw.mac.link) {
 		client->ops->link_status_change(handle, !!link_state);
+		if (rclient && rclient->ops->link_status_change)
+			rclient->ops->link_status_change(rhandle, !!link_state);
 		hdev->hw.mac.link = link_state;
 	}
 }
-- 
2.20.1



  reply	other threads:[~2019-01-22 23:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-22 23:39 [PATCH V2 net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
2019-01-22 23:39 ` Huazhong Tan [this message]
2019-01-22 23:39 ` [PATCH V2 net-next 02/12] net: hns3: add rx multicast packets statistic Huazhong Tan
2019-01-22 23:39 ` [PATCH V2 net-next 03/12] net: hns3: refactor the statistics updating for netdev Huazhong Tan
2019-01-22 23:39 ` [PATCH V2 net-next 04/12] net: hns3: fix rss configuration lost problem when setting channel Huazhong Tan
2019-01-22 23:39 ` [PATCH V2 net-next 05/12] net: hns3: fix for shaper not setting when TC num changes Huazhong Tan
2019-01-22 23:39 ` [PATCH V2 net-next 06/12] net: hns3: fix bug of ethtool_ops.get_channels for VF Huazhong Tan
2019-01-22 23:39 ` [PATCH V2 net-next 07/12] net: hns3: clear param in ring when free ring Huazhong Tan
2019-01-22 23:39 ` [PATCH V2 net-next 08/12] net: hns3: Change fw error code NOT_EXEC to NOT_SUPPORTED Huazhong Tan
2019-01-22 23:39 ` [PATCH V2 net-next 09/12] net: hns3: do not return GE PFC setting err when initializing Huazhong Tan
2019-01-22 23:39 ` [PATCH V2 net-next 10/12] net: hns3: add ETS TC weight setting in SSU module Huazhong Tan
2019-01-22 23:39 ` [PATCH V2 net-next 11/12] net: hns3: add statistics for PFC frames and MAC control frames Huazhong Tan
2019-01-22 23:39 ` [PATCH V2 net-next 12/12] net: hns3: fix PFC not setting problem for DCB module Huazhong Tan
2019-01-23 19:13 ` [PATCH V2 net-next 00/12] code optimizations & bugfixes for HNS3 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=20190122233938.7188-2-tanhuazhong@huawei.com \
    --to=tanhuazhong@huawei.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=huangdaode@hisilicon.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=lipeng321@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=salil.mehta@huawei.com \
    --cc=xavier.huwei@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).