patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com,
	Somnath Kotur <somnath.kotur@broadcom.com>,
	stable@dpdk.org,
	Kalesh Anakkur Purayil <kalesh-anakkur.purayil@broadcom.com>
Subject: [dpdk-stable] [PATCH v3 2/9] net/bnxt: fix bumping of L2 filter reference count
Date: Tue, 28 Jan 2020 13:01:52 -0800	[thread overview]
Message-ID: <20200128210159.6972-3-ajit.khaparde@broadcom.com> (raw)
In-Reply-To: <20200128210159.6972-1-ajit.khaparde@broadcom.com>

From: Somnath Kotur <somnath.kotur@broadcom.com>

Now that the L2 filter reference count is bumped up in all cases
including bnxt_alloc_filter() which is issued in init, just move this
ref count bump inside the routine issuing the HWRM cmd so that it is
bumped up only if the cmd is successful.

Fixes: 5c1171c97216 ("net/bnxt: refactor filter/flow")
Cc: stable@dpdk.org

Reviewed-by: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_filter.c | 3 +--
 drivers/net/bnxt/bnxt_flow.c   | 1 -
 drivers/net/bnxt/bnxt_hwrm.c   | 2 ++
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_filter.c b/drivers/net/bnxt/bnxt_filter.c
index e2184334f..a1463a0e2 100644
--- a/drivers/net/bnxt/bnxt_filter.c
+++ b/drivers/net/bnxt/bnxt_filter.c
@@ -39,8 +39,7 @@ struct bnxt_filter_info *bnxt_alloc_filter(struct bnxt *bp)
 			HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK;
 	memcpy(filter->l2_addr, bp->mac_addr, RTE_ETHER_ADDR_LEN);
 	memset(filter->l2_addr_mask, 0xff, RTE_ETHER_ADDR_LEN);
-	/* bump up the reference count of filter */
-	filter->l2_ref_cnt++;
+
 	return filter;
 }
 
diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
index 5564c5363..4b3b59795 100644
--- a/drivers/net/bnxt/bnxt_flow.c
+++ b/drivers/net/bnxt/bnxt_flow.c
@@ -867,7 +867,6 @@ bnxt_create_l2_filter(struct bnxt *bp, struct bnxt_filter_info *nf,
 		bnxt_free_filter(bp, filter1);
 		return NULL;
 	}
-	filter1->l2_ref_cnt++;
 	return filter1;
 }
 
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 3b013396b..460cc4894 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -488,6 +488,8 @@ int bnxt_hwrm_set_l2_filter(struct bnxt *bp,
 	filter->flow_id = rte_le_to_cpu_32(resp->flow_id);
 	HWRM_UNLOCK();
 
+	filter->l2_ref_cnt++;
+
 	return rc;
 }
 
-- 
2.21.0 (Apple Git-122.2)


  parent reply	other threads:[~2020-01-28 21:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200128072923.9912-1-somnath.kotur@broadcom.com>
     [not found] ` <20200128210159.6972-1-ajit.khaparde@broadcom.com>
2020-01-28 21:01   ` [dpdk-stable] [PATCH v3 1/9] net/bnxt: fix alloc filter to use a common routine Ajit Khaparde
2020-01-28 21:01   ` Ajit Khaparde [this message]
2020-01-28 21:01   ` [dpdk-stable] [PATCH v3 3/9] net/bnxt: fix to allow group ID 0 for RSS action Ajit Khaparde
2020-01-28 21:01   ` [dpdk-stable] [PATCH v3 4/9] net/bnxt: remove redundant if statement Ajit Khaparde
2020-01-28 21:01   ` [dpdk-stable] [PATCH v3 5/9] net/bnxt: remove redundant macro Ajit Khaparde
2020-01-28 21:01   ` [dpdk-stable] [PATCH v3 6/9] net/bnxt: remove unnecessary structure variable Ajit Khaparde
2020-01-28 21:01   ` [dpdk-stable] [PATCH v3 7/9] net/bnxt: remove a redundant variable Ajit Khaparde
2020-01-28 21:01   ` [dpdk-stable] [PATCH v3 9/9] net/bnxt: fix coverity warnings Ajit Khaparde
2020-01-29 12:30     ` Ferruh Yigit

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=20200128210159.6972-3-ajit.khaparde@broadcom.com \
    --to=ajit.khaparde@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=kalesh-anakkur.purayil@broadcom.com \
    --cc=somnath.kotur@broadcom.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).