DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
To: dev@dpdk.org
Cc: Jay Ding <jay.ding@broadcom.com>
Subject: [PATCH v2 13/18] net/bnxt: add VF FLR async event handler
Date: Fri, 22 Dec 2023 13:56:54 -0800	[thread overview]
Message-ID: <20231222215659.64993-14-ajit.khaparde@broadcom.com> (raw)
In-Reply-To: <20231222215659.64993-1-ajit.khaparde@broadcom.com>

[-- Attachment #1: Type: text/plain, Size: 3108 bytes --]

From: Jay Ding <jay.ding@broadcom.com>

When a VF undergoes an FLR, the firmware indicates this via
an async notification to the PF. Note that the PF driver
needs to register for the notification with the firmware.
Add support for VF_FLR async event handling when the driver
is running on a PF.

Signed-off-by: Jay Ding <jay.ding@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_cpr.c  | 20 ++++++++++++++++++++
 drivers/net/bnxt/bnxt_hwrm.c |  6 ++++--
 drivers/net/bnxt/bnxt_hwrm.h |  2 ++
 3 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c
index 0733cf4df2..fb43bc58da 100644
--- a/drivers/net/bnxt/bnxt_cpr.c
+++ b/drivers/net/bnxt/bnxt_cpr.c
@@ -127,6 +127,23 @@ void bnxt_handle_vf_cfg_change(void *arg)
 	}
 }
 
+static void
+bnxt_process_vf_flr(struct bnxt *bp, uint32_t data1)
+{
+	uint16_t pfid, vfid;
+
+	if (!BNXT_TRUFLOW_EN(bp))
+		return;
+
+	pfid = (data1 & HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_PF_ID_MASK) >>
+		HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_PF_ID_SFT;
+	vfid = (data1 & HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_VF_ID_MASK) >>
+		HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_VF_ID_SFT;
+
+	PMD_DRV_LOG(INFO, "VF FLR async event received pfid: %u, vfid: %u\n",
+		    pfid, vfid);
+}
+
 /*
  * Async event handling
  */
@@ -264,6 +281,9 @@ void bnxt_handle_async_event(struct bnxt *bp,
 	case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_ERROR_REPORT:
 		bnxt_handle_event_error_report(bp, data1, data2);
 		break;
+	case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_FLR:
+		bnxt_process_vf_flr(bp, data1);
+		break;
 	default:
 		PMD_DRV_LOG(DEBUG, "handle_async_event id = 0x%x\n", event_id);
 		break;
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 1ac3f30074..3c16abea69 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -1125,9 +1125,11 @@ int bnxt_hwrm_func_driver_register(struct bnxt *bp)
 		req.async_event_fwd[1] |=
 			rte_cpu_to_le_32(ASYNC_CMPL_EVENT_ID_DBG_NOTIFICATION);
 
-	if (BNXT_PF(bp) || BNXT_VF_IS_TRUSTED(bp))
+	if (BNXT_PF(bp) || BNXT_VF_IS_TRUSTED(bp)) {
 		req.async_event_fwd[1] |=
-		rte_cpu_to_le_32(ASYNC_CMPL_EVENT_ID_DEFAULT_VNIC_CHANGE);
+		rte_cpu_to_le_32(ASYNC_CMPL_EVENT_ID_DEFAULT_VNIC_CHANGE |
+				 ASYNC_CMPL_EVENT_ID_VF_FLR);
+	}
 
 	req.async_event_fwd[2] |=
 		rte_cpu_to_le_32(ASYNC_CMPL_EVENT_ID_ECHO_REQUEST |
diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h
index 56b232d7de..6116253787 100644
--- a/drivers/net/bnxt/bnxt_hwrm.h
+++ b/drivers/net/bnxt/bnxt_hwrm.h
@@ -29,6 +29,8 @@ struct hwrm_func_qstats_output;
 	(1 << HWRM_ASYNC_EVENT_CMPL_EVENT_ID_ERROR_RECOVERY)
 #define ASYNC_CMPL_EVENT_ID_PF_DRVR_UNLOAD	\
 	(1 << (HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD - 32))
+#define ASYNC_CMPL_EVENT_ID_VF_FLR \
+	(1 << (HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_FLR - 32))
 #define ASYNC_CMPL_EVENT_ID_VF_CFG_CHANGE	\
 	(1 << (HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE - 32))
 #define ASYNC_CMPL_EVENT_ID_DBG_NOTIFICATION	\
-- 
2.39.2 (Apple Git-143)


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

  parent reply	other threads:[~2023-12-22 21:58 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-22 21:56 [PATCH v2 00/18] bnxt patchset Ajit Khaparde
2023-12-22 21:56 ` [PATCH v2 01/18] net/bnxt: add support for UDP GSO Ajit Khaparde
2023-12-22 21:56 ` [PATCH v2 02/18] net/bnxt: add support for compressed Rx CQE Ajit Khaparde
2023-12-22 21:56 ` [PATCH v2 03/18] net/bnxt: fix a typo while parsing link speed Ajit Khaparde
2023-12-22 21:56 ` [PATCH v2 04/18] net/bnxt: fix setting 50G and 100G forced speed Ajit Khaparde
2023-12-22 21:56 ` [PATCH v2 05/18] net/bnxt: fix speed change from 200G to 25G on Thor Ajit Khaparde
2023-12-22 21:56 ` [PATCH v2 06/18] net/bnxt: support backward compatibility Ajit Khaparde
2023-12-22 21:56 ` [PATCH v2 07/18] net/bnxt: reattempt mbuf allocation for Rx and AGG rings Ajit Khaparde
2023-12-22 21:56 ` [PATCH v2 08/18] net/bnxt: refactor Rx doorbell during Rx flush Ajit Khaparde
2023-12-22 21:56 ` [PATCH v2 09/18] net/bnxt: extend RSS hash support for P7 devices Ajit Khaparde
2023-12-22 21:56 ` [PATCH v2 10/18] net/bnxt: add flow query callback Ajit Khaparde
2023-12-22 21:56 ` [PATCH v2 11/18] net/bnxt: add ESP and AH header based RSS support Ajit Khaparde
2023-12-22 21:56 ` [PATCH v2 12/18] net/bnxt: set allmulti mode if multicast filter fails Ajit Khaparde
2023-12-22 21:56 ` Ajit Khaparde [this message]
2023-12-22 21:56 ` [PATCH v2 14/18] net/bnxt: add tunnel TPA support Ajit Khaparde
2023-12-22 21:56 ` [PATCH v2 15/18] net/bnxt: add 400G get support for P7 devices Ajit Khaparde
2023-12-22 21:56 ` [PATCH v2 16/18] net/bnxt: query extended stats from firmware Ajit Khaparde
2023-12-22 21:56 ` [PATCH v2 17/18] net/bnxt: add AVX2 support for compressed CQE Ajit Khaparde
2023-12-22 21:56 ` [PATCH v2 18/18] net/bnxt: enable SSE mode " Ajit Khaparde

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=20231222215659.64993-14-ajit.khaparde@broadcom.com \
    --to=ajit.khaparde@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=jay.ding@broadcom.com \
    /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).