patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] patch 'app/testpmd: fix stats error message' has been queued to LTS release 18.11.10
@ 2020-09-02  9:12 Kevin Traynor
  2020-09-02  9:12 ` [dpdk-stable] patch 'net/cxgbe: fix double MPS alloc by flow validate and create' " Kevin Traynor
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Traynor @ 2020-09-02  9:12 UTC (permalink / raw)
  To: Wei Hu (Xavier); +Cc: Ferruh Yigit, dpdk stable

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 09/04/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/16e7a4b710d001d91f8b60b91ee83966dcad447b

Thanks.

Kevin.

---
From 16e7a4b710d001d91f8b60b91ee83966dcad447b Mon Sep 17 00:00:00 2001
From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
Date: Sat, 6 Jun 2020 11:46:37 +0800
Subject: [PATCH] app/testpmd: fix stats error message

[ upstream commit 5fd722308ef21819931d25e7a140ff5a292b19d9 ]

There are coverity defects related "Argument cannot be negative"

This patch fixes them by passing '-ret' to the function strerror() when
ret is negative.

Coverity issue: 349913, 358437, 358449, 358450
Fixes: da328f7f115a ("ethdev: change xstats reset function to return int")
Fixes: 9eb974221f44 ("app/testpmd: fix statistics after reset")

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 app/test-pmd/config.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index b51e821a45..3b588e2042 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -232,5 +232,5 @@ nic_stats_clear(portid_t port_id)
 	if (ret != 0) {
 		printf("%s: Error: failed to reset stats (port %u): %s",
-		       __func__, port_id, strerror(ret));
+		       __func__, port_id, strerror(-ret));
 		return;
 	}
@@ -238,4 +238,6 @@ nic_stats_clear(portid_t port_id)
 	ret = rte_eth_stats_get(port_id, &ports[port_id].stats);
 	if (ret != 0) {
+		if (ret < 0)
+			ret = -ret;
 		printf("%s: Error: failed to get stats (port %u): %s",
 		       __func__, port_id, strerror(ret));
@@ -317,8 +319,9 @@ nic_xstats_clear(portid_t port_id)
 		return;
 	}
-	rte_eth_xstats_reset(port_id);
 
 	ret = rte_eth_stats_get(port_id, &ports[port_id].stats);
 	if (ret != 0) {
+		if (ret < 0)
+			ret = -ret;
 		printf("%s: Error: failed to get stats (port %u): %s",
 		       __func__, port_id, strerror(ret));
-- 
2.26.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-09-02 10:08:36.585681610 +0100
+++ 0001-app-testpmd-fix-stats-error-message.patch	2020-09-02 10:08:36.554496721 +0100
@@ -1 +1 @@
-From 5fd722308ef21819931d25e7a140ff5a292b19d9 Mon Sep 17 00:00:00 2001
+From 16e7a4b710d001d91f8b60b91ee83966dcad447b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 5fd722308ef21819931d25e7a140ff5a292b19d9 ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -19,2 +20,2 @@
- app/test-pmd/config.c | 8 ++++++--
- 1 file changed, 6 insertions(+), 2 deletions(-)
+ app/test-pmd/config.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
@@ -23 +24 @@
-index 5381207cc2..016bcb09c4 100644
+index b51e821a45..3b588e2042 100644
@@ -26 +27 @@
-@@ -245,5 +245,5 @@ nic_stats_clear(portid_t port_id)
+@@ -232,5 +232,5 @@ nic_stats_clear(portid_t port_id)
@@ -33 +34 @@
-@@ -251,4 +251,6 @@ nic_stats_clear(portid_t port_id)
+@@ -238,4 +238,6 @@ nic_stats_clear(portid_t port_id)
@@ -40,5 +41 @@
-@@ -334,5 +336,5 @@ nic_xstats_clear(portid_t port_id)
- 	if (ret != 0) {
- 		printf("%s: Error: failed to reset xstats (port %u): %s",
--		       __func__, port_id, strerror(ret));
-+		       __func__, port_id, strerror(-ret));
+@@ -317,8 +319,9 @@ nic_xstats_clear(portid_t port_id)
@@ -47 +44,2 @@
-@@ -340,4 +342,6 @@ nic_xstats_clear(portid_t port_id)
+-	rte_eth_xstats_reset(port_id);
+ 


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [dpdk-stable] patch 'net/cxgbe: fix double MPS alloc by flow validate and create' has been queued to LTS release 18.11.10
  2020-09-02  9:12 [dpdk-stable] patch 'app/testpmd: fix stats error message' has been queued to LTS release 18.11.10 Kevin Traynor
@ 2020-09-02  9:12 ` Kevin Traynor
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Traynor @ 2020-09-02  9:12 UTC (permalink / raw)
  To: Rahul Lakkireddy; +Cc: dpdk stable

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 09/04/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/b82919008c7462a0f2e117e65210754ccb7470f1

Thanks.

Kevin.

---
From b82919008c7462a0f2e117e65210754ccb7470f1 Mon Sep 17 00:00:00 2001
From: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Date: Sat, 13 Jun 2020 03:37:25 +0530
Subject: [PATCH] net/cxgbe: fix double MPS alloc by flow validate and create

[ upstream commit be5f4d5ced10f9d7edc8ba4b3f1d98b9d476d367 ]

The Multi Port Switch (MPS) entry is allocated twice when both
flow validate and create are invoked, but only freed once during
flow destroy. Avoid double alloc by moving MPS entry allocation
closer to when the filter create request is sent to hardware and
will be ignored for filter validate request.

Fixes: fefee7a619a4 ("net/cxgbe: add flow ops to match based on dest MAC")

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
---
 drivers/net/cxgbe/cxgbe_filter.c | 32 ++++++++++++++++++++++++++++++++
 drivers/net/cxgbe/cxgbe_filter.h |  4 +++-
 drivers/net/cxgbe/cxgbe_flow.c   | 28 +++-------------------------
 3 files changed, 38 insertions(+), 26 deletions(-)

diff --git a/drivers/net/cxgbe/cxgbe_filter.c b/drivers/net/cxgbe/cxgbe_filter.c
index 489c23249c..ffb669731e 100644
--- a/drivers/net/cxgbe/cxgbe_filter.c
+++ b/drivers/net/cxgbe/cxgbe_filter.c
@@ -8,4 +8,5 @@
 #include "t4_regs.h"
 #include "cxgbe_filter.h"
+#include "mps_tcam.h"
 #include "clip_tbl.h"
 #include "l2t.h"
@@ -274,7 +275,12 @@ int cxgbe_alloc_ftid(struct adapter *adap, u8 nentries)
 static void clear_filter(struct filter_entry *f)
 {
+	struct port_info *pi = ethdev2pinfo(f->dev);
+
 	if (f->clipt)
 		cxgbe_clip_release(f->dev, f->clipt);
 
+	if (f->fs.mask.macidx)
+		cxgbe_mpstcam_remove(pi, f->fs.val.macidx);
+
 	/* The zeroing of the filter rule below clears the filter valid,
 	 * pending, locked flags etc. so it's all we need for
@@ -574,4 +580,17 @@ static int cxgbe_set_hash_filter(struct rte_eth_dev *dev,
 	f->fs.iq = iq;
 
+	/* Allocate MPS TCAM entry to match Destination MAC. */
+	if (f->fs.mask.macidx) {
+		int idx;
+
+		idx = cxgbe_mpstcam_alloc(pi, f->fs.val.dmac, f->fs.mask.dmac);
+		if (idx <= 0) {
+			ret = -ENOMEM;
+			goto out_err;
+		}
+
+		f->fs.val.macidx = idx;
+	}
+
 	/*
 	 * If the new filter requires loopback Destination MAC and/or VLAN
@@ -1006,4 +1025,17 @@ int cxgbe_set_filter(struct rte_eth_dev *dev, unsigned int filter_id,
 	f->dev = dev;
 
+	/* Allocate MPS TCAM entry to match Destination MAC. */
+	if (f->fs.mask.macidx) {
+		int idx;
+
+		idx = cxgbe_mpstcam_alloc(pi, f->fs.val.dmac, f->fs.mask.dmac);
+		if (idx <= 0) {
+			ret = -ENOMEM;
+			goto free_tid;
+		}
+
+		f->fs.val.macidx = idx;
+	}
+
 	/* Allocate a clip table entry only if we have non-zero IPv6 address. */
 	if (chip_ver > CHELSIO_T5 && f->fs.type &&
diff --git a/drivers/net/cxgbe/cxgbe_filter.h b/drivers/net/cxgbe/cxgbe_filter.h
index 06bac8ef09..5f7ca9c5c6 100644
--- a/drivers/net/cxgbe/cxgbe_filter.h
+++ b/drivers/net/cxgbe/cxgbe_filter.h
@@ -70,6 +70,8 @@ struct ch_filter_tuple {
 	uint16_t fport;		/* foreign port */
 
+	uint8_t dmac[6];        /* Destination MAC to match */
+
 	/* reservations for future additions */
-	uint8_t rsvd[12];
+	uint8_t rsvd[6];
 };
 
diff --git a/drivers/net/cxgbe/cxgbe_flow.c b/drivers/net/cxgbe/cxgbe_flow.c
index d2466f29e4..feb5bb8bd2 100644
--- a/drivers/net/cxgbe/cxgbe_flow.c
+++ b/drivers/net/cxgbe/cxgbe_flow.c
@@ -122,18 +122,7 @@ ch_rte_parsetype_eth(const void *dmask, const struct rte_flow_item *item,
 
 	if (!is_zero_ether_addr(&mask->dst)) {
-		const u8 *addr = (const u8 *)&spec->dst.addr_bytes[0];
-		const u8 *m = (const u8 *)&mask->dst.addr_bytes[0];
-		struct rte_flow *flow = (struct rte_flow *)fs->private;
-		struct port_info *pi = (struct port_info *)
-					(flow->dev->data->dev_private);
-		int idx;
-
-		idx = cxgbe_mpstcam_alloc(pi, addr, m);
-		if (idx <= 0)
-			return rte_flow_error_set(e, idx,
-						  RTE_FLOW_ERROR_TYPE_ITEM,
-						  NULL, "unable to allocate mac"
-						  " entry in h/w");
-		CXGBE_FILL_FS(idx, 0x1ff, macidx);
+		CXGBE_FILL_FS(0, 0x1ff, macidx);
+		CXGBE_FILL_FS_MEMCPY(spec->dst.addr_bytes, mask->dst.addr_bytes,
+				     dmac);
 	}
 
@@ -922,15 +911,4 @@ static int __cxgbe_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow)
 	}
 
-	fs = &flow->fs;
-	if (fs->mask.macidx) {
-		struct port_info *pi = (struct port_info *)
-					(dev->data->dev_private);
-		int ret;
-
-		ret = cxgbe_mpstcam_remove(pi, fs->val.macidx);
-		if (!ret)
-			return ret;
-	}
-
 	return 0;
 }
-- 
2.26.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-09-02 10:08:36.612933337 +0100
+++ 0002-net-cxgbe-fix-double-MPS-alloc-by-flow-validate-and-.patch	2020-09-02 10:08:36.560496766 +0100
@@ -1 +1 @@
-From be5f4d5ced10f9d7edc8ba4b3f1d98b9d476d367 Mon Sep 17 00:00:00 2001
+From b82919008c7462a0f2e117e65210754ccb7470f1 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit be5f4d5ced10f9d7edc8ba4b3f1d98b9d476d367 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -23 +24 @@
-index 06233e41e7..317830f58b 100644
+index 489c23249c..ffb669731e 100644
@@ -26,2 +27,2 @@
-@@ -9,4 +9,5 @@
- #include "base/t4_regs.h"
+@@ -8,4 +8,5 @@
+ #include "t4_regs.h"
@@ -32 +33 @@
-@@ -291,4 +292,6 @@ int cxgbe_alloc_ftid(struct adapter *adap, u8 nentries)
+@@ -274,7 +275,12 @@ int cxgbe_alloc_ftid(struct adapter *adap, u8 nentries)
@@ -39,2 +39,0 @@
-@@ -297,4 +300,7 @@ static void clear_filter(struct filter_entry *f)
- 		cxgbe_l2t_release(f->l2t);
@@ -47 +46 @@
-@@ -610,4 +616,17 @@ static int cxgbe_set_hash_filter(struct rte_eth_dev *dev,
+@@ -574,4 +580,17 @@ static int cxgbe_set_hash_filter(struct rte_eth_dev *dev,
@@ -65 +64 @@
-@@ -1068,4 +1087,17 @@ int cxgbe_set_filter(struct rte_eth_dev *dev, unsigned int filter_id,
+@@ -1006,4 +1025,17 @@ int cxgbe_set_filter(struct rte_eth_dev *dev, unsigned int filter_id,
@@ -84 +83 @@
-index e79c052de6..46ebf83338 100644
+index 06bac8ef09..5f7ca9c5c6 100644
@@ -98 +97 @@
-index 166c39ba55..dd8ee7bbd6 100644
+index d2466f29e4..feb5bb8bd2 100644
@@ -101 +100 @@
-@@ -195,18 +195,7 @@ ch_rte_parsetype_eth(const void *dmask, const struct rte_flow_item *item,
+@@ -122,18 +122,7 @@ ch_rte_parsetype_eth(const void *dmask, const struct rte_flow_item *item,
@@ -103 +102 @@
- 	if (!rte_is_zero_ether_addr(&mask->dst)) {
+ 	if (!is_zero_ether_addr(&mask->dst)) {
@@ -123 +122 @@
-@@ -1213,15 +1202,4 @@ static int __cxgbe_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow)
+@@ -922,15 +911,4 @@ static int __cxgbe_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow)


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-02  9:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-02  9:12 [dpdk-stable] patch 'app/testpmd: fix stats error message' has been queued to LTS release 18.11.10 Kevin Traynor
2020-09-02  9:12 ` [dpdk-stable] patch 'net/cxgbe: fix double MPS alloc by flow validate and create' " Kevin Traynor

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