patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Somnath Kotur <somnath.kotur@broadcom.com>
To: stable@dpdk.org
Cc: ktraynor@redhat.com
Subject: [dpdk-stable] [PATCH 18.11 10/19] net/bnxt: fix flow flush handling
Date: Wed, 18 Dec 2019 11:54:02 +0530	[thread overview]
Message-ID: <20191218062411.13079-11-somnath.kotur@broadcom.com> (raw)
In-Reply-To: <20191218062411.13079-1-somnath.kotur@broadcom.com>

From: Ajit Khaparde <ajit.khaparde@broadcom.com>

We are not freeing all the flows when a flow_flush is called.
Iterate through all the flows belonging to all the VNICs in use and
free the filters.

Fixes: 4ace85a7da25 ("net/bnxt: allocate rings and groups")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
 drivers/net/bnxt/bnxt_flow.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
index 1df1890..aca5f38 100644
--- a/drivers/net/bnxt/bnxt_flow.c
+++ b/drivers/net/bnxt/bnxt_flow.c
@@ -1133,6 +1133,7 @@ static int
 bnxt_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error)
 {
 	struct bnxt *bp = dev->data->dev_private;
+	struct bnxt_filter_info *filter = NULL;
 	struct bnxt_vnic_info *vnic;
 	struct rte_flow *flow;
 	unsigned int i;
@@ -1140,14 +1141,20 @@ bnxt_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error)
 
 	for (i = 0; i < bp->nr_vnics; i++) {
 		vnic = &bp->vnic_info[i];
-		STAILQ_FOREACH(flow, &vnic->flow_list, next) {
-			struct bnxt_filter_info *filter = flow->filter;
+		if (vnic && vnic->fw_vnic_id == (uint16_t)-1)
+			continue;
+
+		while (!STAILQ_EMPTY(&vnic->flow_list)) {
+			flow = STAILQ_FIRST(&vnic->flow_list);
+			filter = flow->filter;
 
 			if (filter->filter_type == HWRM_CFA_EM_FILTER)
 				ret = bnxt_hwrm_clear_em_filter(bp, filter);
 			if (filter->filter_type == HWRM_CFA_NTUPLE_FILTER)
 				ret = bnxt_hwrm_clear_ntuple_filter(bp, filter);
 
+			ret = bnxt_hwrm_clear_l2_filter(bp, filter);
+
 			if (ret) {
 				rte_flow_error_set
 					(error,
@@ -1158,9 +1165,13 @@ bnxt_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error)
 				return -rte_errno;
 			}
 
+			bnxt_free_filter(bp, filter);
+
 			STAILQ_REMOVE(&vnic->flow_list, flow,
 				      rte_flow, next);
+
 			rte_free(flow);
+
 		}
 	}
 
-- 
2.10.1


  parent reply	other threads:[~2019-12-18  6:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-18  6:23 [dpdk-stable] [PATCH 18.11 00/19] bnxt patchset for 18.11 Somnath Kotur
2019-12-18  6:23 ` [dpdk-stable] [PATCH 18.11 01/19] net/bnxt: fix setting default MAC address Somnath Kotur
2019-12-18  6:23 ` [dpdk-stable] [PATCH 18.11 02/19] net/bnxt: fix error checking of FW commands Somnath Kotur
2019-12-18  6:23 ` [dpdk-stable] [PATCH 18.11 03/19] net/bnxt: fix check of address mapping Somnath Kotur
2019-12-18  6:23 ` [dpdk-stable] [PATCH 18.11 04/19] net/bnxt: fix stats errors handling Somnath Kotur
2019-12-18  6:23 ` [dpdk-stable] [PATCH 18.11 05/19] net/bnxt: move macro definitions to header file Somnath Kotur
2019-12-18  6:23 ` [dpdk-stable] [PATCH 18.11 06/19] net/bnxt: fix extended port counter statistics Somnath Kotur
2019-12-18  6:23 ` [dpdk-stable] [PATCH 18.11 07/19] net/bnxt: fix VF probe when MAC address is zero Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 08/19] net/bnxt: fix coding style Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 09/19] net/bnxt: fix async link handling and update Somnath Kotur
2019-12-18  6:24 ` Somnath Kotur [this message]
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 11/19] net/bnxt: update trusted VF status only when it changes Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 12/19] net/bnxt: fix doorbell register offset for Tx ring Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 13/19] net/bnxt: get default HWRM command timeout from FW Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 14/19] net/bnxt: fix MAC/VLAN filter allocation Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 15/19] net/bnxt: fix forwarding with higher mbuf size Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 16/19] net/bnxt: fix crash after removing and adding slaves Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 17/19] net/bnxt: fix Rx queue count Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 18/19] net/bnxt: fix deferred start of Tx queues Somnath Kotur
2019-12-18 10:21   ` Kevin Traynor
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 19/19] net/bnxt: fix rx queue start/stop Somnath Kotur
2019-12-18 11:22 ` [dpdk-stable] [PATCH 18.11 00/19] bnxt patchset for 18.11 Kevin Traynor

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=20191218062411.13079-11-somnath.kotur@broadcom.com \
    --to=somnath.kotur@broadcom.com \
    --cc=ktraynor@redhat.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).