DPDK patches and discussions
 help / color / mirror / Atom feed
From: Kalesh A P <kalesh-anakkur.purayil@broadcom.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com, ajit.khaparde@broadcom.com
Subject: [dpdk-dev] [PATCH 13/18] net/bnxt: fix handling of VF configuration changes
Date: Tue,  4 Jan 2022 14:08:19 +0530	[thread overview]
Message-ID: <20220104083824.23001-14-kalesh-anakkur.purayil@broadcom.com> (raw)
In-Reply-To: <20220104083824.23001-1-kalesh-anakkur.purayil@broadcom.com>

From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

When there is a change in the default VLAN of the VF,
FW sends the VF_CFG_CHANGE async event to the driver.
Upon receiving this async event, driver currently only queries
the FW using HWRM_FUNC_QCFG. But this is not enough.

Driver has to clean up the existing filter and recreate filters
so the FW can apply the default VLAN to the filter.

Fixes: 12213821a8a3 ("net/bnxt: register for more async events")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
 drivers/net/bnxt/bnxt.h        |  3 +++
 drivers/net/bnxt/bnxt_cpr.c    | 25 ++++++++++++++++++++++++-
 drivers/net/bnxt/bnxt_ethdev.c |  5 +++--
 3 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 64866de..9c0dbc6 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -1068,5 +1068,8 @@ int bnxt_flow_stats_cnt(struct bnxt *bp);
 uint32_t bnxt_get_speed_capabilities(struct bnxt *bp);
 int bnxt_flow_ops_get_op(struct rte_eth_dev *dev,
 			 const struct rte_flow_ops **ops);
+int bnxt_dev_start_op(struct rte_eth_dev *eth_dev);
+int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev);
+void bnxt_handle_vf_cfg_change(void *arg);
 
 #endif
diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c
index 593eebf..9b9285b 100644
--- a/drivers/net/bnxt/bnxt_cpr.c
+++ b/drivers/net/bnxt/bnxt_cpr.c
@@ -107,6 +107,26 @@ static void bnxt_handle_event_error_report(struct bnxt *bp,
 	}
 }
 
+void bnxt_handle_vf_cfg_change(void *arg)
+{
+	struct bnxt *bp = arg;
+	struct rte_eth_dev *eth_dev = bp->eth_dev;
+	int rc;
+
+	/* Free and recreate filters with default VLAN */
+	if (eth_dev->data->dev_started) {
+		rc = bnxt_dev_stop_op(eth_dev);
+		if (rc != 0) {
+			PMD_DRV_LOG(ERR, "Failed to stop Port:%u\n", eth_dev->data->port_id);
+			return;
+		}
+
+		rc = bnxt_dev_start_op(eth_dev);
+		if (rc != 0)
+			PMD_DRV_LOG(ERR, "Failed to start Port:%u\n", eth_dev->data->port_id);
+	}
+}
+
 /*
  * Async event handling
  */
@@ -138,8 +158,11 @@ void bnxt_handle_async_event(struct bnxt *bp,
 		PMD_DRV_LOG(INFO, "Async event: PF driver unloaded\n");
 		break;
 	case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE:
-		PMD_DRV_LOG(INFO, "Async event: VF config changed\n");
+		PMD_DRV_LOG(INFO, "Port %u: VF config change async event\n", port_id);
+		PMD_DRV_LOG(INFO, "event: data1 %#x data2 %#x\n", data1, data2);
 		bnxt_hwrm_func_qcfg(bp, NULL);
+		if (BNXT_VF(bp))
+			rte_eal_alarm_set(1, bnxt_handle_vf_cfg_change, (void *)bp);
 		break;
 	case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED:
 		PMD_DRV_LOG(INFO, "Port conn async event\n");
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index cf3bd77..999a9a5 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1530,7 +1530,7 @@ static int bnxt_dev_stop(struct rte_eth_dev *eth_dev)
 }
 
 /* Unload the driver, release resources */
-static int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
+int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
 {
 	struct bnxt *bp = eth_dev->data->dev_private;
 
@@ -1546,7 +1546,7 @@ static int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
 	return bnxt_dev_stop(eth_dev);
 }
 
-static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
+int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
 {
 	struct bnxt *bp = eth_dev->data->dev_private;
 	uint64_t rx_offloads = eth_dev->data->dev_conf.rxmode.offloads;
@@ -1678,6 +1678,7 @@ static int bnxt_dev_close_op(struct rte_eth_dev *eth_dev)
 	rte_eal_alarm_cancel(bnxt_dev_reset_and_resume, (void *)bp);
 	rte_eal_alarm_cancel(bnxt_dev_recover, (void *)bp);
 	bnxt_cancel_fc_thread(bp);
+	rte_eal_alarm_cancel(bnxt_handle_vf_cfg_change, (void *)bp);
 
 	if (eth_dev->data->dev_started)
 		ret = bnxt_dev_stop(eth_dev);
-- 
2.10.1


  parent reply	other threads:[~2022-01-04  8:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-04  8:38 [dpdk-dev] [PATCH 00/18] bnxt PMD fixes Kalesh A P
2022-01-04  8:38 ` [dpdk-dev] [PATCH 01/18] net/bnxt: fix bnxt_dev_set_mc_addr_list_op Kalesh A P
2022-01-04  8:38 ` [dpdk-dev] [PATCH 02/18] net/bnxt: fix to restore mcast macs during reset recovery Kalesh A P
2022-01-04  8:38 ` [dpdk-dev] [PATCH 03/18] net/bnxt: fix queue stop operation Kalesh A P
2022-01-04  8:38 ` [dpdk-dev] [PATCH 04/18] net/bnxt: restore RSS configuration after reset recovery Kalesh A P
2022-01-04  8:38 ` [dpdk-dev] [PATCH 05/18] net/bnxt: fix restoring VLAN filtering after recovery Kalesh A P
2022-01-04  8:38 ` [dpdk-dev] [PATCH 06/18] net/bnxt: fix to cap max number of unicast MACs Kalesh A P
2022-01-04  8:38 ` [dpdk-dev] [PATCH 07/18] net/bnxt: set fast-path pointers only if recovery succeeds Kalesh A P
2022-01-04  8:38 ` [dpdk-dev] [PATCH 08/18] net/bnxt: improve recovery related log messages Kalesh A P
2022-01-04  8:38 ` [dpdk-dev] [PATCH 09/18] net/bnxt: add null check for mark table Kalesh A P
2022-01-04  8:38 ` [dpdk-dev] [PATCH 10/18] net/bnxt: fix flow create when RSS is disabled Kalesh A P
2022-01-04  8:38 ` [dpdk-dev] [PATCH 11/18] net/bnxt: get max supported multicast filters count Kalesh A P
2022-01-04  8:38 ` [dpdk-dev] [PATCH 12/18] net/bnxt: refactor bnxt_stop_rxtx() for reuse Kalesh A P
2022-01-04  8:38 ` Kalesh A P [this message]
2022-01-04  8:38 ` [dpdk-dev] [PATCH 14/18] net/bnxt: fix ring teardown Kalesh A P
2022-01-04  8:38 ` [dpdk-dev] [PATCH 15/18] net/bnxt: fix PAM4 mask setting Kalesh A P
2022-01-04  8:38 ` [dpdk-dev] [PATCH 16/18] net/bnxt: fix pointer access Kalesh A P
2022-01-04  8:38 ` [dpdk-dev] [PATCH 17/18] net/bnxt: fix incorrect memset in bnxt_dev_xstats_get_op Kalesh A P
2022-01-04  8:38 ` [dpdk-dev] [PATCH 18/18] net/bnxt: check VF rep pointer before access Kalesh A P
2022-01-12  2:09 ` [dpdk-dev] [PATCH 00/18] bnxt PMD fixes 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=20220104083824.23001-14-kalesh-anakkur.purayil@broadcom.com \
    --to=kalesh-anakkur.purayil@broadcom.com \
    --cc=ajit.khaparde@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.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).