Received: by 10.213.65.68 with SMTP id h4csp794285imn; Thu, 22 Mar 2018 08:42:21 -0700 (PDT) X-Google-Smtp-Source: AG47ELtNVdkdmgC9h3QJ4aooV3cAzbhKIHlzQF1exs/4MfXGvHaeqQsagcLRMefoxRCFL35pAMwO X-Received: by 2002:a17:902:b43:: with SMTP id 61-v6mr25265758plq.270.1521733341597; Thu, 22 Mar 2018 08:42:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521733341; cv=none; d=google.com; s=arc-20160816; b=Pb/pFBK5TB9UYTdt7vO2KuSFNknBlWEyoCSvfTQAxDsz5E3LxJ+7d+u5ociUg138jK wE95g5VmT893EijWbRNsmqd8M+W6zGNyPQkbeInjyiB5ZDJII+na6SCmzepcPovCjtBY jdyG0zSXZwL/qTZc8K9S4+OpSA7FXy3Ck8skPSuzEYtKB0uOl9WD/QuniLmjQpA4FsfB dwIVHf6wCVvYmUBDl9HGAaBShnnEs6LFNG40ZaOWDAcP/iXjdz3mLub5HAMbwQdT9LFY GthXaFP0OdYAdjJqd/Mj1MZUzeoPyaRkaqWCBQ8xuJKOFED7QQb4qm0hbey7Nm3U7Xr0 CMmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=aFX6yljQgthFosMDd19x+ag3oNXTSy0kY58EI0g2aQ0=; b=lUZj6nAuSOzZrq4w9OzYAPwlyj2ter1v5V/NrNr06HqBRZV5PbnptX8zEFqzMC8BQH hkabX9tVYkQxp96Tt4N09e08SUplzuudKaiGz0uOVQFJNSYaHla4avGa1ZhFTu4Zptzp 3fprifRcB3k2QaJTw1MFLTykwa8AHfOB28IWZHX5uRdWt2fsGhmIs0vNpaKtR0HDQdi+ o4n1E9rj3ljX1448n3h2g9x/N73q9sQfySJZ8h0sqS2fJRUUGwoeNwQS4fcAv9Hl//QL c1B9RWaVIz8sO22SdAQUyNh8CiyPGG6LqaWKMbu6MGmb5qU2YbWPeGizdrT+hJznJwtA cXHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33-v6si6535932ply.517.2018.03.22.08.42.06; Thu, 22 Mar 2018 08:42:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756063AbeCVOa1 (ORCPT + 99 others); Thu, 22 Mar 2018 10:30:27 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:6261 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753729AbeCVOaX (ORCPT ); Thu, 22 Mar 2018 10:30:23 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 45D17F9DA1AF9; Thu, 22 Mar 2018 22:30:07 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.226.47) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.361.1; Thu, 22 Mar 2018 22:30:02 +0800 From: Salil Mehta To: CC: , , , , , 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 Message-ID: <20180322142900.22860-9-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180322142900.22860-1-salil.mehta@huawei.com> References: <20180322142900.22860-1-salil.mehta@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.202.226.47] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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