Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp75289ybt; Mon, 6 Jul 2020 04:28:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyStqFGyX2QMU0SOPRXGPfbKu97pDukC1L1LCGWN9R7gW9S1Nk+T81xxdY0hGKyjJbo34gC X-Received: by 2002:a17:907:9486:: with SMTP id dm6mr44561797ejc.248.1594034914065; Mon, 06 Jul 2020 04:28:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594034914; cv=none; d=google.com; s=arc-20160816; b=RYiOCdv6bdZcMAeYDw+OFpQQQvM80Vj7/spIt5QiAqL7jKa7LYUp21D8EkLo5xjFv1 DBnakyJ184B/2hp092igeEh7RgkzrtDT97dwJLe1Wnodr4vIPuzuNqDwoSd3CNdRiTuk PzZ1HimvTmilz/7ZpGATAjiZ7GF//Hb+WI89x0MiwDyQbiC1I1NuN1r6R7S73u9Xqxux iu72BVuMXh3A+4X5JnTafw9fQCDtNpgMUZF0nRmO2w7bn//vhSwBywqFIaKG8FZFyEii X0DdGB8ij6NHRYMBfDg8PP0/BOQwo7X6qU0LTW97y4MraH6nagEVePgVoleZ61X5tT9s w4ZA== 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; bh=1SY6w9Vjjl49V47EMCyqdYLM+VYLIpqkh2+GtQvdpOQ=; b=RR/1whYwKM2H94iGsC5U+tv9KfIkzOQ86Oo24k3GDrwJAUwd1z2KY1YVuL7T/Il8fF LW9+8sUNOdxhqYG9wk20iCERUxXAs3gviqvd8mP8OGenYCNORA/ysQFk5lM0uxLeA55M yEyliO/Y9+5jT9IR0SzoO7WpGDiR1bsrGcV1c+1JknnJzkRXmjiKGiHdMyoc3hyA4yo+ LSQvk9JMsjqlEsucxFu/BAXE16iCcDP5SJDXlHyXC1gDgnCUxUX+FPRnLTwIbc7gqrmW bSS1pAI/DNnqKf6kME9WyK3OT0Z33HDH3lqIIWmRi5sUr8box2SFV2YJ0nKe3k/TO/Wo +1Fg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dr10si15849998ejc.204.2020.07.06.04.28.11; Mon, 06 Jul 2020 04:28:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729006AbgGFL17 (ORCPT + 99 others); Mon, 6 Jul 2020 07:27:59 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:59682 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728946AbgGFL16 (ORCPT ); Mon, 6 Jul 2020 07:27:58 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 95ACA980027EC2B21D8E; Mon, 6 Jul 2020 19:27:55 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.487.0; Mon, 6 Jul 2020 19:27:46 +0800 From: Huazhong Tan To: CC: , , , , , , Huazhong Tan Subject: [PATCH net 2/4] net: hns3: fix for mishandle of asserting VF reset fail Date: Mon, 6 Jul 2020 19:26:00 +0800 Message-ID: <1594034762-6445-3-git-send-email-tanhuazhong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1594034762-6445-1-git-send-email-tanhuazhong@huawei.com> References: <1594034762-6445-1-git-send-email-tanhuazhong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When asserts VF reset fail, flag HCLGEVF_STATE_CMD_DISABLE and handshake status should not set, otherwise the retry will fail. So adds a check for asserting VF reset and returns directly when fails. Fixes: ef5f8e507ec9 ("net: hns3: stop handling command queue while resetting VF") Signed-off-by: Huazhong Tan --- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c index 1b9578d..a10b022 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -1793,6 +1793,11 @@ static int hclgevf_reset_prepare_wait(struct hclgevf_dev *hdev) if (hdev->reset_type == HNAE3_VF_FUNC_RESET) { hclgevf_build_send_msg(&send_msg, HCLGE_MBX_RESET, 0); ret = hclgevf_send_mbx_msg(hdev, &send_msg, true, NULL, 0); + if (ret) { + dev_err(&hdev->pdev->dev, + "failed to assert VF reset, ret = %d\n", ret); + return ret; + } hdev->rst_stats.vf_func_rst_cnt++; } -- 2.7.4