net: hns3: add calling roce callback function when link status change
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> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
16e8292092
commit
45e92b7e4e
@ -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)
|
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_client *client = hdev->nic_client;
|
||||||
|
struct hnae3_handle *rhandle;
|
||||||
struct hnae3_handle *handle;
|
struct hnae3_handle *handle;
|
||||||
int state;
|
int state;
|
||||||
int i;
|
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++) {
|
for (i = 0; i < hdev->num_vmdq_vport + 1; i++) {
|
||||||
handle = &hdev->vport[i].nic;
|
handle = &hdev->vport[i].nic;
|
||||||
client->ops->link_status_change(handle, state);
|
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;
|
hdev->hw.mac.link = state;
|
||||||
}
|
}
|
||||||
|
@ -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)
|
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_handle *handle = &hdev->nic;
|
||||||
|
struct hnae3_client *rclient;
|
||||||
struct hnae3_client *client;
|
struct hnae3_client *client;
|
||||||
|
|
||||||
client = handle->client;
|
client = handle->client;
|
||||||
|
rclient = hdev->roce_client;
|
||||||
|
|
||||||
link_state =
|
link_state =
|
||||||
test_bit(HCLGEVF_STATE_DOWN, &hdev->state) ? 0 : link_state;
|
test_bit(HCLGEVF_STATE_DOWN, &hdev->state) ? 0 : link_state;
|
||||||
|
|
||||||
if (link_state != hdev->hw.mac.link) {
|
if (link_state != hdev->hw.mac.link) {
|
||||||
client->ops->link_status_change(handle, !!link_state);
|
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;
|
hdev->hw.mac.link = link_state;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user