patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, Chaoyong He <chaoyong.he@corigine.com>,
	peng.zhang@corigine.com, stable@dpdk.org,
	Long Wu <long.wu@corigine.com>
Subject: [PATCH 04/17] net/nfp: fix coredump caused by firmware abnormal cleanup
Date: Mon, 24 Jun 2024 09:57:10 +0800	[thread overview]
Message-ID: <20240624015723.3712898-5-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20240624015723.3712898-1-chaoyong.he@corigine.com>

The logic of 'nfp_fw_setup()' consider both single-pf and multi-pf
firmware, but the abnormal firmware cleanup logic only consider multi-pf
firmware and try to write the heart beat value, which will cause
coredump when using the single-pf firmware.

Fixes: 8ba461d1eecc ("net/nfp: introduce keepalive mechanism for multiple PF")
Cc: peng.zhang@corigine.com
Cc: stable@dpdk.org

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 drivers/net/nfp/nfp_ethdev.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index 9870b2dd33..9196d5d0a4 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -2335,9 +2335,11 @@ nfp_pf_init(struct rte_pci_device *pci_dev)
 	free(sym_tbl);
 fw_cleanup:
 	nfp_fw_unload(cpp);
-	nfp_net_keepalive_stop(&pf_dev->multi_pf);
-	nfp_net_keepalive_clear(pf_dev->multi_pf.beat_addr, pf_dev->multi_pf.function_id);
-	nfp_net_keepalive_uninit(&pf_dev->multi_pf);
+	if (pf_dev->multi_pf.enabled) {
+		nfp_net_keepalive_stop(&pf_dev->multi_pf);
+		nfp_net_keepalive_clear(pf_dev->multi_pf.beat_addr, pf_dev->multi_pf.function_id);
+		nfp_net_keepalive_uninit(&pf_dev->multi_pf);
+	}
 eth_table_cleanup:
 	free(nfp_eth_table);
 hwinfo_cleanup:
-- 
2.39.1


  parent reply	other threads:[~2024-06-24  1:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240624015723.3712898-1-chaoyong.he@corigine.com>
2024-06-24  1:57 ` [PATCH 03/17] net/nfp: fix link status display problem Chaoyong He
2024-06-24  1:57 ` Chaoyong He [this message]
2024-06-24  1:57 ` [PATCH 05/17] net/nfp: forbid offload flow rules with empty action list Chaoyong He
2024-06-24  1:57 ` [PATCH 06/17] net/nfp: remove redundancy function call Chaoyong He
2024-06-24  1:57 ` [PATCH 07/17] net/nfp: fix flow rule match data problem Chaoyong He
2024-06-24  1:57 ` [PATCH 08/17] net/nfp: fix flow rule action " Chaoyong He
2024-06-24  1:57 ` [PATCH 11/17] net/nfp: fix flow position index problem Chaoyong He
2024-06-24  1:57 ` [PATCH 12/17] net/nfp: fix getting firmware version Chaoyong He
2024-06-24  1:57 ` [PATCH 13/17] doc: update the metadata description section Chaoyong He
2024-06-24  1:57 ` [PATCH 14/17] net/nfp: remove the unneeded logic Chaoyong He
2024-06-24  1:57 ` [PATCH 15/17] net/nfp: adapts the reverse sequence card Chaoyong He
2024-06-24  1:57 ` [PATCH 16/17] net/nfp: fix null pointer dereferences Chaoyong He
2024-06-24  1:57 ` [PATCH 17/17] net/nfp: fix port action core dump Chaoyong He

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240624015723.3712898-5-chaoyong.he@corigine.com \
    --to=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=long.wu@corigine.com \
    --cc=oss-drivers@corigine.com \
    --cc=peng.zhang@corigine.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).