From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B500843699 for ; Thu, 7 Dec 2023 12:21:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B09AE42F06; Thu, 7 Dec 2023 12:21:56 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id F3ADE42F04 for ; Thu, 7 Dec 2023 12:21:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701948115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HuPl5b63/ryNblMJwTlsNUb30oZmVaGD+gYakMkLwwg=; b=Di4t/CNwYZIcnyiFne+Vu1mErnlanfII3TgOQ520RBax3NWpLr0RBbWB2VCfdBpQDUYUxd Kg2m/8WRm0rYWwKHFW4tK7zBu//uWW3xbA6WgESimw5wi2tGkvXsENWr6ptUtH3/IX01zc YHc3pyovJqL9aywJHyduVyT74A32w8I= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-591-kzw1ZItyOxymHBM7WRuGvQ-1; Thu, 07 Dec 2023 06:21:49 -0500 X-MC-Unique: kzw1ZItyOxymHBM7WRuGvQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A94FF863061; Thu, 7 Dec 2023 11:21:49 +0000 (UTC) Received: from rh.Home (unknown [10.39.192.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E0C2C185A0; Thu, 7 Dec 2023 11:21:48 +0000 (UTC) From: Kevin Traynor To: Dengdui Huang Cc: Jie Hai , dpdk stable Subject: patch 'net/hns3: fix VF reset handler interruption' has been queued to stable release 21.11.6 Date: Thu, 7 Dec 2023 11:21:13 +0000 Message-ID: <20231207112116.769502-21-ktraynor@redhat.com> In-Reply-To: <20231207112116.769502-1-ktraynor@redhat.com> References: <20231207112116.769502-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 21.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/12/23. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/9bb15a3d0f9e33a6887ce6c0985108a2e4e0b14b Thanks. Kevin --- >From 9bb15a3d0f9e33a6887ce6c0985108a2e4e0b14b Mon Sep 17 00:00:00 2001 From: Dengdui Huang Date: Mon, 27 Nov 2023 21:39:03 +0800 Subject: [PATCH] net/hns3: fix VF reset handler interruption [ upstream commit 94cf4db1603fe9074b5275cc4b63685fc91fdac5 ] Currently, the VF reset interrupt is enabled before the reset process is completed. If the VF reset is triggered by an IMP reset, the initialization of IMP is may not completed, and the VF reset interrupt may continue to be reported. In this scenario, the VF reset being performed by the driver does not need to be interrupted. Therefore, for VF reset, the driver has to enable the interrupt after the end of reset. Fixes: a5475d61fa34 ("net/hns3: support VF") Signed-off-by: Dengdui Huang Acked-by: Jie Hai --- drivers/net/hns3/hns3_ethdev.h | 12 ++++++++++++ drivers/net/hns3/hns3_ethdev_vf.c | 19 +++++++++++++++++-- drivers/net/hns3/hns3_intr.c | 3 +-- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h index 093d11cd71..5ba9503bf8 100644 --- a/drivers/net/hns3/hns3_ethdev.h +++ b/drivers/net/hns3/hns3_ethdev.h @@ -1037,4 +1037,5 @@ void hns3vf_update_link_status(struct hns3_hw *hw, uint8_t link_status, void hns3vf_update_push_lsc_cap(struct hns3_hw *hw, bool supported); void hns3_clear_reset_event(struct hns3_hw *hw); +void hns3vf_clear_reset_event(struct hns3_hw *hw); static inline bool @@ -1049,3 +1050,14 @@ is_reset_pending(struct hns3_adapter *hns) } +static inline void +hns3_clear_reset_status(struct hns3_hw *hw) +{ + struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw); + + if (hns->is_vf) + hns3vf_clear_reset_event(hw); + else + hns3_clear_reset_event(hw); +} + #endif /* _HNS3_ETHDEV_H_ */ diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c index 5b76aad261..0d1d271f37 100644 --- a/drivers/net/hns3/hns3_ethdev_vf.c +++ b/drivers/net/hns3/hns3_ethdev_vf.c @@ -612,4 +612,17 @@ hns3vf_enable_irq0(struct hns3_hw *hw) } +void +hns3vf_clear_reset_event(struct hns3_hw *hw) +{ + uint32_t clearval; + uint32_t cmdq_stat_reg; + + cmdq_stat_reg = hns3_read_dev(hw, HNS3_VECTOR0_CMDQ_STAT_REG); + clearval = cmdq_stat_reg & ~BIT(HNS3_VECTOR0_RST_INT_B); + hns3_write_dev(hw, HNS3_VECTOR0_CMDQ_SRC_REG, clearval); + + hns3vf_enable_irq0(hw); +} + static enum hns3vf_evt_cause hns3vf_check_event_cause(struct hns3_adapter *hns, uint32_t *clearval) @@ -686,6 +699,8 @@ hns3vf_interrupt_handler(void *param) } - /* Enable interrupt */ - hns3vf_enable_irq0(hw); + /* Enable interrupt if it is not caused by reset */ + if (event_cause == HNS3VF_VECTOR0_EVENT_MBX || + event_cause == HNS3VF_VECTOR0_EVENT_OTHER) + hns3vf_enable_irq0(hw); } diff --git a/drivers/net/hns3/hns3_intr.c b/drivers/net/hns3/hns3_intr.c index 9c5a4b018c..b049774e9a 100644 --- a/drivers/net/hns3/hns3_intr.c +++ b/drivers/net/hns3/hns3_intr.c @@ -2731,6 +2731,5 @@ hns3_reset_post(struct hns3_adapter *hns) hns3_notify_reset_ready(hw, false); hns3_clear_reset_level(hw, &hw->reset.pending); - if (!hns->is_vf) - hns3_clear_reset_event(hw); + hns3_clear_reset_status(hw); __atomic_store_n(&hns->hw.reset.resetting, 0, __ATOMIC_RELAXED); hw->reset.attempts = 0; -- 2.43.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-12-07 11:19:00.099501980 +0000 +++ 0021-net-hns3-fix-VF-reset-handler-interruption.patch 2023-12-07 11:18:59.650874005 +0000 @@ -1 +1 @@ -From 94cf4db1603fe9074b5275cc4b63685fc91fdac5 Mon Sep 17 00:00:00 2001 +From 9bb15a3d0f9e33a6887ce6c0985108a2e4e0b14b Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 94cf4db1603fe9074b5275cc4b63685fc91fdac5 ] + @@ -15 +16,0 @@ -Cc: stable@dpdk.org @@ -22,2 +23,2 @@ - drivers/net/hns3/hns3_intr.c | 6 ++---- - 3 files changed, 31 insertions(+), 6 deletions(-) + drivers/net/hns3/hns3_intr.c | 3 +-- + 3 files changed, 30 insertions(+), 4 deletions(-) @@ -26 +27 @@ -index 668f141e32..12d8299def 100644 +index 093d11cd71..5ba9503bf8 100644 @@ -29 +30 @@ -@@ -1036,4 +1036,5 @@ void hns3vf_update_link_status(struct hns3_hw *hw, uint8_t link_status, +@@ -1037,4 +1037,5 @@ void hns3vf_update_link_status(struct hns3_hw *hw, uint8_t link_status, @@ -34,2 +35,2 @@ - const char *hns3_get_media_type_name(uint8_t media_type); -@@ -1050,3 +1051,14 @@ is_reset_pending(struct hns3_adapter *hns) + static inline bool +@@ -1049,3 +1050,14 @@ is_reset_pending(struct hns3_adapter *hns) @@ -49 +50 @@ - #endif /* HNS3_ETHDEV_H */ + #endif /* _HNS3_ETHDEV_H_ */ @@ -51 +52 @@ -index 156fb905f9..916cc0fb1b 100644 +index 5b76aad261..0d1d271f37 100644 @@ -54 +55 @@ -@@ -532,4 +532,17 @@ hns3vf_enable_irq0(struct hns3_hw *hw) +@@ -612,4 +612,17 @@ hns3vf_enable_irq0(struct hns3_hw *hw) @@ -72 +73 @@ -@@ -606,6 +619,8 @@ hns3vf_interrupt_handler(void *param) +@@ -686,6 +699,8 @@ hns3vf_interrupt_handler(void *param) @@ -84 +85 @@ -index 52b5435a23..916bf30dcb 100644 +index 9c5a4b018c..b049774e9a 100644 @@ -87 +88 @@ -@@ -2750,6 +2750,5 @@ hns3_reset_post(struct hns3_adapter *hns) +@@ -2731,6 +2731,5 @@ hns3_reset_post(struct hns3_adapter *hns) @@ -95,8 +95,0 @@ -@@ -2801,6 +2800,5 @@ hns3_reset_fail_handle(struct hns3_adapter *hns) - - hns3_clear_reset_level(hw, &hw->reset.pending); -- if (!hns->is_vf) -- hns3_clear_reset_event(hw); -+ hns3_clear_reset_status(hw); - if (hns3_reset_err_handle(hns)) { - hw->reset.stage = RESET_STAGE_PREWAIT;