patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kalesh A P <kalesh-anakkur.purayil@broadcom.com>
To: stable@dpdk.org
Cc: christian.ehrhardt@canonical.com, ajit.khaparde@broadcom.com
Subject: [PATCH 19.11 6/8] net/bnxt: fix handling of VF configuration change
Date: Mon,  7 Mar 2022 20:40:34 +0530	[thread overview]
Message-ID: <20220307151036.7116-7-kalesh-anakkur.purayil@broadcom.com> (raw)
In-Reply-To: <20220307151036.7116-1-kalesh-anakkur.purayil@broadcom.com>

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

[ upstream commit 6c63f3495e3563869461ec523d13cbb7fcf67d82 ]

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")

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>

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
---
 drivers/net/bnxt/bnxt.h        |  4 +++-
 drivers/net/bnxt/bnxt_cpr.c    | 18 ++++++++++++++++++
 drivers/net/bnxt/bnxt_ethdev.c |  5 +++--
 3 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index bd83005..c850945 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -772,7 +772,9 @@ uint16_t bnxt_dummy_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 			      uint16_t nb_pkts);
 uint16_t bnxt_dummy_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 			      uint16_t nb_pkts);
-
+int bnxt_dev_start_op(struct rte_eth_dev *eth_dev);
+void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev);
+void bnxt_handle_vf_cfg_change(void *arg);
 extern const struct rte_flow_ops bnxt_flow_ops;
 #define bnxt_acquire_flow_lock(bp) \
 	pthread_mutex_lock(&(bp)->flow_lock)
diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c
index f02cbbb..d59f87a 100644
--- a/drivers/net/bnxt/bnxt_cpr.c
+++ b/drivers/net/bnxt/bnxt_cpr.c
@@ -46,6 +46,22 @@ void bnxt_wait_for_device_shutdown(struct bnxt *bp)
 	} while (timeout);
 }
 
+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) {
+		bnxt_dev_stop_op(eth_dev);
+
+		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
  */
@@ -73,6 +89,8 @@ void bnxt_handle_async_event(struct bnxt *bp,
 	case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE:
 		PMD_DRV_LOG(INFO, "Async event: VF config changed\n");
 		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 f52ef2b..5994a33 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -895,7 +895,7 @@ static int bnxt_handle_if_change_status(struct bnxt *bp)
 	return rc;
 }
 
-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;
@@ -1069,7 +1069,7 @@ static int bnxt_ptp_start(struct bnxt *bp)
 }
 
 /* Unload the driver, release resources */
-static void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
+void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
 {
 	struct bnxt *bp = eth_dev->data->dev_private;
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
@@ -1130,6 +1130,7 @@ static void bnxt_dev_close_op(struct rte_eth_dev *eth_dev)
 	/* cancel the recovery handler before remove dev */
 	rte_eal_alarm_cancel(bnxt_dev_reset_and_resume, (void *)bp);
 	rte_eal_alarm_cancel(bnxt_dev_recover, (void *)bp);
+	rte_eal_alarm_cancel(bnxt_handle_vf_cfg_change, (void *)bp);
 
 	if (eth_dev->data->dev_started)
 		bnxt_dev_stop_op(eth_dev);
-- 
2.10.1


  parent reply	other threads:[~2022-03-07 15:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-07 15:10 [PATCH 19.11 0/8] bnxt fixes backport to 19.11 Kalesh A P
2022-03-07 15:10 ` [PATCH 19.11 1/8] net/bnxt: fix queue stop operation Kalesh A P
2022-03-07 15:10 ` [PATCH 19.11 2/8] net/bnxt: cap maximum number of unicast MAC addresses Kalesh A P
2022-03-07 15:10 ` [PATCH 19.11 3/8] net/bnxt: fix multicast address set Kalesh A P
2022-03-07 15:10 ` [PATCH 19.11 4/8] net/bnxt: restore RSS configuration after reset recovery Kalesh A P
2022-03-07 15:10 ` [PATCH 19.11 5/8] net/bnxt: fix memzone allocation per VNIC Kalesh A P
2022-03-07 15:10 ` Kalesh A P [this message]
2022-03-07 15:10 ` [PATCH 19.11 7/8] net/bnxt: get maximum supported multicast filters count Kalesh A P
2022-03-07 15:10 ` [PATCH 19.11 8/8] net/bnxt: fix xstats names query overrun Kalesh A P
2022-03-09  8:02 ` [PATCH 19.11 0/8] bnxt fixes backport to 19.11 Christian Ehrhardt

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=20220307151036.7116-7-kalesh-anakkur.purayil@broadcom.com \
    --to=kalesh-anakkur.purayil@broadcom.com \
    --cc=ajit.khaparde@broadcom.com \
    --cc=christian.ehrhardt@canonical.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).