patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4
@ 2017-10-30 15:34 luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net: fix inner L2 length in packet type parser' " luca.boccassi
                   ` (67 more replies)
  0 siblings, 68 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Olivier Matz, Harry van Haaren, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From e24e4b833bfca06d1b5f385414b58b7a394ccb11 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Thu, 7 Sep 2017 14:09:23 +0100
Subject: [PATCH] cmdline: fix warning for unused return value

[ upstream commit 0a10db80bca3262977646f814e913f4af0b627cc ]

When DPDK is compiled on Ubuntu with extra warnings turned on, there is a
warning about the return value from write() being unchecked. Rather than
having builds disable the warning, which may mask other cases we do care
about, we can add a dummy use of the return value in the code to silence it
in this instance.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 lib/librte_cmdline/cmdline.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/librte_cmdline/cmdline.c b/lib/librte_cmdline/cmdline.c
index a9c47be3c..d74916515 100644
--- a/lib/librte_cmdline/cmdline.c
+++ b/lib/librte_cmdline/cmdline.c
@@ -205,7 +205,8 @@ cmdline_printf(const struct cmdline *cl, const char *fmt, ...)
 	}
 	if (ret >= BUFSIZ)
 		ret = BUFSIZ - 1;
-	write(cl->s_out, buf, ret);
+	ret = write(cl->s_out, buf, ret);
+	(void)ret;
 	free(buf);
 #endif
 }
-- 
2.11.0

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

* [dpdk-stable] patch 'net: fix inner L2 length in packet type parser' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'vfio: fix close unchecked file descriptor' " luca.boccassi
                   ` (66 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Olivier Matz; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 7ec2f419540e7e70f38053d941426af94e7b1703 Mon Sep 17 00:00:00 2001
From: Olivier Matz <olivier.matz@6wind.com>
Date: Mon, 11 Sep 2017 16:57:22 +0200
Subject: [PATCH] net: fix inner L2 length in packet type parser

[ upstream commit b081c1dd2ec64c4f3cc18723ccb7aa1601985bb0 ]

The inner L2 length returned by rte_net_get_ptype() is not
properly initialized. If the caller does not zero the header
lengths structure, the inner_l2 field will be undefined.

Fix it by initializing inner_l2 to 0 when parsing a inner layer.

Fixes: 2c15c5377da2 ("net: support NVGRE in software packet type parser")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
 lib/librte_net/rte_net.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/librte_net/rte_net.c b/lib/librte_net/rte_net.c
index a8c7aff9c..a3ca04032 100644
--- a/lib/librte_net/rte_net.c
+++ b/lib/librte_net/rte_net.c
@@ -396,6 +396,7 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m,
 	if ((layers & RTE_PTYPE_INNER_L2_MASK) == 0)
 		return pkt_type;
 
+	hdr_lens->inner_l2_len = 0;
 	if (proto == rte_cpu_to_be_16(ETHER_TYPE_TEB)) {
 		eh = rte_pktmbuf_read(m, off, sizeof(*eh), &eh_copy);
 		if (unlikely(eh == NULL))
-- 
2.11.0

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

* [dpdk-stable] patch 'vfio: fix close unchecked file descriptor' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net: fix inner L2 length in packet type parser' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'eal: fix auxv open check for ARM and PPC' " luca.boccassi
                   ` (65 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Kuba Kozak; +Cc: Anatoly Burakov, Patrick MacArthur, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 3542d6cbe47c7a30fa977367971c1874a6688d11 Mon Sep 17 00:00:00 2001
From: Kuba Kozak <kubax.kozak@intel.com>
Date: Thu, 21 Sep 2017 15:49:08 +0200
Subject: [PATCH] vfio: fix close unchecked file descriptor

[ upstream commit 96128b365eff2a1e5477e676c08c1fc631cc82c2 ]

Add file descriptor value check before calling close() function.

Coverity issue: 141297
Fixes: 811b6b25060f ("vfio: fix file descriptor leak in multi-process")

Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Patrick MacArthur <patrick@patrickmacarthur.net>
---
 lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c b/lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c
index fb4a2f84b..f28891725 100644
--- a/lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c
+++ b/lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c
@@ -301,7 +301,8 @@ vfio_mp_sync_thread(void __rte_unused * arg)
 				vfio_mp_sync_send_request(conn_sock, SOCKET_ERR);
 			else
 				vfio_mp_sync_send_fd(conn_sock, fd);
-			close(fd);
+			if (fd >= 0)
+				close(fd);
 			break;
 		case SOCKET_REQ_GROUP:
 			/* wait for group number */
-- 
2.11.0

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

* [dpdk-stable] patch 'eal: fix auxv open check for ARM and PPC' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net: fix inner L2 length in packet type parser' " luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'vfio: fix close unchecked file descriptor' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix flow control watermark mismatch' " luca.boccassi
                   ` (64 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Lukasz Majczak; +Cc: Jan Viktorin, Chao Zhu, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From aaae3f20a2e823b15e299d18e6af95211c65e9b5 Mon Sep 17 00:00:00 2001
From: Lukasz Majczak <lma@semihalf.com>
Date: Thu, 28 Sep 2017 08:54:59 +0200
Subject: [PATCH] eal: fix auxv open check for ARM and PPC

[ upstream commit 1e0a17ac4c816fc41f6cf8c1fcd56149d8927263 ]

The assertion of return value from the open() function is done against
0, while it is a correct value - open() returns -1 in case of an error.
It causes problems while trying to run as a daemon, in which case, this
call to open() will return 0 as a valid descriptor.

Fixes: b94e5c9406b5 ("eal/arm: add CPU flags for ARMv7")
Fixes: 97523f822ba9 ("eal/arm: add CPU flags for ARMv8")
Fixes: 9ae155385686 ("eal/ppc: cpu flag checks for IBM Power")

Signed-off-by: Lukasz Majczak <lma@semihalf.com>
Acked-by: Jan Viktorin <viktorin@rehivetech.com>
Acked-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
---
 lib/librte_eal/common/arch/arm/rte_cpuflags.c    | 2 +-
 lib/librte_eal/common/arch/ppc_64/rte_cpuflags.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_eal/common/arch/arm/rte_cpuflags.c b/lib/librte_eal/common/arch/arm/rte_cpuflags.c
index 79160a60c..35338efa2 100644
--- a/lib/librte_eal/common/arch/arm/rte_cpuflags.c
+++ b/lib/librte_eal/common/arch/arm/rte_cpuflags.c
@@ -137,7 +137,7 @@ rte_cpu_get_features(hwcap_registers_t out)
 	_Elfx_auxv_t auxv;
 
 	auxv_fd = open("/proc/self/auxv", O_RDONLY);
-	assert(auxv_fd);
+	assert(auxv_fd != -1);
 	while (read(auxv_fd, &auxv, sizeof(auxv)) == sizeof(auxv)) {
 		if (auxv.a_type == AT_HWCAP) {
 			out[REG_HWCAP] = auxv.a_un.a_val;
diff --git a/lib/librte_eal/common/arch/ppc_64/rte_cpuflags.c b/lib/librte_eal/common/arch/ppc_64/rte_cpuflags.c
index fcf96e045..970a61c5e 100644
--- a/lib/librte_eal/common/arch/ppc_64/rte_cpuflags.c
+++ b/lib/librte_eal/common/arch/ppc_64/rte_cpuflags.c
@@ -108,7 +108,7 @@ rte_cpu_get_features(hwcap_registers_t out)
 	Elf64_auxv_t auxv;
 
 	auxv_fd = open("/proc/self/auxv", O_RDONLY);
-	assert(auxv_fd);
+	assert(auxv_fd != -1);
 	while (read(auxv_fd, &auxv,
 		sizeof(Elf64_auxv_t)) == sizeof(Elf64_auxv_t)) {
 		if (auxv.a_type == AT_HWCAP)
-- 
2.11.0

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

* [dpdk-stable] patch 'net/i40e: fix flow control watermark mismatch' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (2 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'eal: fix auxv open check for ARM and PPC' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/nfp: fix RSS' " luca.boccassi
                   ` (63 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Qi Zhang; +Cc: Kevin Traynor, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 3fc6ec827c536ab4bc174e2f6e279672021a9ef4 Mon Sep 17 00:00:00 2001
From: Qi Zhang <qi.z.zhang@intel.com>
Date: Thu, 10 Aug 2017 18:48:07 +0800
Subject: [PATCH] net/i40e: fix flow control watermark mismatch

[ upstream commit 273dcde1c3e3582d39f4a0916febca7dfd518de9 ]

Flow control watermark is not read out correctly,
that may cause an application who not intend to change
watermark but does change it with a rte_eth_dev_flow_ctrl_set
call right after rte_eth_dev_flow_ctrl_get.

The idea fix is, during init, the watermark is set with default value,
so it is not necessary to read out from hw register during flow_ctl_get,
But due to I40E_GLRPB_GHW limitation, it is shared by different ports on
the same device, it is possible the value is changed on another port,
but local variable not sync, so we have to read out register every
flow_ctl_get.

Fixes: f53577f06925 ("i40e: support flow control")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
---
 drivers/net/i40e/i40e_ethdev.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 65e10f3b4..267a39e42 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -83,12 +83,6 @@
 /* Flow control default timer */
 #define I40E_DEFAULT_PAUSE_TIME 0xFFFFU
 
-/* Flow control default high water */
-#define I40E_DEFAULT_HIGH_WATER (0x1C40/1024)
-
-/* Flow control default low water */
-#define I40E_DEFAULT_LOW_WATER  (0x1A40/1024)
-
 /* Flow control enable fwd bit */
 #define I40E_PRTMAC_FWD_CTRL   0x00000001
 
@@ -98,6 +92,12 @@
 /* Kilobytes shift */
 #define I40E_KILOSHIFT 10
 
+/* Flow control default high water */
+#define I40E_DEFAULT_HIGH_WATER (0xF2000 >> I40E_KILOSHIFT)
+
+/* Flow control default low water */
+#define I40E_DEFAULT_LOW_WATER  (0xF2000 >> I40E_KILOSHIFT)
+
 /* Receive Average Packet Size in Byte*/
 #define I40E_PACKET_AVERAGE_SIZE 128
 
@@ -2879,6 +2879,13 @@ i40e_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
 
 	fc_conf->pause_time = pf->fc_conf.pause_time;
+
+	/* read out from register, in case they are modified by other port */
+	pf->fc_conf.high_water[I40E_MAX_TRAFFIC_CLASS] =
+		I40E_READ_REG(hw, I40E_GLRPB_GHW) >> I40E_KILOSHIFT;
+	pf->fc_conf.low_water[I40E_MAX_TRAFFIC_CLASS] =
+		I40E_READ_REG(hw, I40E_GLRPB_GLW) >> I40E_KILOSHIFT;
+
 	fc_conf->high_water =  pf->fc_conf.high_water[I40E_MAX_TRAFFIC_CLASS];
 	fc_conf->low_water = pf->fc_conf.low_water[I40E_MAX_TRAFFIC_CLASS];
 
-- 
2.11.0

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

* [dpdk-stable] patch 'net/nfp: fix RSS' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (3 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix flow control watermark mismatch' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix PF notify issue when VF is not up' " luca.boccassi
                   ` (62 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Alejandro Lucero; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From d78f75949d9aed2417c128f46db2475bae128b6e Mon Sep 17 00:00:00 2001
From: Alejandro Lucero <alejandro.lucero@netronome.com>
Date: Fri, 11 Aug 2017 14:43:50 +0100
Subject: [PATCH] net/nfp: fix RSS

[ upstream commit e1102e36fa6a8d813e9de7fc6978b83620a4f418 ]

Redirection table was not being updated properly.
There is also a problem when configuring RSS.

Fixes: 934e4c60fbff ("nfp: add RSS")

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
---
 drivers/net/nfp/nfp_net.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 49c52930c..a3c73cd28 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -2120,7 +2120,8 @@ nfp_net_reta_update(struct rte_eth_dev *dev,
 				reta &= ~(0xFF << (8 * j));
 			reta |= reta_conf[idx].reta[shift + j] << (8 * j);
 		}
-		nn_cfg_writel(hw, NFP_NET_CFG_RSS_ITBL + shift, reta);
+		nn_cfg_writel(hw, NFP_NET_CFG_RSS_ITBL + (idx * 64) + shift,
+			      reta);
 	}
 
 	update = NFP_NET_CFG_UPDATE_RSS;
@@ -2167,7 +2168,8 @@ nfp_net_reta_query(struct rte_eth_dev *dev,
 		if (!mask)
 			continue;
 
-		reta = nn_cfg_readl(hw, NFP_NET_CFG_RSS_ITBL + shift);
+		reta = nn_cfg_readl(hw, NFP_NET_CFG_RSS_ITBL + (idx * 64) +
+				    shift);
 		for (j = 0; j < 4; j++) {
 			if (!(mask & (0x1 << j)))
 				continue;
@@ -2217,6 +2219,9 @@ nfp_net_rss_hash_update(struct rte_eth_dev *dev,
 				NFP_NET_CFG_RSS_IPV6_TCP |
 				NFP_NET_CFG_RSS_IPV6_UDP;
 
+	cfg_rss_ctrl |= NFP_NET_CFG_RSS_MASK;
+	cfg_rss_ctrl |= NFP_NET_CFG_RSS_TOEPLITZ;
+
 	/* configuring where to apply the RSS hash */
 	nn_cfg_writel(hw, NFP_NET_CFG_RSS_CTRL, cfg_rss_ctrl);
 
-- 
2.11.0

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

* [dpdk-stable] patch 'net/i40e: fix PF notify issue when VF is not up' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (4 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/nfp: fix RSS' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/ixgbe: fix mapping of user priority to TC' " luca.boccassi
                   ` (61 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Xiaoyun Li; +Cc: Beilei Xing, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From e591d604873ef48b51e6d8fc3919eb638a3f2b52 Mon Sep 17 00:00:00 2001
From: Xiaoyun Li <xiaoyun.li@intel.com>
Date: Tue, 15 Aug 2017 15:39:36 +0800
Subject: [PATCH] net/i40e: fix PF notify issue when VF is not up

[ upstream commit 16048c4cb70386512917073c1661d743f5a78806 ]

This patch stops PF from sending message to VF when VF's admin queue
isn't enabled, namely VF isn't up.

Fixes: 4861cde46116 ("i40e: new poll mode driver")

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
---
 drivers/net/i40e/i40e_pf.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c
index b36d9019c..c5e06ca7b 100644
--- a/drivers/net/i40e/i40e_pf.c
+++ b/drivers/net/i40e/i40e_pf.c
@@ -902,7 +902,10 @@ send_msg:
 static void
 i40e_notify_vf_link_status(struct rte_eth_dev *dev, struct i40e_pf_vf *vf)
 {
+	struct i40e_hw *hw = I40E_PF_TO_HW(vf->pf);
 	struct i40e_virtchnl_pf_event event;
+	uint16_t vf_id = vf->vf_idx;
+	uint32_t tval, rval;
 
 	event.event = I40E_VIRTCHNL_EVENT_LINK_CHANGE;
 	event.event_data.link_event.link_status =
@@ -934,8 +937,15 @@ i40e_notify_vf_link_status(struct rte_eth_dev *dev, struct i40e_pf_vf *vf)
 		break;
 	}
 
-	i40e_pf_host_send_msg_to_vf(vf, I40E_VIRTCHNL_OP_EVENT,
-		I40E_SUCCESS, (uint8_t *)&event, sizeof(event));
+	tval = I40E_READ_REG(hw, I40E_VF_ATQLEN(vf_id));
+	rval = I40E_READ_REG(hw, I40E_VF_ARQLEN(vf_id));
+
+	if (tval & I40E_VF_ATQLEN_ATQLEN_MASK ||
+	    tval & I40E_VF_ATQLEN_ATQENABLE_MASK ||
+	    rval & I40E_VF_ARQLEN_ARQLEN_MASK ||
+	    rval & I40E_VF_ARQLEN_ARQENABLE_MASK)
+		i40e_pf_host_send_msg_to_vf(vf, I40E_VIRTCHNL_OP_EVENT,
+			I40E_SUCCESS, (uint8_t *)&event, sizeof(event));
 }
 
 void
-- 
2.11.0

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

* [dpdk-stable] patch 'net/ixgbe: fix mapping of user priority to TC' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (5 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix PF notify issue when VF is not up' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/enic: fix possible null pointer dereference' " luca.boccassi
                   ` (60 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Wei Dai; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From c31b1e7fc352af4044517288ac0eeda978783e78 Mon Sep 17 00:00:00 2001
From: Wei Dai <wei.dai@intel.com>
Date: Mon, 21 Aug 2017 15:50:05 +0800
Subject: [PATCH] net/ixgbe: fix mapping of user priority to TC

[ upstream commit a8e54b44515ce741a0b73fe2e35e99f6f1dcef4b ]

This patch fixes the mapping of user priority to traffic class
in Rx/Tx path of DCB configuration. Each DCB traffic class
should include all user priorities mapping to it in both Rx and
Tx path.

Fixes: 0807f80d35d0 ("ixgbe: DCB / flow control")

Signed-off-by: Wei Dai <wei.dai@intel.com>
---
 drivers/net/ixgbe/ixgbe_rxtx.c | 41 +++++++++++++++++++++++++++++++++--------
 1 file changed, 33 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index d1e300a58..8b18b5302 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -3395,12 +3395,19 @@ ixgbe_vmdq_dcb_rx_config(struct rte_eth_dev *dev,
 		dcb_config->num_tcs.pg_tcs = ETH_4_TCS;
 		dcb_config->num_tcs.pfc_tcs = ETH_4_TCS;
 	}
+
+	/* Initialize User Priority to Traffic Class mapping */
+	for (j = 0; j < IXGBE_DCB_MAX_TRAFFIC_CLASS; j++) {
+		tc = &dcb_config->tc_config[j];
+		tc->path[IXGBE_DCB_RX_CONFIG].up_to_tc_bitmap = 0;
+	}
+
 	/* User Priority to Traffic Class mapping */
 	for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) {
 		j = vmdq_rx_conf->dcb_tc[i];
 		tc = &dcb_config->tc_config[j];
-		tc->path[IXGBE_DCB_RX_CONFIG].up_to_tc_bitmap =
-						(uint8_t)(1 << j);
+		tc->path[IXGBE_DCB_RX_CONFIG].up_to_tc_bitmap |=
+						(uint8_t)(1 << i);
 	}
 }
 
@@ -3422,12 +3429,18 @@ ixgbe_dcb_vt_tx_config(struct rte_eth_dev *dev,
 		dcb_config->num_tcs.pfc_tcs = ETH_4_TCS;
 	}
 
+	/* Initialize User Priority to Traffic Class mapping */
+	for (j = 0; j < IXGBE_DCB_MAX_TRAFFIC_CLASS; j++) {
+		tc = &dcb_config->tc_config[j];
+		tc->path[IXGBE_DCB_TX_CONFIG].up_to_tc_bitmap = 0;
+	}
+
 	/* User Priority to Traffic Class mapping */
 	for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) {
 		j = vmdq_tx_conf->dcb_tc[i];
 		tc = &dcb_config->tc_config[j];
-		tc->path[IXGBE_DCB_TX_CONFIG].up_to_tc_bitmap =
-						(uint8_t)(1 << j);
+		tc->path[IXGBE_DCB_TX_CONFIG].up_to_tc_bitmap |=
+						(uint8_t)(1 << i);
 	}
 }
 
@@ -3443,12 +3456,18 @@ ixgbe_dcb_rx_config(struct rte_eth_dev *dev,
 	dcb_config->num_tcs.pg_tcs = (uint8_t)rx_conf->nb_tcs;
 	dcb_config->num_tcs.pfc_tcs = (uint8_t)rx_conf->nb_tcs;
 
+	/* Initialize User Priority to Traffic Class mapping */
+	for (j = 0; j < IXGBE_DCB_MAX_TRAFFIC_CLASS; j++) {
+		tc = &dcb_config->tc_config[j];
+		tc->path[IXGBE_DCB_RX_CONFIG].up_to_tc_bitmap = 0;
+	}
+
 	/* User Priority to Traffic Class mapping */
 	for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) {
 		j = rx_conf->dcb_tc[i];
 		tc = &dcb_config->tc_config[j];
-		tc->path[IXGBE_DCB_RX_CONFIG].up_to_tc_bitmap =
-						(uint8_t)(1 << j);
+		tc->path[IXGBE_DCB_RX_CONFIG].up_to_tc_bitmap |=
+						(uint8_t)(1 << i);
 	}
 }
 
@@ -3464,12 +3483,18 @@ ixgbe_dcb_tx_config(struct rte_eth_dev *dev,
 	dcb_config->num_tcs.pg_tcs = (uint8_t)tx_conf->nb_tcs;
 	dcb_config->num_tcs.pfc_tcs = (uint8_t)tx_conf->nb_tcs;
 
+	/* Initialize User Priority to Traffic Class mapping */
+	for (j = 0; j < IXGBE_DCB_MAX_TRAFFIC_CLASS; j++) {
+		tc = &dcb_config->tc_config[j];
+		tc->path[IXGBE_DCB_TX_CONFIG].up_to_tc_bitmap = 0;
+	}
+
 	/* User Priority to Traffic Class mapping */
 	for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) {
 		j = tx_conf->dcb_tc[i];
 		tc = &dcb_config->tc_config[j];
-		tc->path[IXGBE_DCB_TX_CONFIG].up_to_tc_bitmap =
-						(uint8_t)(1 << j);
+		tc->path[IXGBE_DCB_TX_CONFIG].up_to_tc_bitmap |=
+						(uint8_t)(1 << i);
 	}
 }
 
-- 
2.11.0

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

* [dpdk-stable] patch 'net/enic: fix possible null pointer dereference' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (6 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/ixgbe: fix mapping of user priority to TC' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/mlx5: fix clang build' " luca.boccassi
                   ` (59 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: RongQiang Xie; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 8bff1eb20237196eac5588ada13bd79b356e8817 Mon Sep 17 00:00:00 2001
From: RongQiang Xie <xie.rongqiang@zte.com.cn>
Date: Wed, 23 Aug 2017 16:49:24 +0800
Subject: [PATCH] net/enic: fix possible null pointer dereference

[ upstream commit 7f4a1aa1430d085b80b6a483aac0e729a0b4f6df ]

In enic_alloc_consistent() function, if rte_malloc for mze is failed,
!mze is true, memzone should be freed and function should return NULL.

Fixes: da5f560be966 ("net/enic: fix memory freeing")

Signed-off-by: RongQiang Xie <xie.rongqiang@zte.com.cn>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 drivers/net/enic/enic_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 1861a32cc..817f63eb4 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -375,6 +375,7 @@ enic_alloc_consistent(void *priv, size_t size,
 		pr_err("%s : Failed to allocate memory for memzone list\n",
 		       __func__);
 		rte_memzone_free(rz);
+		return NULL;
 	}
 
 	mze->rz = rz;
-- 
2.11.0

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

* [dpdk-stable] patch 'net/mlx5: fix clang build' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (7 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/enic: fix possible null pointer dereference' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/mlx5: improve stack usage during link update' " luca.boccassi
                   ` (58 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Nélio Laranjeiro; +Cc: Adrien Mazarguil, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 116a7777f30dee8b999045d0a1d4680004793ccd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?N=C3=A9lio=20Laranjeiro?= <nelio.laranjeiro@6wind.com>
Date: Wed, 30 Aug 2017 16:47:06 +0200
Subject: [PATCH] net/mlx5: fix clang build

[ upstream commit 90260d577b61685365b7cf1a6151b9ed6b108f2d ]

On redhat 7.2 clang reports the following error:
   CC mlx5_rxmode.o
 /drivers/net/mlx5/mlx5_ethdev.c:820:32: error: field 'edata' with
 variable sized type 'struct ethtool_link_settings' not at the end
 of a struct or class is a GNU extension
 [-Werror,-Wgnu-variable-sized-type-not-at-end]
      struct ethtool_link_settings edata;

Use alternative approach to reserve buffer space on the stack.

Fixes: ef09a7fc7620 ("net/mlx5: fix inconsistent link status query")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 drivers/net/mlx5/mlx5_ethdev.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index ca981a531..5384a880a 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -49,6 +49,7 @@
 #include <linux/sockios.h>
 #include <linux/version.h>
 #include <fcntl.h>
+#include <stdalign.h>
 
 /* DPDK headers don't like -pedantic. */
 #ifdef PEDANTIC
@@ -755,12 +756,11 @@ static int
 mlx5_link_update_unlocked_gs(struct rte_eth_dev *dev, int wait_to_complete)
 {
 	struct priv *priv = mlx5_get_priv(dev);
-	__extension__ struct {
-		struct ethtool_link_settings edata;
-		uint32_t link_mode_data[3 *
-					ETHTOOL_LINK_MODE_MASK_MAX_KERNEL_NU32];
-	} ecmd;
-
+	alignas(struct ethtool_link_settings)
+	uint8_t data[offsetof(struct ethtool_link_settings, link_mode_masks) +
+		     sizeof(uint32_t) *
+		     ETHTOOL_LINK_MODE_MASK_MAX_KERNEL_NU32 * 3];
+	struct ethtool_link_settings *ecmd = (void *)data;
 	struct ifreq ifr;
 	struct rte_eth_link dev_link;
 	uint64_t sc;
@@ -773,23 +773,23 @@ mlx5_link_update_unlocked_gs(struct rte_eth_dev *dev, int wait_to_complete)
 	memset(&dev_link, 0, sizeof(dev_link));
 	dev_link.link_status = ((ifr.ifr_flags & IFF_UP) &&
 				(ifr.ifr_flags & IFF_RUNNING));
-	memset(&ecmd, 0, sizeof(ecmd));
-	ecmd.edata.cmd = ETHTOOL_GLINKSETTINGS;
-	ifr.ifr_data = (void *)&ecmd;
+	memset(ecmd, 0, sizeof(*ecmd));
+	ecmd->cmd = ETHTOOL_GLINKSETTINGS;
+	ifr.ifr_data = (void *)ecmd;
 	if (priv_ifreq(priv, SIOCETHTOOL, &ifr)) {
 		DEBUG("ioctl(SIOCETHTOOL, ETHTOOL_GLINKSETTINGS) failed: %s",
 		      strerror(errno));
 		return -1;
 	}
-	ecmd.edata.link_mode_masks_nwords = -ecmd.edata.link_mode_masks_nwords;
+	ecmd->link_mode_masks_nwords = -ecmd->link_mode_masks_nwords;
 	if (priv_ifreq(priv, SIOCETHTOOL, &ifr)) {
 		DEBUG("ioctl(SIOCETHTOOL, ETHTOOL_GLINKSETTINGS) failed: %s",
 		      strerror(errno));
 		return -1;
 	}
-	dev_link.link_speed = ecmd.edata.speed;
-	sc = ecmd.edata.link_mode_masks[0] |
-		((uint64_t)ecmd.edata.link_mode_masks[1] << 32);
+	dev_link.link_speed = ecmd->speed;
+	sc = ecmd->link_mode_masks[0] |
+		((uint64_t)ecmd->link_mode_masks[1] << 32);
 	priv->link_speed_capa = 0;
 	if (sc & ETHTOOL_LINK_MODE_Autoneg_BIT)
 		priv->link_speed_capa |= ETH_LINK_SPEED_AUTONEG;
@@ -825,7 +825,7 @@ mlx5_link_update_unlocked_gs(struct rte_eth_dev *dev, int wait_to_complete)
 		  ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT |
 		  ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT))
 		priv->link_speed_capa |= ETH_LINK_SPEED_100G;
-	dev_link.link_duplex = ((ecmd.edata.duplex == DUPLEX_HALF) ?
+	dev_link.link_duplex = ((ecmd->duplex == DUPLEX_HALF) ?
 				ETH_LINK_HALF_DUPLEX : ETH_LINK_FULL_DUPLEX);
 	dev_link.link_autoneg = !(dev->data->dev_conf.link_speeds &
 				  ETH_LINK_SPEED_FIXED);
-- 
2.11.0

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

* [dpdk-stable] patch 'net/mlx5: improve stack usage during link update' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (8 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/mlx5: fix clang build' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/mlx5: fix probe failure report' " luca.boccassi
                   ` (57 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Nélio Laranjeiro; +Cc: Adrien Mazarguil, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From cf34c0a6e345b2c5d3d1a3d8a7f37646a4ec8265 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?N=C3=A9lio=20Laranjeiro?= <nelio.laranjeiro@6wind.com>
Date: Wed, 30 Aug 2017 16:47:07 +0200
Subject: [PATCH] net/mlx5: improve stack usage during link update

[ upstream commit 37a4406cdf457fb636d3bcdd0a1922fdef23f55a ]

Allocate no more memory than necessary for the second call to
ETHTOOL_GLINKSETTINGS.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 drivers/net/mlx5/mlx5_ethdev.c | 45 +++++++++++++++++++++---------------------
 1 file changed, 23 insertions(+), 22 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 5384a880a..8ffb2d861 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -120,7 +120,6 @@ struct ethtool_link_settings {
 #define ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT 38
 #define ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT 39
 #endif
-#define ETHTOOL_LINK_MODE_MASK_MAX_KERNEL_NU32 (SCHAR_MAX)
 
 /**
  * Return private structure associated with an Ethernet device.
@@ -756,37 +755,39 @@ static int
 mlx5_link_update_unlocked_gs(struct rte_eth_dev *dev, int wait_to_complete)
 {
 	struct priv *priv = mlx5_get_priv(dev);
+	struct ethtool_link_settings gcmd = { .cmd = ETHTOOL_GLINKSETTINGS };
+	struct ifreq ifr;
+	struct rte_eth_link dev_link;
+	uint64_t sc;
+
+	(void)wait_to_complete;
+	if (priv_ifreq(priv, SIOCGIFFLAGS, &ifr)) {
+		WARN("ioctl(SIOCGIFFLAGS) failed: %s", strerror(errno));
+		return -1;
+	}
+	memset(&dev_link, 0, sizeof(dev_link));
+	dev_link.link_status = ((ifr.ifr_flags & IFF_UP) &&
+				(ifr.ifr_flags & IFF_RUNNING));
+	ifr.ifr_data = (void *)&gcmd;
+	if (priv_ifreq(priv, SIOCETHTOOL, &ifr)) {
+		DEBUG("ioctl(SIOCETHTOOL, ETHTOOL_GLINKSETTINGS) failed: %s",
+		      strerror(errno));
+		return -1;
+	}
+	gcmd.link_mode_masks_nwords = -gcmd.link_mode_masks_nwords;
+
 	alignas(struct ethtool_link_settings)
 	uint8_t data[offsetof(struct ethtool_link_settings, link_mode_masks) +
-		     sizeof(uint32_t) *
-		     ETHTOOL_LINK_MODE_MASK_MAX_KERNEL_NU32 * 3];
+		     sizeof(uint32_t) * gcmd.link_mode_masks_nwords * 3];
 	struct ethtool_link_settings *ecmd = (void *)data;
-	struct ifreq ifr;
-	struct rte_eth_link dev_link;
-	uint64_t sc;
 
-	(void)wait_to_complete;
-	if (priv_ifreq(priv, SIOCGIFFLAGS, &ifr)) {
-		WARN("ioctl(SIOCGIFFLAGS) failed: %s", strerror(errno));
-		return -1;
-	}
-	memset(&dev_link, 0, sizeof(dev_link));
-	dev_link.link_status = ((ifr.ifr_flags & IFF_UP) &&
-				(ifr.ifr_flags & IFF_RUNNING));
-	memset(ecmd, 0, sizeof(*ecmd));
-	ecmd->cmd = ETHTOOL_GLINKSETTINGS;
+	*ecmd = gcmd;
 	ifr.ifr_data = (void *)ecmd;
 	if (priv_ifreq(priv, SIOCETHTOOL, &ifr)) {
 		DEBUG("ioctl(SIOCETHTOOL, ETHTOOL_GLINKSETTINGS) failed: %s",
 		      strerror(errno));
 		return -1;
 	}
-	ecmd->link_mode_masks_nwords = -ecmd->link_mode_masks_nwords;
-	if (priv_ifreq(priv, SIOCETHTOOL, &ifr)) {
-		DEBUG("ioctl(SIOCETHTOOL, ETHTOOL_GLINKSETTINGS) failed: %s",
-		      strerror(errno));
-		return -1;
-	}
 	dev_link.link_speed = ecmd->speed;
 	sc = ecmd->link_mode_masks[0] |
 		((uint64_t)ecmd->link_mode_masks[1] << 32);
-- 
2.11.0

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

* [dpdk-stable] patch 'net/mlx5: fix probe failure report' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (9 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/mlx5: improve stack usage during link update' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/cxgbe: fix memory leak' " luca.boccassi
                   ` (56 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Matan Azrad; +Cc: Nelio Laranjeiro, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 7251e11ce68acebbcf8a9c30eb494357de67d4dd Mon Sep 17 00:00:00 2001
From: Matan Azrad <matan@mellanox.com>
Date: Sun, 13 Aug 2017 15:25:12 +0300
Subject: [PATCH] net/mlx5: fix probe failure report

[ upstream commit e1c3e30508e1c73697a78900cb9004edc83711af ]

The corrupted code doesn't return error when probe function
fails due to error in device mac address getting.
By this way, the probe function may return success even if the
ETH dev is not allocated.

Hence, the probe caller, for example failsafe PMD, fails when it
tries to get ETH dev after the device was plugged out while mlx5
was probing it.

The fix adds error report to the probe caller when priv_get_mac fails
and in all other failure options which are missing it.

By this way, it prevents the unexpected behavior to miss ETH device
after the device was probed successfully.

This bug was already present in the original code taken from mlx4.

Fixes: 771fa900b73a ("mlx5: introduce new driver for Mellanox ConnectX-4 adapters")
Fixes: 1371f4df16bc ("mlx5: check port is configured as ethernet device")

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
---
 drivers/net/mlx5/mlx5.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index aa9d2dcb4..86d1e44c7 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -463,8 +463,10 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
 		DEBUG("using port %u (%08" PRIx32 ")", port, test);
 
 		ctx = ibv_open_device(ibv_dev);
-		if (ctx == NULL)
+		if (ctx == NULL) {
+			err = ENODEV;
 			goto port_error;
+		}
 
 		/* Check port status. */
 		err = ibv_query_port(ctx, port, &port_attr);
@@ -476,6 +478,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
 		if (port_attr.link_layer != IBV_LINK_LAYER_ETHERNET) {
 			ERROR("port %d is not configured in Ethernet mode",
 			      port);
+			err = EINVAL;
 			goto port_error;
 		}
 
@@ -519,6 +522,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
 		}
 		if (ibv_exp_query_device(ctx, &exp_device_attr)) {
 			ERROR("ibv_exp_query_device() failed");
+			err = ENODEV;
 			goto port_error;
 		}
 
@@ -581,6 +585,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
 		if (priv_get_mac(priv, &mac.addr_bytes)) {
 			ERROR("cannot get MAC address, is mlx5_en loaded?"
 			      " (errno: %s)", strerror(errno));
+			err = ENODEV;
 			goto port_error;
 		}
 		INFO("port %u MAC address is %02x:%02x:%02x:%02x:%02x:%02x",
-- 
2.11.0

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

* [dpdk-stable] patch 'net/cxgbe: fix memory leak' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (10 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/mlx5: fix probe failure report' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/ixgbe: fix adding a mirror rule' " luca.boccassi
                   ` (55 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Congwen Zhang; +Cc: Rahul Lakkireddy, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 1ad0dee5e84b22ddab5dcc8e056da10780b42d8c Mon Sep 17 00:00:00 2001
From: Congwen Zhang <zhang.congwen@zte.com.cn>
Date: Tue, 5 Sep 2017 16:46:57 +0800
Subject: [PATCH] net/cxgbe: fix memory leak

[ upstream commit c0b865d4717d85138f716d42ca186672b060f166 ]

In function t4_wr_mbox_meat_timeout(), dynamic memory stored
in 'temp' variable and it is not freed when the function return,
this is a possible memory leak.

Fixes: 3bd122eef2cc ("cxgbe/base: add hardware API for Chelsio T5 series adapters")

Signed-off-by: Congwen Zhang <zhang.congwen@zte.com.cn>
Acked-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
---
 drivers/net/cxgbe/base/t4_hw.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/cxgbe/base/t4_hw.c b/drivers/net/cxgbe/base/t4_hw.c
index 19afdac92..565a6959c 100644
--- a/drivers/net/cxgbe/base/t4_hw.c
+++ b/drivers/net/cxgbe/base/t4_hw.c
@@ -403,6 +403,7 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox,
 			t4_os_atomic_list_del(&entry, &adap->mbox_list,
 					      &adap->mbox_lock);
 			t4_report_fw_error(adap);
+			free(temp);
 			return (pcie_fw & F_PCIE_FW_ERR) ? -ENXIO : -EBUSY;
 		}
 
@@ -446,6 +447,7 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox,
 							 &adap->mbox_list,
 							 &adap->mbox_lock));
 		t4_report_fw_error(adap);
+		free(temp);
 		return (v == X_MBOWNER_FW ? -EBUSY : -ETIMEDOUT);
 	}
 
@@ -546,6 +548,7 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox,
 			T4_OS_MBOX_LOCKING(
 				t4_os_atomic_list_del(&entry, &adap->mbox_list,
 						      &adap->mbox_lock));
+			free(temp);
 			return -G_FW_CMD_RETVAL((int)res);
 		}
 	}
-- 
2.11.0

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

* [dpdk-stable] patch 'net/ixgbe: fix adding a mirror rule' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (11 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/cxgbe: fix memory leak' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/vmxnet3: fix MAC address set' " luca.boccassi
                   ` (54 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Wei Dai; +Cc: Jingjing Wu, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 4bbdd2113f8883c80fcd14be90beacb8468a489f Mon Sep 17 00:00:00 2001
From: Wei Dai <wei.dai@intel.com>
Date: Tue, 5 Sep 2017 17:16:57 +0800
Subject: [PATCH] net/ixgbe: fix adding a mirror rule

[ upstream commit c2252db7f9a09bfca03f59fec2dab09e2a4d0d6b ]

mirror rule_type can be a bit OR result of multiple mirror type of
a rule.

Fixes: 7ba29a76b196 ("ethdev: rename and extend the mirror type")

Signed-off-by: Wei Dai <wei.dai@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index f994fedc7..3b51bcc3d 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -5013,13 +5013,13 @@ ixgbe_mirror_rule_set(struct rte_eth_dev *dev,
 	IXGBE_WRITE_REG(hw, IXGBE_MRCTL(rule_id), mr_ctl);
 
 	/* write pool mirrror control  register */
-	if (mirror_conf->rule_type == ETH_MIRROR_VIRTUAL_POOL_UP) {
+	if (mirror_conf->rule_type & ETH_MIRROR_VIRTUAL_POOL_UP) {
 		IXGBE_WRITE_REG(hw, IXGBE_VMRVM(rule_id), mp_lsb);
 		IXGBE_WRITE_REG(hw, IXGBE_VMRVM(rule_id + rule_mr_offset),
 				mp_msb);
 	}
 	/* write VLAN mirrror control  register */
-	if (mirror_conf->rule_type == ETH_MIRROR_VLAN) {
+	if (mirror_conf->rule_type & ETH_MIRROR_VLAN) {
 		IXGBE_WRITE_REG(hw, IXGBE_VMRVLAN(rule_id), mv_lsb);
 		IXGBE_WRITE_REG(hw, IXGBE_VMRVLAN(rule_id + rule_mr_offset),
 				mv_msb);
-- 
2.11.0

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

* [dpdk-stable] patch 'net/vmxnet3: fix MAC address set' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (12 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/ixgbe: fix adding a mirror rule' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix memory leak if VF init fails' " luca.boccassi
                   ` (53 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: David Harton; +Cc: Shrikrishna Khare, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 06169a6cc3db8eeebbb4d51fdd1868dcaf5ec784 Mon Sep 17 00:00:00 2001
From: David Harton <dharton@cisco.com>
Date: Fri, 25 Aug 2017 14:54:57 -0400
Subject: [PATCH] net/vmxnet3: fix MAC address set

[ upstream commit 66db172f2636a1634b3e8e73afb76968d35acc5e ]

Updated vmxnet3_mac_addr_set() to store the newly set MAC address.
Modified vmxnet3_write_mac() so the h/w is updated in an endian
neutral manner.

Fixes: 139f39a97859 ("vmxnet3: support setting MAC address")

Signed-off-by: David Harton <dharton@cisco.com>
Acked-by: Shrikrishna Khare <skhare@vmware.com>
---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index aedac6ca2..2bd2f272d 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -441,10 +441,10 @@ vmxnet3_write_mac(struct vmxnet3_hw *hw, const uint8_t *addr)
 		     addr[0], addr[1], addr[2],
 		     addr[3], addr[4], addr[5]);
 
-	val = *(const uint32_t *)addr;
+	memcpy(&val, addr, 4);
 	VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_MACL, val);
 
-	val = (addr[5] << 8) | addr[4];
+	memcpy(&val, addr + 4, 2);
 	VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_MACH, val);
 }
 
@@ -762,6 +762,8 @@ vmxnet3_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr)
 {
 	struct vmxnet3_hw *hw = dev->data->dev_private;
 
+	ether_addr_copy(mac_addr, (struct ether_addr *)(hw->perm_addr));
+	ether_addr_copy(mac_addr, &dev->data->mac_addrs[0]);
 	vmxnet3_write_mac(hw, mac_addr->addr_bytes);
 }
 
-- 
2.11.0

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

* [dpdk-stable] patch 'net/i40e: fix memory leak if VF init fails' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (13 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/vmxnet3: fix MAC address set' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix i40evf MAC filter table' " luca.boccassi
                   ` (52 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Jingjing Wu; +Cc: Beilei Xing, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 25a003fe08834d87c81bc2e8e4b82dac53b43336 Mon Sep 17 00:00:00 2001
From: Jingjing Wu <jingjing.wu@intel.com>
Date: Wed, 13 Sep 2017 07:54:23 +0800
Subject: [PATCH] net/i40e: fix memory leak if VF init fails

[ upstream commit d031bff503bac11d8cefed90154441a4bc577d36 ]

Fixes: 4861cde46116 ("i40e: new poll mode driver")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index efd4fac11..0f2f23c05 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1210,29 +1210,29 @@ i40evf_init_vf(struct rte_eth_dev *dev)
 	/* VF reset, shutdown admin queue and initialize again */
 	if (i40e_shutdown_adminq(hw) != I40E_SUCCESS) {
 		PMD_INIT_LOG(ERR, "i40e_shutdown_adminq failed");
-		return -1;
+		goto err;
 	}
 
 	i40e_init_adminq_parameter(hw);
 	if (i40e_init_adminq(hw) != I40E_SUCCESS) {
 		PMD_INIT_LOG(ERR, "init_adminq failed");
-		return -1;
+		goto err;
 	}
 	vf->aq_resp = rte_zmalloc("vf_aq_resp", I40E_AQ_BUF_SZ, 0);
 	if (!vf->aq_resp) {
 		PMD_INIT_LOG(ERR, "unable to allocate vf_aq_resp memory");
-			goto err_aq;
+		goto err_aq;
 	}
 	if (i40evf_check_api_version(dev) != 0) {
 		PMD_INIT_LOG(ERR, "check_api version failed");
-		goto err_aq;
+		goto err_api;
 	}
 	bufsz = sizeof(struct i40e_virtchnl_vf_resource) +
 		(I40E_MAX_VF_VSI * sizeof(struct i40e_virtchnl_vsi_resource));
 	vf->vf_res = rte_zmalloc("vf_res", bufsz, 0);
 	if (!vf->vf_res) {
 		PMD_INIT_LOG(ERR, "unable to allocate vf_res memory");
-			goto err_aq;
+		goto err_api;
 	}
 
 	if (i40evf_get_vf_resource(dev) != 0) {
@@ -1279,6 +1279,9 @@ i40evf_init_vf(struct rte_eth_dev *dev)
 
 err_alloc:
 	rte_free(vf->vf_res);
+	vf->vsi_res = NULL;
+err_api:
+	rte_free(vf->aq_resp);
 err_aq:
 	i40e_shutdown_adminq(hw); /* ignore error */
 err:
-- 
2.11.0

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

* [dpdk-stable] patch 'net/i40e: fix i40evf MAC filter table' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (14 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix memory leak if VF init fails' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/mlx5: fix Tx stats error counter definition' " luca.boccassi
                   ` (51 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: David Harton; +Cc: Beilei Xing, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From f44cb3cb0eb2539ed690d885fefb637c45ef4444 Mon Sep 17 00:00:00 2001
From: David Harton <dharton@cisco.com>
Date: Tue, 12 Sep 2017 23:21:10 -0400
Subject: [PATCH] net/i40e: fix i40evf MAC filter table

[ upstream commit 7a4afbad98eddc88216e7ef5cf152c86e2c09fc2 ]

The i40e maintains a single MAC filter table for both
unicast and multicast addresses.  The i40e_validate_mac_addr
function was preventing multicast addresses from being added
to the table via i40evf_add_mac_addr.  Fixed the issue by
adjusting the check in i40evf_add_mac_addr.

Fixes: 4861cde46116 ("i40e: new poll mode driver")
Fixes: 97ac72aa71a9 ("i40e: support setting VF MAC address")

Signed-off-by: David Harton <dharton@cisco.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 0f2f23c05..c01312228 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -859,7 +859,7 @@ i40evf_add_mac_addr(struct rte_eth_dev *dev,
 	int err;
 	struct vf_cmd_info args;
 
-	if (i40e_validate_mac_addr(addr->addr_bytes) != I40E_SUCCESS) {
+	if (is_zero_ether_addr(addr)) {
 		PMD_DRV_LOG(ERR, "Invalid mac:%x:%x:%x:%x:%x:%x",
 			    addr->addr_bytes[0], addr->addr_bytes[1],
 			    addr->addr_bytes[2], addr->addr_bytes[3],
-- 
2.11.0

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

* [dpdk-stable] patch 'net/mlx5: fix Tx stats error counter definition' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (15 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix i40evf MAC filter table' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/mlx5: fix Tx stats error counter logic' " luca.boccassi
                   ` (50 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Shahaf Shuler; +Cc: Yongseok Koh, Nelio Laranjeiro, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 27f6f90e4cc763c87b2d51bde6075f9a4fa06722 Mon Sep 17 00:00:00 2001
From: Shahaf Shuler <shahafs@mellanox.com>
Date: Thu, 14 Sep 2017 13:50:37 +0300
Subject: [PATCH] net/mlx5: fix Tx stats error counter definition

[ upstream commit 9f9a48eb2978157954242e08acf81d7a26f38810 ]

The current Tx error counter counts, according to its description,
the total number of packets not sent when TX ring full. It is reported
to application as part of oerrors field.

The drop due to full ring is not the statistic that should be set on
oerrors field. Such number can be counted by the application using the
return value of the Tx burst function.
The number that should be set there is the number of packets the device
could not transmit in any way, even when it has resources.

Therefore, replace this counter to count the total number of failed
transmitted packets.

Fixes: 87011737b715 ("mlx5: add software counters")

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
---
 drivers/net/mlx5/mlx5_rxtx.h  | 2 +-
 drivers/net/mlx5/mlx5_stats.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h
index 909d80e6a..d3d6d6ac3 100644
--- a/drivers/net/mlx5/mlx5_rxtx.h
+++ b/drivers/net/mlx5/mlx5_rxtx.h
@@ -81,7 +81,7 @@ struct mlx5_txq_stats {
 	uint64_t opackets; /**< Total of successfully sent packets. */
 	uint64_t obytes; /**< Total of successfully sent bytes. */
 #endif
-	uint64_t odropped; /**< Total of packets not sent when TX ring full. */
+	uint64_t oerrors; /**< Total number of failed transmitted packets. */
 };
 
 /* Flow director queue structure. */
diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c
index f2b5781a9..79b184107 100644
--- a/drivers/net/mlx5/mlx5_stats.c
+++ b/drivers/net/mlx5/mlx5_stats.c
@@ -94,13 +94,13 @@ mlx5_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 			tmp.q_opackets[idx] += txq->stats.opackets;
 			tmp.q_obytes[idx] += txq->stats.obytes;
 #endif
-			tmp.q_errors[idx] += txq->stats.odropped;
+			tmp.q_errors[idx] += txq->stats.oerrors;
 		}
 #ifdef MLX5_PMD_SOFT_COUNTERS
 		tmp.opackets += txq->stats.opackets;
 		tmp.obytes += txq->stats.obytes;
 #endif
-		tmp.oerrors += txq->stats.odropped;
+		tmp.oerrors += txq->stats.oerrors;
 	}
 #ifndef MLX5_PMD_SOFT_COUNTERS
 	/* FIXME: retrieve and add hardware counters. */
-- 
2.11.0

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

* [dpdk-stable] patch 'net/mlx5: fix Tx stats error counter logic' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (16 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/mlx5: fix Tx stats error counter definition' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix packet count for PF' " luca.boccassi
                   ` (49 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Shahaf Shuler; +Cc: Yongseok Koh, Nelio Laranjeiro, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 0a3e50ffc2ffcf91360813c58fc3b3b42531125d Mon Sep 17 00:00:00 2001
From: Shahaf Shuler <shahafs@mellanox.com>
Date: Thu, 14 Sep 2017 13:50:38 +0300
Subject: [PATCH] net/mlx5: fix Tx stats error counter logic

[ upstream commit 24c14430cdc4556a30a1e608f67230e881718f7f ]

Tx error counter lacks the logic of incrementation, making it useless
for applications.

Fixes: 87011737b715 ("mlx5: add software counters")

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
---
 drivers/net/mlx5/mlx5_rxtx.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index 58926e39f..92e4fd53e 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -431,8 +431,10 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
 #ifdef MLX5_PMD_SOFT_COUNTERS
 		total_length = length;
 #endif
-		if (length < (MLX5_WQE_DWORD_SIZE + 2))
+		if (length < (MLX5_WQE_DWORD_SIZE + 2)) {
+			txq->stats.oerrors++;
 			break;
+		}
 		/* Update element. */
 		(*txq->elts)[elts_head] = buf;
 		elts_head = (elts_head + 1) & (elts_n - 1);
@@ -735,8 +737,10 @@ mlx5_tx_burst_mpw(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
 		if (max < segs_n + 1)
 			break;
 		/* Do not bother with large packets MPW cannot handle. */
-		if (segs_n > MLX5_MPW_DSEG_MAX)
+		if (segs_n > MLX5_MPW_DSEG_MAX) {
+			txq->stats.oerrors++;
 			break;
+		}
 		max -= segs_n;
 		--pkts_n;
 		/* Should we enable HW CKSUM offload */
@@ -941,8 +945,10 @@ mlx5_tx_burst_mpw_inline(void *dpdk_txq, struct rte_mbuf **pkts,
 		if (max < segs_n + 1)
 			break;
 		/* Do not bother with large packets MPW cannot handle. */
-		if (segs_n > MLX5_MPW_DSEG_MAX)
+		if (segs_n > MLX5_MPW_DSEG_MAX) {
+			txq->stats.oerrors++;
 			break;
+		}
 		max -= segs_n;
 		--pkts_n;
 		/* Should we enable HW CKSUM offload */
-- 
2.11.0

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

* [dpdk-stable] patch 'net/i40e: fix packet count for PF' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (17 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/mlx5: fix Tx stats error counter logic' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'test: fix assignment operation' " luca.boccassi
                   ` (48 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Qi Zhang; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 4bf705a7d74b0b4c1d82ad0821c43e32be15a5e5 Mon Sep 17 00:00:00 2001
From: Qi Zhang <qi.z.zhang@intel.com>
Date: Mon, 21 Aug 2017 04:05:35 +0800
Subject: [PATCH] net/i40e: fix packet count for PF

[ upstream commit 763de290cbd1dd4ed7f5319e4f5fa8a84d990e06 ]

Previously, for PF statistics we use VSI register for packet count
but use port's register for packet bytes, that cause inconsistent
situation of PF statistics when some VF is active, since it will
cover VF's packet bytes but not packet count.

The patch will take port register for PF packet count back, but still
exclude main vsi's discard packet count.
Just like previous fix, its still not perfect, (since RX packet number
is over counted when there is VF discard packet) but seems it make the
overall better.

Fixes: 9aace75fc82e ("i40e: fix statistics")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 267a39e42..5be7f0af6 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2376,13 +2376,14 @@ i40e_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 	/* call read registers - updates values, now write them to struct */
 	i40e_read_stats_registers(pf, hw);
 
-	stats->ipackets = pf->main_vsi->eth_stats.rx_unicast +
-			pf->main_vsi->eth_stats.rx_multicast +
-			pf->main_vsi->eth_stats.rx_broadcast -
+	stats->ipackets = ns->eth.rx_unicast +
+			ns->eth.rx_multicast +
+			ns->eth.rx_broadcast -
+			ns->eth.rx_discards -
 			pf->main_vsi->eth_stats.rx_discards;
-	stats->opackets = pf->main_vsi->eth_stats.tx_unicast +
-			pf->main_vsi->eth_stats.tx_multicast +
-			pf->main_vsi->eth_stats.tx_broadcast;
+	stats->opackets = ns->eth.tx_unicast +
+			ns->eth.tx_multicast +
+			ns->eth.tx_broadcast;
 	stats->ibytes   = ns->eth.rx_bytes;
 	stats->obytes   = ns->eth.tx_bytes;
 	stats->oerrors  = ns->eth.tx_errors +
-- 
2.11.0

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

* [dpdk-stable] patch 'test: fix assignment operation' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (18 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix packet count for PF' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/igb: fix memcpy length' " luca.boccassi
                   ` (47 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Zhiyong Yang; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 9298a2f373ba523e38946db220ca075b16346a8e Mon Sep 17 00:00:00 2001
From: Zhiyong Yang <zhiyong.yang@intel.com>
Date: Fri, 15 Sep 2017 10:35:57 +0800
Subject: [PATCH] test: fix assignment operation

[ upstream commit e19e163d27dfc342bf58e49c605fededa6cfc6fb ]

This should be an comparison operation rather than an assignment
operation.

Fixes: 5e41ab250dfa ("app/test: unit tests for bonding mode 4")

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 app/test/test_link_bonding_mode4.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test/test_link_bonding_mode4.c b/app/test/test_link_bonding_mode4.c
index 292ea3d06..339671120 100644
--- a/app/test/test_link_bonding_mode4.c
+++ b/app/test/test_link_bonding_mode4.c
@@ -659,7 +659,7 @@ bond_handshake(void)
 	TEST_ASSERT_EQUAL(all_slaves_done, 1, "Bond handshake failed\n");
 
 	/* If flags doesn't match - report failure */
-	return all_slaves_done = 1 ? TEST_SUCCESS : TEST_FAILED;
+	return all_slaves_done == 1 ? TEST_SUCCESS : TEST_FAILED;
 }
 
 #define TEST_LACP_SLAVE_COUT RTE_DIM(test_params.slave_ports)
-- 
2.11.0

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

* [dpdk-stable] patch 'net/igb: fix memcpy length' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (19 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'test: fix assignment operation' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e/base: fix bool definition' " luca.boccassi
                   ` (46 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Yong Wang; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 664e5db471ca1fb9ccf51f23ee33ae4adc1492bf Mon Sep 17 00:00:00 2001
From: Yong Wang <wang.yong19@zte.com.cn>
Date: Tue, 12 Sep 2017 08:44:00 -0400
Subject: [PATCH] net/igb: fix memcpy length

[ upstream commit 671f8776871d2e46c0619c743a82b2f6f6ce58ec ]

The size of "flex_filter.filter_info.mask" and "filter->mask" are 16
bytes, but the length of memcpy--"RTE_ALIGN(filter->len, sizeof(char))
/ sizeof(char)" may reach 128 bytes which may cause array access out
of bound.

Fix it by replacing "sizeof(char)" by "CHAR_BIT".

Fixes: 231d43909a31 ("igb: migrate flex filter to new API")

Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 drivers/net/e1000/igb_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 9cf619faf..d16be9e1b 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -3839,7 +3839,7 @@ eth_igb_get_flex_filter(struct rte_eth_dev *dev,
 	flex_filter.filter_info.priority = filter->priority;
 	memcpy(flex_filter.filter_info.dwords, filter->bytes, filter->len);
 	memcpy(flex_filter.filter_info.mask, filter->mask,
-			RTE_ALIGN(filter->len, sizeof(char)) / sizeof(char));
+			RTE_ALIGN(filter->len, CHAR_BIT) / CHAR_BIT);
 
 	it = eth_igb_flex_filter_lookup(&filter_info->flex_list,
 				&flex_filter.filter_info);
-- 
2.11.0

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

* [dpdk-stable] patch 'net/i40e/base: fix bool definition' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (20 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/igb: fix memcpy length' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix variable assignment' " luca.boccassi
                   ` (45 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Jingjing Wu; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 796e6cca1fcdf15d1886b99f53cf749bbfd74782 Mon Sep 17 00:00:00 2001
From: Jingjing Wu <jingjing.wu@intel.com>
Date: Tue, 19 Sep 2017 02:11:28 +0800
Subject: [PATCH] net/i40e/base: fix bool definition

[ upstream commit c7755aef465f3d596d92b09b71f4c4b3e52027a9 ]

Use stdbool.h instead of defining the bool type, to make
sure the virtchnnl msg format definition is the same
between PF and VF.

Fixes: 4861cde46116 ("i40e: new poll mode driver")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
---
 drivers/net/i40e/base/i40e_osdep.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/i40e/base/i40e_osdep.h b/drivers/net/i40e/base/i40e_osdep.h
index 38e7ba5b1..67f2946e3 100644
--- a/drivers/net/i40e/base/i40e_osdep.h
+++ b/drivers/net/i40e/base/i40e_osdep.h
@@ -35,6 +35,7 @@
 
 #include <string.h>
 #include <stdint.h>
+#include <stdbool.h>
 #include <stdio.h>
 #include <stdarg.h>
 
@@ -56,7 +57,6 @@ typedef uint16_t        u16;
 typedef uint32_t        u32;
 typedef int32_t         s32;
 typedef uint64_t        u64;
-typedef int             bool;
 
 typedef enum i40e_status_code i40e_status;
 #define __iomem
-- 
2.11.0

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

* [dpdk-stable] patch 'net/i40e: fix variable assignment' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (21 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e/base: fix bool definition' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/qede/base: fix to use a passed ptt handle' " luca.boccassi
                   ` (44 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Jingjing Wu; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From c4744728af582f24a7e8df700de78847aef06854 Mon Sep 17 00:00:00 2001
From: Jingjing Wu <jingjing.wu@intel.com>
Date: Tue, 19 Sep 2017 02:53:06 +0800
Subject: [PATCH] net/i40e: fix variable assignment

[ upstream commit 9df0826a42e890006c77861c74b79907f33b8201 ]

rx/tx_queue_setup functions are shared between PF and VF
drivers. So the var 'pf' should not be assigned at the beginning.
This patch fixes the issue, and also corrects the return err code.

Fixes: b6583ee40265 ("i40e: full VMDQ pools support")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
---
 drivers/net/i40e/i40e_rxtx.c | 84 +++++++++++++++++++++++---------------------
 1 file changed, 43 insertions(+), 41 deletions(-)

diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index ba33b2a58..d1dd434ca 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -1646,36 +1646,42 @@ i40e_dev_rx_queue_setup(struct rte_eth_dev *dev,
 			const struct rte_eth_rxconf *rx_conf,
 			struct rte_mempool *mp)
 {
-	struct i40e_vsi *vsi;
 	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
 	struct i40e_adapter *ad =
 		I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
+	struct i40e_vsi *vsi;
+	struct i40e_pf *pf = NULL;
+	struct i40e_vf *vf = NULL;
 	struct i40e_rx_queue *rxq;
 	const struct rte_memzone *rz;
 	uint32_t ring_size;
 	uint16_t len, i;
-	uint16_t base, bsf, tc_mapping;
-	int use_def_burst_func = 1;
+	uint16_t reg_idx, base, bsf, tc_mapping;
+	int q_offset, use_def_burst_func = 1;
 
 	if (hw->mac.type == I40E_MAC_VF || hw->mac.type == I40E_MAC_X722_VF) {
-		struct i40e_vf *vf =
-			I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
+		vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 		vsi = &vf->vsi;
-	} else
+		if (!vsi)
+			return -EINVAL;
+		reg_idx = queue_idx;
+	} else {
+		pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
 		vsi = i40e_pf_get_vsi_by_qindex(pf, queue_idx);
-
-	if (vsi == NULL) {
-		PMD_DRV_LOG(ERR, "VSI not available or queue "
-			    "index exceeds the maximum");
-		return I40E_ERR_PARAM;
+		if (!vsi)
+			return -EINVAL;
+		q_offset = i40e_get_queue_offset_by_qindex(pf, queue_idx);
+		if (q_offset < 0)
+			return -EINVAL;
+		reg_idx = vsi->base_queue + q_offset;
 	}
+
 	if (nb_desc % I40E_ALIGN_RING_DESC != 0 ||
-			(nb_desc > I40E_MAX_RING_DESC) ||
-			(nb_desc < I40E_MIN_RING_DESC)) {
+	    (nb_desc > I40E_MAX_RING_DESC) ||
+	    (nb_desc < I40E_MIN_RING_DESC)) {
 		PMD_DRV_LOG(ERR, "Number (%u) of receive descriptors is "
 			    "invalid", nb_desc);
-		return I40E_ERR_PARAM;
+		return -EINVAL;
 	}
 
 	/* Free memory if needed */
@@ -1698,12 +1704,7 @@ i40e_dev_rx_queue_setup(struct rte_eth_dev *dev,
 	rxq->nb_rx_desc = nb_desc;
 	rxq->rx_free_thresh = rx_conf->rx_free_thresh;
 	rxq->queue_id = queue_idx;
-	if (hw->mac.type == I40E_MAC_VF || hw->mac.type == I40E_MAC_X722_VF)
-		rxq->reg_idx = queue_idx;
-	else /* PF device */
-		rxq->reg_idx = vsi->base_queue +
-			i40e_get_queue_offset_by_qindex(pf, queue_idx);
-
+	rxq->reg_idx = reg_idx;
 	rxq->port_id = dev->data->port_id;
 	rxq->crc_len = (uint8_t) ((dev->data->dev_conf.rxmode.hw_strip_crc) ?
 							0 : ETHER_CRC_LEN);
@@ -1862,34 +1863,40 @@ i40e_dev_tx_queue_setup(struct rte_eth_dev *dev,
 			unsigned int socket_id,
 			const struct rte_eth_txconf *tx_conf)
 {
-	struct i40e_vsi *vsi;
 	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
+	struct i40e_vsi *vsi;
+	struct i40e_pf *pf = NULL;
+	struct i40e_vf *vf = NULL;
 	struct i40e_tx_queue *txq;
 	const struct rte_memzone *tz;
 	uint32_t ring_size;
 	uint16_t tx_rs_thresh, tx_free_thresh;
-	uint16_t i, base, bsf, tc_mapping;
+	uint16_t reg_idx, i, base, bsf, tc_mapping;
+	int q_offset;
 
 	if (hw->mac.type == I40E_MAC_VF || hw->mac.type == I40E_MAC_X722_VF) {
-		struct i40e_vf *vf =
-			I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
+		vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 		vsi = &vf->vsi;
-	} else
+		if (!vsi)
+			return -EINVAL;
+		reg_idx = queue_idx;
+	} else {
+		pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
 		vsi = i40e_pf_get_vsi_by_qindex(pf, queue_idx);
-
-	if (vsi == NULL) {
-		PMD_DRV_LOG(ERR, "VSI is NULL, or queue index (%u) "
-			    "exceeds the maximum", queue_idx);
-		return I40E_ERR_PARAM;
+		if (!vsi)
+			return -EINVAL;
+		q_offset = i40e_get_queue_offset_by_qindex(pf, queue_idx);
+		if (q_offset < 0)
+			return -EINVAL;
+		reg_idx = vsi->base_queue + q_offset;
 	}
 
 	if (nb_desc % I40E_ALIGN_RING_DESC != 0 ||
-			(nb_desc > I40E_MAX_RING_DESC) ||
-			(nb_desc < I40E_MIN_RING_DESC)) {
+	    (nb_desc > I40E_MAX_RING_DESC) ||
+	    (nb_desc < I40E_MIN_RING_DESC)) {
 		PMD_DRV_LOG(ERR, "Number (%u) of transmit descriptors is "
 			    "invalid", nb_desc);
-		return I40E_ERR_PARAM;
+		return -EINVAL;
 	}
 
 	/**
@@ -1998,12 +2005,7 @@ i40e_dev_tx_queue_setup(struct rte_eth_dev *dev,
 	txq->hthresh = tx_conf->tx_thresh.hthresh;
 	txq->wthresh = tx_conf->tx_thresh.wthresh;
 	txq->queue_id = queue_idx;
-	if (hw->mac.type == I40E_MAC_VF || hw->mac.type == I40E_MAC_X722_VF)
-		txq->reg_idx = queue_idx;
-	else /* PF device */
-		txq->reg_idx = vsi->base_queue +
-			i40e_get_queue_offset_by_qindex(pf, queue_idx);
-
+	txq->reg_idx = reg_idx;
 	txq->port_id = dev->data->port_id;
 	txq->txq_flags = tx_conf->txq_flags;
 	txq->vsi = vsi;
-- 
2.11.0

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

* [dpdk-stable] patch 'net/qede/base: fix to use a passed ptt handle' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (22 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix variable assignment' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/qede/base: fix macros to check chip revision/metal' " luca.boccassi
                   ` (43 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Rasesh Mody; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From d7181de7fc09659b2f92b38ecf33c73cd6aed26b Mon Sep 17 00:00:00 2001
From: Rasesh Mody <rasesh.mody@cavium.com>
Date: Mon, 18 Sep 2017 18:29:50 -0700
Subject: [PATCH] net/qede/base: fix to use a passed ptt handle

[ upstream commit 544927f9a43fe1318b7d347982050f2a6fe4692c ]

Fix ecore_configure_vp_wfq_on_link_change() to use a provided ptt[PF
translation table] handle instead of directly using p_dpc_ptt

Fixes: ec94dbc57362 ("qede: add base driver")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
 drivers/net/qede/base/ecore.h     | 1 +
 drivers/net/qede/base/ecore_dev.c | 4 ++--
 drivers/net/qede/base/ecore_mcp.c | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/qede/base/ecore.h b/drivers/net/qede/base/ecore.h
index 907b35b97..fce87e2f9 100644
--- a/drivers/net/qede/base/ecore.h
+++ b/drivers/net/qede/base/ecore.h
@@ -804,6 +804,7 @@ static OSAL_INLINE u8 ecore_concrete_to_sw_fid(struct ecore_dev *p_dev,
 
 int ecore_configure_vport_wfq(struct ecore_dev *p_dev, u16 vp_id, u32 rate);
 void ecore_configure_vp_wfq_on_link_change(struct ecore_dev *p_dev,
+					   struct ecore_ptt *p_ptt,
 					   u32 min_pf_rate);
 
 int ecore_configure_pf_max_bandwidth(struct ecore_dev *p_dev, u8 max_bw);
diff --git a/drivers/net/qede/base/ecore_dev.c b/drivers/net/qede/base/ecore_dev.c
index 6060f9eee..76255bd01 100644
--- a/drivers/net/qede/base/ecore_dev.c
+++ b/drivers/net/qede/base/ecore_dev.c
@@ -4111,6 +4111,7 @@ int ecore_configure_vport_wfq(struct ecore_dev *p_dev, u16 vp_id, u32 rate)
 
 /* API to configure WFQ from mcp link change */
 void ecore_configure_vp_wfq_on_link_change(struct ecore_dev *p_dev,
+					   struct ecore_ptt *p_ptt,
 					   u32 min_pf_rate)
 {
 	int i;
@@ -4125,8 +4126,7 @@ void ecore_configure_vp_wfq_on_link_change(struct ecore_dev *p_dev,
 	for_each_hwfn(p_dev, i) {
 		struct ecore_hwfn *p_hwfn = &p_dev->hwfns[i];
 
-		__ecore_configure_vp_wfq_on_link_change(p_hwfn,
-							p_hwfn->p_dpc_ptt,
+		__ecore_configure_vp_wfq_on_link_change(p_hwfn, p_ptt,
 							min_pf_rate);
 	}
 }
diff --git a/drivers/net/qede/base/ecore_mcp.c b/drivers/net/qede/base/ecore_mcp.c
index 2ff97155c..fad074667 100644
--- a/drivers/net/qede/base/ecore_mcp.c
+++ b/drivers/net/qede/base/ecore_mcp.c
@@ -746,7 +746,7 @@ static void ecore_mcp_handle_link_change(struct ecore_hwfn *p_hwfn,
 	/* Mintz bandwidth configuration */
 	__ecore_configure_pf_min_bandwidth(p_hwfn, p_ptt,
 					   p_link, min_bw);
-	ecore_configure_vp_wfq_on_link_change(p_hwfn->p_dev,
+	ecore_configure_vp_wfq_on_link_change(p_hwfn->p_dev, p_ptt,
 					      p_link->min_pf_rate);
 
 	p_link->an = !!(status & LINK_STATUS_AUTO_NEGOTIATE_ENABLED);
-- 
2.11.0

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

* [dpdk-stable] patch 'net/qede/base: fix macros to check chip revision/metal' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (23 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/qede/base: fix to use a passed ptt handle' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/qede/base: fix API return types' " luca.boccassi
                   ` (42 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Rasesh Mody; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From cacebaeef1f89cc81f018211e660ecd6a1a574b9 Mon Sep 17 00:00:00 2001
From: Rasesh Mody <rasesh.mody@cavium.com>
Date: Mon, 18 Sep 2017 18:30:09 -0700
Subject: [PATCH] net/qede/base: fix macros to check chip revision/metal

[ upstream commit 3b212853e478e45490668ea054ec351da1fbda43 ]

Fix the ECORE_IS_[AB]0() macros to check both the chip revision and the
chip metal. Realign defines in the struct ecore_dev.

Fixes: ec94dbc57362 ("qede: add base driver")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
 drivers/net/qede/base/ecore.h     | 78 +++++++++++++++++++--------------------
 drivers/net/qede/base/ecore_dev.c | 25 ++++++-------
 drivers/net/qede/base/ecore_vf.c  |  2 +-
 3 files changed, 51 insertions(+), 54 deletions(-)

diff --git a/drivers/net/qede/base/ecore.h b/drivers/net/qede/base/ecore.h
index fce87e2f9..e2da8aaca 100644
--- a/drivers/net/qede/base/ecore.h
+++ b/drivers/net/qede/base/ecore.h
@@ -624,45 +624,45 @@ struct ecore_dev {
 	u16 device_id;
 
 	u16				chip_num;
-	#define CHIP_NUM_MASK			0xffff
-	#define CHIP_NUM_SHIFT			16
+#define CHIP_NUM_MASK			0xffff
+#define CHIP_NUM_SHIFT			0
 
-	u16				chip_rev;
-	#define CHIP_REV_MASK			0xf
-	#define CHIP_REV_SHIFT			12
+	u8				chip_rev;
+#define CHIP_REV_MASK			0xf
+#define CHIP_REV_SHIFT			0
 #ifndef ASIC_ONLY
-	#define CHIP_REV_IS_TEDIBEAR(_p_dev) ((_p_dev)->chip_rev == 0x5)
-	#define CHIP_REV_IS_EMUL_A0(_p_dev) ((_p_dev)->chip_rev == 0xe)
-	#define CHIP_REV_IS_EMUL_B0(_p_dev) ((_p_dev)->chip_rev == 0xc)
-	#define CHIP_REV_IS_EMUL(_p_dev) (CHIP_REV_IS_EMUL_A0(_p_dev) || \
-					  CHIP_REV_IS_EMUL_B0(_p_dev))
-	#define CHIP_REV_IS_FPGA_A0(_p_dev) ((_p_dev)->chip_rev == 0xf)
-	#define CHIP_REV_IS_FPGA_B0(_p_dev) ((_p_dev)->chip_rev == 0xd)
-	#define CHIP_REV_IS_FPGA(_p_dev) (CHIP_REV_IS_FPGA_A0(_p_dev) || \
-					  CHIP_REV_IS_FPGA_B0(_p_dev))
-	#define CHIP_REV_IS_SLOW(_p_dev) \
-		(CHIP_REV_IS_EMUL(_p_dev) || CHIP_REV_IS_FPGA(_p_dev))
-	#define CHIP_REV_IS_A0(_p_dev) \
-		(CHIP_REV_IS_EMUL_A0(_p_dev) || \
-		 CHIP_REV_IS_FPGA_A0(_p_dev) || \
-		 !(_p_dev)->chip_rev)
-	#define CHIP_REV_IS_B0(_p_dev) \
-		(CHIP_REV_IS_EMUL_B0(_p_dev) || \
-		 CHIP_REV_IS_FPGA_B0(_p_dev) || \
-		 (_p_dev)->chip_rev == 1)
-	#define CHIP_REV_IS_ASIC(_p_dev) !CHIP_REV_IS_SLOW(_p_dev)
+#define CHIP_REV_IS_TEDIBEAR(_p_dev)	((_p_dev)->chip_rev == 0x5)
+#define CHIP_REV_IS_EMUL_A0(_p_dev)	((_p_dev)->chip_rev == 0xe)
+#define CHIP_REV_IS_EMUL_B0(_p_dev)	((_p_dev)->chip_rev == 0xc)
+#define CHIP_REV_IS_EMUL(_p_dev) \
+	(CHIP_REV_IS_EMUL_A0(_p_dev) || CHIP_REV_IS_EMUL_B0(_p_dev))
+#define CHIP_REV_IS_FPGA_A0(_p_dev)	((_p_dev)->chip_rev == 0xf)
+#define CHIP_REV_IS_FPGA_B0(_p_dev)	((_p_dev)->chip_rev == 0xd)
+#define CHIP_REV_IS_FPGA(_p_dev) \
+	(CHIP_REV_IS_FPGA_A0(_p_dev) || CHIP_REV_IS_FPGA_B0(_p_dev))
+#define CHIP_REV_IS_SLOW(_p_dev) \
+	(CHIP_REV_IS_EMUL(_p_dev) || CHIP_REV_IS_FPGA(_p_dev))
+#define CHIP_REV_IS_A0(_p_dev) \
+	(CHIP_REV_IS_EMUL_A0(_p_dev) || CHIP_REV_IS_FPGA_A0(_p_dev) || \
+	 (!(_p_dev)->chip_rev && !(_p_dev)->chip_metal))
+#define CHIP_REV_IS_B0(_p_dev) \
+	(CHIP_REV_IS_EMUL_B0(_p_dev) || CHIP_REV_IS_FPGA_B0(_p_dev) || \
+	 ((_p_dev)->chip_rev == 1 && !(_p_dev)->chip_metal))
+#define CHIP_REV_IS_ASIC(_p_dev)	!CHIP_REV_IS_SLOW(_p_dev)
 #else
-	#define CHIP_REV_IS_A0(_p_dev)	(!(_p_dev)->chip_rev)
-	#define CHIP_REV_IS_B0(_p_dev)	((_p_dev)->chip_rev == 1)
+#define CHIP_REV_IS_A0(_p_dev) \
+	(!(_p_dev)->chip_rev && !(_p_dev)->chip_metal)
+#define CHIP_REV_IS_B0(_p_dev) \
+	((_p_dev)->chip_rev == 1 && !(_p_dev)->chip_metal)
 #endif
 
-	u16				chip_metal;
-	#define CHIP_METAL_MASK			0xff
-	#define CHIP_METAL_SHIFT		4
+	u8				chip_metal;
+#define CHIP_METAL_MASK			0xff
+#define CHIP_METAL_SHIFT		0
 
-	u16				chip_bond_id;
-	#define CHIP_BOND_ID_MASK		0xf
-	#define CHIP_BOND_ID_SHIFT		0
+	u8				chip_bond_id;
+#define CHIP_BOND_ID_MASK		0xff
+#define CHIP_BOND_ID_SHIFT		0
 
 	u8				num_engines;
 	u8				num_ports_in_engines;
@@ -670,12 +670,12 @@ struct ecore_dev {
 
 	u8				path_id;
 	enum ecore_mf_mode		mf_mode;
-	#define IS_MF_DEFAULT(_p_hwfn)	\
-			(((_p_hwfn)->p_dev)->mf_mode == ECORE_MF_DEFAULT)
-	#define IS_MF_SI(_p_hwfn)	\
-			(((_p_hwfn)->p_dev)->mf_mode == ECORE_MF_NPAR)
-	#define IS_MF_SD(_p_hwfn)	\
-			(((_p_hwfn)->p_dev)->mf_mode == ECORE_MF_OVLAN)
+#define IS_MF_DEFAULT(_p_hwfn)	\
+	(((_p_hwfn)->p_dev)->mf_mode == ECORE_MF_DEFAULT)
+#define IS_MF_SI(_p_hwfn)	\
+	(((_p_hwfn)->p_dev)->mf_mode == ECORE_MF_NPAR)
+#define IS_MF_SD(_p_hwfn)	\
+	(((_p_hwfn)->p_dev)->mf_mode == ECORE_MF_OVLAN)
 
 	int				pcie_width;
 	int				pcie_speed;
diff --git a/drivers/net/qede/base/ecore_dev.c b/drivers/net/qede/base/ecore_dev.c
index 76255bd01..d2dc044dc 100644
--- a/drivers/net/qede/base/ecore_dev.c
+++ b/drivers/net/qede/base/ecore_dev.c
@@ -2856,12 +2856,10 @@ static enum _ecore_status_t ecore_get_dev_info(struct ecore_dev *p_dev)
 	else
 		p_dev->type = ECORE_DEV_TYPE_BB;
 
-	p_dev->chip_num = (u16)ecore_rd(p_hwfn, p_hwfn->p_main_ptt,
-					 MISCS_REG_CHIP_NUM);
-	p_dev->chip_rev = (u16)ecore_rd(p_hwfn, p_hwfn->p_main_ptt,
-					 MISCS_REG_CHIP_REV);
-
-	MASK_FIELD(CHIP_REV, p_dev->chip_rev);
+	tmp = ecore_rd(p_hwfn, p_hwfn->p_main_ptt, MISCS_REG_CHIP_NUM);
+	p_dev->chip_num = (u16)GET_FIELD(tmp, CHIP_NUM);
+	tmp = ecore_rd(p_hwfn, p_hwfn->p_main_ptt, MISCS_REG_CHIP_REV);
+	p_dev->chip_rev = (u8)GET_FIELD(tmp, CHIP_REV);
 
 	/* Learn number of HW-functions */
 	tmp = ecore_rd(p_hwfn, p_hwfn->p_main_ptt,
@@ -2885,20 +2883,19 @@ static enum _ecore_status_t ecore_get_dev_info(struct ecore_dev *p_dev)
 	}
 #endif
 
-	p_dev->chip_bond_id = ecore_rd(p_hwfn, p_hwfn->p_main_ptt,
-				       MISCS_REG_CHIP_TEST_REG) >> 4;
-	MASK_FIELD(CHIP_BOND_ID, p_dev->chip_bond_id);
-	p_dev->chip_metal = (u16)ecore_rd(p_hwfn, p_hwfn->p_main_ptt,
-					   MISCS_REG_CHIP_METAL);
-	MASK_FIELD(CHIP_METAL, p_dev->chip_metal);
+	tmp = ecore_rd(p_hwfn, p_hwfn->p_main_ptt, MISCS_REG_CHIP_TEST_REG);
+	p_dev->chip_bond_id = (u8)GET_FIELD(tmp, CHIP_BOND_ID);
+	tmp = ecore_rd(p_hwfn, p_hwfn->p_main_ptt, MISCS_REG_CHIP_METAL);
+	p_dev->chip_metal = (u8)GET_FIELD(tmp, CHIP_METAL);
+
 	DP_INFO(p_dev->hwfns,
-		"Chip details - %s%d, Num: %04x Rev: %04x Bond id: %04x Metal: %04x\n",
+		"Chip details - %s%d, Num: %04x Rev: %02x Bond id: %02x Metal: %02x\n",
 		ECORE_IS_BB(p_dev) ? "BB" : "AH",
 		CHIP_REV_IS_A0(p_dev) ? 0 : 1,
 		p_dev->chip_num, p_dev->chip_rev, p_dev->chip_bond_id,
 		p_dev->chip_metal);
 
-	if (ECORE_IS_BB(p_dev) && CHIP_REV_IS_A0(p_dev)) {
+	if (ECORE_IS_BB_A0(p_dev)) {
 		DP_NOTICE(p_dev->hwfns, false,
 			  "The chip type/rev (BB A0) is not supported!\n");
 		return ECORE_ABORTED;
diff --git a/drivers/net/qede/base/ecore_vf.c b/drivers/net/qede/base/ecore_vf.c
index be8b1ec4e..5ff8f28a4 100644
--- a/drivers/net/qede/base/ecore_vf.c
+++ b/drivers/net/qede/base/ecore_vf.c
@@ -325,7 +325,7 @@ static enum _ecore_status_t ecore_vf_pf_acquire(struct ecore_hwfn *p_hwfn)
 
 	/* get HW info */
 	p_hwfn->p_dev->type = resp->pfdev_info.dev_type;
-	p_hwfn->p_dev->chip_rev = resp->pfdev_info.chip_rev;
+	p_hwfn->p_dev->chip_rev = (u8)resp->pfdev_info.chip_rev;
 
 	DP_INFO(p_hwfn, "Chip details - %s%d\n",
 		ECORE_IS_BB(p_hwfn->p_dev) ? "BB" : "AH",
-- 
2.11.0

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

* [dpdk-stable] patch 'net/qede/base: fix API return types' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (24 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/qede/base: fix macros to check chip revision/metal' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/qede/base: fix number of app table entries' " luca.boccassi
                   ` (41 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Rasesh Mody; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From a80f1d0c3fc3959984319bc5e2c685ee112069e5 Mon Sep 17 00:00:00 2001
From: Rasesh Mody <rasesh.mody@cavium.com>
Date: Mon, 18 Sep 2017 18:51:25 -0700
Subject: [PATCH] net/qede/base: fix API return types

[ upstream commit 10409fabfc0596438429a06aade029379c3a5274 ]

- Turn ecore_ptt_get_hw_addr() into static
- Convert ecore_dcbx_get_operational_params() to void since we don't
  care about the return value

Fixes: 26ae839d06e9 ("qede: add DCBX support")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
 drivers/net/qede/base/ecore_dcbx.c |  6 ++----
 drivers/net/qede/base/ecore_hw.c   |  2 +-
 drivers/net/qede/base/ecore_hw.h   | 11 -----------
 3 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/drivers/net/qede/base/ecore_dcbx.c b/drivers/net/qede/base/ecore_dcbx.c
index 8175619ae..967cf6f75 100644
--- a/drivers/net/qede/base/ecore_dcbx.c
+++ b/drivers/net/qede/base/ecore_dcbx.c
@@ -619,7 +619,7 @@ ecore_dcbx_get_remote_params(struct ecore_hwfn *p_hwfn,
 	return ECORE_SUCCESS;
 }
 
-static enum _ecore_status_t
+static void
 ecore_dcbx_get_operational_params(struct ecore_hwfn *p_hwfn,
 				  struct ecore_ptt *p_ptt,
 				  struct ecore_dcbx_get *params)
@@ -644,7 +644,7 @@ ecore_dcbx_get_operational_params(struct ecore_hwfn *p_hwfn,
 	if (!enabled) {
 		p_operational->enabled = enabled;
 		p_operational->valid = false;
-		return ECORE_INVAL;
+		return;
 	}
 
 	p_data = &p_operational->params;
@@ -671,8 +671,6 @@ ecore_dcbx_get_operational_params(struct ecore_hwfn *p_hwfn,
 	p_operational->err = err;
 	p_operational->enabled = enabled;
 	p_operational->valid = true;
-
-	return rc;
 }
 
 static enum _ecore_status_t
diff --git a/drivers/net/qede/base/ecore_hw.c b/drivers/net/qede/base/ecore_hw.c
index 7f4db0a0d..3db5cc3be 100644
--- a/drivers/net/qede/base/ecore_hw.c
+++ b/drivers/net/qede/base/ecore_hw.c
@@ -133,7 +133,7 @@ void ecore_ptt_release(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt)
 	OSAL_SPIN_UNLOCK(&p_hwfn->p_ptt_pool->lock);
 }
 
-u32 ecore_ptt_get_hw_addr(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt)
+static u32 ecore_ptt_get_hw_addr(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt)
 {
 	/* The HW is using DWORDS and we need to translate it to Bytes */
 	return OSAL_LE32_TO_CPU(p_ptt->pxp.offset) << 2;
diff --git a/drivers/net/qede/base/ecore_hw.h b/drivers/net/qede/base/ecore_hw.h
index 0750b2ed4..c246f1882 100644
--- a/drivers/net/qede/base/ecore_hw.h
+++ b/drivers/net/qede/base/ecore_hw.h
@@ -98,17 +98,6 @@ enum _ecore_status_t ecore_ptt_pool_alloc(struct ecore_hwfn *p_hwfn);
 void ecore_ptt_pool_free(struct ecore_hwfn *p_hwfn);
 
 /**
- * @brief ecore_ptt_get_hw_addr - Get PTT's GRC/HW address
- *
- * @param p_hwfn
- * @param p_ptt
- *
- * @return u32
- */
-u32 ecore_ptt_get_hw_addr(struct ecore_hwfn	*p_hwfn,
-			  struct ecore_ptt	*p_ptt);
-
-/**
  * @brief ecore_ptt_get_bar_addr - Get PPT's external BAR address
  *
  * @param p_hwfn
-- 
2.11.0

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

* [dpdk-stable] patch 'net/qede/base: fix number of app table entries' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (25 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/qede/base: fix API return types' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix clear xstats bug in VF' " luca.boccassi
                   ` (40 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Rasesh Mody; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 76f3a0ae9ad5527d15667020a71222d2e0198be3 Mon Sep 17 00:00:00 2001
From: Rasesh Mody <rasesh.mody@cavium.com>
Date: Mon, 18 Sep 2017 18:51:30 -0700
Subject: [PATCH] net/qede/base: fix number of app table entries

[ upstream commit 211507c164bb02019a6eb0b5e794dbe36d4ed763 ]

Configure only the available/requested number of app entries rather
than max entries (DCBX_MAX_APP_PROTOCOL) in ecore_dcbx_get_app_data().
Also, fixed a minor issue where incorrect size value is being passed for
memcpy().

Fixes: 26ae839d06e9 ("qede: add DCBX support")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
 drivers/net/qede/base/ecore_dcbx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/qede/base/ecore_dcbx.c b/drivers/net/qede/base/ecore_dcbx.c
index 967cf6f75..8aa3c0b7b 100644
--- a/drivers/net/qede/base/ecore_dcbx.c
+++ b/drivers/net/qede/base/ecore_dcbx.c
@@ -437,7 +437,7 @@ ecore_dcbx_get_app_data(struct ecore_hwfn *p_hwfn,
 	p_params->app_error = ECORE_MFW_GET_FIELD(p_app->flags, DCBX_APP_ERROR);
 	p_params->num_app_entries = ECORE_MFW_GET_FIELD(p_app->flags,
 							DCBX_APP_NUM_ENTRIES);
-	for (i = 0; i < DCBX_MAX_APP_PROTOCOL; i++) {
+	for (i = 0; i < p_params->num_app_entries; i++) {
 		entry = &p_params->app_entry[i];
 		if (ieee) {
 			u8 sf_ieee;
@@ -1143,7 +1143,7 @@ ecore_dcbx_set_app_data(struct ecore_hwfn *p_hwfn,
 	p_app->flags |= (u32)p_params->num_app_entries <<
 					DCBX_APP_NUM_ENTRIES_SHIFT;
 
-	for (i = 0; i < DCBX_MAX_APP_PROTOCOL; i++) {
+	for (i = 0; i < p_params->num_app_entries; i++) {
 		entry = &p_app->app_pri_tbl[i].entry;
 		if (ieee) {
 			*entry &= ~DCBX_APP_SF_IEEE_MASK;
@@ -1338,7 +1338,7 @@ enum _ecore_status_t ecore_dcbx_get_config_params(struct ecore_hwfn *p_hwfn,
 	p_hwfn->p_dcbx_info->set.enabled = dcbx_info->operational.enabled;
 	OSAL_MEMCPY(&p_hwfn->p_dcbx_info->set.config.params,
 		    &dcbx_info->operational.params,
-		    sizeof(struct ecore_dcbx_admin_params));
+		    sizeof(p_hwfn->p_dcbx_info->set.config.params));
 	p_hwfn->p_dcbx_info->set.config.valid = true;
 
 	OSAL_MEMCPY(params, &p_hwfn->p_dcbx_info->set,
-- 
2.11.0

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

* [dpdk-stable] patch 'net/i40e: fix clear xstats bug in VF' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (26 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/qede/base: fix number of app table entries' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'app/testpmd: fix packet throughput after stats reset' " luca.boccassi
                   ` (39 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Wei Zhao; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From b6d081cac4065b8f1f82a957be3b057d976546b2 Mon Sep 17 00:00:00 2001
From: Wei Zhao <wei.zhao1@intel.com>
Date: Thu, 21 Sep 2017 14:32:22 +0800
Subject: [PATCH] net/i40e: fix clear xstats bug in VF

[ upstream commit 8210e9e0d805ee0f80d19149ac0b5799b52c0e13 ]

Clearing VSI stats done by setting an offset value to latest stats
and further stats values are subtracted from that offset.

This setting offset and baselining logic exists in PF driver, but for VF
there is no way to update its VSI offset in the PF.

So same baselining logic added into VF, also setting VSI offset in VF
fixed to support VF stats clear.

Fixes: da61cd0849766 ("i40evf: add extended stats")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 64 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 63 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index c01312228..e8819f576 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -952,16 +952,74 @@ i40evf_update_stats(struct rte_eth_dev *dev, struct i40e_eth_stats **pstats)
 	return 0;
 }
 
+static void
+i40evf_stat_update_48(uint64_t *offset,
+		   uint64_t *stat)
+{
+	if (*stat >= *offset)
+		*stat = *stat - *offset;
+	else
+		*stat = (uint64_t)((*stat +
+			((uint64_t)1 << I40E_48_BIT_WIDTH)) - *offset);
+
+	*stat &= I40E_48_BIT_MASK;
+}
+
+static void
+i40evf_stat_update_32(uint64_t *offset,
+		   uint64_t *stat)
+{
+	if (*stat >= *offset)
+		*stat = (uint64_t)(*stat - *offset);
+	else
+		*stat = (uint64_t)((*stat +
+			((uint64_t)1 << I40E_32_BIT_WIDTH)) - *offset);
+}
+
+static void
+i40evf_update_vsi_stats(struct i40e_vsi *vsi,
+					struct i40e_eth_stats *nes)
+{
+	struct i40e_eth_stats *oes = &vsi->eth_stats_offset;
+
+	i40evf_stat_update_48(&oes->rx_bytes,
+			    &nes->rx_bytes);
+	i40evf_stat_update_48(&oes->rx_unicast,
+			    &nes->rx_unicast);
+	i40evf_stat_update_48(&oes->rx_multicast,
+			    &nes->rx_multicast);
+	i40evf_stat_update_48(&oes->rx_broadcast,
+			    &nes->rx_broadcast);
+	i40evf_stat_update_32(&oes->rx_discards,
+				&nes->rx_discards);
+	i40evf_stat_update_32(&oes->rx_unknown_protocol,
+			    &nes->rx_unknown_protocol);
+	i40evf_stat_update_48(&oes->tx_bytes,
+			    &nes->tx_bytes);
+	i40evf_stat_update_48(&oes->tx_unicast,
+			    &nes->tx_unicast);
+	i40evf_stat_update_48(&oes->tx_multicast,
+			    &nes->tx_multicast);
+	i40evf_stat_update_48(&oes->tx_broadcast,
+			    &nes->tx_broadcast);
+	i40evf_stat_update_32(&oes->tx_errors, &nes->tx_errors);
+	i40evf_stat_update_32(&oes->tx_discards, &nes->tx_discards);
+}
+
 static int
 i40evf_get_statics(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 {
 	int ret;
 	struct i40e_eth_stats *pstats = NULL;
+	struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
+	struct i40e_vsi *vsi = &vf->vsi;
 
 	ret = i40evf_update_stats(dev, &pstats);
 	if (ret != 0)
 		return 0;
 
+	i40evf_update_vsi_stats(vsi, pstats);
+
 	stats->ipackets = pstats->rx_unicast + pstats->rx_multicast +
 						pstats->rx_broadcast;
 	stats->opackets = pstats->tx_broadcast + pstats->tx_multicast +
@@ -984,7 +1042,7 @@ i40evf_dev_xstats_reset(struct rte_eth_dev *dev)
 	i40evf_update_stats(dev, &pstats);
 
 	/* set stats offset base on current values */
-	vf->vsi.eth_stats_offset = vf->vsi.eth_stats;
+	vf->vsi.eth_stats_offset = *pstats;
 }
 
 static int i40evf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
@@ -1008,6 +1066,8 @@ static int i40evf_dev_xstats_get(struct rte_eth_dev *dev,
 	int ret;
 	unsigned i;
 	struct i40e_eth_stats *pstats = NULL;
+	struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
+	struct i40e_vsi *vsi = &vf->vsi;
 
 	if (n < I40EVF_NB_XSTATS)
 		return I40EVF_NB_XSTATS;
@@ -1019,6 +1079,8 @@ static int i40evf_dev_xstats_get(struct rte_eth_dev *dev,
 	if (!xstats)
 		return 0;
 
+	i40evf_update_vsi_stats(vsi, pstats);
+
 	/* loop over xstats array and values from pstats */
 	for (i = 0; i < I40EVF_NB_XSTATS; i++) {
 		xstats[i].id = i;
-- 
2.11.0

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

* [dpdk-stable] patch 'app/testpmd: fix packet throughput after stats reset' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (27 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix clear xstats bug in VF' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix mirror rule reset when port is closed' " luca.boccassi
                   ` (38 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Wei Zhao; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 1d6c8ed407f1e78cbbe7f9df54d3452db4221c40 Mon Sep 17 00:00:00 2001
From: Wei Zhao <wei.zhao1@intel.com>
Date: Thu, 21 Sep 2017 14:32:23 +0800
Subject: [PATCH] app/testpmd: fix packet throughput after stats reset

[ upstream commit 69986a823d789da3745ab6b4ca6d3e84fe76c1b1 ]

Testpmd calculates packet throughput by getting a diff of previous stats
value and current one.

If a stats clear called after previous sample taken, the diff will be
negative and throughput calculation will be wrong.

If current stats value is smaller than previous one, set throughput to
zero.

Fixes: 0e106980301d ("app/testpmd: show throughput in port stats")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 app/test-pmd/config.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 36c47ab51..56a7ec679 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -224,8 +224,10 @@ nic_stats_display(portid_t port_id)
 	if (diff_cycles > 0)
 		diff_cycles = prev_cycles[port_id] - diff_cycles;
 
-	diff_pkts_rx = stats.ipackets - prev_pkts_rx[port_id];
-	diff_pkts_tx = stats.opackets - prev_pkts_tx[port_id];
+	diff_pkts_rx = (stats.ipackets > prev_pkts_rx[port_id]) ?
+		(stats.ipackets - prev_pkts_rx[port_id]) : 0;
+	diff_pkts_tx = (stats.opackets > prev_pkts_tx[port_id]) ?
+		(stats.opackets - prev_pkts_tx[port_id]) : 0;
 	prev_pkts_rx[port_id] = stats.ipackets;
 	prev_pkts_tx[port_id] = stats.opackets;
 	mpps_rx = diff_cycles > 0 ?
-- 
2.11.0

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

* [dpdk-stable] patch 'net/i40e: fix mirror rule reset when port is closed' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (28 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'app/testpmd: fix packet throughput after stats reset' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/bnxt: fix an issue with broadcast traffic' " luca.boccassi
                   ` (37 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Wei Dai; +Cc: Lijuan Tu, Jingjing Wu, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 62766a6f94a552fa2b2379440f2f8801330932da Mon Sep 17 00:00:00 2001
From: Wei Dai <wei.dai@intel.com>
Date: Mon, 25 Sep 2017 14:36:53 +0800
Subject: [PATCH] net/i40e: fix mirror rule reset when port is closed

[ upstream commit 77a45aeb6b2b4f8dbf8ca53e8bfae8aa18382157 ]

When an i40e PF port is stopped, all mirror rules should be reserved.
But when an i40e PF port is closed, all mirror rules should be removed.
When a mirror rule is removed, its associated hardware and software
resource should also be removed.

Fixes: a4def5edf0fc ("i40e: enable port mirroring")

Signed-off-by: Wei Dai <wei.dai@intel.com>
Tested-by: Lijuan Tu <lijuanx.a.tu@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 36 ++++++++++++++++++++++++++++--------
 1 file changed, 28 insertions(+), 8 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 5be7f0af6..d63d5b483 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -422,6 +422,12 @@ static int i40e_dev_sync_phy_type(struct i40e_hw *hw);
 static void i40e_configure_registers(struct i40e_hw *hw);
 static void i40e_hw_init(struct rte_eth_dev *dev);
 static int i40e_config_qinq(struct i40e_hw *hw, struct i40e_vsi *vsi);
+static enum i40e_status_code i40e_aq_del_mirror_rule(struct i40e_hw *hw,
+						     uint16_t seid,
+						     uint16_t rule_type,
+						     uint16_t *entries,
+						     uint16_t count,
+						     uint16_t rule_id);
 static int i40e_mirror_rule_set(struct rte_eth_dev *dev,
 			struct rte_eth_mirror_conf *mirror_conf,
 			uint8_t sw_id, uint8_t on);
@@ -1819,7 +1825,6 @@ i40e_dev_stop(struct rte_eth_dev *dev)
 {
 	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
 	struct i40e_vsi *main_vsi = pf->main_vsi;
-	struct i40e_mirror_rule *p_mirror;
 	struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
 	int i;
 
@@ -1845,13 +1850,6 @@ i40e_dev_stop(struct rte_eth_dev *dev)
 	/* Set link down */
 	i40e_dev_set_link_down(dev);
 
-	/* Remove all mirror rules */
-	while ((p_mirror = TAILQ_FIRST(&pf->mirror_list))) {
-		TAILQ_REMOVE(&pf->mirror_list, p_mirror, rules);
-		rte_free(p_mirror);
-	}
-	pf->nb_mirror_rule = 0;
-
 	if (!rte_intr_allow_others(intr_handle))
 		/* resume to the default handler */
 		rte_intr_callback_register(intr_handle,
@@ -1871,13 +1869,35 @@ i40e_dev_close(struct rte_eth_dev *dev)
 {
 	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
 	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	struct i40e_mirror_rule *p_mirror;
 	uint32_t reg;
 	int i;
+	int ret;
 
 	PMD_INIT_FUNC_TRACE();
 
 	i40e_dev_stop(dev);
 	hw->adapter_stopped = 1;
+
+	/* Remove all mirror rules */
+	while ((p_mirror = TAILQ_FIRST(&pf->mirror_list))) {
+		ret = i40e_aq_del_mirror_rule(hw,
+					      pf->main_vsi->veb->seid,
+					      p_mirror->rule_type,
+					      p_mirror->entries,
+					      p_mirror->num_entries,
+					      p_mirror->id);
+		if (ret < 0)
+			PMD_DRV_LOG(ERR, "failed to remove mirror rule: "
+				    "status = %d, aq_err = %d.", ret,
+				    hw->aq.asq_last_status);
+
+		/* remove mirror software resource anyway */
+		TAILQ_REMOVE(&pf->mirror_list, p_mirror, rules);
+		rte_free(p_mirror);
+		pf->nb_mirror_rule--;
+	}
+
 	i40e_dev_free_queues(dev);
 
 	/* Disable interrupt */
-- 
2.11.0

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

* [dpdk-stable] patch 'net/bnxt: fix an issue with broadcast traffic' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (29 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix mirror rule reset when port is closed' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/bnxt: set checksum offload flags correctly' " luca.boccassi
                   ` (36 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Ajit Khaparde; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 0d122a5d3e6db1c24a907f11a7ed418195f58b71 Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Thu, 28 Sep 2017 16:43:28 -0500
Subject: [PATCH] net/bnxt: fix an issue with broadcast traffic

[ upstream commit a01a07286d112e8526facc47e03d10c44ffafd7b ]

In bnxt_hwrm_cfa_l2_set_rx_mask, we are ignoring the previous
setting of HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_BCAST and
setting it again, thereby wrongly enabling Broadcast.

Fixes: 244bc98b0da7 ("net/bnxt: set L2 Rx mask")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 93910d812..6fd024ada 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -177,8 +177,7 @@ int bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt *bp, struct bnxt_vnic_info *vnic)
 		mask = HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_PROMISCUOUS;
 	if (vnic->flags & BNXT_VNIC_INFO_ALLMULTI)
 		mask = HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ALL_MCAST;
-	req.mask = rte_cpu_to_le_32(HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_BCAST |
-				    mask);
+	req.mask = rte_cpu_to_le_32(mask);
 
 	rc = bnxt_hwrm_send_message(bp, &req, sizeof(req));
 
-- 
2.11.0

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

* [dpdk-stable] patch 'net/bnxt: set checksum offload flags correctly' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (30 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/bnxt: fix an issue with broadcast traffic' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/bnxt: update status of Rx IP/L4 CKSUM' " luca.boccassi
                   ` (35 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Ajit Khaparde; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 855594647de4d04f541dd2c865fc198f5a3b4e42 Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Thu, 28 Sep 2017 16:43:30 -0500
Subject: [PATCH] net/bnxt: set checksum offload flags correctly

[ upstream commit d644aa046a925acb2e7de22a12acf0ffaa4530e4 ]

We are not correctly setting hw checksum offload for all the
offload flags. This patch fixes that.

Fixes: 6eb3cc2294fd ("net/bnxt: add initial Tx code")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_txr.c | 32 +++++++++++++++++++++++++-------
 drivers/net/bnxt/bnxt_txr.h | 21 +++++++++++++++++++++
 2 files changed, 46 insertions(+), 7 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
index 8bf8fee31..c2f9ae78c 100644
--- a/drivers/net/bnxt/bnxt_txr.c
+++ b/drivers/net/bnxt/bnxt_txr.c
@@ -161,7 +161,7 @@ static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt,
 
 	if (tx_pkt->ol_flags & (PKT_TX_TCP_SEG | PKT_TX_TCP_CKSUM |
 				PKT_TX_UDP_CKSUM | PKT_TX_IP_CKSUM |
-				PKT_TX_VLAN_PKT))
+				PKT_TX_VLAN_PKT | PKT_TX_OUTER_IP_CKSUM))
 		long_bd = true;
 
 	tx_buf = &txr->tx_buf_ring[txr->tx_prod];
@@ -211,20 +211,38 @@ static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt,
 
 		if (tx_pkt->ol_flags & PKT_TX_TCP_SEG) {
 			/* TSO */
-			txbd1->lflags = TX_BD_LONG_LFLAGS_LSO;
+			txbd1->lflags |= TX_BD_LONG_LFLAGS_LSO;
 			txbd1->hdr_size = tx_pkt->l2_len + tx_pkt->l3_len +
 					tx_pkt->l4_len;
 			txbd1->mss = tx_pkt->tso_segsz;
 
-		} else if (tx_pkt->ol_flags & (PKT_TX_TCP_CKSUM |
-					PKT_TX_UDP_CKSUM)) {
+		} else if (tx_pkt->ol_flags & PKT_TX_OIP_IIP_TCP_UDP_CKSUM) {
+			/* Outer IP, Inner IP, Inner TCP/UDP CSO */
+			txbd1->lflags |= TX_BD_FLG_TIP_IP_TCP_UDP_CHKSUM;
+			txbd1->mss = 0;
+		} else if (tx_pkt->ol_flags & PKT_TX_IIP_TCP_UDP_CKSUM) {
+			/* (Inner) IP, (Inner) TCP/UDP CSO */
+			txbd1->lflags |= TX_BD_FLG_IP_TCP_UDP_CHKSUM;
+			txbd1->mss = 0;
+		} else if (tx_pkt->ol_flags & PKT_TX_OIP_TCP_UDP_CKSUM) {
+			/* Outer IP, (Inner) TCP/UDP CSO */
+			txbd1->lflags |= TX_BD_FLG_TIP_TCP_UDP_CHKSUM;
+			txbd1->mss = 0;
+		} else if (tx_pkt->ol_flags & PKT_TX_OIP_IIP_CKSUM) {
+			/* Outer IP, Inner IP CSO */
+			txbd1->lflags |= TX_BD_FLG_TIP_IP_CHKSUM;
+			txbd1->mss = 0;
+		} else if (tx_pkt->ol_flags & PKT_TX_TCP_UDP_CKSUM) {
 			/* TCP/UDP CSO */
-			txbd1->lflags = TX_BD_LONG_LFLAGS_TCP_UDP_CHKSUM;
+			txbd1->lflags |= TX_BD_LONG_LFLAGS_TCP_UDP_CHKSUM;
 			txbd1->mss = 0;
-
 		} else if (tx_pkt->ol_flags & PKT_TX_IP_CKSUM) {
 			/* IP CSO */
-			txbd1->lflags = TX_BD_LONG_LFLAGS_IP_CHKSUM;
+			txbd1->lflags |= TX_BD_LONG_LFLAGS_IP_CHKSUM;
+			txbd1->mss = 0;
+		} else if (tx_pkt->ol_flags & PKT_TX_OUTER_IP_CKSUM) {
+			/* IP CSO */
+			txbd1->lflags |= TX_BD_LONG_LFLAGS_T_IP_CHKSUM;
 			txbd1->mss = 0;
 		}
 	} else {
diff --git a/drivers/net/bnxt/bnxt_txr.h b/drivers/net/bnxt/bnxt_txr.h
index 4c16101be..cb961f1b9 100644
--- a/drivers/net/bnxt/bnxt_txr.h
+++ b/drivers/net/bnxt/bnxt_txr.h
@@ -69,4 +69,25 @@ int bnxt_init_tx_ring_struct(struct bnxt_tx_queue *txq, unsigned int socket_id);
 uint16_t bnxt_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 			       uint16_t nb_pkts);
 
+#define PKT_TX_OIP_IIP_TCP_UDP_CKSUM	(PKT_TX_TCP_CKSUM | PKT_TX_UDP_CKSUM | \
+					PKT_TX_IP_CKSUM | PKT_TX_OUTER_IP_CKSUM)
+#define PKT_TX_IIP_TCP_UDP_CKSUM	(PKT_TX_TCP_CKSUM | PKT_TX_UDP_CKSUM | \
+					PKT_TX_IP_CKSUM)
+#define PKT_TX_OIP_TCP_UDP_CKSUM	(PKT_TX_TCP_CKSUM | PKT_TX_UDP_CKSUM | \
+					PKT_TX_OUTER_IP_CKSUM)
+#define PKT_TX_OIP_IIP_CKSUM		(PKT_TX_IP_CKSUM |	\
+					 PKT_TX_OUTER_IP_CKSUM)
+#define PKT_TX_TCP_UDP_CKSUM		(PKT_TX_TCP_CKSUM | PKT_TX_UDP_CKSUM)
+
+
+#define TX_BD_FLG_TIP_IP_TCP_UDP_CHKSUM	(TX_BD_LONG_LFLAGS_TCP_UDP_CHKSUM | \
+					TX_BD_LONG_LFLAGS_T_IP_CHKSUM | \
+					TX_BD_LONG_LFLAGS_IP_CHKSUM)
+#define TX_BD_FLG_IP_TCP_UDP_CHKSUM	(TX_BD_LONG_LFLAGS_TCP_UDP_CHKSUM | \
+					TX_BD_LONG_LFLAGS_IP_CHKSUM)
+#define TX_BD_FLG_TIP_IP_CHKSUM		(TX_BD_LONG_LFLAGS_T_IP_CHKSUM | \
+					TX_BD_LONG_LFLAGS_IP_CHKSUM)
+#define TX_BD_FLG_TIP_TCP_UDP_CHKSUM	(TX_BD_LONG_LFLAGS_TCP_UDP_CHKSUM | \
+					TX_BD_LONG_LFLAGS_T_IP_CHKSUM)
+
 #endif
-- 
2.11.0

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

* [dpdk-stable] patch 'net/bnxt: update status of Rx IP/L4 CKSUM' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (31 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/bnxt: set checksum offload flags correctly' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/bnxt: fix interrupt handler' " luca.boccassi
                   ` (34 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Ajit Khaparde; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From c10c569b6fe90488d0d76d9dd04470e042464b83 Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Thu, 28 Sep 2017 16:43:31 -0500
Subject: [PATCH] net/bnxt: update status of Rx IP/L4 CKSUM

[ upstream commit 7ec39d8c524b87017745df03c961c1ef341c7cbb ]

update ol_flags with the appropriate status of IP/L4 cksum in Rx path.

Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_rxr.c | 11 +++++++++++
 drivers/net/bnxt/bnxt_rxr.h | 16 ++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index 5d93de265..980f3ec58 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -148,6 +148,17 @@ static uint16_t bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
 	}
 
 	rx_buf->mbuf = NULL;
+
+	if (likely(RX_CMP_IP_CS_OK(rxcmp1)))
+		mbuf->ol_flags |= PKT_RX_IP_CKSUM_GOOD;
+	else
+		mbuf->ol_flags |= PKT_RX_IP_CKSUM_NONE;
+
+	if (likely(RX_CMP_L4_CS_OK(rxcmp1)))
+		mbuf->ol_flags |= PKT_RX_L4_CKSUM_GOOD;
+	else
+		mbuf->ol_flags |= PKT_RX_L4_CKSUM_NONE;
+
 	if (rxcmp1->errors_v2 & RX_CMP_L2_ERRORS) {
 		/* Re-install the mbuf back to the rx ring */
 		bnxt_reuse_rx_mbuf(rxr, cons, mbuf);
diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h
index f766b26c3..111a21362 100644
--- a/drivers/net/bnxt/bnxt_rxr.h
+++ b/drivers/net/bnxt/bnxt_rxr.h
@@ -37,6 +37,22 @@
 #define B_RX_DB(db, prod)						\
 		(*(uint32_t *)db = (DB_KEY_RX | prod))
 
+#define RX_CMP_L4_CS_BITS	rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_L4_CS_CALC)
+
+#define RX_CMP_L4_CS_ERR_BITS	rte_cpu_to_le_32(RX_PKT_CMPL_ERRORS_L4_CS_ERROR)
+
+#define RX_CMP_L4_CS_OK(rxcmp1)						\
+	    (((rxcmp1)->flags2 & RX_CMP_L4_CS_BITS) &&		\
+	     !((rxcmp1)->errors_v2 & RX_CMP_L4_CS_ERR_BITS))
+
+#define RX_CMP_IP_CS_ERR_BITS	rte_cpu_to_le_32(RX_PKT_CMPL_ERRORS_IP_CS_ERROR)
+
+#define RX_CMP_IP_CS_BITS	rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_IP_CS_CALC)
+
+#define RX_CMP_IP_CS_OK(rxcmp1)						\
+		(((rxcmp1)->flags2 & RX_CMP_IP_CS_BITS) &&	\
+		!((rxcmp1)->errors_v2 & RX_CMP_IP_CS_ERR_BITS))
+
 struct bnxt_sw_rx_bd {
 	struct rte_mbuf		*mbuf; /* data associated with RX descriptor */
 };
-- 
2.11.0

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

* [dpdk-stable] patch 'net/bnxt: fix interrupt handler' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (32 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/bnxt: update status of Rx IP/L4 CKSUM' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/vmxnet3: fix dereference before null check' " luca.boccassi
                   ` (33 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Ajit Khaparde; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 49bc598713e936fcf09e20edade0902588579a4d Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Thu, 28 Sep 2017 16:43:42 -0500
Subject: [PATCH] net/bnxt: fix interrupt handler

[ upstream commit f7ecea911ec52fc94aba82cc65211e613f8b56df ]

In some cases the interrupt handler is accessing cpr, which has
already been freed causing segfaults. This patch avoids such accesses.

Fixes: 7bc8e9a227cc ("net/bnxt: support async link notification")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_cpr.c | 2 ++
 drivers/net/bnxt/bnxt_irq.c | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c
index 3aedcb8df..0139344ae 100644
--- a/drivers/net/bnxt/bnxt_cpr.c
+++ b/drivers/net/bnxt/bnxt_cpr.c
@@ -123,8 +123,10 @@ void bnxt_free_def_cp_ring(struct bnxt *bp)
 		return;
 
 	bnxt_free_ring(cpr->cp_ring_struct);
+	cpr->cp_ring_struct = NULL;
 	rte_free(cpr->cp_ring_struct);
 	rte_free(cpr);
+	bp->def_cp_ring = NULL;
 }
 
 /* For the default completion ring only */
diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c
index e93585a0b..7e1482782 100644
--- a/drivers/net/bnxt/bnxt_irq.c
+++ b/drivers/net/bnxt/bnxt_irq.c
@@ -56,6 +56,9 @@ static void bnxt_int_handler(struct rte_intr_handle *handle __rte_unused,
 	struct cmpl_base *cmp;
 
 	while (1) {
+		if (!cpr || !cpr->cp_ring_struct)
+			return;
+
 		cons = RING_CMP(cpr->cp_ring_struct, raw_cons);
 		cmp = &cpr->cp_desc_ring[cons];
 
-- 
2.11.0

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

* [dpdk-stable] patch 'net/vmxnet3: fix dereference before null check' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (33 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/bnxt: fix interrupt handler' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'uio: fix compilation with -Og' " luca.boccassi
                   ` (32 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Michal Jastrzebski; +Cc: Tomasz Kulasek, Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From e00ab55ead1f7be3f2fa90c5f347d97ccb972408 Mon Sep 17 00:00:00 2001
From: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
Date: Fri, 29 Sep 2017 15:04:02 +0200
Subject: [PATCH] net/vmxnet3: fix dereference before null check

[ upstream commit 4d0833e6f8d4c9814b0c8fa1a2f8ed2263ae4856 ]

Coverity reports check_after_deref:
Null-checking rq suggests that it may be null, but it
has already been dereferenced on all paths leading to
the check.
This patch removes NULL checking of "rq" from function
vmxnet3_dev_rx_queue_reset as it is already checked against NULL
one level up the callstack (function vmxnet3_dev_clear_queues).

Coverity issue: 143468
Fixes: 5aecdc17a97d ("vmxnet3: fix stop/restart")

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Signed-off-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 drivers/net/vmxnet3/vmxnet3_rxtx.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index 3056f4ff8..4762a4418 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -254,11 +254,9 @@ vmxnet3_dev_rx_queue_reset(void *rxq)
 	struct vmxnet3_comp_ring *comp_ring;
 	int size;
 
-	if (rq != NULL) {
-		/* Release both the cmd_rings mbufs */
-		for (i = 0; i < VMXNET3_RX_CMDRING_SIZE; i++)
-			vmxnet3_rx_cmd_ring_release_mbufs(&rq->cmd_ring[i]);
-	}
+	/* Release both the cmd_rings mbufs */
+	for (i = 0; i < VMXNET3_RX_CMDRING_SIZE; i++)
+		vmxnet3_rx_cmd_ring_release_mbufs(&rq->cmd_ring[i]);
 
 	ring0 = &rq->cmd_ring[0];
 	ring1 = &rq->cmd_ring[1];
-- 
2.11.0

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

* [dpdk-stable] patch 'uio: fix compilation with -Og' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (34 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/vmxnet3: fix dereference before null check' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'cmdline: " luca.boccassi
                   ` (31 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Olivier Matz; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From fc95cbe18bcbbadd2e581fb49610659e06704b27 Mon Sep 17 00:00:00 2001
From: Olivier Matz <olivier.matz@6wind.com>
Date: Mon, 11 Sep 2017 17:13:28 +0200
Subject: [PATCH] uio: fix compilation with -Og
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 84585f330fc3d5296d9b660bb639ebc8c7bf2aff ]

The compilation with gcc-6.3.0 and EXTRA_CFLAGS=-Og gives the following
error:

  CC eal_pci_uio.o
  eal_pci_uio.c: In function ‘pci_get_uio_de ’:
  eal_pci_uio.c:221:9: error: ‘uio_num’ may be used uninitialized in
                       this function [-Werror=maybe-uninitialized]
  return uio_num;
         ^~~~~~~

This is a false positive: gcc is not able to see that when e != NULL,
uio_num is always set. Fix the warning by initializing uio_num to -1,
and by the way, change the type to int.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
 lib/librte_eal/linuxapp/eal/eal_pci_uio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
index aac05d7aa..42280678f 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
@@ -154,7 +154,7 @@ pci_get_uio_dev(struct rte_pci_device *dev, char *dstbuf,
 			   unsigned int buflen, int create)
 {
 	struct rte_pci_addr *loc = &dev->addr;
-	unsigned int uio_num;
+	int uio_num = -1;
 	struct dirent *e;
 	DIR *dir;
 	char dirname[PATH_MAX];
-- 
2.11.0

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

* [dpdk-stable] patch 'cmdline: fix compilation with -Og' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (35 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'uio: fix compilation with -Og' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'hash: fix eviction counter' " luca.boccassi
                   ` (30 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Olivier Matz; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 3e7b58053dc2ce8222eaaabbc055192b19a1bb93 Mon Sep 17 00:00:00 2001
From: Olivier Matz <olivier.matz@6wind.com>
Date: Mon, 11 Sep 2017 17:13:29 +0200
Subject: [PATCH] cmdline: fix compilation with -Og
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 1123f16eb37b19dcabe2b2313f99911c59df91f3 ]

The compilation with gcc-6.3.0 and EXTRA_CFLAGS=-Og gives the following
error:

  CC cmdline_parse.o
  cmdline_parse.c: In function ‘match_inst’:
  cmdline_parse.c:227:5: error: ‘token_p’ may be used uninitialized in
                         this function [-Werror=maybe-uninitialized]
    if (token_p) {
       ^

This is a false positive, gcc is not able to see that we always go in
the loop at least once, initializing token_p.

Fix the warning by initializing token_p to NULL.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
 lib/librte_cmdline/cmdline_parse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_cmdline/cmdline_parse.c b/lib/librte_cmdline/cmdline_parse.c
index b496067aa..28a7933ba 100644
--- a/lib/librte_cmdline/cmdline_parse.c
+++ b/lib/librte_cmdline/cmdline_parse.c
@@ -149,7 +149,7 @@ match_inst(cmdline_parse_inst_t *inst, const char *buf,
 	   unsigned int nb_match_token, void *resbuf, unsigned resbuf_size)
 {
 	unsigned int token_num=0;
-	cmdline_parse_token_hdr_t * token_p;
+	cmdline_parse_token_hdr_t *token_p = NULL;
 	unsigned int i=0;
 	int n = 0;
 	struct cmdline_token_hdr token_hdr;
-- 
2.11.0

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

* [dpdk-stable] patch 'hash: fix eviction counter' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (36 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'cmdline: " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'mem: fix malloc element free in debug mode' " luca.boccassi
                   ` (29 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Pablo de Lara; +Cc: Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 23859b268635a5329f6659a4f5530755050acb07 Mon Sep 17 00:00:00 2001
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Date: Fri, 22 Sep 2017 05:25:43 +0100
Subject: [PATCH] hash: fix eviction counter

[ upstream commit 98b8ec70604065f511aea0a567b039421bc524cc ]

When adding a new entry in a hash table, there is
a maximum number of evictions that can be
performed. When the counter of these evictions reaches
this maximum, the entry cannot be added, as it is considered
that the algorithm has encountered an infinite loop.

The problem with the current implementation, is that this
counter was declared as a static variable.
If there are multiple threads adding entries in the same table
or in different tables, they should access different counters,
one per core and per table.

Therefore, the variable has been modified to be non-static.

Fixes: 243e93a5046f ("hash: fix unlimited cuckoo path")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/librte_hash/rte_cuckoo_hash.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c
index 51db006a9..fb462d69e 100644
--- a/lib/librte_hash/rte_cuckoo_hash.c
+++ b/lib/librte_hash/rte_cuckoo_hash.c
@@ -417,9 +417,9 @@ rte_hash_reset(struct rte_hash *h)
 
 /* Search for an entry that can be pushed to its alternative location */
 static inline int
-make_space_bucket(const struct rte_hash *h, struct rte_hash_bucket *bkt)
+make_space_bucket(const struct rte_hash *h, struct rte_hash_bucket *bkt,
+		unsigned int *nr_pushes)
 {
-	static unsigned int nr_pushes;
 	unsigned i, j;
 	int ret;
 	uint32_t next_bucket_idx;
@@ -456,15 +456,14 @@ make_space_bucket(const struct rte_hash *h, struct rte_hash_bucket *bkt)
 			break;
 
 	/* All entries have been pushed, so entry cannot be added */
-	if (i == RTE_HASH_BUCKET_ENTRIES || nr_pushes > RTE_HASH_MAX_PUSHES)
+	if (i == RTE_HASH_BUCKET_ENTRIES || ++(*nr_pushes) > RTE_HASH_MAX_PUSHES)
 		return -ENOSPC;
 
 	/* Set flag to indicate that this entry is going to be pushed */
 	bkt->flag[i] = 1;
 
-	nr_pushes++;
 	/* Need room in alternative bucket to insert the pushed entry */
-	ret = make_space_bucket(h, next_bkt[i]);
+	ret = make_space_bucket(h, next_bkt[i], nr_pushes);
 	/*
 	 * After recursive function.
 	 * Clear flags and insert the pushed entry
@@ -472,7 +471,6 @@ make_space_bucket(const struct rte_hash *h, struct rte_hash_bucket *bkt)
 	 * or return error
 	 */
 	bkt->flag[i] = 0;
-	nr_pushes = 0;
 	if (ret >= 0) {
 		next_bkt[i]->sig_alt[ret] = bkt->sig_current[i];
 		next_bkt[i]->sig_current[ret] = bkt->sig_alt[i];
@@ -515,6 +513,7 @@ __rte_hash_add_key_with_hash(const struct rte_hash *h, const void *key,
 	unsigned n_slots;
 	unsigned lcore_id;
 	struct lcore_cache *cached_free_slots = NULL;
+	unsigned int nr_pushes = 0;
 
 	if (h->add_key == ADD_KEY_MULTIWRITER)
 		rte_spinlock_lock(h->multiwriter_lock);
@@ -643,7 +642,7 @@ __rte_hash_add_key_with_hash(const struct rte_hash *h, const void *key,
 		 * if successful or return error and
 		 * store the new slot back in the ring
 		 */
-		ret = make_space_bucket(h, prim_bkt);
+		ret = make_space_bucket(h, prim_bkt, &nr_pushes);
 		if (ret >= 0) {
 			prim_bkt->sig_current[ret] = sig;
 			prim_bkt->sig_alt[ret] = alt_hash;
-- 
2.11.0

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

* [dpdk-stable] patch 'mem: fix malloc element free in debug mode' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (37 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'hash: fix eviction counter' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'eal: copy raw strings taken from command line' " luca.boccassi
                   ` (28 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Xueming Li; +Cc: Sergio Gonzalez Monroy, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 98275cc75482e112c45125c1187aff2390dc20a0 Mon Sep 17 00:00:00 2001
From: Xueming Li <xuemingl@mellanox.com>
Date: Sat, 9 Sep 2017 15:33:19 +0800
Subject: [PATCH] mem: fix malloc element free in debug mode

[ upstream commit 41baec55a81467d7733217cd6f81a94e2916348c ]

malloc_elem_free() is clearing(setting to 0) the trailer cookie when
RTE_MALLOC_DEBUG is enabled. In case of joining free neighbor element,
part of joined memory is not getting cleared due to missing the length
of trailer cookie in the middle.

This patch fixes calculation of free memory length to be cleared in
malloc_elem_free() by including trailer cookie.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
---
 lib/librte_eal/common/malloc_elem.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/librte_eal/common/malloc_elem.c b/lib/librte_eal/common/malloc_elem.c
index 08516af2b..77a86151b 100644
--- a/lib/librte_eal/common/malloc_elem.c
+++ b/lib/librte_eal/common/malloc_elem.c
@@ -275,14 +275,14 @@ malloc_elem_free(struct malloc_elem *elem)
 		return -1;
 
 	rte_spinlock_lock(&(elem->heap->lock));
-	size_t sz = elem->size - sizeof(*elem);
+	size_t sz = elem->size - sizeof(*elem) - MALLOC_ELEM_TRAILER_LEN;
 	uint8_t *ptr = (uint8_t *)&elem[1];
 	struct malloc_elem *next = RTE_PTR_ADD(elem, elem->size);
 	if (next->state == ELEM_FREE){
 		/* remove from free list, join to this one */
 		elem_free_list_remove(next);
 		join_elem(elem, next);
-		sz += sizeof(*elem);
+		sz += (sizeof(*elem) + MALLOC_ELEM_TRAILER_LEN);
 	}
 
 	/* check if previous element is free, if so join with it and return,
@@ -291,8 +291,8 @@ malloc_elem_free(struct malloc_elem *elem)
 	if (elem->prev != NULL && elem->prev->state == ELEM_FREE) {
 		elem_free_list_remove(elem->prev);
 		join_elem(elem->prev, elem);
-		sz += sizeof(*elem);
-		ptr -= sizeof(*elem);
+		sz += (sizeof(*elem) + MALLOC_ELEM_TRAILER_LEN);
+		ptr -= (sizeof(*elem) + MALLOC_ELEM_TRAILER_LEN);
 		elem = elem->prev;
 	}
 	malloc_elem_free_list_insert(elem);
-- 
2.11.0

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

* [dpdk-stable] patch 'eal: copy raw strings taken from command line' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (38 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'mem: fix malloc element free in debug mode' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/virtio: fix mbuf port for simple Rx function' " luca.boccassi
                   ` (27 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Patrick MacArthur; +Cc: Sergio Gonzalez Monroy, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 4f267d69a21e9d7a55c67981087e0645ca021109 Mon Sep 17 00:00:00 2001
From: Patrick MacArthur <patrick@patrickmacarthur.net>
Date: Fri, 4 Aug 2017 14:53:57 -0400
Subject: [PATCH] eal: copy raw strings taken from command line

[ upstream commit e3f141879ef480c9e72e95d179c0879aed461406 ]

Normally, command line argument strings are considered immutable, but
SPDK [1] and urdma [2] construct argv arrays to pass to rte_eal_init().
These strings are allocated using malloc() and freed after DPDK
initialization with free(). However, in the case of --file-prefix and
--huge-dir, DPDK takes the pointer to these strings in argv directly. If
a secondary process calls rte_eal_pci_probe() after rte_eal_init()
returns, as is done by SPDK, this causes a use-after-free error because
the strings have been freed by the calling code immediately after
rte_eal_init() returns.

This problem was observed when running SPDK example programs as a
secondary process and causes the secondary processes to fail:

Starting DPDK 16.11.1 initialization...
[ DPDK EAL parameters: identify -c 4 --file-prefix=spdk3260 --base-virtaddr=0x1000000000 --proc-type=auto ]
EAL: Detected 40 lcore(s)
EAL: Auto-detected process type: SECONDARY
EAL: Probing VFIO support...
EAL: VFIO support initialized
EAL: PCI device 0000:81:00.0 on NUMA socket 1
EAL:   probe driver: 8086:953 spdk_nvme
EAL:   cannot connect to primary process!
EAL: Error - exiting with code: 1
Cause: Requested device 0000:81:00.0 cannot be used

Running strace shows that the file prefix has been zero'd out by the
time that the secondary process attempts to probe the NVMe device.

The use-after-free errors can be easily detected with valgrind:

==8489== Invalid read of size 1
==8489==    at 0x4C30D22: strlen (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8489==    by 0x58DB955: vfprintf (vfprintf.c:1637)
==8489==    by 0x59A4685: __vsnprintf_chk (vsnprintf_chk.c:63)
==8489==    by 0x59A45E7: __snprintf_chk (snprintf_chk.c:34)
==8489==    by 0x1246AB: get_socket_path.constprop.0 (in /home/pmacarth/src/spdk/examples/nvme/identify/identify)
==8489==    by 0x124B09: vfio_mp_sync_connect_to_primary (in /home/pmacarth/src/spdk/examples/nvme/identify/identify)
==8489==    by 0x123BE4: vfio_get_group_fd.part.1 (in /home/pmacarth/src/spdk/examples/nvme/identify/identify)
==8489==    by 0x124366: vfio_setup_device (in /home/pmacarth/src/spdk/examples/nvme/identify/identify)
==8489==    by 0x126C8A: pci_vfio_map_resource (in /home/pmacarth/src/spdk/examples/nvme/identify/identify)
==8489==    by 0x12B115: pci_probe_all_drivers.part.0 (in /home/pmacarth/src/spdk/examples/nvme/identify/identify)
==8489==    by 0x12B596: rte_eal_pci_probe (in /home/pmacarth/src/spdk/examples/nvme/identify/identify)
==8489==    by 0x11D5B5: spdk_pci_enumerate (pci.c:147)
==8489==  Address 0x63f362e is 14 bytes inside a block of size 32 free'd
==8489==    at 0x4C2ED5B: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8489==    by 0x11E6FB: spdk_free_args (init.c:136)
==8489==    by 0x11EBF5: spdk_env_init (init.c:309)
==8489==    by 0x10D2AA: main (identify.c:976)
==8489==  Block was alloc'd at
==8489==    at 0x4C2DB2F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8489==    by 0x11E7D7: _sprintf_alloc (init.c:76)
==8489==    by 0x11EA78: spdk_build_eal_cmdline (init.c:251)
==8489==    by 0x11EA78: spdk_env_init (init.c:282)
==8489==    by 0x10D2AA: main (identify.c:976)
==8489==

Fix this by using strdup() to create separate memory buffers for these
strings. Note that this patch will cause valgrind to report memory
leaks of these buffers as there is nowhere to free them. Using static
buffers is an option but would make these strings have a fixed maximum
length whereas there is currently no limit defined by the API.

[1] http://spdk.io
[2] https://github.com/zrlio/urdma

Fixes: af75078fece3 ("first public release")

Signed-off-by: Patrick MacArthur <patrick@patrickmacarthur.net>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
---
 lib/librte_eal/linuxapp/eal/eal.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c
index 2075282e2..59ed78823 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -570,11 +570,11 @@ eal_parse_args(int argc, char **argv)
 			break;
 
 		case OPT_HUGE_DIR_NUM:
-			internal_config.hugepage_dir = optarg;
+			internal_config.hugepage_dir = strdup(optarg);
 			break;
 
 		case OPT_FILE_PREFIX_NUM:
-			internal_config.hugefile_prefix = optarg;
+			internal_config.hugefile_prefix = strdup(optarg);
 			break;
 
 		case OPT_SOCKET_MEM_NUM:
-- 
2.11.0

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

* [dpdk-stable] patch 'net/virtio: fix mbuf port for simple Rx function' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (39 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'eal: copy raw strings taken from command line' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/virtio: fix queue setup consistency' " luca.boccassi
                   ` (26 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Olivier Matz; +Cc: Yuanhan Liu, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From cd893c90234f400679ee5ccd56812ade596e999e Mon Sep 17 00:00:00 2001
From: Olivier Matz <olivier.matz@6wind.com>
Date: Thu, 7 Sep 2017 14:13:42 +0200
Subject: [PATCH] net/virtio: fix mbuf port for simple Rx function

[ upstream commit 0c4f909c17af3cff8859439436a8fa0b9a9689c5 ]

The mbuf->port was was not properly set for the first received
mbufs. Fix this by setting it in virtqueue_enqueue_recv_refill_simple(),
which is used to enqueue the first mbuf in the ring.

The function virtio_rxq_rearm_vec(), which is used to rearm the ring
with new mbufs, is correct and does not need to be updated.

Fixes: cab0461234e7 ("virtio: fill Rx avail ring with blank mbufs")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
---
 drivers/net/virtio/virtio_rxtx_simple.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/virtio/virtio_rxtx_simple.c b/drivers/net/virtio/virtio_rxtx_simple.c
index b651e53b2..a6c0b34e7 100644
--- a/drivers/net/virtio/virtio_rxtx_simple.c
+++ b/drivers/net/virtio/virtio_rxtx_simple.c
@@ -65,6 +65,8 @@ virtqueue_enqueue_recv_refill_simple(struct virtqueue *vq,
 	struct vring_desc *start_dp;
 	uint16_t desc_idx;
 
+	cookie->port = vq->rxq.port_id;
+
 	desc_idx = vq->vq_avail_idx & (vq->vq_nentries - 1);
 	dxp = &vq->vq_descx[desc_idx];
 	dxp->cookie = (void *)cookie;
-- 
2.11.0

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

* [dpdk-stable] patch 'net/virtio: fix queue setup consistency' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (40 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/virtio: fix mbuf port for simple Rx function' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/virtio: fix untrusted scalar value' " luca.boccassi
                   ` (25 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Olivier Matz; +Cc: Yuanhan Liu, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 29113fef0f37476ba992e00ad17cd23a7eb6ac89 Mon Sep 17 00:00:00 2001
From: Olivier Matz <olivier.matz@6wind.com>
Date: Thu, 7 Sep 2017 14:13:43 +0200
Subject: [PATCH] net/virtio: fix queue setup consistency

[ upstream commit efc83a1e7fc319876835738871bf968e7ed5c935 ]

In rx/tx queue setup functions, some code is executed only if
use_simple_rxtx == 1. The value of this variable can change depending on
the offload flags or sse support. If Rx queue setup is called before Tx
queue setup, it can result in an invalid configuration:

- dev_configure is called: use_simple_rxtx is initialized to 0
- rx queue setup is called: queues are initialized without simple path
  support
- tx queue setup is called: use_simple_rxtx switch to 1, and simple
  Rx/Tx handlers are selected

Fix this by postponing a part of Rx/Tx queue initialization in
dev_start(), as it was the case in the initial implementation.

Fixes: 48cec290a3d2 ("net/virtio: move queue configure code to proper place")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
---
 drivers/net/virtio/virtio_ethdev.c | 13 +++++++++++++
 drivers/net/virtio/virtio_ethdev.h |  6 ++++++
 drivers/net/virtio/virtio_rxtx.c   | 40 ++++++++++++++++++++++++++++++--------
 3 files changed, 51 insertions(+), 8 deletions(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 67ebb1e5b..6903368db 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1523,6 +1523,19 @@ virtio_dev_start(struct rte_eth_dev *dev)
 	struct virtnet_rx *rxvq;
 	struct virtnet_tx *txvq __rte_unused;
 	struct virtio_hw *hw = dev->data->dev_private;
+	int ret;
+
+	/* Finish the initialization of the queues */
+	for (i = 0; i < dev->data->nb_rx_queues; i++) {
+		ret = virtio_dev_rx_queue_setup_finish(dev, i);
+		if (ret < 0)
+			return ret;
+	}
+	for (i = 0; i < dev->data->nb_tx_queues; i++) {
+		ret = virtio_dev_tx_queue_setup_finish(dev, i);
+		if (ret < 0)
+			return ret;
+	}
 
 	/* check if lsc interrupt feature is enabled */
 	if (dev->data->dev_conf.intr_conf.lsc) {
diff --git a/drivers/net/virtio/virtio_ethdev.h b/drivers/net/virtio/virtio_ethdev.h
index 4feccf939..c491ec1b0 100644
--- a/drivers/net/virtio/virtio_ethdev.h
+++ b/drivers/net/virtio/virtio_ethdev.h
@@ -88,10 +88,16 @@ int  virtio_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
 		const struct rte_eth_rxconf *rx_conf,
 		struct rte_mempool *mb_pool);
 
+int virtio_dev_rx_queue_setup_finish(struct rte_eth_dev *dev,
+				uint16_t rx_queue_id);
+
 int  virtio_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
 		uint16_t nb_tx_desc, unsigned int socket_id,
 		const struct rte_eth_txconf *tx_conf);
 
+int virtio_dev_tx_queue_setup_finish(struct rte_eth_dev *dev,
+				uint16_t tx_queue_id);
+
 uint16_t virtio_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 		uint16_t nb_pkts);
 
diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index a33ef1a88..ad582f3e5 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -412,9 +412,6 @@ virtio_dev_rx_queue_setup(struct rte_eth_dev *dev,
 	struct virtio_hw *hw = dev->data->dev_private;
 	struct virtqueue *vq = hw->vqs[vtpci_queue_idx];
 	struct virtnet_rx *rxvq;
-	int error, nbufs;
-	struct rte_mbuf *m;
-	uint16_t desc_idx;
 
 	PMD_INIT_FUNC_TRACE();
 
@@ -431,10 +428,24 @@ virtio_dev_rx_queue_setup(struct rte_eth_dev *dev,
 	}
 	dev->data->rx_queues[queue_idx] = rxvq;
 
+	return 0;
+}
+
+int
+virtio_dev_rx_queue_setup_finish(struct rte_eth_dev *dev, uint16_t queue_idx)
+{
+	uint16_t vtpci_queue_idx = 2 * queue_idx + VTNET_SQ_RQ_QUEUE_IDX;
+	struct virtio_hw *hw = dev->data->dev_private;
+	struct virtqueue *vq = hw->vqs[vtpci_queue_idx];
+	struct virtnet_rx *rxvq = &vq->rxq;
+	struct rte_mbuf *m;
+	uint16_t desc_idx;
+	int error, nbufs;
+
+	PMD_INIT_FUNC_TRACE();
 
 	/* Allocate blank mbufs for the each rx descriptor */
 	nbufs = 0;
-	error = ENOSPC;
 
 	if (hw->use_simple_rxtx) {
 		for (desc_idx = 0; desc_idx < vq->vq_nentries;
@@ -525,7 +536,6 @@ virtio_dev_tx_queue_setup(struct rte_eth_dev *dev,
 	struct virtqueue *vq = hw->vqs[vtpci_queue_idx];
 	struct virtnet_tx *txvq;
 	uint16_t tx_free_thresh;
-	uint16_t desc_idx;
 
 	PMD_INIT_FUNC_TRACE();
 
@@ -554,9 +564,24 @@ virtio_dev_tx_queue_setup(struct rte_eth_dev *dev,
 
 	vq->vq_free_thresh = tx_free_thresh;
 
+	dev->data->tx_queues[queue_idx] = txvq;
+	return 0;
+}
+
+int
+virtio_dev_tx_queue_setup_finish(struct rte_eth_dev *dev,
+				uint16_t queue_idx)
+{
+	uint8_t vtpci_queue_idx = 2 * queue_idx + VTNET_SQ_TQ_QUEUE_IDX;
+	struct virtio_hw *hw = dev->data->dev_private;
+	struct virtqueue *vq = hw->vqs[vtpci_queue_idx];
+	uint16_t mid_idx = vq->vq_nentries >> 1;
+	struct virtnet_tx *txvq = &vq->txq;
+	uint16_t desc_idx;
+
+	PMD_INIT_FUNC_TRACE();
+
 	if (hw->use_simple_rxtx) {
-		uint16_t mid_idx  = vq->vq_nentries >> 1;
-
 		for (desc_idx = 0; desc_idx < mid_idx; desc_idx++) {
 			vq->vq_ring.avail->ring[desc_idx] =
 				desc_idx + mid_idx;
@@ -578,7 +603,6 @@ virtio_dev_tx_queue_setup(struct rte_eth_dev *dev,
 
 	VIRTQUEUE_DUMP(vq);
 
-	dev->data->tx_queues[queue_idx] = txvq;
 	return 0;
 }
 
-- 
2.11.0

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

* [dpdk-stable] patch 'net/virtio: fix untrusted scalar value' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (41 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/virtio: fix queue setup consistency' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'timer: use 64-bit specific code on more platforms' " luca.boccassi
                   ` (24 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Daniel Mrzyglod; +Cc: Jianfeng Tan, Yuanhan Liu, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 2048b2fac091653be9183cf788e7df26cf22cacf Mon Sep 17 00:00:00 2001
From: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Date: Fri, 22 Sep 2017 17:21:49 +0200
Subject: [PATCH] net/virtio: fix untrusted scalar value

[ upstream commit 7b3249c56e29bec5f710624335bd4246c2a356fb ]

The unscrutinized value may be incorrectly assumed to be within a certain
range by later operations.

In vhost_user_read: An unscrutinized value from an untrusted source used
in a trusted context - the value of sz_payload may be harmfull and we need
limit them to the max value of payload.

Coverity issue: 139601
Fixes: 6a84c37e3975 ("net/virtio-user: add vhost-user adapter layer")

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
---
 drivers/net/virtio/virtio_user/vhost_user.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/virtio/virtio_user/vhost_user.c b/drivers/net/virtio/virtio_user/vhost_user.c
index 082e8217e..6f4845b70 100644
--- a/drivers/net/virtio/virtio_user/vhost_user.c
+++ b/drivers/net/virtio/virtio_user/vhost_user.c
@@ -97,6 +97,10 @@ vhost_user_read(int fd, struct vhost_user_msg *msg)
 	}
 
 	sz_payload = msg->size;
+
+	if ((size_t)sz_payload > sizeof(msg->payload))
+		goto fail;
+
 	if (sz_payload) {
 		ret = recv(fd, (void *)((char *)msg + sz_hdr), sz_payload, 0);
 		if (ret < sz_payload) {
-- 
2.11.0

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

* [dpdk-stable] patch 'timer: use 64-bit specific code on more platforms' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (42 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/virtio: fix untrusted scalar value' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/virtio: fix compilation with -Og' " luca.boccassi
                   ` (23 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Jerin Jacob; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 9045778fc1e6840d0f9061e242f517edf057bb66 Mon Sep 17 00:00:00 2001
From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Date: Sun, 13 Aug 2017 18:03:38 +0530
Subject: [PATCH] timer: use 64-bit specific code on more platforms

[ upstream commit 1e36bf301bbfa79efe340faf07e8cdb968ae34bd ]

64bit load and store will be an atomic operation on all the
64bit processors.
Change RTE_ARCH_X86_64 to RTE_ARCH_64 to reflect the case.

Fixes: 9b15ba895b9f ("timer: use a skip list")

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
 lib/librte_timer/rte_timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_timer/rte_timer.c b/lib/librte_timer/rte_timer.c
index 18782fab0..29ae2a35e 100644
--- a/lib/librte_timer/rte_timer.c
+++ b/lib/librte_timer/rte_timer.c
@@ -525,7 +525,7 @@ void rte_timer_manage(void)
 		return;
 	cur_time = rte_get_timer_cycles();
 
-#ifdef RTE_ARCH_X86_64
+#ifdef RTE_ARCH_64
 	/* on 64-bit the value cached in the pending_head.expired will be
 	 * updated atomically, so we can consult that for a quick check here
 	 * outside the lock */
-- 
2.11.0

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

* [dpdk-stable] patch 'net/virtio: fix compilation with -Og' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (43 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'timer: use 64-bit specific code on more platforms' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/bonding: fix LACP slave deactivate behavioral' " luca.boccassi
                   ` (22 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Olivier Matz; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From ac415cc8240828a6029cd99b97159c61c4b98cbd Mon Sep 17 00:00:00 2001
From: Olivier Matz <olivier.matz@6wind.com>
Date: Mon, 11 Sep 2017 17:13:26 +0200
Subject: [PATCH] net/virtio: fix compilation with -Og
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 3976f19e13cf7770597b207651c76b1676b9163a ]

The compilation with gcc-6.3.0 and EXTRA_CFLAGS=-Og gives the following
error:

  CC virtio_rxtx.o
  virtio_rxtx.c: In function ‘virtio_rx_offload’:
  virtio_rxtx.c:680:10: error: ‘csum’ may be used uninitialized in
                        this function [-Werror=maybe-uninitialized]
       csum = ~csum;
       ~~~~~^~~~~~~

The function rte_raw_cksum_mbuf() may indeed return an error, and
in this case, csum won't be initialized. Fix it by initializing csum
to 0.

Fixes: 96cb6711939e ("net/virtio: support Rx checksum offload")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/net/virtio/virtio_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index ad582f3e5..08e4e126b 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -685,7 +685,7 @@ virtio_rx_offload(struct rte_mbuf *m, struct virtio_net_hdr *hdr)
 			 * In case of SCTP, this will be wrong since it's a CRC
 			 * but there's nothing we can do.
 			 */
-			uint16_t csum, off;
+			uint16_t csum = 0, off;
 
 			rte_raw_cksum_mbuf(m, hdr->csum_start,
 				rte_pktmbuf_pkt_len(m) - hdr->csum_start,
-- 
2.11.0

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

* [dpdk-stable] patch 'net/bonding: fix LACP slave deactivate behavioral' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (44 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/virtio: fix compilation with -Og' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/qede/base: fix for VF malicious indication' " luca.boccassi
                   ` (21 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Declan Doherty; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From b0e03642711c7b7c036150df75845ef4edc96574 Mon Sep 17 00:00:00 2001
From: Declan Doherty <declan.doherty@intel.com>
Date: Fri, 6 Oct 2017 10:21:12 +0100
Subject: [PATCH] net/bonding: fix LACP slave deactivate behavioral

[ upstream commit 5840f427120c8e5c5d8557fe67da056a20f18888 ]

During a link down event of a port participating in a LACP 802.3ad
bond the current behavior can cause all ports to be deselected
and temporarily stop all traffic on the bond, causing unexpected
traffic loss across all ports and not just the port which was
affected by the link down event.

Fixes: 46fb43683679 ("bond: add mode 4")

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
---
 drivers/net/bonding/rte_eth_bond_8023ad.c | 41 +++++++++++++------------------
 1 file changed, 17 insertions(+), 24 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
index b4a1e7271..8081981c7 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
@@ -934,37 +934,30 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, uint8_t slave_id)
 }
 
 int
-bond_mode_8023ad_deactivate_slave(struct rte_eth_dev *bond_dev,
+bond_mode_8023ad_deactivate_slave(struct rte_eth_dev *bond_dev __rte_unused,
 		uint8_t slave_id)
 {
-	struct bond_dev_private *internals = bond_dev->data->dev_private;
 	void *pkt = NULL;
-	struct port *port;
-	uint8_t i;
-
-	/* Given slave must be in active list */
-	RTE_ASSERT(find_slave_by_id(internals->active_slaves,
-	internals->active_slave_count, slave_id) < internals->active_slave_count);
-
-	/* Exclude slave from transmit policy. If this slave is an aggregator
-	 * make all aggregated slaves unselected to force selection logic
-	 * to select suitable aggregator for this port. */
-	for (i = 0; i < internals->active_slave_count; i++) {
-		port = &mode_8023ad_ports[internals->active_slaves[i]];
-		if (port->aggregator_port_id != slave_id)
-			continue;
-
-		port->selected = UNSELECTED;
-
-		/* Use default aggregator */
-		port->aggregator_port_id = internals->active_slaves[i];
-	}
+	struct port *port = NULL;
+	uint8_t old_partner_state;
 
 	port = &mode_8023ad_ports[slave_id];
+
+	ACTOR_STATE_CLR(port, AGGREGATION);
 	port->selected = UNSELECTED;
-	port->actor_state &= ~(STATE_SYNCHRONIZATION | STATE_DISTRIBUTING |
-			STATE_COLLECTING);
 
+	old_partner_state = port->partner_state;
+	record_default(port);
+
+	/* If partner timeout state changes then disable timer */
+	if (!((old_partner_state ^ port->partner_state) &
+			STATE_LACP_SHORT_TIMEOUT))
+		timer_cancel(&port->current_while_timer);
+
+	PARTNER_STATE_CLR(port, AGGREGATION);
+	ACTOR_STATE_CLR(port, EXPIRED);
+
+	/* flush rx/tx rings */
 	while (rte_ring_dequeue(port->rx_ring, &pkt) == 0)
 		rte_pktmbuf_free((struct rte_mbuf *)pkt);
 
-- 
2.11.0

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

* [dpdk-stable] patch 'net/qede/base: fix for VF malicious indication' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (45 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/bonding: fix LACP slave deactivate behavioral' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/qede/base: fix return code to align with FW' " luca.boccassi
                   ` (20 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Rasesh Mody; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 8bb1056d29df9a6e1a85149da3924e9c8f024b4a Mon Sep 17 00:00:00 2001
From: Rasesh Mody <rasesh.mody@cavium.com>
Date: Fri, 6 Oct 2017 23:31:10 -0700
Subject: [PATCH] net/qede/base: fix for VF malicious indication

[ upstream commit eb35c732fe7c82dbf4b1115030e75a7d212350b8 ]

IOV regression testing led to discovery of a minor issue + possibly race
in IOV flows:
 a. Malicious indications in VF-database on PF-side get cleared during
    FLR flows - but not when disabling SRIOV. At least in Linux if you
    disable IOV while having a malicious VF you wouldn't be able to
    clear the indication as driver would prevent from initializing it.
 b. Possible race during PF response to VF - the channel is made ready
    only after sending the rc via dmae to VF. It's possible due to
    context switch at end of DMAE [when releasing Mutex] that VF would
    start running and send another message prior to PF clearing the
    channel, making the FW consider that VF to be malicious.

This patch fixes that by
 - clearing the indication even if we're only going to disable VF
 - resetting the channel to ready before PF copies the rc to the VF, PF
   can then continue and send an additional message

Fixes: 47b302d64624 ("net/qede/base: add handling of malicious VF")
Fixes: 86a2265e59d7 ("qede: add SRIOV support")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
 drivers/net/qede/base/ecore_sriov.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/qede/base/ecore_sriov.c b/drivers/net/qede/base/ecore_sriov.c
index b28d72810..1e706654b 100644
--- a/drivers/net/qede/base/ecore_sriov.c
+++ b/drivers/net/qede/base/ecore_sriov.c
@@ -1214,13 +1214,17 @@ static void ecore_iov_send_response(struct ecore_hwfn *p_hwfn,
 			     (sizeof(union pfvf_tlvs) - sizeof(u64)) / 4,
 			     &params);
 
-	ecore_dmae_host2host(p_hwfn, p_ptt, mbx->reply_phys,
-			     mbx->req_virt->first_tlv.reply_address,
-			     sizeof(u64) / 4, &params);
-
+	/* Once PF copies the rc to the VF, the latter can continue and
+	 * and send an additional message. So we have to make sure the
+	 * channel would be re-set to ready prior to that.
+	 */
 	REG_WR(p_hwfn,
 	       GTT_BAR0_MAP_REG_USDM_RAM +
 	       USTORM_VF_PF_CHANNEL_READY_OFFSET(eng_vf_id), 1);
+
+	ecore_dmae_host2host(p_hwfn, p_ptt, mbx->reply_phys,
+			     mbx->req_virt->first_tlv.reply_address,
+			     sizeof(u64) / 4, &params);
 }
 
 static u16 ecore_iov_vport_to_tlv(struct ecore_hwfn *p_hwfn,
-- 
2.11.0

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

* [dpdk-stable] patch 'net/qede/base: fix return code to align with FW' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (46 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/qede/base: fix for VF malicious indication' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'app/testpmd: fix invalid port id parameters' " luca.boccassi
                   ` (19 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Rasesh Mody; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 6d3560be202d76d6d9df9b2c187ee0fbe732c636 Mon Sep 17 00:00:00 2001
From: Rasesh Mody <rasesh.mody@cavium.com>
Date: Fri, 6 Oct 2017 23:31:11 -0700
Subject: [PATCH] net/qede/base: fix return code to align with FW

[ upstream commit da4ff1c39854d1c2d922c4959aac1c6fd6c182b1 ]

This change aligns the PF behavior with that of the L2-fw, so that flows
(to remove an incorrect MAC) for PF and VF could remain the same.

Fixes: 86a2265e59d7 ("qede: add SRIOV support")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
 drivers/net/qede/base/ecore_sriov.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/qede/base/ecore_sriov.c b/drivers/net/qede/base/ecore_sriov.c
index 1e706654b..064d7e723 100644
--- a/drivers/net/qede/base/ecore_sriov.c
+++ b/drivers/net/qede/base/ecore_sriov.c
@@ -2810,12 +2810,13 @@ static void ecore_iov_vf_mbx_ucast_filter(struct ecore_hwfn *p_hwfn,
 		goto out;
 	}
 
-	/* Update shadow copy of the VF configuration */
+	/* Update shadow copy of the VF configuration. In case shadow indicates
+	 * the action should be blocked return success to VF to imitate the
+	 * firmware behaviour in such case.
+	 */
 	if (ecore_iov_vf_update_unicast_shadow(p_hwfn, vf, &params) !=
-	    ECORE_SUCCESS) {
-		status = PFVF_STATUS_FAILURE;
+	    ECORE_SUCCESS)
 		goto out;
-	}
 
 	/* Determine if the unicast filtering is acceptible by PF */
 	if ((p_bulletin->valid_bitmap & (1 << VLAN_ADDR_FORCED)) &&
-- 
2.11.0

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

* [dpdk-stable] patch 'app/testpmd: fix invalid port id parameters' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (47 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/qede/base: fix return code to align with FW' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/mlx5: fix clang compilation error' " luca.boccassi
                   ` (18 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Li Han; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 9ad197a56e62b723920bf4201deb9a3119c9abe9 Mon Sep 17 00:00:00 2001
From: Li Han <han.li1@zte.com.cn>
Date: Tue, 22 Aug 2017 13:03:42 +0800
Subject: [PATCH] app/testpmd: fix invalid port id parameters

[ upstream commit d1f1a0fd8a0b3e5b090e64a8d7d895479e959143 ]

in parse_ringnuma_config/parse_portnuma_config functions, port_id
should be less than RTE_MAX_ETHPORTS, but port_id_is_invalid check
assumes that port_id may be RTE_PORT_ALL (65535).

Also fix port_id storage size.

Fixes: 4468635fdd04 ("app/testpmd: forbid actions on invalid port")

Signed-off-by: Li Han <han.li1@zte.com.cn>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 app/test-pmd/parameters.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 2f9695393..a96264657 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -360,7 +360,8 @@ parse_portnuma_config(const char *q_arg)
 	char s[256];
 	const char *p, *p0 = q_arg;
 	char *end;
-	uint8_t i,port_id,socket_id;
+	uint8_t i, socket_id;
+	portid_t port_id;
 	unsigned size;
 	enum fieldnames {
 		FLD_PORT = 0,
@@ -390,8 +391,9 @@ parse_portnuma_config(const char *q_arg)
 			if (errno != 0 || end == str_fld[i] || int_fld[i] > 255)
 				return -1;
 		}
-		port_id = (uint8_t)int_fld[FLD_PORT];
-		if (port_id_is_invalid(port_id, ENABLED_WARN)) {
+		port_id = (portid_t)int_fld[FLD_PORT];
+		if (port_id_is_invalid(port_id, ENABLED_WARN) ||
+			port_id == (portid_t)RTE_PORT_ALL) {
 			printf("Valid port range is [0");
 			FOREACH_PORT(pid, ports)
 				printf(", %d", pid);
@@ -416,7 +418,8 @@ parse_ringnuma_config(const char *q_arg)
 	char s[256];
 	const char *p, *p0 = q_arg;
 	char *end;
-	uint8_t i,port_id,ring_flag,socket_id;
+	uint8_t i, ring_flag, socket_id;
+	portid_t port_id;
 	unsigned size;
 	enum fieldnames {
 		FLD_PORT = 0,
@@ -450,8 +453,9 @@ parse_ringnuma_config(const char *q_arg)
 			if (errno != 0 || end == str_fld[i] || int_fld[i] > 255)
 				return -1;
 		}
-		port_id = (uint8_t)int_fld[FLD_PORT];
-		if (port_id_is_invalid(port_id, ENABLED_WARN)) {
+		port_id = (portid_t)int_fld[FLD_PORT];
+		if (port_id_is_invalid(port_id, ENABLED_WARN) ||
+			port_id == (portid_t)RTE_PORT_ALL) {
 			printf("Valid port range is [0");
 			FOREACH_PORT(pid, ports)
 				printf(", %d", pid);
-- 
2.11.0

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

* [dpdk-stable] patch 'net/mlx5: fix clang compilation error' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (48 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'app/testpmd: fix invalid port id parameters' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/enic: fix assignment' " luca.boccassi
                   ` (17 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Nélio Laranjeiro; +Cc: Yongseok Koh, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From c851d6bb801916e728f0859a6adc95795abff833 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?N=C3=A9lio=20Laranjeiro?= <nelio.laranjeiro@6wind.com>
Date: Mon, 9 Oct 2017 16:44:52 +0200
Subject: [PATCH] net/mlx5: fix clang compilation error

[ upstream commit 35a010ad48cd6aba911f9c05fc7b5d3d86bf2094 ]

drivers/net/mlx5/mlx5_rxq.c:606:6: error: comparison of constant 4
      with expression of type 'enum hash_rxq_flow_type' is always true
      [-Werror,-Wtautological-constant-out-of-range-compare]
		i != (int)RTE_DIM((*priv->hash_rxqs)[0].special_flow);
		~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Clang expects to have an index going upto special_flow size which is
defined by MLX5_MAX_SPECIAL_FLOWS and value is 4.  Comparing to an
unrelated enum where index my be lower cause this compilation issue.

Fixes: 36351ea34b92 ("net/mlx: fix build with icc")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
---
 drivers/net/mlx5/mlx5_rxq.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index aea203b36..5095a2b49 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -609,11 +609,9 @@ priv_allow_flow_type(struct priv *priv, enum hash_rxq_flow_type type)
 int
 priv_rehash_flows(struct priv *priv)
 {
-	enum hash_rxq_flow_type i;
+	size_t i;
 
-	for (i = HASH_RXQ_FLOW_TYPE_PROMISC;
-			i != RTE_DIM((*priv->hash_rxqs)[0].special_flow);
-			++i)
+	for (i = 0; i != RTE_DIM((*priv->hash_rxqs)[0].special_flow); ++i)
 		if (!priv_allow_flow_type(priv, i)) {
 			priv_special_flow_disable(priv, i);
 		} else {
-- 
2.11.0

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

* [dpdk-stable] patch 'net/enic: fix assignment' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (49 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/mlx5: fix clang compilation error' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix uninitialized variable' " luca.boccassi
                   ` (16 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Aaron Conole; +Cc: John Daley, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 941b949eef69add0225edf0e2c298859670e881d Mon Sep 17 00:00:00 2001
From: Aaron Conole <aconole@redhat.com>
Date: Tue, 26 Sep 2017 14:53:27 -0400
Subject: [PATCH] net/enic: fix assignment

[ upstream commit e735c8e20b9c727fd60f9ae1fa86114594c6ec76 ]

As it stands, the existing assignment to mbuf has no effect outside of
the function.  Prior to this change, the mbuf argument would contain
an invalid address, but it would not be null.  After this change, the
caller gets a null mbuf back.

Fixes: 947d860c821f ("enic: improve Rx performance")

Signed-off-by: Aaron Conole <aconole@redhat.com>
Reviewed-by: John Daley <johndale@cisco.com>
---
 drivers/net/enic/enic_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 817f63eb4..86c5539f3 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -231,7 +231,7 @@ enic_free_rq_buf(struct rte_mbuf **mbuf)
 		return;
 
 	rte_pktmbuf_free(*mbuf);
-	mbuf = NULL;
+	*mbuf = NULL;
 }
 
 void enic_init_vnic_resources(struct enic *enic)
-- 
2.11.0

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

* [dpdk-stable] patch 'net/i40e: fix uninitialized variable' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (50 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/enic: fix assignment' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/ixgbe: fix VFIO interrupt mapping in VF' " luca.boccassi
                   ` (15 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Yong Wang; +Cc: Jingjing Wu, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 5ccb40ce538c8a5994fcf027b55a3d864bce7936 Mon Sep 17 00:00:00 2001
From: Yong Wang <wang.yong19@zte.com.cn>
Date: Tue, 10 Oct 2017 07:24:20 -0400
Subject: [PATCH] net/i40e: fix uninitialized variable

[ upstream commit 47cf8373a1792b4a2c49cc03994f479fd4a693a2 ]

In func i40evf_dev_link_update(), "new_link.link_autoneg" is used in
func call i40evf_dev_atomic_write_link_status(), but is uninitialized.

Fixes: 2a73125b7041 ("i40evf: fix link info update")

Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index e8819f576..d47265f70 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -2225,6 +2225,8 @@ i40evf_dev_link_update(struct rte_eth_dev *dev,
 	new_link.link_duplex = ETH_LINK_FULL_DUPLEX;
 	new_link.link_status = vf->link_up ? ETH_LINK_UP :
 					     ETH_LINK_DOWN;
+	new_link.link_autoneg =
+		dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED;
 
 	i40evf_dev_atomic_write_link_status(dev, &new_link);
 
-- 
2.11.0

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

* [dpdk-stable] patch 'net/ixgbe: fix VFIO interrupt mapping in VF' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (51 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix uninitialized variable' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/ixgbe: fix uninitialized variable' " luca.boccassi
                   ` (14 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Wei Dai; +Cc: Wenzhuo Lu, Jianwei Ma, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 50f47bf258bf043b917ac1e8cead95fdcc217b43 Mon Sep 17 00:00:00 2001
From: Wei Dai <wei.dai@intel.com>
Date: Thu, 28 Sep 2017 10:28:33 +0800
Subject: [PATCH] net/ixgbe: fix VFIO interrupt mapping in VF

[ upstream commit 06938770186afcfd05a4d6d3addee12645c9c558 ]

When a VF port is bound to VFIO-PIC, only miscellaneous interrupt
is mapped to VFIO vector 0 in eth_ixgbevf_dev_init( ).
In ixgbevf_dev_start(), if previous VFIO interrupt mapping set in
eth_ixgbevf_dev_init( ) is not cleard, it will fail when calling
rte_intr_enable( ) tries to map Rx queue interrupt to other VFIO
vectors. This patch clears the VFIO interrupt mappings before
setting both miscellaneous and Rx queue interrupt mappings again
to avoid failure.

Fixes: 77234603fba0 ("net/ixgbe: support VF mailbox interrupt for link up/down")

Signed-off-by: Wei Dai <wei.dai@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Tested-by: Jianwei Ma <jianwei.ma@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 3b51bcc3d..d471488cb 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -4250,6 +4250,15 @@ ixgbevf_dev_start(struct rte_eth_dev *dev)
 	}
 	ixgbevf_configure_msix(dev);
 
+	/* When a VF port is bound to VFIO-PCI, only miscellaneous interrupt
+	 * is mapped to VFIO vector 0 in eth_ixgbevf_dev_init( ).
+	 * If previous VFIO interrupt mapping setting in eth_ixgbevf_dev_init( )
+	 * is not cleared, it will fail when following rte_intr_enable( ) tries
+	 * to map Rx queue interrupt to other VFIO vectors.
+	 * So clear uio/vfio intr/evevnfd first to avoid failure.
+	 */
+	rte_intr_disable(intr_handle);
+
 	rte_intr_enable(intr_handle);
 
 	/* Re-enable interrupt for VF */
-- 
2.11.0

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

* [dpdk-stable] patch 'net/ixgbe: fix uninitialized variable' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (52 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/ixgbe: fix VFIO interrupt mapping in VF' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:34 ` [dpdk-stable] patch 'examples/l2fwd-crypto: fix uninitialized errno value' " luca.boccassi
                   ` (13 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Yong Wang; +Cc: Wenzhuo Lu, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 0d8fe85ddb07221c12df8e03a51fadf10369c180 Mon Sep 17 00:00:00 2001
From: Yong Wang <wang.yong19@zte.com.cn>
Date: Mon, 18 Sep 2017 23:17:24 -0400
Subject: [PATCH] net/ixgbe: fix uninitialized variable

[ upstream commit 457ea93fda4ee8e0ea08a862e89a1fbdf0121d9c ]

In func ixgbe_dev_link_update(), "link.link_autoneg" is used in func
call rte_ixgbe_dev_atomic_write_link_status(), but is uninitialized.

Fixes: 82113036e4e5 ("ethdev: redesign link speed config")

Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index d471488cb..d997304cb 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -3230,6 +3230,7 @@ ixgbe_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete)
 	link.link_status = ETH_LINK_DOWN;
 	link.link_speed = 0;
 	link.link_duplex = ETH_LINK_HALF_DUPLEX;
+	link.link_autoneg = ETH_LINK_AUTONEG;
 	memset(&old, 0, sizeof(old));
 	rte_ixgbe_dev_atomic_read_link_status(dev, &old);
 
-- 
2.11.0

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

* [dpdk-stable] patch 'examples/l2fwd-crypto: fix uninitialized errno value' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (53 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'net/ixgbe: fix uninitialized variable' " luca.boccassi
@ 2017-10-30 15:34 ` luca.boccassi
  2017-10-30 15:35 ` [dpdk-stable] patch 'drivers/crypto: use snprintf return value correctly' " luca.boccassi
                   ` (12 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:34 UTC (permalink / raw)
  To: Hemant Agrawal; +Cc: Pablo de Lara, Kirill Rybalchenko, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 061930daed84e2b093d0c1b858e894ce5f0d907f Mon Sep 17 00:00:00 2001
From: Hemant Agrawal <hemant.agrawal@nxp.com>
Date: Wed, 23 Aug 2017 17:54:03 +0530
Subject: [PATCH] examples/l2fwd-crypto: fix uninitialized errno value

[ upstream commit 455446276493a68117f738b2b778f2791751a2a7 ]

errno should be initialized to 0 before calling strtol

Fixes: 1df9c0109f4c ("examples/l2fwd-crypto: parse key parameters")

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Reviewed-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
---
 examples/l2fwd-crypto/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index b40c49c3d..3e99b48f1 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -987,6 +987,7 @@ parse_key(uint8_t *data, char *input_arg)
 	unsigned byte_count;
 	char *token;
 
+	errno = 0;
 	for (byte_count = 0, token = strtok(input_arg, ":");
 			(byte_count < MAX_KEY_SIZE) && (token != NULL);
 			token = strtok(NULL, ":")) {
-- 
2.11.0

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

* [dpdk-stable] patch 'drivers/crypto: use snprintf return value correctly' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (54 preceding siblings ...)
  2017-10-30 15:34 ` [dpdk-stable] patch 'examples/l2fwd-crypto: fix uninitialized errno value' " luca.boccassi
@ 2017-10-30 15:35 ` luca.boccassi
  2017-10-30 15:35 ` [dpdk-stable] patch 'net/i40e: fix flexible payload configuration' " luca.boccassi
                   ` (11 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:35 UTC (permalink / raw)
  To: Tomasz Duszynski; +Cc: Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From ed54d1e8c40c13f272348ef60cbe2a43fca1687d Mon Sep 17 00:00:00 2001
From: Tomasz Duszynski <tdu@semihalf.com>
Date: Wed, 11 Oct 2017 13:05:07 +0200
Subject: [PATCH] drivers/crypto: use snprintf return value correctly

[ upstream commit 6ab25e634f51b98b18bd3095cd09858c4a9489fe ]

snprintf return value is the length of was encoded into destination
array excluding '\0'. Thus return value equal to the length of the
destination array or more means truncation.

This commit fixes improper use of the return value.

Fixes: eec136f3c54f ("aesni_gcm: add driver for AES-GCM crypto operations")
Fixes: 924e84f87306 ("aesni_mb: add driver for multi buffer based crypto")
Fixes: 0f548b50a160 ("crypto/aesni_mb: process crypto op on dequeue")
Fixes: 169ca3db550c ("crypto/armv8: add PMD optimized for ARMv8 processors")
Fixes: 2773c86d061a ("crypto/kasumi: add driver for KASUMI library")
Fixes: 94b0ad8e0aa5 ("null_crypto: add driver for null crypto operations")
Fixes: d61f70b4c918 ("crypto/libcrypto: add driver for OpenSSL library")
Fixes: 3aafc423cf4d ("snow3g: add driver for SNOW 3G library")
Fixes: cf7685d68f00 ("crypto/zuc: add driver for ZUC library")

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c   | 2 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c | 2 +-
 drivers/crypto/kasumi/rte_kasumi_pmd_ops.c     | 2 +-
 drivers/crypto/null/null_crypto_pmd_ops.c      | 2 +-
 drivers/crypto/openssl/rte_openssl_pmd_ops.c   | 2 +-
 drivers/crypto/snow3g/rte_snow3g_pmd_ops.c     | 2 +-
 drivers/crypto/zuc/rte_zuc_pmd_ops.c           | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
index c51f82a8b..d4ff651f7 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
@@ -184,7 +184,7 @@ aesni_gcm_pmd_qp_set_unique_name(struct rte_cryptodev *dev,
 			"aesni_gcm_pmd_%u_qp_%u",
 			dev->data->dev_id, qp->id);
 
-	if (n > sizeof(qp->name))
+	if (n >= sizeof(qp->name))
 		return -1;
 
 	return 0;
diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c
index 287c8a509..e531c8800 100644
--- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c
+++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c
@@ -333,7 +333,7 @@ aesni_mb_pmd_qp_set_unique_name(struct rte_cryptodev *dev,
 			"aesni_mb_pmd_%u_qp_%u",
 			dev->data->dev_id, qp->id);
 
-	if (n > sizeof(qp->name))
+	if (n >= sizeof(qp->name))
 		return -1;
 
 	return 0;
diff --git a/drivers/crypto/kasumi/rte_kasumi_pmd_ops.c b/drivers/crypto/kasumi/rte_kasumi_pmd_ops.c
index b9285a438..8f8695d80 100644
--- a/drivers/crypto/kasumi/rte_kasumi_pmd_ops.c
+++ b/drivers/crypto/kasumi/rte_kasumi_pmd_ops.c
@@ -186,7 +186,7 @@ kasumi_pmd_qp_set_unique_name(struct rte_cryptodev *dev,
 			"kasumi_pmd_%u_qp_%u",
 			dev->data->dev_id, qp->id);
 
-	if (n > sizeof(qp->name))
+	if (n >= sizeof(qp->name))
 		return -1;
 
 	return 0;
diff --git a/drivers/crypto/null/null_crypto_pmd_ops.c b/drivers/crypto/null/null_crypto_pmd_ops.c
index 26ff63193..421f21e09 100644
--- a/drivers/crypto/null/null_crypto_pmd_ops.c
+++ b/drivers/crypto/null/null_crypto_pmd_ops.c
@@ -178,7 +178,7 @@ null_crypto_pmd_qp_set_unique_name(struct rte_cryptodev *dev,
 			"null_crypto_pmd_%u_qp_%u",
 			dev->data->dev_id, qp->id);
 
-	if (n > sizeof(qp->name))
+	if (n >= sizeof(qp->name))
 		return -1;
 
 	return 0;
diff --git a/drivers/crypto/openssl/rte_openssl_pmd_ops.c b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
index a072e6e39..7bf82e1a6 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd_ops.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
@@ -543,7 +543,7 @@ openssl_pmd_qp_set_unique_name(struct rte_cryptodev *dev,
 			"openssl_pmd_%u_qp_%u",
 			dev->data->dev_id, qp->id);
 
-	if (n > sizeof(qp->name))
+	if (n >= sizeof(qp->name))
 		return -1;
 
 	return 0;
diff --git a/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c b/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c
index 4602dfd4d..7cb47c03e 100644
--- a/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c
+++ b/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c
@@ -183,7 +183,7 @@ snow3g_pmd_qp_set_unique_name(struct rte_cryptodev *dev,
 			"snow3g_pmd_%u_qp_%u",
 			dev->data->dev_id, qp->id);
 
-	if (n > sizeof(qp->name))
+	if (n >= sizeof(qp->name))
 		return -1;
 
 	return 0;
diff --git a/drivers/crypto/zuc/rte_zuc_pmd_ops.c b/drivers/crypto/zuc/rte_zuc_pmd_ops.c
index 2c886d51d..620a9dae6 100644
--- a/drivers/crypto/zuc/rte_zuc_pmd_ops.c
+++ b/drivers/crypto/zuc/rte_zuc_pmd_ops.c
@@ -183,7 +183,7 @@ zuc_pmd_qp_set_unique_name(struct rte_cryptodev *dev,
 			"zuc_pmd_%u_qp_%u",
 			dev->data->dev_id, qp->id);
 
-	if (n > sizeof(qp->name))
+	if (n >= sizeof(qp->name))
 		return -1;
 
 	return 0;
-- 
2.11.0

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

* [dpdk-stable] patch 'net/i40e: fix flexible payload configuration' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (55 preceding siblings ...)
  2017-10-30 15:35 ` [dpdk-stable] patch 'drivers/crypto: use snprintf return value correctly' " luca.boccassi
@ 2017-10-30 15:35 ` luca.boccassi
  2017-10-30 15:35 ` [dpdk-stable] patch 'net/i40e: fix mbuf free in vector Tx' " luca.boccassi
                   ` (10 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:35 UTC (permalink / raw)
  To: Andrey Chilikin; +Cc: Beilei Xing, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 0b35308e321ff94a28088b0e6ee6f922a60223f9 Mon Sep 17 00:00:00 2001
From: Andrey Chilikin <andrey.chilikin@intel.com>
Date: Fri, 6 Oct 2017 19:11:26 +0100
Subject: [PATCH] net/i40e: fix flexible payload configuration

[ upstream commit 1edc13a83b0d41f7ab982996f5a1ef9c5ee13b7b ]

Removed legacy writes to ORT/PIT registers from
i40e_GLQF_reg_init(struct i40e_hw *hw) function.
Latest NVM versions contain all relevant values
and these values should not be overwritten by SW to
maintain driver/firmware compatibility and to avoid
conflicts with dynamic device personalization profiles.

Fixes: f05ec7d77e41 ("i40e: initialize flow director flexible payload setting")

Signed-off-by: Andrey Chilikin <andrey.chilikin@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index d63d5b483..43bd0a4f3 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -729,23 +729,22 @@ RTE_PMD_REGISTER_PCI_TABLE(net_i40e, pci_id_i40e_map);
 static inline void i40e_GLQF_reg_init(struct i40e_hw *hw)
 {
 	/*
-	 * Initialize registers for flexible payload, which should be set by NVM.
-	 * This should be removed from code once it is fixed in NVM.
+	 * Force global configuration for flexible payload
+	 * to the first 16 bytes of the corresponding L2/L3/L4 paylod.
+	 * This should be removed from code once proper
+	 * configuration API is added to avoid configuration conflicts
+	 * between ports of the same device.
 	 */
-	I40E_WRITE_REG(hw, I40E_GLQF_ORT(18), 0x00000030);
-	I40E_WRITE_REG(hw, I40E_GLQF_ORT(19), 0x00000030);
-	I40E_WRITE_REG(hw, I40E_GLQF_ORT(26), 0x0000002B);
-	I40E_WRITE_REG(hw, I40E_GLQF_ORT(30), 0x0000002B);
 	I40E_WRITE_REG(hw, I40E_GLQF_ORT(33), 0x000000E0);
 	I40E_WRITE_REG(hw, I40E_GLQF_ORT(34), 0x000000E3);
 	I40E_WRITE_REG(hw, I40E_GLQF_ORT(35), 0x000000E6);
-	I40E_WRITE_REG(hw, I40E_GLQF_ORT(20), 0x00000031);
-	I40E_WRITE_REG(hw, I40E_GLQF_ORT(23), 0x00000031);
-	I40E_WRITE_REG(hw, I40E_GLQF_ORT(63), 0x0000002D);
-	I40E_WRITE_REG(hw, I40E_GLQF_PIT(16), 0x00007480);
-	I40E_WRITE_REG(hw, I40E_GLQF_PIT(17), 0x00007440);
 
-	/* Initialize registers for parsing packet type of QinQ */
+	/*
+	 * Initialize registers for parsing packet type of QinQ
+	 * This should be removed from code once proper
+	 * configuration API is added to avoid configuration conflicts
+	 * between ports of the same device.
+	 */
 	I40E_WRITE_REG(hw, I40E_GLQF_ORT(40), 0x00000029);
 	I40E_WRITE_REG(hw, I40E_GLQF_PIT(9), 0x00009420);
 }
-- 
2.11.0

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

* [dpdk-stable] patch 'net/i40e: fix mbuf free in vector Tx' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (56 preceding siblings ...)
  2017-10-30 15:35 ` [dpdk-stable] patch 'net/i40e: fix flexible payload configuration' " luca.boccassi
@ 2017-10-30 15:35 ` luca.boccassi
  2017-10-30 15:35 ` [dpdk-stable] patch 'kni: fix ethtool build with kernel 4.11' " luca.boccassi
                   ` (9 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:35 UTC (permalink / raw)
  To: Qi Zhang; +Cc: Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From be8c2c6d405f78a33925eea52ce33c3c95eda4e1 Mon Sep 17 00:00:00 2001
From: Qi Zhang <qi.z.zhang@intel.com>
Date: Tue, 10 Oct 2017 09:22:05 -0400
Subject: [PATCH] net/i40e: fix mbuf free in vector Tx

[ upstream commit 24853544c84c152dabcd013b9ee723a059e0d5dd ]

vPMD tx does not set sw_ring's mbuf to NULL after free.
Therefore, in cases where the vector transmit function is in
use, we must use the appropriate index and threshold values
for the queue to only free the unreleased mbufs

Fixes: b4669bb95038 ("i40e: add vector Tx")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/i40e/i40e_rxtx.c | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index d1dd434ca..86546ca8e 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -2159,18 +2159,40 @@ i40e_reset_rx_queue(struct i40e_rx_queue *rxq)
 void
 i40e_tx_queue_release_mbufs(struct i40e_tx_queue *txq)
 {
+	struct rte_eth_dev *dev;
 	uint16_t i;
 
+	dev = &rte_eth_devices[txq->port_id];
+
 	if (!txq || !txq->sw_ring) {
 		PMD_DRV_LOG(DEBUG, "Pointer to rxq or sw_ring is NULL");
 		return;
 	}
 
-	for (i = 0; i < txq->nb_tx_desc; i++) {
-		if (txq->sw_ring[i].mbuf) {
+	/**
+	 *  vPMD tx will not set sw_ring's mbuf to NULL after free,
+	 *  so need to free remains more carefully.
+	 */
+	if (dev->tx_pkt_burst == i40e_xmit_pkts_vec) {
+		i = txq->tx_next_dd - txq->tx_rs_thresh + 1;
+		if (txq->tx_tail < i) {
+			for (; i < txq->nb_tx_desc; i++) {
+				rte_pktmbuf_free_seg(txq->sw_ring[i].mbuf);
+				txq->sw_ring[i].mbuf = NULL;
+			}
+			i = 0;
+		}
+		for (; i < txq->tx_tail; i++) {
 			rte_pktmbuf_free_seg(txq->sw_ring[i].mbuf);
 			txq->sw_ring[i].mbuf = NULL;
 		}
+	} else {
+		for (i = 0; i < txq->nb_tx_desc; i++) {
+			if (txq->sw_ring[i].mbuf) {
+				rte_pktmbuf_free_seg(txq->sw_ring[i].mbuf);
+				txq->sw_ring[i].mbuf = NULL;
+			}
+		}
 	}
 }
 
-- 
2.11.0

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

* [dpdk-stable] patch 'kni: fix ethtool build with kernel 4.11' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (57 preceding siblings ...)
  2017-10-30 15:35 ` [dpdk-stable] patch 'net/i40e: fix mbuf free in vector Tx' " luca.boccassi
@ 2017-10-30 15:35 ` luca.boccassi
  2017-10-30 15:35 ` [dpdk-stable] patch 'kni: fix build on RHEL 7.4' " luca.boccassi
                   ` (8 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:35 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Nicolas Dichtel, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 2639ad2a05ffc6f6636a7a38a8ed9190fbf9c1a9 Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@intel.com>
Date: Wed, 3 May 2017 17:00:16 +0100
Subject: [PATCH] kni: fix ethtool build with kernel 4.11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 9fb3cd2c041eeca30b6c46e5d555d857d6096ae7 ]

build error:
.../lib/librte_eal/linuxapp/kni/igb_main.c:1034:10:
error: implicit declaration of function ‘pci_enable_msix’
    err = pci_enable_msix(pdev,
              ^~~~~~~~~~~~~~~

This build error observed when CONFIG_RTE_KNI_KMOD_ETHTOOL config option
enabled.

Following Linux commit removes the pci_enable_msix()
Linux: 4244de1c64de ("PCI: remove pci_enable_msix")

Switch to pci_enable_msix_range() for kernel > 4.8 since current Linux
igb driver uses this function.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 7 +++++++
 lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h  | 4 ++++
 2 files changed, 11 insertions(+)

diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
index f4dca5a38..acb1a69b4 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
@@ -1031,8 +1031,15 @@ static void igb_set_interrupt_capability(struct igb_adapter *adapter, bool msix)
 			for (i = 0; i < numvecs; i++)
 				adapter->msix_entries[i].entry = i;
 
+#ifdef HAVE_PCI_ENABLE_MSIX
 			err = pci_enable_msix(pdev,
 			                      adapter->msix_entries, numvecs);
+#else
+			err = pci_enable_msix_range(pdev,
+					adapter->msix_entries,
+					numvecs,
+					numvecs);
+#endif
 			if (err == 0)
 				break;
 		}
diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
index 84826b26e..aea253b1c 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
@@ -3933,4 +3933,8 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type)
 #define HAVE_VF_VLAN_PROTO
 #endif /* >= 4.9.0 */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
+#define HAVE_PCI_ENABLE_MSIX
+#endif
+
 #endif /* _KCOMPAT_H_ */
-- 
2.11.0

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

* [dpdk-stable] patch 'kni: fix build on RHEL 7.4' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (58 preceding siblings ...)
  2017-10-30 15:35 ` [dpdk-stable] patch 'kni: fix ethtool build with kernel 4.11' " luca.boccassi
@ 2017-10-30 15:35 ` luca.boccassi
  2017-10-30 15:35 ` [dpdk-stable] patch 'kni: fix build on SLE12 SP3' " luca.boccassi
                   ` (7 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:35 UTC (permalink / raw)
  To: Lee Roberts; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From cc0f505aa263efb2e87e2be5b4454b819df2cc76 Mon Sep 17 00:00:00 2001
From: Lee Roberts <lee.roberts@hpe.com>
Date: Wed, 31 May 2017 09:40:15 -0600
Subject: [PATCH] kni: fix build on RHEL 7.4

[ upstream commit 1e1cabc7a5d8799e55324de01f8eec150d574aef ]

Linux: 9b36627acecd ("net: remove dev->trans_start")

Signed-off-by: Lee Roberts <lee.roberts@hpe.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 lib/librte_eal/linuxapp/kni/compat.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/librte_eal/linuxapp/kni/compat.h b/lib/librte_eal/linuxapp/kni/compat.h
index d96275af9..6a1587b4e 100644
--- a/lib/librte_eal/linuxapp/kni/compat.h
+++ b/lib/librte_eal/linuxapp/kni/compat.h
@@ -53,7 +53,9 @@
 #define HAVE_SK_ALLOC_KERN_PARAM
 #endif
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0) || \
+	(defined(RHEL_RELEASE_CODE) && \
+	 RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7, 4))
 #define HAVE_TRANS_START_HELPER
 #endif
 
-- 
2.11.0

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

* [dpdk-stable] patch 'kni: fix build on SLE12 SP3' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (59 preceding siblings ...)
  2017-10-30 15:35 ` [dpdk-stable] patch 'kni: fix build on RHEL 7.4' " luca.boccassi
@ 2017-10-30 15:35 ` luca.boccassi
  2017-10-30 15:35 ` [dpdk-stable] patch 'examples/l2fwd-cat: fix build with PQOS 1.4' " luca.boccassi
                   ` (6 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:35 UTC (permalink / raw)
  To: Nirmoy Das; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From b59cee0207dee33a791d289523910532f431a595 Mon Sep 17 00:00:00 2001
From: Nirmoy Das <ndas@suse.de>
Date: Mon, 9 Oct 2017 23:04:09 +0100
Subject: [PATCH] kni: fix build on SLE12 SP3
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 47b1119fd1a0c79eeadb5e96e1903d6f4b738f36 ]

build error:
build/lib/librte_eal/linuxapp/kni/kni_net.c:215:5: error:
‘struct net_device’ has no member named ‘trans_start’
  dev->trans_start = jiffies;

Signed-off-by: Nirmoy Das <ndas@suse.de>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 lib/librte_eal/linuxapp/kni/compat.h | 31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/lib/librte_eal/linuxapp/kni/compat.h b/lib/librte_eal/linuxapp/kni/compat.h
index 6a1587b4e..3f8c0bc87 100644
--- a/lib/librte_eal/linuxapp/kni/compat.h
+++ b/lib/librte_eal/linuxapp/kni/compat.h
@@ -8,6 +8,34 @@
 #define RHEL_RELEASE_VERSION(a, b) (((a) << 8) + (b))
 #endif
 
+/* SuSE version macro is the same as Linux kernel version */
+#ifndef SLE_VERSION
+#define SLE_VERSION(a, b, c) KERNEL_VERSION(a, b, c)
+#endif
+#ifdef CONFIG_SUSE_KERNEL
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 57))
+/* SLES12SP3 is at least 4.4.57+ based */
+#define SLE_VERSION_CODE SLE_VERSION(12, 3, 0)
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 28))
+/* SLES12 is at least 3.12.28+ based */
+#define SLE_VERSION_CODE SLE_VERSION(12, 0, 0)
+#elif ((LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 61)) && \
+	(LINUX_VERSION_CODE < KERNEL_VERSION(3, 1, 0)))
+/* SLES11 SP3 is at least 3.0.61+ based */
+#define SLE_VERSION_CODE SLE_VERSION(11, 3, 0)
+#elif (LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 32))
+/* SLES11 SP1 is 2.6.32 based */
+#define SLE_VERSION_CODE SLE_VERSION(11, 1, 0)
+#elif (LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 27))
+/* SLES11 GA is 2.6.27 based */
+#define SLE_VERSION_CODE SLE_VERSION(11, 0, 0)
+#endif /* LINUX_VERSION_CODE == KERNEL_VERSION(x,y,z) */
+#endif /* CONFIG_SUSE_KERNEL */
+#ifndef SLE_VERSION_CODE
+#define SLE_VERSION_CODE 0
+#endif /* SLE_VERSION_CODE */
+
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39) && \
 	(!(defined(RHEL_RELEASE_CODE) && \
 	   RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6, 4)))
@@ -55,7 +83,8 @@
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0) || \
 	(defined(RHEL_RELEASE_CODE) && \
-	 RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7, 4))
+	 RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7, 4)) || \
+	(SLE_VERSION_CODE && SLE_VERSION_CODE == SLE_VERSION(12, 3, 0))
 #define HAVE_TRANS_START_HELPER
 #endif
 
-- 
2.11.0

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

* [dpdk-stable] patch 'examples/l2fwd-cat: fix build with PQOS 1.4' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (60 preceding siblings ...)
  2017-10-30 15:35 ` [dpdk-stable] patch 'kni: fix build on SLE12 SP3' " luca.boccassi
@ 2017-10-30 15:35 ` luca.boccassi
  2017-10-30 15:35 ` [dpdk-stable] patch 'examples/l2fwd_fork: fix message pool init' " luca.boccassi
                   ` (5 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:35 UTC (permalink / raw)
  To: Vladimir Kuramshin; +Cc: Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From eb1087cff53673435a9b8900d5a185411a3b5a6b Mon Sep 17 00:00:00 2001
From: Vladimir Kuramshin <v.kuramshin@samsung.com>
Date: Tue, 19 Sep 2017 12:40:44 +0300
Subject: [PATCH] examples/l2fwd-cat: fix build with PQOS 1.4

[ upstream commit 7a08b1d860a3adbc7315bc5ca532d541d07310af ]

Current version is compatible with PQOS version 1.3
but not compatible with higher versions. This change
makes l2fwd-cat example compatible with versions since 1.4

Signed-off-by: Vladimir Kuramshin <v.kuramshin@samsung.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 examples/l2fwd-cat/Makefile |  5 +--
 examples/l2fwd-cat/cat.c    | 85 +++++++++++++++++++++++++++++++++++++++------
 2 files changed, 76 insertions(+), 14 deletions(-)

diff --git a/examples/l2fwd-cat/Makefile b/examples/l2fwd-cat/Makefile
index ae921ade6..a7fe6d68e 100644
--- a/examples/l2fwd-cat/Makefile
+++ b/examples/l2fwd-cat/Makefile
@@ -40,9 +40,6 @@ endif
 # Default target, can be overridden by command line or environment
 RTE_TARGET ?= x86_64-native-linuxapp-gcc
 
-# Location of PQoS library and includes,
-PQOS_LIBRARY_PATH = $(PQOS_INSTALL_PATH)/libpqos.a
-
 include $(RTE_SDK)/mk/rte.vars.mk
 
 # binary name
@@ -65,6 +62,6 @@ CFLAGS += -I$(PQOS_INSTALL_PATH)/../include
 CFLAGS_cat.o := -D_GNU_SOURCE
 
 LDLIBS += -L$(PQOS_INSTALL_PATH)
-LDLIBS += $(PQOS_LIBRARY_PATH)
+LDLIBS += -lpqos
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/l2fwd-cat/cat.c b/examples/l2fwd-cat/cat.c
index bad39305a..f6f8b6881 100644
--- a/examples/l2fwd-cat/cat.c
+++ b/examples/l2fwd-cat/cat.c
@@ -53,7 +53,11 @@
 static const struct pqos_cap *m_cap;
 static const struct pqos_cpuinfo *m_cpu;
 static const struct pqos_capability *m_cap_l3ca;
+#if PQOS_VERSION <= 103
 static unsigned m_sockets[PQOS_MAX_SOCKETS];
+#else
+static unsigned int *m_sockets;
+#endif
 static unsigned m_sock_count;
 static struct cat_config m_config[PQOS_MAX_CORES];
 static unsigned m_config_count;
@@ -271,16 +275,16 @@ parse_l3ca(const char *l3ca)
 		/* scan the separator '@', ','(next) or '\0'(finish) */
 		l3ca += strcspn(l3ca, "@,");
 
-		if (*l3ca == '@') {
-			/* explicit assign cpu_set */
-			offset = parse_set(l3ca + 1, &cpuset);
-			if (offset < 0 || CPU_COUNT(&cpuset) == 0)
-				goto err;
+		if (*l3ca != '@')
+			goto err;
 
-			end = l3ca + 1 + offset;
-		} else
+		/* explicit assign cpu_set */
+		offset = parse_set(l3ca + 1, &cpuset);
+		if (offset < 0 || CPU_COUNT(&cpuset) == 0)
 			goto err;
 
+		end = l3ca + 1 + offset;
+
 		if (*end != ',' && *end != '\0')
 			goto err;
 
@@ -353,9 +357,6 @@ parse_l3ca(const char *l3ca)
 		idx++;
 	} while (*end != '\0' && idx < PQOS_MAX_CORES);
 
-	if (m_config_count == 0)
-		goto err;
-
 	return 0;
 
 err:
@@ -408,7 +409,11 @@ check_cpus(void)
 					goto exit;
 				}
 
+#if PQOS_VERSION <= 103
 				ret = pqos_l3ca_assoc_get(cpu_id, &cos_id);
+#else
+				ret = pqos_alloc_assoc_get(cpu_id, &cos_id);
+#endif
 				if (ret != PQOS_RETVAL_OK) {
 					printf("PQOS: Failed to read COS "
 						"associated to cpu %u.\n",
@@ -512,7 +517,11 @@ check_and_select_classes(unsigned cos_id_map[][PQOS_MAX_SOCKETS])
 	for (j = 0; j < m_cpu->num_cores; j++) {
 		cpu_id = m_cpu->cores[j].lcore;
 
+#if PQOS_VERSION <= 103
 		ret = pqos_l3ca_assoc_get(cpu_id, &cos_id);
+#else
+		ret = pqos_alloc_assoc_get(cpu_id, &cos_id);
+#endif
 		if (ret != PQOS_RETVAL_OK) {
 			printf("PQOS: Failed to read COS associated to "
 				"cpu %u on phy_pkg %u.\n", cpu_id, phy_pkg_id);
@@ -598,10 +607,19 @@ configure_cat(unsigned cos_id_map[][PQOS_MAX_SOCKETS])
 
 		l3ca.cdp = m_config[i].cdp;
 		if (m_config[i].cdp == 1) {
+#if PQOS_VERSION <= 103
 			l3ca.code_mask = m_config[i].code_mask;
 			l3ca.data_mask = m_config[i].data_mask;
+#else
+			l3ca.u.s.code_mask = m_config[i].code_mask;
+			l3ca.u.s.data_mask = m_config[i].data_mask;
+#endif
 		} else
+#if PQOS_VERSION <= 103
 			l3ca.ways_mask = m_config[i].mask;
+#else
+			l3ca.u.ways_mask = m_config[i].mask;
+#endif
 
 		for (j = 0; j < m_sock_count; j++) {
 			phy_pkg_id = m_sockets[j];
@@ -637,7 +655,11 @@ configure_cat(unsigned cos_id_map[][PQOS_MAX_SOCKETS])
 
 			cos_id = cos_id_map[i][phy_pkg_id];
 
+#if PQOS_VERSION <= 103
 			ret = pqos_l3ca_assoc_set(cpu_id, cos_id);
+#else
+			ret = pqos_alloc_assoc_set(cpu_id, cos_id);
+#endif
 			if (ret != PQOS_RETVAL_OK) {
 				printf("PQOS: Failed to associate COS %u to "
 					"cpu %u\n", cos_id, cpu_id);
@@ -754,24 +776,43 @@ print_cat_config(void)
 			if (tab[n].cdp == 1) {
 				printf("PQOS: COS: %u, cMASK: 0x%llx, "
 					"dMASK: 0x%llx\n", tab[n].class_id,
+#if PQOS_VERSION <= 103
 					(unsigned long long)tab[n].code_mask,
 					(unsigned long long)tab[n].data_mask);
+#else
+					(unsigned long long)tab[n].u.s.code_mask,
+					(unsigned long long)tab[n].u.s.data_mask);
+#endif
 			} else {
 				printf("PQOS: COS: %u, MASK: 0x%llx\n",
 					tab[n].class_id,
+#if PQOS_VERSION <= 103
 					(unsigned long long)tab[n].ways_mask);
+#else
+					(unsigned long long)tab[n].u.ways_mask);
+#endif
 			}
 		}
 	}
 
 	for (i = 0; i < m_sock_count; i++) {
+#if PQOS_VERSION <= 103
 		unsigned lcores[PQOS_MAX_SOCKET_CORES] = {0};
+#else
+		unsigned int *lcores = NULL;
+#endif
 		unsigned lcount = 0;
 		unsigned n = 0;
 
+#if PQOS_VERSION <= 103
 		ret = pqos_cpu_get_cores(m_cpu, m_sockets[i],
 				PQOS_MAX_SOCKET_CORES, &lcount, &lcores[0]);
 		if (ret != PQOS_RETVAL_OK) {
+#else
+		lcores = pqos_cpu_get_cores(m_cpu, m_sockets[i],
+				&lcount);
+		if (lcores == NULL || lcount == 0) {
+#endif
 			printf("PQOS: Error retrieving core information!\n");
 			return;
 		}
@@ -780,13 +821,21 @@ print_cat_config(void)
 		for (n = 0; n < lcount; n++) {
 			unsigned class_id = 0;
 
+#if PQOS_VERSION <= 103
 			ret = pqos_l3ca_assoc_get(lcores[n], &class_id);
+#else
+			ret = pqos_alloc_assoc_get(lcores[n], &class_id);
+#endif
 			if (ret == PQOS_RETVAL_OK)
 				printf("PQOS: CPU: %u, COS: %u\n", lcores[n],
 					class_id);
 			else
 				printf("PQOS: CPU: %u, ERROR\n", lcores[n]);
 		}
+
+#if PQOS_VERSION > 103
+		free(lcores);
+#endif
 	}
 
 }
@@ -849,7 +898,12 @@ cat_fini(void)
 	m_cap = NULL;
 	m_cpu = NULL;
 	m_cap_l3ca = NULL;
+#if PQOS_VERSION <= 103
 	memset(m_sockets, 0, sizeof(m_sockets));
+#else
+	if (m_sockets != NULL)
+		free(m_sockets);
+#endif
 	m_sock_count = 0;
 	memset(m_config, 0, sizeof(m_config));
 	m_config_count = 0;
@@ -875,7 +929,11 @@ cat_exit(void)
 			if (CPU_ISSET(cpu_id, &m_config[i].cpumask) == 0)
 				continue;
 
+#if PQOS_VERSION <= 103
 			ret = pqos_l3ca_assoc_set(cpu_id, 0);
+#else
+			ret = pqos_alloc_assoc_set(cpu_id, 0);
+#endif
 			if (ret != PQOS_RETVAL_OK) {
 				printf("PQOS: Failed to associate COS 0 to "
 					"cpu %u\n", cpu_id);
@@ -927,7 +985,9 @@ cat_init(int argc, char **argv)
 	/* PQoS Initialization - Check and initialize CAT capability */
 	cfg.fd_log = STDOUT_FILENO;
 	cfg.verbose = 0;
+#if PQOS_VERSION <= 103
 	cfg.cdp_cfg = PQOS_REQUIRE_CDP_ANY;
+#endif
 	ret = pqos_init(&cfg);
 	if (ret != PQOS_RETVAL_OK) {
 		printf("PQOS: Error initializing PQoS library!\n");
@@ -953,9 +1013,14 @@ cat_init(int argc, char **argv)
 	}
 
 	/* Get CPU socket information */
+#if PQOS_VERSION <= 103
 	ret = pqos_cpu_get_sockets(m_cpu, PQOS_MAX_SOCKETS, &m_sock_count,
 		m_sockets);
 	if (ret != PQOS_RETVAL_OK) {
+#else
+	m_sockets = pqos_cpu_get_sockets(m_cpu, &m_sock_count);
+	if (m_sockets == NULL) {
+#endif
 		printf("PQOS: Error retrieving CPU socket information!\n");
 		ret = -EFAULT;
 		goto err;
-- 
2.11.0

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

* [dpdk-stable] patch 'examples/l2fwd_fork: fix message pool init' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (61 preceding siblings ...)
  2017-10-30 15:35 ` [dpdk-stable] patch 'examples/l2fwd-cat: fix build with PQOS 1.4' " luca.boccassi
@ 2017-10-30 15:35 ` luca.boccassi
  2017-10-30 15:35 ` [dpdk-stable] patch 'examples/l3fwd-acl: check fseek return' " luca.boccassi
                   ` (4 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:35 UTC (permalink / raw)
  To: Xueming Li; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From e61d923874ccc4de09315bc2519b9ae2661e9740 Mon Sep 17 00:00:00 2001
From: Xueming Li <xuemingl@mellanox.com>
Date: Fri, 15 Sep 2017 23:37:21 +0800
Subject: [PATCH] examples/l2fwd_fork: fix message pool init

[ upstream commit 9b85b871cc52d1219f5a68131059e539f7ee9916 ]

Some invalid callback functions are provided to rte_pktmbuf_pool_init()
without their associated data causing a segmentation fault when the
function tries to use it. In this example, those callbacks are not
necessary, they can be safely replaced by NULL pointers.

Fixes: 95e8005a56e8 ("examples/l2fwd_fork: new app")

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
 examples/multi_process/l2fwd_fork/main.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/examples/multi_process/l2fwd_fork/main.c b/examples/multi_process/l2fwd_fork/main.c
index 820448bc2..88b336e14 100644
--- a/examples/multi_process/l2fwd_fork/main.c
+++ b/examples/multi_process/l2fwd_fork/main.c
@@ -1205,10 +1205,7 @@ main(int argc, char **argv)
 	message_pool = rte_mempool_create("ms_msg_pool",
 			   NB_CORE_MSGBUF * RTE_MAX_LCORE,
 			   sizeof(enum l2fwd_cmd), NB_CORE_MSGBUF / 2,
-			   0,
-			   rte_pktmbuf_pool_init, NULL,
-			   rte_pktmbuf_init, NULL,
-			   rte_socket_id(), 0);
+			   0, NULL, NULL, NULL, NULL, rte_socket_id(), 0);
 
 	if (message_pool == NULL)
 		rte_exit(EXIT_FAILURE, "Create msg mempool failed\n");
-- 
2.11.0

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

* [dpdk-stable] patch 'examples/l3fwd-acl: check fseek return' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (62 preceding siblings ...)
  2017-10-30 15:35 ` [dpdk-stable] patch 'examples/l2fwd_fork: fix message pool init' " luca.boccassi
@ 2017-10-30 15:35 ` luca.boccassi
  2017-10-30 15:35 ` [dpdk-stable] patch 'examples/performance-thread: check thread creation' " luca.boccassi
                   ` (3 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:35 UTC (permalink / raw)
  To: Kuba Kozak; +Cc: Konstantin Ananyev, Zhiyong Yang, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 09cf3b1c4a30ba0bc1542826109d7806e4cb0881 Mon Sep 17 00:00:00 2001
From: Kuba Kozak <kubax.kozak@intel.com>
Date: Tue, 3 Oct 2017 13:48:02 +0200
Subject: [PATCH] examples/l3fwd-acl: check fseek return

[ upstream commit ab9cfe43c28efb3576396e7133af64b25b8785f3 ]

Add return value check and error handling for fseek call.

Coverity issue: 143435
Fixes: 361b2e9559fc ("acl: new sample l3fwd-acl")

Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Zhiyong Yang <zhiyong.yang@intel.com>
---
 examples/l3fwd-acl/main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index 9307d48c5..0d0d8bfc3 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -1027,6 +1027,7 @@ add_rules(const char *rule_path,
 	char buff[LINE_MAX];
 	FILE *fh = fopen(rule_path, "rb");
 	unsigned int i = 0;
+	int val;
 
 	if (fh == NULL)
 		rte_exit(EXIT_FAILURE, "%s: Open %s failed\n", __func__,
@@ -1043,7 +1044,11 @@ add_rules(const char *rule_path,
 		rte_exit(EXIT_FAILURE, "Not find any route entries in %s!\n",
 				rule_path);
 
-	fseek(fh, 0, SEEK_SET);
+	val = fseek(fh, 0, SEEK_SET);
+	if (val < 0) {
+		rte_exit(EXIT_FAILURE, "%s: File seek operation failed\n",
+			__func__);
+	}
 
 	acl_rules = calloc(acl_num, rule_size);
 
-- 
2.11.0

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

* [dpdk-stable] patch 'examples/performance-thread: check thread creation' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (63 preceding siblings ...)
  2017-10-30 15:35 ` [dpdk-stable] patch 'examples/l3fwd-acl: check fseek return' " luca.boccassi
@ 2017-10-30 15:35 ` luca.boccassi
  2017-10-30 15:35 ` [dpdk-stable] patch 'examples/performance-thread: fix out-of-bounds sched array' " luca.boccassi
                   ` (2 subsequent siblings)
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:35 UTC (permalink / raw)
  To: Jacek Piasecki; +Cc: Michal Jastrzebski, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From c6d6f502a67367f47cd5dd9ab7fe0c10103c1747 Mon Sep 17 00:00:00 2001
From: Jacek Piasecki <jacekx.piasecki@intel.com>
Date: Thu, 12 Oct 2017 13:44:44 +0200
Subject: [PATCH] examples/performance-thread: check thread creation

[ upstream commit 842ee032e41e678568ffbce29172b346dc09c82b ]

There was a call for thread create function without result check.
Added result check and message printout after failure.

Coverity issue: 143441
Fixes: 433ba6228f9a ("examples/performance-thread: add pthread_shim app")

Signed-off-by: Jacek Piasecki <jacekx.piasecki@intel.com>
Acked-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
---
 examples/performance-thread/pthread_shim/main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/examples/performance-thread/pthread_shim/main.c b/examples/performance-thread/pthread_shim/main.c
index 850b009d3..febae39be 100644
--- a/examples/performance-thread/pthread_shim/main.c
+++ b/examples/performance-thread/pthread_shim/main.c
@@ -161,6 +161,7 @@ static void initial_lthread(void *args __attribute__((unused)))
 	pthread_override_set(1);
 
 	uint64_t i;
+	int ret;
 
 	/* initialize mutex for shared counter */
 	print_count = 0;
@@ -187,7 +188,10 @@ static void initial_lthread(void *args __attribute__((unused)))
 		pthread_attr_setaffinity_np(&attr, sizeof(rte_cpuset_t), &cpuset);
 
 		/* create the thread */
-		pthread_create(&tid[i], &attr, helloworld_pthread, (void *) i);
+		ret = pthread_create(&tid[i], &attr,
+				helloworld_pthread, (void *) i);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE, "Cannot create helloworld thread\n");
 	}
 
 	/* wait for 1s to allow threads
-- 
2.11.0

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

* [dpdk-stable] patch 'examples/performance-thread: fix out-of-bounds sched array' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (64 preceding siblings ...)
  2017-10-30 15:35 ` [dpdk-stable] patch 'examples/performance-thread: check thread creation' " luca.boccassi
@ 2017-10-30 15:35 ` luca.boccassi
  2017-10-30 15:35 ` [dpdk-stable] patch 'examples/performance-thread: fix out-of-bounds tls " luca.boccassi
  2017-11-02 12:02 ` [dpdk-stable] patch 'eal/bsd: fix missing interrupt stub functions' " luca.boccassi
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:35 UTC (permalink / raw)
  To: Slawomir Mrozowicz; +Cc: Michal Jastrzebski, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 21e77ae83e5939c5f95fcdd464833b1e3896d93a Mon Sep 17 00:00:00 2001
From: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Date: Wed, 20 Sep 2017 09:47:34 +0200
Subject: [PATCH] examples/performance-thread: fix out-of-bounds sched array

[ upstream commit 72481c87ec80542cabf65fa8ad32ac381ee5ce4e ]

Overrunning array schedcore of 128 8-byte elements at element index 128
using index core id.
Fixed by correct check index lcoreid condition and
change type of lcoreid to unsigned.

Coverity issue: 143459, 143461
Fixes: 116819b9ed0d ("examples/performance-thread: add lthread subsystem")

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Acked-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
---
 examples/performance-thread/common/lthread.h       |  2 +-
 examples/performance-thread/common/lthread_sched.c | 14 ++++++++------
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/examples/performance-thread/common/lthread.h b/examples/performance-thread/common/lthread.h
index 8c77af82e..01843ba5a 100644
--- a/examples/performance-thread/common/lthread.h
+++ b/examples/performance-thread/common/lthread.h
@@ -83,7 +83,7 @@ int _lthread_desched_sleep(struct lthread *lt);
 
 void _lthread_free(struct lthread *lt);
 
-struct lthread_sched *_lthread_sched_get(int lcore_id);
+struct lthread_sched *_lthread_sched_get(unsigned int lcore_id);
 
 struct lthread_stack *_stack_alloc(void);
 
diff --git a/examples/performance-thread/common/lthread_sched.c b/examples/performance-thread/common/lthread_sched.c
index c64c21ffb..fbda112f4 100644
--- a/examples/performance-thread/common/lthread_sched.c
+++ b/examples/performance-thread/common/lthread_sched.c
@@ -562,11 +562,14 @@ void lthread_run(void)
  * Return the scheduler for this lcore
  *
  */
-struct lthread_sched *_lthread_sched_get(int lcore_id)
+struct lthread_sched *_lthread_sched_get(unsigned int lcore_id)
 {
-	if (lcore_id > LTHREAD_MAX_LCORES)
-		return NULL;
-	return schedcore[lcore_id];
+	struct lthread_sched *res = NULL;
+
+	if (lcore_id < LTHREAD_MAX_LCORES)
+		res = schedcore[lcore_id];
+
+	return res;
 }
 
 /*
@@ -578,10 +581,9 @@ int lthread_set_affinity(unsigned lcoreid)
 	struct lthread *lt = THIS_LTHREAD;
 	struct lthread_sched *dest_sched;
 
-	if (unlikely(lcoreid > LTHREAD_MAX_LCORES))
+	if (unlikely(lcoreid >= LTHREAD_MAX_LCORES))
 		return POSIX_ERRNO(EINVAL);
 
-
 	DIAG_EVENT(lt, LT_DIAG_LTHREAD_AFFINITY, lcoreid, 0);
 
 	dest_sched = schedcore[lcoreid];
-- 
2.11.0

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

* [dpdk-stable] patch 'examples/performance-thread: fix out-of-bounds tls array' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (65 preceding siblings ...)
  2017-10-30 15:35 ` [dpdk-stable] patch 'examples/performance-thread: fix out-of-bounds sched array' " luca.boccassi
@ 2017-10-30 15:35 ` luca.boccassi
  2017-11-02 12:02 ` [dpdk-stable] patch 'eal/bsd: fix missing interrupt stub functions' " luca.boccassi
  67 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-10-30 15:35 UTC (permalink / raw)
  To: Slawomir Mrozowicz; +Cc: Michal Jastrzebski, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 5ab17b0175e2f8c25292168b83b177501af8e19e Mon Sep 17 00:00:00 2001
From: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Date: Wed, 20 Sep 2017 10:20:24 +0200
Subject: [PATCH] examples/performance-thread: fix out-of-bounds tls array

[ upstream commit c874523dc9fc9c384a760eb5db8c6f295185e5e3 ]

Overrunning array per_lcore_this_sched->current_lthread->tls->data of
1024 8-byte elements at element index 1024 using index k.
Fixed by correct check k condition.

Coverity issue: 143462, 143463
Fixes: 116819b9ed0d ("examples/performance-thread: add lthread subsystem")

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Acked-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
---
 examples/performance-thread/common/lthread_tls.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/examples/performance-thread/common/lthread_tls.c b/examples/performance-thread/common/lthread_tls.c
index 6876f831b..e58388b99 100644
--- a/examples/performance-thread/common/lthread_tls.c
+++ b/examples/performance-thread/common/lthread_tls.c
@@ -199,11 +199,12 @@ void _lthread_tls_destroy(struct lthread *lt)
 void
 *lthread_getspecific(unsigned int k)
 {
+	void *res = NULL;
 
-	if (k > LTHREAD_MAX_KEYS)
-		return NULL;
+	if (k < LTHREAD_MAX_KEYS)
+		res = THIS_LTHREAD->tls->data[k];
 
-	return THIS_LTHREAD->tls->data[k];
+	return res;
 }
 
 /*
@@ -213,7 +214,7 @@ void
  */
 int lthread_setspecific(unsigned int k, const void *data)
 {
-	if (k > LTHREAD_MAX_KEYS)
+	if (k >= LTHREAD_MAX_KEYS)
 		return POSIX_ERRNO(EINVAL);
 
 	int n = THIS_LTHREAD->tls->nb_keys_inuse;
-- 
2.11.0

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

* [dpdk-stable] patch 'eal/bsd: fix missing interrupt stub functions' has been queued to LTS release 16.11.4
  2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
                   ` (66 preceding siblings ...)
  2017-10-30 15:35 ` [dpdk-stable] patch 'examples/performance-thread: fix out-of-bounds tls " luca.boccassi
@ 2017-11-02 12:02 ` luca.boccassi
  2017-11-02 12:02   ` [dpdk-stable] patch 'net/virtio: flush Rx queues on start' " luca.boccassi
                     ` (16 more replies)
  67 siblings, 17 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-02 12:02 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From ea90023f37412eb985a5891e69747958190af580 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Thu, 19 Oct 2017 17:36:26 +0100
Subject: [PATCH] eal/bsd: fix missing interrupt stub functions

[ upstream commit 3a207c8ff4a8b56a49001e0d1957150298b24794 ]

A number of interrupt functions only existed on Linux. Adding in stubs
for these functions corrects this omission, and allows the map files for
both Linux and FreeBSD to be identical.

Fixes: 9efe9c6cdcac ("eal/linux: add epoll wrappers")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/librte_eal/bsdapp/eal/eal_interrupts.c    | 29 +++++++++++++++++++++++++++
 lib/librte_eal/bsdapp/eal/rte_eal_version.map |  3 +++
 2 files changed, 32 insertions(+)

diff --git a/lib/librte_eal/bsdapp/eal/eal_interrupts.c b/lib/librte_eal/bsdapp/eal/eal_interrupts.c
index 836e48369..f7e340d0b 100644
--- a/lib/librte_eal/bsdapp/eal/eal_interrupts.c
+++ b/lib/librte_eal/bsdapp/eal/eal_interrupts.c
@@ -117,3 +117,32 @@ rte_intr_cap_multiple(struct rte_intr_handle *intr_handle)
 	RTE_SET_USED(intr_handle);
 	return 0;
 }
+
+int
+rte_epoll_wait(int epfd, struct rte_epoll_event *events,
+		int maxevents, int timeout)
+{
+	RTE_SET_USED(epfd);
+	RTE_SET_USED(events);
+	RTE_SET_USED(maxevents);
+	RTE_SET_USED(timeout);
+
+	return -ENOTSUP;
+}
+
+int
+rte_epoll_ctl(int epfd, int op, int fd, struct rte_epoll_event *event)
+{
+	RTE_SET_USED(epfd);
+	RTE_SET_USED(op);
+	RTE_SET_USED(fd);
+	RTE_SET_USED(event);
+
+	return -ENOTSUP;
+}
+
+int
+rte_intr_tls_epfd(void)
+{
+	return -ENOTSUP;
+}
diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map
index 2f81f7c09..ca4ac27b5 100644
--- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map
+++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map
@@ -117,11 +117,14 @@ DPDK_2.1 {
 	rte_eal_pci_detach;
 	rte_eal_pci_read_config;
 	rte_eal_pci_write_config;
+	rte_epoll_ctl;
+	rte_epoll_wait;
 	rte_intr_allow_others;
 	rte_intr_dp_is_en;
 	rte_intr_efd_disable;
 	rte_intr_efd_enable;
 	rte_intr_rx_ctl;
+	rte_intr_tls_epfd;
 	rte_memzone_free;
 
 } DPDK_2.0;
-- 
2.11.0

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

* [dpdk-stable] patch 'net/virtio: flush Rx queues on start' has been queued to LTS release 16.11.4
  2017-11-02 12:02 ` [dpdk-stable] patch 'eal/bsd: fix missing interrupt stub functions' " luca.boccassi
@ 2017-11-02 12:02   ` luca.boccassi
  2017-11-02 12:02   ` [dpdk-stable] patch 'net/virtio: fix Tx packet length stats' " luca.boccassi
                     ` (15 subsequent siblings)
  16 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-02 12:02 UTC (permalink / raw)
  To: Tiwei Bie; +Cc: Jens Freimann, Yuanhan Liu, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 75d2da80bb92eff61bdce418a84445103f4b085c Mon Sep 17 00:00:00 2001
From: Tiwei Bie <tiwei.bie@intel.com>
Date: Fri, 20 Oct 2017 10:09:28 +0800
Subject: [PATCH] net/virtio: flush Rx queues on start

[ upstream commit d8227497ec5c3de75fe378e09fc9673ae097fa73 ]

After starting a device, the driver shouldn't deliver the
packets that already existed before the device is started
to applications. Otherwise it will lead to incorrect packet
collection for port state. This patch fixes this issue by
flushing the Rx queues when starting the device.

Fixes: a85786dc816f ("virtio: fix states handling during initialization")

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
---
 drivers/net/virtio/virtio_ethdev.c |  2 ++
 drivers/net/virtio/virtio_rxtx.c   |  2 +-
 drivers/net/virtio/virtqueue.c     | 25 +++++++++++++++++++++++++
 drivers/net/virtio/virtqueue.h     |  5 +++++
 4 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 6903368db..8592485d7 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1564,6 +1564,8 @@ virtio_dev_start(struct rte_eth_dev *dev)
 
 	for (i = 0; i < dev->data->nb_rx_queues; i++) {
 		rxvq = dev->data->rx_queues[i];
+		/* Flush the old packets */
+		virtqueue_flush(rxvq->vq);
 		virtqueue_notify(rxvq->vq);
 	}
 
diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index 08e4e126b..aa985fb6b 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -72,7 +72,7 @@
 #define VIRTIO_SIMPLE_FLAGS ((uint32_t)ETH_TXQ_FLAGS_NOMULTSEGS | \
 	ETH_TXQ_FLAGS_NOOFFLOADS)
 
-static void
+void
 vq_ring_free_chain(struct virtqueue *vq, uint16_t desc_idx)
 {
 	struct vring_desc *dp, *dp_tail;
diff --git a/drivers/net/virtio/virtqueue.c b/drivers/net/virtio/virtqueue.c
index 7f60e3ef1..4f8707ae3 100644
--- a/drivers/net/virtio/virtqueue.c
+++ b/drivers/net/virtio/virtqueue.c
@@ -70,3 +70,28 @@ virtqueue_detatch_unused(struct virtqueue *vq)
 		}
 	return NULL;
 }
+
+/* Flush the elements in the used ring. */
+void
+virtqueue_flush(struct virtqueue *vq)
+{
+	struct vring_used_elem *uep;
+	struct vq_desc_extra *dxp;
+	uint16_t used_idx, desc_idx;
+	uint16_t nb_used, i;
+
+	nb_used = VIRTQUEUE_NUSED(vq);
+
+	for (i = 0; i < nb_used; i++) {
+		used_idx = vq->vq_used_cons_idx & (vq->vq_nentries - 1);
+		uep = &vq->vq_ring.used->ring[used_idx];
+		desc_idx = (uint16_t)uep->id;
+		dxp = &vq->vq_descx[desc_idx];
+		if (dxp->cookie != NULL) {
+			rte_pktmbuf_free(dxp->cookie);
+			dxp->cookie = NULL;
+		}
+		vq->vq_used_cons_idx++;
+		vq_ring_free_chain(vq, desc_idx);
+	}
+}
diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
index 569c251c8..ec967a5bd 100644
--- a/drivers/net/virtio/virtqueue.h
+++ b/drivers/net/virtio/virtqueue.h
@@ -290,6 +290,9 @@ void virtqueue_dump(struct virtqueue *vq);
  */
 struct rte_mbuf *virtqueue_detatch_unused(struct virtqueue *vq);
 
+/* Flush the elements in the used ring. */
+void virtqueue_flush(struct virtqueue *vq);
+
 static inline int
 virtqueue_full(const struct virtqueue *vq)
 {
@@ -298,6 +301,8 @@ virtqueue_full(const struct virtqueue *vq)
 
 #define VIRTQUEUE_NUSED(vq) ((uint16_t)((vq)->vq_ring.used->idx - (vq)->vq_used_cons_idx))
 
+void vq_ring_free_chain(struct virtqueue *vq, uint16_t desc_idx);
+
 static inline void
 vq_update_avail_idx(struct virtqueue *vq)
 {
-- 
2.11.0

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

* [dpdk-stable] patch 'net/virtio: fix Tx packet length stats' has been queued to LTS release 16.11.4
  2017-11-02 12:02 ` [dpdk-stable] patch 'eal/bsd: fix missing interrupt stub functions' " luca.boccassi
  2017-11-02 12:02   ` [dpdk-stable] patch 'net/virtio: flush Rx queues on start' " luca.boccassi
@ 2017-11-02 12:02   ` luca.boccassi
  2017-11-02 12:02   ` [dpdk-stable] patch 'examples/qos_sched: fix uninitialized config' " luca.boccassi
                     ` (14 subsequent siblings)
  16 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-02 12:02 UTC (permalink / raw)
  To: Zhiyong Yang; +Cc: Maxime Coquelin, Yuanhan Liu, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From ab7510c1a80d12547abd886610851c71449f1ac9 Mon Sep 17 00:00:00 2001
From: Zhiyong Yang <zhiyong.yang@intel.com>
Date: Tue, 24 Oct 2017 11:06:14 +0800
Subject: [PATCH] net/virtio: fix Tx packet length stats

[ upstream commit f1216c1eca5a54706af9f13133d06b3477099f8b ]

In the function virtqueue_enqueue_xmit(), when can_push is true,
vtnet_hdr_size is added to pkt_len by calling rte_pktmbuf_prepend.
which is wrong for pkt stats, virtio header length should be subtracted
before calling stats function.

Fixes: 58169a9c8153 ("net/virtio: support Tx checksum offload")

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
---
 drivers/net/virtio/virtio_rxtx.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index aa985fb6b..43fac63b6 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -291,6 +291,10 @@ virtqueue_enqueue_xmit(struct virtnet_tx *txvq, struct rte_mbuf *cookie,
 		/* prepend cannot fail, checked by caller */
 		hdr = (struct virtio_net_hdr *)
 			rte_pktmbuf_prepend(cookie, head_size);
+		/* rte_pktmbuf_prepend() counts the hdr size to the pkt length,
+		 * which is wrong. Below subtract restores correct pkt size.
+		 */
+		cookie->pkt_len -= head_size;
 		/* if offload disabled, it is not zeroed below, do it now */
 		if (offload == 0) {
 			ASSIGN_UNLESS_EQUAL(hdr->csum_start, 0);
-- 
2.11.0

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

* [dpdk-stable] patch 'examples/qos_sched: fix uninitialized config' has been queued to LTS release 16.11.4
  2017-11-02 12:02 ` [dpdk-stable] patch 'eal/bsd: fix missing interrupt stub functions' " luca.boccassi
  2017-11-02 12:02   ` [dpdk-stable] patch 'net/virtio: flush Rx queues on start' " luca.boccassi
  2017-11-02 12:02   ` [dpdk-stable] patch 'net/virtio: fix Tx packet length stats' " luca.boccassi
@ 2017-11-02 12:02   ` luca.boccassi
  2017-11-02 12:02   ` [dpdk-stable] patch 'examples/ipsec-secgw: fix IP version check' " luca.boccassi
                     ` (13 subsequent siblings)
  16 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-02 12:02 UTC (permalink / raw)
  To: Jasvinder Singh; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 9da80b9877bae699fdd98158ba536d15a26ebf16 Mon Sep 17 00:00:00 2001
From: Jasvinder Singh <jasvinder.singh@intel.com>
Date: Tue, 24 Oct 2017 10:09:57 +0100
Subject: [PATCH] examples/qos_sched: fix uninitialized config

[ upstream commit 96b5077cfaf95cd38dc7644e39036ad94e6435c8 ]

Fix problem with uninitialized rx/tx deferred_start flags of the struct
rte_eth_rxconf/txconf by initializing with 0 value (deferred start of
the rx/tx queues is turned off). This setting allows device rx/tx
queues to start with rte_eth_dev_start().

Coverity issue: 194999, 195009
Fixes: de3cfa2c9823 ("sched: initial import")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
---
 examples/qos_sched/init.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index fe0221c6f..51ba5fb75 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -116,6 +116,7 @@ app_init_port(uint8_t portid, struct rte_mempool *mp)
 	rx_conf.rx_thresh.wthresh = rx_thresh.wthresh;
 	rx_conf.rx_free_thresh = 32;
 	rx_conf.rx_drop_en = 0;
+	rx_conf.rx_deferred_start = 0;
 
 	tx_conf.tx_thresh.pthresh = tx_thresh.pthresh;
 	tx_conf.tx_thresh.hthresh = tx_thresh.hthresh;
@@ -123,6 +124,7 @@ app_init_port(uint8_t portid, struct rte_mempool *mp)
 	tx_conf.tx_free_thresh = 0;
 	tx_conf.tx_rs_thresh = 0;
 	tx_conf.txq_flags = ETH_TXQ_FLAGS_NOMULTSEGS | ETH_TXQ_FLAGS_NOOFFLOADS;
+	tx_conf.tx_deferred_start = 0;
 
 	/* init port */
 	RTE_LOG(INFO, APP, "Initializing port %"PRIu8"... ", portid);
-- 
2.11.0

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

* [dpdk-stable] patch 'examples/ipsec-secgw: fix IP version check' has been queued to LTS release 16.11.4
  2017-11-02 12:02 ` [dpdk-stable] patch 'eal/bsd: fix missing interrupt stub functions' " luca.boccassi
                     ` (2 preceding siblings ...)
  2017-11-02 12:02   ` [dpdk-stable] patch 'examples/qos_sched: fix uninitialized config' " luca.boccassi
@ 2017-11-02 12:02   ` luca.boccassi
  2017-11-02 12:02   ` [dpdk-stable] patch 'cryptodev: fix build with -Ofast' " luca.boccassi
                     ` (12 subsequent siblings)
  16 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-02 12:02 UTC (permalink / raw)
  To: Tomasz Duszynski; +Cc: Sergio Gonzalez Monroy, Aviad Yehezkel, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 2961139beccc412b9082946e660d369e3a6859e2 Mon Sep 17 00:00:00 2001
From: Tomasz Duszynski <tdu@semihalf.com>
Date: Fri, 13 Oct 2017 14:50:09 +0200
Subject: [PATCH] examples/ipsec-secgw: fix IP version check

[ upstream commit 3417350e7f1726d6495e0d85e2212f6d4f959e4e ]

Since new_ip and ip4 are overlapping buffers copying ip4 over new_ip
using memmove() might overwrite memory at ip4. This could happen if
following condition holds:

ip_hdr_len > sizeof(struct esp_hdr) + sa->iv_len

Thus using ip4 to check ip version is wrong as it might not contain
proper value.

Fixes: f159e70b0922 ("examples/ipsec-secgw: support transport mode")

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Reviewed-by: Aviad Yehezkel <aviadye@mellanox.com>
---
 examples/ipsec-secgw/esp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/ipsec-secgw/esp.c b/examples/ipsec-secgw/esp.c
index ec5a2e627..c5f30f7d9 100644
--- a/examples/ipsec-secgw/esp.c
+++ b/examples/ipsec-secgw/esp.c
@@ -294,8 +294,8 @@ esp_outbound(struct rte_mbuf *m, struct ipsec_sa *sa,
 				sizeof(struct esp_hdr) + sa->iv_len);
 		memmove(new_ip, ip4, ip_hdr_len);
 		esp = (struct esp_hdr *)(new_ip + ip_hdr_len);
+		ip4 = (struct ip *)new_ip;
 		if (likely(ip4->ip_v == IPVERSION)) {
-			ip4 = (struct ip *)new_ip;
 			ip4->ip_p = IPPROTO_ESP;
 			ip4->ip_len = htons(rte_pktmbuf_data_len(m));
 		} else {
-- 
2.11.0

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

* [dpdk-stable] patch 'cryptodev: fix build with -Ofast' has been queued to LTS release 16.11.4
  2017-11-02 12:02 ` [dpdk-stable] patch 'eal/bsd: fix missing interrupt stub functions' " luca.boccassi
                     ` (3 preceding siblings ...)
  2017-11-02 12:02   ` [dpdk-stable] patch 'examples/ipsec-secgw: fix IP version check' " luca.boccassi
@ 2017-11-02 12:02   ` luca.boccassi
  2017-11-02 12:02   ` [dpdk-stable] patch 'examples/ipsec-secgw: fix IPv6 payload length' " luca.boccassi
                     ` (11 subsequent siblings)
  16 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-02 12:02 UTC (permalink / raw)
  To: Ian Stokes; +Cc: Pablo de Lara, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 3e2ce4dd2dbe9ec12b473e9f4db51c5dcd0011b9 Mon Sep 17 00:00:00 2001
From: Ian Stokes <ian.stokes@intel.com>
Date: Tue, 17 Oct 2017 15:15:06 +0100
Subject: [PATCH] cryptodev: fix build with -Ofast

[ upstream commit 812f48370f93198f082f98a69f0882b6ae1bde61 ]

When compiling with an application that includes rte_cryptodev.h with
Ofast, an error is reported regarding enumeration
RTE_CRYPTO_OP_TYPE_UNDEFINED not handled in switch case in function
 __rte_crypto_op_reset().

Fix this by adding a case for RTE_CRYPTO_OP_TYPE_UNDEFINED.

Fixes: c0f87eb5252b ("cryptodev: change burst API to be crypto op oriented")

Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 lib/librte_cryptodev/rte_crypto.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/librte_cryptodev/rte_crypto.h b/lib/librte_cryptodev/rte_crypto.h
index 901951888..0ec8e4127 100644
--- a/lib/librte_cryptodev/rte_crypto.h
+++ b/lib/librte_cryptodev/rte_crypto.h
@@ -141,6 +141,7 @@ __rte_crypto_op_reset(struct rte_crypto_op *op, enum rte_crypto_op_type type)
 
 		__rte_crypto_sym_op_reset(op->sym);
 		break;
+	case RTE_CRYPTO_OP_TYPE_UNDEFINED:
 	default:
 		break;
 	}
-- 
2.11.0

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

* [dpdk-stable] patch 'examples/ipsec-secgw: fix IPv6 payload length' has been queued to LTS release 16.11.4
  2017-11-02 12:02 ` [dpdk-stable] patch 'eal/bsd: fix missing interrupt stub functions' " luca.boccassi
                     ` (4 preceding siblings ...)
  2017-11-02 12:02   ` [dpdk-stable] patch 'cryptodev: fix build with -Ofast' " luca.boccassi
@ 2017-11-02 12:02   ` luca.boccassi
  2017-11-02 12:02   ` [dpdk-stable] patch 'app/testpmd: fix RSS structure initialisation' " luca.boccassi
                     ` (10 subsequent siblings)
  16 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-02 12:02 UTC (permalink / raw)
  To: Tomasz Duszynski; +Cc: Sergio Gonzalez Monroy, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 8978c2082e5cd1719af9695240fe38a5f62de410 Mon Sep 17 00:00:00 2001
From: Tomasz Duszynski <tdu@semihalf.com>
Date: Fri, 13 Oct 2017 10:04:36 +0200
Subject: [PATCH] examples/ipsec-secgw: fix IPv6 payload length

[ upstream commit b43a81319b2411bbdb96bd349cd3cdfd66714777 ]

IPv6 payload length header field should contain only the number of bytes
following the IPv6 header and not the entire packet size.

Fixes: f159e70b0922 ("examples/ipsec-secgw: support transport mode")
Fixes: 906257e965b7 ("examples/ipsec-secgw: support IPv6")

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
---
 examples/ipsec-secgw/esp.c  | 6 ++++--
 examples/ipsec-secgw/ipip.h | 3 ++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/examples/ipsec-secgw/esp.c b/examples/ipsec-secgw/esp.c
index c5f30f7d9..1a2f07edb 100644
--- a/examples/ipsec-secgw/esp.c
+++ b/examples/ipsec-secgw/esp.c
@@ -199,7 +199,8 @@ esp_inbound_post(struct rte_mbuf *m, struct ipsec_sa *sa,
 			/* XXX No option headers supported */
 			memmove(ip6, ip, sizeof(struct ip6_hdr));
 			ip6->ip6_nxt = *nexthdr;
-			ip6->ip6_plen = htons(rte_pktmbuf_data_len(m));
+			ip6->ip6_plen = htons(rte_pktmbuf_data_len(m) -
+					      sizeof(struct ip6_hdr));
 		}
 	} else
 		ipip_inbound(m, sizeof(struct esp_hdr) + sa->iv_len);
@@ -301,7 +302,8 @@ esp_outbound(struct rte_mbuf *m, struct ipsec_sa *sa,
 		} else {
 			ip6 = (struct ip6_hdr *)new_ip;
 			ip6->ip6_nxt = IPPROTO_ESP;
-			ip6->ip6_plen = htons(rte_pktmbuf_data_len(m));
+			ip6->ip6_plen = htons(rte_pktmbuf_data_len(m) -
+					      sizeof(struct ip6_hdr));
 		}
 	}
 
diff --git a/examples/ipsec-secgw/ipip.h b/examples/ipsec-secgw/ipip.h
index ff1dccdb8..93393d527 100644
--- a/examples/ipsec-secgw/ipip.h
+++ b/examples/ipsec-secgw/ipip.h
@@ -72,7 +72,8 @@ ipip_outbound(struct rte_mbuf *m, uint32_t offset, uint32_t is_ipv6,
 
 		/* Per RFC4301 5.1.2.1 */
 		outip6->ip6_flow = htonl(IP6_VERSION << 28 | ds_ecn << 20);
-		outip6->ip6_plen = htons(rte_pktmbuf_data_len(m));
+		outip6->ip6_plen = htons(rte_pktmbuf_data_len(m) -
+					 sizeof(struct ip6_hdr));
 
 		outip6->ip6_nxt = IPPROTO_ESP;
 		outip6->ip6_hops = IPDEFTTL;
-- 
2.11.0

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

* [dpdk-stable] patch 'app/testpmd: fix RSS structure initialisation' has been queued to LTS release 16.11.4
  2017-11-02 12:02 ` [dpdk-stable] patch 'eal/bsd: fix missing interrupt stub functions' " luca.boccassi
                     ` (5 preceding siblings ...)
  2017-11-02 12:02   ` [dpdk-stable] patch 'examples/ipsec-secgw: fix IPv6 payload length' " luca.boccassi
@ 2017-11-02 12:02   ` luca.boccassi
  2017-11-02 12:02   ` [dpdk-stable] patch 'net/enic: fix packet loss after MTU change' " luca.boccassi
                     ` (9 subsequent siblings)
  16 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-02 12:02 UTC (permalink / raw)
  To: Nélio Laranjeiro; +Cc: Yongseok Koh, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From be3cb056a49463fb5766da3dc685685400316ca5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?N=C3=A9lio=20Laranjeiro?= <nelio.laranjeiro@6wind.com>
Date: Mon, 23 Oct 2017 13:17:56 +0200
Subject: [PATCH] app/testpmd: fix RSS structure initialisation

[ upstream commit f3fb0e46251080aced4354afb41decb0dc8eae2d ]

Struct rss_conf.rss_key_len is not initialised forcing the user to
verify the rss_conf.rss_key pointer to know if the key is present
or not.  rss_conf.rss_key_len should have a valid length according
to the size of the rss_key pointed.

Fixes: 560e02ee5237 ("app/testpmd: configure RSS without restart")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
---
 app/test-pmd/cmdline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 315a252e6..f4ff318dc 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1568,7 +1568,7 @@ cmd_config_rss_parsed(void *parsed_result,
 			__attribute__((unused)) void *data)
 {
 	struct cmd_config_rss *res = parsed_result;
-	struct rte_eth_rss_conf rss_conf;
+	struct rte_eth_rss_conf rss_conf = { .rss_key_len = 0, };
 	int diag;
 	uint8_t i;
 
-- 
2.11.0

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

* [dpdk-stable] patch 'net/enic: fix packet loss after MTU change' has been queued to LTS release 16.11.4
  2017-11-02 12:02 ` [dpdk-stable] patch 'eal/bsd: fix missing interrupt stub functions' " luca.boccassi
                     ` (6 preceding siblings ...)
  2017-11-02 12:02   ` [dpdk-stable] patch 'app/testpmd: fix RSS structure initialisation' " luca.boccassi
@ 2017-11-02 12:02   ` luca.boccassi
  2017-11-02 12:02   ` [dpdk-stable] patch 'net/ixgbe: fix PF DCB info' " luca.boccassi
                     ` (8 subsequent siblings)
  16 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-02 12:02 UTC (permalink / raw)
  To: John Daley; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 02d632155451162a76705a8123a668c727c954c6 Mon Sep 17 00:00:00 2001
From: John Daley <johndale@cisco.com>
Date: Mon, 23 Oct 2017 13:23:00 -0700
Subject: [PATCH] net/enic: fix packet loss after MTU change

[ upstream commit ea5f15b1c49a687eaa57d435a8bf68e553b50b30 ]

If multiple Rx queues and Rx Scatter are used and the MTU is
modified so that the number of mbufs per packet changes, packet
loss is possible.

The enic completion queue index was miscalculated leaving the
upper half of the queues uninitialized after an MTU change, possibly
leading to completions on those queues not getting processed.

Fixes: c3e09182bcd6 ("net/enic: support scatter Rx in MTU update")

Signed-off-by: John Daley <johndale@cisco.com>
---
 drivers/net/enic/enic_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 86c5539f3..b25eff4f1 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -1125,11 +1125,12 @@ static int
 enic_reinit_rq(struct enic *enic, unsigned int rq_idx)
 {
 	struct vnic_rq *sop_rq, *data_rq;
-	unsigned int cq_idx = enic_cq_rq(enic, rq_idx);
+	unsigned int cq_idx;
 	int rc = 0;
 
 	sop_rq = &enic->rq[enic_rte_rq_idx_to_sop_idx(rq_idx)];
 	data_rq = &enic->rq[enic_rte_rq_idx_to_data_idx(rq_idx)];
+	cq_idx = rq_idx;
 
 	vnic_cq_clean(&enic->cq[cq_idx]);
 	vnic_cq_init(&enic->cq[cq_idx],
-- 
2.11.0

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

* [dpdk-stable] patch 'net/ixgbe: fix PF DCB info' has been queued to LTS release 16.11.4
  2017-11-02 12:02 ` [dpdk-stable] patch 'eal/bsd: fix missing interrupt stub functions' " luca.boccassi
                     ` (7 preceding siblings ...)
  2017-11-02 12:02   ` [dpdk-stable] patch 'net/enic: fix packet loss after MTU change' " luca.boccassi
@ 2017-11-02 12:02   ` luca.boccassi
  2017-11-02 12:02   ` [dpdk-stable] patch 'app/testpmd: fix mapping of user priority to DCB TC' " luca.boccassi
                     ` (7 subsequent siblings)
  16 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-02 12:02 UTC (permalink / raw)
  To: Wei Dai; +Cc: Jingjing Wu, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 7d06b691289fc377135ae6970f1749a5abe21914 Mon Sep 17 00:00:00 2001
From: Wei Dai <wei.dai@intel.com>
Date: Mon, 23 Oct 2017 14:43:57 +0800
Subject: [PATCH] net/ixgbe: fix PF DCB info

[ upstream commit 9be9050134aaf09089f0cfb7723159eecc4a15e5 ]

When SRIOV is active, the function ixgbe_dev_get_dcb_info( )
should return the DCB traffic class info of its own queues,
not including any DCB info of the queues of any its VF.

When VMDQ is active, all queues are belonged to the PF,
the function ixgbe_dev_get_dcb_info can return DCB info
of all queues.

Fixes: 89d6728c7837 ("ethdev: get DCB information")

Signed-off-by: Wei Dai <wei.dai@intel.com>
Reviewed-by: Jingjing Wu <jingjing.wu@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 30 ++++++++++++++++++++++--------
 1 file changed, 22 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index d997304cb..73996bbec 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -6788,6 +6788,8 @@ ixgbe_dev_get_dcb_info(struct rte_eth_dev *dev,
 	struct ixgbe_dcb_config *dcb_config =
 			IXGBE_DEV_PRIVATE_TO_DCB_CFG(dev->data->dev_private);
 	struct ixgbe_dcb_tc_config *tc;
+	struct rte_eth_dcb_tc_queue_mapping *tc_queue;
+	uint8_t nb_tcs;
 	uint8_t i, j;
 
 	if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_DCB_FLAG)
@@ -6795,19 +6797,31 @@ ixgbe_dev_get_dcb_info(struct rte_eth_dev *dev,
 	else
 		dcb_info->nb_tcs = 1;
 
+	tc_queue = &dcb_info->tc_queue;
+	nb_tcs = dcb_info->nb_tcs;
+
 	if (dcb_config->vt_mode) { /* vt is enabled*/
 		struct rte_eth_vmdq_dcb_conf *vmdq_rx_conf =
 				&dev->data->dev_conf.rx_adv_conf.vmdq_dcb_conf;
 		for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++)
 			dcb_info->prio_tc[i] = vmdq_rx_conf->dcb_tc[i];
-		for (i = 0; i < vmdq_rx_conf->nb_queue_pools; i++) {
-			for (j = 0; j < dcb_info->nb_tcs; j++) {
-				dcb_info->tc_queue.tc_rxq[i][j].base =
-						i * dcb_info->nb_tcs + j;
-				dcb_info->tc_queue.tc_rxq[i][j].nb_queue = 1;
-				dcb_info->tc_queue.tc_txq[i][j].base =
-						i * dcb_info->nb_tcs + j;
-				dcb_info->tc_queue.tc_txq[i][j].nb_queue = 1;
+		if (RTE_ETH_DEV_SRIOV(dev).active > 0) {
+			for (j = 0; j < nb_tcs; j++) {
+				tc_queue->tc_rxq[0][j].base = j;
+				tc_queue->tc_rxq[0][j].nb_queue = 1;
+				tc_queue->tc_txq[0][j].base = j;
+				tc_queue->tc_txq[0][j].nb_queue = 1;
+			}
+		} else {
+			for (i = 0; i < vmdq_rx_conf->nb_queue_pools; i++) {
+				for (j = 0; j < nb_tcs; j++) {
+					tc_queue->tc_rxq[i][j].base =
+						i * nb_tcs + j;
+					tc_queue->tc_rxq[i][j].nb_queue = 1;
+					tc_queue->tc_txq[i][j].base =
+						i * nb_tcs + j;
+					tc_queue->tc_txq[i][j].nb_queue = 1;
+				}
 			}
 		}
 	} else { /* vt is disabled*/
-- 
2.11.0

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

* [dpdk-stable] patch 'app/testpmd: fix mapping of user priority to DCB TC' has been queued to LTS release 16.11.4
  2017-11-02 12:02 ` [dpdk-stable] patch 'eal/bsd: fix missing interrupt stub functions' " luca.boccassi
                     ` (8 preceding siblings ...)
  2017-11-02 12:02   ` [dpdk-stable] patch 'net/ixgbe: fix PF DCB info' " luca.boccassi
@ 2017-11-02 12:02   ` luca.boccassi
  2017-11-02 12:02   ` [dpdk-stable] patch 'net/bnxt: fix Tx offload capability' " luca.boccassi
                     ` (6 subsequent siblings)
  16 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-02 12:02 UTC (permalink / raw)
  To: Wei Dai; +Cc: Jingjing Wu, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 02bb8e4b1cd38108e92c624de233daaf6d4b1dd8 Mon Sep 17 00:00:00 2001
From: Wei Dai <wei.dai@intel.com>
Date: Mon, 23 Oct 2017 15:25:16 +0800
Subject: [PATCH] app/testpmd: fix mapping of user priority to DCB TC

[ upstream commit f59908fe499bc0e908295bf8ef874048f55186cd ]

When number of DCB traffic class is 4, user priority should be
mapped to traffic class 0/1/2/3.

Fixes: cb60ede6e3b6 ("ethdev: rename DCB field in config structs")

Signed-off-by: Wei Dai <wei.dai@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
---
 app/test-pmd/testpmd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index ce48ca03d..9de01fed2 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1900,8 +1900,8 @@ get_eth_dcb_conf(struct rte_eth_conf *eth_conf,
 				1 << (i % vmdq_rx_conf->nb_queue_pools);
 		}
 		for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) {
-			vmdq_rx_conf->dcb_tc[i] = i;
-			vmdq_tx_conf->dcb_tc[i] = i;
+			vmdq_rx_conf->dcb_tc[i] = i % num_tcs;
+			vmdq_tx_conf->dcb_tc[i] = i % num_tcs;
 		}
 
 		/* set DCB mode of RX and TX of multiple queues */
-- 
2.11.0

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

* [dpdk-stable] patch 'net/bnxt: fix Tx offload capability' has been queued to LTS release 16.11.4
  2017-11-02 12:02 ` [dpdk-stable] patch 'eal/bsd: fix missing interrupt stub functions' " luca.boccassi
                     ` (9 preceding siblings ...)
  2017-11-02 12:02   ` [dpdk-stable] patch 'app/testpmd: fix mapping of user priority to DCB TC' " luca.boccassi
@ 2017-11-02 12:02   ` luca.boccassi
  2017-11-02 12:02   ` [dpdk-stable] patch 'net/bnxt: fix Rx " luca.boccassi
                     ` (5 subsequent siblings)
  16 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-02 12:02 UTC (permalink / raw)
  To: Ajit Khaparde; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From cfa876473954d9c11dc149f303aab4dc88fadc89 Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Tue, 24 Oct 2017 16:19:40 -0500
Subject: [PATCH] net/bnxt: fix Tx offload capability

[ upstream commit 1a54416d9af74c48b58a37e7f0e85824f7bc39dc ]

We are not indicating VLAN insert capability of HW. Fixing it.

Fixes: 0a6d2a720078 ("net/bnxt: get device infos")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 035fe07ac..ca55377f3 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -326,7 +326,8 @@ static void bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
 	dev_info->max_rx_pktlen = BNXT_MAX_MTU + ETHER_HDR_LEN + ETHER_CRC_LEN
 				  + VLAN_TAG_SIZE;
 	dev_info->rx_offload_capa = 0;
-	dev_info->tx_offload_capa = DEV_TX_OFFLOAD_IPV4_CKSUM |
+	dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT |
+					DEV_TX_OFFLOAD_IPV4_CKSUM |
 					DEV_TX_OFFLOAD_TCP_CKSUM |
 					DEV_TX_OFFLOAD_UDP_CKSUM |
 					DEV_TX_OFFLOAD_TCP_TSO;
-- 
2.11.0

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

* [dpdk-stable] patch 'net/bnxt: fix Rx offload capability' has been queued to LTS release 16.11.4
  2017-11-02 12:02 ` [dpdk-stable] patch 'eal/bsd: fix missing interrupt stub functions' " luca.boccassi
                     ` (10 preceding siblings ...)
  2017-11-02 12:02   ` [dpdk-stable] patch 'net/bnxt: fix Tx offload capability' " luca.boccassi
@ 2017-11-02 12:02   ` luca.boccassi
  2017-11-02 12:02   ` [dpdk-stable] patch 'net/bnxt: fix a bit shift operation' " luca.boccassi
                     ` (4 subsequent siblings)
  16 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-02 12:02 UTC (permalink / raw)
  To: Ajit Khaparde; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From deb2b91c6814913f444141d940106d183c02c94e Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Tue, 24 Oct 2017 16:19:41 -0500
Subject: [PATCH] net/bnxt: fix Rx offload capability

[ upstream commit 0489c654e5190f49783f5cffff6f5714e42525bf ]

We are not setting the rx_offload capabilities. Fixing that.

Fixes: 0a6d2a720078 ("net/bnxt: get device infos")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index ca55377f3..dc18fb9ed 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -325,7 +325,11 @@ static void bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
 	dev_info->min_rx_bufsize = 1;
 	dev_info->max_rx_pktlen = BNXT_MAX_MTU + ETHER_HDR_LEN + ETHER_CRC_LEN
 				  + VLAN_TAG_SIZE;
-	dev_info->rx_offload_capa = 0;
+	dev_info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP |
+					DEV_RX_OFFLOAD_IPV4_CKSUM |
+					DEV_RX_OFFLOAD_UDP_CKSUM |
+					DEV_RX_OFFLOAD_TCP_CKSUM |
+					DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM;
 	dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT |
 					DEV_TX_OFFLOAD_IPV4_CKSUM |
 					DEV_TX_OFFLOAD_TCP_CKSUM |
-- 
2.11.0

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

* [dpdk-stable] patch 'net/bnxt: fix a bit shift operation' has been queued to LTS release 16.11.4
  2017-11-02 12:02 ` [dpdk-stable] patch 'eal/bsd: fix missing interrupt stub functions' " luca.boccassi
                     ` (11 preceding siblings ...)
  2017-11-02 12:02   ` [dpdk-stable] patch 'net/bnxt: fix Rx " luca.boccassi
@ 2017-11-02 12:02   ` luca.boccassi
  2017-11-02 12:02   ` [dpdk-stable] patch 'net/bnxt: fix a potential null pointer dereference' " luca.boccassi
                     ` (3 subsequent siblings)
  16 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-02 12:02 UTC (permalink / raw)
  To: Ajit Khaparde; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 2b6de8e6a3d546366f4fc5ce57edf943710daadf Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Tue, 24 Oct 2017 16:19:45 -0500
Subject: [PATCH] net/bnxt: fix a bit shift operation

[ upstream commit 9c7b0242963a3c51f586a04b006b48de7571e4ac ]

We are left shifting more bits than we should be doing.
This patch fixes that.

Coverity issue: 127546
Fixes: 778b759ba10e ("net/bnxt: add MAC address")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index dc18fb9ed..1e956602a 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -555,13 +555,14 @@ static void bnxt_mac_addr_remove_op(struct rte_eth_dev *eth_dev,
 	uint64_t pool_mask = eth_dev->data->mac_pool_sel[index];
 	struct bnxt_vnic_info *vnic;
 	struct bnxt_filter_info *filter, *temp_filter;
-	int i;
+	uint32_t pool = RTE_MIN(MAX_FF_POOLS, ETH_64_POOLS);
+	uint32_t i;
 
 	/*
 	 * Loop through all VNICs from the specified filter flow pools to
 	 * remove the corresponding MAC addr filter
 	 */
-	for (i = 0; i < MAX_FF_POOLS; i++) {
+	for (i = 0; i < pool; i++) {
 		if (!(pool_mask & (1ULL << i)))
 			continue;
 
-- 
2.11.0

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

* [dpdk-stable] patch 'net/bnxt: fix a potential null pointer dereference' has been queued to LTS release 16.11.4
  2017-11-02 12:02 ` [dpdk-stable] patch 'eal/bsd: fix missing interrupt stub functions' " luca.boccassi
                     ` (12 preceding siblings ...)
  2017-11-02 12:02   ` [dpdk-stable] patch 'net/bnxt: fix a bit shift operation' " luca.boccassi
@ 2017-11-02 12:02   ` luca.boccassi
  2017-11-02 12:02   ` [dpdk-stable] patch 'eal/x86: fix atomic cmpset' " luca.boccassi
                     ` (2 subsequent siblings)
  16 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-02 12:02 UTC (permalink / raw)
  To: Ajit Khaparde; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 67335de26faa652432d7b6fb5d0b51782aad9316 Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Tue, 24 Oct 2017 16:19:49 -0500
Subject: [PATCH] net/bnxt: fix a potential null pointer dereference

[ upstream commit 8ec40353d4b1aacb9158755f3e82a8a9ee7df59c ]

Coverity issue: 195046
Fixes: f7ecea911ec5 ("net/bnxt: fix interrupt handler")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_irq.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c
index 7e1482782..851f39caa 100644
--- a/drivers/net/bnxt/bnxt_irq.c
+++ b/drivers/net/bnxt/bnxt_irq.c
@@ -51,10 +51,14 @@ static void bnxt_int_handler(struct rte_intr_handle *handle __rte_unused,
 	struct rte_eth_dev *eth_dev = (struct rte_eth_dev *)param;
 	struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private;
 	struct bnxt_cp_ring_info *cpr = bp->def_cp_ring;
-	uint32_t raw_cons = cpr->cp_raw_cons;
-	uint32_t cons;
 	struct cmpl_base *cmp;
+	uint32_t raw_cons;
+	uint32_t cons;
 
+	if (cpr == NULL)
+		return;
+
+	raw_cons = cpr->cp_raw_cons;
 	while (1) {
 		if (!cpr || !cpr->cp_ring_struct)
 			return;
-- 
2.11.0

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

* [dpdk-stable] patch 'eal/x86: fix atomic cmpset' has been queued to LTS release 16.11.4
  2017-11-02 12:02 ` [dpdk-stable] patch 'eal/bsd: fix missing interrupt stub functions' " luca.boccassi
                     ` (13 preceding siblings ...)
  2017-11-02 12:02   ` [dpdk-stable] patch 'net/bnxt: fix a potential null pointer dereference' " luca.boccassi
@ 2017-11-02 12:02   ` luca.boccassi
  2017-11-02 12:02   ` [dpdk-stable] patch 'examples/multi_process: fix received message length' " luca.boccassi
  2017-11-02 12:02   ` [dpdk-stable] patch 'lpm6: fix compilation with -Og' " luca.boccassi
  16 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-02 12:02 UTC (permalink / raw)
  To: Nikhil Rao; +Cc: Job Abraham, Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From fed9c8331e53040653352b5df099bea677dce830 Mon Sep 17 00:00:00 2001
From: Nikhil Rao <nikhil.rao@intel.com>
Date: Fri, 30 Sep 2016 02:54:53 +0530
Subject: [PATCH] eal/x86: fix atomic cmpset

[ upstream commit 9d1c2a6a912bebde1139157b950e39ffa7192c9d ]

The original code used movl instead of xchgl, this caused
rte_atomic64_cmpset to use ebx as the lower dword of the source
to cmpxchg8b instead of the lower dword of function argument "src".

Fixes: af75078fece3 ("first public release")

Reported-by: Job Abraham <job.abraham@intel.com>
Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
Tested-by: Job Abraham <job.abraham@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/librte_eal/common/include/arch/x86/rte_atomic_32.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_eal/common/include/arch/x86/rte_atomic_32.h b/lib/librte_eal/common/include/arch/x86/rte_atomic_32.h
index 2e04c7595..fb3abf187 100644
--- a/lib/librte_eal/common/include/arch/x86/rte_atomic_32.h
+++ b/lib/librte_eal/common/include/arch/x86/rte_atomic_32.h
@@ -81,7 +81,7 @@ rte_atomic64_cmpset(volatile uint64_t *dst, uint64_t exp, uint64_t src)
 			: "memory" );           /* no-clobber list */
 #else
 	asm volatile (
-            "mov %%ebx, %%edi\n"
+            "xchgl %%ebx, %%edi;\n"
 			MPLOCKED
 			"cmpxchg8b (%[dst]);"
 			"setz %[res];"
-- 
2.11.0

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

* [dpdk-stable] patch 'examples/multi_process: fix received message length' has been queued to LTS release 16.11.4
  2017-11-02 12:02 ` [dpdk-stable] patch 'eal/bsd: fix missing interrupt stub functions' " luca.boccassi
                     ` (14 preceding siblings ...)
  2017-11-02 12:02   ` [dpdk-stable] patch 'eal/x86: fix atomic cmpset' " luca.boccassi
@ 2017-11-02 12:02   ` luca.boccassi
  2017-11-02 12:02   ` [dpdk-stable] patch 'lpm6: fix compilation with -Og' " luca.boccassi
  16 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-02 12:02 UTC (permalink / raw)
  To: Xueming Li; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 50bd291029f3a315adcc8021f2b71000be46c205 Mon Sep 17 00:00:00 2001
From: Xueming Li <xuemingl@mellanox.com>
Date: Thu, 26 Oct 2017 16:29:23 +0800
Subject: [PATCH] examples/multi_process: fix received message length

[ upstream commit 0acd8ed3330a629658e3864d78a6bd4b78de321e ]

Simple_mp example receives message size less than 64 chars while send
side accepts chars less than 128, this leads to different result when
sending text length larger than 64.
This patch uses same buffer length on both message pool and command
line.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
 examples/multi_process/simple_mp/main.c        | 4 ++--
 examples/multi_process/simple_mp/mp_commands.c | 2 +-
 examples/multi_process/simple_mp/mp_commands.h | 1 -
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/examples/multi_process/simple_mp/main.c b/examples/multi_process/simple_mp/main.c
index 2843d94e9..53b87c5c9 100644
--- a/examples/multi_process/simple_mp/main.c
+++ b/examples/multi_process/simple_mp/main.c
@@ -67,6 +67,7 @@
 #include <rte_mempool.h>
 #include <cmdline_rdline.h>
 #include <cmdline_parse.h>
+#include <cmdline_parse_string.h>
 #include <cmdline_socket.h>
 #include <cmdline.h>
 #include "mp_commands.h"
@@ -76,7 +77,6 @@
 static const char *_MSG_POOL = "MSG_POOL";
 static const char *_SEC_2_PRI = "SEC_2_PRI";
 static const char *_PRI_2_SEC = "PRI_2_SEC";
-const unsigned string_size = 64;
 
 struct rte_ring *send_ring, *recv_ring;
 struct rte_mempool *message_pool;
@@ -121,7 +121,7 @@ main(int argc, char **argv)
 		send_ring = rte_ring_create(_PRI_2_SEC, ring_size, rte_socket_id(), flags);
 		recv_ring = rte_ring_create(_SEC_2_PRI, ring_size, rte_socket_id(), flags);
 		message_pool = rte_mempool_create(_MSG_POOL, pool_size,
-				string_size, pool_cache, priv_data_sz,
+				STR_TOKEN_SIZE, pool_cache, priv_data_sz,
 				NULL, NULL, NULL, NULL,
 				rte_socket_id(), flags);
 	} else {
diff --git a/examples/multi_process/simple_mp/mp_commands.c b/examples/multi_process/simple_mp/mp_commands.c
index 8da244bb5..cde3abd40 100644
--- a/examples/multi_process/simple_mp/mp_commands.c
+++ b/examples/multi_process/simple_mp/mp_commands.c
@@ -78,7 +78,7 @@ static void cmd_send_parsed(void *parsed_result,
 
 	if (rte_mempool_get(message_pool, &msg) < 0)
 		rte_panic("Failed to get message buffer\n");
-	snprintf((char *)msg, string_size, "%s", res->message);
+	snprintf((char *)msg, STR_TOKEN_SIZE, "%s", res->message);
 	if (rte_ring_enqueue(send_ring, msg) < 0) {
 		printf("Failed to send message - message discarded\n");
 		rte_mempool_put(message_pool, msg);
diff --git a/examples/multi_process/simple_mp/mp_commands.h b/examples/multi_process/simple_mp/mp_commands.h
index 7e9a4ab22..452b36456 100644
--- a/examples/multi_process/simple_mp/mp_commands.h
+++ b/examples/multi_process/simple_mp/mp_commands.h
@@ -34,7 +34,6 @@
 #ifndef _SIMPLE_MP_COMMANDS_H_
 #define _SIMPLE_MP_COMMANDS_H_
 
-extern const unsigned string_size;
 extern struct rte_ring *send_ring;
 extern struct rte_mempool *message_pool;
 extern volatile int quit;
-- 
2.11.0

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

* [dpdk-stable] patch 'lpm6: fix compilation with -Og' has been queued to LTS release 16.11.4
  2017-11-02 12:02 ` [dpdk-stable] patch 'eal/bsd: fix missing interrupt stub functions' " luca.boccassi
                     ` (15 preceding siblings ...)
  2017-11-02 12:02   ` [dpdk-stable] patch 'examples/multi_process: fix received message length' " luca.boccassi
@ 2017-11-02 12:02   ` luca.boccassi
  2017-11-10 16:09     ` [dpdk-stable] patch 'buildtools: fix icc build' " luca.boccassi
  16 siblings, 1 reply; 109+ messages in thread
From: luca.boccassi @ 2017-11-02 12:02 UTC (permalink / raw)
  To: Olivier Matz; +Cc: Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 089ee37f4d7d9eb3e2db6432cdc3a6ab4f007a18 Mon Sep 17 00:00:00 2001
From: Olivier Matz <olivier.matz@6wind.com>
Date: Mon, 11 Sep 2017 17:13:31 +0200
Subject: [PATCH] lpm6: fix compilation with -Og
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 1f148d8eaf3baaf123fd8bf692947fe9437a5ab6 ]

The compilation with gcc-6.3.0 and EXTRA_CFLAGS=-Og gives the following
error:

  CC rte_lpm6.o
  rte_lpm6.c: In function ‘rte_lpm6_add_v1705’:
  rte_lpm6.c:442:11: error: ‘tbl_next’ may be used uninitialized in
                             this function [-Werror=maybe-uninitialized]
     if (!tbl[tbl_index].valid) {
             ^
  rte_lpm6.c:521:29: note: ‘tbl_next’ was declared here
    struct rte_lpm6_tbl_entry *tbl_next;
                               ^~~~~~~~

This is a false positive from gcc. Fix it by initializing tbl_next
to NULL.

Fixes: 5c510e13a9cb ("lpm: add IPv6 support")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/librte_lpm/rte_lpm6.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_lpm/rte_lpm6.c b/lib/librte_lpm/rte_lpm6.c
index 32fdba01e..f9fecbe3a 100644
--- a/lib/librte_lpm/rte_lpm6.c
+++ b/lib/librte_lpm/rte_lpm6.c
@@ -511,7 +511,7 @@ rte_lpm6_add(struct rte_lpm6 *lpm, uint8_t *ip, uint8_t depth,
 		uint8_t next_hop)
 {
 	struct rte_lpm6_tbl_entry *tbl;
-	struct rte_lpm6_tbl_entry *tbl_next;
+	struct rte_lpm6_tbl_entry *tbl_next = NULL;
 	int32_t rule_index;
 	int status;
 	uint8_t masked_ip[RTE_LPM6_IPV6_ADDR_SIZE];
-- 
2.11.0

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

* [dpdk-stable] patch 'buildtools: fix icc build' has been queued to LTS release 16.11.4
  2017-11-02 12:02   ` [dpdk-stable] patch 'lpm6: fix compilation with -Og' " luca.boccassi
@ 2017-11-10 16:09     ` luca.boccassi
  2017-11-10 16:09       ` [dpdk-stable] patch 'config: fix bnx2x option for armv7a' " luca.boccassi
                         ` (14 more replies)
  0 siblings, 15 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-10 16:09 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From b1076ba6bc492dedbc50d6033dd5bbd622a9225a Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@intel.com>
Date: Thu, 2 Nov 2017 00:25:10 +0000
Subject: [PATCH] buildtools: fix icc build
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit a462a6a9e7705e0a8e855ed42377041ff0efc908 ]

There are random build errors in test reports [1]. Build error
is not directly related to DPDK but observed during DPDK build.

When I get similar unexpected build errors in my system, found
out that /dev/null is invalid.

It seems ICC overwrites the /dev/null with "icc -o /dev/null" instead
of sending output to /dev/null. This is not always reproducible, so
hard to say what exactly is triggering the error.

I suspect test-report build errors can be because of the same reason,
and it is good to add a protection for this case.

Instead of sending output to /dev/null save it to the tmp folder and
remove it back when done.

[1]
http://dpdk.org/ml/archives/test-report/2017-November/034053.html
Failure #3

/usr/src/linux-headers-4.4.0-97-generic/include/linux/sysfs.h:517:37:
error: pointer targets in passing argument 2 of ‘kernfs_find_and_get’
differ in signedness [-Werror=pointer-sign]
  return kernfs_find_and_get(parent, name);

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 scripts/auto-config-h.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/auto-config-h.sh b/scripts/auto-config-h.sh
index 4356d7e38..cb8bce9b8 100755
--- a/scripts/auto-config-h.sh
+++ b/scripts/auto-config-h.sh
@@ -114,9 +114,9 @@ printf "\
 " "$include" "$code" > "${temp}" &&
 if ${CC} ${CPPFLAGS} ${EXTRA_CPPFLAGS} ${CFLAGS} ${EXTRA_CFLAGS} \
 	${AUTO_CONFIG_CFLAGS} \
-	-c -o /dev/null "${temp}" 1>&${out} 2>&${err}
+	-c -o ${temp}.o "${temp}" 1>&${out} 2>&${err}
 then
-	rm -f "${temp}"
+	rm -f "${temp}" "${temp}.o"
 	printf "\
 #ifndef %s
 #define %s 1
@@ -125,7 +125,7 @@ then
 " "${macro}" "${macro}" "${macro}" >> "${file}" &&
 	printf 'Defining %s.\n' "${macro}"
 else
-	rm -f "${temp}"
+	rm -f "${temp}" "${temp}.o"
 	printf "\
 /* %s is not defined. */
 
-- 
2.11.0

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

* [dpdk-stable] patch 'config: fix bnx2x option for armv7a' has been queued to LTS release 16.11.4
  2017-11-10 16:09     ` [dpdk-stable] patch 'buildtools: fix icc build' " luca.boccassi
@ 2017-11-10 16:09       ` luca.boccassi
  2017-11-10 16:09       ` [dpdk-stable] patch 'net/i40e: fix mirror with firmware 6.0' " luca.boccassi
                         ` (13 subsequent siblings)
  14 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-10 16:09 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 4e9e1587be8f532ccaa38f5dc9046f4c163dbc24 Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@intel.com>
Date: Tue, 31 Oct 2017 17:39:24 +0000
Subject: [PATCH] config: fix bnx2x option for armv7a

[ upstream commit de3514f94420117dc894f92b5fa5c2062792b702 ]

Fixes: 02a8686263de ("mk: introduce ARMv7 architecture")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 config/defconfig_arm-armv7a-linuxapp-gcc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/config/defconfig_arm-armv7a-linuxapp-gcc b/config/defconfig_arm-armv7a-linuxapp-gcc
index bde6acd98..b634f5227 100644
--- a/config/defconfig_arm-armv7a-linuxapp-gcc
+++ b/config/defconfig_arm-armv7a-linuxapp-gcc
@@ -73,5 +73,5 @@ CONFIG_RTE_LIBRTE_MLX4_PMD=n
 CONFIG_RTE_LIBRTE_MPIPE_PMD=n
 CONFIG_RTE_LIBRTE_VMXNET3_PMD=n
 CONFIG_RTE_LIBRTE_PMD_XENVIRT=n
-CONFIG_RTE_LIBRTE_PMD_BNX2X=n
+CONFIG_RTE_LIBRTE_BNX2X_PMD=n
 CONFIG_RTE_LIBRTE_QEDE_PMD=n
-- 
2.11.0

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

* [dpdk-stable] patch 'net/i40e: fix mirror with firmware 6.0' has been queued to LTS release 16.11.4
  2017-11-10 16:09     ` [dpdk-stable] patch 'buildtools: fix icc build' " luca.boccassi
  2017-11-10 16:09       ` [dpdk-stable] patch 'config: fix bnx2x option for armv7a' " luca.boccassi
@ 2017-11-10 16:09       ` luca.boccassi
  2017-11-10 16:09       ` [dpdk-stable] patch 'net/i40e: fix Rx packets number for NEON' " luca.boccassi
                         ` (12 subsequent siblings)
  14 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-10 16:09 UTC (permalink / raw)
  To: Qi Zhang; +Cc: Beilei Xing, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 6287eea12bb4ebbab017ce5ec881049ba29d3714 Mon Sep 17 00:00:00 2001
From: Qi Zhang <qi.z.zhang@intel.com>
Date: Tue, 31 Oct 2017 10:26:42 -0400
Subject: [PATCH] net/i40e: fix mirror with firmware 6.0

[ upstream commit d8a4baafe8756ce95e12deac89599d74e53e27a1 ]

Value of I40E_GL_SWR_PRI_JOIN_MAP_0 need to be corrected or mirror
does not work on latest firmware 6.0.

Fixes: 77370db964f7 ("net/i40e: fix ethertype filter for new FW")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 43bd0a4f3..0835c2d43 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -8381,7 +8381,7 @@ i40e_pctype_to_flowtype(enum i40e_filter_pctype pctype)
 
 /* For both X710 and XL710 */
 #define I40E_GL_SWR_PRI_JOIN_MAP_0_VALUE_1	0x10000200
-#define I40E_GL_SWR_PRI_JOIN_MAP_0_VALUE_2	0x20000200
+#define I40E_GL_SWR_PRI_JOIN_MAP_0_VALUE_2	0x203F0200
 #define I40E_GL_SWR_PRI_JOIN_MAP_0		0x26CE00
 
 #define I40E_GL_SWR_PRI_JOIN_MAP_2_VALUE 0x011f0200
-- 
2.11.0

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

* [dpdk-stable] patch 'net/i40e: fix Rx packets number for NEON' has been queued to LTS release 16.11.4
  2017-11-10 16:09     ` [dpdk-stable] patch 'buildtools: fix icc build' " luca.boccassi
  2017-11-10 16:09       ` [dpdk-stable] patch 'config: fix bnx2x option for armv7a' " luca.boccassi
  2017-11-10 16:09       ` [dpdk-stable] patch 'net/i40e: fix mirror with firmware 6.0' " luca.boccassi
@ 2017-11-10 16:09       ` luca.boccassi
  2017-11-10 16:09       ` [dpdk-stable] patch 'net/vmxnet3: fix memory leak when releasing queues' " luca.boccassi
                         ` (11 subsequent siblings)
  14 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-10 16:09 UTC (permalink / raw)
  To: Jianbo Liu; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 888f7936aa0bf9915ebe893877e2fc9ec97ed7b5 Mon Sep 17 00:00:00 2001
From: Jianbo Liu <jianbo.liu@arm.com>
Date: Tue, 31 Oct 2017 13:52:44 +0800
Subject: [PATCH] net/i40e: fix Rx packets number for NEON

[ upstream commit 987990bbf8d95c72dfb952dd6060062d31247d9d ]

Fix i40e stop receiving on ARM, as the statuses of RX descriptors
are not consistent, which is caused by cacheable hugepages.

Fixes: ae0eb310f253 ("net/i40e: implement vector PMD for ARM")

Signed-off-by: Jianbo Liu <jianbo.liu@arm.com>
---
 drivers/net/i40e/i40e_rxtx_vec_neon.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/drivers/net/i40e/i40e_rxtx_vec_neon.c b/drivers/net/i40e/i40e_rxtx_vec_neon.c
index d235daa79..557593a4e 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_neon.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_neon.c
@@ -192,8 +192,7 @@ desc_to_olflags_v(uint64x2_t descs[4], struct rte_mbuf **rx_pkts)
 #endif
 
 #define PKTLEN_SHIFT     10
-
-#define I40E_VPMD_DESC_DD_MASK	0x0001000100010001ULL
+#define I40E_UINT16_BIT (CHAR_BIT * sizeof(uint16_t))
 
 static inline void
 desc_to_ptype_v(uint64x2_t descs[4], struct rte_mbuf **rx_pkts)
@@ -224,7 +223,6 @@ _recv_raw_pkts_vec(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_pkts,
 	struct i40e_rx_entry *sw_ring;
 	uint16_t nb_pkts_recd;
 	int pos;
-	uint64_t var;
 
 	/* mask to shuffle from desc. to mbuf */
 	uint8x16_t shuf_msk = {
@@ -357,7 +355,6 @@ _recv_raw_pkts_vec(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_pkts,
 		/* C.2 get 4 pkts staterr value  */
 		staterr = vzipq_u16(sterr_tmp1.val[1],
 				    sterr_tmp2.val[1]).val[0];
-		stat = vgetq_lane_u64(vreinterpretq_u64_u16(staterr), 0);
 
 		desc_to_olflags_v(descs, &rx_pkts[pos]);
 
@@ -422,6 +419,12 @@ _recv_raw_pkts_vec(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_pkts,
 			rx_pkts[pos + 3]->next = NULL;
 		}
 
+		staterr = vshlq_n_u16(staterr, I40E_UINT16_BIT - 1);
+		staterr = vreinterpretq_u16_s16(
+				vshrq_n_s16(vreinterpretq_s16_u16(staterr),
+					    I40E_UINT16_BIT - 1));
+		stat = ~vgetq_lane_u64(vreinterpretq_u64_u16(staterr), 0);
+
 		rte_prefetch_non_temporal(rxdp + RTE_I40E_DESCS_PER_LOOP);
 
 		/* D.3 copy final 1,2 data to rx_pkts */
@@ -431,10 +434,12 @@ _recv_raw_pkts_vec(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_pkts,
 			 pkt_mb1);
 		desc_to_ptype_v(descs, &rx_pkts[pos]);
 		/* C.4 calc avaialbe number of desc */
-		var = __builtin_popcountll(stat & I40E_VPMD_DESC_DD_MASK);
-		nb_pkts_recd += var;
-		if (likely(var != RTE_I40E_DESCS_PER_LOOP))
+		if (unlikely(stat == 0)) {
+			nb_pkts_recd += RTE_I40E_DESCS_PER_LOOP;
+		} else {
+			nb_pkts_recd += __builtin_ctzl(stat) / I40E_UINT16_BIT;
 			break;
+		}
 	}
 
 	/* Update our internal tail pointer */
-- 
2.11.0

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

* [dpdk-stable] patch 'net/vmxnet3: fix memory leak when releasing queues' has been queued to LTS release 16.11.4
  2017-11-10 16:09     ` [dpdk-stable] patch 'buildtools: fix icc build' " luca.boccassi
                         ` (2 preceding siblings ...)
  2017-11-10 16:09       ` [dpdk-stable] patch 'net/i40e: fix Rx packets number for NEON' " luca.boccassi
@ 2017-11-10 16:09       ` luca.boccassi
  2017-11-10 16:09       ` [dpdk-stable] patch 'net/i40e: fix VFIO interrupt mapping in VF' " luca.boccassi
                         ` (10 subsequent siblings)
  14 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-10 16:09 UTC (permalink / raw)
  To: Chas Williams; +Cc: Luca Boccassi, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 486c87fc07f71f216ae9d2e3b4345cb3311f557a Mon Sep 17 00:00:00 2001
From: Chas Williams <chas3@att.com>
Date: Wed, 1 Nov 2017 16:38:20 -0400
Subject: [PATCH] net/vmxnet3: fix memory leak when releasing queues

[ upstream commit aad14460a066e400c1787126972a475b93a52012 ]

At the end of the queue release, we can free the containers for the
queue objects.

Fixes: dfaff37fc46d ("vmxnet3: import new vmxnet3 poll mode driver implementation")

Signed-off-by: Chas Williams <chas3@att.com>
Reviewed-by: Luca Boccassi <bluca@debian.org>
---
 drivers/net/vmxnet3/vmxnet3_rxtx.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index 4762a4418..5ef7773b1 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -194,6 +194,8 @@ vmxnet3_dev_tx_queue_release(void *txq)
 		vmxnet3_cmd_ring_release(&tq->cmd_ring);
 		/* Release the memzone */
 		rte_memzone_free(tq->mz);
+		/* Release the queue */
+		rte_free(tq);
 	}
 }
 
@@ -214,6 +216,9 @@ vmxnet3_dev_rx_queue_release(void *rxq)
 
 		/* Release the memzone */
 		rte_memzone_free(rq->mz);
+
+		/* Release the queue */
+		rte_free(rq);
 	}
 }
 
-- 
2.11.0

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

* [dpdk-stable] patch 'net/i40e: fix VFIO interrupt mapping in VF' has been queued to LTS release 16.11.4
  2017-11-10 16:09     ` [dpdk-stable] patch 'buildtools: fix icc build' " luca.boccassi
                         ` (3 preceding siblings ...)
  2017-11-10 16:09       ` [dpdk-stable] patch 'net/vmxnet3: fix memory leak when releasing queues' " luca.boccassi
@ 2017-11-10 16:09       ` luca.boccassi
  2017-11-10 16:09       ` [dpdk-stable] patch 'net/i40e: fix Rx queue " luca.boccassi
                         ` (9 subsequent siblings)
  14 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-10 16:09 UTC (permalink / raw)
  To: Wei Dai; +Cc: Lei Yao, Jingjing Wu, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 4eeaed0686eefed1500f0dfb2be54c3d1d77c149 Mon Sep 17 00:00:00 2001
From: Wei Dai <wei.dai@intel.com>
Date: Fri, 3 Nov 2017 16:47:29 +0800
Subject: [PATCH] net/i40e: fix VFIO interrupt mapping in VF

[ upstream commit 66b8304f9d5f8be5dccd169a7ced4fb6c058b488 ]

When a VF port is bound to VFIO-PIC, only miscellaneous interrupt
is mapped to VFIO vector 0 in i40evf_dev_init( ).
In i40evf_dev_interrupt_handle( ) and i40evf_dev_rx_queue_intr_enable( ),
if previous VFIO interrupt mapping set in i40evf_dev_init( ) is not
cleared, it will fail when PMD tries to map Rx queue interrupt to other
VFIO vectors by calling rte_intr_enable( ).

This patch clears the VFIO interrupt mappings before setting both
miscellaneous and Rx queue interrupt mappings again to avoid failure.
And remove the calling of rte_intr_enable( ) in
i40evf_dev_interrupt_handler( ) as there is no need to map VFIO interrupt
in this function repeatedly.

Fixes: 4b90a3ff26c5 ("i40evf: support Rx interrupt")

Signed-off-by: Wei Dai <wei.dai@intel.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index d47265f70..424942a33 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1504,7 +1504,6 @@ i40evf_dev_interrupt_handler(__rte_unused struct rte_intr_handle *handle,
 
 done:
 	i40evf_enable_irq0(hw);
-	rte_intr_enable(&dev->pci_dev->intr_handle);
 }
 
 static int
@@ -2155,7 +2154,20 @@ i40evf_dev_start(struct rte_eth_dev *dev)
 		goto err_mac;
 	}
 
+	/* When a VF port is bound to VFIO-PCI, only miscellaneous interrupt
+	 * is mapped to VFIO vector 0 in i40evf_dev_init( ).
+	 * If previous VFIO interrupt mapping set in i40evf_dev_init( ) is
+	 * not cleared, it will fail when rte_intr_enable( ) tries to map Rx
+	 * queue interrupt to other VFIO vectors.
+	 * So clear uio/vfio intr/evevnfd first to avoid failure.
+	 */
+	if (dev->data->dev_conf.intr_conf.rxq != 0) {
+		rte_intr_disable(intr_handle);
+		rte_intr_enable(intr_handle);
+	}
+
 	i40evf_enable_queues_intr(dev);
+
 	return 0;
 
 err_mac:
-- 
2.11.0

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

* [dpdk-stable] patch 'net/i40e: fix Rx queue interrupt mapping in VF' has been queued to LTS release 16.11.4
  2017-11-10 16:09     ` [dpdk-stable] patch 'buildtools: fix icc build' " luca.boccassi
                         ` (4 preceding siblings ...)
  2017-11-10 16:09       ` [dpdk-stable] patch 'net/i40e: fix VFIO interrupt mapping in VF' " luca.boccassi
@ 2017-11-10 16:09       ` luca.boccassi
  2017-11-10 16:09       ` [dpdk-stable] patch 'net/igb: fix Rx interrupt with VFIO and MSI-X' " luca.boccassi
                         ` (8 subsequent siblings)
  14 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-10 16:09 UTC (permalink / raw)
  To: Wei Dai; +Cc: Lei Yao, Jingjing Wu, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 28168437a7d91d48cfd7a7e75022f866812643d5 Mon Sep 17 00:00:00 2001
From: Wei Dai <wei.dai@intel.com>
Date: Fri, 3 Nov 2017 16:47:30 +0800
Subject: [PATCH] net/i40e: fix Rx queue interrupt mapping in VF

[ upstream commit 96a9fd03c25f6684009fcbf6ec33f4450e45a168 ]

When a VF port is bound to VFIO-PCI, miscellaneous interrupt is
mapped to MSI-X vector 0 and Rx queues interrupt are mapped to
other vectors in vfio_enable_msix( ). To simplify implementation,
all VFIO-PCI bound i40e VF Rx queue interrupts can be mapped in
vector 1. And as current igb_uio only support only one vector,
i40e VF PMD should use vector 0 for igb_uio and vector 1 for
VFIO-PCI. Without this patch, VF Rx queue interrupt is mapped
to vector 0 in register settings and mapped to VFIO vector 1
in vfio_enable_msix( ), and then all Rx queue interrupts will
be missed.
Also remove 2 unused macro definitions.

Fixes: 4b90a3ff26c5 ("i40evf: support Rx interrupt")
Fixes: 975ffea6f671 ("net/i40e: remove DPDK PF version specific code")

Signed-off-by: Wei Dai <wei.dai@intel.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 424942a33..2b533bade 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -68,7 +68,6 @@
 #include "i40e_ethdev.h"
 #include "i40e_pf.h"
 #define I40EVF_VSI_DEFAULT_MSIX_INTR     1
-#define I40EVF_VSI_DEFAULT_MSIX_INTR_LNX 0
 
 /* busy wait delay in msec */
 #define I40EVF_BUSY_WAIT_DELAY 10
@@ -727,7 +726,7 @@ i40evf_config_irq_map(struct rte_eth_dev *dev)
 		if (vf->version_major == I40E_DPDK_VERSION_MAJOR)
 			vector_id = I40EVF_VSI_DEFAULT_MSIX_INTR;
 		else
-			vector_id = I40EVF_VSI_DEFAULT_MSIX_INTR_LNX;
+			vector_id = I40E_RX_VEC_START;
 	} else {
 		vector_id = I40E_MISC_VEC_ID;
 	}
-- 
2.11.0

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

* [dpdk-stable] patch 'net/igb: fix Rx interrupt with VFIO and MSI-X' has been queued to LTS release 16.11.4
  2017-11-10 16:09     ` [dpdk-stable] patch 'buildtools: fix icc build' " luca.boccassi
                         ` (5 preceding siblings ...)
  2017-11-10 16:09       ` [dpdk-stable] patch 'net/i40e: fix Rx queue " luca.boccassi
@ 2017-11-10 16:09       ` luca.boccassi
  2017-11-10 16:09       ` [dpdk-stable] patch 'net/pcap: fix memory leak in dumper open' " luca.boccassi
                         ` (7 subsequent siblings)
  14 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-10 16:09 UTC (permalink / raw)
  To: Xiaoyun Li; +Cc: Wenzhuo Lu, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 574f0413aabb6ec17d0bd155869fdf738946103c Mon Sep 17 00:00:00 2001
From: Xiaoyun Li <xiaoyun.li@intel.com>
Date: Mon, 6 Nov 2017 10:41:40 +0800
Subject: [PATCH] net/igb: fix Rx interrupt with VFIO and MSI-X

[ upstream commit 88e04712f40fca9dd3ab98dd549e27791c320b75 ]

When using VFIO and MSIX interrupt mode, cannot get Rx interrupts. Because
when enabling the interrupt vectors, the offset is computed in a way which
only supports IGB_UIO. But the offset should be different when using VFIO.
This patch fixes this issue.

Fixes: c3cd3de0ab50 ("igb: enable Rx queue interrupts for PF")

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
 drivers/net/e1000/igb_ethdev.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index d16be9e1b..407021dfe 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -5095,7 +5095,13 @@ eth_igb_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t queue_id)
 {
 	struct e1000_hw *hw =
 		E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	uint32_t mask = 1 << queue_id;
+	struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+	uint32_t vec = E1000_MISC_VEC_ID;
+
+	if (rte_intr_allow_others(intr_handle))
+		vec = E1000_RX_VEC_START;
+
+	uint32_t mask = 1 << (queue_id + vec);
 
 	E1000_WRITE_REG(hw, E1000_EIMC, mask);
 	E1000_WRITE_FLUSH(hw);
@@ -5108,7 +5114,13 @@ eth_igb_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id)
 {
 	struct e1000_hw *hw =
 		E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	uint32_t mask = 1 << queue_id;
+	struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+	uint32_t vec = E1000_MISC_VEC_ID;
+
+	if (rte_intr_allow_others(intr_handle))
+		vec = E1000_RX_VEC_START;
+
+	uint32_t mask = 1 << (queue_id + vec);
 	uint32_t regval;
 
 	regval = E1000_READ_REG(hw, E1000_EIMS);
-- 
2.11.0

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

* [dpdk-stable] patch 'net/pcap: fix memory leak in dumper open' has been queued to LTS release 16.11.4
  2017-11-10 16:09     ` [dpdk-stable] patch 'buildtools: fix icc build' " luca.boccassi
                         ` (6 preceding siblings ...)
  2017-11-10 16:09       ` [dpdk-stable] patch 'net/igb: fix Rx interrupt with VFIO and MSI-X' " luca.boccassi
@ 2017-11-10 16:09       ` luca.boccassi
  2017-11-10 16:09       ` [dpdk-stable] patch 'test/pmd_perf: fix crash with multiple devices' " luca.boccassi
                         ` (6 subsequent siblings)
  14 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-10 16:09 UTC (permalink / raw)
  To: Stefan Baranoff; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From d224d370495209f3eb302370516a722a646ed949 Mon Sep 17 00:00:00 2001
From: Stefan Baranoff <sbaranoff@gmail.com>
Date: Sun, 5 Nov 2017 12:24:45 -0500
Subject: [PATCH] net/pcap: fix memory leak in dumper open

[ upstream commit e59196e01c1456e8ea0e9b2056651ef64dc17b78 ]

In open_single_tx_pcap there is a call to pcap_open_dead which calls
malloc to create and return a pcap_t. That object is never freed in
this case. Other places it is freed by passing it back similar to the
way the pcap_dumper_t is in this case.

The pcap_t is only used to create the pcap_dumper_t and is never used
again so freeing it here is safe and much simpler than trying to pass
it back to be freed in eth_dev_stop along with the other
pcap_t/pcap_dumper_t objects.

Fixes: 4c173302c307 ("pcap: add new driver")

Signed-off-by: Stefan Baranoff <sbaranoff@gmail.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 drivers/net/pcap/rte_eth_pcap.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
index 1a208ffca..f6b3c10c0 100644
--- a/drivers/net/pcap/rte_eth_pcap.c
+++ b/drivers/net/pcap/rte_eth_pcap.c
@@ -411,11 +411,13 @@ open_single_tx_pcap(const char *pcap_filename, pcap_dumper_t **dumper)
 	/* The dumper is created using the previous pcap_t reference */
 	*dumper = pcap_dump_open(tx_pcap, pcap_filename);
 	if (*dumper == NULL) {
+		pcap_close(tx_pcap);
 		RTE_LOG(ERR, PMD, "Couldn't open %s for writing.\n",
 			pcap_filename);
 		return -1;
 	}
 
+	pcap_close(tx_pcap);
 	return 0;
 }
 
-- 
2.11.0

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

* [dpdk-stable] patch 'test/pmd_perf: fix crash with multiple devices' has been queued to LTS release 16.11.4
  2017-11-10 16:09     ` [dpdk-stable] patch 'buildtools: fix icc build' " luca.boccassi
                         ` (7 preceding siblings ...)
  2017-11-10 16:09       ` [dpdk-stable] patch 'net/pcap: fix memory leak in dumper open' " luca.boccassi
@ 2017-11-10 16:09       ` luca.boccassi
  2017-11-10 16:09       ` [dpdk-stable] patch 'app/testpmd: fix forwarding between non consecutive ports' " luca.boccassi
                         ` (5 subsequent siblings)
  14 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-10 16:09 UTC (permalink / raw)
  To: Daniel Mrzyglod; +Cc: Michal Jastrzebski, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From a2dbf2c661dfbe1a1f92af7124ec5b199b064d98 Mon Sep 17 00:00:00 2001
From: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Date: Fri, 27 Oct 2017 18:24:08 +0200
Subject: [PATCH] test/pmd_perf: fix crash with multiple devices

[ upstream commit 7fd72d49ea789d35230f2f4f28a27baa1164c68c ]

Error can be reproduce if we run pmd_perf_autotest with more then
one device in such way:
RTE>>set_rxtx_sc poll_before_xmit
RTE>>pmd_perf_autotest

if first burst was value less than MAX_PKT_BURST in the end we overwrite
pkts_burst table for rx which was supposed for another interface.

Fixes: 002ade70e933 ("app/test: measure cycles per packet in Rx/Tx")

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
---
 app/test/test_pmd_perf.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c
index 1ffd65a52..afab180f9 100644
--- a/app/test/test_pmd_perf.c
+++ b/app/test/test_pmd_perf.c
@@ -572,6 +572,7 @@ poll_burst(void *args)
 	unsigned i, portid, nb_rx = 0;
 	uint64_t total;
 	uint64_t timeout = MAX_IDLE;
+	int num[RTE_MAX_ETHPORTS];
 
 	lcore_id = rte_lcore_id();
 	conf = &lcore_conf[lcore_id];
@@ -591,6 +592,7 @@ poll_burst(void *args)
 	for (i = 0; i < conf->nb_ports; i++) {
 		portid = conf->portlist[i];
 		next[portid] = i * pkt_per_port;
+		num[portid] = pkt_per_port;
 	}
 
 	while (!rte_atomic64_read(&start))
@@ -601,8 +603,8 @@ poll_burst(void *args)
 		for (i = 0; i < conf->nb_ports; i++) {
 			portid = conf->portlist[i];
 			nb_rx = rte_eth_rx_burst((uint8_t) portid, 0,
-						 &pkts_burst[next[portid]],
-						 MAX_PKT_BURST);
+					&pkts_burst[next[portid]],
+					RTE_MIN(MAX_PKT_BURST, num[portid]));
 			if (unlikely(nb_rx == 0)) {
 				timeout--;
 				if (unlikely(timeout == 0))
@@ -610,6 +612,7 @@ poll_burst(void *args)
 				continue;
 			}
 			next[portid] += nb_rx;
+			num[portid] -= nb_rx;
 			total -= nb_rx;
 		}
 	}
@@ -618,7 +621,6 @@ timeout:
 
 	printf("%"PRIu64" packets lost, IDLE %"PRIu64" times\n",
 	       total, MAX_IDLE - timeout);
-
 	/* clean up */
 	total = pkt_per_port * conf->nb_ports - total;
 	for (i = 0; i < total; i++)
@@ -644,7 +646,7 @@ exec_burst(uint32_t flags, int lcore)
 	conf = &lcore_conf[lcore];
 
 	pkt_per_port = MAX_TRAFFIC_BURST;
-	num = pkt_per_port;
+	num = pkt_per_port * conf->nb_ports;
 
 	rte_atomic64_init(&start);
 
@@ -661,11 +663,12 @@ exec_burst(uint32_t flags, int lcore)
 		nb_tx = RTE_MIN(MAX_PKT_BURST, num);
 		for (i = 0; i < conf->nb_ports; i++) {
 			portid = conf->portlist[i];
-			rte_eth_tx_burst(portid, 0,
+			nb_tx = rte_eth_tx_burst(portid, 0,
 					 &tx_burst[idx], nb_tx);
 			idx += nb_tx;
+			num -= nb_tx;
 		}
-		num -= nb_tx;
+
 	}
 
 	sleep(5);
-- 
2.11.0

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

* [dpdk-stable] patch 'app/testpmd: fix forwarding between non consecutive ports' has been queued to LTS release 16.11.4
  2017-11-10 16:09     ` [dpdk-stable] patch 'buildtools: fix icc build' " luca.boccassi
                         ` (8 preceding siblings ...)
  2017-11-10 16:09       ` [dpdk-stable] patch 'test/pmd_perf: fix crash with multiple devices' " luca.boccassi
@ 2017-11-10 16:09       ` luca.boccassi
  2017-11-10 16:09       ` [dpdk-stable] patch 'app/testpmd: fix topology error message' " luca.boccassi
                         ` (4 subsequent siblings)
  14 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-10 16:09 UTC (permalink / raw)
  To: Ophir Munk; +Cc: Raslan Darawsheh, Pablo de Lara, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From f7d56b8e49954dd481db419361a51322c91b77d4 Mon Sep 17 00:00:00 2001
From: Ophir Munk <ophirmu@mellanox.com>
Date: Tue, 7 Nov 2017 13:52:30 +0000
Subject: [PATCH] app/testpmd: fix forwarding between non consecutive ports

[ upstream commit fafee5e9caaf439b29a6e10600e91b8de81eff66 ]

When defining two failsafe devices in testpmd the port numbers of the
failsafe devices may not be consecutive.
For example: if failsafe device includes a PCI device and a TAP device
then failsafe port numbers would be 0 and 3.
Port 0 - failsafe #1 device
Port 1 - PCI #1 device
Port 2 - TAP #1 device
Port 3 - failsafe #2 device
Port 4 - PCI #2 device
Port 5 - TAP #2 device

If forwarding is defined between the failsafe devices including a peer
address the forwarding should be between peer addresses of ports 0
and 3. Instead testpmd establishes forwarding between peer addresses
of consecutive ports 0 and 1. This commit fixes this bug.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 app/test-pmd/config.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 56a7ec679..c50b62efd 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1199,7 +1199,7 @@ simple_fwd_config_setup(void)
 		fwd_streams[i]->rx_queue  = 0;
 		fwd_streams[i]->tx_port   = fwd_ports_ids[j];
 		fwd_streams[i]->tx_queue  = 0;
-		fwd_streams[i]->peer_addr = j;
+		fwd_streams[i]->peer_addr = fwd_streams[i]->tx_port;
 		fwd_streams[i]->retry_enabled = retry_enabled;
 
 		if (port_topology == PORT_TOPOLOGY_PAIRED) {
@@ -1207,7 +1207,7 @@ simple_fwd_config_setup(void)
 			fwd_streams[j]->rx_queue  = 0;
 			fwd_streams[j]->tx_port   = fwd_ports_ids[i];
 			fwd_streams[j]->tx_queue  = 0;
-			fwd_streams[j]->peer_addr = i;
+			fwd_streams[j]->peer_addr = fwd_streams[j]->tx_port;
 			fwd_streams[j]->retry_enabled = retry_enabled;
 		}
 	}
-- 
2.11.0

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

* [dpdk-stable] patch 'app/testpmd: fix topology error message' has been queued to LTS release 16.11.4
  2017-11-10 16:09     ` [dpdk-stable] patch 'buildtools: fix icc build' " luca.boccassi
                         ` (9 preceding siblings ...)
  2017-11-10 16:09       ` [dpdk-stable] patch 'app/testpmd: fix forwarding between non consecutive ports' " luca.boccassi
@ 2017-11-10 16:09       ` luca.boccassi
  2017-11-10 16:09       ` [dpdk-stable] patch 'usertools: fix device binding with python 3' " luca.boccassi
                         ` (3 subsequent siblings)
  14 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-10 16:09 UTC (permalink / raw)
  To: Pablo de Lara; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From e2bccd1efb9da1be0eb6f39b615a30ae1833973b Mon Sep 17 00:00:00 2001
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Date: Tue, 7 Nov 2017 18:11:26 +0000
Subject: [PATCH] app/testpmd: fix topology error message

[ upstream commit 7535883327ad37b0631edd6ae1a3315400a6b95b ]

Fixes: 3e2006d6186c ("app/testpmd: add loopback topology")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 app/test-pmd/parameters.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index a96264657..092339174 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -810,7 +810,7 @@ launch_args_parse(int argc, char** argv)
 					port_topology = PORT_TOPOLOGY_LOOP;
 				else
 					rte_exit(EXIT_FAILURE, "port-topology %s invalid -"
-						 " must be: paired or chained \n",
+						 " must be: paired, chained or loop\n",
 						 optarg);
 			}
 			if (!strcmp(lgopts[opt_idx].name, "forward-mode"))
-- 
2.11.0

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

* [dpdk-stable] patch 'usertools: fix device binding with python 3' has been queued to LTS release 16.11.4
  2017-11-10 16:09     ` [dpdk-stable] patch 'buildtools: fix icc build' " luca.boccassi
                         ` (10 preceding siblings ...)
  2017-11-10 16:09       ` [dpdk-stable] patch 'app/testpmd: fix topology error message' " luca.boccassi
@ 2017-11-10 16:09       ` luca.boccassi
  2017-11-10 16:09       ` [dpdk-stable] patch 'net/qede/base: fix division by zero' " luca.boccassi
                         ` (2 subsequent siblings)
  14 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-10 16:09 UTC (permalink / raw)
  To: Omri Mor; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 02d0210b743f8791ff1a0ffcfab838d9d0685d90 Mon Sep 17 00:00:00 2001
From: Omri Mor <omrimor2@illinois.edu>
Date: Fri, 6 Oct 2017 16:38:38 -0500
Subject: [PATCH] usertools: fix device binding with python 3

[ upstream commit 8fab26f8ee80ed7dff84cd90d343e5265a6128d1 ]

When using Python 3, dpdk-devbind.py fails to detect modules other than
igb_uio.

Fixes: bb9f408550d1 ("tools: support binding to built-in kernel modules")

Signed-off-by: Omri Mor <omrimor2@illinois.edu>
---
 tools/dpdk-devbind.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/dpdk-devbind.py b/tools/dpdk-devbind.py
index fef59c41f..e4c6d521d 100755
--- a/tools/dpdk-devbind.py
+++ b/tools/dpdk-devbind.py
@@ -182,8 +182,7 @@ def check_modules():
 
         # special case for vfio_pci (module is named vfio-pci,
         # but its .ko is named vfio_pci)
-        sysfs_mods = map(lambda a:
-                         a if a != 'vfio_pci' else 'vfio-pci', sysfs_mods)
+        sysfs_mods = [a if a != 'vfio_pci' else 'vfio-pci' for a in sysfs_mods]
 
         for mod in mods:
             if mod["Name"] in sysfs_mods:
-- 
2.11.0

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

* [dpdk-stable] patch 'net/qede/base: fix division by zero' has been queued to LTS release 16.11.4
  2017-11-10 16:09     ` [dpdk-stable] patch 'buildtools: fix icc build' " luca.boccassi
                         ` (11 preceding siblings ...)
  2017-11-10 16:09       ` [dpdk-stable] patch 'usertools: fix device binding with python 3' " luca.boccassi
@ 2017-11-10 16:09       ` luca.boccassi
  2017-11-10 16:09       ` [dpdk-stable] patch 'net/qede: fix icc build' " luca.boccassi
  2017-11-10 16:10       ` [dpdk-stable] patch 'buildtools: check allocation error in pmdinfogen' " luca.boccassi
  14 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-10 16:09 UTC (permalink / raw)
  To: Rasesh Mody; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 8a4a4766b17d666ca59f05d0107c788ebb11e530 Mon Sep 17 00:00:00 2001
From: Rasesh Mody <rasesh.mody@cavium.com>
Date: Tue, 7 Nov 2017 00:34:24 -0800
Subject: [PATCH] net/qede/base: fix division by zero

[ upstream commit 5b5f9675d332f192388a9e89a779b0285139e0e2 ]

Fix division by zero in calculating the regpair elements per page
Remove unused API ecore_cxt_free_proto_ilt()

Coverity issue: 1379423, 1379428
Fixes: 22d07d939c3c ("net/qede/base: update")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
 drivers/net/qede/base/ecore_cxt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/qede/base/ecore_cxt.c b/drivers/net/qede/base/ecore_cxt.c
index 3dd953d92..5e2f0293a 100644
--- a/drivers/net/qede/base/ecore_cxt.c
+++ b/drivers/net/qede/base/ecore_cxt.c
@@ -67,6 +67,7 @@ union type0_task_context {
 
 /* TYPE-1 task context - ROCE */
 union type1_task_context {
+	struct regpair reserved; /* @DPDK */
 };
 
 struct src_ent {
-- 
2.11.0

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

* [dpdk-stable] patch 'net/qede: fix icc build' has been queued to LTS release 16.11.4
  2017-11-10 16:09     ` [dpdk-stable] patch 'buildtools: fix icc build' " luca.boccassi
                         ` (12 preceding siblings ...)
  2017-11-10 16:09       ` [dpdk-stable] patch 'net/qede/base: fix division by zero' " luca.boccassi
@ 2017-11-10 16:09       ` luca.boccassi
  2017-11-10 16:10       ` [dpdk-stable] patch 'buildtools: check allocation error in pmdinfogen' " luca.boccassi
  14 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-10 16:09 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 17b1a775129aa248cc1803129ec5d6aaf32b69ef Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@intel.com>
Date: Tue, 7 Nov 2017 23:38:11 +0000
Subject: [PATCH] net/qede: fix icc build

[ upstream commit e8f8f595188b155a2a08009e895dd8654a93f015 ]

observed icc version "icc (ICC) 18.0.0 20170811"

build error:
.../dpdk/drivers/net/qede/qede_ethdev.c(1475):
error #279: controlling expression is constant
	assert(false && "Unable to start periodic timer");
			^

Warning disabled in Makefile.

Fixes: 2af14ca79c0a ("net/qede: support 100G")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 drivers/net/qede/Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/qede/Makefile b/drivers/net/qede/Makefile
index 29b443df0..18150b586 100644
--- a/drivers/net/qede/Makefile
+++ b/drivers/net/qede/Makefile
@@ -66,8 +66,9 @@ CFLAGS_BASE_DRIVER += -Wno-sometimes-uninitialized
 ifeq ($(shell clang -Wno-pointer-bool-conversion -Werror -E - < /dev/null > /dev/null 2>&1; echo $$?),0)
 CFLAGS_BASE_DRIVER += -Wno-pointer-bool-conversion
 endif
-else
-CFLAGS_BASE_DRIVER += -wd188 #188: enumerated type mixed with another type
+else #ICC
+CFLAGS_BASE_DRIVER += -wd188   #188: enumerated type mixed with another type
+CFLAGS_qede_ethdev.o += -wd279 #279: controlling expression is constant
 endif
 
 #
-- 
2.11.0

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

* [dpdk-stable] patch 'buildtools: check allocation error in pmdinfogen' has been queued to LTS release 16.11.4
  2017-11-10 16:09     ` [dpdk-stable] patch 'buildtools: fix icc build' " luca.boccassi
                         ` (13 preceding siblings ...)
  2017-11-10 16:09       ` [dpdk-stable] patch 'net/qede: fix icc build' " luca.boccassi
@ 2017-11-10 16:10       ` luca.boccassi
  2017-11-13 14:49         ` [dpdk-stable] patch 'net/i40e: fix VF cannot forward packets issue' " luca.boccassi
  14 siblings, 1 reply; 109+ messages in thread
From: luca.boccassi @ 2017-11-10 16:10 UTC (permalink / raw)
  To: Yong Wang; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 557277fd6818584b3cc4ba746a1baae48c786304 Mon Sep 17 00:00:00 2001
From: Yong Wang <wang.yong19@zte.com.cn>
Date: Fri, 15 Sep 2017 07:33:08 -0400
Subject: [PATCH] buildtools: check allocation error in pmdinfogen

[ upstream commit 3b29f60f2d584d5086b735e0a6fab518a17eaa1e ]

In func locate_pmd_entries(), pointer 'new' returned from call to func
'calloc' may be NULL. It is dereferenced without null point check.

Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
---
 buildtools/pmdinfogen/pmdinfogen.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/buildtools/pmdinfogen/pmdinfogen.c b/buildtools/pmdinfogen/pmdinfogen.c
index 5bf08ced8..df10a2f9f 100644
--- a/buildtools/pmdinfogen/pmdinfogen.c
+++ b/buildtools/pmdinfogen/pmdinfogen.c
@@ -326,6 +326,10 @@ static int locate_pmd_entries(struct elf_info *info)
 
 	do {
 		new = calloc(sizeof(struct pmd_driver), 1);
+		if (new == NULL) {
+			fprintf(stderr, "Failed to calloc memory\n");
+			return -1;
+		}
 		new->name_sym = find_sym_in_symtab(info, "this_pmd_name", last);
 		last = new->name_sym;
 		if (!new->name_sym)
@@ -407,7 +411,8 @@ int main(int argc, char **argv)
 	}
 	parse_elf(&info, argv[1]);
 
-	locate_pmd_entries(&info);
+	if (locate_pmd_entries(&info) < 0)
+		exit(1);
 
 	if (info.drivers) {
 		output_pmd_info_string(&info, argv[2]);
-- 
2.11.0

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

* [dpdk-stable] patch 'net/i40e: fix VF cannot forward packets issue' has been queued to LTS release 16.11.4
  2017-11-10 16:10       ` [dpdk-stable] patch 'buildtools: check allocation error in pmdinfogen' " luca.boccassi
@ 2017-11-13 14:49         ` luca.boccassi
  2017-11-13 14:49           ` [dpdk-stable] patch 'net/nfp: fix stats struct initial value' " luca.boccassi
                             ` (5 more replies)
  0 siblings, 6 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-13 14:49 UTC (permalink / raw)
  To: Xiaoyun Li; +Cc: Beilei Xing, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From a26b1740b553cb9d56f96cdd5f6ddae671ff915b Mon Sep 17 00:00:00 2001
From: Xiaoyun Li <xiaoyun.li@intel.com>
Date: Thu, 9 Nov 2017 14:30:14 +0800
Subject: [PATCH] net/i40e: fix VF cannot forward packets issue

[ upstream commit 79f47fc1b7b987b62b1a794f012d5a0253c8b17b ]

When Rx interrupt is not enabled, there is no need to check if interrupt
allow others. It will cause VF cannot forwarding packets issue. This patch
fixes this issue.

Fixes: 96a9fd03c25f ("net/i40e: fix Rx queue interrupt mapping in VF")

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 2b533bade..1686914a1 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -722,7 +722,8 @@ i40evf_config_irq_map(struct rte_eth_dev *dev)
 	uint32_t vector_id;
 	int i, err;
 
-	if (rte_intr_allow_others(intr_handle)) {
+	if (dev->data->dev_conf.intr_conf.rxq != 0 &&
+	    rte_intr_allow_others(intr_handle)) {
 		if (vf->version_major == I40E_DPDK_VERSION_MAJOR)
 			vector_id = I40EVF_VSI_DEFAULT_MSIX_INTR;
 		else
-- 
2.11.0

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

* [dpdk-stable] patch 'net/nfp: fix stats struct initial value' has been queued to LTS release 16.11.4
  2017-11-13 14:49         ` [dpdk-stable] patch 'net/i40e: fix VF cannot forward packets issue' " luca.boccassi
@ 2017-11-13 14:49           ` luca.boccassi
  2017-11-13 14:49           ` [dpdk-stable] patch 'net/bnxt: fix link handling and configuration' " luca.boccassi
                             ` (4 subsequent siblings)
  5 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-13 14:49 UTC (permalink / raw)
  To: Alejandro Lucero; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From ef7969dd3d2b4db7a6d8fa02d8adacc438730896 Mon Sep 17 00:00:00 2001
From: Alejandro Lucero <alejandro.lucero@netronome.com>
Date: Wed, 8 Nov 2017 11:59:45 +0000
Subject: [PATCH] net/nfp: fix stats struct initial value

[ upstream commit 9b634927a71d555ec7314e177d8698347b5cc8e0 ]

Not all struct fields will be written and random data could
confuse readers.

Coverity issue: 140755
Fixes: 92aa491b881e ("nfp: add statistics")

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
---
 drivers/net/nfp/nfp_net.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index a3c73cd28..74453204b 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -857,6 +857,8 @@ nfp_net_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 
 	/* RTE_ETHDEV_QUEUE_STAT_CNTRS default value is 16 */
 
+	memset(&nfp_dev_stats, 0, sizeof(nfp_dev_stats));
+
 	/* reading per RX ring stats */
 	for (i = 0; i < dev->data->nb_rx_queues; i++) {
 		if (i == RTE_ETHDEV_QUEUE_STAT_CNTRS)
-- 
2.11.0

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

* [dpdk-stable] patch 'net/bnxt: fix link handling and configuration' has been queued to LTS release 16.11.4
  2017-11-13 14:49         ` [dpdk-stable] patch 'net/i40e: fix VF cannot forward packets issue' " luca.boccassi
  2017-11-13 14:49           ` [dpdk-stable] patch 'net/nfp: fix stats struct initial value' " luca.boccassi
@ 2017-11-13 14:49           ` luca.boccassi
  2017-11-13 14:49           ` [dpdk-stable] patch 'net/mlx5: fix link speed bitmasks' " luca.boccassi
                             ` (3 subsequent siblings)
  5 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-13 14:49 UTC (permalink / raw)
  To: Ajit Khaparde; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 88a85c6bddd883ce0070be8624d6354c49d6a9af Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Thu, 9 Nov 2017 11:46:28 -0600
Subject: [PATCH] net/bnxt: fix link handling and configuration

[ upstream commit 9a82633c27cdfbc33e34876dff41abdbfa71bb97 ]

Remove a case where we were sending a deprecated field to the FW.
There is no need to send auto_link_speed to the FW.
Also set the auto_mode correctly depending on the setting requested.

Fixes: 7bc8e9a227cc ("net/bnxt: support async link notification")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt.h        |  2 ++
 drivers/net/bnxt/bnxt_cpr.c    |  2 +-
 drivers/net/bnxt/bnxt_ethdev.c | 33 +++++++++++------------
 drivers/net/bnxt/bnxt_hwrm.c   | 61 +++++++++++++++++++++++++++---------------
 4 files changed, 58 insertions(+), 40 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 4418c7fda..ff3c24063 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -112,6 +112,8 @@ struct bnxt_link_info {
 	uint16_t		auto_link_speed;
 	uint16_t		auto_link_speed_mask;
 	uint32_t		preemphasis;
+	uint8_t			phy_type;
+	uint8_t			media_type;
 };
 
 #define BNXT_COS_QUEUE_COUNT	8
diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c
index 0139344ae..6f88ac91c 100644
--- a/drivers/net/bnxt/bnxt_cpr.c
+++ b/drivers/net/bnxt/bnxt_cpr.c
@@ -55,7 +55,7 @@ void bnxt_handle_async_event(struct bnxt *bp,
 	case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE:
 	case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE:
 	case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE:
-		bnxt_link_update_op(bp->eth_dev, 0);
+		bnxt_link_update_op(bp->eth_dev, 1);
 		break;
 	default:
 		RTE_LOG(ERR, PMD, "handle_async_event id = 0x%x\n", event_id);
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 1e956602a..b6feb5ad7 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -106,6 +106,8 @@ static struct rte_pci_id bnxt_pci_id_map[] = {
 	ETH_RSS_NONFRAG_IPV6_TCP |	\
 	ETH_RSS_NONFRAG_IPV6_UDP)
 
+static void bnxt_print_link_info(struct rte_eth_dev *eth_dev);
+
 /***********************/
 
 /*
@@ -261,6 +263,7 @@ static int bnxt_init_chip(struct bnxt *bp)
 			goto err_out;
 		}
 	}
+	bnxt_print_link_info(bp->eth_dev);
 
 	return 0;
 
@@ -415,20 +418,6 @@ static int bnxt_dev_configure_op(struct rte_eth_dev *eth_dev)
 	return 0;
 }
 
-static inline int
-rte_bnxt_atomic_write_link_status(struct rte_eth_dev *eth_dev,
-				struct rte_eth_link *link)
-{
-	struct rte_eth_link *dst = &eth_dev->data->dev_link;
-	struct rte_eth_link *src = link;
-
-	if (rte_atomic64_cmpset((uint64_t *)dst, *(uint64_t *)dst,
-					*(uint64_t *)src) == 0)
-		return 1;
-
-	return 0;
-}
-
 static void bnxt_print_link_info(struct rte_eth_dev *eth_dev)
 {
 	struct rte_eth_link *link = &eth_dev->data->dev_link;
@@ -481,7 +470,7 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
 
 	bnxt_enable_int(bp);
 
-	bnxt_link_update_op(eth_dev, 0);
+	bnxt_link_update_op(eth_dev, 1);
 	return 0;
 
 error:
@@ -497,9 +486,14 @@ error:
 static int bnxt_dev_set_link_up_op(struct rte_eth_dev *eth_dev)
 {
 	struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private;
+	int rc = 0;
 
-	eth_dev->data->dev_link.link_status = 1;
-	bnxt_set_hwrm_link_config(bp, true);
+	if (!bp->link_info.link_up)
+		rc = bnxt_set_hwrm_link_config(bp, true);
+	if (!rc)
+		eth_dev->data->dev_link.link_status = 1;
+
+	bnxt_print_link_info(eth_dev);
 	return 0;
 }
 
@@ -509,6 +503,8 @@ static int bnxt_dev_set_link_down_op(struct rte_eth_dev *eth_dev)
 
 	eth_dev->data->dev_link.link_status = 0;
 	bnxt_set_hwrm_link_config(bp, false);
+	bp->link_info.link_up = 0;
+
 	return 0;
 }
 
@@ -651,7 +647,8 @@ out:
 	/* Timed out or success */
 	if (new.link_status != eth_dev->data->dev_link.link_status ||
 	new.link_speed != eth_dev->data->dev_link.link_speed) {
-		rte_bnxt_atomic_write_link_status(eth_dev, &new);
+		memcpy(&eth_dev->data->dev_link, &new,
+			sizeof(struct rte_eth_link));
 		bnxt_print_link_info(eth_dev);
 	}
 
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 6fd024ada..619bc979c 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -481,34 +481,38 @@ static int bnxt_hwrm_port_phy_cfg(struct bnxt *bp, struct bnxt_link_info *conf)
 	struct hwrm_port_phy_cfg_input req = {0};
 	struct hwrm_port_phy_cfg_output *resp = bp->hwrm_cmd_resp_addr;
 	uint32_t enables = 0;
-	uint32_t link_speed_mask =
-		HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED_MASK;
 
 	HWRM_PREP(req, PORT_PHY_CFG, -1, resp);
 
 	if (conf->link_up) {
+		/* Setting Fixed Speed. But AutoNeg is ON, So disable it */
+		if (bp->link_info.auto_mode && conf->link_speed) {
+			req.auto_mode = HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_NONE;
+			RTE_LOG(DEBUG, PMD, "Disabling AutoNeg\n");
+		}
+
 		req.flags = rte_cpu_to_le_32(conf->phy_flags);
 		req.force_link_speed = rte_cpu_to_le_16(conf->link_speed);
+		enables |= HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_MODE;
 		/*
 		 * Note, ChiMP FW 20.2.1 and 20.2.2 return an error when we set
 		 * any auto mode, even "none".
 		 */
 		if (!conf->link_speed) {
-			req.auto_mode = conf->auto_mode;
-			enables |= HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_MODE;
-			if (conf->auto_mode ==
-			    HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK) {
-				req.auto_link_speed_mask =
-					conf->auto_link_speed_mask;
-				enables |= link_speed_mask;
-			}
-			if (bp->link_info.auto_link_speed) {
-				req.auto_link_speed =
-					bp->link_info.auto_link_speed;
-				enables |=
-				HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED;
-			}
+			/* No speeds specified. Enable AutoNeg - all speeds */
+			req.auto_mode =
+				HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ALL_SPEEDS;
 		}
+		/* AutoNeg - Advertise speeds specified. */
+		if (conf->auto_link_speed_mask) {
+			req.auto_mode =
+				HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK;
+			req.auto_link_speed_mask =
+				conf->auto_link_speed_mask;
+			enables |=
+			HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED_MASK;
+		}
+
 		req.auto_duplex = conf->duplex;
 		enables |= HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_DUPLEX;
 		req.auto_pause = conf->auto_pause;
@@ -556,6 +560,8 @@ static int bnxt_hwrm_port_phy_qcfg(struct bnxt *bp,
 	link_info->auto_pause = resp->auto_pause;
 	link_info->force_pause = resp->force_pause;
 	link_info->auto_mode = resp->auto_mode;
+	link_info->phy_type = resp->phy_type;
+	link_info->media_type = resp->media_type;
 
 	link_info->support_speeds = rte_le_to_cpu_16(resp->support_speeds);
 	link_info->auto_link_speed = rte_le_to_cpu_16(resp->auto_link_speed);
@@ -1274,6 +1280,11 @@ static uint16_t bnxt_parse_eth_link_duplex(uint32_t conf_link_speed)
 	return hw_link_duplex;
 }
 
+static uint16_t bnxt_check_eth_link_autoneg(uint32_t conf_link)
+{
+	return (conf_link & ETH_LINK_SPEED_FIXED) ? 0 : 1;
+}
+
 static uint16_t bnxt_parse_eth_link_speed(uint32_t conf_link_speed)
 {
 	uint16_t eth_link_speed = 0;
@@ -1482,7 +1493,7 @@ int bnxt_set_hwrm_link_config(struct bnxt *bp, bool link_up)
 	int rc = 0;
 	struct rte_eth_conf *dev_conf = &bp->eth_dev->data->dev_conf;
 	struct bnxt_link_info link_req;
-	uint16_t speed;
+	uint16_t speed, autoneg;
 
 	if (BNXT_NPAR_PF(bp) || BNXT_VF(bp))
 		return 0;
@@ -1497,20 +1508,28 @@ int bnxt_set_hwrm_link_config(struct bnxt *bp, bool link_up)
 	if (!link_up)
 		goto port_phy_cfg;
 
+	autoneg = bnxt_check_eth_link_autoneg(dev_conf->link_speeds);
 	speed = bnxt_parse_eth_link_speed(dev_conf->link_speeds);
 	link_req.phy_flags = HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY;
-	if (speed == 0) {
+	if (autoneg == 1) {
 		link_req.phy_flags |=
 				HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG;
-		link_req.auto_mode =
-				HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK;
 		link_req.auto_link_speed_mask =
 			bnxt_parse_eth_link_speed_mask(bp,
 						       dev_conf->link_speeds);
 	} else {
+		if (bp->link_info.phy_type ==
+		    HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASET ||
+		    bp->link_info.phy_type ==
+		    HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASETE ||
+		    bp->link_info.media_type ==
+		    HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_TP) {
+			RTE_LOG(ERR, PMD, "10GBase-T devices must autoneg\n");
+			return -EINVAL;
+		}
+
 		link_req.phy_flags |= HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE;
 		link_req.link_speed = speed;
-		RTE_LOG(INFO, PMD, "Set Link Speed %x\n", speed);
 	}
 	link_req.duplex = bnxt_parse_eth_link_duplex(dev_conf->link_speeds);
 	link_req.auto_pause = bp->link_info.auto_pause;
-- 
2.11.0

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

* [dpdk-stable] patch 'net/mlx5: fix link speed bitmasks' has been queued to LTS release 16.11.4
  2017-11-13 14:49         ` [dpdk-stable] patch 'net/i40e: fix VF cannot forward packets issue' " luca.boccassi
  2017-11-13 14:49           ` [dpdk-stable] patch 'net/nfp: fix stats struct initial value' " luca.boccassi
  2017-11-13 14:49           ` [dpdk-stable] patch 'net/bnxt: fix link handling and configuration' " luca.boccassi
@ 2017-11-13 14:49           ` luca.boccassi
  2017-11-13 14:49           ` [dpdk-stable] patch 'test/memzone: fix memory leak' " luca.boccassi
                             ` (2 subsequent siblings)
  5 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-13 14:49 UTC (permalink / raw)
  To: Edward Makarov; +Cc: Nelio Laranjeiro, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 49b5ac15653bff7dc06a4ec7ee2a53e1590c94ef Mon Sep 17 00:00:00 2001
From: Edward Makarov <makarov@kraftway.ru>
Date: Fri, 10 Nov 2017 14:18:04 +0000
Subject: [PATCH] net/mlx5: fix link speed bitmasks

[ upstream commit b113cb5ee6cec14a9892df1143217e358a58f5d6 ]

The constant ETHTOOL_LINK_MODE_1000baseT_Full_BIT and the others like
that in mlx5_link_update_unlocked_gs must be bit masks but unfortunately
they are bit numbers. This commit fixes the issue.

Fixes: 188408719888 ("net/mlx5: fix support for newer link speeds")

Signed-off-by: Edward Makarov <makarov@kraftway.ru>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
---
 drivers/net/mlx5/mlx5_ethdev.c | 50 +++++++++++++++++++++---------------------
 drivers/net/mlx5/mlx5_utils.h  |  4 ++++
 2 files changed, 29 insertions(+), 25 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 8ffb2d861..2ea995f89 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -792,39 +792,39 @@ mlx5_link_update_unlocked_gs(struct rte_eth_dev *dev, int wait_to_complete)
 	sc = ecmd->link_mode_masks[0] |
 		((uint64_t)ecmd->link_mode_masks[1] << 32);
 	priv->link_speed_capa = 0;
-	if (sc & ETHTOOL_LINK_MODE_Autoneg_BIT)
+	if (sc & MLX5_BITSHIFT(ETHTOOL_LINK_MODE_Autoneg_BIT))
 		priv->link_speed_capa |= ETH_LINK_SPEED_AUTONEG;
-	if (sc & (ETHTOOL_LINK_MODE_1000baseT_Full_BIT |
-		  ETHTOOL_LINK_MODE_1000baseKX_Full_BIT))
+	if (sc & (MLX5_BITSHIFT(ETHTOOL_LINK_MODE_1000baseT_Full_BIT) |
+		  MLX5_BITSHIFT(ETHTOOL_LINK_MODE_1000baseKX_Full_BIT)))
 		priv->link_speed_capa |= ETH_LINK_SPEED_1G;
-	if (sc & (ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT |
-		  ETHTOOL_LINK_MODE_10000baseKR_Full_BIT |
-		  ETHTOOL_LINK_MODE_10000baseR_FEC_BIT))
+	if (sc & (MLX5_BITSHIFT(ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT) |
+		  MLX5_BITSHIFT(ETHTOOL_LINK_MODE_10000baseKR_Full_BIT) |
+		  MLX5_BITSHIFT(ETHTOOL_LINK_MODE_10000baseR_FEC_BIT)))
 		priv->link_speed_capa |= ETH_LINK_SPEED_10G;
-	if (sc & (ETHTOOL_LINK_MODE_20000baseMLD2_Full_BIT |
-		  ETHTOOL_LINK_MODE_20000baseKR2_Full_BIT))
+	if (sc & (MLX5_BITSHIFT(ETHTOOL_LINK_MODE_20000baseMLD2_Full_BIT) |
+		  MLX5_BITSHIFT(ETHTOOL_LINK_MODE_20000baseKR2_Full_BIT)))
 		priv->link_speed_capa |= ETH_LINK_SPEED_20G;
-	if (sc & (ETHTOOL_LINK_MODE_40000baseKR4_Full_BIT |
-		  ETHTOOL_LINK_MODE_40000baseCR4_Full_BIT |
-		  ETHTOOL_LINK_MODE_40000baseSR4_Full_BIT |
-		  ETHTOOL_LINK_MODE_40000baseLR4_Full_BIT))
+	if (sc & (MLX5_BITSHIFT(ETHTOOL_LINK_MODE_40000baseKR4_Full_BIT) |
+		  MLX5_BITSHIFT(ETHTOOL_LINK_MODE_40000baseCR4_Full_BIT) |
+		  MLX5_BITSHIFT(ETHTOOL_LINK_MODE_40000baseSR4_Full_BIT) |
+		  MLX5_BITSHIFT(ETHTOOL_LINK_MODE_40000baseLR4_Full_BIT)))
 		priv->link_speed_capa |= ETH_LINK_SPEED_40G;
-	if (sc & (ETHTOOL_LINK_MODE_56000baseKR4_Full_BIT |
-		  ETHTOOL_LINK_MODE_56000baseCR4_Full_BIT |
-		  ETHTOOL_LINK_MODE_56000baseSR4_Full_BIT |
-		  ETHTOOL_LINK_MODE_56000baseLR4_Full_BIT))
+	if (sc & (MLX5_BITSHIFT(ETHTOOL_LINK_MODE_56000baseKR4_Full_BIT) |
+		  MLX5_BITSHIFT(ETHTOOL_LINK_MODE_56000baseCR4_Full_BIT) |
+		  MLX5_BITSHIFT(ETHTOOL_LINK_MODE_56000baseSR4_Full_BIT) |
+		  MLX5_BITSHIFT(ETHTOOL_LINK_MODE_56000baseLR4_Full_BIT)))
 		priv->link_speed_capa |= ETH_LINK_SPEED_56G;
-	if (sc & (ETHTOOL_LINK_MODE_25000baseCR_Full_BIT |
-		  ETHTOOL_LINK_MODE_25000baseKR_Full_BIT |
-		  ETHTOOL_LINK_MODE_25000baseSR_Full_BIT))
+	if (sc & (MLX5_BITSHIFT(ETHTOOL_LINK_MODE_25000baseCR_Full_BIT) |
+		  MLX5_BITSHIFT(ETHTOOL_LINK_MODE_25000baseKR_Full_BIT) |
+		  MLX5_BITSHIFT(ETHTOOL_LINK_MODE_25000baseSR_Full_BIT)))
 		priv->link_speed_capa |= ETH_LINK_SPEED_25G;
-	if (sc & (ETHTOOL_LINK_MODE_50000baseCR2_Full_BIT |
-		  ETHTOOL_LINK_MODE_50000baseKR2_Full_BIT))
+	if (sc & (MLX5_BITSHIFT(ETHTOOL_LINK_MODE_50000baseCR2_Full_BIT) |
+		  MLX5_BITSHIFT(ETHTOOL_LINK_MODE_50000baseKR2_Full_BIT)))
 		priv->link_speed_capa |= ETH_LINK_SPEED_50G;
-	if (sc & (ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT |
-		  ETHTOOL_LINK_MODE_100000baseSR4_Full_BIT |
-		  ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT |
-		  ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT))
+	if (sc & (MLX5_BITSHIFT(ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT) |
+		  MLX5_BITSHIFT(ETHTOOL_LINK_MODE_100000baseSR4_Full_BIT) |
+		  MLX5_BITSHIFT(ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT) |
+		  MLX5_BITSHIFT(ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT)))
 		priv->link_speed_capa |= ETH_LINK_SPEED_100G;
 	dev_link.link_duplex = ((ecmd->duplex == DUPLEX_HALF) ?
 				ETH_LINK_HALF_DUPLEX : ETH_LINK_FULL_DUPLEX);
diff --git a/drivers/net/mlx5/mlx5_utils.h b/drivers/net/mlx5/mlx5_utils.h
index a824787ff..f126979b7 100644
--- a/drivers/net/mlx5/mlx5_utils.h
+++ b/drivers/net/mlx5/mlx5_utils.h
@@ -35,6 +35,7 @@
 #define RTE_PMD_MLX5_UTILS_H_
 
 #include <stddef.h>
+#include <stdint.h>
 #include <stdio.h>
 #include <limits.h>
 #include <assert.h>
@@ -61,6 +62,9 @@
 	 !!(((bf)[((b) / (sizeof((bf)[0]) * CHAR_BIT))] & \
 	     ((size_t)1 << ((b) % (sizeof((bf)[0]) * CHAR_BIT))))))
 
+/* Convert a bit number to the corresponding 64-bit mask */
+#define MLX5_BITSHIFT(v) (UINT64_C(1) << (v))
+
 /* Save and restore errno around argument evaluation. */
 #define ERRNO_SAFE(x) ((errno = (int []){ errno, ((x), 0) }[0]))
 
-- 
2.11.0

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

* [dpdk-stable] patch 'test/memzone: fix memory leak' has been queued to LTS release 16.11.4
  2017-11-13 14:49         ` [dpdk-stable] patch 'net/i40e: fix VF cannot forward packets issue' " luca.boccassi
                             ` (2 preceding siblings ...)
  2017-11-13 14:49           ` [dpdk-stable] patch 'net/mlx5: fix link speed bitmasks' " luca.boccassi
@ 2017-11-13 14:49           ` luca.boccassi
  2017-11-13 14:49           ` [dpdk-stable] patch 'pdump: fix possible mbuf leak on failure' " luca.boccassi
  2017-11-13 14:49           ` [dpdk-stable] patch 'ring: guarantee load/load order in enqueue and dequeue' " luca.boccassi
  5 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-13 14:49 UTC (permalink / raw)
  To: Radoslaw Biernacki; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From c3ded11c1be627b0447a8e9c3d3d30346e955fc4 Mon Sep 17 00:00:00 2001
From: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
Date: Wed, 8 Nov 2017 13:33:14 +0100
Subject: [PATCH] test/memzone: fix memory leak

[ upstream commit 71330483a19303e5001ea70af80672cbe6cd881b ]

This patch fixes the memory leaks in memzone_autotest. Those memory leaks
lead to failures in tests from the same testing group due to out of memory
problems.  With introduction of rte_memzone_free() it is now possible to
free the memzone.  Fix uses this API call to make a clean after each test
case.

Fixes: ff909fe21f0a ("mem: introduce memzone freeing")

Signed-off-by: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
---
 app/test/test_memzone.c | 135 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 134 insertions(+), 1 deletion(-)

diff --git a/app/test/test_memzone.c b/app/test/test_memzone.c
index 7ae31cf74..72cda007d 100644
--- a/app/test/test_memzone.c
+++ b/app/test/test_memzone.c
@@ -176,6 +176,10 @@ test_memzone_reserve_flags(void)
 			printf("hugepage_sz not equal 2M\n");
 			return -1;
 		}
+		if (rte_memzone_free(mz)) {
+			printf("Fail memzone free\n");
+			return -1;
+		}
 
 		mz = rte_memzone_reserve("flag_zone_2M_HINT", size, SOCKET_ID_ANY,
 				RTE_MEMZONE_2MB|RTE_MEMZONE_SIZE_HINT_ONLY);
@@ -187,6 +191,10 @@ test_memzone_reserve_flags(void)
 			printf("hugepage_sz not equal 2M\n");
 			return -1;
 		}
+		if (rte_memzone_free(mz)) {
+			printf("Fail memzone free\n");
+			return -1;
+		}
 
 		/* Check if 1GB huge pages are unavailable, that function fails unless
 		 * HINT flag is indicated
@@ -202,6 +210,10 @@ test_memzone_reserve_flags(void)
 				printf("hugepage_sz not equal 2M\n");
 				return -1;
 			}
+			if (rte_memzone_free(mz)) {
+				printf("Fail memzone free\n");
+				return -1;
+			}
 
 			mz = rte_memzone_reserve("flag_zone_1G", size, SOCKET_ID_ANY,
 					RTE_MEMZONE_1GB);
@@ -224,6 +236,10 @@ test_memzone_reserve_flags(void)
 			printf("hugepage_sz not equal 1G\n");
 			return -1;
 		}
+		if (rte_memzone_free(mz)) {
+			printf("Fail memzone free\n");
+			return -1;
+		}
 
 		mz = rte_memzone_reserve("flag_zone_1G_HINT", size, SOCKET_ID_ANY,
 				RTE_MEMZONE_1GB|RTE_MEMZONE_SIZE_HINT_ONLY);
@@ -235,6 +251,10 @@ test_memzone_reserve_flags(void)
 			printf("hugepage_sz not equal 1G\n");
 			return -1;
 		}
+		if (rte_memzone_free(mz)) {
+			printf("Fail memzone free\n");
+			return -1;
+		}
 
 		/* Check if 1GB huge pages are unavailable, that function fails unless
 		 * HINT flag is indicated
@@ -250,12 +270,20 @@ test_memzone_reserve_flags(void)
 				printf("hugepage_sz not equal 1G\n");
 				return -1;
 			}
+			if (rte_memzone_free(mz)) {
+				printf("Fail memzone free\n");
+				return -1;
+			}
 			mz = rte_memzone_reserve("flag_zone_2M", size, SOCKET_ID_ANY,
 					RTE_MEMZONE_2MB);
 			if (mz != NULL) {
 				printf("MEMZONE FLAG 2MB\n");
 				return -1;
 			}
+			if (rte_memzone_free(mz)) {
+				printf("Fail memzone free\n");
+				return -1;
+			}
 		}
 
 		if (hugepage_2MB_avail && hugepage_1GB_avail) {
@@ -285,6 +313,10 @@ test_memzone_reserve_flags(void)
 			printf("hugepage_sz not equal 16M\n");
 			return -1;
 		}
+		if (rte_memzone_free(mz)) {
+			printf("Fail memzone free\n");
+			return -1;
+		}
 
 		mz = rte_memzone_reserve("flag_zone_16M_HINT", size,
 		SOCKET_ID_ANY, RTE_MEMZONE_16MB|RTE_MEMZONE_SIZE_HINT_ONLY);
@@ -296,6 +328,10 @@ test_memzone_reserve_flags(void)
 			printf("hugepage_sz not equal 16M\n");
 			return -1;
 		}
+		if (rte_memzone_free(mz)) {
+			printf("Fail memzone free\n");
+			return -1;
+		}
 
 		/* Check if 1GB huge pages are unavailable, that function fails
 		 * unless HINT flag is indicated
@@ -312,6 +348,10 @@ test_memzone_reserve_flags(void)
 				printf("hugepage_sz not equal 16M\n");
 				return -1;
 			}
+			if (rte_memzone_free(mz)) {
+				printf("Fail memzone free\n");
+				return -1;
+			}
 
 			mz = rte_memzone_reserve("flag_zone_16G", size,
 				SOCKET_ID_ANY, RTE_MEMZONE_16GB);
@@ -333,6 +373,10 @@ test_memzone_reserve_flags(void)
 			printf("hugepage_sz not equal 16G\n");
 			return -1;
 		}
+		if (rte_memzone_free(mz)) {
+			printf("Fail memzone free\n");
+			return -1;
+		}
 
 		mz = rte_memzone_reserve("flag_zone_16G_HINT", size,
 		SOCKET_ID_ANY, RTE_MEMZONE_16GB|RTE_MEMZONE_SIZE_HINT_ONLY);
@@ -344,6 +388,10 @@ test_memzone_reserve_flags(void)
 			printf("hugepage_sz not equal 16G\n");
 			return -1;
 		}
+		if (rte_memzone_free(mz)) {
+			printf("Fail memzone free\n");
+			return -1;
+		}
 
 		/* Check if 1GB huge pages are unavailable, that function fails
 		 * unless HINT flag is indicated
@@ -360,6 +408,10 @@ test_memzone_reserve_flags(void)
 				printf("hugepage_sz not equal 16G\n");
 				return -1;
 			}
+			if (rte_memzone_free(mz)) {
+				printf("Fail memzone free\n");
+				return -1;
+			}
 			mz = rte_memzone_reserve("flag_zone_16M", size,
 				SOCKET_ID_ANY, RTE_MEMZONE_16MB);
 			if (mz != NULL) {
@@ -434,6 +486,12 @@ test_memzone_reserve_max(void)
 		rte_memzone_dump(stdout);
 		return -1;
 	}
+
+	if (rte_memzone_free(mz)) {
+		printf("Fail memzone free\n");
+		return -1;
+	}
+
 	return 0;
 }
 
@@ -473,6 +531,12 @@ test_memzone_reserve_max_aligned(void)
 		rte_memzone_dump(stdout);
 		return -1;
 	}
+
+	if (rte_memzone_free(mz)) {
+		printf("Fail memzone free\n");
+		return -1;
+	}
+
 	return 0;
 }
 
@@ -593,6 +657,28 @@ test_memzone_aligned(void)
 	if (is_memory_overlap(memzone_aligned_512->phys_addr, memzone_aligned_512->len,
 					memzone_aligned_1024->phys_addr, memzone_aligned_1024->len))
 		return -1;
+
+	/* free all used zones */
+	if (rte_memzone_free(memzone_aligned_32)) {
+		printf("Fail memzone free\n");
+		return -1;
+	}
+	if (rte_memzone_free(memzone_aligned_128)) {
+		printf("Fail memzone free\n");
+		return -1;
+	}
+	if (rte_memzone_free(memzone_aligned_256)) {
+		printf("Fail memzone free\n");
+		return -1;
+	}
+	if (rte_memzone_free(memzone_aligned_512)) {
+		printf("Fail memzone free\n");
+		return -1;
+	}
+	if (rte_memzone_free(memzone_aligned_1024)) {
+		printf("Fail memzone free\n");
+		return -1;
+	}
 	return 0;
 }
 
@@ -638,6 +724,11 @@ check_memzone_bounded(const char *name, uint32_t len,  uint32_t align,
 		return -1;
 	}
 
+	if (rte_memzone_free(mz)) {
+		printf("Fail memzone free\n");
+		return -1;
+	}
+
 	return 0;
 }
 
@@ -758,7 +849,7 @@ test_memzone_free(void)
 }
 
 static int
-test_memzone(void)
+test_memzone_basic(void)
 {
 	const struct rte_memzone *memzone1;
 	const struct rte_memzone *memzone2;
@@ -837,6 +928,40 @@ test_memzone(void)
 	if (mz != NULL)
 		return -1;
 
+	if (rte_memzone_free(memzone1)) {
+		printf("Fail memzone free - memzone1\n");
+		return -1;
+	}
+	if (rte_memzone_free(memzone2)) {
+		printf("Fail memzone free - memzone2\n");
+		return -1;
+	}
+	if (memzone3 && rte_memzone_free(memzone3)) {
+		printf("Fail memzone free - memzone3\n");
+		return -1;
+	}
+	if (rte_memzone_free(memzone4)) {
+		printf("Fail memzone free - memzone4\n");
+		return -1;
+	}
+
+	return 0;
+}
+
+static int memzone_calk_called;
+static void memzone_walk_clb(const struct rte_memzone *mz __rte_unused,
+			     void *arg __rte_unused)
+{
+	memzone_calk_called = 1;
+}
+
+static int
+test_memzone(void)
+{
+	printf("test basic memzone API\n");
+	if (test_memzone_basic() < 0)
+		return -1;
+
 	printf("test free memzone\n");
 	if (test_memzone_free() < 0)
 		return -1;
@@ -869,6 +994,14 @@ test_memzone(void)
 	if (test_memzone_reserve_max_aligned() < 0)
 		return -1;
 
+	printf("check memzone cleanup\n");
+	rte_memzone_walk(memzone_walk_clb, NULL);
+	if (memzone_calk_called) {
+		printf("there are some memzones left after test\n");
+		rte_memzone_dump(stdout);
+		return -1;
+	}
+
 	return 0;
 }
 
-- 
2.11.0

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

* [dpdk-stable] patch 'pdump: fix possible mbuf leak on failure' has been queued to LTS release 16.11.4
  2017-11-13 14:49         ` [dpdk-stable] patch 'net/i40e: fix VF cannot forward packets issue' " luca.boccassi
                             ` (3 preceding siblings ...)
  2017-11-13 14:49           ` [dpdk-stable] patch 'test/memzone: fix memory leak' " luca.boccassi
@ 2017-11-13 14:49           ` luca.boccassi
  2017-11-13 14:49           ` [dpdk-stable] patch 'ring: guarantee load/load order in enqueue and dequeue' " luca.boccassi
  5 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-13 14:49 UTC (permalink / raw)
  To: Ilya V. Matveychikov; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 1b8810926176b5a3d5707da8cc3d135b1c97fbf2 Mon Sep 17 00:00:00 2001
From: "Ilya V. Matveychikov" <matvejchikov@gmail.com>
Date: Fri, 10 Nov 2017 16:55:16 +0300
Subject: [PATCH] pdump: fix possible mbuf leak on failure

[ upstream commit ef1d0e390e056916438ad74c4fa0333c3f09aaa6 ]

If pdump_pktmbuf_copy_data() fails it's possible to have segment leak
as rte_pktmbuf_free() only handles m_dup chain but not the seg just
allocated and yet not chained.

Fixes: 278f945402c5 ("pdump: add new library for packet capture")

Signed-off-by: Ilya V. Matveychikov <matvejchikov@gmail.com>
---
 lib/librte_pdump/rte_pdump.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c
index 596868374..e64bf598c 100644
--- a/lib/librte_pdump/rte_pdump.c
+++ b/lib/librte_pdump/rte_pdump.c
@@ -154,6 +154,8 @@ pdump_pktmbuf_copy(struct rte_mbuf *m, struct rte_mempool *mp)
 	do {
 		nseg++;
 		if (pdump_pktmbuf_copy_data(seg, m) < 0) {
+			if (seg != m_dup)
+				rte_pktmbuf_free_seg(seg);
 			rte_pktmbuf_free(m_dup);
 			return NULL;
 		}
-- 
2.11.0

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

* [dpdk-stable] patch 'ring: guarantee load/load order in enqueue and dequeue' has been queued to LTS release 16.11.4
  2017-11-13 14:49         ` [dpdk-stable] patch 'net/i40e: fix VF cannot forward packets issue' " luca.boccassi
                             ` (4 preceding siblings ...)
  2017-11-13 14:49           ` [dpdk-stable] patch 'pdump: fix possible mbuf leak on failure' " luca.boccassi
@ 2017-11-13 14:49           ` luca.boccassi
  5 siblings, 0 replies; 109+ messages in thread
From: luca.boccassi @ 2017-11-13 14:49 UTC (permalink / raw)
  To: Jia He; +Cc: Jie Liu, Bing Zhao, Jerin Jacob, Jianbo Liu, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 16.11.4

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

Thanks.

Kind regards,
Luca Boccassi

---
>From 0b16342d527b3ea5ca579274598ff8a52fcb7e8e Mon Sep 17 00:00:00 2001
From: Jia He <jia.he@hxt-semitech.com>
Date: Fri, 10 Nov 2017 03:30:42 +0000
Subject: [PATCH] ring: guarantee load/load order in enqueue and dequeue

[ upstream commit 9bc2cbb007c0a3335c5582357ae9f6d37ea0b654 ]

We watched a rte panic of mbuf_autotest in our qualcomm arm64 server
(Amberwing).

Root cause:
In __rte_ring_move_cons_head()
...
        do {
                /* Restore n as it may change every loop */
                n = max;

                *old_head = r->cons.head;                //1st load
                const uint32_t prod_tail = r->prod.tail; //2nd load

In weak memory order architectures (powerpc,arm), the 2nd load might be
reodered before the 1st load, that makes *entries is bigger than we wanted.
This nasty reording messed enque/deque up.

cpu1(producer)          cpu2(consumer)          cpu3(consumer)
                        load r->prod.tail
in enqueue:
load r->cons.tail
load r->prod.head

store r->prod.tail

                                                load r->cons.head
                                                load r->prod.tail
                                                ...
                                                store r->cons.{head,tail}
                        load r->cons.head

Then, r->cons.head will be bigger than prod_tail, then make *entries very
big and the consumer will go forward incorrectly.

After this patch, the old cons.head will be recaculated after failure of
rte_atomic32_cmpset

There is no such issue on X86, because X86 is strong memory order model.
But rte_smp_rmb() doesn't have impact on runtime performance on X86, so
keep the same code without architectures specific concerns.

Fixes: 50d769054872 ("ring: add burst API")

Signed-off-by: Jia He <jia.he@hxt-semitech.com>
Signed-off-by: Jie Liu <jie2.liu@hxt-semitech.com>
Signed-off-by: Bing Zhao <bing.zhao@hxt-semitech.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Jianbo Liu <jianbo.liu@arm.com>
---
 lib/librte_ring/rte_ring.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h
index 32b8c8d2c..c1b311a8b 100644
--- a/lib/librte_ring/rte_ring.h
+++ b/lib/librte_ring/rte_ring.h
@@ -450,6 +450,12 @@ __rte_ring_mp_do_enqueue(struct rte_ring *r, void * const *obj_table,
 		n = max;
 
 		prod_head = r->prod.head;
+
+		/* add rmb barrier to avoid load/load reorder in weak
+		 * memory model. It is noop on x86
+		 */
+		rte_smp_rmb();
+
 		cons_tail = r->cons.tail;
 		/* The subtraction is done between two unsigned 32bits value
 		 * (the result is always modulo 32 bits even if we have
@@ -642,6 +648,12 @@ __rte_ring_mc_do_dequeue(struct rte_ring *r, void **obj_table,
 		n = max;
 
 		cons_head = r->cons.head;
+
+		/* add rmb barrier to avoid load/load reorder in weak
+		 * memory model. It is noop on x86
+		 */
+		rte_smp_rmb();
+
 		prod_tail = r->prod.tail;
 		/* The subtraction is done between two unsigned 32bits value
 		 * (the result is always modulo 32 bits even if we have
-- 
2.11.0

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

end of thread, other threads:[~2017-11-13 14:49 UTC | newest]

Thread overview: 109+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-30 15:34 [dpdk-stable] patch 'cmdline: fix warning for unused return value' has been queued to LTS release 16.11.4 luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net: fix inner L2 length in packet type parser' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'vfio: fix close unchecked file descriptor' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'eal: fix auxv open check for ARM and PPC' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix flow control watermark mismatch' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/nfp: fix RSS' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix PF notify issue when VF is not up' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/ixgbe: fix mapping of user priority to TC' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/enic: fix possible null pointer dereference' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/mlx5: fix clang build' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/mlx5: improve stack usage during link update' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/mlx5: fix probe failure report' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/cxgbe: fix memory leak' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/ixgbe: fix adding a mirror rule' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/vmxnet3: fix MAC address set' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix memory leak if VF init fails' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix i40evf MAC filter table' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/mlx5: fix Tx stats error counter definition' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/mlx5: fix Tx stats error counter logic' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix packet count for PF' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'test: fix assignment operation' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/igb: fix memcpy length' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e/base: fix bool definition' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix variable assignment' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/qede/base: fix to use a passed ptt handle' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/qede/base: fix macros to check chip revision/metal' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/qede/base: fix API return types' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/qede/base: fix number of app table entries' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix clear xstats bug in VF' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'app/testpmd: fix packet throughput after stats reset' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix mirror rule reset when port is closed' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/bnxt: fix an issue with broadcast traffic' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/bnxt: set checksum offload flags correctly' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/bnxt: update status of Rx IP/L4 CKSUM' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/bnxt: fix interrupt handler' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/vmxnet3: fix dereference before null check' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'uio: fix compilation with -Og' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'cmdline: " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'hash: fix eviction counter' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'mem: fix malloc element free in debug mode' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'eal: copy raw strings taken from command line' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/virtio: fix mbuf port for simple Rx function' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/virtio: fix queue setup consistency' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/virtio: fix untrusted scalar value' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'timer: use 64-bit specific code on more platforms' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/virtio: fix compilation with -Og' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/bonding: fix LACP slave deactivate behavioral' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/qede/base: fix for VF malicious indication' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/qede/base: fix return code to align with FW' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'app/testpmd: fix invalid port id parameters' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/mlx5: fix clang compilation error' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/enic: fix assignment' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/i40e: fix uninitialized variable' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/ixgbe: fix VFIO interrupt mapping in VF' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'net/ixgbe: fix uninitialized variable' " luca.boccassi
2017-10-30 15:34 ` [dpdk-stable] patch 'examples/l2fwd-crypto: fix uninitialized errno value' " luca.boccassi
2017-10-30 15:35 ` [dpdk-stable] patch 'drivers/crypto: use snprintf return value correctly' " luca.boccassi
2017-10-30 15:35 ` [dpdk-stable] patch 'net/i40e: fix flexible payload configuration' " luca.boccassi
2017-10-30 15:35 ` [dpdk-stable] patch 'net/i40e: fix mbuf free in vector Tx' " luca.boccassi
2017-10-30 15:35 ` [dpdk-stable] patch 'kni: fix ethtool build with kernel 4.11' " luca.boccassi
2017-10-30 15:35 ` [dpdk-stable] patch 'kni: fix build on RHEL 7.4' " luca.boccassi
2017-10-30 15:35 ` [dpdk-stable] patch 'kni: fix build on SLE12 SP3' " luca.boccassi
2017-10-30 15:35 ` [dpdk-stable] patch 'examples/l2fwd-cat: fix build with PQOS 1.4' " luca.boccassi
2017-10-30 15:35 ` [dpdk-stable] patch 'examples/l2fwd_fork: fix message pool init' " luca.boccassi
2017-10-30 15:35 ` [dpdk-stable] patch 'examples/l3fwd-acl: check fseek return' " luca.boccassi
2017-10-30 15:35 ` [dpdk-stable] patch 'examples/performance-thread: check thread creation' " luca.boccassi
2017-10-30 15:35 ` [dpdk-stable] patch 'examples/performance-thread: fix out-of-bounds sched array' " luca.boccassi
2017-10-30 15:35 ` [dpdk-stable] patch 'examples/performance-thread: fix out-of-bounds tls " luca.boccassi
2017-11-02 12:02 ` [dpdk-stable] patch 'eal/bsd: fix missing interrupt stub functions' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'net/virtio: flush Rx queues on start' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'net/virtio: fix Tx packet length stats' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'examples/qos_sched: fix uninitialized config' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'examples/ipsec-secgw: fix IP version check' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'cryptodev: fix build with -Ofast' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'examples/ipsec-secgw: fix IPv6 payload length' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'app/testpmd: fix RSS structure initialisation' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'net/enic: fix packet loss after MTU change' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'net/ixgbe: fix PF DCB info' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'app/testpmd: fix mapping of user priority to DCB TC' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'net/bnxt: fix Tx offload capability' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'net/bnxt: fix Rx " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'net/bnxt: fix a bit shift operation' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'net/bnxt: fix a potential null pointer dereference' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'eal/x86: fix atomic cmpset' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'examples/multi_process: fix received message length' " luca.boccassi
2017-11-02 12:02   ` [dpdk-stable] patch 'lpm6: fix compilation with -Og' " luca.boccassi
2017-11-10 16:09     ` [dpdk-stable] patch 'buildtools: fix icc build' " luca.boccassi
2017-11-10 16:09       ` [dpdk-stable] patch 'config: fix bnx2x option for armv7a' " luca.boccassi
2017-11-10 16:09       ` [dpdk-stable] patch 'net/i40e: fix mirror with firmware 6.0' " luca.boccassi
2017-11-10 16:09       ` [dpdk-stable] patch 'net/i40e: fix Rx packets number for NEON' " luca.boccassi
2017-11-10 16:09       ` [dpdk-stable] patch 'net/vmxnet3: fix memory leak when releasing queues' " luca.boccassi
2017-11-10 16:09       ` [dpdk-stable] patch 'net/i40e: fix VFIO interrupt mapping in VF' " luca.boccassi
2017-11-10 16:09       ` [dpdk-stable] patch 'net/i40e: fix Rx queue " luca.boccassi
2017-11-10 16:09       ` [dpdk-stable] patch 'net/igb: fix Rx interrupt with VFIO and MSI-X' " luca.boccassi
2017-11-10 16:09       ` [dpdk-stable] patch 'net/pcap: fix memory leak in dumper open' " luca.boccassi
2017-11-10 16:09       ` [dpdk-stable] patch 'test/pmd_perf: fix crash with multiple devices' " luca.boccassi
2017-11-10 16:09       ` [dpdk-stable] patch 'app/testpmd: fix forwarding between non consecutive ports' " luca.boccassi
2017-11-10 16:09       ` [dpdk-stable] patch 'app/testpmd: fix topology error message' " luca.boccassi
2017-11-10 16:09       ` [dpdk-stable] patch 'usertools: fix device binding with python 3' " luca.boccassi
2017-11-10 16:09       ` [dpdk-stable] patch 'net/qede/base: fix division by zero' " luca.boccassi
2017-11-10 16:09       ` [dpdk-stable] patch 'net/qede: fix icc build' " luca.boccassi
2017-11-10 16:10       ` [dpdk-stable] patch 'buildtools: check allocation error in pmdinfogen' " luca.boccassi
2017-11-13 14:49         ` [dpdk-stable] patch 'net/i40e: fix VF cannot forward packets issue' " luca.boccassi
2017-11-13 14:49           ` [dpdk-stable] patch 'net/nfp: fix stats struct initial value' " luca.boccassi
2017-11-13 14:49           ` [dpdk-stable] patch 'net/bnxt: fix link handling and configuration' " luca.boccassi
2017-11-13 14:49           ` [dpdk-stable] patch 'net/mlx5: fix link speed bitmasks' " luca.boccassi
2017-11-13 14:49           ` [dpdk-stable] patch 'test/memzone: fix memory leak' " luca.boccassi
2017-11-13 14:49           ` [dpdk-stable] patch 'pdump: fix possible mbuf leak on failure' " luca.boccassi
2017-11-13 14:49           ` [dpdk-stable] patch 'ring: guarantee load/load order in enqueue and dequeue' " luca.boccassi

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