Received: by 10.213.65.68 with SMTP id h4csp741995imn; Thu, 22 Mar 2018 07:37:53 -0700 (PDT) X-Google-Smtp-Source: AG47ELvTcseI1gpPJlRY5jFJ9UT2KMqOc53TwE+ijQ2tzcCpI85HHtr2NbEPxKHCuKH7gisHYXch X-Received: by 2002:a17:902:6184:: with SMTP id u4-v6mr5831625plj.390.1521729473424; Thu, 22 Mar 2018 07:37:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521729473; cv=none; d=google.com; s=arc-20160816; b=burBjG/GDNqDr1Q6MD+xrfy4dUIa08ztjRqqotgaIPY1IgOsD8xvNPVFcW5FHOkAmU Qw+OP93boZWYgTulVBDAffiqTs4VEugtoJmSad0xATCCkTmcH/yctq8B8DKZkgx8zSnK EwAESqnd+c3ImBQGg1F7RYHFBb86L+snlyRIjTFO6MeStSD7HNrprq0K7s4qIaBBYAG8 cqVWv+/KLFP1syWHnRNr6Xsq/qH8G7ECcs+j3pwbq/TCnWbldB08SgtnKkldAwkNOVaM +3LQ6wHilnGweTIXWJ1fxcL92j0P46zslAbYfhNqaTWEW1EYmZSMUcYjqJFAU2UMcbzs qVZw== 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=FIoyOErJ9OYOCEni8E9FG5YKiFlB276NaL4ZoI47Kyc=; b=d1flu/DmgB8ICPexmisMHbLTiFq8QcEgCbJNzdOM3y14kHDjGQCIY0rppexqxwe5oj mDu27S9K1RCFLs/CiCpQ8o8Dmi2HNJXmLSTAUNVRHPRMhpam39QLPnD/PLWuLR8Fc6T5 n8YGPxvd6C3IGfit3fsyFyNIAvdR6ez0KRyFa8dmoeFsUE5qU4/CJuuzzIhhxbny54AD GWJrITxuw0OPa8JDCopLSp2jl8w0P5RvZsMkN2xdXZh2pq+BGRiTsXqU8ye5nLYRITHP 8WHESOFhjH0hTef32THlaVN7YyZu1GBMlIO9+5ep5hqwTlZMEkiWIKkXmi0AuH0PUTY5 hZ5w== 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 e4si4459455pga.1.2018.03.22.07.37.38; Thu, 22 Mar 2018 07:37:53 -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 S1756044AbeCVOaV (ORCPT + 99 others); Thu, 22 Mar 2018 10:30:21 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:45602 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1754649AbeCVOaR (ORCPT ); Thu, 22 Mar 2018 10:30:17 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 835301BC9712D; Thu, 22 Mar 2018 22:30:02 +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:29:52 +0800 From: Salil Mehta To: CC: , , , , , Subject: [PATCH net-next 4/9] net: hns3: Add support to request VF Reset to PF Date: Thu, 22 Mar 2018 14:28:55 +0000 Message-ID: <20180322142900.22860-5-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 VF driver depends upon PF to eventually reset the hardware. This request is made using the mailbox command. This patch adds the required function to acheive above. Signed-off-by: Salil Mehta --- .../net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c index 0d204e2..b648311 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -832,6 +832,20 @@ static void hclgevf_reset_tqp(struct hnae3_handle *handle, u16 queue_id) 2, true, NULL, 0); } +static int hclgevf_do_reset(struct hclgevf_dev *hdev) +{ + int status; + u8 respmsg; + + status = hclgevf_send_mbx_msg(hdev, HCLGE_MBX_RESET, 0, NULL, + 0, false, &respmsg, sizeof(u8)); + if (status) + dev_err(&hdev->pdev->dev, + "VF reset request to PF failed(=%d)\n", status); + + return status; +} + static void hclgevf_reset_event(struct hnae3_handle *handle) { struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); @@ -910,6 +924,7 @@ static void hclgevf_reset_service_task(struct work_struct *work) { struct hclgevf_dev *hdev = container_of(work, struct hclgevf_dev, rst_service_task); + int ret; if (test_and_set_bit(HCLGEVF_STATE_RST_HANDLING, &hdev->state)) return; @@ -965,6 +980,10 @@ static void hclgevf_reset_service_task(struct work_struct *work) hdev->reset_attempts++; /* request PF for resetting this VF via mailbox */ + ret = hclgevf_do_reset(hdev); + if (ret) + dev_warn(&hdev->pdev->dev, + "VF rst fail, stack will call\n"); } } -- 2.7.4