Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp794877imm; Tue, 5 Jun 2018 04:43:56 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJbmRJVVUGI9r21fq2e2hjZnuhMDH4xXpPLCcleP7YaR6qpi8FNwoHXRiIYudbbLY6whZfm X-Received: by 2002:a63:7986:: with SMTP id u128-v6mr4153703pgc.273.1528199036249; Tue, 05 Jun 2018 04:43:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528199036; cv=none; d=google.com; s=arc-20160816; b=eOcR0YDUP16TMNT5xgsRrEdXZ+AxE+6eetQyIFYgtZNC1kC/uCydzFtNvxaJ+rc8ZC wjxMt0vQhmm1yy5wZlrAveYUeM//9VHCthaf33VXavdOAQ2w10Qc6Sc4IuPWO1KpqQxB ZwY17QktSJdRLACbBnE8ZzgL3eCMwZ6s0ujdNAx3thIdFw5PQblXydjswoT77YbaVJh7 F4fjOcnW4orXY257JzAecNR8gmgy2U+KsSN9zMwuhsi7p/WGazgnQqzCTif7F3cwl5qX Ge7DnTTGC1g1YFJk2D5KloQKZbZcrFV7KMOBVsFVdT1DOKyHLQk6aEW6LaAMdFBwhCoI 522g== 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=rUgOCcetzR3rd/qOhiYTAQuxdtuSsjBHeb1E7oyQUns=; b=e3Vc0R395jHQiEX7FicYaiNn8FUHy05JYXSkPhUf5nu4bkrY7sJAqk441tVSDR74a8 eKJXfVEg4Rd5977W7ew2LcXnA7ClJzCaxGgqLJ/u8nH5GtcHgAdmqtfng76zyAcgi11G M1Fz1KaKzNn3CTPbba+2/5FA1aZ1QbT4TYJ5xNV9hT675nuUVjGFcVWPuz10uGLeu/YD FP2XH0Af+tKz03neipO5Tr+gqMeiTk4FI15Hm7GrZJGSUlphBCYjT/MvLTbGCyjFjqLs UznNI1/bw+E+rKPeN1yZmCukuPHvCMCIFu4tRT22OkiFd816eOASyarQs1L6S4emdwKf fETA== 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 m67-v6si8090383pgm.517.2018.06.05.04.43.41; Tue, 05 Jun 2018 04:43:56 -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 S1751949AbeFELnR (ORCPT + 99 others); Tue, 5 Jun 2018 07:43:17 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:8644 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751721AbeFELnO (ORCPT ); Tue, 5 Jun 2018 07:43:14 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id B68BC3F6DA4A; Tue, 5 Jun 2018 19:42:58 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.227.234) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.382.0; Tue, 5 Jun 2018 19:42:50 +0800 From: Salil Mehta To: CC: , , , , , , , Xi Wang Subject: [PATCH net-next 3/3] net: hns3: Optimize PF CMDQ interrupt switching process Date: Tue, 5 Jun 2018 12:42:01 +0100 Message-ID: <20180605114201.29900-4-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180605114201.29900-1-salil.mehta@huawei.com> References: <20180605114201.29900-1-salil.mehta@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.202.227.234] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xi Wang When the PF frequently switches the CMDQ interrupt, if the CMDQ_SRC is not cleared before the hardware interrupt is generated, the new interrupt will not be reported. This patch optimizes this problem by clearing CMDQ_SRC and RESET_STS before enabling interrupt and syncing pending IRQ handlers after disabling interrupt. Fixes: 466b0c00391b ("net: hns3: Add support for misc interrupt") Signed-off-by: Xi Wang Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 2a80134..d318d35 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -2557,6 +2557,15 @@ static void hclge_clear_event_cause(struct hclge_dev *hdev, u32 event_type, } } +static void hclge_clear_all_event_cause(struct hclge_dev *hdev) +{ + hclge_clear_event_cause(hdev, HCLGE_VECTOR0_EVENT_RST, + BIT(HCLGE_VECTOR0_GLOBALRESET_INT_B) | + BIT(HCLGE_VECTOR0_CORERESET_INT_B) | + BIT(HCLGE_VECTOR0_IMPRESET_INT_B)); + hclge_clear_event_cause(hdev, HCLGE_VECTOR0_EVENT_MBX, 0); +} + static void hclge_enable_vector(struct hclge_misc_vector *vector, bool enable) { writel(enable ? 1 : 0, vector->addr); @@ -5688,6 +5697,8 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev) INIT_WORK(&hdev->rst_service_task, hclge_reset_service_task); INIT_WORK(&hdev->mbx_service_task, hclge_mailbox_service_task); + hclge_clear_all_event_cause(hdev); + /* Enable MISC vector(vector0) */ hclge_enable_vector(&hdev->misc_vector, true); @@ -5817,6 +5828,8 @@ static void hclge_uninit_ae_dev(struct hnae3_ae_dev *ae_dev) /* Disable MISC vector(vector0) */ hclge_enable_vector(&hdev->misc_vector, false); + synchronize_irq(hdev->misc_vector.vector_irq); + hclge_destroy_cmd_queue(&hdev->hw); hclge_misc_irq_uninit(hdev); hclge_pci_uninit(hdev); -- 2.7.4