patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Cc: dpdk stable <stable@dpdk.org>
Subject: [dpdk-stable] patch 'net/cxgbe: fix CLIP leak in filter error path' has been queued to LTS release 18.11.10
Date: Fri, 17 Jul 2020 17:31:54 +0100	[thread overview]
Message-ID: <20200717163214.4839-6-ktraynor@redhat.com> (raw)
In-Reply-To: <20200717163214.4839-1-ktraynor@redhat.com>

Hi,

FYI, your patch has been queued to LTS release 18.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/23/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/d2cff2bc6e489fc26b7f1aca87d768d7d7fc58b3

Thanks.

Kevin.

---
From d2cff2bc6e489fc26b7f1aca87d768d7d7fc58b3 Mon Sep 17 00:00:00 2001
From: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Date: Sat, 13 Jun 2020 03:37:23 +0530
Subject: [PATCH] net/cxgbe: fix CLIP leak in filter error path

[ upstream commit 844b21299f1a10ac350528365dc761e2934512ee ]

Free up Compressed Local IP (CLIP) entry properly during filter
creation failure path. Also consolidate all various tables
cleanup to a common function and invoke it from both wild-card
and exact-match filter paths.

Fixes: af44a577988b ("net/cxgbe: support to offload flows to HASH region")

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
---
 drivers/net/cxgbe/cxgbe_filter.c | 68 +++++++++++++++-----------------
 1 file changed, 31 insertions(+), 37 deletions(-)

diff --git a/drivers/net/cxgbe/cxgbe_filter.c b/drivers/net/cxgbe/cxgbe_filter.c
index 8cd26212f8..489c23249c 100644
--- a/drivers/net/cxgbe/cxgbe_filter.c
+++ b/drivers/net/cxgbe/cxgbe_filter.c
@@ -268,4 +268,20 @@ int cxgbe_alloc_ftid(struct adapter *adap, u8 nentries)
 }
 
+/**
+ * Clear a filter and release any of its resources that we own.  This also
+ * clears the filter's "pending" status.
+ */
+static void clear_filter(struct filter_entry *f)
+{
+	if (f->clipt)
+		cxgbe_clip_release(f->dev, f->clipt);
+
+	/* The zeroing of the filter rule below clears the filter valid,
+	 * pending, locked flags etc. so it's all we need for
+	 * this operation.
+	 */
+	memset(f, 0, sizeof(*f));
+}
+
 /**
  * Construct hash filter ntuple.
@@ -551,5 +567,5 @@ static int cxgbe_set_hash_filter(struct rte_eth_dev *dev,
 	f = t4_os_alloc(sizeof(*f));
 	if (!f)
-		goto out_err;
+		return -ENOMEM;
 
 	f->fs = *fs;
@@ -588,5 +604,5 @@ static int cxgbe_set_hash_filter(struct rte_eth_dev *dev,
 		if (!mbuf) {
 			ret = -ENOMEM;
-			goto free_clip;
+			goto free_atid;
 		}
 
@@ -618,31 +634,13 @@ static int cxgbe_set_hash_filter(struct rte_eth_dev *dev,
 	return 0;
 
-free_clip:
-	cxgbe_clip_release(f->dev, f->clipt);
 free_atid:
 	cxgbe_free_atid(t, atid);
 
 out_err:
+	clear_filter(f);
 	t4_os_free(f);
 	return ret;
 }
 
-/**
- * Clear a filter and release any of its resources that we own.  This also
- * clears the filter's "pending" status.
- */
-static void clear_filter(struct filter_entry *f)
-{
-	if (f->clipt)
-		cxgbe_clip_release(f->dev, f->clipt);
-
-	/*
-	 * The zeroing of the filter rule below clears the filter valid,
-	 * pending, locked flags etc. so it's all we need for
-	 * this operation.
-	 */
-	memset(f, 0, sizeof(*f));
-}
-
 /**
  * t4_mk_filtdelwr - create a delete filter WR
@@ -998,14 +996,4 @@ int cxgbe_set_filter(struct rte_eth_dev *dev, unsigned int filter_id,
 	}
 
-	/*
-	 * Allocate a clip table entry only if we have non-zero IPv6 address
-	 */
-	if (chip_ver > CHELSIO_T5 && fs->type &&
-	    memcmp(fs->val.lip, bitoff, sizeof(bitoff))) {
-		f->clipt = cxgbe_clip_alloc(dev, (u32 *)&fs->val.lip);
-		if (!f->clipt)
-			goto free_tid;
-	}
-
 	/*
 	 * Convert the filter specification into our internal format.
@@ -1018,4 +1006,14 @@ int cxgbe_set_filter(struct rte_eth_dev *dev, unsigned int filter_id,
 	f->dev = dev;
 
+	/* Allocate a clip table entry only if we have non-zero IPv6 address. */
+	if (chip_ver > CHELSIO_T5 && f->fs.type &&
+	    memcmp(f->fs.val.lip, bitoff, sizeof(bitoff))) {
+		f->clipt = cxgbe_clip_alloc(dev, (u32 *)&f->fs.val.lip);
+		if (!f->clipt) {
+			ret = -ENOMEM;
+			goto free_tid;
+		}
+	}
+
 	/*
 	 * Attempt to set the filter.  If we don't succeed, we clear
@@ -1098,4 +1096,5 @@ void cxgbe_hash_filter_rpl(struct adapter *adap,
 
 		cxgbe_free_atid(t, ftid);
+		clear_filter(f);
 		t4_os_free(f);
 	}
@@ -1273,11 +1272,6 @@ void cxgbe_hash_del_filter_rpl(struct adapter *adap,
 
 	ctx = f->ctx;
-	f->ctx = NULL;
-
-	f->valid = 0;
-
-	if (f->clipt)
-		cxgbe_clip_release(f->dev, f->clipt);
 
+	clear_filter(f);
 	cxgbe_remove_tid(t, 0, tid, 0);
 	t4_os_free(f);
-- 
2.21.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-17 17:17:00.330522875 +0100
+++ 0006-net-cxgbe-fix-CLIP-leak-in-filter-error-path.patch	2020-07-17 17:16:59.961771832 +0100
@@ -1 +1 @@
-From 844b21299f1a10ac350528365dc761e2934512ee Mon Sep 17 00:00:00 2001
+From d2cff2bc6e489fc26b7f1aca87d768d7d7fc58b3 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 844b21299f1a10ac350528365dc761e2934512ee ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index 27e96c73e6..45602d468d 100644
+index 8cd26212f8..489c23249c 100644
@@ -23 +24 @@
-@@ -285,4 +285,20 @@ int cxgbe_alloc_ftid(struct adapter *adap, u8 nentries)
+@@ -268,4 +268,20 @@ int cxgbe_alloc_ftid(struct adapter *adap, u8 nentries)
@@ -44 +45 @@
-@@ -584,5 +600,5 @@ static int cxgbe_set_hash_filter(struct rte_eth_dev *dev,
+@@ -551,5 +567,5 @@ static int cxgbe_set_hash_filter(struct rte_eth_dev *dev,
@@ -51 +52 @@
-@@ -632,5 +648,5 @@ static int cxgbe_set_hash_filter(struct rte_eth_dev *dev,
+@@ -588,5 +604,5 @@ static int cxgbe_set_hash_filter(struct rte_eth_dev *dev,
@@ -58 +59 @@
-@@ -662,31 +678,13 @@ static int cxgbe_set_hash_filter(struct rte_eth_dev *dev,
+@@ -618,31 +634,13 @@ static int cxgbe_set_hash_filter(struct rte_eth_dev *dev,
@@ -91 +92 @@
-@@ -1071,14 +1069,4 @@ int cxgbe_set_filter(struct rte_eth_dev *dev, unsigned int filter_id,
+@@ -998,14 +996,4 @@ int cxgbe_set_filter(struct rte_eth_dev *dev, unsigned int filter_id,
@@ -106 +107 @@
-@@ -1091,4 +1079,14 @@ int cxgbe_set_filter(struct rte_eth_dev *dev, unsigned int filter_id,
+@@ -1018,4 +1006,14 @@ int cxgbe_set_filter(struct rte_eth_dev *dev, unsigned int filter_id,
@@ -119,3 +120,3 @@
- 	iconf = adapter->params.tp.ingress_config;
- 
-@@ -1193,4 +1191,5 @@ void cxgbe_hash_filter_rpl(struct adapter *adap,
+ 	/*
+ 	 * Attempt to set the filter.  If we don't succeed, we clear
+@@ -1098,4 +1096,5 @@ void cxgbe_hash_filter_rpl(struct adapter *adap,
@@ -127 +128 @@
-@@ -1417,11 +1416,6 @@ void cxgbe_hash_del_filter_rpl(struct adapter *adap,
+@@ -1273,11 +1272,6 @@ void cxgbe_hash_del_filter_rpl(struct adapter *adap,


  parent reply	other threads:[~2020-07-17 16:32 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-17 16:31 [dpdk-stable] patch 'net/netvsc: do not spin forever waiting for reply' " Kevin Traynor
2020-07-17 16:31 ` [dpdk-stable] patch 'app/testpmd: fix memory leak on error path' " Kevin Traynor
2020-07-17 16:31 ` [dpdk-stable] patch 'net/mlx5: fix unreachable MPLS " Kevin Traynor
2020-07-17 16:31 ` [dpdk-stable] patch 'net/failsafe: fix RSS RETA size info' " Kevin Traynor
2020-07-17 16:31 ` [dpdk-stable] patch 'net/i40e: enable NEON Rx/Tx in meson' " Kevin Traynor
2020-07-17 16:31 ` Kevin Traynor [this message]
2020-07-17 16:31 ` [dpdk-stable] patch 'bpf: fix add/sub min/max estimations' " Kevin Traynor
2020-07-17 16:31 ` [dpdk-stable] patch 'net: fix IPv4 checksum' " Kevin Traynor
2020-07-17 16:31 ` [dpdk-stable] patch 'examples: add flush after stats printing' " Kevin Traynor
2020-07-17 16:31 ` [dpdk-stable] patch 'bus/vmbus: fix ring buffer mapping' " Kevin Traynor
2020-07-17 16:31 ` [dpdk-stable] patch 'pci: fix address domain format size' " Kevin Traynor
2020-07-17 16:32 ` [dpdk-stable] patch 'net/qede: fix multicast drop in promiscuous mode' " Kevin Traynor
2020-07-17 16:32 ` [dpdk-stable] patch 'net/mvpp2: fix non-EAL thread support' " Kevin Traynor
2020-07-17 16:32 ` [dpdk-stable] patch 'eal/arm: add vcopyq intrinsic for aarch32' " Kevin Traynor
2020-07-17 16:32 ` [dpdk-stable] patch 'net/ixgbe: fix include of vector header file' " Kevin Traynor
2020-07-17 16:32 ` [dpdk-stable] patch 'net/mlx5: fix iterator type in Rx queue management' " Kevin Traynor
2020-07-17 16:32 ` [dpdk-stable] patch 'vhost: fix features definition location' " Kevin Traynor
2020-07-17 16:32 ` [dpdk-stable] patch 'mem: fix 32-bit init config with meson' " Kevin Traynor
2020-07-17 16:32 ` [dpdk-stable] patch 'examples/eventdev: fix 32-bit coremask' " Kevin Traynor
2020-07-17 16:32 ` [dpdk-stable] patch 'devtools: fix path in forbidden token check' " Kevin Traynor
2020-07-17 16:32 ` [dpdk-stable] patch 'sched: fix port time rounding' " Kevin Traynor
2020-07-17 16:32 ` [dpdk-stable] patch 'lib: remind experimental status in headers' " Kevin Traynor
2020-07-17 16:32 ` [dpdk-stable] patch 'rawdev: remove remaining experimental tags' " Kevin Traynor
2020-07-17 16:32 ` [dpdk-stable] patch 'eal/armv8: fix timer frequency calibration with PMU' " Kevin Traynor
2020-07-17 16:32 ` [dpdk-stable] patch 'vfio: remove unused variable' " Kevin Traynor
2020-07-17 16:32 ` [dpdk-stable] patch 'eal: fix uuid header dependencies' " 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=20200717163214.4839-6-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=rahul.lakkireddy@chelsio.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).