* [dpdk-stable] patch 'net/qede: fix device stop to remove primary MAC' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'net/qede: fix to prevent overwriting packet type' " luca.boccassi
` (82 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Rasesh Mody; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From ca0da86b0468e5ec9ee9f59b0be42667e86189a6 Mon Sep 17 00:00:00 2001
From: Rasesh Mody <rasesh.mody@cavium.com>
Date: Tue, 27 Mar 2018 17:15:54 -0700
Subject: [PATCH] net/qede: fix device stop to remove primary MAC
[ upstream commit 83ade1ebdbfc8211d3cb5c2bc282c3fa396e4a34 ]
This fix is to remove primary MAC filter during dev stop. Without the
fix device start attempt to add the primary MAC fails. Perform MAC set
remove under IS_PF() check.
Fixes: dd28bc8c6ef4 ("net/qede: fix VF port creation sequence")
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
drivers/net/qede/qede_ethdev.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index a91f43683..0708dc8ba 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -998,7 +998,7 @@ qede_mac_addr_remove(struct rte_eth_dev *eth_dev, uint32_t index)
ether_addr_copy(ð_dev->data->mac_addrs[index],
(struct ether_addr *)&ucast.mac);
- ecore_filter_ucast_cmd(edev, &ucast, ECORE_SPQ_MODE_CB, NULL);
+ qede_mac_int_ops(eth_dev, &ucast, false);
}
static void
@@ -1336,6 +1336,9 @@ static void qede_dev_stop(struct rte_eth_dev *eth_dev)
/* Disable traffic */
ecore_hw_stop_fastpath(edev); /* TBD - loop */
+ if (IS_PF(edev))
+ qede_mac_addr_remove(eth_dev, 0);
+
DP_INFO(edev, "Device is stopped\n");
}
@@ -2391,6 +2394,9 @@ static int qede_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
dev->data->dev_started = 0;
qede_dev_stop(dev);
restart = true;
+ } else {
+ if (IS_PF(edev))
+ qede_mac_addr_remove(dev, 0);
}
rte_delay_ms(1000);
qede_start_vport(qdev, mtu); /* Recreate vport */
@@ -2418,7 +2424,9 @@ static int qede_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
dev->data->dev_conf.rxmode.jumbo_frame = 0;
/* Restore config lost due to vport stop */
- qede_mac_addr_set(dev, &qdev->primary_mac);
+ if (IS_PF(edev))
+ qede_mac_addr_set(dev, &qdev->primary_mac);
+
if (dev->data->promiscuous)
qede_promiscuous_enable(dev);
else
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/qede: fix to prevent overwriting packet type' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'net/qede: fix device stop to remove primary MAC' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'ethdev: fix port accessing after release' " luca.boccassi
` (81 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Harish Patil; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From fd10a0bddbf1742724892df22819cbd730861cc1 Mon Sep 17 00:00:00 2001
From: Harish Patil <harish.patil@cavium.com>
Date: Tue, 27 Mar 2018 17:15:55 -0700
Subject: [PATCH] net/qede: fix to prevent overwriting packet type
[ upstream commit c152cbe2522afa12e49bdc4bb19eb5adc6227218 ]
Fixes: 3f72dd780e10 ("net/qede: check tunnel L3 header")
Signed-off-by: Harish Patil <harish.patil@cavium.com>
---
drivers/net/qede/qede_rxtx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c
index 0de7c6b8a..906f26f08 100644
--- a/drivers/net/qede/qede_rxtx.c
+++ b/drivers/net/qede/qede_rxtx.c
@@ -1466,6 +1466,8 @@ qede_recv_pkts(void *p_rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
*/
rx_mb->data_off = offset + RTE_PKTMBUF_HEADROOM;
packet_type |= qede_rx_cqe_to_pkt_type_outer(rx_mb);
+ } else {
+ packet_type |= qede_rx_cqe_to_pkt_type(parse_flag);
}
/* Common handling for non-tunnel packets and for inner
@@ -1487,7 +1489,6 @@ qede_recv_pkts(void *p_rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
ol_flags |= PKT_RX_IP_CKSUM_BAD;
} else {
ol_flags |= PKT_RX_IP_CKSUM_GOOD;
- packet_type |= qede_rx_cqe_to_pkt_type(parse_flag);
}
if (CQE_HAS_VLAN(parse_flag) ||
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'ethdev: fix port accessing after release' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'net/qede: fix device stop to remove primary MAC' " luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'net/qede: fix to prevent overwriting packet type' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'vhost: avoid concurrency when logging dirty pages' " luca.boccassi
` (80 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Matan Azrad; +Cc: Ferruh Yigit, Thomas Monjalon, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From ef52abb3783d209fc258b7e1bd915bc2735a3ef5 Mon Sep 17 00:00:00 2001
From: Matan Azrad <matan@mellanox.com>
Date: Wed, 28 Mar 2018 12:10:30 +0000
Subject: [PATCH] ethdev: fix port accessing after release
[ upstream commit f0e1180cb6a99825587ce4c108c4366023ac1f63 ]
rte_eth_dev_pci_release() function wrongly releases an ethdev port and
then releases internal fields of this port.
This behavior is problematic, because after the release, the port may
be reallocated again by another thread or just be invalid for any
usage.
Move the release operation to the end of the function.
Fixes: dcd5c8112bc3 ("ethdev: add PCI driver helpers")
Suggested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
lib/librte_ether/rte_ethdev_pci.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev_pci.h b/lib/librte_ether/rte_ethdev_pci.h
index 897ce5b41..6565ae7d3 100644
--- a/lib/librte_ether/rte_ethdev_pci.h
+++ b/lib/librte_ether/rte_ethdev_pci.h
@@ -123,9 +123,6 @@ rte_eth_dev_pci_allocate(struct rte_pci_device *dev, size_t private_data_size)
static inline void
rte_eth_dev_pci_release(struct rte_eth_dev *eth_dev)
{
- /* free ether device */
- rte_eth_dev_release_port(eth_dev);
-
if (rte_eal_process_type() == RTE_PROC_PRIMARY)
rte_free(eth_dev->data->dev_private);
@@ -139,6 +136,9 @@ rte_eth_dev_pci_release(struct rte_eth_dev *eth_dev)
eth_dev->device = NULL;
eth_dev->intr_handle = NULL;
+
+ /* free ether device */
+ rte_eth_dev_release_port(eth_dev);
}
typedef int (*eth_dev_pci_callback_t)(struct rte_eth_dev *eth_dev);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'vhost: avoid concurrency when logging dirty pages' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (2 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'ethdev: fix port accessing after release' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:44 ` Maxime Coquelin
2018-04-30 14:40 ` [dpdk-stable] patch 'net/vhost: fix crash when creating vdev dynamically' " luca.boccassi
` (79 subsequent siblings)
83 siblings, 1 reply; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Maxime Coquelin; +Cc: Jianfeng Tan, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From a5d642c446cc3a3be41694715d99f3e9f9ea44df Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin@redhat.com>
Date: Wed, 21 Mar 2018 16:44:13 +0100
Subject: [PATCH] vhost: avoid concurrency when logging dirty pages
[ upstream commit 394313fff39d0f994325c47f7eab39daf5dc9e11 ]
This patch aims at fixing a migration performance regression
faced since atomic operation is used to log pages as dirty when
doing live migration.
Instead of setting a single bit by doing an atomic read-modify-write
operation to log a page as dirty, this patch write 0xFF to the
corresponding byte, and so logs 8 page as dirty.
The advantage is that it avoids concurrent atomic operations by
multiple PMD threads, the drawback is that some clean pages are
marked as dirty and so are transferred twice.
Fixes: 897f13a1f726 ("vhost: make page logging atomic")
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>
---
lib/librte_vhost/vhost.h | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
index bab0b456e..a4f23f714 100644
--- a/lib/librte_vhost/vhost.h
+++ b/lib/librte_vhost/vhost.h
@@ -247,18 +247,14 @@ struct virtio_net {
#define VHOST_LOG_PAGE 4096
/*
- * Atomically set a bit in memory.
+ * Mark all pages belonging to the same dirty log bitmap byte
+ * as dirty. The goal is to avoid concurrency between different
+ * threads doing atomic read-modify-writes on the same byte.
*/
-static __rte_always_inline void
-vhost_set_bit(unsigned int nr, volatile uint8_t *addr)
-{
- __sync_fetch_and_or_8(addr, (1U << nr));
-}
-
static __rte_always_inline void
vhost_log_page(uint8_t *log_base, uint64_t page)
{
- vhost_set_bit(page % 8, &log_base[page / 8]);
+ log_base[page / 8] = 0xff;
}
static __rte_always_inline void
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* Re: [dpdk-stable] patch 'vhost: avoid concurrency when logging dirty pages' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'vhost: avoid concurrency when logging dirty pages' " luca.boccassi
@ 2018-04-30 14:44 ` Maxime Coquelin
2018-04-30 14:56 ` Luca Boccassi
0 siblings, 1 reply; 382+ messages in thread
From: Maxime Coquelin @ 2018-04-30 14:44 UTC (permalink / raw)
To: luca.boccassi; +Cc: Jianfeng Tan, dpdk stable
Hi Luca,
Please don't backport this patch to -stable releases.
It has already been reverted in upstream master, and a new patch is to
be posted in the coming hours.
I already notified Yuanhan for the same for v17.11 LTS.
Thanks,
Maxime
On 04/30/2018 04:40 PM, luca.boccassi@gmail.com wrote:
> Hi,
>
> FYI, your patch has been queued to stable release 18.02.2
>
> Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
> It will be pushed if I get no objections before 05/02/18. So please
> shout if anyone has objections.
>
> Thanks.
>
> Luca Boccassi
>
> ---
> From a5d642c446cc3a3be41694715d99f3e9f9ea44df Mon Sep 17 00:00:00 2001
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> Date: Wed, 21 Mar 2018 16:44:13 +0100
> Subject: [PATCH] vhost: avoid concurrency when logging dirty pages
>
> [ upstream commit 394313fff39d0f994325c47f7eab39daf5dc9e11 ]
>
> This patch aims at fixing a migration performance regression
> faced since atomic operation is used to log pages as dirty when
> doing live migration.
>
> Instead of setting a single bit by doing an atomic read-modify-write
> operation to log a page as dirty, this patch write 0xFF to the
> corresponding byte, and so logs 8 page as dirty.
>
> The advantage is that it avoids concurrent atomic operations by
> multiple PMD threads, the drawback is that some clean pages are
> marked as dirty and so are transferred twice.
>
> Fixes: 897f13a1f726 ("vhost: make page logging atomic")
>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>
> ---
> lib/librte_vhost/vhost.h | 12 ++++--------
> 1 file changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
> index bab0b456e..a4f23f714 100644
> --- a/lib/librte_vhost/vhost.h
> +++ b/lib/librte_vhost/vhost.h
> @@ -247,18 +247,14 @@ struct virtio_net {
> #define VHOST_LOG_PAGE 4096
>
> /*
> - * Atomically set a bit in memory.
> + * Mark all pages belonging to the same dirty log bitmap byte
> + * as dirty. The goal is to avoid concurrency between different
> + * threads doing atomic read-modify-writes on the same byte.
> */
> -static __rte_always_inline void
> -vhost_set_bit(unsigned int nr, volatile uint8_t *addr)
> -{
> - __sync_fetch_and_or_8(addr, (1U << nr));
> -}
> -
> static __rte_always_inline void
> vhost_log_page(uint8_t *log_base, uint64_t page)
> {
> - vhost_set_bit(page % 8, &log_base[page / 8]);
> + log_base[page / 8] = 0xff;
> }
>
> static __rte_always_inline void
>
^ permalink raw reply [flat|nested] 382+ messages in thread
* Re: [dpdk-stable] patch 'vhost: avoid concurrency when logging dirty pages' has been queued to stable release 18.02.2
2018-04-30 14:44 ` Maxime Coquelin
@ 2018-04-30 14:56 ` Luca Boccassi
0 siblings, 0 replies; 382+ messages in thread
From: Luca Boccassi @ 2018-04-30 14:56 UTC (permalink / raw)
To: Maxime Coquelin; +Cc: Jianfeng Tan, dpdk stable
On Mon, 2018-04-30 at 16:44 +0200, Maxime Coquelin wrote:
> Hi Luca,
>
> Please don't backport this patch to -stable releases.
> It has already been reverted in upstream master, and a new patch is
> to
> be posted in the coming hours.
>
> I already notified Yuanhan for the same for v17.11 LTS.
>
> Thanks,
> Maxime
Ok, removed, thanks for the heads-up.
> On 04/30/2018 04:40 PM, luca.boccassi@gmail.com wrote:
> > Hi,
> >
> > FYI, your patch has been queued to stable release 18.02.2
> >
> > Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable
> > yet.
> > It will be pushed if I get no objections before 05/02/18. So please
> > shout if anyone has objections.
> >
> > Thanks.
> >
> > Luca Boccassi
> >
> > ---
> > From a5d642c446cc3a3be41694715d99f3e9f9ea44df Mon Sep 17 00:00:00
> > 2001
> > From: Maxime Coquelin <maxime.coquelin@redhat.com>
> > Date: Wed, 21 Mar 2018 16:44:13 +0100
> > Subject: [PATCH] vhost: avoid concurrency when logging dirty pages
> >
> > [ upstream commit 394313fff39d0f994325c47f7eab39daf5dc9e11 ]
> >
> > This patch aims at fixing a migration performance regression
> > faced since atomic operation is used to log pages as dirty when
> > doing live migration.
> >
> > Instead of setting a single bit by doing an atomic read-modify-
> > write
> > operation to log a page as dirty, this patch write 0xFF to the
> > corresponding byte, and so logs 8 page as dirty.
> >
> > The advantage is that it avoids concurrent atomic operations by
> > multiple PMD threads, the drawback is that some clean pages are
> > marked as dirty and so are transferred twice.
> >
> > Fixes: 897f13a1f726 ("vhost: make page logging atomic")
> >
> > Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> > Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>
> > ---
> > lib/librte_vhost/vhost.h | 12 ++++--------
> > 1 file changed, 4 insertions(+), 8 deletions(-)
> >
> > diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
> > index bab0b456e..a4f23f714 100644
> > --- a/lib/librte_vhost/vhost.h
> > +++ b/lib/librte_vhost/vhost.h
> > @@ -247,18 +247,14 @@ struct virtio_net {
> > #define VHOST_LOG_PAGE 4096
> >
> > /*
> > - * Atomically set a bit in memory.
> > + * Mark all pages belonging to the same dirty log bitmap byte
> > + * as dirty. The goal is to avoid concurrency between different
> > + * threads doing atomic read-modify-writes on the same byte.
> > */
> > -static __rte_always_inline void
> > -vhost_set_bit(unsigned int nr, volatile uint8_t *addr)
> > -{
> > - __sync_fetch_and_or_8(addr, (1U << nr));
> > -}
> > -
> > static __rte_always_inline void
> > vhost_log_page(uint8_t *log_base, uint64_t page)
> > {
> > - vhost_set_bit(page % 8, &log_base[page / 8]);
> > + log_base[page / 8] = 0xff;
> > }
> >
> > static __rte_always_inline void
> >
--
Kind regards,
Luca Boccassi
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/vhost: fix crash when creating vdev dynamically' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (3 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'vhost: avoid concurrency when logging dirty pages' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'crypto/dpaa2_sec: fix debug logs' " luca.boccassi
` (78 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Junjie Chen; +Cc: Zhiyong Yang, Maxime Coquelin, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From ebab27f620c6bbd7fe725487dbb165a96251bd36 Mon Sep 17 00:00:00 2001
From: Junjie Chen <junjie.j.chen@intel.com>
Date: Fri, 30 Mar 2018 14:58:31 +0800
Subject: [PATCH] net/vhost: fix crash when creating vdev dynamically
[ upstream commit 30a701a53737a0b6f7953412cc3b3d36c1d49122 ]
When creating vdev dynamically, vhost pmd driver starts directly without
checking TX/RX queues are ready or not, and thus causes segmentation fault
when vhost library accesses queues. This patch adds a flag to check whether
queues are setup or not, and adds queues setup into dev_start function to
allow user to start them after setting up.
Fixes: aed0b12930b3 ("net/vhost: fix socket file deleted on stop")
Signed-off-by: Junjie Chen <junjie.j.chen@intel.com>
Tested-by: Zhiyong Yang <zhiyong.yang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
drivers/net/vhost/rte_eth_vhost.c | 69 ++++++++++++++++++++++++++-------------
1 file changed, 46 insertions(+), 23 deletions(-)
diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index 3aae01c39..11b607650 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -117,6 +117,7 @@ struct pmd_internal {
char *dev_name;
char *iface_name;
uint16_t max_queues;
+ uint16_t vid;
rte_atomic32_t started;
};
@@ -527,8 +528,10 @@ update_queuing_status(struct rte_eth_dev *dev)
unsigned int i;
int allow_queuing = 1;
- if (rte_atomic32_read(&internal->started) == 0 ||
- rte_atomic32_read(&internal->dev_attached) == 0)
+ if (rte_atomic32_read(&internal->dev_attached) == 0)
+ return;
+
+ if (rte_atomic32_read(&internal->started) == 0)
allow_queuing = 0;
/* Wait until rx/tx_pkt_burst stops accessing vhost device */
@@ -551,13 +554,36 @@ update_queuing_status(struct rte_eth_dev *dev)
}
}
+static void
+queue_setup(struct rte_eth_dev *eth_dev, struct pmd_internal *internal)
+{
+ struct vhost_queue *vq;
+ int i;
+
+ for (i = 0; i < eth_dev->data->nb_rx_queues; i++) {
+ vq = eth_dev->data->rx_queues[i];
+ if (!vq)
+ continue;
+ vq->vid = internal->vid;
+ vq->internal = internal;
+ vq->port = eth_dev->data->port_id;
+ }
+ for (i = 0; i < eth_dev->data->nb_tx_queues; i++) {
+ vq = eth_dev->data->tx_queues[i];
+ if (!vq)
+ continue;
+ vq->vid = internal->vid;
+ vq->internal = internal;
+ vq->port = eth_dev->data->port_id;
+ }
+}
+
static int
new_device(int vid)
{
struct rte_eth_dev *eth_dev;
struct internal_list *list;
struct pmd_internal *internal;
- struct vhost_queue *vq;
unsigned i;
char ifname[PATH_MAX];
#ifdef RTE_LIBRTE_VHOST_NUMA
@@ -580,21 +606,13 @@ new_device(int vid)
eth_dev->data->numa_node = newnode;
#endif
- for (i = 0; i < eth_dev->data->nb_rx_queues; i++) {
- vq = eth_dev->data->rx_queues[i];
- if (vq == NULL)
- continue;
- vq->vid = vid;
- vq->internal = internal;
- vq->port = eth_dev->data->port_id;
- }
- for (i = 0; i < eth_dev->data->nb_tx_queues; i++) {
- vq = eth_dev->data->tx_queues[i];
- if (vq == NULL)
- continue;
- vq->vid = vid;
- vq->internal = internal;
- vq->port = eth_dev->data->port_id;
+ internal->vid = vid;
+ if (eth_dev->data->rx_queues && eth_dev->data->tx_queues) {
+ queue_setup(eth_dev, internal);
+ rte_atomic32_set(&internal->dev_attached, 1);
+ } else {
+ RTE_LOG(INFO, PMD, "RX/TX queues have not setup yet\n");
+ rte_atomic32_set(&internal->dev_attached, 0);
}
for (i = 0; i < rte_vhost_get_vring_num(vid); i++)
@@ -604,7 +622,6 @@ new_device(int vid)
eth_dev->data->dev_link.link_status = ETH_LINK_UP;
- rte_atomic32_set(&internal->dev_attached, 1);
update_queuing_status(eth_dev);
RTE_LOG(INFO, PMD, "Vhost device %d created\n", vid);
@@ -634,8 +651,9 @@ destroy_device(int vid)
eth_dev = list->eth_dev;
internal = eth_dev->data->dev_private;
+ rte_atomic32_set(&internal->started, 0);
+ update_queuing_status(eth_dev);
rte_atomic32_set(&internal->dev_attached, 0);
- update_queuing_status(eth_dev);
eth_dev->data->dev_link.link_status = ETH_LINK_DOWN;
@@ -770,12 +788,17 @@ rte_eth_vhost_get_vid_from_port_id(uint16_t port_id)
}
static int
-eth_dev_start(struct rte_eth_dev *dev)
+eth_dev_start(struct rte_eth_dev *eth_dev)
{
- struct pmd_internal *internal = dev->data->dev_private;
+ struct pmd_internal *internal = eth_dev->data->dev_private;
+
+ if (unlikely(rte_atomic32_read(&internal->dev_attached) == 0)) {
+ queue_setup(eth_dev, internal);
+ rte_atomic32_set(&internal->dev_attached, 1);
+ }
rte_atomic32_set(&internal->started, 1);
- update_queuing_status(dev);
+ update_queuing_status(eth_dev);
return 0;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'crypto/dpaa2_sec: fix debug logs' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (4 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'net/vhost: fix crash when creating vdev dynamically' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'config: remove old log level option' " luca.boccassi
` (77 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Shreyansh Jain; +Cc: Hemant Agrawal, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From a27705ff26797d16e8fbfe93a12950c82b8bf21b Mon Sep 17 00:00:00 2001
From: Shreyansh Jain <shreyansh.jain@nxp.com>
Date: Mon, 2 Apr 2018 19:36:00 +0530
Subject: [PATCH] crypto/dpaa2_sec: fix debug logs
[ upstream commit 79c271ee4f51a4216439477797bda8fb82806ea8 ]
Digest and IV length variable declarations have changed.
These were escaping builds as the debugging macro was disabled.
During dynamic logging change, they were discoverd.
Fixes: 0fbd75a99fc9 ("cryptodev: move IV parameters to session")
Fixes: 7f0034275a24 ("cryptodev: remove digest length from crypto op")
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index 9a790dddd..3954afe94 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -136,7 +136,7 @@ build_authenc_gcm_sg_fd(dpaa2_sec_session *sess,
"iv-len=%d data_off: 0x%x\n",
sym_op->aead.data.offset,
sym_op->aead.data.length,
- sym_op->aead.digest.length,
+ sess->digest_length,
sess->iv.length,
sym_op->m_src->data_off);
@@ -301,7 +301,7 @@ build_authenc_gcm_fd(dpaa2_sec_session *sess,
"iv-len=%d data_off: 0x%x\n",
sym_op->aead.data.offset,
sym_op->aead.data.length,
- sym_op->aead.digest.length,
+ sess->digest_length,
sess->iv.length,
sym_op->m_src->data_off);
@@ -433,10 +433,10 @@ build_authenc_sg_fd(dpaa2_sec_session *sess,
"cipher_off: 0x%x/length %d, iv-len=%d data_off: 0x%x\n",
sym_op->auth.data.offset,
sym_op->auth.data.length,
- sym_op->auth.digest.length,
+ sess->digest_length,
sym_op->cipher.data.offset,
sym_op->cipher.data.length,
- sym_op->cipher.iv.length,
+ sess->iv.length,
sym_op->m_src->data_off);
/* Configure Output FLE with Scatter/Gather Entry */
@@ -877,7 +877,7 @@ build_cipher_sg_fd(dpaa2_sec_session *sess, struct rte_crypto_op *op,
"CIPHER SG: cipher_off: 0x%x/length %d,ivlen=%d data_off: 0x%x",
sym_op->cipher.data.offset,
sym_op->cipher.data.length,
- sym_op->cipher.iv.length,
+ sess->iv.length,
sym_op->m_src->data_off);
/* o/p fle */
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'config: remove old log level option' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (5 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'crypto/dpaa2_sec: fix debug logs' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'mbuf: fix truncated strncpy' " luca.boccassi
` (76 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 1319d5b781f8d7d39a0931aeef313b2f04b6e400 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Fri, 16 Feb 2018 12:02:39 -0800
Subject: [PATCH] config: remove old log level option
[ upstream commit aded107a7428d54fea3ef7d9fb99729a2808eb75 ]
The old RTE_LOG_LEVEL has been replaced by RTE_DP_LOG_LEVEL and
is not used anywhere in the current source tree.
It is a merge leftover.
Fixes: 43e9f17ce7b8 ("log: remove log level config option")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
config/rte_config.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/config/rte_config.h b/config/rte_config.h
index 699878adb..08bcb1c3d 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -24,7 +24,6 @@
#define RTE_MAX_MEMSEG 512
#define RTE_MAX_MEMZONE 2560
#define RTE_MAX_TAILQ 32
-#define RTE_LOG_LEVEL RTE_LOG_INFO
#define RTE_LOG_DP_LEVEL RTE_LOG_INFO
#define RTE_BACKTRACE 1
#define RTE_EAL_VFIO 1
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'mbuf: fix truncated strncpy' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (6 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'config: remove old log level option' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'bus/fslmc: fix find device start condition' " luca.boccassi
` (75 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 4905f7ecca8a84444d2e394ea1f9ac88c4a32a2e Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Thu, 29 Mar 2018 10:05:30 -0700
Subject: [PATCH] mbuf: fix truncated strncpy
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[ upstream commit 8ea081f381615308bb872a608ebbdb0aa6c9f90f ]
Gcc-8 discovers issue with platform_mempool_ops.
rte_mbuf_pool_ops.c:26:3: error: ‘strncpy’ output truncated before
terminating nul copying as many bytes from a string as its length
[-Werror=stringop-truncation]
strncpy(mz->addr, ops_name, strlen(ops_name));
Since the ops_name is already checked for size, using strncpy
here is unnecessary; just use strcpy.
Fixes: a3acc3144a76 ("mbuf: add pool ops selection functions")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_mbuf/rte_mbuf_pool_ops.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/librte_mbuf/rte_mbuf_pool_ops.c b/lib/librte_mbuf/rte_mbuf_pool_ops.c
index 48cc34200..a1d4699f6 100644
--- a/lib/librte_mbuf/rte_mbuf_pool_ops.c
+++ b/lib/librte_mbuf/rte_mbuf_pool_ops.c
@@ -23,7 +23,7 @@ rte_mbuf_set_platform_mempool_ops(const char *ops_name)
RTE_MEMPOOL_OPS_NAMESIZE, SOCKET_ID_ANY, 0);
if (mz == NULL)
return -rte_errno;
- strncpy(mz->addr, ops_name, strlen(ops_name));
+ strcpy(mz->addr, ops_name);
return 0;
} else if (strcmp(mz->addr, ops_name) == 0) {
return 0;
@@ -62,7 +62,7 @@ rte_mbuf_set_user_mempool_ops(const char *ops_name)
return -rte_errno;
}
- strncpy(mz->addr, ops_name, strlen(ops_name));
+ strcpy(mz->addr, ops_name);
return 0;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'bus/fslmc: fix find device start condition' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (7 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'mbuf: fix truncated strncpy' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'hash: fix missing spinlock unlock in add key' " luca.boccassi
` (74 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Gaetan Rivet; +Cc: Shreyansh Jain, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 55a19abb371f93be67ef7995eada545fff8e8331 Mon Sep 17 00:00:00 2001
From: Gaetan Rivet <gaetan.rivet@6wind.com>
Date: Thu, 22 Mar 2018 11:28:44 +0100
Subject: [PATCH] bus/fslmc: fix find device start condition
[ upstream commit 78f5a2e93d746110d1da1a81a62cf6149c52e6ef ]
If start is set and a device before it matches the data,
this device is returned.
Fixes: c7fe1eea8a74 ("bus: simplify finding starting point")
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
drivers/bus/fslmc/fslmc_bus.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index 5ee0beb85..010dd474e 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -301,8 +301,9 @@ rte_fslmc_find_device(const struct rte_device *start, rte_dev_cmp_t cmp,
struct rte_dpaa2_device *dev;
TAILQ_FOREACH(dev, &rte_fslmc_bus.device_list, next) {
- if (start && &dev->device == start) {
- start = NULL; /* starting point found */
+ if (start != NULL) {
+ if (&dev->device == start)
+ start = NULL; /* starting point found */
continue;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'hash: fix missing spinlock unlock in add key' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (8 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'bus/fslmc: fix find device start condition' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'app/crypto-perf: fix IOVA translation' " luca.boccassi
` (73 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Pavan Nikhilesh; +Cc: Pablo de Lara, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 7eeacc3b4a3fb3bdc8655736dfda3beb21789f8e Mon Sep 17 00:00:00 2001
From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Date: Sun, 4 Mar 2018 20:28:31 +0530
Subject: [PATCH] hash: fix missing spinlock unlock in add key
[ upstream commit e166e55c1a472d6bbc388c66f41be5823c63f8b7 ]
Fix missing spinlock unlock during add key when key is already present.
Fixes: be856325cba3 ("hash: add scalable multi-writer insertion with Intel TSX")
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
lib/librte_hash/rte_cuckoo_hash.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c
index 9b1387b5e..a07543a29 100644
--- a/lib/librte_hash/rte_cuckoo_hash.c
+++ b/lib/librte_hash/rte_cuckoo_hash.c
@@ -552,7 +552,8 @@ __rte_hash_add_key_with_hash(const struct rte_hash *h, const void *key,
* Return index where key is stored,
* subtracting the first dummy index
*/
- return prim_bkt->key_idx[i] - 1;
+ ret = prim_bkt->key_idx[i] - 1;
+ goto failure;
}
}
}
@@ -572,7 +573,8 @@ __rte_hash_add_key_with_hash(const struct rte_hash *h, const void *key,
* Return index where key is stored,
* subtracting the first dummy index
*/
- return sec_bkt->key_idx[i] - 1;
+ ret = sec_bkt->key_idx[i] - 1;
+ goto failure;
}
}
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'app/crypto-perf: fix IOVA translation' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (9 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'hash: fix missing spinlock unlock in add key' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'mem: do not use physical addresses in IOVA as VA mode' " luca.boccassi
` (72 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Anatoly Burakov; +Cc: Pablo de Lara, Santosh Shukla, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From a88333bdda807a6014473946e618f66bc2ef1aa9 Mon Sep 17 00:00:00 2001
From: Anatoly Burakov <anatoly.burakov@intel.com>
Date: Wed, 4 Apr 2018 15:40:44 +0100
Subject: [PATCH] app/crypto-perf: fix IOVA translation
[ upstream commit 72b75134b89667baf4aaf4fcb516ab6bc2b1ebd7 ]
IOVA addresses should be found by calling rte_virt2iova() as
opposed to rte_virt2phy(), as physical address may not be
equal to IOVA address.
Fixes: 2eb6a1a3e5fc ("app/crypto-perf: fix crypto op init")
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
---
app/test-crypto-perf/cperf_test_common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/test-crypto-perf/cperf_test_common.c b/app/test-crypto-perf/cperf_test_common.c
index 21cb1c221..bd71ac353 100644
--- a/app/test-crypto-perf/cperf_test_common.c
+++ b/app/test-crypto-perf/cperf_test_common.c
@@ -91,7 +91,7 @@ mempool_obj_init(struct rte_mempool *mp,
op->type = RTE_CRYPTO_OP_TYPE_SYMMETRIC;
op->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
op->sess_type = RTE_CRYPTO_OP_WITH_SESSION;
- op->phys_addr = rte_mem_virt2phy(obj);
+ op->phys_addr = rte_mem_virt2iova(obj);
op->mempool = mp;
/* Set source buffer */
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'mem: do not use physical addresses in IOVA as VA mode' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (10 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'app/crypto-perf: fix IOVA translation' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'bus/fslmc: do not needlessly check for IOVA " luca.boccassi
` (71 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Anatoly Burakov; +Cc: Santosh Shukla, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From fe29a30cda0df4a22d022ffad812e87557c9fe88 Mon Sep 17 00:00:00 2001
From: Anatoly Burakov <anatoly.burakov@intel.com>
Date: Wed, 4 Apr 2018 15:40:45 +0100
Subject: [PATCH] mem: do not use physical addresses in IOVA as VA mode
[ upstream commit 048303b6f3fdfb5ce863e293f6b3dfabc0a0a2db ]
We already use VA addresses for IOVA purposes everywhere if we're in
RTE_IOVA_VA mode:
1) rte_malloc_virt2phy()/rte_malloc_virt2iova() always return VA addresses
2) Because of 1), memzone's IOVA is set to VA address on reserve
3) Because of 2), mempool's IOVA addresses are set to VA addresses
The only place where actual physical addresses are stored is in memsegs at
init time, but we're not using them anywhere, and there is no external API
to get those addresses (aside from manually iterating through memsegs), nor
should anyone care about them in RTE_IOVA_VA mode.
So, fix EAL initialization to allocate VA-contiguous segments at the start
without regard for physical addresses (as if they weren't available), and
use VA to set final IOVA addresses for all pages.
Fixes: 62196f4e0941 ("mem: rename address mapping function to IOVA")
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
---
lib/librte_eal/linuxapp/eal/eal_memory.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index 38853b753..ecf375b22 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -473,6 +473,9 @@ map_all_hugepages(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi,
hugepg_tbl[i].orig_va = virtaddr;
}
else {
+ /* rewrite physical addresses in IOVA as VA mode */
+ if (rte_eal_iova_mode() == RTE_IOVA_VA)
+ hugepg_tbl[i].physaddr = (uintptr_t)virtaddr;
hugepg_tbl[i].final_va = virtaddr;
}
@@ -1091,7 +1094,8 @@ rte_eal_hugepage_init(void)
continue;
}
- if (phys_addrs_available) {
+ if (phys_addrs_available &&
+ rte_eal_iova_mode() != RTE_IOVA_VA) {
/* find physical addresses for each hugepage */
if (find_physaddrs(&tmp_hp[hp_offset], hpi) < 0) {
RTE_LOG(DEBUG, EAL, "Failed to find phys addr "
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'bus/fslmc: do not needlessly check for IOVA mode' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (11 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'mem: do not use physical addresses in IOVA as VA mode' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'vfio: " luca.boccassi
` (70 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Anatoly Burakov; +Cc: Hemant Agrawal, Santosh Shukla, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From ed0cb73db919e4a382f991c8b3863c6dc6f54546 Mon Sep 17 00:00:00 2001
From: Anatoly Burakov <anatoly.burakov@intel.com>
Date: Wed, 4 Apr 2018 15:40:46 +0100
Subject: [PATCH] bus/fslmc: do not needlessly check for IOVA mode
[ upstream commit 634d549c9c34385b86b1ca4d422adcc20c696517 ]
We already set IOVA addresses of memsegs and memzones to VA
address during initialization, so we don't need to check
whether we're in RTE_IOVA_VA mode anywhere else.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
---
drivers/bus/fslmc/fslmc_vfio.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index 1241295be..affc9f80e 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -223,10 +223,7 @@ int rte_fslmc_vfio_dmamap(void)
dma_map.size = memseg[i].len;
dma_map.vaddr = memseg[i].addr_64;
#ifdef RTE_LIBRTE_DPAA2_USE_PHYS_IOVA
- if (rte_eal_iova_mode() == RTE_IOVA_VA)
- dma_map.iova = dma_map.vaddr;
- else
- dma_map.iova = memseg[i].iova;
+ dma_map.iova = memseg[i].iova;
#else
dma_map.iova = dma_map.vaddr;
#endif
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'vfio: do not needlessly check for IOVA mode' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (12 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'bus/fslmc: do not needlessly check for IOVA " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'bus/dpaa: fix resource leak' " luca.boccassi
` (69 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Anatoly Burakov; +Cc: Santosh Shukla, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 3b25b24326726592a0ac49352c672486213f2dac Mon Sep 17 00:00:00 2001
From: Anatoly Burakov <anatoly.burakov@intel.com>
Date: Wed, 4 Apr 2018 15:40:47 +0100
Subject: [PATCH] vfio: do not needlessly check for IOVA mode
[ upstream commit bef5a2d629d536a82c81c02b84684da828c0e37f ]
We already set IOVA addresses of memsegs and memzones to VA
address during initialization, so we don't need to check
whether we're in RTE_IOVA_VA mode anywhere else.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
---
lib/librte_eal/linuxapp/eal/eal_vfio.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c
index e44ae4d04..2421d513b 100644
--- a/lib/librte_eal/linuxapp/eal/eal_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c
@@ -681,10 +681,7 @@ vfio_type1_dma_map(int vfio_container_fd)
dma_map.argsz = sizeof(struct vfio_iommu_type1_dma_map);
dma_map.vaddr = ms[i].addr_64;
dma_map.size = ms[i].len;
- if (rte_eal_iova_mode() == RTE_IOVA_VA)
- dma_map.iova = dma_map.vaddr;
- else
- dma_map.iova = ms[i].iova;
+ dma_map.iova = ms[i].iova;
dma_map.flags = VFIO_DMA_MAP_FLAG_READ | VFIO_DMA_MAP_FLAG_WRITE;
ret = ioctl(vfio_container_fd, VFIO_IOMMU_MAP_DMA, &dma_map);
@@ -784,10 +781,7 @@ vfio_spapr_dma_map(int vfio_container_fd)
dma_map.argsz = sizeof(struct vfio_iommu_type1_dma_map);
dma_map.vaddr = ms[i].addr_64;
dma_map.size = ms[i].len;
- if (rte_eal_iova_mode() == RTE_IOVA_VA)
- dma_map.iova = dma_map.vaddr;
- else
- dma_map.iova = ms[i].iova;
+ dma_map.iova = ms[i].iova;
dma_map.flags = VFIO_DMA_MAP_FLAG_READ |
VFIO_DMA_MAP_FLAG_WRITE;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'bus/dpaa: fix resource leak' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (13 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'vfio: " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'bus/dpaa: fix unchecked return value' " luca.boccassi
` (68 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Hemant Agrawal; +Cc: Shreyansh Jain, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 05a71f386e18b0dcc7b802dbf79f1a8d28927a11 Mon Sep 17 00:00:00 2001
From: Hemant Agrawal <hemant.agrawal@nxp.com>
Date: Mon, 9 Apr 2018 15:52:48 +0530
Subject: [PATCH] bus/dpaa: fix resource leak
[ upstream commit 35bb5234defc3d1629e1f24db0ade342b0157e70 ]
Coverity issue: 268337
Fixes: 1459585888b5 ("bus/dpaa: fix memory allocation during scan")
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
drivers/bus/dpaa/base/fman/fman.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/bus/dpaa/base/fman/fman.c b/drivers/bus/dpaa/base/fman/fman.c
index bda62e011..c19b2fba9 100644
--- a/drivers/bus/dpaa/base/fman/fman.c
+++ b/drivers/bus/dpaa/base/fman/fman.c
@@ -442,6 +442,7 @@ fman_if_init(const struct device_node *dpa_node)
if (!pool_node) {
FMAN_ERR(-ENXIO, "%s: bad fsl,bman-buffer-pools\n",
dname);
+ free(bpool);
goto err;
}
pname = pool_node->full_name;
@@ -449,6 +450,7 @@ fman_if_init(const struct device_node *dpa_node)
prop = of_get_property(pool_node, "fsl,bpid", &proplen);
if (!prop) {
FMAN_ERR(-EINVAL, "%s: no fsl,bpid\n", pname);
+ free(bpool);
goto err;
}
assert(proplen == sizeof(*prop));
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'bus/dpaa: fix unchecked return value' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (14 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'bus/dpaa: fix resource leak' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'net/dpaa: fix array overrun' " luca.boccassi
` (67 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Sunil Kumar Kori; +Cc: Hemant Agrawal, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From ade0ca3edca5d0b3f5176e18c19f2a0b9bb0800f Mon Sep 17 00:00:00 2001
From: Sunil Kumar Kori <sunil.kori@nxp.com>
Date: Mon, 9 Apr 2018 15:52:45 +0530
Subject: [PATCH] bus/dpaa: fix unchecked return value
[ upstream commit 23386f2ece4b6d3a15b3940088edecbfc877917d ]
Coverity issue: 268323
Fixes: 5d944582d028 ("bus/dpaa: check portal presence in the caller function")
Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/bus/dpaa/dpaa_bus.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index f2bb3b158..d64173972 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -309,9 +309,15 @@ rte_dpaa_portal_fq_init(void *arg, struct qman_fq *fq)
/* Affine above created portal with channel*/
u32 sdqcr;
struct qman_portal *qp;
+ int ret;
- if (unlikely(!RTE_PER_LCORE(dpaa_io)))
- rte_dpaa_portal_init(arg);
+ if (unlikely(!RTE_PER_LCORE(dpaa_io))) {
+ ret = rte_dpaa_portal_init(arg);
+ if (ret < 0) {
+ DPAA_BUS_LOG(ERR, "portal initialization failure");
+ return ret;
+ }
+ }
/* Initialise qman specific portals */
qp = fsl_qman_portal_create();
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/dpaa: fix array overrun' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (15 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'bus/dpaa: fix unchecked return value' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'net/dpaa: fix oob access' " luca.boccassi
` (66 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Hemant Agrawal; +Cc: Shreyansh Jain, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From f41ce0863e303f24b29ff7ecfbb0e37ca094fbc7 Mon Sep 17 00:00:00 2001
From: Hemant Agrawal <hemant.agrawal@nxp.com>
Date: Mon, 9 Apr 2018 15:52:46 +0530
Subject: [PATCH] net/dpaa: fix array overrun
[ upstream commit e4f931cc6ef271e817ee4f6465b8048815255deb ]
Coverity issue: 268342
Fixes: 62f53995caaf ("net/dpaa: add frame count based tail drop with CGR")
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
drivers/net/dpaa/dpaa_ethdev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index 9b69ef456..800b75464 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -1105,10 +1105,10 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)
dpaa_push_mode_max_queue = DPAA_MAX_PUSH_MODE_QUEUE;
}
- /* Each device can not have more than DPAA_PCD_FQID_MULTIPLIER RX
+ /* Each device can not have more than DPAA_MAX_NUM_PCD_QUEUES RX
* queues.
*/
- if (num_rx_fqs <= 0 || num_rx_fqs > DPAA_PCD_FQID_MULTIPLIER) {
+ if (num_rx_fqs <= 0 || num_rx_fqs > DPAA_MAX_NUM_PCD_QUEUES) {
DPAA_PMD_ERR("Invalid number of RX queues\n");
return -EINVAL;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/dpaa: fix oob access' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (16 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'net/dpaa: fix array overrun' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'net/dpaa2: fix xstats' " luca.boccassi
` (65 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Hemant Agrawal; +Cc: Shreyansh Jain, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From c038124399990c93e8548fe95b364ea535afdaf3 Mon Sep 17 00:00:00 2001
From: Hemant Agrawal <hemant.agrawal@nxp.com>
Date: Mon, 9 Apr 2018 15:52:47 +0530
Subject: [PATCH] net/dpaa: fix oob access
[ upstream commit 5c3fc73e820ac0365ae1c1da5546572ac80e64cf ]
Coverity issue: 268318
Fixes: b21ed3e2a16d ("net/dpaa: support extended statistics")
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
drivers/net/dpaa/dpaa_ethdev.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index 800b75464..f511fa514 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -335,10 +335,13 @@ dpaa_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
static int
dpaa_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
struct rte_eth_xstat_name *xstats_names,
- __rte_unused unsigned int limit)
+ unsigned int limit)
{
unsigned int i, stat_cnt = RTE_DIM(dpaa_xstats_strings);
+ if (limit < stat_cnt)
+ return stat_cnt;
+
if (xstats_names != NULL)
for (i = 0; i < stat_cnt; i++)
snprintf(xstats_names[i].name,
@@ -366,7 +369,7 @@ dpaa_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
return 0;
fman_if_stats_get_all(dpaa_intf->fif, values_copy,
- sizeof(struct dpaa_if_stats));
+ sizeof(struct dpaa_if_stats) / 8);
for (i = 0; i < stat_cnt; i++)
values[i] =
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/dpaa2: fix xstats' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (17 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'net/dpaa: fix oob access' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'vfio: fix device hotplug when several devices per group' " luca.boccassi
` (64 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Hemant Agrawal; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 2739338fff6635592d2b663a93cd9e68d1ec980a Mon Sep 17 00:00:00 2001
From: Hemant Agrawal <hemant.agrawal@nxp.com>
Date: Mon, 9 Apr 2018 15:52:50 +0530
Subject: [PATCH] net/dpaa2: fix xstats
[ upstream commit 876b2c902ea0480f3bd0f4f9361e8e0ad9745ff3 ]
Fixes: 1d6329b2fc1f ("net/dpaa2: support extra stats")
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/net/dpaa2/dpaa2_ethdev.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 09a11d65a..182fcf329 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -1169,12 +1169,12 @@ dpaa2_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
union dpni_statistics value[3] = {};
unsigned int i = 0, num = RTE_DIM(dpaa2_xstats_strings);
- if (xstats == NULL)
- return 0;
-
if (n < num)
return num;
+ if (xstats == NULL)
+ return 0;
+
/* Get Counters from page_0*/
retcode = dpni_get_statistics(dpni, CMD_PRI_LOW, priv->token,
0, 0, &value[0]);
@@ -1207,10 +1207,13 @@ err:
static int
dpaa2_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
struct rte_eth_xstat_name *xstats_names,
- __rte_unused unsigned int limit)
+ unsigned int limit)
{
unsigned int i, stat_cnt = RTE_DIM(dpaa2_xstats_strings);
+ if (limit < stat_cnt)
+ return stat_cnt;
+
if (xstats_names != NULL)
for (i = 0; i < stat_cnt; i++)
snprintf(xstats_names[i].name,
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'vfio: fix device hotplug when several devices per group' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (18 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'net/dpaa2: fix xstats' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'ip_frag: fix double free of chained mbufs' " luca.boccassi
` (63 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Anatoly Burakov; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From bd2058932c118996a702f683238e492236f44793 Mon Sep 17 00:00:00 2001
From: Anatoly Burakov <anatoly.burakov@intel.com>
Date: Tue, 10 Apr 2018 11:23:30 +0100
Subject: [PATCH] vfio: fix device hotplug when several devices per group
[ upstream commit 08a20b3d37e4e648e1b57b6df2dd05558a987965 ]
We only need to perform DMA mapping for first device in first group.
At the time of mapping, we haven't yet added the device into the group,
so the count is expected to be zero.
Fixes: 810bfa64c673 ("vfio: fix index for tracking devices in a group")
Fixes: a9c349e3a100 ("vfio: fix device unplug when several devices per group")
Fixes: 94c0776b1bad ("vfio: support hotplug")
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
lib/librte_eal/linuxapp/eal/eal_vfio.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c
index 2421d513b..9e593184c 100644
--- a/lib/librte_eal/linuxapp/eal/eal_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c
@@ -332,7 +332,8 @@ rte_vfio_setup_device(const char *sysfs_base, const char *dev_addr,
* functionality.
*/
if (internal_config.process_type == RTE_PROC_PRIMARY &&
- vfio_cfg.vfio_active_groups == 1) {
+ vfio_cfg.vfio_active_groups == 1 &&
+ vfio_group_device_count(vfio_group_fd) == 0) {
/* select an IOMMU type which we will be using */
const struct vfio_iommu_type *t =
vfio_set_iommu_type(vfio_cfg.vfio_container_fd);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'ip_frag: fix double free of chained mbufs' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (19 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'vfio: fix device hotplug when several devices per group' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'hash: fix comment for lookup' " luca.boccassi
` (62 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Allain Legacy; +Cc: Konstantin Ananyev, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 495b149f719b6ad560a4ffde6d4a6fbb15a2c3ac Mon Sep 17 00:00:00 2001
From: Allain Legacy <allain.legacy@windriver.com>
Date: Mon, 19 Mar 2018 09:25:23 -0500
Subject: [PATCH] ip_frag: fix double free of chained mbufs
[ upstream commit 4f512a1919998933a39886ab2ec7f2fdde48756c ]
The first mbuf and the last mbuf to be visited in the preceding loop
are not set to NULL in the fragmentation table. This creates the
possibility of a double free when the fragmentation table is later freed
with rte_ip_frag_table_destroy().
Fixes: 95908f52393d ("ip_frag: free mbufs on reassembly table destroy")
Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
lib/librte_ip_frag/rte_ipv4_reassembly.c | 2 ++
lib/librte_ip_frag/rte_ipv6_reassembly.c | 2 ++
2 files changed, 4 insertions(+)
diff --git a/lib/librte_ip_frag/rte_ipv4_reassembly.c b/lib/librte_ip_frag/rte_ipv4_reassembly.c
index 82e831ca3..4956b99ea 100644
--- a/lib/librte_ip_frag/rte_ipv4_reassembly.c
+++ b/lib/librte_ip_frag/rte_ipv4_reassembly.c
@@ -59,7 +59,9 @@ ipv4_frag_reassemble(struct ip_frag_pkt *fp)
/* chain with the first fragment. */
rte_pktmbuf_adj(m, (uint16_t)(m->l2_len + m->l3_len));
rte_pktmbuf_chain(fp->frags[IP_FIRST_FRAG_IDX].mb, m);
+ fp->frags[curr_idx].mb = NULL;
m = fp->frags[IP_FIRST_FRAG_IDX].mb;
+ fp->frags[IP_FIRST_FRAG_IDX].mb = NULL;
/* update mbuf fields for reassembled packet. */
m->ol_flags |= PKT_TX_IP_CKSUM;
diff --git a/lib/librte_ip_frag/rte_ipv6_reassembly.c b/lib/librte_ip_frag/rte_ipv6_reassembly.c
index 3479fabb8..db249fe60 100644
--- a/lib/librte_ip_frag/rte_ipv6_reassembly.c
+++ b/lib/librte_ip_frag/rte_ipv6_reassembly.c
@@ -82,7 +82,9 @@ ipv6_frag_reassemble(struct ip_frag_pkt *fp)
/* chain with the first fragment. */
rte_pktmbuf_adj(m, (uint16_t)(m->l2_len + m->l3_len));
rte_pktmbuf_chain(fp->frags[IP_FIRST_FRAG_IDX].mb, m);
+ fp->frags[curr_idx].mb = NULL;
m = fp->frags[IP_FIRST_FRAG_IDX].mb;
+ fp->frags[IP_FIRST_FRAG_IDX].mb = NULL;
/* update mbuf fields for reassembled packet. */
m->ol_flags |= PKT_TX_IP_CKSUM;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'hash: fix comment for lookup' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (20 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'ip_frag: fix double free of chained mbufs' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'doc: reduce initial offload API rework scope to drivers' " luca.boccassi
` (61 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Shreyansh Jain; +Cc: Pablo de Lara, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 090a1120303ab6fd566cb00993babff4dc78c33b Mon Sep 17 00:00:00 2001
From: Shreyansh Jain <shreyansh.jain@nxp.com>
Date: Thu, 12 Apr 2018 18:03:58 +0530
Subject: [PATCH] hash: fix comment for lookup
[ upstream commit 0da959d484c852ed80a9e83ece3ff916aa7d3b75 ]
rte_hash_lookup_with_hash() has wrong comment for its 'sig' param.
Fixes: 1a9f648be291 ("hash: fix for multi-process apps")
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
lib/librte_hash/rte_hash.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_hash/rte_hash.h b/lib/librte_hash/rte_hash.h
index 3beaca71c..f71ca9fbf 100644
--- a/lib/librte_hash/rte_hash.h
+++ b/lib/librte_hash/rte_hash.h
@@ -328,7 +328,7 @@ rte_hash_lookup(const struct rte_hash *h, const void *key);
* @param key
* Key to find.
* @param sig
- * Hash value to remove from the hash table.
+ * Precomputed hash value for 'key'.
* @return
* - -EINVAL if the parameters are invalid.
* - -ENOENT if the key is not found.
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'doc: reduce initial offload API rework scope to drivers' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (21 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'hash: fix comment for lookup' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'net/virtio-user: fix port id type' " luca.boccassi
` (60 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: Shahaf Shuler, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 7659eef1f86732b93d94babecac42ccdd20d5eed Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@intel.com>
Date: Fri, 13 Apr 2018 22:20:59 +0100
Subject: [PATCH] doc: reduce initial offload API rework scope to drivers
[ upstream commit 315ee8374e0e94fe9ae101da02ff9d91384521f6 ]
Do ethdev new offloading API switch in two steps.
In v18.05 target is implementing the new ethdev-PMD offload interface,
which means converting all PMDs to new offloading API.
Next target is removing the old ethdev offload API.
It will effect applications and will force them to implement new
offloading API.
Fixes: 3004d3454192 ("doc: update deprecation of ethdev offload API")
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
---
doc/guides/rel_notes/deprecation.rst | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 9b5576152..e9fcb69ca 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -97,8 +97,12 @@ Deprecation Notices
* ethdev: a new Tx and Rx offload API was introduced on 17.11.
In the new API, offloads are divided into per-port and per-queue offloads.
Offloads are disabled by default and enabled per application request.
- The old offloads API is target to be deprecated on 18.05. This includes:
+ The old ethdev - drivers offload interface will be deprecated on 18.05.
+ This includes:
+ - removal of the conversion in ethdev from new offloading API to old API for drivers.
+
+ In later releases the old offloading API will be deprecated, which will include:
- removal of ``ETH_TXQ_FLAGS_NO*`` flags.
- removal of ``txq_flags`` field from ``rte_eth_txconf`` struct.
- removal of the offloads bit-field from ``rte_eth_rxmode`` struct.
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/virtio-user: fix port id type' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (22 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'doc: reduce initial offload API rework scope to drivers' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'net/i40e: fix flow RSS TCI use' " luca.boccassi
` (59 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Zhiyong Yang; +Cc: Maxime Coquelin, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 00c345c7f6b349937d867fa1c003721f11aed372 Mon Sep 17 00:00:00 2001
From: Zhiyong Yang <zhiyong.yang@intel.com>
Date: Fri, 30 Mar 2018 16:31:50 +0800
Subject: [PATCH] net/virtio-user: fix port id type
[ upstream commit 40a7be870e55778d7fa51f7e47f9ffde5aa61d36 ]
virtio-user port_id range should be increased from 8 bits to 16 bits.
Fixes: f8244c6399d9 ("ethdev: increase port id range")
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
drivers/net/virtio/virtio_user/virtio_user_dev.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.h b/drivers/net/virtio/virtio_user/virtio_user_dev.h
index 64467b4f9..5f8755771 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.h
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.h
@@ -31,7 +31,7 @@ struct virtio_user_dev {
*/
uint64_t device_features; /* supported features by device */
uint8_t status;
- uint8_t port_id;
+ uint16_t port_id;
uint8_t mac_addr[ETHER_ADDR_LEN];
char path[PATH_MAX];
struct vring vrings[VIRTIO_MAX_VIRTQUEUES];
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/i40e: fix flow RSS TCI use' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (23 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'net/virtio-user: fix port id type' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'net/mlx4: fix a typo in header file' " luca.boccassi
` (58 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Wei Zhao; +Cc: Yuan Peng, Qi Zhang, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From c9eb9370b2b141b940eadd0dd48d2e6c9c97d513 Mon Sep 17 00:00:00 2001
From: Wei Zhao <wei.zhao1@intel.com>
Date: Tue, 3 Apr 2018 14:09:36 +0800
Subject: [PATCH] net/i40e: fix flow RSS TCI use
[ upstream commit 433d9226db2edc9c7a7463e9bb35bf7b3a07dc67 ]
Vlan tci configuration from testpmd is stored in big endian, changing
it to little endian is needed before using it.
Fixes: ecad87d22383 ("net/i40e: move RSS to flow API")
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
drivers/net/i40e/i40e_flow.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 69d1ba55e..58ae725b1 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -4150,7 +4150,8 @@ i40e_flow_parse_rss_pattern(__rte_unused struct rte_eth_dev *dev,
if (vlan_mask->tci ==
rte_cpu_to_be_16(I40E_TCI_MASK)) {
info->region[0].user_priority[0] =
- (vlan_spec->tci >> 13) & 0x7;
+ (rte_be_to_cpu_16(
+ vlan_spec->tci) >> 13) & 0x7;
info->region[0].user_priority_num = 1;
info->queue_region_number = 1;
*action_flag = 0;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/mlx4: fix a typo in header file' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (24 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'net/i40e: fix flow RSS TCI use' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'net/mlx: fix warnings for unused compiler arguments' " luca.boccassi
` (57 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Rami Rosen; +Cc: Adrien Mazarguil, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 9e0649fd769ee8cc4718698f8702415717e0e6c1 Mon Sep 17 00:00:00 2001
From: Rami Rosen <rami.rosen@intel.com>
Date: Tue, 27 Mar 2018 21:07:09 -0400
Subject: [PATCH] net/mlx4: fix a typo in header file
[ upstream commit 4db261fc88b2d17848227dd06452967816a56db2 ]
This patch fixes a trivial typo in mlx4 header file.
Fixes: 3d555728c933 ("net/mlx4: separate Rx/Tx definitions")
Signed-off-by: Rami Rosen <rami.rosen@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
drivers/net/mlx4/mlx4_rxtx.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/mlx4/mlx4_rxtx.h b/drivers/net/mlx4/mlx4_rxtx.h
index c12bd39a9..dd46ac006 100644
--- a/drivers/net/mlx4/mlx4_rxtx.h
+++ b/drivers/net/mlx4/mlx4_rxtx.h
@@ -83,7 +83,7 @@ struct txq_elt {
};
};
-/** Rx queue counters. */
+/** Tx queue counters. */
struct mlx4_txq_stats {
unsigned int idx; /**< Mapping index. */
uint64_t opackets; /**< Total of successfully sent packets. */
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/mlx: fix warnings for unused compiler arguments' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (25 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'net/mlx4: fix a typo in header file' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'net/octeontx: remove redundant driver name update' " luca.boccassi
` (56 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Bruce Richardson; +Cc: Yongseok Koh, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 25c48d65f98176221c9423c6d7236491e95cae0d Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Thu, 29 Mar 2018 14:36:20 +0100
Subject: [PATCH] net/mlx: fix warnings for unused compiler arguments
[ upstream commit a11dfe9b65940106e6aab62a682b12a9324b16c0 ]
When linking the mlx glue code libraries using CC, the linker arguments in
LDFLAGS are not prefixed with -Wl. [The EXTRA_LDFLAGS are though.] This
leads to warning messages on build:
clang-5.0: warning: argument unused during compilation: '-e xport-dynamic'
Fix this by checking for $LINK_USING_CC in the Makefiles and prefixing the
LDFLAGS appropriately if set.
Fixes: 27cea11686ff ("net/mlx4: spawn rdma-core dependency plug-in")
Fixes: 59b91bec12c6 ("net/mlx5: spawn rdma-core dependency plug-in")
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
---
drivers/net/mlx4/Makefile | 7 ++++++-
drivers/net/mlx5/Makefile | 7 ++++++-
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/net/mlx4/Makefile b/drivers/net/mlx4/Makefile
index cc800493b..b6c05ed42 100644
--- a/drivers/net/mlx4/Makefile
+++ b/drivers/net/mlx4/Makefile
@@ -132,8 +132,13 @@ ifeq ($(CONFIG_RTE_LIBRTE_MLX4_DLOPEN_DEPS),y)
$(LIB): $(LIB_GLUE)
+ifeq ($(LINK_USING_CC),1)
+GLUE_LDFLAGS := $(call linkerprefix,$(LDFLAGS))
+else
+GLUE_LDFLAGS := $(LDFLAGS)
+endif
$(LIB_GLUE): mlx4_glue.o
- $Q $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) \
+ $Q $(LD) $(GLUE_LDFLAGS) $(EXTRA_LDFLAGS) \
-Wl,-h,$(LIB_GLUE) \
-s -shared -o $@ $< -libverbs -lmlx4
diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile
index afda4118f..201f6f06a 100644
--- a/drivers/net/mlx5/Makefile
+++ b/drivers/net/mlx5/Makefile
@@ -181,8 +181,13 @@ ifeq ($(CONFIG_RTE_LIBRTE_MLX5_DLOPEN_DEPS),y)
$(LIB): $(LIB_GLUE)
+ifeq ($(LINK_USING_CC),1)
+GLUE_LDFLAGS := $(call linkerprefix,$(LDFLAGS))
+else
+GLUE_LDFLAGS := $(LDFLAGS)
+endif
$(LIB_GLUE): mlx5_glue.o
- $Q $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) \
+ $Q $(LD) $(GLUE_LDFLAGS) $(EXTRA_LDFLAGS) \
-Wl,-h,$(LIB_GLUE) \
-s -shared -o $@ $< -libverbs -lmlx5
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/octeontx: remove redundant driver name update' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (26 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'net/mlx: fix warnings for unused compiler arguments' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'net/octeontx: fix uninitialized speed variable' " luca.boccassi
` (55 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Santosh Shukla; +Cc: David Marchand, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 08306dbdd9fb34cd6e8a8c90954d2b9b2b628d1c Mon Sep 17 00:00:00 2001
From: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Date: Mon, 2 Apr 2018 16:05:33 +0000
Subject: [PATCH] net/octeontx: remove redundant driver name update
[ upstream commit ecc3fa6d3ef54ca7d4dea6d22d1d45693eea4cf1 ]
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Reviewed-by: David Marchand <david.marchand@6wind.com>
---
drivers/net/octeontx/octeontx_ethdev.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c
index f2893faa9..8058d27f9 100644
--- a/drivers/net/octeontx/octeontx_ethdev.c
+++ b/drivers/net/octeontx/octeontx_ethdev.c
@@ -619,7 +619,6 @@ octeontx_dev_info(struct rte_eth_dev *dev,
ETH_LINK_SPEED_1G | ETH_LINK_SPEED_10G |
ETH_LINK_SPEED_40G;
- dev_info->driver_name = RTE_STR(rte_octeontx_pmd);
dev_info->max_mac_addrs = 1;
dev_info->max_rx_pktlen = PKI_MAX_PKTLEN;
dev_info->max_rx_queues = 1;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/octeontx: fix uninitialized speed variable' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (27 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'net/octeontx: remove redundant driver name update' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'net/bonding: fix setting VLAN ID on slave ports' " luca.boccassi
` (54 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Jerin Jacob, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 90c702184941e222876816ed7ce16c27583e4873 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Thu, 5 Apr 2018 08:12:28 -0700
Subject: [PATCH] net/octeontx: fix uninitialized speed variable
[ upstream commit 3a4b87c897d6e746ce53bcbe70a35e44654c7434 ]
This is fix for Coverity Defect 268319 about uninitialized speed
in an error case. Also drop unnecessary assignment.
Coverity issue: 268319
Fixes: 4fac7c0a147e ("net/octeontx: add link update")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
drivers/net/octeontx/octeontx_ethdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c
index 8058d27f9..311e9ce4c 100644
--- a/drivers/net/octeontx/octeontx_ethdev.c
+++ b/drivers/net/octeontx/octeontx_ethdev.c
@@ -532,7 +532,6 @@ octeontx_dev_link_update(struct rte_eth_dev *dev,
struct rte_eth_link link;
int res;
- res = 0;
PMD_INIT_FUNC_TRACE();
res = octeontx_port_link_status(nic);
@@ -566,6 +565,7 @@ octeontx_dev_link_update(struct rte_eth_dev *dev,
case OCTEONTX_LINK_SPEED_RESERVE1:
case OCTEONTX_LINK_SPEED_RESERVE2:
default:
+ link.link_speed = ETH_SPEED_NUM_NONE;
octeontx_log_err("incorrect link speed %d", nic->speed);
break;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bonding: fix setting VLAN ID on slave ports' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (28 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'net/octeontx: fix uninitialized speed variable' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'net/bonding: clear started state if start fails' " luca.boccassi
` (53 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Chas Williams; +Cc: Radu Nicolau, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 6c7e0341c932ec4a5668a6e4e7084e4a524a54e6 Mon Sep 17 00:00:00 2001
From: Chas Williams <chas3@att.com>
Date: Tue, 3 Apr 2018 12:01:22 -0400
Subject: [PATCH] net/bonding: fix setting VLAN ID on slave ports
[ upstream commit 3639903f488976e61752103bed546d5b87147ad0 ]
The pos returned is just the offset of the slab. You need to use this
to offset the bits in the slab.
Fixes: c771e4ef38 ("net/bonding: enable slave VLAN filter")
Signed-off-by: Chas Williams <chas3@att.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
---
drivers/net/bonding/rte_eth_bond_api.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
index f854b7375..d5b7260e4 100644
--- a/drivers/net/bonding/rte_eth_bond_api.c
+++ b/drivers/net/bonding/rte_eth_bond_api.c
@@ -211,9 +211,12 @@ slave_vlan_filter_set(uint16_t bonded_port_id, uint16_t slave_port_id)
for (i = 0, mask = 1;
i < RTE_BITMAP_SLAB_BIT_SIZE;
i ++, mask <<= 1) {
- if (unlikely(slab & mask))
+ if (unlikely(slab & mask)) {
+ uint16_t vlan_id = pos + i;
+
res = rte_eth_dev_vlan_filter(slave_port_id,
- (uint16_t)pos, 1);
+ vlan_id, 1);
+ }
}
found = rte_bitmap_scan(internals->vlan_filter_bmp,
&pos, &slab);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bonding: clear started state if start fails' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (29 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'net/bonding: fix setting VLAN ID on slave ports' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'net/szedata2: fix total stats' " luca.boccassi
` (52 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Chas Williams; +Cc: Radu Nicolau, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 65bf9e3e3fb9085e0fd5d883342164a82b7a3f0b Mon Sep 17 00:00:00 2001
From: Chas Williams <chas3@att.com>
Date: Fri, 23 Mar 2018 13:05:32 -0400
Subject: [PATCH] net/bonding: clear started state if start fails
[ upstream commit 85d3c09a0f40740ca64556522fed1b3bb5aa6167 ]
There are several error paths where the bonding device may not start.
Clear dev_started before we return if we take one of these paths.
Fixes: 2efb58cbab6e ("bond: new link bonding library")
Signed-off-by: Chas Williams <chas3@att.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
---
drivers/net/bonding/rte_eth_bond_pmd.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index c34c3251f..c0d167fff 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -2026,7 +2026,7 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev)
if (internals->slave_count == 0) {
RTE_BOND_LOG(ERR, "Cannot start port since there are no slave devices");
- return -1;
+ goto out_err;
}
if (internals->user_defined_mac == 0) {
@@ -2037,18 +2037,18 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev)
new_mac_addr = &internals->slaves[i].persisted_mac_addr;
if (new_mac_addr == NULL)
- return -1;
+ goto out_err;
if (mac_address_set(eth_dev, new_mac_addr) != 0) {
RTE_BOND_LOG(ERR, "bonded port (%d) failed to update MAC address",
eth_dev->data->port_id);
- return -1;
+ goto out_err;
}
}
/* Update all slave devices MACs*/
if (mac_address_slaves_update(eth_dev) != 0)
- return -1;
+ goto out_err;
/* If bonded device is configure in promiscuous mode then re-apply config */
if (internals->promiscuous_en)
@@ -2073,7 +2073,7 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev)
"bonded port (%d) failed to reconfigure slave device (%d)",
eth_dev->data->port_id,
internals->slaves[i].port_id);
- return -1;
+ goto out_err;
}
/* We will need to poll for link status if any slave doesn't
* support interrupts
@@ -2081,6 +2081,7 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev)
if (internals->slaves[i].link_status_poll_enabled)
internals->link_status_polling_enabled = 1;
}
+
/* start polling if needed */
if (internals->link_status_polling_enabled) {
rte_eal_alarm_set(
@@ -2100,6 +2101,10 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev)
bond_tlb_enable(internals);
return 0;
+
+out_err:
+ eth_dev->data->dev_started = 0;
+ return -1;
}
static void
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/szedata2: fix total stats' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (30 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'net/bonding: clear started state if start fails' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'net/szedata2: fix format string for PCI address' " luca.boccassi
` (51 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Matej Vido; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From a294181ee190a11149e08f086001ed5ec599d404 Mon Sep 17 00:00:00 2001
From: Matej Vido <vido@cesnet.cz>
Date: Wed, 4 Apr 2018 15:42:18 +0200
Subject: [PATCH] net/szedata2: fix total stats
[ upstream commit 745f6a1e7e37d80920d38be4fffbb442a09ab7cf ]
Counters from all queues have to be summed up for total stats
even though the number of queue stats counters is not sufficient.
Fixes: 83556fd2c0fc ("szedata2: change to physical device type")
Signed-off-by: Matej Vido <vido@cesnet.cz>
---
drivers/net/szedata2/rte_eth_szedata2.c | 33 ++++++++++++++++++++-------------
1 file changed, 20 insertions(+), 13 deletions(-)
diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c
index e53c738db..dc2079e0d 100644
--- a/drivers/net/szedata2/rte_eth_szedata2.c
+++ b/drivers/net/szedata2/rte_eth_szedata2.c
@@ -1054,22 +1054,29 @@ eth_stats_get(struct rte_eth_dev *dev,
uint64_t tx_err_total = 0;
uint64_t rx_total_bytes = 0;
uint64_t tx_total_bytes = 0;
- const struct pmd_internals *internals = dev->data->dev_private;
- for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS && i < nb_rx; i++) {
- stats->q_ipackets[i] = internals->rx_queue[i].rx_pkts;
- stats->q_ibytes[i] = internals->rx_queue[i].rx_bytes;
- rx_total += stats->q_ipackets[i];
- rx_total_bytes += stats->q_ibytes[i];
+ for (i = 0; i < nb_rx; i++) {
+ struct szedata2_rx_queue *rxq = dev->data->rx_queues[i];
+
+ if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) {
+ stats->q_ipackets[i] = rxq->rx_pkts;
+ stats->q_ibytes[i] = rxq->rx_bytes;
+ }
+ rx_total += rxq->rx_pkts;
+ rx_total_bytes += rxq->rx_bytes;
}
- for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS && i < nb_tx; i++) {
- stats->q_opackets[i] = internals->tx_queue[i].tx_pkts;
- stats->q_obytes[i] = internals->tx_queue[i].tx_bytes;
- stats->q_errors[i] = internals->tx_queue[i].err_pkts;
- tx_total += stats->q_opackets[i];
- tx_total_bytes += stats->q_obytes[i];
- tx_err_total += stats->q_errors[i];
+ for (i = 0; i < nb_tx; i++) {
+ struct szedata2_tx_queue *txq = dev->data->tx_queues[i];
+
+ if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) {
+ stats->q_opackets[i] = txq->tx_pkts;
+ stats->q_obytes[i] = txq->tx_bytes;
+ stats->q_errors[i] = txq->err_pkts;
+ }
+ tx_total += txq->tx_pkts;
+ tx_total_bytes += txq->tx_bytes;
+ tx_err_total += txq->err_pkts;
}
stats->ipackets = rx_total;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/szedata2: fix format string for PCI address' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (31 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'net/szedata2: fix total stats' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'net/enic: fix crash on MTU update with non-setup queues' " luca.boccassi
` (50 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Matej Vido; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 98d5e864b122fad4523d8e8eeb71641177bc68d8 Mon Sep 17 00:00:00 2001
From: Matej Vido <vido@cesnet.cz>
Date: Wed, 4 Apr 2018 15:42:21 +0200
Subject: [PATCH] net/szedata2: fix format string for PCI address
[ upstream commit ddbbe324db8fa340e01a389844dc703e8cb30072 ]
For fscanf() function SCN macros should be used but PRI macros were
wrongly used.
Also use correct sizes of variables for read values.
Fixes: 83556fd2c0fc ("szedata2: change to physical device type")
Signed-off-by: Matej Vido <vido@cesnet.cz>
---
drivers/net/szedata2/rte_eth_szedata2.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c
index dc2079e0d..31b11e5cd 100644
--- a/drivers/net/szedata2/rte_eth_szedata2.c
+++ b/drivers/net/szedata2/rte_eth_szedata2.c
@@ -1424,9 +1424,9 @@ get_szedata2_index(const struct rte_pci_addr *pcislot_addr, uint32_t *index)
FILE *fd;
char pcislot_path[PATH_MAX];
uint32_t domain;
- uint32_t bus;
- uint32_t devid;
- uint32_t function;
+ uint8_t bus;
+ uint8_t devid;
+ uint8_t function;
dir = opendir("/sys/class/combo");
if (dir == NULL)
@@ -1451,7 +1451,7 @@ get_szedata2_index(const struct rte_pci_addr *pcislot_addr, uint32_t *index)
if (fd == NULL)
continue;
- ret = fscanf(fd, "%4" PRIx16 ":%2" PRIx8 ":%2" PRIx8 ".%" PRIx8,
+ ret = fscanf(fd, "%8" SCNx32 ":%2" SCNx8 ":%2" SCNx8 ".%" SCNx8,
&domain, &bus, &devid, &function);
fclose(fd);
if (ret != 4)
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/enic: fix crash on MTU update with non-setup queues' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (32 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'net/szedata2: fix format string for PCI address' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'net/i40e: fix flow RSS queue region' " luca.boccassi
` (49 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: John Daley; +Cc: Hyong Youb Kim, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From be61adcbf957c0c7caa41e360ccc52ff2aac4dd5 Mon Sep 17 00:00:00 2001
From: John Daley <johndale@cisco.com>
Date: Wed, 4 Apr 2018 16:54:53 -0700
Subject: [PATCH] net/enic: fix crash on MTU update with non-setup queues
[ upstream commit 33a2d6594945eb3278bfa441f79ae9a38ea538a0 ]
The enic code called from rte_eth_dev_set_mtu() was assuming that the
Rx queues are already set up via a call to rte_eth_tx_queue_setup().
OVS calls rte_eth_dev_set_mtu() before rte_eth_rx_queue_setup() and
a null pointer was dereferenced.
Fixes: c3e09182bcd6 ("net/enic: support scatter Rx in MTU update")
Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>
---
drivers/net/enic/enic_main.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index caccdafff..b8147e37d 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -1220,6 +1220,8 @@ int enic_set_mtu(struct enic *enic, uint16_t new_mtu)
/* free and reallocate RQs with the new MTU */
for (rq_idx = 0; rq_idx < enic->rq_count; rq_idx++) {
rq = &enic->rq[enic_rte_rq_idx_to_sop_idx(rq_idx)];
+ if (!rq->in_use)
+ continue;
enic_free_rq(rq);
rc = enic_alloc_rq(enic, rq_idx, rq->socket_id, rq->mp,
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/i40e: fix flow RSS queue region' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (33 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'net/enic: fix crash on MTU update with non-setup queues' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'net/i40e: fix flow RSS queue index check' " luca.boccassi
` (48 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Wei Zhao; +Cc: Yuan Peng, Qi Zhang, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From b295ee97ffc44031cf45eae4ba8fdb358f7c6f11 Mon Sep 17 00:00:00 2001
From: Wei Zhao <wei.zhao1@intel.com>
Date: Tue, 3 Apr 2018 14:09:08 +0800
Subject: [PATCH] net/i40e: fix flow RSS queue region
[ upstream commit 55bde0b880820104a410bbb324a982f59b59d25a ]
Queue region comparison error in configuration parameters.
Fixes: ecad87d22383 ("net/i40e: move RSS to flow API")
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
drivers/net/i40e/i40e_flow.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 58ae725b1..75bfa4af5 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -4238,7 +4238,7 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
}
if (rss_info->num < rss->num ||
- rss_info->queue[0] < rss->queue[0] ||
+ rss->queue[0] < rss_info->queue[0] ||
(rss->queue[0] + rss->num >
rss_info->num + rss_info->queue[0])) {
rte_flow_error_set(error, EINVAL,
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/i40e: fix flow RSS queue index check' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (34 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'net/i40e: fix flow RSS queue region' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'net/ixgbe: fix busy wait during checking link status' " luca.boccassi
` (47 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Wei Zhao; +Cc: Yuan Peng, Qi Zhang, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From f476b111fb18a3b6ed38bc805604b3bc2c544c26 Mon Sep 17 00:00:00 2001
From: Wei Zhao <wei.zhao1@intel.com>
Date: Wed, 4 Apr 2018 16:06:03 +0800
Subject: [PATCH] net/i40e: fix flow RSS queue index check
[ upstream commit 9486d60b94b58932c6da1163df2118549fa57224 ]
There need a queue index check for RSS queue region
in order to aviod error from configuration.
Fixes: ecad87d22383 ("net/i40e: move RSS to flow API")
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
drivers/net/i40e/i40e_flow.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 75bfa4af5..312c7eed0 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -4215,6 +4215,32 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
}
}
+ if (conf_info->queue_region_number) {
+ for (i = 0; i < rss->num; i++) {
+ for (j = 0; j < rss_info->num; j++) {
+ if (rss->queue[i] == rss_info->queue[j])
+ break;
+ }
+ if (j == rss_info->num) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ACTION,
+ act,
+ "no valid queues");
+ return -rte_errno;
+ }
+ }
+
+ for (i = 0; i < rss->num - 1; i++) {
+ if (rss->queue[i + 1] != rss->queue[i] + 1) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ACTION,
+ act,
+ "no valid queues");
+ return -rte_errno;
+ }
+ }
+ }
+
for (n = 0; n < conf_info->queue_region_number; n++) {
if (conf_info->region[n].user_priority_num ||
conf_info->region[n].flowtype_num) {
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/ixgbe: fix busy wait during checking link status' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (35 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'net/i40e: fix flow RSS queue index check' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'doc: add timestamp offload to mlx5 features' " luca.boccassi
` (46 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Chas Williams; +Cc: Helin Zhang, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 3baaa0d4dfba701192035a81503dad51b194db49 Mon Sep 17 00:00:00 2001
From: Chas Williams <chas3@att.com>
Date: Thu, 1 Feb 2018 17:39:07 -0500
Subject: [PATCH] net/ixgbe: fix busy wait during checking link status
[ upstream commit 22da9548cc1841350421e9b7efbb659c8e0b3d3b ]
If we haven't set wait_to_complete, there is no need to busy wait
until we have a link status. Applications, like bonding, use the
wait_to_complete flag to indicate that they will be doing their own
busy wait and will likely be polling again shortly.
Fixes: dc66e5fd01b9 ("net/ixgbe: improve link state check on VF")
Signed-off-by: Chas Williams <chas3@att.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
---
drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 6c0168322..c28551322 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -3877,7 +3877,7 @@ ixgbevf_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
/* for SFP+ modules and DA cables on 82599 it can take up to 500usecs
* before the link status is correct
*/
- if (mac->type == ixgbe_mac_82599_vf) {
+ if (mac->type == ixgbe_mac_82599_vf && wait_to_complete) {
int i;
for (i = 0; i < 5; i++) {
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'doc: add timestamp offload to mlx5 features' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (36 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'net/ixgbe: fix busy wait during checking link status' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'net/bnxt: fix Rx drop setting' " luca.boccassi
` (45 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Yongseok Koh; +Cc: Adrien Mazarguil, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From f012e3a87f718fbec525ec81d61ef876ecc696d1 Mon Sep 17 00:00:00 2001
From: Yongseok Koh <yskoh@mellanox.com>
Date: Mon, 2 Apr 2018 10:01:22 -0700
Subject: [PATCH] doc: add timestamp offload to mlx5 features
[ upstream commit 360e6972e8b7dca1b4a0a4ed8ed3005b861aa718 ]
Fixes: 78c7406b7b5a ("net/mlx5: add Rx HW timestamp")
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
doc/guides/nics/features/mlx5.ini | 1 +
1 file changed, 1 insertion(+)
diff --git a/doc/guides/nics/features/mlx5.ini b/doc/guides/nics/features/mlx5.ini
index c36363915..f8ce08770 100644
--- a/doc/guides/nics/features/mlx5.ini
+++ b/doc/guides/nics/features/mlx5.ini
@@ -29,6 +29,7 @@ CRC offload = Y
VLAN offload = Y
L3 checksum offload = Y
L4 checksum offload = Y
+Timestamp offload = Y
Packet type parsing = Y
Rx descriptor status = Y
Tx descriptor status = Y
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bnxt: fix Rx drop setting' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (37 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'doc: add timestamp offload to mlx5 features' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'net/sfc/base: fix comparison always true warning' " luca.boccassi
` (44 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Ajit Khaparde; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 82243daa4aeb70ef7b8e924306b5cd368e831c85 Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Sat, 7 Apr 2018 10:40:54 -0700
Subject: [PATCH] net/bnxt: fix Rx drop setting
[ upstream commit d4cd95c645b5af9f7f480ba7fb6f4e4eee0e0e23 ]
If Rx descriptors are not available, pkts are dropped by default.
Fix rx_drop_en setting in bnxt_dev_info_get_op to reflect 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 0b2165326..8c1596e2a 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -454,7 +454,8 @@ static void bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
.wthresh = 0,
},
.rx_free_thresh = 32,
- .rx_drop_en = 0,
+ /* If no descriptors available, pkts are dropped by default */
+ .rx_drop_en = 1,
};
dev_info->default_txconf = (struct rte_eth_txconf) {
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/sfc/base: fix comparison always true warning' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (38 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'net/bnxt: fix Rx drop setting' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'net/i40e: fix DDP profile DEL operation' " luca.boccassi
` (43 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Andrew Rybchenko; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 3bdb36c37cbc0d68e0c172eda35a14589abb239d Mon Sep 17 00:00:00 2001
From: Andrew Rybchenko <arybchenko@solarflare.com>
Date: Mon, 9 Apr 2018 12:58:57 +0100
Subject: [PATCH] net/sfc/base: fix comparison always true warning
[ upstream commit 06619ede18663fe81bf7ebf49ec751210308d41e ]
Loopback type used as bit index has efx_loopback_type_t type
which is enum. clang complains that it is always true when it
is compared with qword (64 bit) bits number boundary.
Fixes: 9ee64bd404fc ("net/sfc/base: import loopback control")
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
drivers/net/sfc/base/efx_port.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/sfc/base/efx_port.c b/drivers/net/sfc/base/efx_port.c
index a792a9ef6..fda8260f4 100644
--- a/drivers/net/sfc/base/efx_port.c
+++ b/drivers/net/sfc/base/efx_port.c
@@ -120,7 +120,7 @@ efx_port_loopback_set(
EFSYS_ASSERT(link_mode < EFX_LINK_NMODES);
if (EFX_TEST_QWORD_BIT(encp->enc_loopback_types[link_mode],
- loopback_type) == 0) {
+ (int)loopback_type) == 0) {
rc = ENOTSUP;
goto fail1;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/i40e: fix DDP profile DEL operation' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (39 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'net/sfc/base: fix comparison always true warning' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'net/vhost: fix invalid state' " luca.boccassi
` (42 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Beilei Xing; +Cc: Jingjing Wu, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From c534c86507c440566a930818b2b8c2155a4a9cb2 Mon Sep 17 00:00:00 2001
From: Beilei Xing <beilei.xing@intel.com>
Date: Wed, 7 Feb 2018 16:40:59 +0800
Subject: [PATCH] net/i40e: fix DDP profile DEL operation
[ upstream commit 0585f5c3d2643e49c0d2629e4937fb0bf010afbd ]
Customized info will be updated when processing DDP package,
including PCYPE/PTYPE/protocol. Previously, the customized info
is updated without any check for package operation - ADD or DEL,
but only covers ADD operation. In this situation, even if a package
is being removed, new PCTYPE/PTYPE/protocol will still be created,
it will cause wrong parsing for SW. This patch cleans new
PCTYPE/PTYPE/protocol created when a package is being removed.
Fixes: e163c18a15b0 ("net/i40e: update ptype and pctype info")
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
---
drivers/net/i40e/i40e_ethdev.c | 51 +++++++++++++++++++++++++++++++++--------
drivers/net/i40e/i40e_ethdev.h | 4 +++-
drivers/net/i40e/i40e_flow.c | 2 +-
drivers/net/i40e/rte_pmd_i40e.c | 6 +++--
4 files changed, 50 insertions(+), 13 deletions(-)
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 5671b64bf..2322d6043 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -11530,7 +11530,8 @@ i40e_find_customized_pctype(struct i40e_pf *pf, uint8_t index)
static int
i40e_update_customized_pctype(struct rte_eth_dev *dev, uint8_t *pkg,
uint32_t pkg_size, uint32_t proto_num,
- struct rte_pmd_i40e_proto_info *proto)
+ struct rte_pmd_i40e_proto_info *proto,
+ enum rte_pmd_i40e_package_op op)
{
struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
uint32_t pctype_num;
@@ -11543,6 +11544,12 @@ i40e_update_customized_pctype(struct rte_eth_dev *dev, uint8_t *pkg,
uint32_t i, j, n;
int ret;
+ if (op != RTE_PMD_I40E_PKG_OP_WR_ADD &&
+ op != RTE_PMD_I40E_PKG_OP_WR_DEL) {
+ PMD_DRV_LOG(ERR, "Unsupported operation.");
+ return -1;
+ }
+
ret = rte_pmd_i40e_get_ddp_info(pkg, pkg_size,
(uint8_t *)&pctype_num, sizeof(pctype_num),
RTE_PMD_I40E_PKG_INFO_PCTYPE_NUM);
@@ -11605,8 +11612,13 @@ i40e_update_customized_pctype(struct rte_eth_dev *dev, uint8_t *pkg,
i40e_find_customized_pctype(pf,
I40E_CUSTOMIZED_GTPU);
if (new_pctype) {
- new_pctype->pctype = pctype_value;
- new_pctype->valid = true;
+ if (op == RTE_PMD_I40E_PKG_OP_WR_ADD) {
+ new_pctype->pctype = pctype_value;
+ new_pctype->valid = true;
+ } else {
+ new_pctype->pctype = I40E_FILTER_PCTYPE_INVALID;
+ new_pctype->valid = false;
+ }
}
}
@@ -11616,8 +11628,9 @@ i40e_update_customized_pctype(struct rte_eth_dev *dev, uint8_t *pkg,
static int
i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg,
- uint32_t pkg_size, uint32_t proto_num,
- struct rte_pmd_i40e_proto_info *proto)
+ uint32_t pkg_size, uint32_t proto_num,
+ struct rte_pmd_i40e_proto_info *proto,
+ enum rte_pmd_i40e_package_op op)
{
struct rte_pmd_i40e_ptype_mapping *ptype_mapping;
uint16_t port_id = dev->data->port_id;
@@ -11630,6 +11643,17 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg,
bool in_tunnel;
int ret;
+ if (op != RTE_PMD_I40E_PKG_OP_WR_ADD &&
+ op != RTE_PMD_I40E_PKG_OP_WR_DEL) {
+ PMD_DRV_LOG(ERR, "Unsupported operation.");
+ return -1;
+ }
+
+ if (op == RTE_PMD_I40E_PKG_OP_WR_DEL) {
+ rte_pmd_i40e_ptype_mapping_reset(port_id);
+ return 0;
+ }
+
/* get information about new ptype num */
ret = rte_pmd_i40e_get_ddp_info(pkg, pkg_size,
(uint8_t *)&ptype_num, sizeof(ptype_num),
@@ -11802,7 +11826,7 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg,
void
i40e_update_customized_info(struct rte_eth_dev *dev, uint8_t *pkg,
- uint32_t pkg_size)
+ uint32_t pkg_size, enum rte_pmd_i40e_package_op op)
{
struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
uint32_t proto_num;
@@ -11811,6 +11835,12 @@ i40e_update_customized_info(struct rte_eth_dev *dev, uint8_t *pkg,
uint32_t i;
int ret;
+ if (op != RTE_PMD_I40E_PKG_OP_WR_ADD &&
+ op != RTE_PMD_I40E_PKG_OP_WR_DEL) {
+ PMD_DRV_LOG(ERR, "Unsupported operation.");
+ return;
+ }
+
/* get information about protocol number */
ret = rte_pmd_i40e_get_ddp_info(pkg, pkg_size,
(uint8_t *)&proto_num, sizeof(proto_num),
@@ -11844,20 +11874,23 @@ i40e_update_customized_info(struct rte_eth_dev *dev, uint8_t *pkg,
/* Check if GTP is supported. */
for (i = 0; i < proto_num; i++) {
if (!strncmp(proto[i].name, "GTP", 3)) {
- pf->gtp_support = true;
+ if (op == RTE_PMD_I40E_PKG_OP_WR_ADD)
+ pf->gtp_support = true;
+ else
+ pf->gtp_support = false;
break;
}
}
/* Update customized pctype info */
ret = i40e_update_customized_pctype(dev, pkg, pkg_size,
- proto_num, proto);
+ proto_num, proto, op);
if (ret)
PMD_DRV_LOG(INFO, "No pctype is updated.");
/* Update customized ptype info */
ret = i40e_update_customized_ptype(dev, pkg, pkg_size,
- proto_num, proto);
+ proto_num, proto, op);
if (ret)
PMD_DRV_LOG(INFO, "No ptype is updated.");
diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index 99efb6707..a51bd4b07 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -11,6 +11,7 @@
#include <rte_hash.h>
#include <rte_flow_driver.h>
#include <rte_tm_driver.h>
+#include "rte_pmd_i40e.h"
#define I40E_VLAN_TAG_SIZE 4
@@ -1206,7 +1207,8 @@ void i40e_tm_conf_uninit(struct rte_eth_dev *dev);
struct i40e_customized_pctype*
i40e_find_customized_pctype(struct i40e_pf *pf, uint8_t index);
void i40e_update_customized_info(struct rte_eth_dev *dev, uint8_t *pkg,
- uint32_t pkg_size);
+ uint32_t pkg_size,
+ enum rte_pmd_i40e_package_op op);
int i40e_dcb_init_configure(struct rte_eth_dev *dev, bool sw_dcb);
int i40e_flush_queue_region_all_conf(struct rte_eth_dev *dev,
struct i40e_hw *hw, struct i40e_pf *pf, uint16_t on);
diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 312c7eed0..31d7b8857 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -2400,7 +2400,7 @@ i40e_flow_fdir_get_pctype_value(struct i40e_pf *pf,
break;
}
- if (cus_pctype)
+ if (cus_pctype && cus_pctype->valid)
return cus_pctype->pctype;
return I40E_FILTER_PCTYPE_INVALID;
diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c
index ada3eff27..169d635e2 100644
--- a/drivers/net/i40e/rte_pmd_i40e.c
+++ b/drivers/net/i40e/rte_pmd_i40e.c
@@ -1610,8 +1610,6 @@ rte_pmd_i40e_process_ddp_package(uint16_t port, uint8_t *buff,
return -EINVAL;
}
- i40e_update_customized_info(dev, buff, size);
-
/* Find metadata segment */
metadata_seg_hdr = i40e_find_segment_in_package(SEGMENT_TYPE_METADATA,
pkg_hdr);
@@ -1715,6 +1713,10 @@ rte_pmd_i40e_process_ddp_package(uint16_t port, uint8_t *buff,
}
}
+ if (op == RTE_PMD_I40E_PKG_OP_WR_ADD ||
+ op == RTE_PMD_I40E_PKG_OP_WR_DEL)
+ i40e_update_customized_info(dev, buff, size, op);
+
rte_free(profile_info_sec);
return status;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/vhost: fix invalid state' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (40 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'net/i40e: fix DDP profile DEL operation' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:40 ` [dpdk-stable] patch 'net/i40e: add comment and clean code for flow RSS' " luca.boccassi
` (41 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Junjie Chen; +Cc: Jens Freimann, Jianfeng Tan, Maxime Coquelin, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From a82b4c3565f91d46942c171007a549d7ddffa927 Mon Sep 17 00:00:00 2001
From: Junjie Chen <junjie.j.chen@intel.com>
Date: Wed, 11 Apr 2018 13:02:32 -0400
Subject: [PATCH] net/vhost: fix invalid state
[ upstream commit e6722dee533cda3756fbc5c9ea4ddfbf30276f1b ]
dev_start sets *dev_attached* after setup queues, this sets device to
invalid state since no frontend is attached. Also destroy_device set
*started* to zero which makes *allow_queuing* always zero until dev_start
get called again. Actually, we should not determine queues existence by
*dev_attached* but by queues pointers or other separated variable(s).
Fixes: 30a701a53737 ("net/vhost: fix crash when creating vdev dynamically")
Signed-off-by: Junjie Chen <junjie.j.chen@intel.com>
Tested-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
drivers/net/vhost/rte_eth_vhost.c | 59 +++++++++++++++++++--------------------
1 file changed, 29 insertions(+), 30 deletions(-)
diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index 11b607650..e392d719b 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -528,10 +528,11 @@ update_queuing_status(struct rte_eth_dev *dev)
unsigned int i;
int allow_queuing = 1;
- if (rte_atomic32_read(&internal->dev_attached) == 0)
+ if (!dev->data->rx_queues || !dev->data->tx_queues)
return;
- if (rte_atomic32_read(&internal->started) == 0)
+ if (rte_atomic32_read(&internal->started) == 0 ||
+ rte_atomic32_read(&internal->dev_attached) == 0)
allow_queuing = 0;
/* Wait until rx/tx_pkt_burst stops accessing vhost device */
@@ -607,13 +608,10 @@ new_device(int vid)
#endif
internal->vid = vid;
- if (eth_dev->data->rx_queues && eth_dev->data->tx_queues) {
+ if (rte_atomic32_read(&internal->started) == 1)
queue_setup(eth_dev, internal);
- rte_atomic32_set(&internal->dev_attached, 1);
- } else {
- RTE_LOG(INFO, PMD, "RX/TX queues have not setup yet\n");
- rte_atomic32_set(&internal->dev_attached, 0);
- }
+ else
+ RTE_LOG(INFO, PMD, "RX/TX queues not exist yet\n");
for (i = 0; i < rte_vhost_get_vring_num(vid); i++)
rte_vhost_enable_guest_notification(vid, i, 0);
@@ -622,6 +620,7 @@ new_device(int vid)
eth_dev->data->dev_link.link_status = ETH_LINK_UP;
+ rte_atomic32_set(&internal->dev_attached, 1);
update_queuing_status(eth_dev);
RTE_LOG(INFO, PMD, "Vhost device %d created\n", vid);
@@ -651,23 +650,24 @@ destroy_device(int vid)
eth_dev = list->eth_dev;
internal = eth_dev->data->dev_private;
- rte_atomic32_set(&internal->started, 0);
- update_queuing_status(eth_dev);
rte_atomic32_set(&internal->dev_attached, 0);
+ update_queuing_status(eth_dev);
eth_dev->data->dev_link.link_status = ETH_LINK_DOWN;
- for (i = 0; i < eth_dev->data->nb_rx_queues; i++) {
- vq = eth_dev->data->rx_queues[i];
- if (vq == NULL)
- continue;
- vq->vid = -1;
- }
- for (i = 0; i < eth_dev->data->nb_tx_queues; i++) {
- vq = eth_dev->data->tx_queues[i];
- if (vq == NULL)
- continue;
- vq->vid = -1;
+ if (eth_dev->data->rx_queues && eth_dev->data->tx_queues) {
+ for (i = 0; i < eth_dev->data->nb_rx_queues; i++) {
+ vq = eth_dev->data->rx_queues[i];
+ if (!vq)
+ continue;
+ vq->vid = -1;
+ }
+ for (i = 0; i < eth_dev->data->nb_tx_queues; i++) {
+ vq = eth_dev->data->tx_queues[i];
+ if (!vq)
+ continue;
+ vq->vid = -1;
+ }
}
state = vring_states[eth_dev->data->port_id];
@@ -792,11 +792,7 @@ eth_dev_start(struct rte_eth_dev *eth_dev)
{
struct pmd_internal *internal = eth_dev->data->dev_private;
- if (unlikely(rte_atomic32_read(&internal->dev_attached) == 0)) {
- queue_setup(eth_dev, internal);
- rte_atomic32_set(&internal->dev_attached, 1);
- }
-
+ queue_setup(eth_dev, internal);
rte_atomic32_set(&internal->started, 1);
update_queuing_status(eth_dev);
@@ -836,10 +832,13 @@ eth_dev_close(struct rte_eth_dev *dev)
pthread_mutex_unlock(&internal_list_lock);
rte_free(list);
- for (i = 0; i < dev->data->nb_rx_queues; i++)
- rte_free(dev->data->rx_queues[i]);
- for (i = 0; i < dev->data->nb_tx_queues; i++)
- rte_free(dev->data->tx_queues[i]);
+ if (dev->data->rx_queues)
+ for (i = 0; i < dev->data->nb_rx_queues; i++)
+ rte_free(dev->data->rx_queues[i]);
+
+ if (dev->data->tx_queues)
+ for (i = 0; i < dev->data->nb_tx_queues; i++)
+ rte_free(dev->data->tx_queues[i]);
rte_free(dev->data->mac_addrs);
free(internal->dev_name);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/i40e: add comment and clean code for flow RSS' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (41 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'net/vhost: fix invalid state' " luca.boccassi
@ 2018-04-30 14:40 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'net/i40e: fix using error set function' " luca.boccassi
` (40 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:40 UTC (permalink / raw)
To: Wei Zhao; +Cc: Yuan Peng, Qi Zhang, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 603920cdfa22c80afe3622d44b43c2a5daddeadb Mon Sep 17 00:00:00 2001
From: Wei Zhao <wei.zhao1@intel.com>
Date: Wed, 11 Apr 2018 11:24:32 +0800
Subject: [PATCH] net/i40e: add comment and clean code for flow RSS
[ upstream commit 17d5c9234b85b8fc8ca19f91f3f326d398421d39 ]
This patch add comment for flow rss parse function in order
to explain some important info. This patch also delete some
useless code for queue index check for RSS queue region
configuration.
Fixes: ecad87d22383 ("net/i40e: move RSS to flow API")
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
drivers/net/i40e/i40e_flow.c | 36 +++++++++++++++++++++++++-----------
1 file changed, 25 insertions(+), 11 deletions(-)
diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 31d7b8857..c1b3ef4bb 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -4170,6 +4170,19 @@ i40e_flow_parse_rss_pattern(__rte_unused struct rte_eth_dev *dev,
return 0;
}
+/**
+ * This function is used to parse rss queue index, total queue number and
+ * hash functions, If the purpose of this configuration is for queue region
+ * configuration, it will set queue_region_conf flag to TRUE, else to FALSE.
+ * In queue region configuration, it also need to parse hardware flowtype
+ * and user_priority from configuration, it will also cheeck the validity
+ * of these parameters. For example, The queue region sizes should
+ * be any of the following values: 1, 2, 4, 8, 16, 32, 64, the
+ * hw_flowtype or PCTYPE max index should be 63, the user priority
+ * max index should be 7, and so on. And also, queue index should be
+ * continuous sequence and queue region index should be part of rss
+ * queue index for this port.
+ */
static int
i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
const struct rte_flow_action *actions,
@@ -4215,6 +4228,12 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
}
}
+ /**
+ * Do some queue region related parameters check
+ * in order to keep queue index for queue region to be
+ * continuous sequence and also to be part of RSS
+ * queue index for this port.
+ */
if (conf_info->queue_region_number) {
for (i = 0; i < rss->num; i++) {
for (j = 0; j < rss_info->num; j++) {
@@ -4241,6 +4260,7 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
}
}
+ /* Parse queue region related parameters from configuration */
for (n = 0; n < conf_info->queue_region_number; n++) {
if (conf_info->region[n].user_priority_num ||
conf_info->region[n].flowtype_num) {
@@ -4263,17 +4283,6 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
return -rte_errno;
}
- if (rss_info->num < rss->num ||
- rss->queue[0] < rss_info->queue[0] ||
- (rss->queue[0] + rss->num >
- rss_info->num + rss_info->queue[0])) {
- rte_flow_error_set(error, EINVAL,
- RTE_FLOW_ERROR_TYPE_ACTION,
- act,
- "no valid queues");
- return -rte_errno;
- }
-
for (i = 0; i < info->queue_region_number; i++) {
if (info->region[i].queue_num == rss->num &&
info->region[i].queue_start_index ==
@@ -4328,6 +4337,9 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
rss_config->queue_region_conf = TRUE;
}
+ /**
+ * Return function if this flow is used for queue region configuration
+ */
if (rss_config->queue_region_conf)
return 0;
@@ -4348,6 +4360,8 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
return -rte_errno;
}
}
+
+ /* Parse RSS related parameters from configuration */
if (rss->rss_conf)
rss_config->rss_conf = *rss->rss_conf;
else
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/i40e: fix using error set function' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (42 preceding siblings ...)
2018-04-30 14:40 ` [dpdk-stable] patch 'net/i40e: add comment and clean code for flow RSS' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'net/bonding: free mempool used in mode 6' " luca.boccassi
` (39 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Wei Zhao; +Cc: Yuan Peng, Qi Zhang, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 6707d8d2b98bd55f10f400c271fe7431d50b42dc Mon Sep 17 00:00:00 2001
From: Wei Zhao <wei.zhao1@intel.com>
Date: Mon, 9 Apr 2018 10:26:32 +0800
Subject: [PATCH] net/i40e: fix using error set function
[ upstream commit 9ef8ebe790d8de796b50e5a1e389e07540d2ce4f ]
There is a specific function to set error for flow configuration,
so change to use that function.
Fixes: ecad87d22383 ("net/i40e: move RSS to flow API")
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
drivers/net/i40e/i40e_flow.c | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index c1b3ef4bb..f1c492a18 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -4266,20 +4266,29 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
conf_info->region[n].flowtype_num) {
if (!((rte_is_power_of_2(rss->num)) &&
rss->num <= 64)) {
- PMD_DRV_LOG(ERR, "The region sizes should be any of the following values: 1, 2, 4, 8, 16, 32, 64 as long as the "
- "total number of queues do not exceed the VSI allocation");
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ACTION,
+ act,
+ "The region sizes should be any of the following values: 1, 2, 4, 8, 16, 32, 64 as long as the "
+ "total number of queues do not exceed the VSI allocation");
return -rte_errno;
}
if (conf_info->region[n].user_priority[n] >=
I40E_MAX_USER_PRIORITY) {
- PMD_DRV_LOG(ERR, "the user priority max index is 7");
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ACTION,
+ act,
+ "the user priority max index is 7");
return -rte_errno;
}
if (conf_info->region[n].hw_flowtype[n] >=
I40E_FILTER_PCTYPE_MAX) {
- PMD_DRV_LOG(ERR, "the hw_flowtype or PCTYPE max index is 63");
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ACTION,
+ act,
+ "the hw_flowtype or PCTYPE max index is 63");
return -rte_errno;
}
@@ -4292,7 +4301,10 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
if (i == info->queue_region_number) {
if (i > I40E_REGION_MAX_INDEX) {
- PMD_DRV_LOG(ERR, "the queue region max index is 7");
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ACTION,
+ act,
+ "the queue region max index is 7");
return -rte_errno;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bonding: free mempool used in mode 6' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (43 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'net/i40e: fix using error set function' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'net/bonding: fix typo in log comment' " luca.boccassi
` (38 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Tonghao Zhang; +Cc: Ferruh Yigit, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 2d90d0443cad0b8130de3a54ce7466649c119ab6 Mon Sep 17 00:00:00 2001
From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Date: Tue, 10 Apr 2018 21:34:28 -0700
Subject: [PATCH] net/bonding: free mempool used in mode 6
[ upstream commit b9c0dea24beb4b893e88d93c1b52481003ff8999 ]
When creating bond device with mode6, dpdk will create
mempool for arp packets. If free the bond device and
create it with same name, there will be an error. Because
the mempool is not freed when destroying bond device.
Fixes: 06fe78b98ccd ("bond: add mode 6")
Fixes: ea0c20ea95fd ("apps: use helper to create mbuf pools")
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
drivers/net/bonding/rte_eth_bond_pmd.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index c0d167fff..f41c56b8b 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -3123,6 +3123,10 @@ bond_remove(struct rte_vdev_device *dev)
eth_dev->tx_pkt_burst = NULL;
internals = eth_dev->data->dev_private;
+ /* Try to release mempool used in mode6. If the bond
+ * device is not mode6, free the NULL is not problem.
+ */
+ rte_mempool_free(internals->mode6.mempool);
rte_bitmap_free(internals->vlan_filter_bmp);
rte_free(internals->vlan_filter_bmpmem);
rte_free(eth_dev->data->dev_private);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bonding: fix typo in log comment' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (44 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'net/bonding: free mempool used in mode 6' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'drivers/net: fix icc deprecated parameter warning' " luca.boccassi
` (37 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Tonghao Zhang; +Cc: Ferruh Yigit, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 9f78fd70a5cffdbb4c3e5191fe6a3c5ef076a774 Mon Sep 17 00:00:00 2001
From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Date: Tue, 10 Apr 2018 21:34:29 -0700
Subject: [PATCH] net/bonding: fix typo in log comment
[ upstream commit f87ce336a88c4312eb3eb7bc9f31a9618fb02b90 ]
Fixes: 68451eb6698c ("net/bonding: call through EAL on create/free")
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
drivers/net/bonding/rte_eth_bond_pmd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index f41c56b8b..32613703b 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -2953,7 +2953,7 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode)
/* Set mode 4 default configuration */
bond_mode_8023ad_setup(eth_dev, NULL);
if (bond_ethdev_mode_set(eth_dev, mode)) {
- RTE_BOND_LOG(ERR, "Failed to set bonded device %d mode too %d",
+ RTE_BOND_LOG(ERR, "Failed to set bonded device %d mode to %d\n",
eth_dev->data->port_id, mode);
goto err;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'drivers/net: fix icc deprecated parameter warning' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (45 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'net/bonding: fix typo in log comment' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'drivers/net: remove redundant icc flag' " luca.boccassi
` (36 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: Pablo de Lara, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 6ce2ebf0b3b3f48a27e12216b72301994e565789 Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@intel.com>
Date: Fri, 13 Apr 2018 23:21:08 +0100
Subject: [PATCH] drivers/net: fix icc deprecated parameter warning
[ upstream commit f16d0b36f8168a4c8ec71af178be558008008b98 ]
With icc (ICC) 18.0.1 20171018, -wd usage generates following warning:
icc: command line remark #10010: option '-wd3656' is deprecated and will
be removed in a future release. See '-help deprecated'
"icc -help deprecated" output is:
-wd use -diag-disable
Based on above information "-wd" converted to "-diag-disable"
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
drivers/net/bnx2x/Makefile | 2 +-
drivers/net/cxgbe/Makefile | 2 +-
drivers/net/e1000/Makefile | 3 ++-
drivers/net/fm10k/Makefile | 3 ++-
drivers/net/i40e/Makefile | 2 +-
drivers/net/ixgbe/Makefile | 5 +++--
drivers/net/qede/Makefile | 4 ++--
drivers/net/sfc/Makefile | 2 +-
drivers/net/sfc/meson.build | 2 +-
drivers/net/vmxnet3/Makefile | 3 ++-
10 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/drivers/net/bnx2x/Makefile b/drivers/net/bnx2x/Makefile
index 90ff8b1ee..e3a39a9e0 100644
--- a/drivers/net/bnx2x/Makefile
+++ b/drivers/net/bnx2x/Makefile
@@ -18,7 +18,7 @@ EXPORT_MAP := rte_pmd_bnx2x_version.map
LIBABIVER := 1
ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
-CFLAGS += -wd188 #188: enumerated type mixed with another type
+CFLAGS += -diag-disable 188 #188: enumerated type mixed with another type
endif
#
diff --git a/drivers/net/cxgbe/Makefile b/drivers/net/cxgbe/Makefile
index 65df14253..5dee3c723 100644
--- a/drivers/net/cxgbe/Makefile
+++ b/drivers/net/cxgbe/Makefile
@@ -49,7 +49,7 @@ ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
#
# CFLAGS for icc
#
-CFLAGS_BASE_DRIVER = -wd188
+CFLAGS_BASE_DRIVER = -diag-disable 188
else
#
# CFLAGS for gcc/clang
diff --git a/drivers/net/e1000/Makefile b/drivers/net/e1000/Makefile
index ba81a1f45..01941ac69 100644
--- a/drivers/net/e1000/Makefile
+++ b/drivers/net/e1000/Makefile
@@ -22,7 +22,8 @@ ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
#
# CFLAGS for icc
#
-CFLAGS_BASE_DRIVER = -wd177 -wd181 -wd188 -wd869 -wd2259
+CFLAGS_BASE_DRIVER = -diag-disable 177 -diag-disable 181 -diag-disable 188
+CFLAGS_BASE_DRIVER += -diag-disable 869 -diag-disable 2259
else
#
# CFLAGS for gcc/clang
diff --git a/drivers/net/fm10k/Makefile b/drivers/net/fm10k/Makefile
index b059a700a..d657dff8a 100644
--- a/drivers/net/fm10k/Makefile
+++ b/drivers/net/fm10k/Makefile
@@ -19,7 +19,8 @@ ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
#
# CFLAGS for icc
#
-CFLAGS_BASE_DRIVER = -wd174 -wd593 -wd869 -wd981 -wd2259
+CFLAGS_BASE_DRIVER = -diag-disable 174 -diag-disable 593 -diag-disable 869
+CFLAGS_BASE_DRIVER += -diag-disable 981 -diag-disable 2259
else ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)
diff --git a/drivers/net/i40e/Makefile b/drivers/net/i40e/Makefile
index 5663f5b1c..c91545741 100644
--- a/drivers/net/i40e/Makefile
+++ b/drivers/net/i40e/Makefile
@@ -24,7 +24,7 @@ LIBABIVER := 2
# to disable warnings
#
ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
-CFLAGS_BASE_DRIVER = -wd593 -wd188
+CFLAGS_BASE_DRIVER = -diag-disable 593 -diag-disable 188
else ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)
CFLAGS_BASE_DRIVER += -Wno-sign-compare
CFLAGS_BASE_DRIVER += -Wno-unused-value
diff --git a/drivers/net/ixgbe/Makefile b/drivers/net/ixgbe/Makefile
index d0804fc5b..f8cad125b 100644
--- a/drivers/net/ixgbe/Makefile
+++ b/drivers/net/ixgbe/Makefile
@@ -20,9 +20,10 @@ ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
#
# CFLAGS for icc
#
-CFLAGS_BASE_DRIVER = -wd174 -wd593 -wd869 -wd981 -wd2259
+CFLAGS_BASE_DRIVER = -diag-disable 174 -diag-disable 593 -diag-disable 869
+CFLAGS_BASE_DRIVER += -diag-disable 981 -diag-disable 2259
-CFLAGS_ixgbe_rxtx.o += -wd3656
+CFLAGS_ixgbe_rxtx.o += -diag-disable 3656
else ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)
#
diff --git a/drivers/net/qede/Makefile b/drivers/net/qede/Makefile
index ccbffa45d..db5ba966e 100644
--- a/drivers/net/qede/Makefile
+++ b/drivers/net/qede/Makefile
@@ -73,8 +73,8 @@ ifeq ($(shell clang -Wno-pointer-bool-conversion -Werror -E - < /dev/null > /dev
CFLAGS_BASE_DRIVER += -Wno-pointer-bool-conversion
endif
else #ICC
-CFLAGS_BASE_DRIVER += -wd188 #188: enumerated type mixed with another type
-CFLAGS_qede_ethdev.o += -wd279 #279: controlling expression is constant
+CFLAGS_BASE_DRIVER += -diag-disable 188 #188: enumerated type mixed with another type
+CFLAGS_qede_ethdev.o += -diag-disable 279 #279: controlling expression is constant
endif
#
diff --git a/drivers/net/sfc/Makefile b/drivers/net/sfc/Makefile
index 8a671dd20..3dae91468 100644
--- a/drivers/net/sfc/Makefile
+++ b/drivers/net/sfc/Makefile
@@ -46,7 +46,7 @@ else ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
CFLAGS_BASE_DRIVER += -Wno-unused-but-set-variable
# Suppress ICC false positive warning on 'bulk' may be used before its
# value is set
-CFLAGS_sfc_ef10_tx.o += -wd3656
+CFLAGS_sfc_ef10_tx.o += -diag-disable 3656
endif
LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs
diff --git a/drivers/net/sfc/meson.build b/drivers/net/sfc/meson.build
index b60a8f58d..a37fc44a7 100644
--- a/drivers/net/sfc/meson.build
+++ b/drivers/net/sfc/meson.build
@@ -32,7 +32,7 @@ extra_flags += [
# Suppress ICC false positive warning on 'bulk' may be used before its
# value is set
-extra_flags += '-wd3656'
+extra_flags += '-diag-disable 3656'
foreach flag: extra_flags
if cc.has_argument(flag)
diff --git a/drivers/net/vmxnet3/Makefile b/drivers/net/vmxnet3/Makefile
index 6bfbf0195..911850140 100644
--- a/drivers/net/vmxnet3/Makefile
+++ b/drivers/net/vmxnet3/Makefile
@@ -15,7 +15,8 @@ ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
#
# CFLAGS for icc
#
-CFLAGS_BASE_DRIVER = -wd174 -wd593 -wd869 -wd981 -wd2259
+CFLAGS_BASE_DRIVER = -diag-disable 174 -diag-disable 593 -diag-disable 869
+CFLAGS_BASE_DRIVER += -diag-disable 981 -diag-disable 2259
else ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)
#
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'drivers/net: remove redundant icc flag' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (46 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'drivers/net: fix icc deprecated parameter warning' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'event/opdl: fix atomic queue race condition' " luca.boccassi
` (35 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: Pablo de Lara, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 06f34e6b087937425003d915aea9f008433c8a46 Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@intel.com>
Date: Fri, 13 Apr 2018 23:21:09 +0100
Subject: [PATCH] drivers/net: remove redundant icc flag
[ upstream commit 91cf42f6c491ea707256d1778d89c4e852722b92 ]
ICC warning #188 already disabled globally via commit [1], no
need individual arguments in PMDs.
[1]
Fixes: 1b80b9c854c3 ("mk: disable icc warning 188")
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
drivers/net/bnx2x/Makefile | 4 ----
drivers/net/cxgbe/Makefile | 8 --------
drivers/net/e1000/Makefile | 2 +-
drivers/net/i40e/Makefile | 2 +-
drivers/net/qede/Makefile | 1 -
5 files changed, 2 insertions(+), 15 deletions(-)
diff --git a/drivers/net/bnx2x/Makefile b/drivers/net/bnx2x/Makefile
index e3a39a9e0..0c0f51aaa 100644
--- a/drivers/net/bnx2x/Makefile
+++ b/drivers/net/bnx2x/Makefile
@@ -17,10 +17,6 @@ EXPORT_MAP := rte_pmd_bnx2x_version.map
LIBABIVER := 1
-ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
-CFLAGS += -diag-disable 188 #188: enumerated type mixed with another type
-endif
-
#
# all source are stored in SRCS-y
#
diff --git a/drivers/net/cxgbe/Makefile b/drivers/net/cxgbe/Makefile
index 5dee3c723..33267f6a6 100644
--- a/drivers/net/cxgbe/Makefile
+++ b/drivers/net/cxgbe/Makefile
@@ -45,12 +45,6 @@ EXPORT_MAP := rte_pmd_cxgbe_version.map
LIBABIVER := 1
-ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
-#
-# CFLAGS for icc
-#
-CFLAGS_BASE_DRIVER = -diag-disable 188
-else
#
# CFLAGS for gcc/clang
#
@@ -59,9 +53,7 @@ ifeq ($(shell test $(GCC_VERSION) -ge 44 && echo 1), 1)
CFLAGS += -Wno-deprecated
endif
endif
-CFLAGS_BASE_DRIVER =
-endif
LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs
LDLIBS += -lrte_bus_pci
diff --git a/drivers/net/e1000/Makefile b/drivers/net/e1000/Makefile
index 01941ac69..87cfb265d 100644
--- a/drivers/net/e1000/Makefile
+++ b/drivers/net/e1000/Makefile
@@ -22,7 +22,7 @@ ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
#
# CFLAGS for icc
#
-CFLAGS_BASE_DRIVER = -diag-disable 177 -diag-disable 181 -diag-disable 188
+CFLAGS_BASE_DRIVER = -diag-disable 177 -diag-disable 181
CFLAGS_BASE_DRIVER += -diag-disable 869 -diag-disable 2259
else
#
diff --git a/drivers/net/i40e/Makefile b/drivers/net/i40e/Makefile
index c91545741..7e34b50a7 100644
--- a/drivers/net/i40e/Makefile
+++ b/drivers/net/i40e/Makefile
@@ -24,7 +24,7 @@ LIBABIVER := 2
# to disable warnings
#
ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
-CFLAGS_BASE_DRIVER = -diag-disable 593 -diag-disable 188
+CFLAGS_BASE_DRIVER = -diag-disable 593
else ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)
CFLAGS_BASE_DRIVER += -Wno-sign-compare
CFLAGS_BASE_DRIVER += -Wno-unused-value
diff --git a/drivers/net/qede/Makefile b/drivers/net/qede/Makefile
index db5ba966e..831ee15df 100644
--- a/drivers/net/qede/Makefile
+++ b/drivers/net/qede/Makefile
@@ -73,7 +73,6 @@ ifeq ($(shell clang -Wno-pointer-bool-conversion -Werror -E - < /dev/null > /dev
CFLAGS_BASE_DRIVER += -Wno-pointer-bool-conversion
endif
else #ICC
-CFLAGS_BASE_DRIVER += -diag-disable 188 #188: enumerated type mixed with another type
CFLAGS_qede_ethdev.o += -diag-disable 279 #279: controlling expression is constant
endif
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'event/opdl: fix atomic queue race condition' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (47 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'drivers/net: remove redundant icc flag' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'eventdev: fix MP/MC tail updates in event ring' " luca.boccassi
` (34 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Liang Ma; +Cc: Peter Mccarthy, Harry van Haaren, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 459f030c20513c4f26d1d6504538374ff41a4d3d Mon Sep 17 00:00:00 2001
From: Liang Ma <liang.j.ma@intel.com>
Date: Tue, 27 Mar 2018 15:18:12 +0100
Subject: [PATCH] event/opdl: fix atomic queue race condition
[ upstream commit b770f952de678b4964d05ce49b0518919f152b83 ]
If application link one atomic queue to multiple ports,
and each worker core update flow_id, there will have a
chance to hit race condition issue and lead to double processing
same event. This fix solve the problem and eliminate
the race condition issue.
Fixes: 4236ce9bf5bf ("event/opdl: add OPDL ring infrastructure library")
Signed-off-by: Liang Ma <liang.j.ma@intel.com>
Signed-off-by: Peter Mccarthy <peter.mccarthy@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
---
drivers/event/opdl/opdl_evdev_init.c | 3 ++
drivers/event/opdl/opdl_ring.c | 93 +++++++++++++++++++++++++-----------
drivers/event/opdl/opdl_ring.h | 16 ++++++-
3 files changed, 84 insertions(+), 28 deletions(-)
diff --git a/drivers/event/opdl/opdl_evdev_init.c b/drivers/event/opdl/opdl_evdev_init.c
index 1454de533..582ad698f 100644
--- a/drivers/event/opdl/opdl_evdev_init.c
+++ b/drivers/event/opdl/opdl_evdev_init.c
@@ -733,6 +733,9 @@ initialise_all_other_ports(struct rte_eventdev *dev)
queue->ports[queue->nb_ports] = port;
port->instance_id = queue->nb_ports;
queue->nb_ports++;
+ opdl_stage_set_queue_id(stage_inst,
+ port->queue_id);
+
} else if (queue->q_pos == OPDL_Q_POS_END) {
/* tx port */
diff --git a/drivers/event/opdl/opdl_ring.c b/drivers/event/opdl/opdl_ring.c
index eca7712bd..8aca481c9 100644
--- a/drivers/event/opdl/opdl_ring.c
+++ b/drivers/event/opdl/opdl_ring.c
@@ -25,7 +25,10 @@
#define OPDL_NAME_SIZE 64
-#define OPDL_EVENT_MASK (0xFFFF0000000FFFFFULL)
+#define OPDL_EVENT_MASK (0x00000000000FFFFFULL)
+#define OPDL_FLOWID_MASK (0xFFFFF)
+#define OPDL_OPA_MASK (0xFF)
+#define OPDL_OPA_OFFSET (0x38)
int opdl_logtype_driver;
@@ -86,7 +89,6 @@ struct opdl_stage {
*/
uint32_t available_seq;
uint32_t head; /* Current head for single-thread operation */
- uint32_t shadow_head; /* Shadow head for single-thread operation */
uint32_t nb_instance; /* Number of instances */
uint32_t instance_id; /* ID of this stage instance */
uint16_t num_claimed; /* Number of slots claimed */
@@ -102,6 +104,9 @@ struct opdl_stage {
/* For managing disclaims in multi-threaded processing stages */
struct claim_manager pending_disclaims[RTE_MAX_LCORE]
__rte_cache_aligned;
+ uint32_t shadow_head; /* Shadow head for single-thread operation */
+ uint32_t queue_id; /* ID of Queue which is assigned to this stage */
+ uint32_t pos; /* Atomic scan position */
} __rte_cache_aligned;
/* Context for opdl_ring */
@@ -494,6 +499,9 @@ opdl_stage_claim_singlethread(struct opdl_stage *s, void *entries,
uint32_t num_entries, uint32_t *seq, bool block, bool atomic)
{
uint32_t i = 0, j = 0, offset;
+ uint32_t opa_id = 0;
+ uint32_t flow_id = 0;
+ uint64_t event = 0;
void *get_slots;
struct rte_event *ev;
RTE_SET_USED(seq);
@@ -520,7 +528,17 @@ opdl_stage_claim_singlethread(struct opdl_stage *s, void *entries,
for (j = 0; j < num_entries; j++) {
ev = (struct rte_event *)get_slot(t, s->head+j);
- if ((ev->flow_id%s->nb_instance) == s->instance_id) {
+
+ event = __atomic_load_n(&(ev->event),
+ __ATOMIC_ACQUIRE);
+
+ opa_id = OPDL_OPA_MASK & (event >> OPDL_OPA_OFFSET);
+ flow_id = OPDL_FLOWID_MASK & event;
+
+ if (opa_id >= s->queue_id)
+ continue;
+
+ if ((flow_id % s->nb_instance) == s->instance_id) {
memcpy(entries_offset, ev, t->slot_size);
entries_offset += t->slot_size;
i++;
@@ -531,6 +549,7 @@ opdl_stage_claim_singlethread(struct opdl_stage *s, void *entries,
s->head += num_entries;
s->num_claimed = num_entries;
s->num_event = i;
+ s->pos = 0;
/* automatically disclaim entries if number of rte_events is zero */
if (unlikely(i == 0))
@@ -953,21 +972,26 @@ opdl_ring_get_slot(const struct opdl_ring *t, uint32_t index)
}
bool
-opdl_ring_cas_slot(const struct opdl_stage *s, const struct rte_event *ev,
+opdl_ring_cas_slot(struct opdl_stage *s, const struct rte_event *ev,
uint32_t index, bool atomic)
{
- uint32_t i = 0, j = 0, offset;
+ uint32_t i = 0, offset;
struct opdl_ring *t = s->t;
struct rte_event *ev_orig = NULL;
bool ev_updated = false;
- uint64_t ev_temp = 0;
+ uint64_t ev_temp = 0;
+ uint64_t ev_update = 0;
+
+ uint32_t opa_id = 0;
+ uint32_t flow_id = 0;
+ uint64_t event = 0;
if (index > s->num_event) {
PMD_DRV_LOG(ERR, "index is overflow");
return ev_updated;
}
- ev_temp = ev->event&OPDL_EVENT_MASK;
+ ev_temp = ev->event & OPDL_EVENT_MASK;
if (!atomic) {
offset = opdl_first_entry_id(s->seq, s->nb_instance,
@@ -984,27 +1008,39 @@ opdl_ring_cas_slot(const struct opdl_stage *s, const struct rte_event *ev,
}
} else {
- for (i = 0; i < s->num_claimed; i++) {
+ for (i = s->pos; i < s->num_claimed; i++) {
ev_orig = (struct rte_event *)
get_slot(t, s->shadow_head+i);
- if ((ev_orig->flow_id%s->nb_instance) ==
- s->instance_id) {
+ event = __atomic_load_n(&(ev_orig->event),
+ __ATOMIC_ACQUIRE);
- if (j == index) {
- if ((ev_orig->event&OPDL_EVENT_MASK) !=
- ev_temp) {
- ev_orig->event = ev->event;
- ev_updated = true;
- }
- if (ev_orig->u64 != ev->u64) {
- ev_orig->u64 = ev->u64;
- ev_updated = true;
- }
+ opa_id = OPDL_OPA_MASK & (event >> OPDL_OPA_OFFSET);
+ flow_id = OPDL_FLOWID_MASK & event;
- break;
+ if (opa_id >= s->queue_id)
+ continue;
+
+ if ((flow_id % s->nb_instance) == s->instance_id) {
+ ev_update = s->queue_id;
+ ev_update = (ev_update << OPDL_OPA_OFFSET)
+ | ev->event;
+
+ s->pos = i + 1;
+
+ if ((event & OPDL_EVENT_MASK) !=
+ ev_temp) {
+ __atomic_store_n(&(ev_orig->event),
+ ev_update,
+ __ATOMIC_RELEASE);
+ ev_updated = true;
}
- j++;
+ if (ev_orig->u64 != ev->u64) {
+ ev_orig->u64 = ev->u64;
+ ev_updated = true;
+ }
+
+ break;
}
}
@@ -1049,11 +1085,7 @@ check_deps(struct opdl_ring *t, struct opdl_stage *deps[],
return -EINVAL;
}
}
- if (num_deps > t->num_stages) {
- PMD_DRV_LOG(ERR, "num_deps (%u) > number stages (%u)",
- num_deps, t->num_stages);
- return -EINVAL;
- }
+
return 0;
}
@@ -1153,6 +1185,13 @@ opdl_stage_get_opdl_ring(const struct opdl_stage *s)
return s->t;
}
+void
+opdl_stage_set_queue_id(struct opdl_stage *s,
+ uint32_t queue_id)
+{
+ s->queue_id = queue_id;
+}
+
void
opdl_ring_dump(const struct opdl_ring *t, FILE *f)
{
diff --git a/drivers/event/opdl/opdl_ring.h b/drivers/event/opdl/opdl_ring.h
index 9e8c33e68..751a59dbc 100644
--- a/drivers/event/opdl/opdl_ring.h
+++ b/drivers/event/opdl/opdl_ring.h
@@ -518,6 +518,20 @@ opdl_stage_find_num_available(struct opdl_stage *s, uint32_t num_entries);
struct opdl_stage *
opdl_stage_create(struct opdl_ring *t, bool threadsafe);
+
+/**
+ * Set the internal queue id for each stage instance.
+ *
+ * @param s
+ * The pointer of stage instance.
+ *
+ * @param queue_id
+ * The value of internal queue id.
+ */
+void
+opdl_stage_set_queue_id(struct opdl_stage *s,
+ uint32_t queue_id);
+
/**
* Prints information on opdl_ring instance and all its stages
*
@@ -590,7 +604,7 @@ opdl_ring_set_stage_threadsafe(struct opdl_stage *s, bool threadsafe);
*/
bool
-opdl_ring_cas_slot(const struct opdl_stage *s, const struct rte_event *ev,
+opdl_ring_cas_slot(struct opdl_stage *s, const struct rte_event *ev,
uint32_t index, bool atomic);
#ifdef __cplusplus
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'eventdev: fix MP/MC tail updates in event ring' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (48 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'event/opdl: fix atomic queue race condition' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'eventdev: remove stale forward declaration' " luca.boccassi
` (33 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Mattias Rönnblom; +Cc: Bruce Richardson, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 4b55aba99c15faf76a4d9adc036240c08c8dd08c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= <hofors@lysator.liu.se>
Date: Tue, 3 Apr 2018 10:19:03 +0200
Subject: [PATCH] eventdev: fix MP/MC tail updates in event ring
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[ upstream commit 463dee906eeee3b2ed1715930083e2be90578de8 ]
rte_event_ring enqueue and dequeue tail updates were hardcoded for a
SC/SP configuration.
Fixes: dc39e2f359b5 ("eventdev: add ring structure for events")
Signed-off-by: Mattias Rönnblom <hofors@lysator.liu.se>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/librte_eventdev/rte_event_ring.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/librte_eventdev/rte_event_ring.h b/lib/librte_eventdev/rte_event_ring.h
index 29d4228ab..827a3209e 100644
--- a/lib/librte_eventdev/rte_event_ring.h
+++ b/lib/librte_eventdev/rte_event_ring.h
@@ -99,7 +99,7 @@ rte_event_ring_enqueue_burst(struct rte_event_ring *r,
ENQUEUE_PTRS(&r->r, &r[1], prod_head, events, n, struct rte_event);
- update_tail(&r->r.prod, prod_head, prod_next, 1, 1);
+ update_tail(&r->r.prod, prod_head, prod_next, r->r.prod.single, 1);
end:
if (free_space != NULL)
*free_space = free_entries - n;
@@ -140,7 +140,7 @@ rte_event_ring_dequeue_burst(struct rte_event_ring *r,
DEQUEUE_PTRS(&r->r, &r[1], cons_head, events, n, struct rte_event);
- update_tail(&r->r.cons, cons_head, cons_next, 1, 0);
+ update_tail(&r->r.cons, cons_head, cons_next, r->r.cons.single, 0);
end:
if (available != NULL)
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'eventdev: remove stale forward declaration' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (49 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'eventdev: fix MP/MC tail updates in event ring' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'event/dpaa: fix integer overflow of max ports' " luca.boccassi
` (32 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Rami Rosen; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 931dedda5c53050d071eb0e2ab2e5724b8ba1b01 Mon Sep 17 00:00:00 2001
From: Rami Rosen <rami.rosen@intel.com>
Date: Fri, 13 Apr 2018 20:20:17 -0400
Subject: [PATCH] eventdev: remove stale forward declaration
[ upstream commit 6797eb65bf5b2a41d38eec28a2852ba45fa12836 ]
This patch removes the decalartion of rte_eventdev_driver from
rte_eventdev.h, as it not used anymore; pci_eventdev_skeleton_pmd
moved to use rte_pci_driver instead of rte_eventdev_driver.
Fixes: 7214438d93e6 ("eventdev: remove PCI dependency from generic structures")
Signed-off-by: Rami Rosen <rami.rosen@intel.com>
---
lib/librte_eventdev/rte_eventdev.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h
index b21c27179..b52b8e91f 100644
--- a/lib/librte_eventdev/rte_eventdev.h
+++ b/lib/librte_eventdev/rte_eventdev.h
@@ -1096,7 +1096,6 @@ int
rte_event_eth_rx_adapter_caps_get(uint8_t dev_id, uint8_t eth_port_id,
uint32_t *caps);
-struct rte_eventdev_driver;
struct rte_eventdev_ops;
struct rte_eventdev;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'event/dpaa: fix integer overflow of max ports' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (50 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'eventdev: remove stale forward declaration' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'vfio: export functions even when disabled' " luca.boccassi
` (31 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Gowrishankar Muthukrishnan; +Cc: Sunil Kumar Kori, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 2308778eb07095de05e234344835b1b10716acdf Mon Sep 17 00:00:00 2001
From: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
Date: Fri, 13 Apr 2018 10:36:31 +0530
Subject: [PATCH] event/dpaa: fix integer overflow of max ports
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[ upstream commit 100915c0a51121fdbbb3be04aa73823f54e20cda ]
dev_info->max_event_ports is uint8_t. dpaa_event_dev_info_get assigns
DPAA_EVENT_MAX_EVENT_PORT (which is RTE_MAX_LCORE, upto 256 in ppc64le)
into this variable, which breaks compile in ppc64le.
drivers/event/dpaa/dpaa_eventdev.c: In function ‘dpaa_event_dev_info_get’:
rte_config.h:23:23: error:
large integer implicitly truncated to unsigned type [-Werror=overflow]
#define RTE_MAX_LCORE 256
Fixes: 9caac5dd1e ("event/dpaa: introduce PMD")
Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
Acked-by: Sunil Kumar Kori <sunil.kori@nxp.com>
---
drivers/event/dpaa/dpaa_eventdev.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/event/dpaa/dpaa_eventdev.h b/drivers/event/dpaa/dpaa_eventdev.h
index 918fe35ce..583e46ca4 100644
--- a/drivers/event/dpaa/dpaa_eventdev.h
+++ b/drivers/event/dpaa/dpaa_eventdev.h
@@ -26,7 +26,7 @@
#define DPAA_EVENT_MAX_QUEUE_FLOWS 2048
#define DPAA_EVENT_MAX_QUEUE_PRIORITY_LEVELS 8
#define DPAA_EVENT_MAX_EVENT_PRIORITY_LEVELS 0
-#define DPAA_EVENT_MAX_EVENT_PORT RTE_MAX_LCORE
+#define DPAA_EVENT_MAX_EVENT_PORT RTE_MIN(RTE_MAX_LCORE, INT8_MAX)
#define DPAA_EVENT_MAX_PORT_DEQUEUE_DEPTH 8
#define DPAA_EVENT_PORT_DEQUEUE_TIMEOUT_NS 100UL
#define DPAA_EVENT_PORT_DEQUEUE_TIMEOUT_INVALID ((uint64_t)-1)
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'vfio: export functions even when disabled' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (51 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'event/dpaa: fix integer overflow of max ports' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'ipc: fix use-after-free in synchronous requests' " luca.boccassi
` (30 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Anatoly Burakov; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 6d0f8aefc7c177a0d64107f5c3e8d2a713d09e5b Mon Sep 17 00:00:00 2001
From: Anatoly Burakov <anatoly.burakov@intel.com>
Date: Mon, 16 Apr 2018 13:13:56 +0100
Subject: [PATCH] vfio: export functions even when disabled
[ upstream commit 6e8a721044c6ef677e67991f3f2a9bd0870eecc2 ]
Previously, VFIO functions were not compiled in and exported if
VFIO compilation was disabled. Fix this by actually compiling
all of the functions unconditionally, and provide missing
prototypes on Linux.
Fixes: 279b581c897d ("vfio: expose functions")
Fixes: 73a639085938 ("vfio: allow to map other memory regions")
Fixes: 964b2f3bfb07 ("vfio: export some internal functions")
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
lib/librte_eal/bsdapp/eal/eal.c | 13 +------
lib/librte_eal/common/include/rte_vfio.h | 15 +++++---
lib/librte_eal/linuxapp/eal/eal_vfio.c | 64 +++++++++++++++++++++++++++++++-
3 files changed, 74 insertions(+), 18 deletions(-)
diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c
index 4eafcb5ad..b1b8f7600 100644
--- a/lib/librte_eal/bsdapp/eal/eal.c
+++ b/lib/librte_eal/bsdapp/eal/eal.c
@@ -40,6 +40,7 @@
#include <rte_dev.h>
#include <rte_devargs.h>
#include <rte_version.h>
+#include <rte_vfio.h>
#include <rte_atomic.h>
#include <malloc_heap.h>
@@ -735,18 +736,6 @@ rte_eal_vfio_intr_mode(void)
return RTE_INTR_MODE_NONE;
}
-/* dummy forward declaration. */
-struct vfio_device_info;
-
-/* dummy prototypes. */
-int rte_vfio_setup_device(const char *sysfs_base, const char *dev_addr,
- int *vfio_dev_fd, struct vfio_device_info *device_info);
-int rte_vfio_release_device(const char *sysfs_base, const char *dev_addr, int fd);
-int rte_vfio_enable(const char *modname);
-int rte_vfio_is_enabled(const char *modname);
-int rte_vfio_noiommu_is_enabled(void);
-int rte_vfio_clear_group(int vfio_group_fd);
-
int rte_vfio_setup_device(__rte_unused const char *sysfs_base,
__rte_unused const char *dev_addr,
__rte_unused int *vfio_dev_fd,
diff --git a/lib/librte_eal/common/include/rte_vfio.h b/lib/librte_eal/common/include/rte_vfio.h
index 249095e46..c98ba48dc 100644
--- a/lib/librte_eal/common/include/rte_vfio.h
+++ b/lib/librte_eal/common/include/rte_vfio.h
@@ -5,6 +5,10 @@
#ifndef _RTE_VFIO_H_
#define _RTE_VFIO_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* determine if VFIO is present on the system
*/
@@ -28,9 +32,12 @@
#define VFIO_NOIOMMU_MODE \
"/sys/module/vfio/parameters/enable_unsafe_noiommu_mode"
-#ifdef __cplusplus
-extern "C" {
-#endif
+#else /* not VFIO_PRESENT */
+
+/* we don't need an actual definition, only pointer is used */
+struct vfio_device_info;
+
+#endif /* VFIO_PRESENT */
/**
* Setup vfio_cfg for the device identified by its address.
@@ -131,6 +138,4 @@ rte_vfio_clear_group(int vfio_group_fd);
}
#endif
-#endif /* VFIO_PRESENT */
-
#endif /* _RTE_VFIO_H_ */
diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c
index 9e593184c..d20ec8d9f 100644
--- a/lib/librte_eal/linuxapp/eal/eal_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c
@@ -838,4 +838,66 @@ rte_vfio_noiommu_is_enabled(void)
return c == 'Y';
}
-#endif
+#else
+
+int
+rte_vfio_setup_device(__rte_unused const char *sysfs_base,
+ __rte_unused const char *dev_addr,
+ __rte_unused int *vfio_dev_fd,
+ __rte_unused struct vfio_device_info *device_info)
+{
+ return -1;
+}
+
+int
+rte_vfio_release_device(__rte_unused const char *sysfs_base,
+ __rte_unused const char *dev_addr, __rte_unused int fd)
+{
+ return -1;
+}
+
+int
+rte_vfio_enable(__rte_unused const char *modname)
+{
+ return -1;
+}
+
+int
+rte_vfio_is_enabled(__rte_unused const char *modname)
+{
+ return -1;
+}
+
+int
+rte_vfio_noiommu_is_enabled(void)
+{
+ return -1;
+}
+
+int
+rte_vfio_clear_group(__rte_unused int vfio_group_fd)
+{
+ return -1;
+}
+
+int __rte_experimental
+rte_vfio_get_group_num(__rte_unused const char *sysfs_base,
+ __rte_unused const char *dev_addr,
+ __rte_unused int *iommu_group_num)
+{
+ return -1;
+}
+
+int __rte_experimental
+rte_vfio_get_container_fd(void)
+{
+ return -1;
+}
+
+int __rte_experimental
+rte_vfio_get_group_fd(__rte_unused int iommu_group_num)
+{
+ return -1;
+}
+
+#endif /* VFIO_PRESENT */
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'ipc: fix use-after-free in synchronous requests' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (52 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'vfio: export functions even when disabled' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'ipc: fix missing mutex unlocks on failed send' " luca.boccassi
` (29 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Anatoly Burakov; +Cc: Jianfeng Tan, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From d64cf5c8efaff7c3c6640fbdc04bc4ac2372b1dd Mon Sep 17 00:00:00 2001
From: Anatoly Burakov <anatoly.burakov@intel.com>
Date: Fri, 13 Apr 2018 12:54:59 +0100
Subject: [PATCH] ipc: fix use-after-free in synchronous requests
[ upstream commit fe98e52a52f0989c299883bf7c231b64ae1cd242 ]
Previously, we were adding synchronous requests to request list, we
were doing it after checking if request existed. However, we only
removed the request from the request list if we have succeeded in
sending the request. In case of failed request send, we left an
invalid pointer in the request list.
Fix this by only adding request to the list once we succeed in
sending it.
Fixes: 783b6e54971d ("eal: add synchronous multi-process communication")
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
---
lib/librte_eal/common/eal_common_proc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/librte_eal/common/eal_common_proc.c b/lib/librte_eal/common/eal_common_proc.c
index da7930f56..dccf9ab09 100644
--- a/lib/librte_eal/common/eal_common_proc.c
+++ b/lib/librte_eal/common/eal_common_proc.c
@@ -559,8 +559,6 @@ mp_request_one(const char *dst, struct rte_mp_msg *req,
pthread_mutex_lock(&sync_requests.lock);
exist = find_sync_request(dst, req->name);
- if (!exist)
- TAILQ_INSERT_TAIL(&sync_requests.requests, &sync_req, next);
if (exist) {
RTE_LOG(ERR, EAL, "A pending request %s:%s\n", dst, req->name);
rte_errno = EEXIST;
@@ -576,6 +574,8 @@ mp_request_one(const char *dst, struct rte_mp_msg *req,
} else if (ret == 0)
return 0;
+ TAILQ_INSERT_TAIL(&sync_requests.requests, &sync_req, next);
+
reply->nb_sent++;
do {
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'ipc: fix missing mutex unlocks on failed send' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (53 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'ipc: fix use-after-free in synchronous requests' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'fix ethdev ports enumeration' " luca.boccassi
` (28 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Anatoly Burakov; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 930272de80fdc00c87188dd4ccfde24d008bcda0 Mon Sep 17 00:00:00 2001
From: Anatoly Burakov <anatoly.burakov@intel.com>
Date: Fri, 13 Apr 2018 15:16:19 +0100
Subject: [PATCH] ipc: fix missing mutex unlocks on failed send
[ upstream commit 48e97288982233f015185d632452ab6548c1bd2c ]
Earlier fix for race condition introduced a bug where mutex
wasn't unlocked if message failed to be sent. Fix all of this
by moving locking out of mp_request_sync() altogether.
Fixes: da5957821bdd ("eal: fix race condition in IPC request")
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
lib/librte_eal/common/eal_common_proc.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/lib/librte_eal/common/eal_common_proc.c b/lib/librte_eal/common/eal_common_proc.c
index dccf9ab09..6c315ddf5 100644
--- a/lib/librte_eal/common/eal_common_proc.c
+++ b/lib/librte_eal/common/eal_common_proc.c
@@ -557,12 +557,10 @@ mp_request_one(const char *dst, struct rte_mp_msg *req,
sync_req.reply = &msg;
pthread_cond_init(&sync_req.cond, NULL);
- pthread_mutex_lock(&sync_requests.lock);
exist = find_sync_request(dst, req->name);
if (exist) {
RTE_LOG(ERR, EAL, "A pending request %s:%s\n", dst, req->name);
rte_errno = EEXIST;
- pthread_mutex_unlock(&sync_requests.lock);
return -1;
}
@@ -592,9 +590,7 @@ mp_request_one(const char *dst, struct rte_mp_msg *req,
now.tv_usec * 1000 < ts->tv_nsec)
break;
} while (1);
- /* We got the lock now */
TAILQ_REMOVE(&sync_requests.requests, &sync_req, next);
- pthread_mutex_unlock(&sync_requests.lock);
if (sync_req.reply_received == 0) {
RTE_LOG(ERR, EAL, "Fail to recv reply for request %s:%s\n",
@@ -645,8 +641,12 @@ rte_mp_request(struct rte_mp_msg *req, struct rte_mp_reply *reply,
reply->msgs = NULL;
/* for secondary process, send request to the primary process only */
- if (rte_eal_process_type() == RTE_PROC_SECONDARY)
- return mp_request_one(eal_mp_socket_path(), req, reply, &end);
+ if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
+ pthread_mutex_lock(&sync_requests.lock);
+ ret = mp_request_one(eal_mp_socket_path(), req, reply, &end);
+ pthread_mutex_unlock(&sync_requests.lock);
+ return ret;
+ }
/* for primary process, broadcast request, and collect reply 1 by 1 */
mp_dir = opendir(mp_dir_path);
@@ -656,6 +656,7 @@ rte_mp_request(struct rte_mp_msg *req, struct rte_mp_reply *reply,
return -1;
}
+ pthread_mutex_lock(&sync_requests.lock);
while ((ent = readdir(mp_dir))) {
char path[PATH_MAX];
@@ -665,9 +666,13 @@ rte_mp_request(struct rte_mp_msg *req, struct rte_mp_reply *reply,
snprintf(path, sizeof(path), "%s/%s", mp_dir_path,
ent->d_name);
+ /* unlocks the mutex while waiting for response,
+ * locks on receive
+ */
if (mp_request_one(path, req, reply, &end))
ret = -1;
}
+ pthread_mutex_unlock(&sync_requests.lock);
closedir(mp_dir);
return ret;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'fix ethdev ports enumeration' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (54 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'ipc: fix missing mutex unlocks on failed send' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 15:07 ` Thomas Monjalon
2018-04-30 14:41 ` [dpdk-stable] patch 'fix ethdev port id validation' " luca.boccassi
` (27 subsequent siblings)
83 siblings, 1 reply; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From beef7e18559abf272f9ca0a4d1b62f8d32c47b02 Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas@monjalon.net>
Date: Thu, 5 Apr 2018 17:33:20 +0200
Subject: [PATCH] fix ethdev ports enumeration
[ upstream commit 8728ccf37615904cf23fb8763895b05c9a3c6b0c ]
Some DPDK applications wrongly assume these requirements:
- no hotplug, i.e. ports are never detached
- all allocated ports are available to the application
Such application iterates over ports by its own mean.
The most common pattern is to request the port count and
assume ports with index in the range [0..count[ can be used.
There are three consequences when using such wrong design:
- new ports having an index higher than the port count won't be seen
- old ports being detached (RTE_ETH_DEV_UNUSED) can be seen as ghosts
- failsafe sub-devices (RTE_ETH_DEV_DEFERRED) will be seen by the application
Such mistake will be less common with growing hotplug awareness.
All applications and examples inside this repository - except testpmd -
must be fixed to use the iterator RTE_ETH_FOREACH_DEV.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
app/proc_info/main.c | 2 +-
app/test-eventdev/test_perf_common.c | 10 +++++-----
app/test-eventdev/test_pipeline_common.c | 10 +++++-----
app/test-pmd/cmdline.c | 4 ++--
app/test-pmd/testpmd.c | 7 ++-----
doc/guides/sample_app_ug/flow_classify.rst | 11 +++++------
doc/guides/sample_app_ug/l2_forward_job_stats.rst | 2 +-
.../sample_app_ug/l2_forward_real_virtual.rst | 2 +-
doc/guides/sample_app_ug/link_status_intr.rst | 2 +-
doc/guides/sample_app_ug/skeleton.rst | 8 ++++----
drivers/net/bonding/Makefile | 1 +
drivers/net/bonding/meson.build | 2 ++
drivers/net/bonding/rte_eth_bond_args.c | 4 ++--
drivers/net/mrvl/mrvl_ethdev.c | 2 +-
examples/bond/Makefile | 3 +++
examples/bond/main.c | 4 ++--
examples/bond/meson.build | 1 +
examples/distributor/Makefile | 3 +++
examples/distributor/main.c | 21 ++++++++++-----------
examples/distributor/meson.build | 1 +
examples/ethtool/ethtool-app/Makefile | 1 +
examples/ethtool/ethtool-app/ethapp.c | 10 +++++-----
examples/eventdev_pipeline/main.c | 19 +++++++++----------
.../eventdev_pipeline/pipeline_worker_generic.c | 7 +++----
examples/eventdev_pipeline/pipeline_worker_tx.c | 2 +-
examples/exception_path/Makefile | 3 +++
examples/exception_path/main.c | 8 ++++----
examples/exception_path/meson.build | 1 +
examples/flow_classify/flow_classify.c | 11 +++++------
examples/ip_fragmentation/Makefile | 3 +++
examples/ip_fragmentation/main.c | 10 +++++-----
examples/ip_fragmentation/meson.build | 1 +
examples/ip_reassembly/Makefile | 3 +++
examples/ip_reassembly/main.c | 10 +++++-----
examples/ip_reassembly/meson.build | 1 +
examples/ipsec-secgw/ipsec-secgw.c | 18 ++++++++----------
examples/ipv4_multicast/Makefile | 3 +++
examples/ipv4_multicast/main.c | 8 ++++----
examples/ipv4_multicast/meson.build | 1 +
examples/kni/Makefile | 3 +++
examples/kni/main.c | 14 +++++++-------
examples/kni/meson.build | 1 +
examples/l2fwd-cat/Makefile | 2 ++
examples/l2fwd-cat/l2fwd-cat.c | 7 +++----
examples/l2fwd-cat/meson.build | 1 +
examples/l2fwd-crypto/Makefile | 3 +++
examples/l2fwd-crypto/main.c | 20 +++++++++-----------
examples/l2fwd-crypto/meson.build | 1 +
examples/l2fwd-jobstats/Makefile | 4 +++-
examples/l2fwd-jobstats/main.c | 19 +++++++++----------
examples/l2fwd-jobstats/meson.build | 1 +
examples/l2fwd-keepalive/Makefile | 3 +++
examples/l2fwd-keepalive/main.c | 19 +++++++++----------
examples/l2fwd-keepalive/meson.build | 1 +
examples/l2fwd/Makefile | 3 +++
examples/l2fwd/main.c | 21 ++++++++++-----------
examples/l2fwd/meson.build | 1 +
examples/l3fwd-acl/Makefile | 3 +++
examples/l3fwd-acl/main.c | 10 +++++-----
examples/l3fwd-acl/meson.build | 1 +
examples/l3fwd-power/Makefile | 3 +++
examples/l3fwd-power/main.c | 15 +++++++--------
examples/l3fwd-power/meson.build | 1 +
examples/l3fwd-vf/Makefile | 3 +++
examples/l3fwd-vf/main.c | 7 +++----
examples/l3fwd-vf/meson.build | 1 +
examples/l3fwd/Makefile | 3 +++
examples/l3fwd/main.c | 12 ++++++------
examples/l3fwd/meson.build | 1 +
examples/multi_process/l2fwd_fork/Makefile | 1 +
examples/multi_process/l2fwd_fork/main.c | 22 ++++++++++------------
examples/multi_process/symmetric_mp/Makefile | 1 +
examples/multi_process/symmetric_mp/main.c | 4 ++--
examples/packet_ordering/Makefile | 3 +++
examples/packet_ordering/main.c | 20 ++++++++------------
examples/packet_ordering/meson.build | 1 +
examples/performance-thread/l3fwd-thread/Makefile | 1 +
examples/performance-thread/l3fwd-thread/main.c | 10 +++++-----
examples/ptpclient/Makefile | 3 +++
examples/ptpclient/meson.build | 1 +
examples/ptpclient/ptpclient.c | 2 +-
examples/rxtx_callbacks/Makefile | 3 +++
examples/rxtx_callbacks/main.c | 9 ++++-----
examples/rxtx_callbacks/meson.build | 1 +
examples/skeleton/Makefile | 3 +++
examples/skeleton/basicfwd.c | 7 +++----
examples/skeleton/meson.build | 1 +
examples/tep_termination/Makefile | 3 +++
examples/tep_termination/main.c | 2 +-
examples/tep_termination/meson.build | 1 +
examples/vhost/Makefile | 3 +++
examples/vhost/main.c | 2 +-
examples/vhost/meson.build | 1 +
examples/vm_power_manager/Makefile | 1 +
examples/vm_power_manager/channel_monitor.c | 5 ++---
examples/vm_power_manager/main.c | 8 ++++----
examples/vmdq/Makefile | 3 +++
examples/vmdq/main.c | 2 +-
examples/vmdq/meson.build | 1 +
examples/vmdq_dcb/Makefile | 3 +++
examples/vmdq_dcb/main.c | 2 +-
examples/vmdq_dcb/meson.build | 1 +
lib/librte_eventdev/rte_event_eth_rx_adapter.c | 10 +++++-----
lib/librte_latencystats/Makefile | 1 +
lib/librte_latencystats/meson.build | 1 +
lib/librte_latencystats/rte_latencystats.c | 6 ++----
test/test/test_event_eth_rx_adapter.c | 4 ++--
test/test/test_pmd_perf.c | 4 ++--
test/test/test_pmd_ring.c | 2 +-
109 files changed, 319 insertions(+), 244 deletions(-)
diff --git a/app/proc_info/main.c b/app/proc_info/main.c
index f90c14498..115df9d96 100644
--- a/app/proc_info/main.c
+++ b/app/proc_info/main.c
@@ -636,7 +636,7 @@ main(int argc, char **argv)
if (enabled_port_mask == 0)
enabled_port_mask = 0xffff;
- for (i = 0; i < nb_ports; i++) {
+ RTE_ETH_FOREACH_DEV(i) {
if (enabled_port_mask & (1 << i)) {
if (enable_stats)
nic_stats_display(i);
diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index 59fa0a49e..488cf0724 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -226,7 +226,7 @@ perf_event_rx_adapter_setup(struct evt_options *opt, uint8_t stride,
memset(&queue_conf, 0,
sizeof(struct rte_event_eth_rx_adapter_queue_conf));
queue_conf.ev.sched_type = opt->sched_type_list[0];
- for (prod = 0; prod < rte_eth_dev_count(); prod++) {
+ RTE_ETH_FOREACH_DEV(prod) {
uint32_t cap;
ret = rte_event_eth_rx_adapter_caps_get(opt->dev_id,
@@ -465,7 +465,7 @@ perf_elt_init(struct rte_mempool *mp, void *arg __rte_unused,
int
perf_ethdev_setup(struct evt_test *test, struct evt_options *opt)
{
- int i;
+ uint16_t i;
struct test_perf *t = evt_test_priv(test);
struct rte_eth_conf port_conf = {
.rxmode = {
@@ -496,7 +496,7 @@ perf_ethdev_setup(struct evt_test *test, struct evt_options *opt)
return -ENODEV;
}
- for (i = 0; i < rte_eth_dev_count(); i++) {
+ RTE_ETH_FOREACH_DEV(i) {
if (rte_eth_dev_configure(i, 1, 1,
&port_conf)
@@ -527,11 +527,11 @@ perf_ethdev_setup(struct evt_test *test, struct evt_options *opt)
void perf_ethdev_destroy(struct evt_test *test, struct evt_options *opt)
{
- int i;
+ uint16_t i;
RTE_SET_USED(test);
if (opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR) {
- for (i = 0; i < rte_eth_dev_count(); i++) {
+ RTE_ETH_FOREACH_DEV(i) {
rte_event_eth_rx_adapter_stop(i);
rte_eth_dev_stop(i);
rte_eth_dev_close(i);
diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c
index 6cad9357b..b4dbe3769 100644
--- a/app/test-eventdev/test_pipeline_common.c
+++ b/app/test-eventdev/test_pipeline_common.c
@@ -213,7 +213,7 @@ pipeline_opt_check(struct evt_options *opt, uint64_t nb_queues)
int
pipeline_ethdev_setup(struct evt_test *test, struct evt_options *opt)
{
- int i;
+ uint16_t i;
uint8_t nb_queues = 1;
uint8_t mt_state = 0;
struct test_pipeline *t = evt_test_priv(test);
@@ -239,7 +239,7 @@ pipeline_ethdev_setup(struct evt_test *test, struct evt_options *opt)
return -ENODEV;
}
- for (i = 0; i < rte_eth_dev_count(); i++) {
+ RTE_ETH_FOREACH_DEV(i) {
struct rte_eth_dev_info dev_info;
memset(&dev_info, 0, sizeof(struct rte_eth_dev_info));
@@ -337,7 +337,7 @@ pipeline_event_rx_adapter_setup(struct evt_options *opt, uint8_t stride,
memset(&queue_conf, 0,
sizeof(struct rte_event_eth_rx_adapter_queue_conf));
queue_conf.ev.sched_type = opt->sched_type_list[0];
- for (prod = 0; prod < rte_eth_dev_count(); prod++) {
+ RTE_ETH_FOREACH_DEV(prod) {
uint32_t cap;
ret = rte_event_eth_rx_adapter_caps_get(opt->dev_id,
@@ -453,7 +453,7 @@ pipeline_event_tx_service_setup(struct evt_test *test, struct evt_options *opt,
void
pipeline_ethdev_destroy(struct evt_test *test, struct evt_options *opt)
{
- int i;
+ uint16_t i;
RTE_SET_USED(test);
RTE_SET_USED(opt);
struct test_pipeline *t = evt_test_priv(test);
@@ -464,7 +464,7 @@ pipeline_ethdev_destroy(struct evt_test *test, struct evt_options *opt)
rte_service_component_unregister(t->tx_service.service_id);
}
- for (i = 0; i < rte_eth_dev_count(); i++) {
+ RTE_ETH_FOREACH_DEV(i) {
rte_event_eth_rx_adapter_stop(i);
rte_eth_dev_stop(i);
rte_eth_dev_close(i);
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 40b31ad7e..91b1ad340 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1880,7 +1880,7 @@ cmd_config_rss_parsed(void *parsed_result,
struct cmd_config_rss *res = parsed_result;
struct rte_eth_rss_conf rss_conf = { .rss_key_len = 0, };
int diag;
- uint8_t i;
+ uint16_t i;
if (!strcmp(res->value, "all"))
rss_conf.rss_hf = ETH_RSS_IP | ETH_RSS_TCP |
@@ -1914,7 +1914,7 @@ cmd_config_rss_parsed(void *parsed_result,
return;
}
rss_conf.rss_key = NULL;
- for (i = 0; i < rte_eth_dev_count(); i++) {
+ RTE_ETH_FOREACH_DEV(i) {
diag = rte_eth_dev_rss_hash_update(i, &rss_conf);
if (diag < 0)
printf("Configuration of RSS hash at ethernet port %d "
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 4c0e2586c..0708c32cb 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1110,9 +1110,8 @@ run_pkt_fwd_on_lcore(struct fwd_lcore *fc, packet_fwd_t pkt_fwd)
uint64_t tics_per_1sec;
uint64_t tics_datum;
uint64_t tics_current;
- uint8_t idx_port, cnt_ports;
+ uint16_t idx_port;
- cnt_ports = rte_eth_dev_count();
tics_datum = rte_rdtsc();
tics_per_1sec = rte_get_timer_hz();
#endif
@@ -1127,9 +1126,7 @@ run_pkt_fwd_on_lcore(struct fwd_lcore *fc, packet_fwd_t pkt_fwd)
tics_current = rte_rdtsc();
if (tics_current - tics_datum >= tics_per_1sec) {
/* Periodic bitrate calculation */
- for (idx_port = 0;
- idx_port < cnt_ports;
- idx_port++)
+ RTE_ETH_FOREACH_DEV(idx_port)
rte_stats_bitrate_calc(bitrate_data,
idx_port);
tics_datum = tics_current;
diff --git a/doc/guides/sample_app_ug/flow_classify.rst b/doc/guides/sample_app_ug/flow_classify.rst
index 524747741..a0095962c 100644
--- a/doc/guides/sample_app_ug/flow_classify.rst
+++ b/doc/guides/sample_app_ug/flow_classify.rst
@@ -187,7 +187,7 @@ The ``main()`` function also initializes all the ports using the user defined
.. code-block:: c
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if (port_init(portid, mbuf_pool) != 0) {
rte_exit(EXIT_FAILURE,
"Cannot init port %" PRIu8 "\n", portid);
@@ -424,14 +424,13 @@ following:
static __attribute__((noreturn)) void
lcore_main(cls_app)
{
- const uint8_t nb_ports = rte_eth_dev_count();
- uint8_t port;
+ uint16_t port;
/*
* Check that the port is on the same NUMA node as the polling thread
* for best performance.
*/
- for (port = 0; port < nb_ports; port++)
+ RTE_ETH_FOREACH_DEV(port)
if (rte_eth_dev_socket_id(port) > 0 &&
rte_eth_dev_socket_id(port) != (int)rte_socket_id()) {
printf("\n\n");
@@ -451,7 +450,7 @@ following:
* Receive packets on a port and forward them on the paired
* port. The mapping is 0 -> 1, 1 -> 0, 2 -> 3, 3 -> 2, etc.
*/
- for (port = 0; port < nb_ports; port++) {
+ RTE_ETH_FOREACH_DEV(port) {
/* Get burst of RX packets, from first port of pair. */
struct rte_mbuf *bufs[BURST_SIZE];
@@ -501,7 +500,7 @@ The main work of the application is done within the loop:
.. code-block:: c
for (;;) {
- for (port = 0; port < nb_ports; port++) {
+ RTE_ETH_FOREACH_DEV(port) {
/* Get burst of RX packets, from first port of pair. */
struct rte_mbuf *bufs[BURST_SIZE];
diff --git a/doc/guides/sample_app_ug/l2_forward_job_stats.rst b/doc/guides/sample_app_ug/l2_forward_job_stats.rst
index bfdf9c8f2..f14a780ae 100644
--- a/doc/guides/sample_app_ug/l2_forward_job_stats.rst
+++ b/doc/guides/sample_app_ug/l2_forward_job_stats.rst
@@ -193,7 +193,7 @@ in the *DPDK Programmer's Guide* and the *DPDK API Reference*.
/*
* Each logical core is assigned a dedicated TX queue on each port.
*/
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
/* skip ports that are not enabled */
if ((l2fwd_enabled_port_mask & (1 << portid)) == 0)
continue;
diff --git a/doc/guides/sample_app_ug/l2_forward_real_virtual.rst b/doc/guides/sample_app_ug/l2_forward_real_virtual.rst
index f02be05ce..c91f57380 100644
--- a/doc/guides/sample_app_ug/l2_forward_real_virtual.rst
+++ b/doc/guides/sample_app_ug/l2_forward_real_virtual.rst
@@ -213,7 +213,7 @@ in the *DPDK Programmer's Guide* - Rel 1.4 EAR and the *DPDK API Reference*.
* Each logical core is assigned a dedicated TX queue on each port.
*/
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
/* skip ports that are not enabled */
if ((l2fwd_enabled_port_mask & (1 << portid)) == 0)
diff --git a/doc/guides/sample_app_ug/link_status_intr.rst b/doc/guides/sample_app_ug/link_status_intr.rst
index 8fa6d76ce..57673456b 100644
--- a/doc/guides/sample_app_ug/link_status_intr.rst
+++ b/doc/guides/sample_app_ug/link_status_intr.rst
@@ -99,7 +99,7 @@ To fully understand this code, it is recommended to study the chapters that rela
* Each logical core is assigned a dedicated TX queue on each port.
*/
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
/* skip ports that are not enabled */
if ((lsi_enabled_port_mask & (1 << portid)) == 0)
diff --git a/doc/guides/sample_app_ug/skeleton.rst b/doc/guides/sample_app_ug/skeleton.rst
index 0503584de..d3a3712f4 100644
--- a/doc/guides/sample_app_ug/skeleton.rst
+++ b/doc/guides/sample_app_ug/skeleton.rst
@@ -81,7 +81,7 @@ The ``main()`` function also initializes all the ports using the user defined
.. code-block:: c
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if (port_init(portid, mbuf_pool) != 0) {
rte_exit(EXIT_FAILURE,
"Cannot init port %" PRIu8 "\n", portid);
@@ -199,7 +199,7 @@ looks like the following:
* Check that the port is on the same NUMA node as the polling thread
* for best performance.
*/
- for (port = 0; port < nb_ports; port++)
+ RTE_ETH_FOREACH_DEV(port)
if (rte_eth_dev_socket_id(port) > 0 &&
rte_eth_dev_socket_id(port) !=
(int)rte_socket_id())
@@ -216,7 +216,7 @@ looks like the following:
* Receive packets on a port and forward them on the paired
* port. The mapping is 0 -> 1, 1 -> 0, 2 -> 3, 3 -> 2, etc.
*/
- for (port = 0; port < nb_ports; port++) {
+ RTE_ETH_FOREACH_DEV(port) {
/* Get burst of RX packets, from first port of pair. */
struct rte_mbuf *bufs[BURST_SIZE];
@@ -246,7 +246,7 @@ The main work of the application is done within the loop:
.. code-block:: c
for (;;) {
- for (port = 0; port < nb_ports; port++) {
+ RTE_ETH_FOREACH_DEV(port) {
/* Get burst of RX packets, from first port of pair. */
struct rte_mbuf *bufs[BURST_SIZE];
diff --git a/drivers/net/bonding/Makefile b/drivers/net/bonding/Makefile
index 4a6633ede..44353a1f8 100644
--- a/drivers/net/bonding/Makefile
+++ b/drivers/net/bonding/Makefile
@@ -8,6 +8,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
#
LIB = librte_pmd_bond.a
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
diff --git a/drivers/net/bonding/meson.build b/drivers/net/bonding/meson.build
index 44d5fd8e7..98fdd37af 100644
--- a/drivers/net/bonding/meson.build
+++ b/drivers/net/bonding/meson.build
@@ -9,4 +9,6 @@ sources = files('rte_eth_bond_api.c', 'rte_eth_bond_pmd.c',
deps += 'sched' # needed for rte_bitmap.h
deps += ['ip_frag', 'cmdline']
+allow_experimental_apis = true
+
install_headers('rte_eth_bond.h', 'rte_eth_bond_8023ad.h')
diff --git a/drivers/net/bonding/rte_eth_bond_args.c b/drivers/net/bonding/rte_eth_bond_args.c
index e99681e2d..eb205c8bb 100644
--- a/drivers/net/bonding/rte_eth_bond_args.c
+++ b/drivers/net/bonding/rte_eth_bond_args.c
@@ -32,7 +32,7 @@ find_port_id_by_pci_addr(const struct rte_pci_addr *pci_addr)
struct rte_pci_addr *eth_pci_addr;
unsigned i;
- for (i = 0; i < rte_eth_dev_count(); i++) {
+ RTE_ETH_FOREACH_DEV(i) {
pci_dev = RTE_ETH_DEV_TO_PCI(&rte_eth_devices[i]);
eth_pci_addr = &pci_dev->addr;
@@ -50,7 +50,7 @@ find_port_id_by_dev_name(const char *name)
{
unsigned i;
- for (i = 0; i < rte_eth_dev_count(); i++) {
+ RTE_ETH_FOREACH_DEV(i) {
if (rte_eth_devices[i].data == NULL)
continue;
diff --git a/drivers/net/mrvl/mrvl_ethdev.c b/drivers/net/mrvl/mrvl_ethdev.c
index 0fd4585f5..4226f83a4 100644
--- a/drivers/net/mrvl/mrvl_ethdev.c
+++ b/drivers/net/mrvl/mrvl_ethdev.c
@@ -2485,7 +2485,7 @@ rte_pmd_mrvl_remove(struct rte_vdev_device *vdev)
RTE_LOG(INFO, PMD, "Removing %s\n", name);
- for (i = 0; i < rte_eth_dev_count(); i++) {
+ RTE_ETH_FOREACH_DEV(i) { /* FIXME: removing all devices! */
char ifname[RTE_ETH_NAME_MAX_LEN];
rte_eth_dev_get_name_by_port(i, ifname);
diff --git a/examples/bond/Makefile b/examples/bond/Makefile
index 44d10d4f5..e7afce358 100644
--- a/examples/bond/Makefile
+++ b/examples/bond/Makefile
@@ -25,6 +25,8 @@ CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+
build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
@@ -58,6 +60,7 @@ ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
CFLAGS_main.o += -Wno-return-type
endif
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
diff --git a/examples/bond/main.c b/examples/bond/main.c
index 455f108ee..d68162f1d 100644
--- a/examples/bond/main.c
+++ b/examples/bond/main.c
@@ -738,7 +738,7 @@ int
main(int argc, char *argv[])
{
int ret;
- uint8_t nb_ports, i;
+ uint16_t nb_ports, i;
/* init EAL */
ret = rte_eal_init(argc, argv);
@@ -761,7 +761,7 @@ main(int argc, char *argv[])
/* initialize all ports */
slaves_count = nb_ports;
- for (i = 0; i < nb_ports; i++) {
+ RTE_ETH_FOREACH_DEV(i) {
slave_port_init(i, mbuf_pool);
slaves[i] = i;
}
diff --git a/examples/bond/meson.build b/examples/bond/meson.build
index 8f65e4a8d..82e355a49 100644
--- a/examples/bond/meson.build
+++ b/examples/bond/meson.build
@@ -7,6 +7,7 @@
# DPDK instance, use 'make'
deps += 'pmd_bond'
+allow_experimental_apis = true
sources = files(
'main.c'
)
diff --git a/examples/distributor/Makefile b/examples/distributor/Makefile
index 05ea0bfec..cb1bd216d 100644
--- a/examples/distributor/Makefile
+++ b/examples/distributor/Makefile
@@ -23,6 +23,8 @@ CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+
build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
@@ -48,6 +50,7 @@ RTE_TARGET ?= x86_64-native-linuxapp-gcc
include $(RTE_SDK)/mk/rte.vars.mk
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += $(WERROR_FLAGS)
# workaround for a gcc bug with noreturn attribute
diff --git a/examples/distributor/main.c b/examples/distributor/main.c
index c49d680bd..62831a05c 100644
--- a/examples/distributor/main.c
+++ b/examples/distributor/main.c
@@ -198,7 +198,7 @@ lcore_rx(struct lcore_params *p)
uint16_t port;
struct rte_mbuf *bufs[BURST_SIZE*2];
- for (port = 0; port < nb_ports; port++) {
+ RTE_ETH_FOREACH_DEV(port) {
/* skip ports that are not enabled */
if ((enabled_port_mask & (1 << port)) == 0)
continue;
@@ -295,11 +295,11 @@ flush_one_port(struct output_buffer *outbuf, uint8_t outp)
}
static inline void
-flush_all_ports(struct output_buffer *tx_buffers, uint16_t nb_ports)
+flush_all_ports(struct output_buffer *tx_buffers)
{
uint16_t outp;
- for (outp = 0; outp < nb_ports; outp++) {
+ RTE_ETH_FOREACH_DEV(outp) {
/* skip ports that are not enabled */
if ((enabled_port_mask & (1 << outp)) == 0)
continue;
@@ -367,11 +367,10 @@ static int
lcore_tx(struct rte_ring *in_r)
{
static struct output_buffer tx_buffers[RTE_MAX_ETHPORTS];
- const uint16_t nb_ports = rte_eth_dev_count();
const int socket_id = rte_socket_id();
uint16_t port;
- for (port = 0; port < nb_ports; port++) {
+ RTE_ETH_FOREACH_DEV(port) {
/* skip ports that are not enabled */
if ((enabled_port_mask & (1 << port)) == 0)
continue;
@@ -386,7 +385,7 @@ lcore_tx(struct rte_ring *in_r)
printf("\nCore %u doing packet TX.\n", rte_lcore_id());
while (!quit_signal) {
- for (port = 0; port < nb_ports; port++) {
+ RTE_ETH_FOREACH_DEV(port) {
/* skip ports that are not enabled */
if ((enabled_port_mask & (1 << port)) == 0)
continue;
@@ -398,7 +397,7 @@ lcore_tx(struct rte_ring *in_r)
/* if we get no traffic, flush anything we have */
if (unlikely(nb_rx == 0)) {
- flush_all_ports(tx_buffers, nb_ports);
+ flush_all_ports(tx_buffers);
continue;
}
@@ -446,14 +445,14 @@ print_stats(void)
unsigned int i, j;
const unsigned int num_workers = rte_lcore_count() - 4;
- for (i = 0; i < rte_eth_dev_count(); i++) {
+ RTE_ETH_FOREACH_DEV(i) {
rte_eth_stats_get(i, ð_stats);
app_stats.port_rx_pkts[i] = eth_stats.ipackets;
app_stats.port_tx_pkts[i] = eth_stats.opackets;
}
printf("\n\nRX Thread:\n");
- for (i = 0; i < rte_eth_dev_count(); i++) {
+ RTE_ETH_FOREACH_DEV(i) {
printf("Port %u Pktsin : %5.2f\n", i,
(app_stats.port_rx_pkts[i] -
prev_app_stats.port_rx_pkts[i])/1000000.0);
@@ -492,7 +491,7 @@ print_stats(void)
printf(" - Dequeued: %5.2f\n",
(app_stats.tx.dequeue_pkts -
prev_app_stats.tx.dequeue_pkts)/1000000.0);
- for (i = 0; i < rte_eth_dev_count(); i++) {
+ RTE_ETH_FOREACH_DEV(i) {
printf("Port %u Pktsout: %5.2f\n",
i, (app_stats.port_tx_pkts[i] -
prev_app_stats.port_tx_pkts[i])/1000000.0);
@@ -694,7 +693,7 @@ main(int argc, char *argv[])
nb_ports_available = nb_ports;
/* initialize all ports */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
/* skip ports that are not enabled */
if ((enabled_port_mask & (1 << portid)) == 0) {
printf("\nSkipping disabled port %d\n", portid);
diff --git a/examples/distributor/meson.build b/examples/distributor/meson.build
index 88c001f56..d036ea0f6 100644
--- a/examples/distributor/meson.build
+++ b/examples/distributor/meson.build
@@ -7,6 +7,7 @@
# DPDK instance, use 'make'
deps += 'distributor'
+allow_experimental_apis = true
sources = files(
'main.c'
)
diff --git a/examples/ethtool/ethtool-app/Makefile b/examples/ethtool/ethtool-app/Makefile
index 4cd9efdd5..1d400f19b 100644
--- a/examples/ethtool/ethtool-app/Makefile
+++ b/examples/ethtool/ethtool-app/Makefile
@@ -16,6 +16,7 @@ APP = ethtool
# all source are stored in SRCS-y
SRCS-y := main.c ethapp.c
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3 -D_GNU_SOURCE -pthread -I$(SRCDIR)/../lib
CFLAGS += $(WERROR_FLAGS)
diff --git a/examples/ethtool/ethtool-app/ethapp.c b/examples/ethtool/ethtool-app/ethapp.c
index 0c3f1f6e1..4d62f4c17 100644
--- a/examples/ethtool/ethtool-app/ethapp.c
+++ b/examples/ethtool/ethtool-app/ethapp.c
@@ -145,9 +145,9 @@ pcmd_drvinfo_callback(__rte_unused void *ptr_params,
__rte_unused void *ptr_data)
{
struct ethtool_drvinfo info;
- int id_port;
+ uint16_t id_port;
- for (id_port = 0; id_port < rte_eth_dev_count(); id_port++) {
+ RTE_ETH_FOREACH_DEV(id_port) {
memset(&info, 0, sizeof(info));
if (rte_ethtool_get_drvinfo(id_port, &info)) {
printf("Error getting info for port %i\n", id_port);
@@ -167,10 +167,10 @@ pcmd_link_callback(__rte_unused void *ptr_params,
__rte_unused struct cmdline *ctx,
__rte_unused void *ptr_data)
{
- int num_ports = rte_eth_dev_count();
- int id_port, stat_port;
+ uint16_t id_port;
+ int stat_port;
- for (id_port = 0; id_port < num_ports; id_port++) {
+ RTE_ETH_FOREACH_DEV(id_port) {
if (!rte_eth_dev_is_valid_port(id_port))
continue;
stat_port = rte_ethtool_get_link(id_port);
diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index 2422c1849..bbab99597 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -339,10 +339,9 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
}
static int
-init_ports(unsigned int num_ports)
+init_ports(uint16_t num_ports)
{
- uint8_t portid;
- unsigned int i;
+ uint16_t portid, i;
if (!cdata.num_mbuf)
cdata.num_mbuf = 16384 * num_ports;
@@ -354,12 +353,12 @@ init_ports(unsigned int num_ports)
/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
rte_socket_id());
- for (portid = 0; portid < num_ports; portid++)
+ RTE_ETH_FOREACH_DEV(portid)
if (port_init(portid, mp) != 0)
- rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu8 "\n",
+ rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
portid);
- for (i = 0; i < num_ports; i++) {
+ RTE_ETH_FOREACH_DEV(i) {
void *userdata = (void *)(uintptr_t) i;
fdata->tx_buf[i] =
rte_malloc(NULL, RTE_ETH_TX_BUFFER_SIZE(32), 0);
@@ -375,13 +374,13 @@ init_ports(unsigned int num_ports)
}
static void
-do_capability_setup(uint16_t nb_ethdev, uint8_t eventdev_id)
+do_capability_setup(uint8_t eventdev_id)
{
- int i;
+ uint16_t i;
uint8_t mt_unsafe = 0;
uint8_t burst = 0;
- for (i = 0; i < nb_ethdev; i++) {
+ RTE_ETH_FOREACH_DEV(i) {
struct rte_eth_dev_info dev_info;
memset(&dev_info, 0, sizeof(struct rte_eth_dev_info));
@@ -483,7 +482,7 @@ main(int argc, char **argv)
fprintf(stderr, "Warning: More than one eventdev, using idx 0");
- do_capability_setup(num_ports, 0);
+ do_capability_setup(0);
fdata->cap.check_opt();
worker_data = rte_calloc(0, cdata.num_workers,
diff --git a/examples/eventdev_pipeline/pipeline_worker_generic.c b/examples/eventdev_pipeline/pipeline_worker_generic.c
index c673160f5..2215e9ebe 100644
--- a/examples/eventdev_pipeline/pipeline_worker_generic.c
+++ b/examples/eventdev_pipeline/pipeline_worker_generic.c
@@ -138,7 +138,7 @@ consumer(void)
&packet, 1, 0);
if (n == 0) {
- for (i = 0; i < rte_eth_dev_count(); i++)
+ RTE_ETH_FOREACH_DEV(i)
rte_eth_tx_buffer_flush(i, 0, fdata->tx_buf[i]);
return 0;
}
@@ -196,14 +196,13 @@ consumer_burst(void)
unsigned int i, j;
uint8_t dev_id = cons_data.dev_id;
uint8_t port_id = cons_data.port_id;
- uint16_t nb_ports = rte_eth_dev_count();
do {
uint16_t n = rte_event_dequeue_burst(dev_id, port_id,
packets, RTE_DIM(packets), 0);
if (n == 0) {
- for (j = 0; j < nb_ports; j++)
+ RTE_ETH_FOREACH_DEV(j)
rte_eth_tx_buffer_flush(j, 0, fdata->tx_buf[j]);
return 0;
}
@@ -521,7 +520,7 @@ generic_opt_check(void)
rte_exit(EXIT_FAILURE,
"Event dev doesn't support all type queues\n");
- for (i = 0; i < rte_eth_dev_count(); i++) {
+ RTE_ETH_FOREACH_DEV(i) {
ret = rte_event_eth_rx_adapter_caps_get(0, i, &cap);
if (ret)
rte_exit(EXIT_FAILURE,
diff --git a/examples/eventdev_pipeline/pipeline_worker_tx.c b/examples/eventdev_pipeline/pipeline_worker_tx.c
index b254b03f7..fc98128ec 100644
--- a/examples/eventdev_pipeline/pipeline_worker_tx.c
+++ b/examples/eventdev_pipeline/pipeline_worker_tx.c
@@ -735,7 +735,7 @@ worker_tx_opt_check(void)
rte_exit(EXIT_FAILURE,
"Event dev doesn't support all type queues\n");
- for (i = 0; i < rte_eth_dev_count(); i++) {
+ RTE_ETH_FOREACH_DEV(i) {
ret = rte_event_eth_rx_adapter_caps_get(0, i, &cap);
if (ret)
rte_exit(EXIT_FAILURE,
diff --git a/examples/exception_path/Makefile b/examples/exception_path/Makefile
index ae74781ec..88f709eff 100644
--- a/examples/exception_path/Makefile
+++ b/examples/exception_path/Makefile
@@ -23,6 +23,8 @@ CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+
build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
@@ -48,6 +50,7 @@ RTE_TARGET ?= x86_64-native-linuxapp-gcc
include $(RTE_SDK)/mk/rte.vars.mk
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c
index dda391cd5..996f4939d 100644
--- a/examples/exception_path/main.c
+++ b/examples/exception_path/main.c
@@ -475,7 +475,7 @@ init_port(uint16_t port)
/* Check the link status of all ports in up to 9s, and print them finally */
static void
-check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
+check_all_ports_link_status(uint32_t port_mask)
{
#define CHECK_INTERVAL 100 /* 100ms */
#define MAX_CHECK_TIME 90 /* 9s (90 * 100ms) in total */
@@ -487,7 +487,7 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
fflush(stdout);
for (count = 0; count <= MAX_CHECK_TIME; count++) {
all_ports_up = 1;
- for (portid = 0; portid < port_num; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if ((port_mask & (1 << portid)) == 0)
continue;
memset(&link, 0, sizeof(link));
@@ -571,14 +571,14 @@ main(int argc, char** argv)
FATAL_ERROR("Port mask requires more ports than available");
/* Initialise each port */
- for (port = 0; port < nb_sys_ports; port++) {
+ RTE_ETH_FOREACH_DEV(port) {
/* Skip ports that are not enabled */
if ((ports_mask & (1 << port)) == 0) {
continue;
}
init_port(port);
}
- check_all_ports_link_status(nb_sys_ports, ports_mask);
+ check_all_ports_link_status(ports_mask);
/* Launch per-lcore function on every lcore */
rte_eal_mp_remote_launch(main_loop, NULL, CALL_MASTER);
diff --git a/examples/exception_path/meson.build b/examples/exception_path/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/exception_path/meson.build
+++ b/examples/exception_path/meson.build
@@ -6,6 +6,7 @@
# To build this example as a standalone application with an already-installed
# DPDK instance, use 'make'
+allow_experimental_apis = true
sources = files(
'main.c'
)
diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c
index 32d9b1d30..a65ef20f9 100644
--- a/examples/flow_classify/flow_classify.c
+++ b/examples/flow_classify/flow_classify.c
@@ -259,8 +259,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
static __attribute__((noreturn)) void
lcore_main(struct flow_classifier *cls_app)
{
- const uint8_t nb_ports = rte_eth_dev_count();
- uint8_t port;
+ uint16_t port;
int ret;
int i = 0;
@@ -275,7 +274,7 @@ lcore_main(struct flow_classifier *cls_app)
* Check that the port is on the same NUMA node as the polling thread
* for best performance.
*/
- for (port = 0; port < nb_ports; port++)
+ RTE_ETH_FOREACH_DEV(port)
if (rte_eth_dev_socket_id(port) > 0 &&
rte_eth_dev_socket_id(port) != (int)rte_socket_id()) {
printf("\n\n");
@@ -294,7 +293,7 @@ lcore_main(struct flow_classifier *cls_app)
* on the paired port.
* The mapping is 0 -> 1, 1 -> 0, 2 -> 3, 3 -> 2, etc.
*/
- for (port = 0; port < nb_ports; port++) {
+ RTE_ETH_FOREACH_DEV(port) {
/* Get burst of RX packets, from first port of pair. */
struct rte_mbuf *bufs[BURST_SIZE];
const uint16_t nb_rx = rte_eth_rx_burst(port, 0,
@@ -754,7 +753,7 @@ main(int argc, char *argv[])
{
struct rte_mempool *mbuf_pool;
uint8_t nb_ports;
- uint8_t portid;
+ uint16_t portid;
int ret;
int socket_id;
struct rte_table_acl_params table_acl_params;
@@ -789,7 +788,7 @@ main(int argc, char *argv[])
rte_exit(EXIT_FAILURE, "Cannot create mbuf pool\n");
/* Initialize all ports. */
- for (portid = 0; portid < nb_ports; portid++)
+ RTE_ETH_FOREACH_DEV(portid)
if (port_init(portid, mbuf_pool) != 0)
rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu8 "\n",
portid);
diff --git a/examples/ip_fragmentation/Makefile b/examples/ip_fragmentation/Makefile
index 9e89e744c..3b58ced54 100644
--- a/examples/ip_fragmentation/Makefile
+++ b/examples/ip_fragmentation/Makefile
@@ -24,6 +24,8 @@ CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+
build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
@@ -49,6 +51,7 @@ RTE_TARGET ?= x86_64-native-linuxapp-gcc
include $(RTE_SDK)/mk/rte.vars.mk
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index d3b1da6c0..f525c3a9c 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -571,7 +571,7 @@ print_ethaddr(const char *name, struct ether_addr *eth_addr)
/* Check the link status of all ports in up to 9s, and print them finally */
static void
-check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
+check_all_ports_link_status(uint32_t port_mask)
{
#define CHECK_INTERVAL 100 /* 100ms */
#define MAX_CHECK_TIME 90 /* 9s (90 * 100ms) in total */
@@ -583,7 +583,7 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
fflush(stdout);
for (count = 0; count <= MAX_CHECK_TIME; count++) {
all_ports_up = 1;
- for (portid = 0; portid < port_num; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if ((port_mask & (1 << portid)) == 0)
continue;
memset(&link, 0, sizeof(link));
@@ -876,7 +876,7 @@ main(int argc, char **argv)
rte_exit(EXIT_FAILURE, "Non-existent ports in portmask!\n");
/* initialize all ports */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
struct rte_eth_conf local_port_conf = port_conf;
struct rte_eth_rxconf rxq_conf;
@@ -994,7 +994,7 @@ main(int argc, char **argv)
printf("\n");
/* start ports */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if ((enabled_port_mask & (1 << portid)) == 0) {
continue;
}
@@ -1016,7 +1016,7 @@ main(int argc, char **argv)
if (init_routing_table() < 0)
rte_exit(EXIT_FAILURE, "Cannot init routing table\n");
- check_all_ports_link_status(nb_ports, enabled_port_mask);
+ check_all_ports_link_status(enabled_port_mask);
/* launch per-lcore init on every lcore */
rte_eal_mp_remote_launch(main_loop, NULL, CALL_MASTER);
diff --git a/examples/ip_fragmentation/meson.build b/examples/ip_fragmentation/meson.build
index 304203eed..9782a6a7b 100644
--- a/examples/ip_fragmentation/meson.build
+++ b/examples/ip_fragmentation/meson.build
@@ -7,6 +7,7 @@
# DPDK instance, use 'make'
deps += ['ip_frag', 'lpm']
+allow_experimental_apis = true
sources = files(
'main.c'
)
diff --git a/examples/ip_reassembly/Makefile b/examples/ip_reassembly/Makefile
index 1e81315f2..6438d977e 100644
--- a/examples/ip_reassembly/Makefile
+++ b/examples/ip_reassembly/Makefile
@@ -24,6 +24,8 @@ CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+
build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
@@ -49,6 +51,7 @@ RTE_TARGET ?= x86_64-native-linuxapp-gcc
include $(RTE_SDK)/mk/rte.vars.mk
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index 350a9739c..ddff35880 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -702,7 +702,7 @@ print_ethaddr(const char *name, const struct ether_addr *eth_addr)
/* Check the link status of all ports in up to 9s, and print them finally */
static void
-check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
+check_all_ports_link_status(uint32_t port_mask)
{
#define CHECK_INTERVAL 100 /* 100ms */
#define MAX_CHECK_TIME 90 /* 9s (90 * 100ms) in total */
@@ -714,7 +714,7 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
fflush(stdout);
for (count = 0; count <= MAX_CHECK_TIME; count++) {
all_ports_up = 1;
- for (portid = 0; portid < port_num; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if ((port_mask & (1 << portid)) == 0)
continue;
memset(&link, 0, sizeof(link));
@@ -1023,7 +1023,7 @@ main(int argc, char **argv)
rte_exit(EXIT_FAILURE, "Non-existent ports in portmask!\n");
/* initialize all ports */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
struct rte_eth_rxconf rxq_conf;
struct rte_eth_conf local_port_conf = port_conf;
@@ -1141,7 +1141,7 @@ main(int argc, char **argv)
printf("\n");
/* start ports */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if ((enabled_port_mask & (1 << portid)) == 0) {
continue;
}
@@ -1157,7 +1157,7 @@ main(int argc, char **argv)
if (init_routing_table() < 0)
rte_exit(EXIT_FAILURE, "Cannot init routing table\n");
- check_all_ports_link_status(nb_ports, enabled_port_mask);
+ check_all_ports_link_status(enabled_port_mask);
signal(SIGUSR1, signal_handler);
signal(SIGTERM, signal_handler);
diff --git a/examples/ip_reassembly/meson.build b/examples/ip_reassembly/meson.build
index 8ebd48291..8a667c265 100644
--- a/examples/ip_reassembly/meson.build
+++ b/examples/ip_reassembly/meson.build
@@ -7,6 +7,7 @@
# DPDK instance, use 'make'
deps += ['lpm', 'ip_frag']
+allow_experimental_apis = true
sources = files(
'main.c'
)
diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 3a8562ee9..3001d626b 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -1173,7 +1173,7 @@ print_ethaddr(const char *name, const struct ether_addr *eth_addr)
/* Check the link status of all ports in up to 9s, and print them finally */
static void
-check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
+check_all_ports_link_status(uint32_t port_mask)
{
#define CHECK_INTERVAL 100 /* 100ms */
#define MAX_CHECK_TIME 90 /* 9s (90 * 100ms) in total */
@@ -1185,7 +1185,7 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
fflush(stdout);
for (count = 0; count <= MAX_CHECK_TIME; count++) {
all_ports_up = 1;
- for (portid = 0; portid < port_num; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if ((port_mask & (1 << portid)) == 0)
continue;
memset(&link, 0, sizeof(link));
@@ -1383,7 +1383,7 @@ cryptodevs_init(void)
if (sess_sz > max_sess_sz)
max_sess_sz = sess_sz;
}
- for (port_id = 0; port_id < rte_eth_dev_count(); port_id++) {
+ RTE_ETH_FOREACH_DEV(port_id) {
void *sec_ctx;
if ((enabled_port_mask & (1 << port_id)) == 0)
@@ -1470,7 +1470,7 @@ cryptodevs_init(void)
}
/* create session pools for eth devices that implement security */
- for (port_id = 0; port_id < rte_eth_dev_count(); port_id++) {
+ RTE_ETH_FOREACH_DEV(port_id) {
if ((enabled_port_mask & (1 << port_id)) &&
rte_eth_dev_get_sec_ctx(port_id)) {
int socket_id = rte_eth_dev_socket_id(port_id);
@@ -1646,7 +1646,7 @@ main(int32_t argc, char **argv)
int32_t ret;
uint32_t lcore_id;
uint8_t socket_id;
- uint16_t portid, nb_ports;
+ uint16_t portid;
/* init EAL */
ret = rte_eal_init(argc, argv);
@@ -1665,8 +1665,6 @@ main(int32_t argc, char **argv)
rte_exit(EXIT_FAILURE, "Invalid unprotected portmask 0x%x\n",
unprotected_port_mask);
- nb_ports = rte_eth_dev_count();
-
if (check_params() < 0)
rte_exit(EXIT_FAILURE, "check_params failed\n");
@@ -1700,7 +1698,7 @@ main(int32_t argc, char **argv)
pool_init(&socket_ctx[socket_id], socket_id, NB_MBUF);
}
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if ((enabled_port_mask & (1 << portid)) == 0)
continue;
@@ -1710,7 +1708,7 @@ main(int32_t argc, char **argv)
cryptodevs_init();
/* start ports */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if ((enabled_port_mask & (1 << portid)) == 0)
continue;
@@ -1729,7 +1727,7 @@ main(int32_t argc, char **argv)
rte_eth_promiscuous_enable(portid);
}
- check_all_ports_link_status(nb_ports, enabled_port_mask);
+ check_all_ports_link_status(enabled_port_mask);
/* launch per-lcore init on every lcore */
rte_eal_mp_remote_launch(main_loop, NULL, CALL_MASTER);
diff --git a/examples/ipv4_multicast/Makefile b/examples/ipv4_multicast/Makefile
index a16c62333..236e706b3 100644
--- a/examples/ipv4_multicast/Makefile
+++ b/examples/ipv4_multicast/Makefile
@@ -24,6 +24,8 @@ CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+
build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
@@ -49,6 +51,7 @@ RTE_TARGET ?= x86_64-native-linuxapp-gcc
include $(RTE_SDK)/mk/rte.vars.mk
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index c3bcf2c80..23b266bbe 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -578,7 +578,7 @@ init_mcast_hash(void)
/* Check the link status of all ports in up to 9s, and print them finally */
static void
-check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
+check_all_ports_link_status(uint32_t port_mask)
{
#define CHECK_INTERVAL 100 /* 100ms */
#define MAX_CHECK_TIME 90 /* 9s (90 * 100ms) in total */
@@ -590,7 +590,7 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
fflush(stdout);
for (count = 0; count <= MAX_CHECK_TIME; count++) {
all_ports_up = 1;
- for (portid = 0; portid < port_num; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if ((port_mask & (1 << portid)) == 0)
continue;
memset(&link, 0, sizeof(link));
@@ -683,7 +683,7 @@ main(int argc, char **argv)
nb_lcores = rte_lcore_count();
/* initialize all ports */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
struct rte_eth_rxconf rxq_conf;
struct rte_eth_conf local_port_conf = port_conf;
@@ -786,7 +786,7 @@ main(int argc, char **argv)
printf("done:\n");
}
- check_all_ports_link_status(nb_ports, enabled_port_mask);
+ check_all_ports_link_status(enabled_port_mask);
/* initialize the multicast hash */
int retval = init_mcast_hash();
diff --git a/examples/ipv4_multicast/meson.build b/examples/ipv4_multicast/meson.build
index d9e4c7c21..6969e2c54 100644
--- a/examples/ipv4_multicast/meson.build
+++ b/examples/ipv4_multicast/meson.build
@@ -7,6 +7,7 @@
# DPDK instance, use 'make'
deps += 'hash'
+allow_experimental_apis = true
sources = files(
'main.c'
)
diff --git a/examples/kni/Makefile b/examples/kni/Makefile
index 562dc2741..96ae2fc6f 100644
--- a/examples/kni/Makefile
+++ b/examples/kni/Makefile
@@ -23,6 +23,8 @@ CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+
build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
@@ -53,6 +55,7 @@ $(error This application can only operate in a linuxapp environment, \
please change the definition of the RTE_TARGET environment variable)
endif
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
diff --git a/examples/kni/main.c b/examples/kni/main.c
index 0d9980ee1..f069788ce 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -275,7 +275,7 @@ kni_egress(struct kni_port_params *p)
static int
main_loop(__rte_unused void *arg)
{
- uint8_t i, nb_ports = rte_eth_dev_count();
+ uint16_t i;
int32_t f_stop;
const unsigned lcore_id = rte_lcore_id();
enum lcore_rxtx {
@@ -286,7 +286,7 @@ main_loop(__rte_unused void *arg)
};
enum lcore_rxtx flag = LCORE_NONE;
- for (i = 0; i < nb_ports; i++) {
+ RTE_ETH_FOREACH_DEV(i) {
if (!kni_port_params_array[i])
continue;
if (kni_port_params_array[i]->lcore_rx == (uint8_t)lcore_id) {
@@ -626,7 +626,7 @@ init_port(uint16_t port)
/* Check the link status of all ports in up to 9s, and print them finally */
static void
-check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
+check_all_ports_link_status(uint32_t port_mask)
{
#define CHECK_INTERVAL 100 /* 100ms */
#define MAX_CHECK_TIME 90 /* 9s (90 * 100ms) in total */
@@ -638,7 +638,7 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
fflush(stdout);
for (count = 0; count <= MAX_CHECK_TIME; count++) {
all_ports_up = 1;
- for (portid = 0; portid < port_num; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if ((port_mask & (1 << portid)) == 0)
continue;
memset(&link, 0, sizeof(link));
@@ -935,7 +935,7 @@ main(int argc, char** argv)
init_kni();
/* Initialise each port */
- for (port = 0; port < nb_sys_ports; port++) {
+ RTE_ETH_FOREACH_DEV(port) {
/* Skip ports that are not enabled */
if (!(ports_mask & (1 << port)))
continue;
@@ -947,7 +947,7 @@ main(int argc, char** argv)
kni_alloc(port);
}
- check_all_ports_link_status(nb_sys_ports, ports_mask);
+ check_all_ports_link_status(ports_mask);
/* Launch per-lcore function on every lcore */
rte_eal_mp_remote_launch(main_loop, NULL, CALL_MASTER);
@@ -957,7 +957,7 @@ main(int argc, char** argv)
}
/* Release resources */
- for (port = 0; port < nb_sys_ports; port++) {
+ RTE_ETH_FOREACH_DEV(port) {
if (!(ports_mask & (1 << port)))
continue;
kni_free_kni(port);
diff --git a/examples/kni/meson.build b/examples/kni/meson.build
index c39aead6f..bf3561713 100644
--- a/examples/kni/meson.build
+++ b/examples/kni/meson.build
@@ -7,6 +7,7 @@
# DPDK instance, use 'make'
deps += ['kni', 'bus_pci']
+allow_experimental_apis = true
sources = files(
'main.c'
)
diff --git a/examples/l2fwd-cat/Makefile b/examples/l2fwd-cat/Makefile
index aec770c28..fe0f20073 100644
--- a/examples/l2fwd-cat/Makefile
+++ b/examples/l2fwd-cat/Makefile
@@ -23,6 +23,7 @@ CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -D_GNU_SOURCE
LDFLAGS += -lpqos
@@ -55,6 +56,7 @@ RTE_TARGET ?= x86_64-native-linuxapp-gcc
include $(RTE_SDK)/mk/rte.vars.mk
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += $(WERROR_FLAGS)
# workaround for a gcc bug with noreturn attribute
diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c
index 69339cca8..344292864 100644
--- a/examples/l2fwd-cat/l2fwd-cat.c
+++ b/examples/l2fwd-cat/l2fwd-cat.c
@@ -95,14 +95,13 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
static __attribute__((noreturn)) void
lcore_main(void)
{
- const uint16_t nb_ports = rte_eth_dev_count();
uint16_t port;
/*
* Check that the port is on the same NUMA node as the polling thread
* for best performance.
*/
- for (port = 0; port < nb_ports; port++)
+ RTE_ETH_FOREACH_DEV(port)
if (rte_eth_dev_socket_id(port) > 0 &&
rte_eth_dev_socket_id(port) !=
(int)rte_socket_id())
@@ -119,7 +118,7 @@ lcore_main(void)
* Receive packets on a port and forward them on the paired
* port. The mapping is 0 -> 1, 1 -> 0, 2 -> 3, 3 -> 2, etc.
*/
- for (port = 0; port < nb_ports; port++) {
+ RTE_ETH_FOREACH_DEV(port) {
/* Get burst of RX packets, from first port of pair. */
struct rte_mbuf *bufs[BURST_SIZE];
@@ -186,7 +185,7 @@ main(int argc, char *argv[])
rte_exit(EXIT_FAILURE, "Cannot create mbuf pool\n");
/* Initialize all ports. */
- for (portid = 0; portid < nb_ports; portid++)
+ RTE_ETH_FOREACH_DEV(portid)
if (port_init(portid, mbuf_pool) != 0)
rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
portid);
diff --git a/examples/l2fwd-cat/meson.build b/examples/l2fwd-cat/meson.build
index b6deabc97..29e5d0cf7 100644
--- a/examples/l2fwd-cat/meson.build
+++ b/examples/l2fwd-cat/meson.build
@@ -7,6 +7,7 @@
# DPDK instance, use 'make'
ext_deps += cc.find_library('pqos')
+allow_experimental_apis = true
cflags += '-D_GNU_SOURCE'
cflags += '-I/usr/local/include' # assume pqos lib installed in /usr/local
sources = files(
diff --git a/examples/l2fwd-crypto/Makefile b/examples/l2fwd-crypto/Makefile
index a67f087b2..99afdd2e3 100644
--- a/examples/l2fwd-crypto/Makefile
+++ b/examples/l2fwd-crypto/Makefile
@@ -23,6 +23,8 @@ CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+
build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
@@ -48,6 +50,7 @@ RTE_TARGET ?= x86_64-native-linuxapp-gcc
include $(RTE_SDK)/mk/rte.vars.mk
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 4d8341e29..b1ad19284 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -1721,7 +1721,7 @@ l2fwd_crypto_parse_args(struct l2fwd_crypto_options *options,
/* Check the link status of all ports in up to 9s, and print them finally */
static void
-check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
+check_all_ports_link_status(uint32_t port_mask)
{
#define CHECK_INTERVAL 100 /* 100ms */
#define MAX_CHECK_TIME 90 /* 9s (90 * 100ms) in total */
@@ -1733,7 +1733,7 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
fflush(stdout);
for (count = 0; count <= MAX_CHECK_TIME; count++) {
all_ports_up = 1;
- for (portid = 0; portid < port_num; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if ((port_mask & (1 << portid)) == 0)
continue;
memset(&link, 0, sizeof(link));
@@ -2309,7 +2309,7 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports,
static int
initialize_ports(struct l2fwd_crypto_options *options)
{
- uint16_t last_portid, portid;
+ uint16_t last_portid = 0, portid;
unsigned enabled_portcount = 0;
unsigned nb_ports = rte_eth_dev_count();
@@ -2322,7 +2322,7 @@ initialize_ports(struct l2fwd_crypto_options *options)
for (portid = 0; portid < RTE_MAX_ETHPORTS; portid++)
l2fwd_dst_ports[portid] = 0;
- for (last_portid = 0, portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
int retval;
struct rte_eth_dev_info dev_info;
struct rte_eth_rxconf rxq_conf;
@@ -2426,7 +2426,7 @@ initialize_ports(struct l2fwd_crypto_options *options)
return -1;
}
- check_all_ports_link_status(nb_ports, l2fwd_enabled_port_mask);
+ check_all_ports_link_status(l2fwd_enabled_port_mask);
return enabled_portcount;
}
@@ -2470,12 +2470,12 @@ reserve_key_memory(struct l2fwd_crypto_options *options)
int
main(int argc, char **argv)
{
- struct lcore_queue_conf *qconf;
+ struct lcore_queue_conf *qconf = NULL;
struct l2fwd_crypto_options options;
uint8_t nb_cryptodevs, cdev_id;
- uint16_t nb_ports, portid;
- unsigned lcore_id, rx_lcore_id;
+ uint16_t portid;
+ unsigned lcore_id, rx_lcore_id = 0;
int ret, enabled_cdevcount, enabled_portcount;
uint8_t enabled_cdevs[RTE_CRYPTO_MAX_DEVS] = {0};
@@ -2516,10 +2516,8 @@ main(int argc, char **argv)
if (enabled_portcount < 1)
rte_exit(EXIT_FAILURE, "Failed to initial Ethernet ports\n");
- nb_ports = rte_eth_dev_count();
/* Initialize the port/queue configuration of each logical core */
- for (rx_lcore_id = 0, qconf = NULL, portid = 0;
- portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
/* skip ports that are not enabled */
if ((options.portmask & (1 << portid)) == 0)
diff --git a/examples/l2fwd-crypto/meson.build b/examples/l2fwd-crypto/meson.build
index 09438a6a0..6c852ad19 100644
--- a/examples/l2fwd-crypto/meson.build
+++ b/examples/l2fwd-crypto/meson.build
@@ -7,6 +7,7 @@
# DPDK instance, use 'make'
deps += 'cryptodev'
+allow_experimental_apis = true
sources = files(
'main.c'
)
diff --git a/examples/l2fwd-jobstats/Makefile b/examples/l2fwd-jobstats/Makefile
index 696a8b21a..a9315d475 100644
--- a/examples/l2fwd-jobstats/Makefile
+++ b/examples/l2fwd-jobstats/Makefile
@@ -23,6 +23,8 @@ CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+
build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
@@ -48,7 +50,7 @@ RTE_TARGET ?= x86_64-native-linuxapp-gcc
include $(RTE_SDK)/mk/rte.vars.mk
-
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
index 2554f448a..248224840 100644
--- a/examples/l2fwd-jobstats/main.c
+++ b/examples/l2fwd-jobstats/main.c
@@ -680,7 +680,7 @@ l2fwd_parse_args(int argc, char **argv)
/* Check the link status of all ports in up to 9s, and print them finally */
static void
-check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
+check_all_ports_link_status(uint32_t port_mask)
{
#define CHECK_INTERVAL 100 /* 100ms */
#define MAX_CHECK_TIME 90 /* 9s (90 * 100ms) in total */
@@ -692,7 +692,7 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
fflush(stdout);
for (count = 0; count <= MAX_CHECK_TIME; count++) {
all_ports_up = 1;
- for (portid = 0; portid < port_num; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if ((port_mask & (1 << portid)) == 0)
continue;
memset(&link, 0, sizeof(link));
@@ -742,7 +742,7 @@ main(int argc, char **argv)
int ret;
char name[RTE_JOBSTATS_NAMESIZE];
uint16_t nb_ports;
- uint16_t nb_ports_available;
+ uint16_t nb_ports_available = 0;
uint16_t portid, last_port;
uint8_t i;
@@ -782,7 +782,7 @@ main(int argc, char **argv)
/*
* Each logical core is assigned a dedicated TX queue on each port.
*/
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
/* skip ports that are not enabled */
if ((l2fwd_enabled_port_mask & (1 << portid)) == 0)
continue;
@@ -804,7 +804,7 @@ main(int argc, char **argv)
qconf = NULL;
/* Initialize the port/queue configuration of each logical core */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
/* skip ports that are not enabled */
if ((l2fwd_enabled_port_mask & (1 << portid)) == 0)
continue;
@@ -827,10 +827,8 @@ main(int argc, char **argv)
printf("Lcore %u: RX port %u\n", rx_lcore_id, portid);
}
- nb_ports_available = nb_ports;
-
/* Initialise each port */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
struct rte_eth_dev_info dev_info;
struct rte_eth_rxconf rxq_conf;
struct rte_eth_txconf txq_conf;
@@ -839,9 +837,10 @@ main(int argc, char **argv)
/* skip ports that are not enabled */
if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) {
printf("Skipping disabled port %u\n", portid);
- nb_ports_available--;
continue;
}
+ nb_ports_available++;
+
/* init port */
printf("Initializing port %u... ", portid);
fflush(stdout);
@@ -934,7 +933,7 @@ main(int argc, char **argv)
"All available ports are disabled. Please set portmask.\n");
}
- check_all_ports_link_status(nb_ports, l2fwd_enabled_port_mask);
+ check_all_ports_link_status(l2fwd_enabled_port_mask);
drain_tsc = (hz + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US;
diff --git a/examples/l2fwd-jobstats/meson.build b/examples/l2fwd-jobstats/meson.build
index 1ffd484e2..3653aa7ec 100644
--- a/examples/l2fwd-jobstats/meson.build
+++ b/examples/l2fwd-jobstats/meson.build
@@ -7,6 +7,7 @@
# DPDK instance, use 'make'
deps += ['jobstats', 'timer']
+allow_experimental_apis = true
sources = files(
'main.c'
)
diff --git a/examples/l2fwd-keepalive/Makefile b/examples/l2fwd-keepalive/Makefile
index 4ab67db44..af2895668 100644
--- a/examples/l2fwd-keepalive/Makefile
+++ b/examples/l2fwd-keepalive/Makefile
@@ -25,6 +25,8 @@ CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+
build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
@@ -50,6 +52,7 @@ RTE_TARGET ?= x86_64-native-linuxapp-gcc
include $(RTE_SDK)/mk/rte.vars.mk
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
LDFLAGS += -lrt
diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
index 39b8c3286..e9ad91a1f 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -445,7 +445,7 @@ l2fwd_parse_args(int argc, char **argv)
/* Check the link status of all ports in up to 9s, and print them finally */
static void
-check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
+check_all_ports_link_status(uint32_t port_mask)
{
#define CHECK_INTERVAL 100 /* 100ms */
#define MAX_CHECK_TIME 90 /* 9s (90 * 100ms) in total */
@@ -457,7 +457,7 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
fflush(stdout);
for (count = 0; count <= MAX_CHECK_TIME; count++) {
all_ports_up = 1;
- for (portid = 0; portid < port_num; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if ((port_mask & (1 << portid)) == 0)
continue;
memset(&link, 0, sizeof(link));
@@ -526,7 +526,7 @@ main(int argc, char **argv)
struct lcore_queue_conf *qconf;
int ret;
uint16_t nb_ports;
- uint16_t nb_ports_available;
+ uint16_t nb_ports_available = 0;
uint16_t portid, last_port;
unsigned lcore_id, rx_lcore_id;
unsigned nb_ports_in_mask = 0;
@@ -573,7 +573,7 @@ main(int argc, char **argv)
/*
* Each logical core is assigned a dedicated TX queue on each port.
*/
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
/* skip ports that are not enabled */
if ((l2fwd_enabled_port_mask & (1 << portid)) == 0)
continue;
@@ -595,7 +595,7 @@ main(int argc, char **argv)
qconf = NULL;
/* Initialize the port/queue configuration of each logical core */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
/* skip ports that are not enabled */
if ((l2fwd_enabled_port_mask & (1 << portid)) == 0)
continue;
@@ -619,10 +619,8 @@ main(int argc, char **argv)
rx_lcore_id, portid);
}
- nb_ports_available = nb_ports;
-
/* Initialise each port */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
struct rte_eth_dev_info dev_info;
struct rte_eth_rxconf rxq_conf;
struct rte_eth_txconf txq_conf;
@@ -631,9 +629,10 @@ main(int argc, char **argv)
/* skip ports that are not enabled */
if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) {
printf("Skipping disabled port %u\n", portid);
- nb_ports_available--;
continue;
}
+ nb_ports_available++;
+
/* init port */
printf("Initializing port %u... ", portid);
fflush(stdout);
@@ -728,7 +727,7 @@ main(int argc, char **argv)
"All available ports are disabled. Please set portmask.\n");
}
- check_all_ports_link_status(nb_ports, l2fwd_enabled_port_mask);
+ check_all_ports_link_status(l2fwd_enabled_port_mask);
struct rte_timer hb_timer, stats_timer;
diff --git a/examples/l2fwd-keepalive/meson.build b/examples/l2fwd-keepalive/meson.build
index 6f7b007e1..2dffffaaa 100644
--- a/examples/l2fwd-keepalive/meson.build
+++ b/examples/l2fwd-keepalive/meson.build
@@ -8,6 +8,7 @@
ext_deps += cc.find_library('rt')
deps += 'timer'
+allow_experimental_apis = true
sources = files(
'main.c', 'shm.c'
)
diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile
index a8a47ad4e..1d7760de9 100644
--- a/examples/l2fwd/Makefile
+++ b/examples/l2fwd/Makefile
@@ -23,6 +23,8 @@ CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+
build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
@@ -48,6 +50,7 @@ RTE_TARGET ?= x86_64-native-linuxapp-gcc
include $(RTE_SDK)/mk/rte.vars.mk
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index e4a4a7c36..f8ca29cf6 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -444,7 +444,7 @@ l2fwd_parse_args(int argc, char **argv)
/* Check the link status of all ports in up to 9s, and print them finally */
static void
-check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
+check_all_ports_link_status(uint32_t port_mask)
{
#define CHECK_INTERVAL 100 /* 100ms */
#define MAX_CHECK_TIME 90 /* 9s (90 * 100ms) in total */
@@ -458,7 +458,7 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
if (force_quit)
return;
all_ports_up = 1;
- for (portid = 0; portid < port_num; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if (force_quit)
return;
if ((port_mask & (1 << portid)) == 0)
@@ -517,7 +517,7 @@ main(int argc, char **argv)
struct lcore_queue_conf *qconf;
int ret;
uint16_t nb_ports;
- uint16_t nb_ports_available;
+ uint16_t nb_ports_available = 0;
uint16_t portid, last_port;
unsigned lcore_id, rx_lcore_id;
unsigned nb_ports_in_mask = 0;
@@ -562,7 +562,7 @@ main(int argc, char **argv)
/*
* Each logical core is assigned a dedicated TX queue on each port.
*/
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
/* skip ports that are not enabled */
if ((l2fwd_enabled_port_mask & (1 << portid)) == 0)
continue;
@@ -585,7 +585,7 @@ main(int argc, char **argv)
qconf = NULL;
/* Initialize the port/queue configuration of each logical core */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
/* skip ports that are not enabled */
if ((l2fwd_enabled_port_mask & (1 << portid)) == 0)
continue;
@@ -610,8 +610,6 @@ main(int argc, char **argv)
printf("Lcore %u: RX port %u\n", rx_lcore_id, portid);
}
- nb_ports_available = nb_ports;
-
nb_mbufs = RTE_MAX(nb_ports * (nb_rxd + nb_txd + MAX_PKT_BURST +
nb_lcores * MEMPOOL_CACHE_SIZE), 8192U);
@@ -623,7 +621,7 @@ main(int argc, char **argv)
rte_exit(EXIT_FAILURE, "Cannot init mbuf pool\n");
/* Initialise each port */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
struct rte_eth_rxconf rxq_conf;
struct rte_eth_txconf txq_conf;
struct rte_eth_conf local_port_conf = port_conf;
@@ -632,9 +630,10 @@ main(int argc, char **argv)
/* skip ports that are not enabled */
if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) {
printf("Skipping disabled port %u\n", portid);
- nb_ports_available--;
continue;
}
+ nb_ports_available++;
+
/* init port */
printf("Initializing port %u... ", portid);
fflush(stdout);
@@ -726,7 +725,7 @@ main(int argc, char **argv)
"All available ports are disabled. Please set portmask.\n");
}
- check_all_ports_link_status(nb_ports, l2fwd_enabled_port_mask);
+ check_all_ports_link_status(l2fwd_enabled_port_mask);
ret = 0;
/* launch per-lcore init on every lcore */
@@ -738,7 +737,7 @@ main(int argc, char **argv)
}
}
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if ((l2fwd_enabled_port_mask & (1 << portid)) == 0)
continue;
printf("Closing port %d...", portid);
diff --git a/examples/l2fwd/meson.build b/examples/l2fwd/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/l2fwd/meson.build
+++ b/examples/l2fwd/meson.build
@@ -6,6 +6,7 @@
# To build this example as a standalone application with an already-installed
# DPDK instance, use 'make'
+allow_experimental_apis = true
sources = files(
'main.c'
)
diff --git a/examples/l3fwd-acl/Makefile b/examples/l3fwd-acl/Makefile
index 285683f83..eabca1ed7 100644
--- a/examples/l3fwd-acl/Makefile
+++ b/examples/l3fwd-acl/Makefile
@@ -23,6 +23,8 @@ CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+
build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
@@ -48,6 +50,7 @@ RTE_TARGET ?= x86_64-native-linuxapp-gcc
include $(RTE_SDK)/mk/rte.vars.mk
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index 9aebb3318..3c547cd8e 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -1805,7 +1805,7 @@ init_mem(unsigned nb_mbuf)
/* Check the link status of all ports in up to 9s, and print them finally */
static void
-check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
+check_all_ports_link_status(uint32_t port_mask)
{
#define CHECK_INTERVAL 100 /* 100ms */
#define MAX_CHECK_TIME 90 /* 9s (90 * 100ms) in total */
@@ -1817,7 +1817,7 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
fflush(stdout);
for (count = 0; count <= MAX_CHECK_TIME; count++) {
all_ports_up = 1;
- for (portid = 0; portid < port_num; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if ((port_mask & (1 << portid)) == 0)
continue;
memset(&link, 0, sizeof(link));
@@ -1903,7 +1903,7 @@ main(int argc, char **argv)
nb_lcores = rte_lcore_count();
/* initialize all ports */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
struct rte_eth_conf local_port_conf = port_conf;
/* skip ports that are not enabled */
@@ -2043,7 +2043,7 @@ main(int argc, char **argv)
printf("\n");
/* start ports */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if ((enabled_port_mask & (1 << portid)) == 0)
continue;
@@ -2064,7 +2064,7 @@ main(int argc, char **argv)
rte_eth_promiscuous_enable(portid);
}
- check_all_ports_link_status((uint8_t)nb_ports, enabled_port_mask);
+ check_all_ports_link_status(enabled_port_mask);
/* launch per-lcore init on every lcore */
rte_eal_mp_remote_launch(main_loop, NULL, CALL_MASTER);
diff --git a/examples/l3fwd-acl/meson.build b/examples/l3fwd-acl/meson.build
index 7096e00c1..68cebd6ce 100644
--- a/examples/l3fwd-acl/meson.build
+++ b/examples/l3fwd-acl/meson.build
@@ -7,6 +7,7 @@
# DPDK instance, use 'make'
deps += ['acl', 'lpm', 'hash']
+allow_experimental_apis = true
sources = files(
'main.c'
)
diff --git a/examples/l3fwd-power/Makefile b/examples/l3fwd-power/Makefile
index 390b7d6b6..d4e1ac64f 100644
--- a/examples/l3fwd-power/Makefile
+++ b/examples/l3fwd-power/Makefile
@@ -23,6 +23,8 @@ CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+
build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
@@ -54,6 +56,7 @@ please change the definition of the RTE_TARGET environment variable)
all:
else
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index b2a7c79e6..16f4d098c 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -341,7 +341,7 @@ static void
signal_exit_now(int sigtype)
{
unsigned lcore_id;
- unsigned int portid, nb_ports;
+ unsigned int portid;
int ret;
if (sigtype == SIGINT) {
@@ -357,8 +357,7 @@ signal_exit_now(int sigtype)
"core%u\n", lcore_id);
}
- nb_ports = rte_eth_dev_count();
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if ((enabled_port_mask & (1 << portid)) == 0)
continue;
@@ -1512,7 +1511,7 @@ init_mem(unsigned nb_mbuf)
/* Check the link status of all ports in up to 9s, and print them finally */
static void
-check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
+check_all_ports_link_status(uint32_t port_mask)
{
#define CHECK_INTERVAL 100 /* 100ms */
#define MAX_CHECK_TIME 90 /* 9s (90 * 100ms) in total */
@@ -1524,7 +1523,7 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
fflush(stdout);
for (count = 0; count <= MAX_CHECK_TIME; count++) {
all_ports_up = 1;
- for (portid = 0; portid < port_num; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if ((port_mask & (1 << portid)) == 0)
continue;
memset(&link, 0, sizeof(link));
@@ -1659,7 +1658,7 @@ main(int argc, char **argv)
nb_lcores = rte_lcore_count();
/* initialize all ports */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
struct rte_eth_conf local_port_conf = port_conf;
/* skip ports that are not enabled */
@@ -1834,7 +1833,7 @@ main(int argc, char **argv)
printf("\n");
/* start ports */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if ((enabled_port_mask & (1 << portid)) == 0) {
continue;
}
@@ -1855,7 +1854,7 @@ main(int argc, char **argv)
rte_spinlock_init(&(locks[portid]));
}
- check_all_ports_link_status(nb_ports, enabled_port_mask);
+ check_all_ports_link_status(enabled_port_mask);
/* launch per-lcore init on every lcore */
rte_eal_mp_remote_launch(main_loop, NULL, CALL_MASTER);
diff --git a/examples/l3fwd-power/meson.build b/examples/l3fwd-power/meson.build
index 61e8daa96..cb50c7ab4 100644
--- a/examples/l3fwd-power/meson.build
+++ b/examples/l3fwd-power/meson.build
@@ -7,6 +7,7 @@
# DPDK instance, use 'make'
deps += ['power', 'timer', 'lpm', 'hash']
+allow_experimental_apis = true
sources = files(
'main.c'
)
diff --git a/examples/l3fwd-vf/Makefile b/examples/l3fwd-vf/Makefile
index dfb1d52d3..d776689fa 100644
--- a/examples/l3fwd-vf/Makefile
+++ b/examples/l3fwd-vf/Makefile
@@ -23,6 +23,8 @@ CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+
build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
@@ -48,6 +50,7 @@ RTE_TARGET ?= x86_64-native-linuxapp-gcc
include $(RTE_SDK)/mk/rte.vars.mk
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3 $(USER_FLAGS)
CFLAGS += $(WERROR_FLAGS)
diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c
index c69bd62fa..7a9927c34 100644
--- a/examples/l3fwd-vf/main.c
+++ b/examples/l3fwd-vf/main.c
@@ -648,11 +648,10 @@ static void
signal_handler(int signum)
{
uint16_t portid;
- uint16_t nb_ports = rte_eth_dev_count();
/* When we receive a SIGINT signal */
if (signum == SIGINT) {
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
/* skip ports that are not enabled */
if ((enabled_port_mask & (1 << portid)) == 0)
continue;
@@ -958,7 +957,7 @@ main(int argc, char **argv)
nb_lcores = rte_lcore_count();
/* initialize all ports */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
struct rte_eth_conf local_port_conf = port_conf;
/* skip ports that are not enabled */
@@ -1063,7 +1062,7 @@ main(int argc, char **argv)
printf("\n");
/* start ports */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if ((enabled_port_mask & (1 << portid)) == 0) {
continue;
}
diff --git a/examples/l3fwd-vf/meson.build b/examples/l3fwd-vf/meson.build
index 226286e74..00f3c38f4 100644
--- a/examples/l3fwd-vf/meson.build
+++ b/examples/l3fwd-vf/meson.build
@@ -7,6 +7,7 @@
# DPDK instance, use 'make'
deps += ['lpm', 'hash']
+allow_experimental_apis = true
sources = files(
'main.c'
)
diff --git a/examples/l3fwd/Makefile b/examples/l3fwd/Makefile
index cccdd9dfa..8cc8f6aaa 100644
--- a/examples/l3fwd/Makefile
+++ b/examples/l3fwd/Makefile
@@ -23,6 +23,8 @@ CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+
build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
@@ -48,6 +50,7 @@ RTE_TARGET ?= x86_64-native-linuxapp-gcc
include $(RTE_SDK)/mk/rte.vars.mk
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -I$(SRCDIR)
CFLAGS += -O3 $(USER_FLAGS)
CFLAGS += $(WERROR_FLAGS)
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index e7111fa18..8f7961cec 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -694,7 +694,7 @@ init_mem(unsigned nb_mbuf)
/* Check the link status of all ports in up to 9s, and print them finally */
static void
-check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
+check_all_ports_link_status(uint32_t port_mask)
{
#define CHECK_INTERVAL 100 /* 100ms */
#define MAX_CHECK_TIME 90 /* 9s (90 * 100ms) in total */
@@ -708,7 +708,7 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
if (force_quit)
return;
all_ports_up = 1;
- for (portid = 0; portid < port_num; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if (force_quit)
return;
if ((port_mask & (1 << portid)) == 0)
@@ -837,7 +837,7 @@ main(int argc, char **argv)
setup_l3fwd_lookup_tables();
/* initialize all ports */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
struct rte_eth_conf local_port_conf = port_conf;
/* skip ports that are not enabled */
@@ -971,7 +971,7 @@ main(int argc, char **argv)
printf("\n");
/* start ports */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if ((enabled_port_mask & (1 << portid)) == 0) {
continue;
}
@@ -1007,7 +1007,7 @@ main(int argc, char **argv)
}
- check_all_ports_link_status(nb_ports, enabled_port_mask);
+ check_all_ports_link_status(enabled_port_mask);
ret = 0;
/* launch per-lcore init on every lcore */
@@ -1020,7 +1020,7 @@ main(int argc, char **argv)
}
/* stop ports */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if ((enabled_port_mask & (1 << portid)) == 0)
continue;
printf("Closing port %d...", portid);
diff --git a/examples/l3fwd/meson.build b/examples/l3fwd/meson.build
index 6dd4b9022..cbef07f4f 100644
--- a/examples/l3fwd/meson.build
+++ b/examples/l3fwd/meson.build
@@ -7,6 +7,7 @@
# DPDK instance, use 'make'
deps += ['hash', 'lpm']
+allow_experimental_apis = true
sources = files(
'l3fwd_em.c', 'l3fwd_lpm.c', 'main.c'
)
diff --git a/examples/multi_process/l2fwd_fork/Makefile b/examples/multi_process/l2fwd_fork/Makefile
index b65582ef1..79d506862 100644
--- a/examples/multi_process/l2fwd_fork/Makefile
+++ b/examples/multi_process/l2fwd_fork/Makefile
@@ -16,6 +16,7 @@ RTE_TARGET ?= x86_64-native-linuxapp-gcc
include $(RTE_SDK)/mk/rte.vars.mk
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
diff --git a/examples/multi_process/l2fwd_fork/main.c b/examples/multi_process/l2fwd_fork/main.c
index bc9ceb5ca..6b130f2f5 100644
--- a/examples/multi_process/l2fwd_fork/main.c
+++ b/examples/multi_process/l2fwd_fork/main.c
@@ -838,7 +838,7 @@ l2fwd_parse_args(int argc, char **argv)
/* Check the link status of all ports in up to 9s, and print them finally */
static void
-check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
+check_all_ports_link_status(uint32_t port_mask)
{
#define CHECK_INTERVAL 100 /* 100ms */
#define MAX_CHECK_TIME 90 /* 9s (90 * 100ms) in total */
@@ -850,7 +850,7 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
fflush(stdout);
for (count = 0; count <= MAX_CHECK_TIME; count++) {
all_ports_up = 1;
- for (portid = 0; portid < port_num; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if ((port_mask & (1 << portid)) == 0)
continue;
memset(&link, 0, sizeof(link));
@@ -897,7 +897,7 @@ main(int argc, char **argv)
struct lcore_queue_conf *qconf;
int ret;
uint16_t nb_ports;
- uint16_t nb_ports_available;
+ uint16_t nb_ports_available = 0;
uint16_t portid, last_port;
unsigned rx_lcore_id;
unsigned nb_ports_in_mask = 0;
@@ -946,7 +946,7 @@ main(int argc, char **argv)
rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
/* create the mbuf pool */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
/* skip ports that are not enabled */
if ((l2fwd_enabled_port_mask & (1 << portid)) == 0)
continue;
@@ -969,7 +969,7 @@ main(int argc, char **argv)
/*
* Each logical core is assigned a dedicated TX queue on each port.
*/
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
/* skip ports that are not enabled */
if ((l2fwd_enabled_port_mask & (1 << portid)) == 0)
continue;
@@ -992,7 +992,7 @@ main(int argc, char **argv)
qconf = NULL;
/* Initialize the port/queue configuration of each logical core */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
struct lcore_resource_struct *res;
/* skip ports that are not enabled */
if ((l2fwd_enabled_port_mask & (1 << portid)) == 0)
@@ -1025,10 +1025,8 @@ main(int argc, char **argv)
printf("Lcore %u: RX port %u\n", rx_lcore_id, (unsigned) portid);
}
- nb_ports_available = nb_ports;
-
/* Initialise each port */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
struct rte_eth_rxconf rxq_conf;
struct rte_eth_txconf txq_conf;
struct rte_eth_conf local_port_conf = port_conf;
@@ -1036,9 +1034,9 @@ main(int argc, char **argv)
/* skip ports that are not enabled */
if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) {
printf("Skipping disabled port %u\n", (unsigned) portid);
- nb_ports_available--;
continue;
}
+ nb_ports_available++;
/* init port */
printf("Initializing port %u... ", (unsigned) portid);
fflush(stdout);
@@ -1129,7 +1127,7 @@ main(int argc, char **argv)
"All available ports are disabled. Please set portmask.\n");
}
- check_all_ports_link_status(nb_ports, l2fwd_enabled_port_mask);
+ check_all_ports_link_status(l2fwd_enabled_port_mask);
/* Record pair lcore */
/**
@@ -1140,7 +1138,7 @@ main(int argc, char **argv)
* procedure completed. So, record the pair relationship for those lcores working
* on ports.
**/
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
uint32_t pair_port;
unsigned lcore = 0, pair_lcore = 0;
unsigned j, find_lcore, find_pair_lcore;
diff --git a/examples/multi_process/symmetric_mp/Makefile b/examples/multi_process/symmetric_mp/Makefile
index 6fb9cc366..6c0fcb55b 100644
--- a/examples/multi_process/symmetric_mp/Makefile
+++ b/examples/multi_process/symmetric_mp/Makefile
@@ -16,6 +16,7 @@ APP = symmetric_mp
# all source are stored in SRCS-y
SRCS-y := main.c
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c
index 1ada4ef51..2fbf08803 100644
--- a/examples/multi_process/symmetric_mp/main.c
+++ b/examples/multi_process/symmetric_mp/main.c
@@ -115,7 +115,7 @@ smp_parse_args(int argc, char **argv)
int opt, ret;
char **argvopt;
int option_index;
- unsigned i, port_mask = 0;
+ uint16_t i, port_mask = 0;
char *prgname = argv[0];
static struct option lgopts[] = {
{PARAM_NUM_PROCS, 1, 0, 0},
@@ -156,7 +156,7 @@ smp_parse_args(int argc, char **argv)
smp_usage(prgname, "Invalid or missing port mask\n");
/* get the port numbers from the port mask */
- for(i = 0; i < rte_eth_dev_count(); i++)
+ RTE_ETH_FOREACH_DEV(i)
if(port_mask & (1 << i))
ports[num_ports++] = (uint8_t)i;
diff --git a/examples/packet_ordering/Makefile b/examples/packet_ordering/Makefile
index 3cf1ee1dc..5eb503c25 100644
--- a/examples/packet_ordering/Makefile
+++ b/examples/packet_ordering/Makefile
@@ -23,6 +23,8 @@ CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+
build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
@@ -48,6 +50,7 @@ RTE_TARGET ?= x86_64-native-linuxapp-gcc
include $(RTE_SDK)/mk/rte.vars.mk
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c
index 97a58ddaf..964e23c2e 100644
--- a/examples/packet_ordering/main.c
+++ b/examples/packet_ordering/main.c
@@ -211,11 +211,10 @@ flush_tx_error_callback(struct rte_mbuf **unsent, uint16_t count,
static inline int
free_tx_buffers(struct rte_eth_dev_tx_buffer *tx_buffer[]) {
- const uint8_t nb_ports = rte_eth_dev_count();
- unsigned port_id;
+ uint16_t port_id;
/* initialize buffers for all ports */
- for (port_id = 0; port_id < nb_ports; port_id++) {
+ RTE_ETH_FOREACH_DEV(port_id) {
/* skip ports that are not enabled */
if ((portmask & (1 << port_id)) == 0)
continue;
@@ -228,12 +227,11 @@ free_tx_buffers(struct rte_eth_dev_tx_buffer *tx_buffer[]) {
static inline int
configure_tx_buffers(struct rte_eth_dev_tx_buffer *tx_buffer[])
{
- const uint8_t nb_ports = rte_eth_dev_count();
- unsigned port_id;
+ uint16_t port_id;
int ret;
/* initialize buffers for all ports */
- for (port_id = 0; port_id < nb_ports; port_id++) {
+ RTE_ETH_FOREACH_DEV(port_id) {
/* skip ports that are not enabled */
if ((portmask & (1 << port_id)) == 0)
continue;
@@ -325,8 +323,7 @@ configure_eth_port(uint16_t port_id)
static void
print_stats(void)
{
- const uint8_t nb_ports = rte_eth_dev_count();
- unsigned i;
+ uint16_t i;
struct rte_eth_stats eth_stats;
printf("\nRX thread stats:\n");
@@ -355,7 +352,7 @@ print_stats(void)
printf(" - Pkts tx failed w/o reorder: %"PRIu64"\n",
app_stats.tx.early_pkts_tx_failed_woro);
- for (i = 0; i < nb_ports; i++) {
+ RTE_ETH_FOREACH_DEV(i) {
rte_eth_stats_get(i, ð_stats);
printf("\nPort %u stats:\n", i);
printf(" - Pkts in: %"PRIu64"\n", eth_stats.ipackets);
@@ -383,7 +380,6 @@ int_handler(int sig_num)
static int
rx_thread(struct rte_ring *ring_out)
{
- const uint8_t nb_ports = rte_eth_dev_count();
uint32_t seqn = 0;
uint16_t i, ret = 0;
uint16_t nb_rx_pkts;
@@ -395,7 +391,7 @@ rx_thread(struct rte_ring *ring_out)
while (!quit_signal) {
- for (port_id = 0; port_id < nb_ports; port_id++) {
+ RTE_ETH_FOREACH_DEV(port_id) {
if ((portmask & (1 << port_id)) != 0) {
/* receive packets */
@@ -665,7 +661,7 @@ main(int argc, char **argv)
nb_ports_available = nb_ports;
/* initialize all ports */
- for (port_id = 0; port_id < nb_ports; port_id++) {
+ RTE_ETH_FOREACH_DEV(port_id) {
/* skip ports that are not enabled */
if ((portmask & (1 << port_id)) == 0) {
printf("\nSkipping disabled port %d\n", port_id);
diff --git a/examples/packet_ordering/meson.build b/examples/packet_ordering/meson.build
index 6c2fccdcb..a3776946f 100644
--- a/examples/packet_ordering/meson.build
+++ b/examples/packet_ordering/meson.build
@@ -7,6 +7,7 @@
# DPDK instance, use 'make'
deps += 'reorder'
+allow_experimental_apis = true
sources = files(
'main.c'
)
diff --git a/examples/performance-thread/l3fwd-thread/Makefile b/examples/performance-thread/l3fwd-thread/Makefile
index 5558043f2..5ac543645 100644
--- a/examples/performance-thread/l3fwd-thread/Makefile
+++ b/examples/performance-thread/l3fwd-thread/Makefile
@@ -18,6 +18,7 @@ SRCS-y := main.c
include $(RTE_SDK)/examples/performance-thread/common/common.mk
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3 -g $(USER_FLAGS) $(INCLUDES) $(WERROR_FLAGS)
# workaround for a gcc bug with noreturn attribute
diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c
index c04294cfd..4fafed16d 100644
--- a/examples/performance-thread/l3fwd-thread/main.c
+++ b/examples/performance-thread/l3fwd-thread/main.c
@@ -3411,7 +3411,7 @@ init_mem(unsigned nb_mbuf)
/* Check the link status of all ports in up to 9s, and print them finally */
static void
-check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
+check_all_ports_link_status(uint32_t port_mask)
{
#define CHECK_INTERVAL 100 /* 100ms */
#define MAX_CHECK_TIME 90 /* 9s (90 * 100ms) in total */
@@ -3423,7 +3423,7 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
fflush(stdout);
for (count = 0; count <= MAX_CHECK_TIME; count++) {
all_ports_up = 1;
- for (portid = 0; portid < port_num; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if ((port_mask & (1 << portid)) == 0)
continue;
memset(&link, 0, sizeof(link));
@@ -3522,7 +3522,7 @@ main(int argc, char **argv)
nb_lcores = rte_lcore_count();
/* initialize all ports */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
struct rte_eth_conf local_port_conf = port_conf;
/* skip ports that are not enabled */
@@ -3654,7 +3654,7 @@ main(int argc, char **argv)
printf("\n");
/* start ports */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if ((enabled_port_mask & (1 << portid)) == 0)
continue;
@@ -3699,7 +3699,7 @@ main(int argc, char **argv)
}
}
- check_all_ports_link_status((uint8_t)nb_ports, enabled_port_mask);
+ check_all_ports_link_status(enabled_port_mask);
if (lthreads_on) {
printf("Starting L-Threading Model\n");
diff --git a/examples/ptpclient/Makefile b/examples/ptpclient/Makefile
index 989e2dd40..1c1d9cdbb 100644
--- a/examples/ptpclient/Makefile
+++ b/examples/ptpclient/Makefile
@@ -23,6 +23,8 @@ CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+
build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
@@ -48,6 +50,7 @@ RTE_TARGET ?= x86_64-native-linuxapp-gcc
include $(RTE_SDK)/mk/rte.vars.mk
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
diff --git a/examples/ptpclient/meson.build b/examples/ptpclient/meson.build
index fa0cbe93c..d4171a218 100644
--- a/examples/ptpclient/meson.build
+++ b/examples/ptpclient/meson.build
@@ -6,6 +6,7 @@
# To build this example as a standalone application with an already-installed
# DPDK instance, use 'make'
+allow_experimental_apis = true
sources = files(
'ptpclient.c'
)
diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index 83821eb8d..ad98a392f 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -737,7 +737,7 @@ main(int argc, char *argv[])
rte_exit(EXIT_FAILURE, "Cannot create mbuf pool\n");
/* Initialize all ports. */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if ((ptp_enabled_port_mask & (1 << portid)) != 0) {
if (port_init(portid, mbuf_pool) == 0) {
ptp_enabled_ports[ptp_enabled_port_nb] = portid;
diff --git a/examples/rxtx_callbacks/Makefile b/examples/rxtx_callbacks/Makefile
index e9d30d56f..c72ba66d6 100644
--- a/examples/rxtx_callbacks/Makefile
+++ b/examples/rxtx_callbacks/Makefile
@@ -23,6 +23,8 @@ CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+
build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
@@ -48,6 +50,7 @@ RTE_TARGET ?= x86_64-native-linuxapp-gcc
include $(RTE_SDK)/mk/rte.vars.mk
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += $(WERROR_FLAGS)
# workaround for a gcc bug with noreturn attribute
diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
index d2e5e19e6..46dacc7ef 100644
--- a/examples/rxtx_callbacks/main.c
+++ b/examples/rxtx_callbacks/main.c
@@ -24,8 +24,6 @@ static const struct rte_eth_conf port_conf_default = {
},
};
-static unsigned nb_ports;
-
static struct {
uint64_t total_cycles;
uint64_t total_pkts;
@@ -145,7 +143,7 @@ lcore_main(void)
{
uint16_t port;
- for (port = 0; port < nb_ports; port++)
+ RTE_ETH_FOREACH_DEV(port)
if (rte_eth_dev_socket_id(port) > 0 &&
rte_eth_dev_socket_id(port) !=
(int)rte_socket_id())
@@ -156,7 +154,7 @@ lcore_main(void)
printf("\nCore %u forwarding packets. [Ctrl+C to quit]\n",
rte_lcore_id());
for (;;) {
- for (port = 0; port < nb_ports; port++) {
+ RTE_ETH_FOREACH_DEV(port) {
struct rte_mbuf *bufs[BURST_SIZE];
const uint16_t nb_rx = rte_eth_rx_burst(port, 0,
bufs, BURST_SIZE);
@@ -179,6 +177,7 @@ int
main(int argc, char *argv[])
{
struct rte_mempool *mbuf_pool;
+ uint16_t nb_ports;
uint16_t portid;
/* init EAL */
@@ -200,7 +199,7 @@ main(int argc, char *argv[])
rte_exit(EXIT_FAILURE, "Cannot create mbuf pool\n");
/* initialize all ports */
- for (portid = 0; portid < nb_ports; portid++)
+ RTE_ETH_FOREACH_DEV(portid)
if (port_init(portid, mbuf_pool) != 0)
rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu8"\n",
portid);
diff --git a/examples/rxtx_callbacks/meson.build b/examples/rxtx_callbacks/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/rxtx_callbacks/meson.build
+++ b/examples/rxtx_callbacks/meson.build
@@ -6,6 +6,7 @@
# To build this example as a standalone application with an already-installed
# DPDK instance, use 'make'
+allow_experimental_apis = true
sources = files(
'main.c'
)
diff --git a/examples/skeleton/Makefile b/examples/skeleton/Makefile
index bd980ec9b..a4a1860cb 100644
--- a/examples/skeleton/Makefile
+++ b/examples/skeleton/Makefile
@@ -23,6 +23,8 @@ CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+
build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
@@ -48,6 +50,7 @@ RTE_TARGET ?= x86_64-native-linuxapp-gcc
include $(RTE_SDK)/mk/rte.vars.mk
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += $(WERROR_FLAGS)
# workaround for a gcc bug with noreturn attribute
diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c
index e62cc0a59..11a9b5747 100644
--- a/examples/skeleton/basicfwd.c
+++ b/examples/skeleton/basicfwd.c
@@ -106,14 +106,13 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
static __attribute__((noreturn)) void
lcore_main(void)
{
- const uint16_t nb_ports = rte_eth_dev_count();
uint16_t port;
/*
* Check that the port is on the same NUMA node as the polling thread
* for best performance.
*/
- for (port = 0; port < nb_ports; port++)
+ RTE_ETH_FOREACH_DEV(port)
if (rte_eth_dev_socket_id(port) > 0 &&
rte_eth_dev_socket_id(port) !=
(int)rte_socket_id())
@@ -130,7 +129,7 @@ lcore_main(void)
* Receive packets on a port and forward them on the paired
* port. The mapping is 0 -> 1, 1 -> 0, 2 -> 3, 3 -> 2, etc.
*/
- for (port = 0; port < nb_ports; port++) {
+ RTE_ETH_FOREACH_DEV(port) {
/* Get burst of RX packets, from first port of pair. */
struct rte_mbuf *bufs[BURST_SIZE];
@@ -186,7 +185,7 @@ main(int argc, char *argv[])
rte_exit(EXIT_FAILURE, "Cannot create mbuf pool\n");
/* Initialize all ports. */
- for (portid = 0; portid < nb_ports; portid++)
+ RTE_ETH_FOREACH_DEV(portid)
if (port_init(portid, mbuf_pool) != 0)
rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
portid);
diff --git a/examples/skeleton/meson.build b/examples/skeleton/meson.build
index 9bb9ec329..ef46b187e 100644
--- a/examples/skeleton/meson.build
+++ b/examples/skeleton/meson.build
@@ -6,6 +6,7 @@
# To build this example as a standalone application with an already-installed
# DPDK instance, use 'make'
+allow_experimental_apis = true
sources = files(
'basicfwd.c'
)
diff --git a/examples/tep_termination/Makefile b/examples/tep_termination/Makefile
index d2c357a1c..2b93446c0 100644
--- a/examples/tep_termination/Makefile
+++ b/examples/tep_termination/Makefile
@@ -25,6 +25,8 @@ CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+
build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
@@ -55,6 +57,7 @@ $(error This application can only operate in a linuxapp environment, \
please change the definition of the RTE_TARGET environment variable)
endif
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
CFLAGS += -D_GNU_SOURCE
diff --git a/examples/tep_termination/main.c b/examples/tep_termination/main.c
index 270739138..cc12cd87a 100644
--- a/examples/tep_termination/main.c
+++ b/examples/tep_termination/main.c
@@ -1185,7 +1185,7 @@ main(int argc, char *argv[])
vpool_array[queue_id].pool = mbuf_pool;
/* initialize all ports */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
/* skip ports that are not enabled */
if ((enabled_port_mask & (1 << portid)) == 0) {
RTE_LOG(INFO, VHOST_PORT,
diff --git a/examples/tep_termination/meson.build b/examples/tep_termination/meson.build
index 68c940aab..24697ec6d 100644
--- a/examples/tep_termination/meson.build
+++ b/examples/tep_termination/meson.build
@@ -7,6 +7,7 @@
# DPDK instance, use 'make'
deps += ['hash', 'vhost']
+allow_experimental_apis = true
sources = files(
'main.c', 'vxlan.c', 'vxlan_setup.c'
)
diff --git a/examples/vhost/Makefile b/examples/vhost/Makefile
index 2dc62ebf0..67cc55b1b 100644
--- a/examples/vhost/Makefile
+++ b/examples/vhost/Makefile
@@ -25,6 +25,8 @@ CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+
build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
@@ -56,6 +58,7 @@ please change the definition of the RTE_TARGET environment variable)
all:
else
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O2 -D_FILE_OFFSET_BITS=64
CFLAGS += $(WERROR_FLAGS)
CFLAGS += -D_GNU_SOURCE
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 60d862b42..0b5221f1e 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -1477,7 +1477,7 @@ main(int argc, char *argv[])
}
/* initialize all ports */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
/* skip ports that are not enabled */
if ((enabled_port_mask & (1 << portid)) == 0) {
RTE_LOG(INFO, VHOST_PORT,
diff --git a/examples/vhost/meson.build b/examples/vhost/meson.build
index 3e6e69047..64c84ee12 100644
--- a/examples/vhost/meson.build
+++ b/examples/vhost/meson.build
@@ -7,6 +7,7 @@
# DPDK instance, use 'make'
deps += 'vhost'
+allow_experimental_apis = true
sources = files(
'main.c', 'virtio_net.c'
)
diff --git a/examples/vm_power_manager/Makefile b/examples/vm_power_manager/Makefile
index ef2a9f959..608d0d9f4 100644
--- a/examples/vm_power_manager/Makefile
+++ b/examples/vm_power_manager/Makefile
@@ -21,6 +21,7 @@ APP = vm_power_mgr
SRCS-y := main.c vm_power_cli.c power_manager.c channel_manager.c
SRCS-y += channel_monitor.c
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3 -I$(RTE_SDK)/lib/librte_power/
CFLAGS += $(WERROR_FLAGS)
diff --git a/examples/vm_power_manager/channel_monitor.c b/examples/vm_power_manager/channel_monitor.c
index 1c7b6eb2d..73bddd993 100644
--- a/examples/vm_power_manager/channel_monitor.c
+++ b/examples/vm_power_manager/channel_monitor.c
@@ -110,12 +110,11 @@ static int
get_pfid(struct policy *pol)
{
- int i, x, ret = 0, nb_ports;
+ int i, x, ret = 0;
- nb_ports = rte_eth_dev_count();
for (i = 0; i < pol->pkt.nb_mac_to_monitor; i++) {
- for (x = 0; x < nb_ports; x++) {
+ RTE_ETH_FOREACH_DEV(x) {
ret = rte_pmd_i40e_query_vfid_by_mac(x,
(struct ether_addr *)&(pol->pkt.vfid[i]));
if (ret != -EINVAL) {
diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c
index 8a1e95bd7..4cde828f9 100644
--- a/examples/vm_power_manager/main.c
+++ b/examples/vm_power_manager/main.c
@@ -176,7 +176,7 @@ parse_args(int argc, char **argv)
}
static void
-check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
+check_all_ports_link_status(uint32_t port_mask)
{
#define CHECK_INTERVAL 100 /* 100ms */
#define MAX_CHECK_TIME 90 /* 9s (90 * 100ms) in total */
@@ -189,7 +189,7 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
if (force_quit)
return;
all_ports_up = 1;
- for (portid = 0; portid < port_num; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if (force_quit)
return;
if ((port_mask & (1 << portid)) == 0)
@@ -287,7 +287,7 @@ main(int argc, char **argv)
rte_exit(EXIT_FAILURE, "Cannot create mbuf pool\n");
/* Initialize ports. */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
struct ether_addr eth;
int w, j;
int ret;
@@ -339,7 +339,7 @@ main(int argc, char **argv)
return 0;
}
- check_all_ports_link_status(nb_ports, enabled_port_mask);
+ check_all_ports_link_status(enabled_port_mask);
rte_eal_remote_launch(run_monitor, NULL, lcore_id);
if (power_manager_init() < 0) {
diff --git a/examples/vmdq/Makefile b/examples/vmdq/Makefile
index 87abeab93..e2d114919 100644
--- a/examples/vmdq/Makefile
+++ b/examples/vmdq/Makefile
@@ -23,6 +23,8 @@ CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+
build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
@@ -48,6 +50,7 @@ RTE_TARGET ?= x86_64-native-linuxapp-gcc
include $(RTE_SDK)/mk/rte.vars.mk
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += $(WERROR_FLAGS)
EXTRA_CFLAGS += -O3
diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index d94a18314..72845241e 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -600,7 +600,7 @@ main(int argc, char *argv[])
rte_exit(EXIT_FAILURE, "Cannot create mbuf pool\n");
/* initialize all ports */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
/* skip ports that are not enabled */
if ((enabled_port_mask & (1 << portid)) == 0) {
printf("\nSkipping disabled port %d\n", portid);
diff --git a/examples/vmdq/meson.build b/examples/vmdq/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/vmdq/meson.build
+++ b/examples/vmdq/meson.build
@@ -6,6 +6,7 @@
# To build this example as a standalone application with an already-installed
# DPDK instance, use 'make'
+allow_experimental_apis = true
sources = files(
'main.c'
)
diff --git a/examples/vmdq_dcb/Makefile b/examples/vmdq_dcb/Makefile
index bf161cb2b..3bd80a023 100644
--- a/examples/vmdq_dcb/Makefile
+++ b/examples/vmdq_dcb/Makefile
@@ -23,6 +23,8 @@ CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+
build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
@@ -48,6 +50,7 @@ RTE_TARGET ?= x86_64-native-linuxapp-gcc
include $(RTE_SDK)/mk/rte.vars.mk
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += $(WERROR_FLAGS)
# workaround for a gcc bug with noreturn attribute
diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c
index bfe72f8c8..2016a9571 100644
--- a/examples/vmdq_dcb/main.c
+++ b/examples/vmdq_dcb/main.c
@@ -662,7 +662,7 @@ main(int argc, char *argv[])
rte_exit(EXIT_FAILURE, "Cannot create mbuf pool\n");
/* initialize all ports */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
/* skip ports that are not enabled */
if ((enabled_port_mask & (1 << portid)) == 0) {
printf("\nSkipping disabled port %d\n", portid);
diff --git a/examples/vmdq_dcb/meson.build b/examples/vmdq_dcb/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/vmdq_dcb/meson.build
+++ b/examples/vmdq_dcb/meson.build
@@ -6,6 +6,7 @@
# To build this example as a standalone application with an already-installed
# DPDK instance, use 'make'
+allow_experimental_apis = true
sources = files(
'main.c'
)
diff --git a/lib/librte_eventdev/rte_event_eth_rx_adapter.c b/lib/librte_eventdev/rte_event_eth_rx_adapter.c
index 9aece9f8c..9297f4c4d 100644
--- a/lib/librte_eventdev/rte_event_eth_rx_adapter.c
+++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.c
@@ -213,7 +213,7 @@ eth_poll_wrr_calc(struct rte_event_eth_rx_adapter *rx_adapter)
/* Generate array of all queues to poll, the size of this
* array is poll_q
*/
- for (d = 0; d < rte_eth_dev_count(); d++) {
+ RTE_ETH_FOREACH_DEV(d) {
uint16_t nb_rx_queues;
struct eth_device_info *dev_info =
&rx_adapter->eth_devices[d];
@@ -813,7 +813,7 @@ rx_adapter_ctrl(uint8_t id, int start)
dev = &rte_eventdevs[rx_adapter->eventdev_id];
- for (i = 0; i < rte_eth_dev_count(); i++) {
+ RTE_ETH_FOREACH_DEV(i) {
dev_info = &rx_adapter->eth_devices[i];
/* if start check for num dev queues */
if (start && !dev_info->nb_dev_queues)
@@ -903,7 +903,7 @@ rte_event_eth_rx_adapter_create_ext(uint8_t id, uint8_t dev_id,
return -ENOMEM;
}
rte_spinlock_init(&rx_adapter->rx_lock);
- for (i = 0; i < rte_eth_dev_count(); i++)
+ RTE_ETH_FOREACH_DEV(i)
rx_adapter->eth_devices[i].dev = &rte_eth_devices[i];
event_eth_rx_adapter[id] = rx_adapter;
@@ -1174,7 +1174,7 @@ rte_event_eth_rx_adapter_stats_get(uint8_t id,
dev = &rte_eventdevs[rx_adapter->eventdev_id];
memset(stats, 0, sizeof(*stats));
- for (i = 0; i < rte_eth_dev_count(); i++) {
+ RTE_ETH_FOREACH_DEV(i) {
dev_info = &rx_adapter->eth_devices[i];
if (dev_info->internal_event_port == 0 ||
dev->dev_ops->eth_rx_adapter_stats_get == NULL)
@@ -1211,7 +1211,7 @@ rte_event_eth_rx_adapter_stats_reset(uint8_t id)
return -EINVAL;
dev = &rte_eventdevs[rx_adapter->eventdev_id];
- for (i = 0; i < rte_eth_dev_count(); i++) {
+ RTE_ETH_FOREACH_DEV(i) {
dev_info = &rx_adapter->eth_devices[i];
if (dev_info->internal_event_port == 0 ||
dev->dev_ops->eth_rx_adapter_stats_reset == NULL)
diff --git a/lib/librte_latencystats/Makefile b/lib/librte_latencystats/Makefile
index ae0dbd8f0..8884045c0 100644
--- a/lib/librte_latencystats/Makefile
+++ b/lib/librte_latencystats/Makefile
@@ -6,6 +6,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
# library name
LIB = librte_latencystats.a
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
LDLIBS += -lm
LDLIBS += -lpthread
diff --git a/lib/librte_latencystats/meson.build b/lib/librte_latencystats/meson.build
index 286558dd7..0c96e1287 100644
--- a/lib/librte_latencystats/meson.build
+++ b/lib/librte_latencystats/meson.build
@@ -4,3 +4,4 @@
sources = files('rte_latencystats.c')
headers = files('rte_latencystats.h')
deps += ['metrics', 'ethdev']
+allow_experimental_apis = true
diff --git a/lib/librte_latencystats/rte_latencystats.c b/lib/librte_latencystats/rte_latencystats.c
index 66330203c..f981a803e 100644
--- a/lib/librte_latencystats/rte_latencystats.c
+++ b/lib/librte_latencystats/rte_latencystats.c
@@ -201,7 +201,6 @@ rte_latencystats_init(uint64_t app_samp_intvl,
uint16_t pid;
uint16_t qid;
struct rxtx_cbs *cbs = NULL;
- const uint16_t nb_ports = rte_eth_dev_count();
const char *ptr_strings[NUM_LATENCY_STATS] = {0};
const struct rte_memzone *mz = NULL;
const unsigned int flags = 0;
@@ -234,7 +233,7 @@ rte_latencystats_init(uint64_t app_samp_intvl,
}
/** Register Rx/Tx callbacks */
- for (pid = 0; pid < nb_ports; pid++) {
+ RTE_ETH_FOREACH_DEV(pid) {
struct rte_eth_dev_info dev_info;
rte_eth_dev_info_get(pid, &dev_info);
for (qid = 0; qid < dev_info.nb_rx_queues; qid++) {
@@ -266,10 +265,9 @@ rte_latencystats_uninit(void)
uint16_t qid;
int ret = 0;
struct rxtx_cbs *cbs = NULL;
- const uint16_t nb_ports = rte_eth_dev_count();
/** De register Rx/Tx callbacks */
- for (pid = 0; pid < nb_ports; pid++) {
+ RTE_ETH_FOREACH_DEV(pid) {
struct rte_eth_dev_info dev_info;
rte_eth_dev_info_get(pid, &dev_info);
for (qid = 0; qid < dev_info.nb_rx_queues; qid++) {
diff --git a/test/test/test_event_eth_rx_adapter.c b/test/test/test_event_eth_rx_adapter.c
index 006ed3149..1b913a25f 100644
--- a/test/test/test_event_eth_rx_adapter.c
+++ b/test/test/test_event_eth_rx_adapter.c
@@ -119,7 +119,7 @@ init_ports(int num_ports)
if (!default_params.mp)
return -ENOMEM;
- for (portid = 0; portid < num_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
retval = port_init(portid, default_params.mp);
if (retval)
return retval;
@@ -179,7 +179,7 @@ static void
testsuite_teardown(void)
{
uint32_t i;
- for (i = 0; i < rte_eth_dev_count(); i++)
+ RTE_ETH_FOREACH_DEV(i)
rte_eth_dev_stop(i);
rte_mempool_free(default_params.mp);
diff --git a/test/test/test_pmd_perf.c b/test/test/test_pmd_perf.c
index 911dd762c..0e64a581b 100644
--- a/test/test/test_pmd_perf.c
+++ b/test/test/test_pmd_perf.c
@@ -698,7 +698,7 @@ test_pmd_perf(void)
reset_count();
num = 0;
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if (socketid == -1) {
socketid = rte_eth_dev_socket_id(portid);
slave_id = alloc_lcore(socketid);
@@ -791,7 +791,7 @@ test_pmd_perf(void)
return -1;
/* port tear down */
- for (portid = 0; portid < nb_ports; portid++) {
+ RTE_ETH_FOREACH_DEV(portid) {
if (socketid != rte_eth_dev_socket_id(portid))
continue;
diff --git a/test/test/test_pmd_ring.c b/test/test/test_pmd_ring.c
index 4b8910149..0787e4ebf 100644
--- a/test/test/test_pmd_ring.c
+++ b/test/test/test_pmd_ring.c
@@ -473,7 +473,7 @@ test_pmd_ring(void)
return -1;
/* find a port created with the --vdev=net_ring0 command line option */
- for (port = 0; port < nb_ports; port++) {
+ RTE_ETH_FOREACH_DEV(port) {
struct rte_eth_dev_info dev_info;
rte_eth_dev_info_get(port, &dev_info);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* Re: [dpdk-stable] patch 'fix ethdev ports enumeration' has been queued to stable release 18.02.2
2018-04-30 14:41 ` [dpdk-stable] patch 'fix ethdev ports enumeration' " luca.boccassi
@ 2018-04-30 15:07 ` Thomas Monjalon
2018-04-30 15:43 ` Luca Boccassi
0 siblings, 1 reply; 382+ messages in thread
From: Thomas Monjalon @ 2018-04-30 15:07 UTC (permalink / raw)
To: luca.boccassi; +Cc: dpdk stable
30/04/2018 16:41, luca.boccassi@gmail.com:
> Hi,
>
> FYI, your patch has been queued to stable release 18.02.2
>
> Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
> It will be pushed if I get no objections before 05/02/18. So please
> shout if anyone has objections.
I did not plan to backport it. But yes, it may be a good idead.
In this case, you need to backport some fixes on top of it:
net/mvpp2: fix build
ethdev: remove experimental flag of ports enumeration
> ---
> From beef7e18559abf272f9ca0a4d1b62f8d32c47b02 Mon Sep 17 00:00:00 2001
> From: Thomas Monjalon <thomas@monjalon.net>
> Date: Thu, 5 Apr 2018 17:33:20 +0200
> Subject: [PATCH] fix ethdev ports enumeration
>
> [ upstream commit 8728ccf37615904cf23fb8763895b05c9a3c6b0c ]
>
> Some DPDK applications wrongly assume these requirements:
> - no hotplug, i.e. ports are never detached
> - all allocated ports are available to the application
>
> Such application iterates over ports by its own mean.
> The most common pattern is to request the port count and
> assume ports with index in the range [0..count[ can be used.
>
> There are three consequences when using such wrong design:
> - new ports having an index higher than the port count won't be seen
> - old ports being detached (RTE_ETH_DEV_UNUSED) can be seen as ghosts
> - failsafe sub-devices (RTE_ETH_DEV_DEFERRED) will be seen by the application
>
> Such mistake will be less common with growing hotplug awareness.
> All applications and examples inside this repository - except testpmd -
> must be fixed to use the iterator RTE_ETH_FOREACH_DEV.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
^ permalink raw reply [flat|nested] 382+ messages in thread
* Re: [dpdk-stable] patch 'fix ethdev ports enumeration' has been queued to stable release 18.02.2
2018-04-30 15:07 ` Thomas Monjalon
@ 2018-04-30 15:43 ` Luca Boccassi
2018-05-01 9:13 ` Thomas Monjalon
0 siblings, 1 reply; 382+ messages in thread
From: Luca Boccassi @ 2018-04-30 15:43 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dpdk stable
On Mon, 2018-04-30 at 17:07 +0200, Thomas Monjalon wrote:
> 30/04/2018 16:41, luca.boccassi@gmail.com:
> > Hi,
> >
> > FYI, your patch has been queued to stable release 18.02.2
> >
> > Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable
> > yet.
> > It will be pushed if I get no objections before 05/02/18. So please
> > shout if anyone has objections.
>
> I did not plan to backport it. But yes, it may be a good idead.
> In this case, you need to backport some fixes on top of it:
> net/mvpp2: fix build
> ethdev: remove experimental flag of ports enumeration
Are you sure about those 2? The first one doesn't apply as there's no
mvpp2 in 18.02, and the second one changes the API
> > ---
> > From beef7e18559abf272f9ca0a4d1b62f8d32c47b02 Mon Sep 17 00:00:00
> > 2001
> > From: Thomas Monjalon <thomas@monjalon.net>
> > Date: Thu, 5 Apr 2018 17:33:20 +0200
> > Subject: [PATCH] fix ethdev ports enumeration
> >
> > [ upstream commit 8728ccf37615904cf23fb8763895b05c9a3c6b0c ]
> >
> > Some DPDK applications wrongly assume these requirements:
> > - no hotplug, i.e. ports are never detached
> > - all allocated ports are available to the application
> >
> > Such application iterates over ports by its own mean.
> > The most common pattern is to request the port count and
> > assume ports with index in the range [0..count[ can be used.
> >
> > There are three consequences when using such wrong design:
> > - new ports having an index higher than the port count won't be
> > seen
> > - old ports being detached (RTE_ETH_DEV_UNUSED) can be seen as
> > ghosts
> > - failsafe sub-devices (RTE_ETH_DEV_DEFERRED) will be seen by
> > the application
> >
> > Such mistake will be less common with growing hotplug awareness.
> > All applications and examples inside this repository - except
> > testpmd -
> > must be fixed to use the iterator RTE_ETH_FOREACH_DEV.
> >
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
>
>
>
--
Kind regards,
Luca Boccassi
^ permalink raw reply [flat|nested] 382+ messages in thread
* Re: [dpdk-stable] patch 'fix ethdev ports enumeration' has been queued to stable release 18.02.2
2018-04-30 15:43 ` Luca Boccassi
@ 2018-05-01 9:13 ` Thomas Monjalon
0 siblings, 0 replies; 382+ messages in thread
From: Thomas Monjalon @ 2018-05-01 9:13 UTC (permalink / raw)
To: Luca Boccassi; +Cc: dpdk stable
30/04/2018 17:43, Luca Boccassi:
> On Mon, 2018-04-30 at 17:07 +0200, Thomas Monjalon wrote:
> > 30/04/2018 16:41, luca.boccassi@gmail.com:
> > > Hi,
> > >
> > > FYI, your patch has been queued to stable release 18.02.2
> > >
> > > Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable
> > > yet.
> > > It will be pushed if I get no objections before 05/02/18. So please
> > > shout if anyone has objections.
> >
> > I did not plan to backport it. But yes, it may be a good idead.
> > In this case, you need to backport some fixes on top of it:
> > net/mvpp2: fix build
> > ethdev: remove experimental flag of ports enumeration
>
> Are you sure about those 2? The first one doesn't apply as there's no
> mvpp2 in 18.02, and the second one changes the API
True.
After a second thought, I think you can try to get the below commit
with existing experimental constraint (without above commit).
> > > ---
> > > From beef7e18559abf272f9ca0a4d1b62f8d32c47b02 Mon Sep 17 00:00:00
> > > 2001
> > > From: Thomas Monjalon <thomas@monjalon.net>
> > > Date: Thu, 5 Apr 2018 17:33:20 +0200
> > > Subject: [PATCH] fix ethdev ports enumeration
> > >
> > > [ upstream commit 8728ccf37615904cf23fb8763895b05c9a3c6b0c ]
> > >
> > > Some DPDK applications wrongly assume these requirements:
> > > - no hotplug, i.e. ports are never detached
> > > - all allocated ports are available to the application
> > >
> > > Such application iterates over ports by its own mean.
> > > The most common pattern is to request the port count and
> > > assume ports with index in the range [0..count[ can be used.
> > >
> > > There are three consequences when using such wrong design:
> > > - new ports having an index higher than the port count won't be
> > > seen
> > > - old ports being detached (RTE_ETH_DEV_UNUSED) can be seen as
> > > ghosts
> > > - failsafe sub-devices (RTE_ETH_DEV_DEFERRED) will be seen by
> > > the application
> > >
> > > Such mistake will be less common with growing hotplug awareness.
> > > All applications and examples inside this repository - except
> > > testpmd -
> > > must be fixed to use the iterator RTE_ETH_FOREACH_DEV.
> > >
> > > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> >
> >
> >
>
>
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'fix ethdev port id validation' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (55 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'fix ethdev ports enumeration' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 15:04 ` Thomas Monjalon
2018-04-30 14:41 ` [dpdk-stable] patch 'bus/fslmc: fix build with clang 3.4' " luca.boccassi
` (26 subsequent siblings)
83 siblings, 1 reply; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 17bf70baba04313dc1ceef180f2f19da7f5ecad1 Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas@monjalon.net>
Date: Thu, 5 Apr 2018 17:33:21 +0200
Subject: [PATCH] fix ethdev port id validation
[ upstream commit a9dbe180222680edf8c49e86791f972549ce5be3 ]
Some DPDK applications wrongly assume these requirements:
- no hotplug, i.e. ports are never detached
- all allocated ports are available to the application
Such application assume a valid port index is in the range [0..count[.
There are three consequences when using such wrong design:
- new ports having an index higher than the port count won't be valid
- old ports being detached (RTE_ETH_DEV_UNUSED) can be valid
Such mistake will be less common with growing hotplug awareness.
All applications and examples inside this repository - except testpmd -
must be fixed to use the function rte_eth_dev_is_valid_port.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
app/pdump/main.c | 3 +-
app/test-pmd/cmdline.c | 51 ----------------------
doc/guides/sample_app_ug/flow_classify.rst | 3 --
doc/guides/sample_app_ug/kernel_nic_interface.rst | 10 -----
doc/guides/sample_app_ug/l2_forward_job_stats.rst | 5 ---
.../sample_app_ug/l2_forward_real_virtual.rst | 5 ---
doc/guides/sample_app_ug/link_status_intr.rst | 4 --
doc/guides/sample_app_ug/rxtx_callbacks.rst | 3 --
doc/guides/sample_app_ug/skeleton.rst | 3 +-
examples/bbdev_app/main.c | 10 ++---
examples/bond/main.c | 2 +-
examples/distributor/main.c | 2 +-
examples/eventdev_pipeline/main.c | 2 +-
examples/flow_classify/flow_classify.c | 2 +-
examples/ipsec-secgw/ipsec-secgw.c | 6 +--
examples/kni/main.c | 8 ++--
examples/l2fwd-cat/l2fwd-cat.c | 2 +-
examples/l3fwd-acl/main.c | 6 +--
examples/l3fwd-power/main.c | 6 +--
examples/l3fwd-vf/main.c | 6 +--
examples/l3fwd/main.c | 6 +--
examples/multi_process/symmetric_mp/main.c | 2 +-
examples/packet_ordering/main.c | 3 +-
examples/performance-thread/l3fwd-thread/main.c | 6 +--
examples/ptpclient/ptpclient.c | 2 +-
examples/rxtx_callbacks/main.c | 2 +-
examples/skeleton/basicfwd.c | 2 +-
examples/tep_termination/main.c | 7 ++-
examples/tep_termination/vxlan_setup.c | 2 +-
examples/vhost/main.c | 10 +++--
examples/vm_power_manager/main.c | 2 +-
examples/vmdq/main.c | 8 ++--
examples/vmdq_dcb/main.c | 8 ++--
lib/librte_kni/rte_kni.c | 4 +-
test/test/test_event_eth_rx_adapter.c | 2 +-
35 files changed, 59 insertions(+), 146 deletions(-)
diff --git a/app/pdump/main.c b/app/pdump/main.c
index f6865bdbd..c851d5bed 100644
--- a/app/pdump/main.c
+++ b/app/pdump/main.c
@@ -554,11 +554,10 @@ configure_vdev(uint16_t port_id)
{
struct ether_addr addr;
const uint16_t rxRings = 0, txRings = 1;
- const uint8_t nb_ports = rte_eth_dev_count();
int ret;
uint16_t q;
- if (port_id > nb_ports)
+ if (!rte_eth_dev_is_valid_port(port_id))
return -1;
ret = rte_eth_dev_configure(port_id, rxRings, txRings,
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 91b1ad340..f22fa935c 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -5511,11 +5511,6 @@ static void cmd_set_bond_mon_period_parsed(void *parsed_result,
struct cmd_set_bond_mon_period_result *res = parsed_result;
int ret;
- if (res->port_num >= nb_ports) {
- printf("Port id %d must be less than %d\n", res->port_num, nb_ports);
- return;
- }
-
ret = rte_eth_bond_link_monitoring_set(res->port_num, res->period_ms);
/* check the return value and print it if is < 0 */
@@ -5572,12 +5567,6 @@ cmd_set_bonding_agg_mode(void *parsed_result,
struct cmd_set_bonding_agg_mode_policy_result *res = parsed_result;
uint8_t policy = AGG_BANDWIDTH;
- if (res->port_num >= nb_ports) {
- printf("Port id %d must be less than %d\n",
- res->port_num, nb_ports);
- return;
- }
-
if (!strcmp(res->policy, "bandwidth"))
policy = AGG_BANDWIDTH;
else if (!strcmp(res->policy, "stable"))
@@ -10725,11 +10714,6 @@ cmd_flow_director_mask_parsed(void *parsed_result,
struct rte_eth_fdir_masks *mask;
struct rte_port *port;
- if (res->port_id > nb_ports) {
- printf("Invalid port, range is [0, %d]\n", nb_ports - 1);
- return;
- }
-
port = &ports[res->port_id];
/** Check if the port is not started **/
if (port->port_status != RTE_PORT_STOPPED) {
@@ -10926,11 +10910,6 @@ cmd_flow_director_flex_mask_parsed(void *parsed_result,
uint16_t i;
int ret;
- if (res->port_id > nb_ports) {
- printf("Invalid port, range is [0, %d]\n", nb_ports - 1);
- return;
- }
-
port = &ports[res->port_id];
/** Check if the port is not started **/
if (port->port_status != RTE_PORT_STOPPED) {
@@ -11082,11 +11061,6 @@ cmd_flow_director_flxpld_parsed(void *parsed_result,
struct rte_port *port;
int ret = 0;
- if (res->port_id > nb_ports) {
- printf("Invalid port, range is [0, %d]\n", nb_ports - 1);
- return;
- }
-
port = &ports[res->port_id];
/** Check if the port is not started **/
if (port->port_status != RTE_PORT_STOPPED) {
@@ -14467,11 +14441,6 @@ cmd_ddp_add_parsed(
int file_num;
int ret = -ENOTSUP;
- if (res->port_id > nb_ports) {
- printf("Invalid port, range is [0, %d]\n", nb_ports - 1);
- return;
- }
-
if (!all_ports_stopped()) {
printf("Please stop all ports first\n");
return;
@@ -14549,11 +14518,6 @@ cmd_ddp_del_parsed(
uint32_t size;
int ret = -ENOTSUP;
- if (res->port_id > nb_ports) {
- printf("Invalid port, range is [0, %d]\n", nb_ports - 1);
- return;
- }
-
if (!all_ports_stopped()) {
printf("Please stop all ports first\n");
return;
@@ -14864,11 +14828,6 @@ cmd_ddp_get_list_parsed(
#endif
int ret = -ENOTSUP;
- if (res->port_id > nb_ports) {
- printf("Invalid port, range is [0, %d]\n", nb_ports - 1);
- return;
- }
-
#ifdef RTE_LIBRTE_I40E_PMD
size = PROFILE_INFO_SIZE * MAX_PROFILE_NUM + 4;
p_list = (struct rte_pmd_i40e_profile_list *)malloc(size);
@@ -14942,11 +14901,6 @@ cmd_cfg_input_set_parsed(
#endif
int ret = -ENOTSUP;
- if (res->port_id > nb_ports) {
- printf("Invalid port, range is [0, %d]\n", nb_ports - 1);
- return;
- }
-
if (!all_ports_stopped()) {
printf("Please stop all ports first\n");
return;
@@ -15070,11 +15024,6 @@ cmd_clear_input_set_parsed(
#endif
int ret = -ENOTSUP;
- if (res->port_id > nb_ports) {
- printf("Invalid port, range is [0, %d]\n", nb_ports - 1);
- return;
- }
-
if (!all_ports_stopped()) {
printf("Please stop all ports first\n");
return;
diff --git a/doc/guides/sample_app_ug/flow_classify.rst b/doc/guides/sample_app_ug/flow_classify.rst
index a0095962c..003ed0356 100644
--- a/doc/guides/sample_app_ug/flow_classify.rst
+++ b/doc/guides/sample_app_ug/flow_classify.rst
@@ -279,9 +279,6 @@ Forwarding application is shown below:
int retval;
uint16_t q;
- if (port >= rte_eth_dev_count())
- return -1;
-
/* Configure the Ethernet device. */
retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
if (retval != 0)
diff --git a/doc/guides/sample_app_ug/kernel_nic_interface.rst b/doc/guides/sample_app_ug/kernel_nic_interface.rst
index 580d06b5b..fc110997f 100644
--- a/doc/guides/sample_app_ug/kernel_nic_interface.rst
+++ b/doc/guides/sample_app_ug/kernel_nic_interface.rst
@@ -511,11 +511,6 @@ Application may choose to not implement following callbacks:
int ret;
struct rte_eth_conf conf;
- if (port_id >= rte_eth_dev_count()) {
- RTE_LOG(ERR, APP, "Invalid port id %d\n", port_id);
- return -EINVAL;
- }
-
RTE_LOG(INFO, APP, "Change MTU of port %d to %u\n", port_id, new_mtu);
/* Stop specific port */
@@ -559,11 +554,6 @@ Application may choose to not implement following callbacks:
{
int ret = 0;
- if (port_id >= rte_eth_dev_count() || port_id >= RTE_MAX_ETHPORTS) {
- RTE_LOG(ERR, APP, "Invalid port id %d\n", port_id);
- return -EINVAL;
- }
-
RTE_LOG(INFO, APP, "Configure network interface of %d %s\n",
port_id, if_up ? "up" : "down");
diff --git a/doc/guides/sample_app_ug/l2_forward_job_stats.rst b/doc/guides/sample_app_ug/l2_forward_job_stats.rst
index f14a780ae..d7219a293 100644
--- a/doc/guides/sample_app_ug/l2_forward_job_stats.rst
+++ b/doc/guides/sample_app_ug/l2_forward_job_stats.rst
@@ -178,11 +178,6 @@ in the *DPDK Programmer's Guide* and the *DPDK API Reference*.
.. code-block:: c
- nb_ports = rte_eth_dev_count();
-
- if (nb_ports == 0)
- rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
-
/* reset l2fwd_dst_ports */
for (portid = 0; portid < RTE_MAX_ETHPORTS; portid++)
diff --git a/doc/guides/sample_app_ug/l2_forward_real_virtual.rst b/doc/guides/sample_app_ug/l2_forward_real_virtual.rst
index c91f57380..b459d4efe 100644
--- a/doc/guides/sample_app_ug/l2_forward_real_virtual.rst
+++ b/doc/guides/sample_app_ug/l2_forward_real_virtual.rst
@@ -197,11 +197,6 @@ in the *DPDK Programmer's Guide* - Rel 1.4 EAR and the *DPDK API Reference*.
if (rte_pci_probe() < 0)
rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
- nb_ports = rte_eth_dev_count();
-
- if (nb_ports == 0)
- rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
-
/* reset l2fwd_dst_ports */
for (portid = 0; portid < RTE_MAX_ETHPORTS; portid++)
diff --git a/doc/guides/sample_app_ug/link_status_intr.rst b/doc/guides/sample_app_ug/link_status_intr.rst
index 57673456b..8c11ba4ae 100644
--- a/doc/guides/sample_app_ug/link_status_intr.rst
+++ b/doc/guides/sample_app_ug/link_status_intr.rst
@@ -91,10 +91,6 @@ To fully understand this code, it is recommended to study the chapters that rela
if (rte_pci_probe() < 0)
rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
- nb_ports = rte_eth_dev_count();
- if (nb_ports == 0)
- rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
-
/*
* Each logical core is assigned a dedicated TX queue on each port.
*/
diff --git a/doc/guides/sample_app_ug/rxtx_callbacks.rst b/doc/guides/sample_app_ug/rxtx_callbacks.rst
index 0bb0d3e00..85d96d8a2 100644
--- a/doc/guides/sample_app_ug/rxtx_callbacks.rst
+++ b/doc/guides/sample_app_ug/rxtx_callbacks.rst
@@ -83,9 +83,6 @@ comments:
int retval;
uint16_t q;
- if (port >= rte_eth_dev_count())
- return -1;
-
/* Configure the Ethernet device. */
retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
if (retval != 0)
diff --git a/doc/guides/sample_app_ug/skeleton.rst b/doc/guides/sample_app_ug/skeleton.rst
index d3a3712f4..959561716 100644
--- a/doc/guides/sample_app_ug/skeleton.rst
+++ b/doc/guides/sample_app_ug/skeleton.rst
@@ -119,7 +119,7 @@ Forwarding application is shown below:
int retval;
uint16_t q;
- if (port >= rte_eth_dev_count())
+ if (!rte_eth_dev_is_valid_port(port))
return -1;
/* Configure the Ethernet device. */
@@ -192,7 +192,6 @@ looks like the following:
static __attribute__((noreturn)) void
lcore_main(void)
{
- const uint16_t nb_ports = rte_eth_dev_count();
uint16_t port;
/*
diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
index 3c4525695..254cc0676 100644
--- a/examples/bbdev_app/main.c
+++ b/examples/bbdev_app/main.c
@@ -1017,7 +1017,7 @@ int
main(int argc, char **argv)
{
int ret;
- unsigned int nb_bbdevs, nb_ports, flags, lcore_id;
+ unsigned int nb_bbdevs, flags, lcore_id;
void *sigret;
struct app_config_params app_params = def_app_config;
struct rte_mempool *ethdev_mbuf_mempool, *bbdev_mbuf_mempool;
@@ -1079,12 +1079,10 @@ main(int argc, char **argv)
nb_bbdevs, app_params.bbdev_id);
printf("Number of bbdevs detected: %d\n", nb_bbdevs);
- /* Get the number of available ethdev devices */
- nb_ports = rte_eth_dev_count();
- if (nb_ports <= app_params.port_id)
+ if (!rte_eth_dev_is_valid_port(app_params.port_id))
rte_exit(EXIT_FAILURE,
- "%u ports detected, cannot use port with ID %u!\n",
- nb_ports, app_params.port_id);
+ "cannot use port with ID %u!\n",
+ app_params.port_id);
/* create the mbuf mempool for ethdev pkts */
ethdev_mbuf_mempool = rte_pktmbuf_pool_create("ethdev_mbuf_pool",
diff --git a/examples/bond/main.c b/examples/bond/main.c
index d68162f1d..d4097d04d 100644
--- a/examples/bond/main.c
+++ b/examples/bond/main.c
@@ -147,7 +147,7 @@ slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool)
struct rte_eth_txconf txq_conf;
struct rte_eth_conf local_port_conf = port_conf;
- if (portid >= rte_eth_dev_count())
+ if (!rte_eth_dev_is_valid_port(portid))
rte_exit(EXIT_FAILURE, "Invalid port\n");
rte_eth_dev_info_get(portid, &dev_info);
diff --git a/examples/distributor/main.c b/examples/distributor/main.c
index 62831a05c..2e6b09d21 100644
--- a/examples/distributor/main.c
+++ b/examples/distributor/main.c
@@ -116,7 +116,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
struct rte_eth_dev_info dev_info;
struct rte_eth_txconf txconf;
- if (port >= rte_eth_dev_count())
+ if (!rte_eth_dev_is_valid_port(port))
return -1;
rte_eth_dev_info_get(port, &dev_info);
diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index bbab99597..48358a7d2 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -285,7 +285,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
struct rte_eth_dev_info dev_info;
struct rte_eth_txconf txconf;
- if (port >= rte_eth_dev_count())
+ if (!rte_eth_dev_is_valid_port(port))
return -1;
rte_eth_dev_info_get(port, &dev_info);
diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c
index a65ef20f9..d0e537e7d 100644
--- a/examples/flow_classify/flow_classify.c
+++ b/examples/flow_classify/flow_classify.c
@@ -200,7 +200,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
struct rte_eth_dev_info dev_info;
struct rte_eth_txconf txconf;
- if (port >= rte_eth_dev_count())
+ if (rte_eth_dev_is_valid_port(port))
return -1;
rte_eth_dev_info_get(port, &dev_info);
diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 3001d626b..6bbb920f9 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -848,7 +848,7 @@ static int32_t
check_params(void)
{
uint8_t lcore;
- uint16_t portid, nb_ports;
+ uint16_t portid;
uint16_t i;
int32_t socket_id;
@@ -857,8 +857,6 @@ check_params(void)
return -1;
}
- nb_ports = rte_eth_dev_count();
-
for (i = 0; i < nb_lcore_params; ++i) {
lcore = lcore_params[i].lcore_id;
if (!rte_lcore_is_enabled(lcore)) {
@@ -877,7 +875,7 @@ check_params(void)
printf("port %u is not enabled in port mask\n", portid);
return -1;
}
- if (portid >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(portid)) {
printf("port %u is not present on the board\n", portid);
return -1;
}
diff --git a/examples/kni/main.c b/examples/kni/main.c
index f069788ce..1855c64ab 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -689,7 +689,7 @@ kni_change_mtu(uint16_t port_id, unsigned int new_mtu)
struct rte_eth_dev_info dev_info;
struct rte_eth_rxconf rxq_conf;
- if (port_id >= rte_eth_dev_count()) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
RTE_LOG(ERR, APP, "Invalid port id %d\n", port_id);
return -EINVAL;
}
@@ -748,7 +748,7 @@ kni_config_network_interface(uint16_t port_id, uint8_t if_up)
{
int ret = 0;
- if (port_id >= rte_eth_dev_count() || port_id >= RTE_MAX_ETHPORTS) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
RTE_LOG(ERR, APP, "Invalid port id %d\n", port_id);
return -EINVAL;
}
@@ -782,7 +782,7 @@ kni_config_mac_address(uint16_t port_id, uint8_t mac_addr[])
{
int ret = 0;
- if (port_id >= rte_eth_dev_count() || port_id >= RTE_MAX_ETHPORTS) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
RTE_LOG(ERR, APP, "Invalid port id %d\n", port_id);
return -EINVAL;
}
@@ -927,7 +927,7 @@ main(int argc, char** argv)
/* Check if the configured port ID is valid */
for (i = 0; i < RTE_MAX_ETHPORTS; i++)
- if (kni_port_params_array[i] && i >= nb_sys_ports)
+ if (kni_port_params_array[i] && !rte_eth_dev_is_valid_port(i))
rte_exit(EXIT_FAILURE, "Configured invalid "
"port ID %u\n", i);
diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c
index 344292864..ed4878043 100644
--- a/examples/l2fwd-cat/l2fwd-cat.c
+++ b/examples/l2fwd-cat/l2fwd-cat.c
@@ -39,7 +39,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
uint16_t nb_rxd = RX_RING_SIZE;
uint16_t nb_txd = TX_RING_SIZE;
- if (port >= rte_eth_dev_count())
+ if (!rte_eth_dev_is_valid_port(port))
return -1;
/* Configure the Ethernet device. */
diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index 3c547cd8e..2c891b494 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -1452,7 +1452,7 @@ check_lcore_params(void)
}
static int
-check_port_config(const unsigned nb_ports)
+check_port_config(void)
{
unsigned portid;
uint16_t i;
@@ -1464,7 +1464,7 @@ check_port_config(const unsigned nb_ports)
printf("port %u is not enabled in port mask\n", portid);
return -1;
}
- if (portid >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(portid)) {
printf("port %u is not present on the board\n", portid);
return -1;
}
@@ -1893,7 +1893,7 @@ main(int argc, char **argv)
nb_ports = rte_eth_dev_count();
- if (check_port_config(nb_ports) < 0)
+ if (check_port_config() < 0)
rte_exit(EXIT_FAILURE, "check_port_config failed\n");
/* Add ACL rules and route entries, build trie */
diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index 16f4d098c..d6a092618 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -1056,7 +1056,7 @@ check_lcore_params(void)
}
static int
-check_port_config(const unsigned nb_ports)
+check_port_config(void)
{
unsigned portid;
uint16_t i;
@@ -1068,7 +1068,7 @@ check_port_config(const unsigned nb_ports)
portid);
return -1;
}
- if (portid >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(portid)) {
printf("port %u is not present on the board\n",
portid);
return -1;
@@ -1652,7 +1652,7 @@ main(int argc, char **argv)
nb_ports = rte_eth_dev_count();
- if (check_port_config(nb_ports) < 0)
+ if (check_port_config() < 0)
rte_exit(EXIT_FAILURE, "check_port_config failed\n");
nb_lcores = rte_lcore_count();
diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c
index 7a9927c34..dd0e057ef 100644
--- a/examples/l3fwd-vf/main.c
+++ b/examples/l3fwd-vf/main.c
@@ -575,7 +575,7 @@ check_lcore_params(void)
}
static int
-check_port_config(const unsigned nb_ports)
+check_port_config(void)
{
unsigned portid;
uint16_t i;
@@ -586,7 +586,7 @@ check_port_config(const unsigned nb_ports)
printf("port %u is not enabled in port mask\n", portid);
return -1;
}
- if (portid >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(portid)) {
printf("port %u is not present on the board\n", portid);
return -1;
}
@@ -951,7 +951,7 @@ main(int argc, char **argv)
nb_ports = rte_eth_dev_count();
- if (check_port_config(nb_ports) < 0)
+ if (check_port_config() < 0)
rte_exit(EXIT_FAILURE, "check_port_config failed\n");
nb_lcores = rte_lcore_count();
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index 8f7961cec..ec1da5c18 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -210,7 +210,7 @@ check_lcore_params(void)
}
static int
-check_port_config(const unsigned nb_ports)
+check_port_config(void)
{
uint16_t portid;
uint16_t i;
@@ -221,7 +221,7 @@ check_port_config(const unsigned nb_ports)
printf("port %u is not enabled in port mask\n", portid);
return -1;
}
- if (portid >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(portid)) {
printf("port %u is not present on the board\n", portid);
return -1;
}
@@ -828,7 +828,7 @@ main(int argc, char **argv)
nb_ports = rte_eth_dev_count();
- if (check_port_config(nb_ports) < 0)
+ if (check_port_config() < 0)
rte_exit(EXIT_FAILURE, "check_port_config failed\n");
nb_lcores = rte_lcore_count();
diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c
index 2fbf08803..75cad0cca 100644
--- a/examples/multi_process/symmetric_mp/main.c
+++ b/examples/multi_process/symmetric_mp/main.c
@@ -204,7 +204,7 @@ smp_port_init(uint16_t port, struct rte_mempool *mbuf_pool,
if (rte_eal_process_type() == RTE_PROC_SECONDARY)
return 0;
- if (port >= rte_eth_dev_count())
+ if (!rte_eth_dev_is_valid_port(port))
return -1;
printf("# Initialising port %u... ", port);
diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c
index 964e23c2e..676cb6f71 100644
--- a/examples/packet_ordering/main.c
+++ b/examples/packet_ordering/main.c
@@ -261,7 +261,6 @@ configure_eth_port(uint16_t port_id)
{
struct ether_addr addr;
const uint16_t rxRings = 1, txRings = 1;
- const uint8_t nb_ports = rte_eth_dev_count();
int ret;
uint16_t q;
uint16_t nb_rxd = RX_DESC_PER_QUEUE;
@@ -270,7 +269,7 @@ configure_eth_port(uint16_t port_id)
struct rte_eth_txconf txconf;
struct rte_eth_conf port_conf = port_conf_default;
- if (port_id > nb_ports)
+ if (!rte_eth_dev_is_valid_port(port_id))
return -1;
rte_eth_dev_info_get(port_id, &dev_info);
diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c
index 4fafed16d..699b99d00 100644
--- a/examples/performance-thread/l3fwd-thread/main.c
+++ b/examples/performance-thread/l3fwd-thread/main.c
@@ -2491,7 +2491,7 @@ check_lcore_params(void)
}
static int
-check_port_config(const unsigned nb_ports)
+check_port_config(void)
{
unsigned portid;
uint16_t i;
@@ -2502,7 +2502,7 @@ check_port_config(const unsigned nb_ports)
printf("port %u is not enabled in port mask\n", portid);
return -1;
}
- if (portid >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(portid)) {
printf("port %u is not present on the board\n", portid);
return -1;
}
@@ -3516,7 +3516,7 @@ main(int argc, char **argv)
nb_ports = rte_eth_dev_count();
- if (check_port_config(nb_ports) < 0)
+ if (check_port_config() < 0)
rte_exit(EXIT_FAILURE, "check_port_config failed\n");
nb_lcores = rte_lcore_count();
diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index ad98a392f..55be3f7cd 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -187,7 +187,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
uint16_t nb_rxd = RX_RING_SIZE;
uint16_t nb_txd = TX_RING_SIZE;
- if (port >= rte_eth_dev_count())
+ if (!rte_eth_dev_is_valid_port(port))
return -1;
rte_eth_dev_info_get(port, &dev_info);
diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
index 46dacc7ef..84b09cf05 100644
--- a/examples/rxtx_callbacks/main.c
+++ b/examples/rxtx_callbacks/main.c
@@ -80,7 +80,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
struct rte_eth_dev_info dev_info;
struct rte_eth_txconf txconf;
- if (port >= rte_eth_dev_count())
+ if (!rte_eth_dev_is_valid_port(port))
return -1;
rte_eth_dev_info_get(port, &dev_info);
diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c
index 11a9b5747..5ac1dc820 100644
--- a/examples/skeleton/basicfwd.c
+++ b/examples/skeleton/basicfwd.c
@@ -42,7 +42,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
struct rte_eth_dev_info dev_info;
struct rte_eth_txconf txconf;
- if (port >= rte_eth_dev_count())
+ if (!rte_eth_dev_is_valid_port(port))
return -1;
rte_eth_dev_info_get(port, &dev_info);
diff --git a/examples/tep_termination/main.c b/examples/tep_termination/main.c
index cc12cd87a..e86854176 100644
--- a/examples/tep_termination/main.c
+++ b/examples/tep_termination/main.c
@@ -515,11 +515,10 @@ check_ports_num(unsigned max_nb_ports)
}
for (portid = 0; portid < nb_ports; portid++) {
- if (ports[portid] >= max_nb_ports) {
+ if (!rte_eth_dev_is_valid_port(ports[portid])) {
RTE_LOG(INFO, VHOST_PORT,
- "\nSpecified port ID(%u) exceeds max "
- " system port ID(%u)\n",
- ports[portid], (max_nb_ports - 1));
+ "\nSpecified port ID(%u) is not valid\n",
+ ports[portid]);
ports[portid] = INVALID_PORT_ID;
valid_nb_ports--;
}
diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c
index ba7d92aac..299c29d27 100644
--- a/examples/tep_termination/vxlan_setup.c
+++ b/examples/tep_termination/vxlan_setup.c
@@ -133,7 +133,7 @@ vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool)
txconf = &dev_info.default_txconf;
txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
- if (port >= rte_eth_dev_count())
+ if (!rte_eth_dev_is_valid_port(port))
return -1;
rx_rings = nb_devices;
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 0b5221f1e..7cddac7d2 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -294,7 +294,8 @@ port_init(uint16_t port)
printf("pf queue num: %u, configured vmdq pool num: %u, each vmdq pool has %u queues\n",
num_pf_queues, num_devices, queues_per_pool);
- if (port >= rte_eth_dev_count()) return -1;
+ if (!rte_eth_dev_is_valid_port(port))
+ return -1;
rx_rings = (uint16_t)dev_info.max_rx_queues;
if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
@@ -667,9 +668,10 @@ static unsigned check_ports_num(unsigned nb_ports)
}
for (portid = 0; portid < num_ports; portid ++) {
- if (ports[portid] >= nb_ports) {
- RTE_LOG(INFO, VHOST_PORT, "\nSpecified port ID(%u) exceeds max system port ID(%u)\n",
- ports[portid], (nb_ports - 1));
+ if (!rte_eth_dev_is_valid_port(ports[portid])) {
+ RTE_LOG(INFO, VHOST_PORT,
+ "\nSpecified port ID(%u) is not valid\n",
+ ports[portid]);
ports[portid] = INVALID_PORT_ID;
valid_num_ports--;
}
diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c
index 4cde828f9..db0ddb01d 100644
--- a/examples/vm_power_manager/main.c
+++ b/examples/vm_power_manager/main.c
@@ -61,7 +61,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
struct rte_eth_dev_info dev_info;
struct rte_eth_txconf txq_conf;
- if (port >= rte_eth_dev_count())
+ if (!rte_eth_dev_is_valid_port(port))
return -1;
rte_eth_dev_info_get(port, &dev_info);
diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 72845241e..2f3eb74f5 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -201,7 +201,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
num_pf_queues, num_pools, queues_per_pool);
printf("vmdq queue base: %d pool base %d\n",
vmdq_queue_base, vmdq_pool_base);
- if (port >= rte_eth_dev_count())
+ if (!rte_eth_dev_is_valid_port(port))
return -1;
/*
@@ -539,9 +539,9 @@ static unsigned check_ports_num(unsigned nb_ports)
}
for (portid = 0; portid < num_ports; portid++) {
- if (ports[portid] >= nb_ports) {
- printf("\nSpecified port ID(%u) exceeds max system port ID(%u)\n",
- ports[portid], (nb_ports - 1));
+ if (!rte_eth_dev_is_valid_port(ports[portid])) {
+ printf("\nSpecified port ID(%u) is not valid\n",
+ ports[portid]);
ports[portid] = INVALID_PORT_ID;
valid_num_ports--;
}
diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c
index 2016a9571..9c68ab089 100644
--- a/examples/vmdq_dcb/main.c
+++ b/examples/vmdq_dcb/main.c
@@ -246,7 +246,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
num_pools, queues_per_pool);
}
- if (port >= rte_eth_dev_count())
+ if (!rte_eth_dev_is_valid_port(port))
return -1;
retval = get_eth_conf(&port_conf);
@@ -599,9 +599,9 @@ static unsigned check_ports_num(unsigned nb_ports)
}
for (portid = 0; portid < num_ports; portid++) {
- if (ports[portid] >= nb_ports) {
- printf("\nSpecified port ID(%u) exceeds max system port ID(%u)\n",
- ports[portid], (nb_ports - 1));
+ if (!rte_eth_dev_is_valid_port(ports[portid])) {
+ printf("\nSpecified port ID(%u) is not valid\n",
+ ports[portid]);
ports[portid] = INVALID_PORT_ID;
valid_num_ports--;
}
diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c
index 28674115f..8a8f6c1cc 100644
--- a/lib/librte_kni/rte_kni.c
+++ b/lib/librte_kni/rte_kni.c
@@ -510,7 +510,7 @@ kni_config_mac_address(uint16_t port_id, uint8_t mac_addr[])
{
int ret = 0;
- if (port_id >= rte_eth_dev_count() || port_id >= RTE_MAX_ETHPORTS) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
RTE_LOG(ERR, KNI, "Invalid port id %d\n", port_id);
return -EINVAL;
}
@@ -530,7 +530,7 @@ kni_config_mac_address(uint16_t port_id, uint8_t mac_addr[])
static int
kni_config_promiscusity(uint16_t port_id, uint8_t to_on)
{
- if (port_id >= rte_eth_dev_count() || port_id >= RTE_MAX_ETHPORTS) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
RTE_LOG(ERR, KNI, "Invalid port id %d\n", port_id);
return -EINVAL;
}
diff --git a/test/test/test_event_eth_rx_adapter.c b/test/test/test_event_eth_rx_adapter.c
index 1b913a25f..2234df0eb 100644
--- a/test/test/test_event_eth_rx_adapter.c
+++ b/test/test/test_event_eth_rx_adapter.c
@@ -51,7 +51,7 @@ port_init(uint8_t port, struct rte_mempool *mp)
uint16_t q;
struct rte_eth_dev_info dev_info;
- if (port >= rte_eth_dev_count())
+ if (!rte_eth_dev_is_valid_port(port))
return -1;
retval = rte_eth_dev_configure(port, 0, 0, &port_conf);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* Re: [dpdk-stable] patch 'fix ethdev port id validation' has been queued to stable release 18.02.2
2018-04-30 14:41 ` [dpdk-stable] patch 'fix ethdev port id validation' " luca.boccassi
@ 2018-04-30 15:04 ` Thomas Monjalon
2018-04-30 15:41 ` Luca Boccassi
0 siblings, 1 reply; 382+ messages in thread
From: Thomas Monjalon @ 2018-04-30 15:04 UTC (permalink / raw)
To: luca.boccassi; +Cc: dpdk stable
30/04/2018 16:41, luca.boccassi@gmail.com:
> Hi,
>
> FYI, your patch has been queued to stable release 18.02.2
>
> Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
> It will be pushed if I get no objections before 05/02/18. So please
> shout if anyone has objections.
I did not plan to backport it. But yes, it may be a good idead.
In this case, you need to backport some fixes on top of it:
app/testpmd: fix build without i40e
examples/flow_classify: fix validation in port init
> ---
> From 17bf70baba04313dc1ceef180f2f19da7f5ecad1 Mon Sep 17 00:00:00 2001
> From: Thomas Monjalon <thomas@monjalon.net>
> Date: Thu, 5 Apr 2018 17:33:21 +0200
> Subject: [PATCH] fix ethdev port id validation
>
> [ upstream commit a9dbe180222680edf8c49e86791f972549ce5be3 ]
>
> Some DPDK applications wrongly assume these requirements:
> - no hotplug, i.e. ports are never detached
> - all allocated ports are available to the application
>
> Such application assume a valid port index is in the range [0..count[.
>
> There are three consequences when using such wrong design:
> - new ports having an index higher than the port count won't be valid
> - old ports being detached (RTE_ETH_DEV_UNUSED) can be valid
>
> Such mistake will be less common with growing hotplug awareness.
> All applications and examples inside this repository - except testpmd -
> must be fixed to use the function rte_eth_dev_is_valid_port.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
^ permalink raw reply [flat|nested] 382+ messages in thread
* Re: [dpdk-stable] patch 'fix ethdev port id validation' has been queued to stable release 18.02.2
2018-04-30 15:04 ` Thomas Monjalon
@ 2018-04-30 15:41 ` Luca Boccassi
0 siblings, 0 replies; 382+ messages in thread
From: Luca Boccassi @ 2018-04-30 15:41 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dpdk stable
On Mon, 2018-04-30 at 17:04 +0200, Thomas Monjalon wrote:
> 30/04/2018 16:41, luca.boccassi@gmail.com:
> > Hi,
> >
> > FYI, your patch has been queued to stable release 18.02.2
> >
> > Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable
> > yet.
> > It will be pushed if I get no objections before 05/02/18. So please
> > shout if anyone has objections.
>
> I did not plan to backport it. But yes, it may be a good idead.
> In this case, you need to backport some fixes on top of it:
> app/testpmd: fix build without i40e
> examples/flow_classify: fix validation in port init
Thanks, applied those as well.
--
Kind regards,
Luca Boccassi
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'bus/fslmc: fix build with clang 3.4' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (56 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'fix ethdev port id validation' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'doc: fix a typo in the EAL guide' " luca.boccassi
` (25 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Hemant Agrawal; +Cc: Maxime Coquelin, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 1859b6389d18c1c27bcc93ceacaa96378c7b4eae Mon Sep 17 00:00:00 2001
From: Hemant Agrawal <hemant.agrawal@nxp.com>
Date: Thu, 19 Apr 2018 18:02:39 +0530
Subject: [PATCH] bus/fslmc: fix build with clang 3.4
[ upstream commit 3ef648aa4854f53b5ad3f148dc021852157a0246 ]
error: redefinition of typedef 'dma_addr_t' is a C11 feature
[-Werror,-Wtypedef-redefinition]
Fixes: 4bc5ab88dbd6 ("net/dpaa2: fix Tx only mode")
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Tested-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
drivers/bus/fslmc/qbman/include/fsl_qbman_base.h | 2 --
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 3 +++
drivers/net/dpaa2/dpaa2_rxtx.c | 4 ++--
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/bus/fslmc/qbman/include/fsl_qbman_base.h b/drivers/bus/fslmc/qbman/include/fsl_qbman_base.h
index 96269ed4a..bb60a98f9 100644
--- a/drivers/bus/fslmc/qbman/include/fsl_qbman_base.h
+++ b/drivers/bus/fslmc/qbman/include/fsl_qbman_base.h
@@ -6,8 +6,6 @@
#ifndef _FSL_QBMAN_BASE_H
#define _FSL_QBMAN_BASE_H
-typedef uint64_t dma_addr_t;
-
/**
* DOC: QBMan basic structures
*
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index 3954afe94..a1fe8e596 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -30,6 +30,9 @@
#include "dpaa2_sec_priv.h"
#include "dpaa2_sec_logs.h"
+/* Required types */
+typedef uint64_t dma_addr_t;
+
/* RTA header files */
#include <hw/desc/ipsec.h>
#include <hw/desc/algo.h>
diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
index 183293c1d..e37b08cb5 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -501,7 +501,7 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
q_storage->last_num_pkts);
qbman_pull_desc_set_fq(&pulldesc, fqid);
qbman_pull_desc_set_storage(&pulldesc, dq_storage,
- (dma_addr_t)(DPAA2_VADDR_TO_IOVA(dq_storage)), 1);
+ (uint64_t)(DPAA2_VADDR_TO_IOVA(dq_storage)), 1);
if (check_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index)) {
while (!qbman_check_command_complete(
get_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index)))
@@ -535,7 +535,7 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
qbman_pull_desc_set_numframes(&pulldesc, DPAA2_DQRR_RING_SIZE);
qbman_pull_desc_set_fq(&pulldesc, fqid);
qbman_pull_desc_set_storage(&pulldesc, dq_storage1,
- (dma_addr_t)(DPAA2_VADDR_TO_IOVA(dq_storage1)), 1);
+ (uint64_t)(DPAA2_VADDR_TO_IOVA(dq_storage1)), 1);
/* Check if the previous issued command is completed.
* Also seems like the SWP is shared between the Ethernet Driver
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'doc: fix a typo in the EAL guide' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (57 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'bus/fslmc: fix build with clang 3.4' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'doc: fix a typo in rawdev " luca.boccassi
` (24 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Rami Rosen; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From f6e33dd1746dbec2e317d52f0e78b96c60e64547 Mon Sep 17 00:00:00 2001
From: Rami Rosen <rami.rosen@intel.com>
Date: Sat, 21 Apr 2018 23:03:37 -0400
Subject: [PATCH] doc: fix a typo in the EAL guide
[ upstream commit cdba9376c03640605cfe976d96ca91010878a00b ]
This patch fixes a trivial typo in the programmer's guide.
Fixes: 1733be6d3147 ("doc: new eal multi-pthread feature")
Signed-off-by: Rami Rosen <rami.rosen@intel.com>
---
doc/guides/prog_guide/env_abstraction_layer.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/guides/prog_guide/env_abstraction_layer.rst b/doc/guides/prog_guide/env_abstraction_layer.rst
index 9a2fab1e3..559d0f8f9 100644
--- a/doc/guides/prog_guide/env_abstraction_layer.rst
+++ b/doc/guides/prog_guide/env_abstraction_layer.rst
@@ -341,7 +341,7 @@ Known Issues
+ rte_timer
- Running ``rte_timer_manager()`` on a non-EAL pthread is not allowed. However, resetting/stopping the timer from a non-EAL pthread is allowed.
+ Running ``rte_timer_manage()`` on a non-EAL pthread is not allowed. However, resetting/stopping the timer from a non-EAL pthread is allowed.
+ rte_log
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'doc: fix a typo in rawdev guide' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (58 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'doc: fix a typo in the EAL guide' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'doc: fix typos in OcteonTx guides' " luca.boccassi
` (23 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Jerin Jacob; +Cc: Marko Kovacevic, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From fd2a3dbf78a9e60f10f12c8f0475997ebfaf6344 Mon Sep 17 00:00:00 2001
From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Date: Sun, 8 Apr 2018 07:53:38 +0530
Subject: [PATCH] doc: fix a typo in rawdev guide
[ upstream commit 85e59d55cd21e36ca12f3342f63db89d7af1a8e7 ]
Fixes: a9bb0c44c775 ("doc: add rawdev library guide and doxygen page")
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
---
doc/guides/prog_guide/rawdev.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/guides/prog_guide/rawdev.rst b/doc/guides/prog_guide/rawdev.rst
index 54bffc585..42c195cef 100644
--- a/doc/guides/prog_guide/rawdev.rst
+++ b/doc/guides/prog_guide/rawdev.rst
@@ -43,7 +43,7 @@ Key factors guiding design of the Rawdevice library:
* Firmware Management - Firmware load/unload/status
2. Application API should be able to pass along arbitrary state information
- to/fro device driver. This can be achieved by maintaining context
+ to/from device driver. This can be achieved by maintaining context
information through opaque data or pointers.
Figure below outlines the layout of the rawdevice library and device vis-a-vis
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'doc: fix typos in OcteonTx guides' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (59 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'doc: fix a typo in rawdev " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'build: fix default arm64 instruction level' " luca.boccassi
` (22 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Pavan Nikhilesh; +Cc: Marko Kovacevic, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 2a614338e34b34b9eae5caaa5419710035cc28a5 Mon Sep 17 00:00:00 2001
From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Date: Fri, 20 Apr 2018 15:04:10 +0530
Subject: [PATCH] doc: fix typos in OcteonTx guides
[ upstream commit 49781e37e78a1be538e498233b84a2b0e644b5eb ]
Fixes: 26cb0a72412f ("doc: add octeontx platform guide")
Fixes: 48191dde6acf ("doc: add octeontx mempool guide")
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
---
doc/guides/eventdevs/octeontx.rst | 2 +-
doc/guides/platform/octeontx.rst | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/doc/guides/eventdevs/octeontx.rst b/doc/guides/eventdevs/octeontx.rst
index 4fabe54f9..1e8abcec5 100644
--- a/doc/guides/eventdevs/octeontx.rst
+++ b/doc/guides/eventdevs/octeontx.rst
@@ -36,7 +36,7 @@ Supported OCTEONTX SoCs
Prerequisites
-------------
-See :doc: `../platform/octeontx` for setup information.
+See :doc:`../platform/octeontx` for setup information.
Pre-Installation Configuration
------------------------------
diff --git a/doc/guides/platform/octeontx.rst b/doc/guides/platform/octeontx.rst
index dc1aa4fe1..b0a99c38d 100644
--- a/doc/guides/platform/octeontx.rst
+++ b/doc/guides/platform/octeontx.rst
@@ -16,11 +16,11 @@ Common Offload HW Block Drivers
-------------------------------
1. **Eventdev Driver**
- See :doc: `../eventdevs/octeontx.rst` for octeontx ssovf eventdev driver
+ See :doc:`../eventdevs/octeontx` for octeontx ssovf eventdev driver
information.
2. **Mempool Driver**
- See :doc: `../mempool/octeontx.rst` for octeontx fpavf mempool driver
+ See :doc:`../mempool/octeontx` for octeontx fpavf mempool driver
information.
Steps To Setup Platform
@@ -52,4 +52,4 @@ OCTEONTX compatible board:
SDK and related information can be obtained from: `Cavium support site <https://support.cavium.com/>`_.
-- Follow the DPDK :doc: `../linux_gsg/index.rst` to setup the basic DPDK environment.
+- Follow the DPDK :doc:`../linux_gsg/index` to setup the basic DPDK environment.
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'build: fix default arm64 instruction level' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (60 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'doc: fix typos in OcteonTx guides' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'mbuf: fix Tx checksum offload API doc' " luca.boccassi
` (21 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Jerin Jacob; +Cc: Bruce Richardson, Hemant Agrawal, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 6a2a48ef5f75274c1ed49e7dfd4658456b650993 Mon Sep 17 00:00:00 2001
From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Date: Mon, 9 Apr 2018 20:09:46 +0530
Subject: [PATCH] build: fix default arm64 instruction level
[ upstream commit e6084f36256668d60addff8f3023c89d8154b031 ]
The make based build system has crc+crypto instruction
support for the default arm64 build.
http://dpdk.org/browse/dpdk/tree/mk/machine/armv8a/rte.vars.mk#n31
This patch fixes the disparity with meson build flags for armv8.
As a bonus, This patch fixes the following errors with
ip_pipeline example application.
Assembler messages:
Error: selected processor does not support `crc32cx w3,w3,x0'
Fixes: c6e536e38437 ("build: add more implementers IDs and PNs for ARM")
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Tested-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
config/arm/meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 4e788a4e4..faf630c5a 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -8,7 +8,7 @@ march_opt = '-march=@0@'.format(machine)
arm_force_native_march = false
machine_args_generic = [
- ['default', ['-march=armv8-a']],
+ ['default', ['-march=armv8-a+crc+crypto']],
['native', ['-march=native']],
['0xd03', ['-mcpu=cortex-a53']],
['0xd04', ['-mcpu=cortex-a35']],
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'mbuf: fix Tx checksum offload API doc' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (61 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'build: fix default arm64 instruction level' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'mbuf: improve tunnel Tx offloads " luca.boccassi
` (20 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: Olivier Matz, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 2f3d85ead2248160df0581238d7c0d198024f7d9 Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas@monjalon.net>
Date: Fri, 20 Apr 2018 01:39:52 +0200
Subject: [PATCH] mbuf: fix Tx checksum offload API doc
[ upstream commit f00dcb7b0a74928b8b846f73b37386d7b1bb4869 ]
When introducing rte_eth_tx_prepare(), the constraints on checksum
pre-filling for Tx offloads were relaxed because implemented in
the PMDs with rte_net_intel_cksum_flags_prepare() helper.
As a consequence, these old requirements are removed for:
- PKT_TX_OUTER_IP_CKSUM
- PKT_TX_IP_CKSUM
- PKT_TX_[L4]_CKSUM
- PKT_TX_TCP_SEG
Not sure SCTP offload is properly implemented though.
A reference to rte_eth_tx_prepare() is added in rte_eth_tx_burst() doc.
Fixes: 609dd68ef14f ("mbuf: enhance the API documentation of offload flags")
Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation")
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
lib/librte_ether/rte_ethdev.h | 3 +++
lib/librte_mbuf/rte_mbuf.h | 16 +++-------------
2 files changed, 6 insertions(+), 13 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index cf2b254a7..198aceb4f 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -3860,6 +3860,9 @@ static inline int rte_eth_tx_descriptor_status(uint16_t port_id,
* invoke this function concurrently on the same tx queue without SW lock.
* @see rte_eth_dev_info_get, struct rte_eth_txconf::txq_flags
*
+ * @see rte_eth_tx_prepare to perform some prior checks or adjustments
+ * for offloads.
+ *
* @param port_id
* The port identifier of the Ethernet device.
* @param queue_id
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 62740254d..9c319aeff 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -226,12 +226,8 @@ extern "C" {
* - set the PKT_TX_TCP_SEG flag in mbuf->ol_flags (this flag implies
* PKT_TX_TCP_CKSUM)
* - set the flag PKT_TX_IPV4 or PKT_TX_IPV6
- * - if it's IPv4, set the PKT_TX_IP_CKSUM flag and write the IP checksum
- * to 0 in the packet
+ * - if it's IPv4, set the PKT_TX_IP_CKSUM flag
* - fill the mbuf offload information: l2_len, l3_len, l4_len, tso_segsz
- * - calculate the pseudo header checksum without taking ip_len in account,
- * and set it in the TCP header. Refer to rte_ipv4_phdr_cksum() and
- * rte_ipv6_phdr_cksum() that can be used as helpers.
*/
#define PKT_TX_TCP_SEG (1ULL << 50)
@@ -244,9 +240,6 @@ extern "C" {
* - fill l2_len and l3_len in mbuf
* - set the flags PKT_TX_TCP_CKSUM, PKT_TX_SCTP_CKSUM or PKT_TX_UDP_CKSUM
* - set the flag PKT_TX_IPV4 or PKT_TX_IPV6
- * - calculate the pseudo header checksum and set it in the L4 header (only
- * for TCP or UDP). See rte_ipv4_phdr_cksum() and rte_ipv6_phdr_cksum().
- * For SCTP, set the crc field to 0.
*/
#define PKT_TX_L4_NO_CKSUM (0ULL << 52) /**< Disable L4 cksum of TX pkt. */
#define PKT_TX_TCP_CKSUM (1ULL << 52) /**< TCP cksum of TX pkt. computed by NIC. */
@@ -258,7 +251,6 @@ extern "C" {
* Offload the IP checksum in the hardware. The flag PKT_TX_IPV4 should
* also be set by the application, although a PMD will only check
* PKT_TX_IP_CKSUM.
- * - set the IP checksum field in the packet to 0
* - fill the mbuf offload information: l2_len, l3_len
*/
#define PKT_TX_IP_CKSUM (1ULL << 54)
@@ -288,10 +280,8 @@ extern "C" {
/**
* Offload the IP checksum of an external header in the hardware. The
- * flag PKT_TX_OUTER_IPV4 should also be set by the application, alto ugh
- * a PMD will only check PKT_TX_IP_CKSUM. The IP checksum field in the
- * packet must be set to 0.
- * - set the outer IP checksum field in the packet to 0
+ * flag PKT_TX_OUTER_IPV4 should also be set by the application, although
+ * a PMD will only check PKT_TX_OUTER_IP_CKSUM.
* - fill the mbuf offload information: outer_l2_len, outer_l3_len
*/
#define PKT_TX_OUTER_IP_CKSUM (1ULL << 58)
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'mbuf: improve tunnel Tx offloads API doc' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (62 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'mbuf: fix Tx checksum offload API doc' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'test/crypto: add MRVL to hash test cases' " luca.boccassi
` (19 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: Olivier Matz, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From c781568f3727aef981c2cc27ac1b1f8b3e9f3e4e Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas@monjalon.net>
Date: Fri, 20 Apr 2018 01:53:10 +0200
Subject: [PATCH] mbuf: improve tunnel Tx offloads API doc
[ upstream commit ab66fe0e4a1ca058c4e23efd475e48788c0977e7 ]
Add few details to remind TSO flag, checksum flags and header lengths.
The doxygen syntax for MPLS-in-UDP is fixed.
Fixes: d95188551fa1 ("mbuf: introduce new Tx offload flag for MPLS-in-UDP")
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
lib/librte_mbuf/rte_mbuf.h | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 9c319aeff..54a917ba8 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -201,14 +201,17 @@ extern "C" {
/**
* Bits 45:48 used for the tunnel type.
- * When doing Tx offload like TSO or checksum, the HW needs to configure the
- * tunnel type into the HW descriptors.
+ * The tunnel type must be specified for TSO or checksum on the inner part
+ * of tunnel packets.
+ * These flags can be used with PKT_TX_TCP_SEG for TSO, or PKT_TX_xxx_CKSUM.
+ * The mbuf fields for inner and outer header lengths are required:
+ * outer_l2_len, outer_l3_len, l2_len, l3_len, l4_len and tso_segsz for TSO.
*/
#define PKT_TX_TUNNEL_VXLAN (0x1ULL << 45)
#define PKT_TX_TUNNEL_GRE (0x2ULL << 45)
#define PKT_TX_TUNNEL_IPIP (0x3ULL << 45)
#define PKT_TX_TUNNEL_GENEVE (0x4ULL << 45)
-/**< TX packet with MPLS-in-UDP RFC 7510 header. */
+/** TX packet with MPLS-in-UDP RFC 7510 header. */
#define PKT_TX_TUNNEL_MPLSINUDP (0x5ULL << 45)
/* add new TX TUNNEL type here */
#define PKT_TX_TUNNEL_MASK (0xFULL << 45)
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'test/crypto: add MRVL to hash test cases' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (63 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'mbuf: improve tunnel Tx offloads " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'crypto/dpaa_sec: add macro for device name' " luca.boccassi
` (18 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Tomasz Duszynski; +Cc: Pablo de Lara, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 40c93cb4149a21b7b5a0a2bc371c125ab0ab39ee Mon Sep 17 00:00:00 2001
From: Tomasz Duszynski <tdu@semihalf.com>
Date: Wed, 14 Mar 2018 14:12:54 +0100
Subject: [PATCH] test/crypto: add MRVL to hash test cases
[ upstream commit 914bcbb0cfec3ab296591bc82a92c3a91f5c69de ]
MRVL Crypto PMD supports most of the hash algorithms covered
by test suites thus specific bits should be set in pmd_masks.
Otherwise blockcipher authonly test returns success even though no
real tests have been executed.
Fixes: 84e0ded38ac5 ("test/crypto: add mrvl crypto unit tests")
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
test/test/test_cryptodev_hash_test_vectors.h | 66 ++++++++++++++++++----------
1 file changed, 44 insertions(+), 22 deletions(-)
diff --git a/test/test/test_cryptodev_hash_test_vectors.h b/test/test/test_cryptodev_hash_test_vectors.h
index 93dacb7b9..df9202f99 100644
--- a/test/test/test_cryptodev_hash_test_vectors.h
+++ b/test/test/test_cryptodev_hash_test_vectors.h
@@ -324,13 +324,15 @@ static const struct blockcipher_test_case hash_test_cases[] = {
.test_descr = "MD5 Digest",
.test_data = &md5_test_vector,
.op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN,
- .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
+ .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
+ BLOCKCIPHER_TEST_TARGET_PMD_MRVL
},
{
.test_descr = "MD5 Digest Verify",
.test_data = &md5_test_vector,
.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY,
- .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
+ .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
+ BLOCKCIPHER_TEST_TARGET_PMD_MRVL
},
{
.test_descr = "HMAC-MD5 Digest",
@@ -341,7 +343,8 @@ static const struct blockcipher_test_case hash_test_cases[] = {
BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
- BLOCKCIPHER_TEST_TARGET_PMD_QAT
+ BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+ BLOCKCIPHER_TEST_TARGET_PMD_MRVL
},
{
.test_descr = "HMAC-MD5 Digest Verify",
@@ -352,19 +355,22 @@ static const struct blockcipher_test_case hash_test_cases[] = {
BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
- BLOCKCIPHER_TEST_TARGET_PMD_QAT
+ BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+ BLOCKCIPHER_TEST_TARGET_PMD_MRVL
},
{
.test_descr = "SHA1 Digest",
.test_data = &sha1_test_vector,
.op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN,
- .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
+ .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
+ BLOCKCIPHER_TEST_TARGET_PMD_MRVL
},
{
.test_descr = "SHA1 Digest Verify",
.test_data = &sha1_test_vector,
.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY,
- .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
+ .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
+ BLOCKCIPHER_TEST_TARGET_PMD_MRVL
},
{
.test_descr = "HMAC-SHA1 Digest",
@@ -375,7 +381,8 @@ static const struct blockcipher_test_case hash_test_cases[] = {
BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
- BLOCKCIPHER_TEST_TARGET_PMD_QAT
+ BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+ BLOCKCIPHER_TEST_TARGET_PMD_MRVL
},
{
.test_descr = "HMAC-SHA1 Digest Scatter Gather",
@@ -394,7 +401,8 @@ static const struct blockcipher_test_case hash_test_cases[] = {
BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
- BLOCKCIPHER_TEST_TARGET_PMD_QAT
+ BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+ BLOCKCIPHER_TEST_TARGET_PMD_MRVL
},
{
.test_descr = "HMAC-SHA1 Digest Verify Scatter Gather",
@@ -408,13 +416,15 @@ static const struct blockcipher_test_case hash_test_cases[] = {
.test_descr = "SHA224 Digest",
.test_data = &sha224_test_vector,
.op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN,
- .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
+ .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
+ BLOCKCIPHER_TEST_TARGET_PMD_MRVL
},
{
.test_descr = "SHA224 Digest Verify",
.test_data = &sha224_test_vector,
.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY,
- .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
+ .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
+ BLOCKCIPHER_TEST_TARGET_PMD_MRVL
},
{
.test_descr = "HMAC-SHA224 Digest",
@@ -442,13 +452,15 @@ static const struct blockcipher_test_case hash_test_cases[] = {
.test_descr = "SHA256 Digest",
.test_data = &sha256_test_vector,
.op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN,
- .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
+ .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
+ BLOCKCIPHER_TEST_TARGET_PMD_MRVL
},
{
.test_descr = "SHA256 Digest Verify",
.test_data = &sha256_test_vector,
.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY,
- .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
+ .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
+ BLOCKCIPHER_TEST_TARGET_PMD_MRVL
},
{
.test_descr = "HMAC-SHA256 Digest",
@@ -459,7 +471,8 @@ static const struct blockcipher_test_case hash_test_cases[] = {
BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
- BLOCKCIPHER_TEST_TARGET_PMD_QAT
+ BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+ BLOCKCIPHER_TEST_TARGET_PMD_MRVL
},
{
.test_descr = "HMAC-SHA256 Digest Verify",
@@ -470,19 +483,22 @@ static const struct blockcipher_test_case hash_test_cases[] = {
BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
- BLOCKCIPHER_TEST_TARGET_PMD_QAT
+ BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+ BLOCKCIPHER_TEST_TARGET_PMD_MRVL
},
{
.test_descr = "SHA384 Digest",
.test_data = &sha384_test_vector,
.op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN,
- .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
+ .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
+ BLOCKCIPHER_TEST_TARGET_PMD_MRVL
},
{
.test_descr = "SHA384 Digest Verify",
.test_data = &sha384_test_vector,
.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY,
- .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
+ .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
+ BLOCKCIPHER_TEST_TARGET_PMD_MRVL
},
{
.test_descr = "HMAC-SHA384 Digest",
@@ -493,7 +509,8 @@ static const struct blockcipher_test_case hash_test_cases[] = {
BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
- BLOCKCIPHER_TEST_TARGET_PMD_QAT
+ BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+ BLOCKCIPHER_TEST_TARGET_PMD_MRVL
},
{
.test_descr = "HMAC-SHA384 Digest Verify",
@@ -504,19 +521,22 @@ static const struct blockcipher_test_case hash_test_cases[] = {
BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
- BLOCKCIPHER_TEST_TARGET_PMD_QAT
+ BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+ BLOCKCIPHER_TEST_TARGET_PMD_MRVL
},
{
.test_descr = "SHA512 Digest",
.test_data = &sha512_test_vector,
.op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN,
- .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
+ .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
+ BLOCKCIPHER_TEST_TARGET_PMD_MRVL
},
{
.test_descr = "SHA512 Digest Verify",
.test_data = &sha512_test_vector,
.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY,
- .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
+ .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
+ BLOCKCIPHER_TEST_TARGET_PMD_MRVL
},
{
.test_descr = "HMAC-SHA512 Digest",
@@ -527,7 +547,8 @@ static const struct blockcipher_test_case hash_test_cases[] = {
BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
- BLOCKCIPHER_TEST_TARGET_PMD_QAT
+ BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+ BLOCKCIPHER_TEST_TARGET_PMD_MRVL
},
{
.test_descr = "HMAC-SHA512 Digest Verify",
@@ -538,7 +559,8 @@ static const struct blockcipher_test_case hash_test_cases[] = {
BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
- BLOCKCIPHER_TEST_TARGET_PMD_QAT
+ BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+ BLOCKCIPHER_TEST_TARGET_PMD_MRVL
},
};
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'crypto/dpaa_sec: add macro for device name' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (64 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'test/crypto: add MRVL to hash test cases' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'crypto/dpaa_sec: add portal presence check' " luca.boccassi
` (17 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Ashish Jain; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 6240d122e10058bfa9ee0c14cd39cdf72bf90e49 Mon Sep 17 00:00:00 2001
From: Ashish Jain <ashish.jain@nxp.com>
Date: Mon, 2 Apr 2018 21:03:17 +0530
Subject: [PATCH] crypto/dpaa_sec: add macro for device name
[ upstream commit 69cb2eebd17af9e902221619cfd37dc4c280d2ee ]
Fixes: c3e85bdcc6e6 ("crypto/dpaa_sec: add crypto driver for NXP DPAA platform")
Signed-off-by: Ashish Jain <ashish.jain@nxp.com>
---
drivers/crypto/dpaa_sec/dpaa_sec.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.h b/drivers/crypto/dpaa_sec/dpaa_sec.h
index f45b36cb5..b8f7bd23e 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.h
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.h
@@ -7,6 +7,9 @@
#ifndef _DPAA_SEC_H_
#define _DPAA_SEC_H_
+#define CRYPTODEV_NAME_DPAA_SEC_PMD crypto_dpaa_sec
+/**< NXP DPAA - SEC PMD device name */
+
#define NUM_POOL_CHANNELS 4
#define DPAA_SEC_BURST 7
#define DPAA_SEC_ALG_UNSUPPORT (-1)
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'crypto/dpaa_sec: add portal presence check' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (65 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'crypto/dpaa_sec: add macro for device name' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'crypto/dpaa_sec: fix null check in uninit' " luca.boccassi
` (16 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Ashish Jain; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 1180a9ca1288dbec5b311269bc6766a1b29edae4 Mon Sep 17 00:00:00 2001
From: Ashish Jain <ashish.jain@nxp.com>
Date: Mon, 2 Apr 2018 21:03:18 +0530
Subject: [PATCH] crypto/dpaa_sec: add portal presence check
[ upstream commit 5b0f1bd36a83ef63a52bf14913566b9edb2067cc ]
Adding a check to do portal configuration if not already
configured before packet enqueue. This check is only done
during dpaa_sec_attach_sess_q for initial packets,
so this change wont affect the data path and hence performance.
Fixes: e79416d10fa3 ("crypto/dpaa_sec: support multiple sessions per queue pair")
Signed-off-by: Ashish Jain <ashish.jain@nxp.com>
---
drivers/crypto/dpaa_sec/dpaa_sec.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index 18681cf3a..9cf36b063 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -1759,7 +1759,13 @@ dpaa_sec_attach_sess_q(struct dpaa_sec_qp *qp, dpaa_sec_session *sess)
PMD_DRV_LOG(ERR, "Unable to prepare sec cdb");
return -1;
}
-
+ if (unlikely(!RTE_PER_LCORE(dpaa_io))) {
+ ret = rte_dpaa_portal_init((void *)0);
+ if (ret) {
+ PMD_DRV_LOG(ERR, "Failure in affining portal");
+ return ret;
+ }
+ }
ret = dpaa_sec_init_rx(sess->inq, dpaa_mem_vtop(&sess->cdb),
qman_fq_fqid(&qp->outq));
if (ret)
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'crypto/dpaa_sec: fix null check in uninit' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (66 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'crypto/dpaa_sec: add portal presence check' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'crypto/dpaa2_sec: fix OP storage for physical IOVA mode' " luca.boccassi
` (15 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Shreyansh Jain; +Cc: dpdk stable, akhil.goyal
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From e69ac0e7ae435790233aaa26712bf6872fa25449 Mon Sep 17 00:00:00 2001
From: Shreyansh Jain <shreyansh.jain@nxp.com>
Date: Mon, 2 Apr 2018 21:03:19 +0530
Subject: [PATCH] crypto/dpaa_sec: fix null check in uninit
[ upstream commit debef417a0e3609485473e135c5f2fbc541cfc4b ]
Fixes: c3e85bdcc6e6 ("crypto/dpaa_sec: add crypto driver for NXP DPAA platform")
Cc: akhil.goyal@nxp.com
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
drivers/crypto/dpaa_sec/dpaa_sec.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index 9cf36b063..c9bdd5640 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -2252,11 +2252,12 @@ struct rte_security_ops dpaa_sec_security_ops = {
static int
dpaa_sec_uninit(struct rte_cryptodev *dev)
{
- struct dpaa_sec_dev_private *internals = dev->data->dev_private;
+ struct dpaa_sec_dev_private *internals;
if (dev == NULL)
return -ENODEV;
+ internals = dev->data->dev_private;
rte_free(dev->security_ctx);
rte_mempool_free(internals->ctx_pool);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'crypto/dpaa2_sec: fix OP storage for physical IOVA mode' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (67 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'crypto/dpaa_sec: fix null check in uninit' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'test/crypto: add macro for dpaa device name' " luca.boccassi
` (14 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Hemant Agrawal; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 33caa7cb69658351af4dc3a3f1a6d76e6b98d4f2 Mon Sep 17 00:00:00 2001
From: Hemant Agrawal <hemant.agrawal@nxp.com>
Date: Mon, 2 Apr 2018 21:03:21 +0530
Subject: [PATCH] crypto/dpaa2_sec: fix OP storage for physical IOVA mode
[ upstream commit 228e20866a235b478f528d5361c70d4540586b05 ]
op storage in fle is just for reference for post dq.
So, don't convert it to iova mode.
Fixes: 37f96eb01bce ("crypto/dpaa2_sec: support scatter gather")
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 2 --
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 16 ++++++++--------
2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index d421dbf08..9f75f56ff 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -306,7 +306,6 @@ static phys_addr_t dpaa2_mem_vtop(uint64_t vaddr)
*/
#define DPAA2_MBUF_VADDR_TO_IOVA(mbuf) ((mbuf)->buf_iova)
-#define DPAA2_OP_VADDR_TO_IOVA(op) (op->phys_addr)
/**
* macro to convert Virtual address to IOVA
@@ -327,7 +326,6 @@ static phys_addr_t dpaa2_mem_vtop(uint64_t vaddr)
#else /* RTE_LIBRTE_DPAA2_USE_PHYS_IOVA */
#define DPAA2_MBUF_VADDR_TO_IOVA(mbuf) ((mbuf)->buf_addr)
-#define DPAA2_OP_VADDR_TO_IOVA(op) (op)
#define DPAA2_VADDR_TO_IOVA(_vaddr) (_vaddr)
#define DPAA2_IOVA_TO_VADDR(_iova) (_iova)
#define DPAA2_MODIFY_IOVA_TO_VADDR(_mem, _type)
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index a1fe8e596..a64074bfe 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -120,7 +120,7 @@ build_authenc_gcm_sg_fd(dpaa2_sec_session *sess,
return -1;
}
memset(fle, 0, FLE_SG_MEM_SIZE);
- DPAA2_SET_FLE_ADDR(fle, DPAA2_OP_VADDR_TO_IOVA(op));
+ DPAA2_SET_FLE_ADDR(fle, (size_t)op);
DPAA2_FLE_SAVE_CTXT(fle, priv);
op_fle = fle + 1;
@@ -271,7 +271,7 @@ build_authenc_gcm_fd(dpaa2_sec_session *sess,
return -1;
}
memset(fle, 0, FLE_POOL_BUF_SIZE);
- DPAA2_SET_FLE_ADDR(fle, DPAA2_OP_VADDR_TO_IOVA(op));
+ DPAA2_SET_FLE_ADDR(fle, (size_t)op);
DPAA2_FLE_SAVE_CTXT(fle, priv);
fle = fle + 1;
sge = fle + 2;
@@ -416,7 +416,7 @@ build_authenc_sg_fd(dpaa2_sec_session *sess,
return -1;
}
memset(fle, 0, FLE_SG_MEM_SIZE);
- DPAA2_SET_FLE_ADDR(fle, DPAA2_OP_VADDR_TO_IOVA(op));
+ DPAA2_SET_FLE_ADDR(fle, (size_t)op);
DPAA2_FLE_SAVE_CTXT(fle, priv);
op_fle = fle + 1;
@@ -565,7 +565,7 @@ build_authenc_fd(dpaa2_sec_session *sess,
return -1;
}
memset(fle, 0, FLE_POOL_BUF_SIZE);
- DPAA2_SET_FLE_ADDR(fle, DPAA2_OP_VADDR_TO_IOVA(op));
+ DPAA2_SET_FLE_ADDR(fle, (size_t)op);
DPAA2_FLE_SAVE_CTXT(fle, priv);
fle = fle + 1;
sge = fle + 2;
@@ -694,7 +694,7 @@ static inline int build_auth_sg_fd(
}
memset(fle, 0, FLE_SG_MEM_SIZE);
/* first FLE entry used to store mbuf and session ctxt */
- DPAA2_SET_FLE_ADDR(fle, DPAA2_OP_VADDR_TO_IOVA(op));
+ DPAA2_SET_FLE_ADDR(fle, (size_t)op);
DPAA2_FLE_SAVE_CTXT(fle, priv);
op_fle = fle + 1;
ip_fle = fle + 2;
@@ -775,7 +775,7 @@ build_auth_fd(dpaa2_sec_session *sess, struct rte_crypto_op *op,
* to get the MBUF Addr from the previous FLE.
* We can have a better approach to use the inline Mbuf
*/
- DPAA2_SET_FLE_ADDR(fle, DPAA2_OP_VADDR_TO_IOVA(op));
+ DPAA2_SET_FLE_ADDR(fle, (size_t)op);
DPAA2_FLE_SAVE_CTXT(fle, priv);
fle = fle + 1;
@@ -867,7 +867,7 @@ build_cipher_sg_fd(dpaa2_sec_session *sess, struct rte_crypto_op *op,
}
memset(fle, 0, FLE_SG_MEM_SIZE);
/* first FLE entry used to store mbuf and session ctxt */
- DPAA2_SET_FLE_ADDR(fle, DPAA2_OP_VADDR_TO_IOVA(op));
+ DPAA2_SET_FLE_ADDR(fle, (size_t)op);
DPAA2_FLE_SAVE_CTXT(fle, priv);
op_fle = fle + 1;
@@ -989,7 +989,7 @@ build_cipher_fd(dpaa2_sec_session *sess, struct rte_crypto_op *op,
* to get the MBUF Addr from the previous FLE.
* We can have a better approach to use the inline Mbuf
*/
- DPAA2_SET_FLE_ADDR(fle, DPAA2_OP_VADDR_TO_IOVA(op));
+ DPAA2_SET_FLE_ADDR(fle, (size_t)op);
DPAA2_FLE_SAVE_CTXT(fle, priv);
fle = fle + 1;
sge = fle + 2;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'test/crypto: add macro for dpaa device name' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (68 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'crypto/dpaa2_sec: fix OP storage for physical IOVA mode' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'app/crypto-perf: fix excess crypto device error' " luca.boccassi
` (13 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Ashish Jain; +Cc: Pablo de Lara, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 2dc57b69daf942c861e5fd6e27f679d4e36aa900 Mon Sep 17 00:00:00 2001
From: Ashish Jain <ashish.jain@nxp.com>
Date: Mon, 2 Apr 2018 21:03:14 +0530
Subject: [PATCH] test/crypto: add macro for dpaa device name
[ upstream commit b0abcc69447ccbf2ee415c0ed3a09ad1484653a2 ]
Fixes: b674d6d0381a ("test/crypto: add dpaa crypto test cases")
Signed-off-by: Ashish Jain <ashish.jain@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
test/test/test_cryptodev.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/test/test/test_cryptodev.h b/test/test/test_cryptodev.h
index 8cdc0874a..e5379f2e5 100644
--- a/test/test/test_cryptodev.h
+++ b/test/test/test_cryptodev.h
@@ -58,6 +58,7 @@
#define CRYPTODEV_NAME_KASUMI_PMD crypto_kasumi
#define CRYPTODEV_NAME_ZUC_PMD crypto_zuc
#define CRYPTODEV_NAME_ARMV8_PMD crypto_armv8
+#define CRYPTODEV_NAME_DPAA_SEC_PMD crypto_dpaa_sec
#define CRYPTODEV_NAME_DPAA2_SEC_PMD crypto_dpaa2_sec
#define CRYPTODEV_NAME_SCHEDULER_PMD crypto_scheduler
#define CRYPTODEV_NAME_MRVL_PMD crypto_mrvl
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'app/crypto-perf: fix excess crypto device error' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (69 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'test/crypto: add macro for dpaa device name' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'crypto/dpaa_sec: improve the error checking' " luca.boccassi
` (12 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Hemant Agrawal; +Cc: Pablo de Lara, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 332e51a494440a6b662fbaedb2aa54a0c8bfeb90 Mon Sep 17 00:00:00 2001
From: Hemant Agrawal <hemant.agrawal@nxp.com>
Date: Mon, 2 Apr 2018 21:03:15 +0530
Subject: [PATCH] app/crypto-perf: fix excess crypto device error
[ upstream commit dc476f122d9d80173a3b2b68870dc9f334f296c3 ]
If number of available devices are more than logical core,
there is no need to throw an error.
Just use the less number of devices instead.
Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application")
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
app/test-crypto-perf/main.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c
index 019d83598..d905e13a1 100644
--- a/app/test-crypto-perf/main.c
+++ b/app/test-crypto-perf/main.c
@@ -80,12 +80,12 @@ cperf_initialize_cryptodev(struct cperf_options *opts, uint8_t *enabled_cdevs,
nb_lcores = rte_lcore_count() - 1;
- if (enabled_cdev_count > nb_lcores) {
- printf("Number of capable crypto devices (%d) "
- "has to be less or equal to number of slave "
- "cores (%d)\n", enabled_cdev_count, nb_lcores);
- return -EINVAL;
- }
+ /*
+ * Use less number of devices,
+ * if there are more available than cores.
+ */
+ if (enabled_cdev_count > nb_lcores)
+ enabled_cdev_count = nb_lcores;
/* Create a mempool shared by all the devices */
uint32_t max_sess_size = 0, sess_size;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'crypto/dpaa_sec: improve the error checking' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (70 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'app/crypto-perf: fix excess crypto device error' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'crypto/dpaa2_sec: improve error handling' " luca.boccassi
` (11 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Sunil Kumar Kori; +Cc: Akhil Goyal, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From f3790c3be9824fac12d7f181368244653721a26e Mon Sep 17 00:00:00 2001
From: Sunil Kumar Kori <sunil.kori@nxp.com>
Date: Thu, 5 Apr 2018 14:05:48 +0530
Subject: [PATCH] crypto/dpaa_sec: improve the error checking
[ upstream commit 22788c2c6a23d9c6bd6b9766065f0f3c2d203fb1 ]
Reported by NXP's internal coverity
Fixes: c3e85bdcc6e6 ("crypto/dpaa_sec: add crypto driver for NXP DPAA platform")
Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
---
drivers/crypto/dpaa_sec/dpaa_sec.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index c9bdd5640..c979c9ca6 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -388,7 +388,7 @@ static int
dpaa_sec_prep_cdb(dpaa_sec_session *ses)
{
struct alginfo alginfo_c = {0}, alginfo_a = {0}, alginfo = {0};
- uint32_t shared_desc_len = 0;
+ int32_t shared_desc_len = 0;
struct sec_cdb *cdb = &ses->cdb;
int err;
#if RTE_BYTE_ORDER == RTE_BIG_ENDIAN
@@ -530,6 +530,12 @@ dpaa_sec_prep_cdb(dpaa_sec_session *ses)
ses->digest_length, ses->dir);
}
}
+
+ if (shared_desc_len < 0) {
+ PMD_TX_LOG(ERR, "error in preparing command block\n");
+ return shared_desc_len;
+ }
+
cdb->sh_hdr.hi.field.idlen = shared_desc_len;
cdb->sh_hdr.hi.word = rte_cpu_to_be_32(cdb->sh_hdr.hi.word);
cdb->sh_hdr.lo.word = rte_cpu_to_be_32(cdb->sh_hdr.lo.word);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'crypto/dpaa2_sec: improve error handling' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (71 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'crypto/dpaa_sec: improve the error checking' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'examples/l2fwd-crypto: fix the default aead assignments' " luca.boccassi
` (10 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Sunil Kumar Kori; +Cc: Akhil Goyal, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 15c0c24744a894430bb74965612857b2696a1974 Mon Sep 17 00:00:00 2001
From: Sunil Kumar Kori <sunil.kori@nxp.com>
Date: Thu, 5 Apr 2018 14:05:49 +0530
Subject: [PATCH] crypto/dpaa2_sec: improve error handling
[ upstream commit c3b894155f7698c1e5a0a796527258f38e07179a ]
Fixed as reported by NXP's internal coverity.
Also part of dpdk coverity.
Coverity issue: 268331
Coverity issue: 268333
Fixes: 8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation")
Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
---
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 27 +++++++++++++++++++++++----
1 file changed, 23 insertions(+), 4 deletions(-)
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index a64074bfe..f3073aa27 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -1624,7 +1624,7 @@ dpaa2_sec_auth_init(struct rte_cryptodev *dev,
{
struct dpaa2_sec_dev_private *dev_priv = dev->data->dev_private;
struct alginfo authdata;
- unsigned int bufsize, i;
+ int bufsize, i;
struct ctxt_priv *priv;
struct sec_flow_context *flc;
@@ -1720,6 +1720,10 @@ dpaa2_sec_auth_init(struct rte_cryptodev *dev,
bufsize = cnstr_shdsc_hmac(priv->flc_desc[DESC_INITFINAL].desc,
1, 0, &authdata, !session->dir,
session->digest_length);
+ if (bufsize < 0) {
+ DPAA2_SEC_ERR("Crypto: Invalid buffer length");
+ goto error_out;
+ }
flc->word1_sdl = (uint8_t)bufsize;
flc->word2_rflc_31_0 = lower_32_bits(
@@ -1750,7 +1754,7 @@ dpaa2_sec_aead_init(struct rte_cryptodev *dev,
struct dpaa2_sec_aead_ctxt *ctxt = &session->ext_params.aead_ctxt;
struct dpaa2_sec_dev_private *dev_priv = dev->data->dev_private;
struct alginfo aeaddata;
- unsigned int bufsize, i;
+ int bufsize, i;
struct ctxt_priv *priv;
struct sec_flow_context *flc;
struct rte_crypto_aead_xform *aead_xform = &xform->aead;
@@ -1841,6 +1845,11 @@ dpaa2_sec_aead_init(struct rte_cryptodev *dev,
priv->flc_desc[0].desc, 1, 0,
&aeaddata, session->iv.length,
session->digest_length);
+ if (bufsize < 0) {
+ DPAA2_SEC_ERR("Crypto: Invalid buffer length");
+ goto error_out;
+ }
+
flc->word1_sdl = (uint8_t)bufsize;
flc->word2_rflc_31_0 = lower_32_bits(
(uint64_t)&(((struct dpaa2_sec_qp *)
@@ -1870,7 +1879,7 @@ dpaa2_sec_aead_chain_init(struct rte_cryptodev *dev,
struct dpaa2_sec_aead_ctxt *ctxt = &session->ext_params.aead_ctxt;
struct dpaa2_sec_dev_private *dev_priv = dev->data->dev_private;
struct alginfo authdata, cipherdata;
- unsigned int bufsize, i;
+ int bufsize, i;
struct ctxt_priv *priv;
struct sec_flow_context *flc;
struct rte_crypto_cipher_xform *cipher_xform;
@@ -2062,6 +2071,10 @@ dpaa2_sec_aead_chain_init(struct rte_cryptodev *dev,
ctxt->auth_only_len,
session->digest_length,
session->dir);
+ if (bufsize < 0) {
+ DPAA2_SEC_ERR("Crypto: Invalid buffer length");
+ goto error_out;
+ }
} else {
RTE_LOG(ERR, PMD, "Hash before cipher not supported\n");
goto error_out;
@@ -2153,7 +2166,7 @@ dpaa2_sec_set_ipsec_session(struct rte_cryptodev *dev,
struct ipsec_encap_pdb encap_pdb;
struct ipsec_decap_pdb decap_pdb;
struct alginfo authdata, cipherdata;
- unsigned int bufsize;
+ int bufsize;
struct sec_flow_context *flc;
PMD_INIT_FUNC_TRACE();
@@ -2343,6 +2356,12 @@ dpaa2_sec_set_ipsec_session(struct rte_cryptodev *dev,
1, 0, &decap_pdb, &cipherdata, &authdata);
} else
goto out;
+
+ if (bufsize < 0) {
+ DPAA2_SEC_ERR("Crypto: Invalid buffer length");
+ goto out;
+ }
+
flc->word1_sdl = (uint8_t)bufsize;
/* Enable the stashing control bit */
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'examples/l2fwd-crypto: fix the default aead assignments' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (72 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'crypto/dpaa2_sec: improve error handling' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'examples/ipsec-secgw: fix usage print' " luca.boccassi
` (9 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Hemant Agrawal; +Cc: Akhil Goyal, Pablo de Lara, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 7111dade83670a49327af395bc4d5f0fa890d3ed Mon Sep 17 00:00:00 2001
From: Hemant Agrawal <hemant.agrawal@nxp.com>
Date: Wed, 11 Apr 2018 14:45:47 +0530
Subject: [PATCH] examples/l2fwd-crypto: fix the default aead assignments
[ upstream commit d2c4b7d365d6c680d77d1fe7aa399c9d64514127 ]
The code is incorrectly updating the authxform instead of
aead xforms.
Fixes: b79e4c00af0e ("cryptodev: use AES-GCM/CCM as AEAD algorithms")
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
examples/l2fwd-crypto/main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index b1ad19284..2fcc33984 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -1474,8 +1474,8 @@ l2fwd_crypto_default_options(struct l2fwd_crypto_options *options)
options->aead_iv_random_size = -1;
options->aead_iv.length = 0;
- options->auth_xform.aead.algo = RTE_CRYPTO_AEAD_AES_GCM;
- options->auth_xform.aead.op = RTE_CRYPTO_AEAD_OP_ENCRYPT;
+ options->aead_xform.aead.algo = RTE_CRYPTO_AEAD_AES_GCM;
+ options->aead_xform.aead.op = RTE_CRYPTO_AEAD_OP_ENCRYPT;
options->aad_param = 0;
options->aad_random_size = -1;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'examples/ipsec-secgw: fix usage print' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (73 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'examples/l2fwd-crypto: fix the default aead assignments' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'crypto/zuc: do not set default op status' " luca.boccassi
` (8 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Anoob Joseph; +Cc: Radu Nicolau, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 37a9b53c80dc48767841d4227882da4ddf0501ce Mon Sep 17 00:00:00 2001
From: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Date: Mon, 16 Apr 2018 17:53:15 +0530
Subject: [PATCH] examples/ipsec-secgw: fix usage print
[ upstream commit ae43ebbe9366176ea2a84b5e7f2ba8962961ea07 ]
The usage print was not updated when jumbo frames & crypto_dev mask
support was added. Fixing that. Also, the optional arguments were not
properly highlighted in the usage header. This is also fixed.
General cleanup of the usage print was also done to make it look more
cleaner and similar to what is existing in other applications like
l3fwd.
Fixes: bbabfe6e4ee4 ("examples/ipsec_secgw: support jumbo frames")
Fixes: 2c68fe791538 ("examples/ipsec-secgw: add cryptodev mask option")
Fixes: d299106e8e31 ("examples/ipsec-secgw: add IPsec sample application")
Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
---
examples/ipsec-secgw/ipsec-secgw.c | 36 ++++++++++++++++++++++--------------
1 file changed, 22 insertions(+), 14 deletions(-)
diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 6bbb920f9..c9d3f244f 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -924,20 +924,28 @@ init_lcore_rx_queues(void)
static void
print_usage(const char *prgname)
{
- printf("%s [EAL options] -- -p PORTMASK -P -u PORTMASK"
- " --"OPTION_CONFIG" (port,queue,lcore)[,(port,queue,lcore]"
- " --single-sa SAIDX -f CONFIG_FILE\n"
- " -p PORTMASK: hexadecimal bitmask of ports to configure\n"
- " -P : enable promiscuous mode\n"
- " -u PORTMASK: hexadecimal bitmask of unprotected ports\n"
- " -j FRAMESIZE: jumbo frame maximum size\n"
- " --"OPTION_CONFIG": (port,queue,lcore): "
- "rx queues configuration\n"
- " --single-sa SAIDX: use single SA index for outbound, "
- "bypassing the SP\n"
- " --cryptodev_mask MASK: hexadecimal bitmask of the "
- "crypto devices to configure\n"
- " -f CONFIG_FILE: Configuration file path\n",
+ fprintf(stderr, "%s [EAL options] --"
+ " -p PORTMASK"
+ " [-P]"
+ " [-u PORTMASK]"
+ " [-j FRAMESIZE]"
+ " -f CONFIG_FILE"
+ " --config (port,queue,lcore)[,(port,queue,lcore)]"
+ " [--single-sa SAIDX]"
+ " [--cryptodev_mask MASK]"
+ "\n\n"
+ " -p PORTMASK: Hexadecimal bitmask of ports to configure\n"
+ " -P : Enable promiscuous mode\n"
+ " -u PORTMASK: Hexadecimal bitmask of unprotected ports\n"
+ " -j FRAMESIZE: Enable jumbo frame with 'FRAMESIZE' as maximum\n"
+ " packet size\n"
+ " -f CONFIG_FILE: Configuration file\n"
+ " --config (port,queue,lcore): Rx queue configuration\n"
+ " --single-sa SAIDX: Use single SA index for outbound traffic,\n"
+ " bypassing the SP\n"
+ " --cryptodev_mask MASK: Hexadecimal bitmask of the crypto\n"
+ " devices to configure\n"
+ "\n",
prgname);
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'crypto/zuc: do not set default op status' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (74 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'examples/ipsec-secgw: fix usage print' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'crypto/zuc: remove unnecessary check' " luca.boccassi
` (7 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Pablo de Lara; +Cc: Fiona Trahe, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 1fefe4d7c613ee9403209d6e991d661cdbbd2e86 Mon Sep 17 00:00:00 2001
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Date: Thu, 19 Apr 2018 15:55:39 +0100
Subject: [PATCH] crypto/zuc: do not set default op status
[ upstream commit 466dcf34d728db0ae86d83f37dd7db5c20dd2979 ]
When crypto operations are allocated from the operation
pool, their status get reset to NOT_PROCESSED.
Therefore, there is no need to set this status again.
Fixes: cf7685d68f00 ("crypto/zuc: add driver for ZUC library")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
---
drivers/crypto/zuc/rte_zuc_pmd.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/crypto/zuc/rte_zuc_pmd.c b/drivers/crypto/zuc/rte_zuc_pmd.c
index ad65b80c5..5fcd1a245 100644
--- a/drivers/crypto/zuc/rte_zuc_pmd.c
+++ b/drivers/crypto/zuc/rte_zuc_pmd.c
@@ -352,9 +352,6 @@ zuc_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops,
for (i = 0; i < nb_ops; i++) {
curr_c_op = ops[i];
- /* Set status as enqueued (not processed yet) by default. */
- curr_c_op->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
-
curr_sess = zuc_get_session(qp, curr_c_op);
if (unlikely(curr_sess == NULL ||
curr_sess->op == ZUC_OP_NOT_SUPPORTED)) {
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'crypto/zuc: remove unnecessary check' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (75 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'crypto/zuc: do not set default op status' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'crypto/zuc: batch ops with same transform' " luca.boccassi
` (6 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Pablo de Lara; +Cc: Fiona Trahe, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 6189aafb31926c41d084f5ed7587b6ede2b7b397 Mon Sep 17 00:00:00 2001
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Date: Thu, 19 Apr 2018 15:55:40 +0100
Subject: [PATCH] crypto/zuc: remove unnecessary check
[ upstream commit 5943233a687af76672d45a15755f5432fb4c73e9 ]
When processing operations, the operation type was being
checked to avoid if it was set to NOT SUPPORTED.
In data path, doing so is not required since that is already
checked when creating the crypto session,
so that case will not ever happen.
Fixes: cf7685d68f00 ("crypto/zuc: add driver for ZUC library")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
---
drivers/crypto/zuc/rte_zuc_pmd.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/crypto/zuc/rte_zuc_pmd.c b/drivers/crypto/zuc/rte_zuc_pmd.c
index 5fcd1a245..2e337c468 100644
--- a/drivers/crypto/zuc/rte_zuc_pmd.c
+++ b/drivers/crypto/zuc/rte_zuc_pmd.c
@@ -353,8 +353,7 @@ zuc_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops,
curr_c_op = ops[i];
curr_sess = zuc_get_session(qp, curr_c_op);
- if (unlikely(curr_sess == NULL ||
- curr_sess->op == ZUC_OP_NOT_SUPPORTED)) {
+ if (unlikely(curr_sess == NULL)) {
curr_c_op->status =
RTE_CRYPTO_OP_STATUS_INVALID_SESSION;
break;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'crypto/zuc: batch ops with same transform' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (76 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'crypto/zuc: remove unnecessary check' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'crypto/dpaa_sec: fix HMAC supported digest sizes' " luca.boccassi
` (5 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Pablo de Lara; +Cc: Fiona Trahe, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 97b67d592dd3da614ffd065bd5b35c2163bbff5f Mon Sep 17 00:00:00 2001
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Date: Thu, 19 Apr 2018 15:55:41 +0100
Subject: [PATCH] crypto/zuc: batch ops with same transform
[ upstream commit 17c36a6746419ae8d1a14b1d1345d4a892511c57 ]
The ZUC API to encrypt packets does not require the operations
to share the same key. Currently, the operations were being
batched only when they shared the same key, but this is not needed.
Instead, now operations will be batched based on the transform
(cipher only, auth only...).
Fixes: cf7685d68f00 ("crypto/zuc: add driver for ZUC library")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
---
drivers/crypto/zuc/rte_zuc_pmd.c | 105 ++++++++++++++++++++++++---------------
1 file changed, 64 insertions(+), 41 deletions(-)
diff --git a/drivers/crypto/zuc/rte_zuc_pmd.c b/drivers/crypto/zuc/rte_zuc_pmd.c
index 2e337c468..8a44331dc 100644
--- a/drivers/crypto/zuc/rte_zuc_pmd.c
+++ b/drivers/crypto/zuc/rte_zuc_pmd.c
@@ -12,7 +12,7 @@
#include "rte_zuc_pmd_private.h"
-#define ZUC_MAX_BURST 8
+#define ZUC_MAX_BURST 4
#define BYTE_LEN 8
static uint8_t cryptodev_driver_id;
@@ -168,10 +168,10 @@ zuc_get_session(struct zuc_qp *qp, struct rte_crypto_op *op)
return sess;
}
-/** Encrypt/decrypt mbufs with same cipher key. */
+/** Encrypt/decrypt mbufs. */
static uint8_t
process_zuc_cipher_op(struct rte_crypto_op **ops,
- struct zuc_session *session,
+ struct zuc_session **sessions,
uint8_t num_ops)
{
unsigned i;
@@ -180,6 +180,7 @@ process_zuc_cipher_op(struct rte_crypto_op **ops,
uint8_t *iv[ZUC_MAX_BURST];
uint32_t num_bytes[ZUC_MAX_BURST];
uint8_t *cipher_keys[ZUC_MAX_BURST];
+ struct zuc_session *sess;
for (i = 0; i < num_ops; i++) {
if (((ops[i]->sym->cipher.data.length % BYTE_LEN) != 0)
@@ -190,6 +191,8 @@ process_zuc_cipher_op(struct rte_crypto_op **ops,
break;
}
+ sess = sessions[i];
+
#ifdef RTE_LIBRTE_PMD_ZUC_DEBUG
if (!rte_pktmbuf_is_contiguous(ops[i]->sym->m_src) ||
(ops[i]->sym->m_dst != NULL &&
@@ -211,10 +214,10 @@ process_zuc_cipher_op(struct rte_crypto_op **ops,
rte_pktmbuf_mtod(ops[i]->sym->m_src, uint8_t *) +
(ops[i]->sym->cipher.data.offset >> 3);
iv[i] = rte_crypto_op_ctod_offset(ops[i], uint8_t *,
- session->cipher_iv_offset);
+ sess->cipher_iv_offset);
num_bytes[i] = ops[i]->sym->cipher.data.length >> 3;
- cipher_keys[i] = session->pKey_cipher;
+ cipher_keys[i] = sess->pKey_cipher;
processed_ops++;
}
@@ -225,10 +228,10 @@ process_zuc_cipher_op(struct rte_crypto_op **ops,
return processed_ops;
}
-/** Generate/verify hash from mbufs with same hash key. */
+/** Generate/verify hash from mbufs. */
static int
process_zuc_hash_op(struct zuc_qp *qp, struct rte_crypto_op **ops,
- struct zuc_session *session,
+ struct zuc_session **sessions,
uint8_t num_ops)
{
unsigned i;
@@ -237,6 +240,7 @@ process_zuc_hash_op(struct zuc_qp *qp, struct rte_crypto_op **ops,
uint32_t *dst;
uint32_t length_in_bits;
uint8_t *iv;
+ struct zuc_session *sess;
for (i = 0; i < num_ops; i++) {
/* Data must be byte aligned */
@@ -246,17 +250,19 @@ process_zuc_hash_op(struct zuc_qp *qp, struct rte_crypto_op **ops,
break;
}
+ sess = sessions[i];
+
length_in_bits = ops[i]->sym->auth.data.length;
src = rte_pktmbuf_mtod(ops[i]->sym->m_src, uint8_t *) +
(ops[i]->sym->auth.data.offset >> 3);
iv = rte_crypto_op_ctod_offset(ops[i], uint8_t *,
- session->auth_iv_offset);
+ sess->auth_iv_offset);
- if (session->auth_op == RTE_CRYPTO_AUTH_OP_VERIFY) {
+ if (sess->auth_op == RTE_CRYPTO_AUTH_OP_VERIFY) {
dst = (uint32_t *)qp->temp_digest;
- sso_zuc_eia3_1_buffer(session->pKey_hash,
+ sso_zuc_eia3_1_buffer(sess->pKey_hash,
iv, src,
length_in_bits, dst);
/* Verify digest. */
@@ -266,7 +272,7 @@ process_zuc_hash_op(struct zuc_qp *qp, struct rte_crypto_op **ops,
} else {
dst = (uint32_t *)ops[i]->sym->auth.digest.data;
- sso_zuc_eia3_1_buffer(session->pKey_hash,
+ sso_zuc_eia3_1_buffer(sess->pKey_hash,
iv, src,
length_in_bits, dst);
}
@@ -276,33 +282,34 @@ process_zuc_hash_op(struct zuc_qp *qp, struct rte_crypto_op **ops,
return processed_ops;
}
-/** Process a batch of crypto ops which shares the same session. */
+/** Process a batch of crypto ops which shares the same operation type. */
static int
-process_ops(struct rte_crypto_op **ops, struct zuc_session *session,
+process_ops(struct rte_crypto_op **ops, enum zuc_operation op_type,
+ struct zuc_session **sessions,
struct zuc_qp *qp, uint8_t num_ops,
uint16_t *accumulated_enqueued_ops)
{
unsigned i;
unsigned enqueued_ops, processed_ops;
- switch (session->op) {
+ switch (op_type) {
case ZUC_OP_ONLY_CIPHER:
processed_ops = process_zuc_cipher_op(ops,
- session, num_ops);
+ sessions, num_ops);
break;
case ZUC_OP_ONLY_AUTH:
- processed_ops = process_zuc_hash_op(qp, ops, session,
+ processed_ops = process_zuc_hash_op(qp, ops, sessions,
num_ops);
break;
case ZUC_OP_CIPHER_AUTH:
- processed_ops = process_zuc_cipher_op(ops, session,
+ processed_ops = process_zuc_cipher_op(ops, sessions,
num_ops);
- process_zuc_hash_op(qp, ops, session, processed_ops);
+ process_zuc_hash_op(qp, ops, sessions, processed_ops);
break;
case ZUC_OP_AUTH_CIPHER:
- processed_ops = process_zuc_hash_op(qp, ops, session,
+ processed_ops = process_zuc_hash_op(qp, ops, sessions,
num_ops);
- process_zuc_cipher_op(ops, session, processed_ops);
+ process_zuc_cipher_op(ops, sessions, processed_ops);
break;
default:
/* Operation not supported. */
@@ -318,10 +325,10 @@ process_ops(struct rte_crypto_op **ops, struct zuc_session *session,
ops[i]->status = RTE_CRYPTO_OP_STATUS_SUCCESS;
/* Free session if a session-less crypto op. */
if (ops[i]->sess_type == RTE_CRYPTO_OP_SESSIONLESS) {
- memset(session, 0, sizeof(struct zuc_session));
+ memset(sessions[i], 0, sizeof(struct zuc_session));
memset(ops[i]->sym->session, 0,
rte_cryptodev_get_header_session_size());
- rte_mempool_put(qp->sess_mp, session);
+ rte_mempool_put(qp->sess_mp, sessions[i]);
rte_mempool_put(qp->sess_mp, ops[i]->sym->session);
ops[i]->sym->session = NULL;
}
@@ -342,7 +349,10 @@ zuc_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops,
struct rte_crypto_op *c_ops[ZUC_MAX_BURST];
struct rte_crypto_op *curr_c_op;
- struct zuc_session *prev_sess = NULL, *curr_sess = NULL;
+ struct zuc_session *curr_sess;
+ struct zuc_session *sessions[ZUC_MAX_BURST];
+ enum zuc_operation prev_zuc_op = ZUC_OP_NOT_SUPPORTED;
+ enum zuc_operation curr_zuc_op;
struct zuc_qp *qp = queue_pair;
unsigned i;
uint8_t burst_size = 0;
@@ -359,50 +369,63 @@ zuc_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops,
break;
}
- /* Batch ops that share the same session. */
- if (prev_sess == NULL) {
- prev_sess = curr_sess;
- c_ops[burst_size++] = curr_c_op;
- } else if (curr_sess == prev_sess) {
- c_ops[burst_size++] = curr_c_op;
+ curr_zuc_op = curr_sess->op;
+
+ /*
+ * Batch ops that share the same operation type
+ * (cipher only, auth only...).
+ */
+ if (burst_size == 0) {
+ prev_zuc_op = curr_zuc_op;
+ c_ops[0] = curr_c_op;
+ sessions[0] = curr_sess;
+ burst_size++;
+ } else if (curr_zuc_op == prev_zuc_op) {
+ c_ops[burst_size] = curr_c_op;
+ sessions[burst_size] = curr_sess;
+ burst_size++;
/*
* When there are enough ops to process in a batch,
* process them, and start a new batch.
*/
if (burst_size == ZUC_MAX_BURST) {
- processed_ops = process_ops(c_ops, prev_sess,
- qp, burst_size, &enqueued_ops);
+ processed_ops = process_ops(c_ops, curr_zuc_op,
+ sessions, qp, burst_size,
+ &enqueued_ops);
if (processed_ops < burst_size) {
burst_size = 0;
break;
}
burst_size = 0;
- prev_sess = NULL;
}
} else {
/*
- * Different session, process the ops
- * of the previous session.
+ * Different operation type, process the ops
+ * of the previous type.
*/
- processed_ops = process_ops(c_ops, prev_sess,
- qp, burst_size, &enqueued_ops);
+ processed_ops = process_ops(c_ops, prev_zuc_op,
+ sessions, qp, burst_size,
+ &enqueued_ops);
if (processed_ops < burst_size) {
burst_size = 0;
break;
}
burst_size = 0;
- prev_sess = curr_sess;
+ prev_zuc_op = curr_zuc_op;
- c_ops[burst_size++] = curr_c_op;
+ c_ops[0] = curr_c_op;
+ sessions[0] = curr_sess;
+ burst_size++;
}
}
if (burst_size != 0) {
- /* Process the crypto ops of the last session. */
- processed_ops = process_ops(c_ops, prev_sess,
- qp, burst_size, &enqueued_ops);
+ /* Process the crypto ops of the last operation type. */
+ processed_ops = process_ops(c_ops, prev_zuc_op,
+ sessions, qp, burst_size,
+ &enqueued_ops);
}
qp->qp_stats.enqueue_err_count += nb_ops - enqueued_ops;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'crypto/dpaa_sec: fix HMAC supported digest sizes' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (77 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'crypto/zuc: batch ops with same transform' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'crypto/dpaa2_sec: " luca.boccassi
` (4 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Hemant Agrawal; +Cc: Nipun Gupta, Akhil Goyal, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 75ec713a91518424e8b09284ff3fcd3532314c33 Mon Sep 17 00:00:00 2001
From: Hemant Agrawal <hemant.agrawal@nxp.com>
Date: Thu, 19 Apr 2018 22:22:37 +0530
Subject: [PATCH] crypto/dpaa_sec: fix HMAC supported digest sizes
[ upstream commit 6c9c2e4667e1e0988c67378ca7075f0f50ed4b13 ]
For HMAC algorithms (MD5-HMAC, SHAx-HMAC), the supported
digest sizes are not a fixed value, but a range between
1 and the maximum digest size for those algorithms.
Also setting iv_size as 0.
Fixes: c3e85bdcc6e6 ("crypto/dpaa_sec: add crypto driver for NXP DPAA platform")
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
---
drivers/crypto/dpaa_sec/dpaa_sec.h | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.h b/drivers/crypto/dpaa_sec/dpaa_sec.h
index b8f7bd23e..143359580 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.h
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.h
@@ -185,10 +185,11 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = {
.increment = 1
},
.digest_size = {
- .min = 16,
+ .min = 1,
.max = 16,
- .increment = 0
+ .increment = 1
},
+ .iv_size = { 0 }
}, }
}, }
},
@@ -205,10 +206,11 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = {
.increment = 1
},
.digest_size = {
- .min = 20,
+ .min = 1,
.max = 20,
- .increment = 0
+ .increment = 1
},
+ .iv_size = { 0 }
}, }
}, }
},
@@ -225,10 +227,11 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = {
.increment = 1
},
.digest_size = {
- .min = 28,
+ .min = 1,
.max = 28,
- .increment = 0
+ .increment = 1
},
+ .iv_size = { 0 }
}, }
}, }
},
@@ -245,10 +248,11 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = {
.increment = 1
},
.digest_size = {
- .min = 32,
+ .min = 1,
.max = 32,
- .increment = 0
+ .increment = 1
},
+ .iv_size = { 0 }
}, }
}, }
},
@@ -265,10 +269,11 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = {
.increment = 1
},
.digest_size = {
- .min = 48,
+ .min = 1,
.max = 48,
- .increment = 0
+ .increment = 1
},
+ .iv_size = { 0 }
}, }
}, }
},
@@ -285,10 +290,11 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = {
.increment = 1
},
.digest_size = {
- .min = 64,
+ .min = 1,
.max = 64,
- .increment = 0
+ .increment = 1
},
+ .iv_size = { 0 }
}, }
}, }
},
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'crypto/dpaa2_sec: fix HMAC supported digest sizes' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (78 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'crypto/dpaa_sec: fix HMAC supported digest sizes' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'mk: fix make defconfig on FreeBSD' " luca.boccassi
` (3 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Hemant Agrawal; +Cc: Nipun Gupta, Akhil Goyal, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 1f4a7bd2cc558fafd8e47448c777a3a4ce91eec5 Mon Sep 17 00:00:00 2001
From: Hemant Agrawal <hemant.agrawal@nxp.com>
Date: Thu, 19 Apr 2018 22:22:38 +0530
Subject: [PATCH] crypto/dpaa2_sec: fix HMAC supported digest sizes
[ upstream commit e37effdc3d48c5f63871639c9007a10a5f57b825 ]
For HMAC algorithms (MD5-HMAC, SHAx-HMAC), the supported
digest sizes are not a fixed value, but a range between
1 and the maximum digest size for those algorithms.
Fixes: f947fd77185f ("crypto/dpaa2_sec: fix HMAC supported key sizes")
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
---
drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h b/drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h
index e8ac95bac..a9d83ebce 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h
@@ -185,9 +185,9 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
.increment = 1
},
.digest_size = {
- .min = 16,
+ .min = 1,
.max = 16,
- .increment = 0
+ .increment = 1
},
.iv_size = { 0 }
}, }
@@ -206,9 +206,9 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
.increment = 1
},
.digest_size = {
- .min = 20,
+ .min = 1,
.max = 20,
- .increment = 0
+ .increment = 1
},
.iv_size = { 0 }
}, }
@@ -227,9 +227,9 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
.increment = 1
},
.digest_size = {
- .min = 28,
+ .min = 1,
.max = 28,
- .increment = 0
+ .increment = 1
},
.iv_size = { 0 }
}, }
@@ -248,9 +248,9 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
.increment = 1
},
.digest_size = {
- .min = 32,
- .max = 32,
- .increment = 0
+ .min = 1,
+ .max = 32,
+ .increment = 1
},
.iv_size = { 0 }
}, }
@@ -269,9 +269,9 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
.increment = 1
},
.digest_size = {
- .min = 48,
+ .min = 1,
.max = 48,
- .increment = 0
+ .increment = 1
},
.iv_size = { 0 }
}, }
@@ -290,9 +290,9 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
.increment = 1
},
.digest_size = {
- .min = 64,
+ .min = 1,
.max = 64,
- .increment = 0
+ .increment = 1
},
.iv_size = { 0 }
}, }
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'mk: fix make defconfig on FreeBSD' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (79 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'crypto/dpaa2_sec: " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'mempool: fix leak when no objects are populated' " luca.boccassi
` (2 subsequent siblings)
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: David Hunt; +Cc: Anatoly Burakov, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 242933f016b3f3fd7603775368fa64860e11fd59 Mon Sep 17 00:00:00 2001
From: David Hunt <david.hunt@intel.com>
Date: Mon, 23 Apr 2018 14:09:02 +0100
Subject: [PATCH] mk: fix make defconfig on FreeBSD
[ upstream commit 6ace79505d326d05aaa3c57facca7ca8e1675b11 ]
On FreeBSD, make defconfig generates the config as
"defconfig_x86_64-bsdapp-", which does not resolve to any known
config file.
On FreeBSD, we get amd64 out of "uname -m", which was not handled by
the list of checks, but which now resolves to x86_64-native.
Then we run '$CC --version', and use grep -o with the list of known
compilers, and set to either gcc, icc or clang. Grep's '-o' option
returns the matched word rather than the whole line, making the
result easier to use.
The remaining code in the patch then takes ${compiler}, the "uname -m"
output and assembles them all together into a valid freebsd config name,
i.e. "defconfig_x86_64-native-bsdapp-clang".
Fixes: bce6c42c4ad5 ("mk: add sensible default target with defconfig")
Signed-off-by: David Hunt <david.hunt@intel.com>
Tested-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
mk/rte.sdkconfig.mk | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/mk/rte.sdkconfig.mk b/mk/rte.sdkconfig.mk
index 0664725ee..d90d62cc6 100644
--- a/mk/rte.sdkconfig.mk
+++ b/mk/rte.sdkconfig.mk
@@ -36,7 +36,6 @@ notemplate:
@echo "use T=template from the following list:"
@$(MAKE) -rR showconfigs | sed 's,^, ,'
-
.PHONY: defconfig
defconfig:
@$(MAKE) config T=$(shell \
@@ -47,15 +46,25 @@ defconfig:
print "arm-armv7a"} \
else if ($$0 == "ppc64") { \
print "ppc_64-power8"} \
+ else if ($$0 == "amd64") { \
+ print "x86_64-native"} \
else { \
- printf "%s-native", $$0} }')-$(shell \
+ printf "%s-native", $$0} }' \
+ )-$(shell \
uname | awk '{ \
if ($$0 == "Linux") { \
print "linuxapp"} \
else { \
- print "bsdapp"} }')-$(shell \
- ${CC} -v 2>&1 | \
- grep " version " | cut -d ' ' -f 1)
+ print "bsdapp"} }' \
+ )-$(shell \
+ ${CC} --version | grep -o 'cc\|gcc\|icc\|clang' | awk \
+ '{ \
+ if ($$1 == "cc") { \
+ print "gcc" } \
+ else { \
+ print $$1 } \
+ }' \
+ )
.PHONY: config
ifeq ($(RTE_CONFIG_TEMPLATE),)
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'mempool: fix leak when no objects are populated' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (80 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'mk: fix make defconfig on FreeBSD' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'test: fix memory flags test for low NUMA nodes number' " luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'test/mempool: fix autotest retry' " luca.boccassi
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Andrew Rybchenko; +Cc: Olivier Matz, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From a9640338bdc7ef5fc85d445d0b99b562006beb6b Mon Sep 17 00:00:00 2001
From: Andrew Rybchenko <arybchenko@solarflare.com>
Date: Mon, 16 Apr 2018 14:24:30 +0100
Subject: [PATCH] mempool: fix leak when no objects are populated
[ upstream commit 25e6755056eaba45921b898b9986af68277ac6ac ]
Fixes: 84121f197187 ("mempool: store memory chunks in a list")
Suggested-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
lib/librte_mempool/rte_mempool.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c
index 54f7f4ba4..80bf941c9 100644
--- a/lib/librte_mempool/rte_mempool.c
+++ b/lib/librte_mempool/rte_mempool.c
@@ -408,12 +408,18 @@ rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr,
}
/* not enough room to store one object */
- if (i == 0)
- return -EINVAL;
+ if (i == 0) {
+ ret = -EINVAL;
+ goto fail;
+ }
STAILQ_INSERT_TAIL(&mp->mem_list, memhdr, next);
mp->nb_mem_chunks++;
return i;
+
+fail:
+ rte_free(memhdr);
+ return ret;
}
int
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'test: fix memory flags test for low NUMA nodes number' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (81 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'mempool: fix leak when no objects are populated' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:41 ` [dpdk-stable] patch 'test/mempool: fix autotest retry' " luca.boccassi
83 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Phil Yang; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 31991b17caadc33cd528d2e9c6ee54b03846beef Mon Sep 17 00:00:00 2001
From: Phil Yang <phil.yang@arm.com>
Date: Tue, 6 Feb 2018 10:21:38 +0800
Subject: [PATCH] test: fix memory flags test for low NUMA nodes number
[ upstream commit 896af46bd1ade6d8d1f452f03c6e08e0965d7ef9 ]
Since RTE_MAX_NUMA_NODES is configurable, the existing socket number
could greater than RTE_MAX_NUMA_NODES. Optimize test case to cover this
situation.(i.e RTE_MAX_NUMA_NODES=1)
Fixes: 45f1b6e8680a ("app: add new tests on eal flags")
Signed-off-by: Phil Yang <phil.yang@arm.com>
---
test/test/test_eal_flags.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/test/test/test_eal_flags.c b/test/test/test_eal_flags.c
index 37c42efe8..7df0b8f1e 100644
--- a/test/test/test_eal_flags.c
+++ b/test/test/test_eal_flags.c
@@ -33,7 +33,7 @@
#define memtest "memtest"
#define memtest1 "memtest1"
#define memtest2 "memtest2"
-#define SOCKET_MEM_STRLEN (RTE_MAX_NUMA_NODES * 10)
+#define SOCKET_MEM_STRLEN (RTE_MAX_NUMA_NODES * 20)
#define launch_proc(ARGV) process_dup(ARGV, \
sizeof(ARGV)/(sizeof(ARGV[0])), __func__)
@@ -1138,10 +1138,11 @@ test_memory_flags(void)
#ifdef RTE_EXEC_ENV_BSDAPP
int i, num_sockets = 1;
#else
- int i, num_sockets = get_number_of_sockets();
+ int i, num_sockets = RTE_MIN(get_number_of_sockets(),
+ RTE_MAX_NUMA_NODES);
#endif
- if (num_sockets <= 0 || num_sockets > RTE_MAX_NUMA_NODES) {
+ if (num_sockets <= 0) {
printf("Error - cannot get number of sockets!\n");
return -1;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'test/mempool: fix autotest retry' has been queued to stable release 18.02.2
2018-04-30 14:40 ` [dpdk-stable] patch 'net/avf: fix link autoneg value' " luca.boccassi
` (82 preceding siblings ...)
2018-04-30 14:41 ` [dpdk-stable] patch 'test: fix memory flags test for low NUMA nodes number' " luca.boccassi
@ 2018-04-30 14:41 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
83 siblings, 1 reply; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:41 UTC (permalink / raw)
To: Andrew Rybchenko; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 1db719e857f817509ded54c2be68570066dc6665 Mon Sep 17 00:00:00 2001
From: Andrew Rybchenko <arybchenko@solarflare.com>
Date: Wed, 25 Apr 2018 18:00:37 +0100
Subject: [PATCH] test/mempool: fix autotest retry
[ upstream commit 2d645858a93e21a41e84928d4fb869318c3639a6 ]
Single producer / single consumer mempool handle is stored in static
variable and the mempool allocated if stored value is NULL.
If the mempool is freed, NULL should be restored to make sure that
the mempool is allocated once again next time when the test is run.
Fixes: 8ef772aee072 ("app/test: rework mempool test")
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
test/test/test_mempool.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/test/test/test_mempool.c b/test/test/test_mempool.c
index 63f921e26..1f5610575 100644
--- a/test/test/test_mempool.c
+++ b/test/test/test_mempool.c
@@ -327,17 +327,17 @@ test_mempool_sp_sc(void)
}
if (rte_mempool_lookup("test_mempool_sp_sc") != mp_spsc) {
printf("Cannot lookup mempool from its name\n");
- rte_mempool_free(mp_spsc);
- RET_ERR();
+ ret = -1;
+ goto err;
}
lcore_next = rte_get_next_lcore(lcore_id, 0, 1);
if (lcore_next >= RTE_MAX_LCORE) {
- rte_mempool_free(mp_spsc);
- RET_ERR();
+ ret = -1;
+ goto err;
}
if (rte_eal_lcore_role(lcore_next) != ROLE_RTE) {
- rte_mempool_free(mp_spsc);
- RET_ERR();
+ ret = -1;
+ goto err;
}
rte_spinlock_init(&scsp_spinlock);
memset(scsp_obj_table, 0, sizeof(scsp_obj_table));
@@ -348,7 +348,10 @@ test_mempool_sp_sc(void)
if (rte_eal_wait_lcore(lcore_next) < 0)
ret = -1;
+
+err:
rte_mempool_free(mp_spsc);
+ mp_spsc = NULL;
return ret;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'bus/pci: fix find device implementation' has been queued to stable release 18.02.2
2018-04-30 14:41 ` [dpdk-stable] patch 'test/mempool: fix autotest retry' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/vdev: " luca.boccassi
` (41 more replies)
0 siblings, 42 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Gaetan Rivet; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 8e800a3bc8f3df06239b4a5edbda790594dd4762 Mon Sep 17 00:00:00 2001
From: Gaetan Rivet <gaetan.rivet@6wind.com>
Date: Fri, 27 Apr 2018 16:13:05 +0200
Subject: [PATCH] bus/pci: fix find device implementation
[ upstream commit 64de7e4069b9b84b0f2d840b44e334233412d55f ]
If start is set, and a device before it matches the data
passed for comparison, then this first device is returned.
This induces potentially infinite loops.
Fixes: c7fe1eea8a74 ("bus: simplify finding starting point")
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
drivers/bus/pci/pci_common.c | 21 ++++++++++++---------
drivers/bus/pci/rte_bus_pci.h | 3 +++
2 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c
index 2a00f365a..2c45f8151 100644
--- a/drivers/bus/pci/pci_common.c
+++ b/drivers/bus/pci/pci_common.c
@@ -459,17 +459,20 @@ static struct rte_device *
pci_find_device(const struct rte_device *start, rte_dev_cmp_t cmp,
const void *data)
{
- struct rte_pci_device *dev;
+ const struct rte_pci_device *pstart;
+ struct rte_pci_device *pdev;
- FOREACH_DEVICE_ON_PCIBUS(dev) {
- if (start && &dev->device == start) {
- start = NULL; /* starting point found */
- continue;
- }
- if (cmp(&dev->device, data) == 0)
- return &dev->device;
+ if (start != NULL) {
+ pstart = RTE_DEV_TO_PCI_CONST(start);
+ pdev = TAILQ_NEXT(pstart, next);
+ } else {
+ pdev = TAILQ_FIRST(&rte_pci_bus.device_list);
+ }
+ while (pdev != NULL) {
+ if (cmp(&pdev->device, data) == 0)
+ return &pdev->device;
+ pdev = TAILQ_NEXT(pdev, next);
}
-
return NULL;
}
diff --git a/drivers/bus/pci/rte_bus_pci.h b/drivers/bus/pci/rte_bus_pci.h
index 357afb912..458e6d076 100644
--- a/drivers/bus/pci/rte_bus_pci.h
+++ b/drivers/bus/pci/rte_bus_pci.h
@@ -74,6 +74,9 @@ struct rte_pci_device {
*/
#define RTE_DEV_TO_PCI(ptr) container_of(ptr, struct rte_pci_device, device)
+#define RTE_DEV_TO_PCI_CONST(ptr) \
+ container_of(ptr, const struct rte_pci_device, device)
+
#define RTE_ETH_DEV_TO_PCI(eth_dev) RTE_DEV_TO_PCI((eth_dev)->device)
/** Any PCI device identifier (vendor, device, ...) */
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'bus/vdev: fix find device implementation' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-05-02 8:26 ` Gaëtan Rivet
2018-04-30 14:53 ` [dpdk-stable] patch 'net/sfc: add missing Rx fini on RSS setup fail path' " luca.boccassi
` (40 subsequent siblings)
41 siblings, 1 reply; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Gaetan Rivet; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From c2afaf6b85b6d55dee13c3742baf2052d7994a9d Mon Sep 17 00:00:00 2001
From: Gaetan Rivet <gaetan.rivet@6wind.com>
Date: Fri, 27 Apr 2018 16:13:06 +0200
Subject: [PATCH] bus/vdev: fix find device implementation
[ upstream commit 3701b792a8a3bce519adc979d5cc8d127231fd48 ]
If start is set and a device before it matches the data,
this device is returned.
This induces potentially infinite loops.
Fixes: c7fe1eea8a74 ("bus: simplify finding starting point")
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
drivers/bus/vdev/rte_bus_vdev.h | 3 +++
drivers/bus/vdev/vdev.c | 16 ++++++++++------
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/drivers/bus/vdev/rte_bus_vdev.h b/drivers/bus/vdev/rte_bus_vdev.h
index f9d8a2383..4da9967c6 100644
--- a/drivers/bus/vdev/rte_bus_vdev.h
+++ b/drivers/bus/vdev/rte_bus_vdev.h
@@ -53,6 +53,9 @@ struct rte_vdev_device {
#define RTE_DEV_TO_VDEV(ptr) \
container_of(ptr, struct rte_vdev_device, device)
+#define RTE_DEV_TO_VDEV_CONST(ptr) \
+ container_of(ptr, const struct rte_vdev_device, device)
+
static inline const char *
rte_vdev_device_name(const struct rte_vdev_device *dev)
{
diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
index 7eae319cb..914073d12 100644
--- a/drivers/bus/vdev/vdev.c
+++ b/drivers/bus/vdev/vdev.c
@@ -386,15 +386,19 @@ static struct rte_device *
vdev_find_device(const struct rte_device *start, rte_dev_cmp_t cmp,
const void *data)
{
+ const struct rte_vdev_device *vstart;
struct rte_vdev_device *dev;
- TAILQ_FOREACH(dev, &vdev_device_list, next) {
- if (start && &dev->device == start) {
- start = NULL;
- continue;
- }
+ if (start != NULL) {
+ vstart = RTE_DEV_TO_VDEV_CONST(start);
+ dev = TAILQ_NEXT(vstart, next);
+ } else {
+ dev = TAILQ_FIRST(&vdev_device_list);
+ }
+ while (dev != NULL) {
if (cmp(&dev->device, data) == 0)
- return &dev->device;
+ break;
+ dev = TAILQ_NEXT(dev, next);
}
return NULL;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* Re: [dpdk-stable] patch 'bus/vdev: fix find device implementation' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/vdev: " luca.boccassi
@ 2018-05-02 8:26 ` Gaëtan Rivet
2018-05-02 10:57 ` Luca Boccassi
0 siblings, 1 reply; 382+ messages in thread
From: Gaëtan Rivet @ 2018-05-02 8:26 UTC (permalink / raw)
To: luca.boccassi; +Cc: dpdk stable
Hi Luca,
On Mon, Apr 30, 2018 at 03:53:21PM +0100, luca.boccassi@gmail.com wrote:
> Hi,
>
> FYI, your patch has been queued to stable release 18.02.2
>
> Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
> It will be pushed if I get no objections before 05/02/18. So please
> shout if anyone has objections.
This patch will be bogus while still compiling in a stable release,
without the commit: 35f462839b69 ("bus/vdev: add lock on device list").
It should be slightly reworked to function without. The previous version
of this patch [1] could be used instead.
[1]: https://dpdk.org/ml/archives/dev/2018-April/098822.html
Regards,
>
> Thanks.
>
> Luca Boccassi
>
> ---
> From c2afaf6b85b6d55dee13c3742baf2052d7994a9d Mon Sep 17 00:00:00 2001
> From: Gaetan Rivet <gaetan.rivet@6wind.com>
> Date: Fri, 27 Apr 2018 16:13:06 +0200
> Subject: [PATCH] bus/vdev: fix find device implementation
>
> [ upstream commit 3701b792a8a3bce519adc979d5cc8d127231fd48 ]
>
> If start is set and a device before it matches the data,
> this device is returned.
>
> This induces potentially infinite loops.
>
> Fixes: c7fe1eea8a74 ("bus: simplify finding starting point")
>
> Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
> ---
> drivers/bus/vdev/rte_bus_vdev.h | 3 +++
> drivers/bus/vdev/vdev.c | 16 ++++++++++------
> 2 files changed, 13 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/bus/vdev/rte_bus_vdev.h b/drivers/bus/vdev/rte_bus_vdev.h
> index f9d8a2383..4da9967c6 100644
> --- a/drivers/bus/vdev/rte_bus_vdev.h
> +++ b/drivers/bus/vdev/rte_bus_vdev.h
> @@ -53,6 +53,9 @@ struct rte_vdev_device {
> #define RTE_DEV_TO_VDEV(ptr) \
> container_of(ptr, struct rte_vdev_device, device)
>
> +#define RTE_DEV_TO_VDEV_CONST(ptr) \
> + container_of(ptr, const struct rte_vdev_device, device)
> +
> static inline const char *
> rte_vdev_device_name(const struct rte_vdev_device *dev)
> {
> diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
> index 7eae319cb..914073d12 100644
> --- a/drivers/bus/vdev/vdev.c
> +++ b/drivers/bus/vdev/vdev.c
> @@ -386,15 +386,19 @@ static struct rte_device *
> vdev_find_device(const struct rte_device *start, rte_dev_cmp_t cmp,
> const void *data)
> {
> + const struct rte_vdev_device *vstart;
> struct rte_vdev_device *dev;
>
> - TAILQ_FOREACH(dev, &vdev_device_list, next) {
> - if (start && &dev->device == start) {
> - start = NULL;
> - continue;
> - }
> + if (start != NULL) {
> + vstart = RTE_DEV_TO_VDEV_CONST(start);
> + dev = TAILQ_NEXT(vstart, next);
> + } else {
> + dev = TAILQ_FIRST(&vdev_device_list);
> + }
> + while (dev != NULL) {
> if (cmp(&dev->device, data) == 0)
> - return &dev->device;
> + break;
> + dev = TAILQ_NEXT(dev, next);
> }
> return NULL;
> }
> --
> 2.14.2
>
--
Gaëtan Rivet
6WIND
^ permalink raw reply [flat|nested] 382+ messages in thread
* Re: [dpdk-stable] patch 'bus/vdev: fix find device implementation' has been queued to stable release 18.02.2
2018-05-02 8:26 ` Gaëtan Rivet
@ 2018-05-02 10:57 ` Luca Boccassi
2018-05-02 12:16 ` Gaëtan Rivet
0 siblings, 1 reply; 382+ messages in thread
From: Luca Boccassi @ 2018-05-02 10:57 UTC (permalink / raw)
To: Gaëtan Rivet; +Cc: dpdk stable
On Wed, 2018-05-02 at 10:26 +0200, Gaëtan Rivet wrote:
> Hi Luca,
>
> On Mon, Apr 30, 2018 at 03:53:21PM +0100, luca.boccassi@gmail.com
> wrote:
> > Hi,
> >
> > FYI, your patch has been queued to stable release 18.02.2
> >
> > Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable
> > yet.
> > It will be pushed if I get no objections before 05/02/18. So please
> > shout if anyone has objections.
>
> This patch will be bogus while still compiling in a stable release,
> without the commit: 35f462839b69 ("bus/vdev: add lock on device
> list").
>
> It should be slightly reworked to function without. The previous
> version
> of this patch [1] could be used instead.
>
> [1]: https://dpdk.org/ml/archives/dev/2018-April/098822.html
>
> Regards,
Do you think it's worth including or can I skip it?
--
Kind regards,
Luca Boccassi
^ permalink raw reply [flat|nested] 382+ messages in thread
* Re: [dpdk-stable] patch 'bus/vdev: fix find device implementation' has been queued to stable release 18.02.2
2018-05-02 10:57 ` Luca Boccassi
@ 2018-05-02 12:16 ` Gaëtan Rivet
2018-05-02 14:02 ` Luca Boccassi
0 siblings, 1 reply; 382+ messages in thread
From: Gaëtan Rivet @ 2018-05-02 12:16 UTC (permalink / raw)
To: Luca Boccassi; +Cc: dpdk stable
On Wed, May 02, 2018 at 11:57:53AM +0100, Luca Boccassi wrote:
> On Wed, 2018-05-02 at 10:26 +0200, Gaëtan Rivet wrote:
> > Hi Luca,
> >
> > On Mon, Apr 30, 2018 at 03:53:21PM +0100, luca.boccassi@gmail.com
> > wrote:
> > > Hi,
> > >
> > > FYI, your patch has been queued to stable release 18.02.2
> > >
> > > Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable
> > > yet.
> > > It will be pushed if I get no objections before 05/02/18. So please
> > > shout if anyone has objections.
> >
> > This patch will be bogus while still compiling in a stable release,
> > without the commit: 35f462839b69 ("bus/vdev: add lock on device
> > list").
> >
> > It should be slightly reworked to function without. The previous
> > version
> > of this patch [1] could be used instead.
> >
> > [1]: https://dpdk.org/ml/archives/dev/2018-April/098822.html
> >
> > Regards,
>
> Do you think it's worth including or can I skip it?
>
It is an actual bug with a simple fix, so I think it's worth including
yes.
--
Gaëtan Rivet
6WIND
^ permalink raw reply [flat|nested] 382+ messages in thread
* Re: [dpdk-stable] patch 'bus/vdev: fix find device implementation' has been queued to stable release 18.02.2
2018-05-02 12:16 ` Gaëtan Rivet
@ 2018-05-02 14:02 ` Luca Boccassi
2018-05-02 14:23 ` Gaëtan Rivet
0 siblings, 1 reply; 382+ messages in thread
From: Luca Boccassi @ 2018-05-02 14:02 UTC (permalink / raw)
To: Gaëtan Rivet; +Cc: dpdk stable
On Wed, 2018-05-02 at 14:16 +0200, Gaëtan Rivet wrote:
> On Wed, May 02, 2018 at 11:57:53AM +0100, Luca Boccassi wrote:
> > On Wed, 2018-05-02 at 10:26 +0200, Gaëtan Rivet wrote:
> > > Hi Luca,
> > >
> > > On Mon, Apr 30, 2018 at 03:53:21PM +0100, luca.boccassi@gmail.com
> > > wrote:
> > > > Hi,
> > > >
> > > > FYI, your patch has been queued to stable release 18.02.2
> > > >
> > > > Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stabl
> > > > e
> > > > yet.
> > > > It will be pushed if I get no objections before 05/02/18. So
> > > > please
> > > > shout if anyone has objections.
> > >
> > > This patch will be bogus while still compiling in a stable
> > > release,
> > > without the commit: 35f462839b69 ("bus/vdev: add lock on device
> > > list").
> > >
> > > It should be slightly reworked to function without. The previous
> > > version
> > > of this patch [1] could be used instead.
> > >
> > > [1]: https://dpdk.org/ml/archives/dev/2018-April/098822.html
> > >
> > > Regards,
> >
> > Do you think it's worth including or can I skip it?
> >
>
> It is an actual bug with a simple fix, so I think it's worth
> including
> yes.
This is the diff when removing v2 and applying v1 instead:
--- a/drivers/bus/vdev/vdev.c
+++ b/drivers/bus/vdev/vdev.c
@@ -397,7 +397,7 @@ vdev_find_device(const struct rte_device *start, rte_dev_cmp_t cmp,
}
while (dev != NULL) {
if (cmp(&dev->device, data) == 0)
- break;
+ return &dev->device;
dev = TAILQ_NEXT(dev, next);
}
return NULL;
Please let me know if this is correct. Thanks!
--
Kind regards,
Luca Boccassi
^ permalink raw reply [flat|nested] 382+ messages in thread
* Re: [dpdk-stable] patch 'bus/vdev: fix find device implementation' has been queued to stable release 18.02.2
2018-05-02 14:02 ` Luca Boccassi
@ 2018-05-02 14:23 ` Gaëtan Rivet
0 siblings, 0 replies; 382+ messages in thread
From: Gaëtan Rivet @ 2018-05-02 14:23 UTC (permalink / raw)
To: Luca Boccassi; +Cc: dpdk stable
On Wed, May 02, 2018 at 03:02:27PM +0100, Luca Boccassi wrote:
> On Wed, 2018-05-02 at 14:16 +0200, Gaëtan Rivet wrote:
> > On Wed, May 02, 2018 at 11:57:53AM +0100, Luca Boccassi wrote:
> > > On Wed, 2018-05-02 at 10:26 +0200, Gaëtan Rivet wrote:
> > > > Hi Luca,
> > > >
> > > > On Mon, Apr 30, 2018 at 03:53:21PM +0100, luca.boccassi@gmail.com
> > > > wrote:
> > > > > Hi,
> > > > >
> > > > > FYI, your patch has been queued to stable release 18.02.2
> > > > >
> > > > > Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stabl
> > > > > e
> > > > > yet.
> > > > > It will be pushed if I get no objections before 05/02/18. So
> > > > > please
> > > > > shout if anyone has objections.
> > > >
> > > > This patch will be bogus while still compiling in a stable
> > > > release,
> > > > without the commit: 35f462839b69 ("bus/vdev: add lock on device
> > > > list").
> > > >
> > > > It should be slightly reworked to function without. The previous
> > > > version
> > > > of this patch [1] could be used instead.
> > > >
> > > > [1]: https://dpdk.org/ml/archives/dev/2018-April/098822.html
> > > >
> > > > Regards,
> > >
> > > Do you think it's worth including or can I skip it?
> > >
> >
> > It is an actual bug with a simple fix, so I think it's worth
> > including
> > yes.
>
> This is the diff when removing v2 and applying v1 instead:
>
> --- a/drivers/bus/vdev/vdev.c
> +++ b/drivers/bus/vdev/vdev.c
> @@ -397,7 +397,7 @@ vdev_find_device(const struct rte_device *start, rte_dev_cmp_t cmp,
> }
> while (dev != NULL) {
> if (cmp(&dev->device, data) == 0)
> - break;
> + return &dev->device;
> dev = TAILQ_NEXT(dev, next);
> }
> return NULL;
>
>
> Please let me know if this is correct. Thanks!
Yes, in the end this is the only difference between the two versions
(aside from context). This should be correct.
--
Gaëtan Rivet
6WIND
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/sfc: add missing Rx fini on RSS setup fail path' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/vdev: " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'net/bnxt: set padding flags in Rx descriptor' " luca.boccassi
` (39 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Ivan Malov; +Cc: Andrew Rybchenko, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 72f718ffaa42ba5be671af13dd8139a5303a1fdd Mon Sep 17 00:00:00 2001
From: Ivan Malov <ivan.malov@oktetlabs.ru>
Date: Tue, 17 Apr 2018 16:18:38 +0100
Subject: [PATCH] net/sfc: add missing Rx fini on RSS setup fail path
[ upstream commit 00b94c1c21d4e8300c51acdd5a0e43bed4552bae ]
Fixes: 4ec1fc3ba881 ("net/sfc: add basic stubs for RSS support on driver attach")
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
drivers/net/sfc/sfc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/sfc/sfc.c b/drivers/net/sfc/sfc.c
index ac5fdcaa5..e8cfb1141 100644
--- a/drivers/net/sfc/sfc.c
+++ b/drivers/net/sfc/sfc.c
@@ -616,6 +616,8 @@ sfc_set_rss_defaults(struct sfc_adapter *sa)
fail_hash_support_get:
fail_scale_support_get:
+ efx_rx_fini(sa->nic);
+
fail_rx_init:
efx_ev_fini(sa->nic);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bnxt: set padding flags in Rx descriptor' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/vdev: " luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'net/sfc: add missing Rx fini on RSS setup fail path' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'net/bnxt: fix endianness of flag' " luca.boccassi
` (38 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Ajit Khaparde; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From e04fd759cb5967c1b4fd7955b8a75c90b210ccf5 Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Mon, 16 Apr 2018 18:11:14 -0700
Subject: [PATCH] net/bnxt: set padding flags in Rx descriptor
[ upstream commit f4253e97e7b0bc372ad6ba31fb05df5c79f97b5c ]
Set the RX_PROD_PKT_BD_FLAGS_EOP_PAD in Rx buffer descriptors.
Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code")
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_rxr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index aae9a6352..8f7ebf8c7 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -755,7 +755,7 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq)
if (rxq->rx_buf_use_size <= size)
size = rxq->rx_buf_use_size;
- type = RX_PROD_PKT_BD_TYPE_RX_PROD_PKT;
+ type = RX_PROD_PKT_BD_TYPE_RX_PROD_PKT | RX_PROD_PKT_BD_FLAGS_EOP_PAD;
rxr = rxq->rx_ring;
ring = rxr->rx_ring_struct;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bnxt: fix endianness of flag' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (2 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'net/bnxt: set padding flags in Rx descriptor' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'net/bnxt: fix incorrect ntuple flag setting' " luca.boccassi
` (37 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Ajit Khaparde; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 6a1801fd1c196f9ab52c4d85b66e1cbde9e8fd71 Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Mon, 16 Apr 2018 18:11:15 -0700
Subject: [PATCH] net/bnxt: fix endianness of flag
[ upstream commit 8e92b4f1553dc45b6093ba1cb9162b98b4cf95ce ]
In bnxt_hwrm_vnic_alloc, use rte_cpu_to_le_32 while setting the flags.
Fixes: 2691827e82c0 ("net/bnxt: add HWRM VNIC alloc")
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_hwrm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 05663fedd..f52146780 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -1193,7 +1193,8 @@ int bnxt_hwrm_vnic_alloc(struct bnxt *bp, struct bnxt_vnic_info *vnic)
HWRM_PREP(req, VNIC_ALLOC);
if (vnic->func_default)
- req.flags = HWRM_VNIC_ALLOC_INPUT_FLAGS_DEFAULT;
+ req.flags =
+ rte_cpu_to_le_32(HWRM_VNIC_ALLOC_INPUT_FLAGS_DEFAULT);
rc = bnxt_hwrm_send_message(bp, &req, sizeof(req));
HWRM_CHECK_RESULT();
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bnxt: fix incorrect ntuple flag setting' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (3 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'net/bnxt: fix endianness of flag' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'net/bnxt: fix Rx checksum flags for tunnel frames' " luca.boccassi
` (36 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Ajit Khaparde; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From ef0b72d83427d35d9177f11f4b5fc2bb1bff7758 Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Mon, 16 Apr 2018 18:11:16 -0700
Subject: [PATCH] net/bnxt: fix incorrect ntuple flag setting
[ upstream commit 532c005149b258c703a1d90884a57e80ac1ab407 ]
We are wrongly setting the Rx path flag while creating the ntuple filter.
It needs to be set for L2 or Exact Match filters only.
Fixes: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops")
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_filter.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/bnxt/bnxt_filter.c b/drivers/net/bnxt/bnxt_filter.c
index 032e8eed0..e318d4a02 100644
--- a/drivers/net/bnxt/bnxt_filter.c
+++ b/drivers/net/bnxt/bnxt_filter.c
@@ -844,7 +844,8 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev,
if (rc != 0)
goto ret;
//Since we support ingress attribute only - right now.
- filter->flags = HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX;
+ if (filter->filter_type == HWRM_CFA_EM_FILTER)
+ filter->flags = HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX;
switch (act->type) {
case RTE_FLOW_ACTION_TYPE_QUEUE:
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bnxt: fix Rx checksum flags for tunnel frames' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (4 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'net/bnxt: fix incorrect ntuple flag setting' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'net/bnxt: fix L2 filter cleanup' " luca.boccassi
` (35 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Ajit Khaparde; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 077bf25ffdce8a719b46ee657637ae5580be59dc Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Mon, 16 Apr 2018 18:11:17 -0700
Subject: [PATCH] net/bnxt: fix Rx checksum flags for tunnel frames
[ upstream commit f3a050b65852ba3cfaebdae24cdd4edd54f82380 ]
Fix Rx checksum status for tunnel frames as seen by hardware.
Current code does not handle cases for tunnel frames correctly.
Fixes: 7ec39d8c524b ("net/bnxt: update status of Rx IP/L4 CKSUM")
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_rxr.h | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h
index f3ed49bd6..174e1832f 100644
--- a/drivers/net/bnxt/bnxt_rxr.h
+++ b/drivers/net/bnxt/bnxt_rxr.h
@@ -52,17 +52,25 @@
#define BNXT_TPA_OUTER_L3_OFF(hdr_info) \
((hdr_info) & 0x1ff)
-#define RX_CMP_L4_CS_BITS rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_L4_CS_CALC)
+#define RX_CMP_L4_CS_BITS \
+ rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_L4_CS_CALC | \
+ RX_PKT_CMPL_FLAGS2_T_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_ERR_BITS \
+ rte_cpu_to_le_32(RX_PKT_CMPL_ERRORS_L4_CS_ERROR | \
+ RX_PKT_CMPL_ERRORS_T_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_ERR_BITS \
+ rte_cpu_to_le_32(RX_PKT_CMPL_ERRORS_IP_CS_ERROR | \
+ RX_PKT_CMPL_ERRORS_T_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_BITS \
+ rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_IP_CS_CALC | \
+ RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC)
#define RX_CMP_IP_CS_OK(rxcmp1) \
(((rxcmp1)->flags2 & RX_CMP_IP_CS_BITS) && \
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bnxt: fix L2 filter cleanup' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (5 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'net/bnxt: fix Rx checksum flags for tunnel frames' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'net/bnxt: fix flow destroy' " luca.boccassi
` (34 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Ajit Khaparde; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From b92061898cc3af278059c3ed17869d1cae30e0b1 Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Mon, 16 Apr 2018 18:11:18 -0700
Subject: [PATCH] net/bnxt: fix L2 filter cleanup
[ upstream commit 0b5ca74dda4085a80c4b8cdc1933377a9b4444d5 ]
We are wrongly freeing up a filter in the driver while it is still
configured in the HW. This can cause incorrect L2 filter id to be
used for filters created subsequently.
This filter will be cleared on cleanup anyway.
Fixes: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops")
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_filter.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_filter.c b/drivers/net/bnxt/bnxt_filter.c
index e318d4a02..b7718cdca 100644
--- a/drivers/net/bnxt/bnxt_filter.c
+++ b/drivers/net/bnxt/bnxt_filter.c
@@ -957,11 +957,6 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev,
goto ret;
}
- if (filter1) {
- bnxt_free_filter(bp, filter1);
- filter1->fw_l2_filter_id = -1;
- }
-
act = nxt_non_void_action(++act);
if (act->type != RTE_FLOW_ACTION_TYPE_END) {
rte_flow_error_set(error, EINVAL,
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bnxt: fix flow destroy' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (6 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'net/bnxt: fix L2 filter cleanup' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'net/bnxt: reset L2 filter id once filter is freed' " luca.boccassi
` (33 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Ajit Khaparde; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 70f16a7042b198ef2d31c7e005122684dc4e337d Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Mon, 16 Apr 2018 18:11:19 -0700
Subject: [PATCH] net/bnxt: fix flow destroy
[ upstream commit 608e6fd6ab4f03b3f629779db47e8effe19ff4bc ]
bnxt_hwrm_clear_l2_filter needs to be called only if the filter type
is L2 and not otherwise.
Also check for the return value of bnxt_hwrm_clear_l2_filter().
Fixes: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops")
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_filter.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_filter.c b/drivers/net/bnxt/bnxt_filter.c
index b7718cdca..64a23f628 100644
--- a/drivers/net/bnxt/bnxt_filter.c
+++ b/drivers/net/bnxt/bnxt_filter.c
@@ -1182,8 +1182,8 @@ bnxt_flow_destroy(struct rte_eth_dev *dev,
ret = bnxt_hwrm_clear_em_filter(bp, filter);
if (filter->filter_type == HWRM_CFA_NTUPLE_FILTER)
ret = bnxt_hwrm_clear_ntuple_filter(bp, filter);
-
- bnxt_hwrm_clear_l2_filter(bp, filter);
+ else
+ ret = bnxt_hwrm_clear_l2_filter(bp, filter);
if (!ret) {
STAILQ_REMOVE(&vnic->flow_list, flow, rte_flow, next);
rte_free(flow);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bnxt: reset L2 filter id once filter is freed' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (7 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'net/bnxt: fix flow destroy' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'net/bnxt: free memory allocated for VF filters' " luca.boccassi
` (32 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Ajit Khaparde; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From e438ed756e229af7c8ed543bd9b366ce79ecaa1a Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Mon, 16 Apr 2018 18:11:22 -0700
Subject: [PATCH] net/bnxt: reset L2 filter id once filter is freed
[ upstream commit 1383434c908922e60ff2637a66c771ead2ddd035 ]
The fw_l2_filter_id for a ntuple filter is needed only for the lifetime
of the ntuple filter. Once the filter is free, reset the field.
The associated l2_filter will be freed as a part of its own cleanup.
Fixes: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops")
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_hwrm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index f52146780..9c7b1f244 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -3702,6 +3702,7 @@ int bnxt_hwrm_clear_ntuple_filter(struct bnxt *bp,
HWRM_UNLOCK();
filter->fw_ntuple_filter_id = -1;
+ filter->fw_l2_filter_id = UINT64_MAX;
return 0;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bnxt: free memory allocated for VF filters' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (8 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'net/bnxt: reset L2 filter id once filter is freed' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'net/bnxt: avoid freeing memzone multiple times' " luca.boccassi
` (31 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Ajit Khaparde; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From b3b144d48d4c78cc5d0a89619a8db02257050b38 Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Mon, 16 Apr 2018 18:11:23 -0700
Subject: [PATCH] net/bnxt: free memory allocated for VF filters
[ upstream commit f11fd694a84a3108b93aaf807f1d1f12cb112ac4 ]
Memory allocated to hold VF filter info is not being freed currently.
This can cause potential memory leak.
Fixes: 7a5b0874440e ("net/bnxt: support to add a VF MAC address")
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_filter.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/bnxt/bnxt_filter.c b/drivers/net/bnxt/bnxt_filter.c
index 64a23f628..5ede63436 100644
--- a/drivers/net/bnxt/bnxt_filter.c
+++ b/drivers/net/bnxt/bnxt_filter.c
@@ -159,6 +159,14 @@ void bnxt_free_filter_mem(struct bnxt *bp)
rte_free(bp->filter_info);
bp->filter_info = NULL;
+
+ for (i = 0; i < bp->pf.max_vfs; i++) {
+ STAILQ_FOREACH(filter, &bp->pf.vf_info[i].filter, next) {
+ rte_free(filter);
+ STAILQ_REMOVE(&bp->pf.vf_info[i].filter, filter,
+ bnxt_filter_info, next);
+ }
+ }
}
int bnxt_alloc_filter_mem(struct bnxt *bp)
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bnxt: avoid freeing memzone multiple times' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (9 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'net/bnxt: free memory allocated for VF filters' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'net/bnxt: add device ID for Stratus VF' " luca.boccassi
` (30 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Ajit Khaparde; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From c3db11efce9ee68ff7c549ef3c249d44af337f67 Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Mon, 16 Apr 2018 18:11:25 -0700
Subject: [PATCH] net/bnxt: avoid freeing memzone multiple times
[ upstream commit 23460b4c6a7ab68e2b6d217460684a554f7e78eb ]
Since we are storing the mem_zone address for each ring created,
we are freeing the same address multiple times.
For example the memory zone created for Rx is being freed during
Rx ring cleanup, AGG ring cleanup and CQ cleanup.
Avoid this by storing the memory zone address in RXQ instead and
free it as a part of queue_release dev_op.
In the same way do the same for TX queues as well.
Fixes: 51c87ebafc7d ("net/bnxt: add Tx queue create/destroy")
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_ring.c | 10 +++++++---
drivers/net/bnxt/bnxt_ring.h | 4 ++--
drivers/net/bnxt/bnxt_rxq.c | 4 +++-
drivers/net/bnxt/bnxt_rxq.h | 1 +
drivers/net/bnxt/bnxt_txq.c | 4 +++-
drivers/net/bnxt/bnxt_txq.h | 1 +
6 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index 8fb897216..75c0830fe 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -56,7 +56,7 @@ void bnxt_free_ring(struct bnxt_ring *ring)
memset((char *)*ring->vmem, 0, ring->vmem_size);
*ring->vmem = NULL;
}
- rte_memzone_free((const struct rte_memzone *)ring->mem_zone);
+ ring->mem_zone = NULL;
}
/*
@@ -89,12 +89,14 @@ int bnxt_init_ring_grps(struct bnxt *bp)
* rx bd ring - Only non-zero length if rx_ring_info is not NULL
*/
int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx,
- struct bnxt_tx_ring_info *tx_ring_info,
- struct bnxt_rx_ring_info *rx_ring_info,
+ struct bnxt_tx_queue *txq,
+ struct bnxt_rx_queue *rxq,
struct bnxt_cp_ring_info *cp_ring_info,
const char *suffix)
{
struct bnxt_ring *cp_ring = cp_ring_info->cp_ring_struct;
+ struct bnxt_rx_ring_info *rx_ring_info = rxq ? rxq->rx_ring : NULL;
+ struct bnxt_tx_ring_info *tx_ring_info = txq ? txq->tx_ring : NULL;
struct bnxt_ring *tx_ring;
struct bnxt_ring *rx_ring;
struct rte_pci_device *pdev = bp->pdev;
@@ -191,6 +193,7 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx,
}
if (tx_ring_info) {
+ txq->mz = mz;
tx_ring = tx_ring_info->tx_ring_struct;
tx_ring->bd = ((char *)mz->addr + tx_ring_start);
@@ -210,6 +213,7 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx,
}
if (rx_ring_info) {
+ rxq->mz = mz;
rx_ring = rx_ring_info->rx_ring_struct;
rx_ring->bd = ((char *)mz->addr + rx_ring_start);
diff --git a/drivers/net/bnxt/bnxt_ring.h b/drivers/net/bnxt/bnxt_ring.h
index ebf7228e4..f4d9f095c 100644
--- a/drivers/net/bnxt/bnxt_ring.h
+++ b/drivers/net/bnxt/bnxt_ring.h
@@ -93,8 +93,8 @@ struct bnxt_cp_ring_info;
void bnxt_free_ring(struct bnxt_ring *ring);
int bnxt_init_ring_grps(struct bnxt *bp);
int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx,
- struct bnxt_tx_ring_info *tx_ring_info,
- struct bnxt_rx_ring_info *rx_ring_info,
+ struct bnxt_tx_queue *txq,
+ struct bnxt_rx_queue *rxq,
struct bnxt_cp_ring_info *cp_ring_info,
const char *suffix);
int bnxt_alloc_hwrm_rings(struct bnxt *bp);
diff --git a/drivers/net/bnxt/bnxt_rxq.c b/drivers/net/bnxt/bnxt_rxq.c
index d49f35462..33cca9263 100644
--- a/drivers/net/bnxt/bnxt_rxq.c
+++ b/drivers/net/bnxt/bnxt_rxq.c
@@ -295,6 +295,8 @@ void bnxt_rx_queue_release_op(void *rx_queue)
bnxt_free_ring(rxq->cp_ring->cp_ring_struct);
bnxt_free_rxq_stats(rxq);
+ rte_memzone_free(rxq->mz);
+ rxq->mz = NULL;
rte_free(rxq);
}
@@ -355,7 +357,7 @@ int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
eth_dev->data->rx_queues[queue_idx] = rxq;
/* Allocate RX ring hardware descriptors */
- if (bnxt_alloc_rings(bp, queue_idx, NULL, rxq->rx_ring, rxq->cp_ring,
+ if (bnxt_alloc_rings(bp, queue_idx, NULL, rxq, rxq->cp_ring,
"rxr")) {
PMD_DRV_LOG(ERR,
"ring_dma_zone_reserve for rx_ring failed!\n");
diff --git a/drivers/net/bnxt/bnxt_rxq.h b/drivers/net/bnxt/bnxt_rxq.h
index c7acaa755..514428128 100644
--- a/drivers/net/bnxt/bnxt_rxq.h
+++ b/drivers/net/bnxt/bnxt_rxq.h
@@ -60,6 +60,7 @@ struct bnxt_rx_queue {
uint32_t rx_buf_use_size; /* useable size */
struct bnxt_rx_ring_info *rx_ring;
struct bnxt_cp_ring_info *cp_ring;
+ const struct rte_memzone *mz;
};
void bnxt_free_rxq_stats(struct bnxt_rx_queue *rxq);
diff --git a/drivers/net/bnxt/bnxt_txq.c b/drivers/net/bnxt/bnxt_txq.c
index 53524346d..ec4f5f6f5 100644
--- a/drivers/net/bnxt/bnxt_txq.c
+++ b/drivers/net/bnxt/bnxt_txq.c
@@ -93,6 +93,8 @@ void bnxt_tx_queue_release_op(void *tx_queue)
bnxt_free_ring(txq->cp_ring->cp_ring_struct);
bnxt_free_txq_stats(txq);
+ rte_memzone_free(txq->mz);
+ txq->mz = NULL;
rte_free(txq);
}
@@ -147,7 +149,7 @@ int bnxt_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
txq->port_id = eth_dev->data->port_id;
/* Allocate TX ring hardware descriptors */
- if (bnxt_alloc_rings(bp, queue_idx, txq->tx_ring, NULL, txq->cp_ring,
+ if (bnxt_alloc_rings(bp, queue_idx, txq, NULL, txq->cp_ring,
"txr")) {
PMD_DRV_LOG(ERR, "ring_dma_zone_reserve for tx_ring failed!");
bnxt_tx_queue_release_op(txq);
diff --git a/drivers/net/bnxt/bnxt_txq.h b/drivers/net/bnxt/bnxt_txq.h
index e27c34fa9..a013a84bd 100644
--- a/drivers/net/bnxt/bnxt_txq.h
+++ b/drivers/net/bnxt/bnxt_txq.h
@@ -61,6 +61,7 @@ struct bnxt_tx_queue {
unsigned int cp_nr_rings;
struct bnxt_cp_ring_info *cp_ring;
+ const struct rte_memzone *mz;
};
void bnxt_free_txq_stats(struct bnxt_tx_queue *txq);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bnxt: add device ID for Stratus VF' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (10 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'net/bnxt: avoid freeing memzone multiple times' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'net/thunderx: fix MTU configuration for jumbo packets' " luca.boccassi
` (29 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Somnath Kotur; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From bdd8f1889b870d3392e91f5012d6ce7cbcf658f2 Mon Sep 17 00:00:00 2001
From: Somnath Kotur <somnath.kotur@broadcom.com>
Date: Mon, 16 Apr 2018 18:11:26 -0700
Subject: [PATCH] net/bnxt: add device ID for Stratus VF
[ upstream commit 2d10c776c022214d93946cc475629e0221c46742 ]
Fixes: 1cd45aeb3270 ("net/bnxt: support Stratus VF device")
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 8c1596e2a..14aaf05a8 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -62,7 +62,8 @@ int bnxt_logtype_driver;
#define PCI_VENDOR_ID_BROADCOM 0x14E4
-#define BROADCOM_DEV_ID_STRATUS_NIC_VF 0x1609
+#define BROADCOM_DEV_ID_STRATUS_NIC_VF1 0x1606
+#define BROADCOM_DEV_ID_STRATUS_NIC_VF2 0x1609
#define BROADCOM_DEV_ID_STRATUS_NIC 0x1614
#define BROADCOM_DEV_ID_57414_VF 0x16c1
#define BROADCOM_DEV_ID_57301 0x16c8
@@ -100,7 +101,9 @@ int bnxt_logtype_driver;
static const struct rte_pci_id bnxt_pci_id_map[] = {
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM,
- BROADCOM_DEV_ID_STRATUS_NIC_VF) },
+ BROADCOM_DEV_ID_STRATUS_NIC_VF1) },
+ { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM,
+ BROADCOM_DEV_ID_STRATUS_NIC_VF2) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_STRATUS_NIC) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57414_VF) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57301) },
@@ -3049,7 +3052,8 @@ static bool bnxt_vf_pciid(uint16_t id)
id == BROADCOM_DEV_ID_5731X_VF ||
id == BROADCOM_DEV_ID_5741X_VF ||
id == BROADCOM_DEV_ID_57414_VF ||
- id == BROADCOM_DEV_ID_STRATUS_NIC_VF)
+ id == BROADCOM_DEV_ID_STRATUS_NIC_VF1 ||
+ id == BROADCOM_DEV_ID_STRATUS_NIC_VF2)
return true;
return false;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/thunderx: fix MTU configuration for jumbo packets' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (11 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'net/bnxt: add device ID for Stratus VF' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'net/ixgbe: enable vector PMD for icc 32 bits' " luca.boccassi
` (28 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Nitin Saxena; +Cc: Jerin Jacob, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From b7fd74c24638458d0fce1c1627c98f40146a53a3 Mon Sep 17 00:00:00 2001
From: Nitin Saxena <nitin.saxena@caviumnetworks.com>
Date: Mon, 16 Apr 2018 10:44:47 +0000
Subject: [PATCH] net/thunderx: fix MTU configuration for jumbo packets
[ upstream commit c77875fbb8004c22e9910338f93b7be3e29ab9f9 ]
thunderx pmd driver passes dev_info.max_rx_pktlen as
9200 (via rte_eth_dev_info_get()) to application.
But, when application tries to set MTU as
(9200 - sizeof(ethernet_header_t)) the operation fails
because of missing CRC and VLAN additions.
This patch fixes the following for thunderx pmd driver:
- Sets NIC_HW_MAX_FRS to 9216 (instead of 9200)
- Sets NIC_HW_MAX_MTU to 9190 (NIC_HW_MAX_FRS - ETH_HLEN
- ETHER_CRC_LEN - 2*VLAN_HLEN)
- Sets dev_info->max_rx_pkt_len to NIC_HW_MAX_MTU +
ETH_HLEN (instead of 9200)
- Allows rte_eth_dev_set_mtu() to pass if application
(like VPP) calls rte_eth_dev_set_mtu() before
rte_eth_dev_start() by putting appropriate check for
dev->data->dev_started
Fixes: 65d9804edc05 ("net/thunderx: support MTU configuration")
Signed-off-by: Nitin Saxena <nitin.saxena@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
drivers/net/thunderx/base/nicvf_hw_defs.h | 5 ++++-
drivers/net/thunderx/nicvf_ethdev.c | 15 +++++++--------
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/drivers/net/thunderx/base/nicvf_hw_defs.h b/drivers/net/thunderx/base/nicvf_hw_defs.h
index b13c21fff..b12c8ec50 100644
--- a/drivers/net/thunderx/base/nicvf_hw_defs.h
+++ b/drivers/net/thunderx/base/nicvf_hw_defs.h
@@ -171,7 +171,10 @@
/* Min/Max packet size */
#define NIC_HW_MIN_FRS (64)
-#define NIC_HW_MAX_FRS (9200) /* 9216 max pkt including FCS */
+/* ETH_HLEN+ETH_FCS_LEN+2*VLAN_HLEN */
+#define NIC_HW_L2_OVERHEAD (26)
+#define NIC_HW_MAX_MTU (9190)
+#define NIC_HW_MAX_FRS (NIC_HW_MAX_MTU + NIC_HW_L2_OVERHEAD)
#define NIC_HW_MAX_SEGS (12)
/* Descriptor alignments */
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index a65361fb4..ad8aa4145 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -170,7 +170,7 @@ static int
nicvf_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
{
struct nicvf *nic = nicvf_pmd_priv(dev);
- uint32_t buffsz, frame_size = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
+ uint32_t buffsz, frame_size = mtu + NIC_HW_L2_OVERHEAD;
size_t i;
struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode;
@@ -188,7 +188,7 @@ nicvf_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
* Refuse mtu that requires the support of scattered packets
* when this feature has not been enabled before.
*/
- if (!dev->data->scattered_rx &&
+ if (dev->data->dev_started && !dev->data->scattered_rx &&
(frame_size + 2 * VLAN_TAG_SIZE > buffsz))
return -EINVAL;
@@ -202,11 +202,11 @@ nicvf_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
else
rxmode->offloads &= ~DEV_RX_OFFLOAD_JUMBO_FRAME;
- if (nicvf_mbox_update_hw_max_frs(nic, frame_size))
+ if (nicvf_mbox_update_hw_max_frs(nic, mtu))
return -EINVAL;
- /* Update max frame size */
- rxmode->max_rx_pkt_len = (uint32_t)frame_size;
+ /* Update max_rx_pkt_len */
+ rxmode->max_rx_pkt_len = mtu + ETHER_HDR_LEN;
nic->mtu = mtu;
for (i = 0; i < nic->sqs_count; i++)
@@ -1418,7 +1418,7 @@ nicvf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
dev_info->speed_capa |= ETH_LINK_SPEED_40G;
dev_info->min_rx_bufsize = ETHER_MIN_MTU;
- dev_info->max_rx_pktlen = NIC_HW_MAX_FRS;
+ dev_info->max_rx_pktlen = NIC_HW_MAX_MTU + ETHER_HDR_LEN;
dev_info->max_rx_queues =
(uint16_t)MAX_RCV_QUEUES_PER_QS * (MAX_SQS_PER_VF + 1);
dev_info->max_tx_queues =
@@ -1751,8 +1751,7 @@ nicvf_dev_start(struct rte_eth_dev *dev)
/* Setup MTU based on max_rx_pkt_len or default */
mtu = dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_JUMBO_FRAME ?
dev->data->dev_conf.rxmode.max_rx_pkt_len
- - ETHER_HDR_LEN - ETHER_CRC_LEN
- : ETHER_MTU;
+ - ETHER_HDR_LEN : ETHER_MTU;
if (nicvf_dev_set_mtu(dev, mtu)) {
PMD_INIT_LOG(ERR, "Failed to set default mtu size");
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/ixgbe: enable vector PMD for icc 32 bits' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (12 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'net/thunderx: fix MTU configuration for jumbo packets' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'net/mlx4: fix RSS resource leak in case of error' " luca.boccassi
` (27 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Pablo de Lara; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 9a981b6d2372db8f294df3f4c63af1764effea1b Mon Sep 17 00:00:00 2001
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Date: Tue, 17 Apr 2018 14:39:04 +0100
Subject: [PATCH] net/ixgbe: enable vector PMD for icc 32 bits
[ upstream commit 7bd0994f0127a24860dc3bc03d60b37612d3ecf0 ]
IXGBE vector PMD was re-enabled for 32 bits, but only for gcc.
This commit enables it for icc too.
Fixes: e6672d2f0f88 ("net/ixgbe: enable ixgbe vector PMD for i686")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
config/defconfig_i686-native-linuxapp-icc | 5 -----
1 file changed, 5 deletions(-)
diff --git a/config/defconfig_i686-native-linuxapp-icc b/config/defconfig_i686-native-linuxapp-icc
index 144ba0ae4..78706f80d 100644
--- a/config/defconfig_i686-native-linuxapp-icc
+++ b/config/defconfig_i686-native-linuxapp-icc
@@ -17,11 +17,6 @@ CONFIG_RTE_TOOLCHAIN_ICC=y
#
CONFIG_RTE_LIBRTE_KNI=n
-#
-# Vectorized PMD is not supported on 32-bit
-#
-CONFIG_RTE_IXGBE_INC_VECTOR=n
-
#
# Solarflare PMD is not supported on 32-bit
#
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/mlx4: fix RSS resource leak in case of error' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (13 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'net/ixgbe: enable vector PMD for icc 32 bits' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'net/mlx4: fix ignored RSS hash types' " luca.boccassi
` (26 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Adrien Mazarguil; +Cc: Nelio Laranjeiro, Ferruh Yigit, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From c737e4f5b68e9fce256cf9b17d2fc06f9a999846 Mon Sep 17 00:00:00 2001
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Date: Thu, 19 Apr 2018 12:07:25 +0200
Subject: [PATCH] net/mlx4: fix RSS resource leak in case of error
[ upstream commit cb43322fbd00c7f7c13ad2095fb0331bf8a5f262 ]
When memory cannot be allocated for a flow rule, its RSS context reference
is not dropped.
Fixes: 078b8b452e6b ("net/mlx4: add RSS flow rule action support")
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
drivers/net/mlx4/mlx4_flow.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c
index 2d55bfe03..a3b4480b4 100644
--- a/drivers/net/mlx4/mlx4_flow.c
+++ b/drivers/net/mlx4/mlx4_flow.c
@@ -820,11 +820,14 @@ fill:
},
};
- if (!mlx4_zmallocv(__func__, vec, RTE_DIM(vec)))
+ if (!mlx4_zmallocv(__func__, vec, RTE_DIM(vec))) {
+ if (temp.rss)
+ mlx4_rss_put(temp.rss);
return rte_flow_error_set
(error, -rte_errno,
RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
"flow rule handle allocation failure");
+ }
/* Most fields will be updated by second pass. */
*flow = (struct rte_flow){
.ibv_attr = temp.ibv_attr,
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/mlx4: fix ignored RSS hash types' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (14 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'net/mlx4: fix RSS resource leak in case of error' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'net/mlx5: fix RSS flow action bounds check' " luca.boccassi
` (25 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Adrien Mazarguil; +Cc: Nelio Laranjeiro, Ferruh Yigit, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From fd5885ebc62c5b5b6d674057773a0d8fd5a64dca Mon Sep 17 00:00:00 2001
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Date: Thu, 19 Apr 2018 12:07:27 +0200
Subject: [PATCH] net/mlx4: fix ignored RSS hash types
[ upstream commit ef134c8daa0873daa3aa9b02313d6f452c3477a2 ]
When an unsupported hash type is part of a RSS configuration structure, it
is silently ignored instead of triggering an error. This may lead
applications to assume that such types are accepted, while they are in fact
not part of the resulting flow rules.
Fixes: 078b8b452e6b ("net/mlx4: add RSS flow rule action support")
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
drivers/net/mlx4/mlx4_flow.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c
index a3b4480b4..4d26df326 100644
--- a/drivers/net/mlx4/mlx4_flow.c
+++ b/drivers/net/mlx4/mlx4_flow.c
@@ -706,6 +706,7 @@ fill:
const struct rte_flow_action_queue *queue;
const struct rte_flow_action_rss *rss;
const struct rte_eth_rss_conf *rss_conf;
+ uint64_t fields;
unsigned int i;
case RTE_FLOW_ACTION_TYPE_VOID:
@@ -780,10 +781,15 @@ fill:
" of the context size";
goto exit_action_not_supported;
}
+ rte_errno = 0;
+ fields = mlx4_conv_rss_hf(priv, rss_conf->rss_hf);
+ if (fields == (uint64_t)-1 && rte_errno) {
+ msg = "unsupported RSS hash type requested";
+ goto exit_action_not_supported;
+ }
flow->rss = mlx4_rss_get
- (priv,
- mlx4_conv_rss_hf(priv, rss_conf->rss_hf),
- rss_conf->rss_key, rss->num, rss->queue);
+ (priv, fields, rss_conf->rss_key, rss->num,
+ rss->queue);
if (!flow->rss) {
msg = "either invalid parameters or not enough"
" resources for additional multi-queue"
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/mlx5: fix RSS flow action bounds check' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (15 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'net/mlx4: fix ignored RSS hash types' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'net/bnxt: fix matching of flow API item masks' " luca.boccassi
` (24 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Adrien Mazarguil; +Cc: Nelio Laranjeiro, Ferruh Yigit, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 33993e25783fb68ab233e4f9aa71c670cea1049e Mon Sep 17 00:00:00 2001
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Date: Thu, 19 Apr 2018 12:07:29 +0200
Subject: [PATCH] net/mlx5: fix RSS flow action bounds check
[ upstream commit e68744e53ed209c0419925171c5aa510f6643adb ]
The number of queues provided by the application is not checked against
parser's supported maximum.
Fixes: 3d821d6fea40 ("net/mlx5: support RSS action flow rule")
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
drivers/net/mlx5/mlx5_flow.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index bf718f894..8a5565b30 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -16,6 +16,7 @@
#pragma GCC diagnostic error "-Wpedantic"
#endif
+#include <rte_common.h>
#include <rte_ethdev_driver.h>
#include <rte_flow.h>
#include <rte_flow_driver.h>
@@ -698,6 +699,14 @@ priv_flow_convert_actions(struct priv *priv,
return -rte_errno;
}
}
+ if (rss->num > RTE_DIM(parser->queues)) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ACTION,
+ actions,
+ "too many queues for RSS"
+ " context");
+ return -rte_errno;
+ }
for (n = 0; n < rss->num; ++n) {
if (rss->queue[n] >= priv->rxqs_n) {
rte_flow_error_set(error, EINVAL,
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bnxt: fix matching of flow API item masks' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (16 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'net/mlx5: fix RSS flow action bounds check' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'app/testpmd: fix flow completion for RSS queues' " luca.boccassi
` (23 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Adrien Mazarguil; +Cc: Ferruh Yigit, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 774362c7c44c54d155815a241a6cd842028c1cd6 Mon Sep 17 00:00:00 2001
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Date: Thu, 19 Apr 2018 12:07:31 +0200
Subject: [PATCH] net/bnxt: fix matching of flow API item masks
[ upstream commit e65f082adbf62a17dc1759c8af532811672095c3 ]
Some values are interpreted without endian conversion and/or without
taking the proper mask into account.
Fixes: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops")
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
drivers/net/bnxt/bnxt_filter.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_filter.c b/drivers/net/bnxt/bnxt_filter.c
index 5ede63436..3b9820813 100644
--- a/drivers/net/bnxt/bnxt_filter.c
+++ b/drivers/net/bnxt/bnxt_filter.c
@@ -33,6 +33,7 @@
#include <sys/queue.h>
+#include <rte_byteorder.h>
#include <rte_log.h>
#include <rte_malloc.h>
#include <rte_flow.h>
@@ -382,7 +383,8 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp,
}
/* Mask is not allowed. Only exact matches are */
- if ((eth_mask->type & UINT16_MAX) != UINT16_MAX) {
+ if (eth_mask->type &&
+ eth_mask->type != RTE_BE16(0xffff)) {
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM,
item,
@@ -408,7 +410,7 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp,
* RTE_LOG(ERR, PMD, "Handle this condition\n");
* }
*/
- if (eth_spec->type) {
+ if (eth_mask->type) {
filter->ethertype =
rte_be_to_cpu_16(eth_spec->type);
en |= use_ntuple ?
@@ -422,13 +424,15 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp,
(const struct rte_flow_item_vlan *)item->spec;
vlan_mask =
(const struct rte_flow_item_vlan *)item->mask;
- if (vlan_mask->tci & 0xFFFF && !vlan_mask->tpid) {
+ if (vlan_mask->tci &&
+ vlan_mask->tci == RTE_BE16(0x0fff) &&
+ !vlan_mask->tpid) {
/* Only the VLAN ID can be matched. */
filter->l2_ovlan =
rte_be_to_cpu_16(vlan_spec->tci &
- 0xFFF);
+ RTE_BE16(0x0fff));
en |= EM_FLOW_ALLOC_INPUT_EN_OVLAN_VID;
- } else {
+ } else if (vlan_mask->tci || vlan_mask->tpid) {
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM,
item,
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'app/testpmd: fix flow completion for RSS queues' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (17 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'net/bnxt: fix matching of flow API item masks' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'app/testpmd: fix lack of flow action configuration' " luca.boccassi
` (22 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Adrien Mazarguil; +Cc: Ferruh Yigit, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 66e7a5b218fe707831e132d888760d530bee550d Mon Sep 17 00:00:00 2001
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Date: Thu, 19 Apr 2018 12:07:33 +0200
Subject: [PATCH] app/testpmd: fix flow completion for RSS queues
[ upstream commit 7a17b969e9257546d967900719f2168cdc9653de ]
The lack of a working completion for RSS queues was overlooked during
development; until now only "end" was displayed as a valid token.
Fixes: 05d34c6e9d2c ("app/testpmd: add queue actions to flow command")
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
app/test-pmd/cmdline_flow.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index a5cf84f79..9cac8e9bf 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -2663,17 +2663,15 @@ static int
comp_vc_action_rss_queue(struct context *ctx, const struct token *token,
unsigned int ent, char *buf, unsigned int size)
{
- static const char *const str[] = { "", "end", NULL };
- unsigned int i;
-
(void)ctx;
(void)token;
- for (i = 0; str[i] != NULL; ++i)
- if (buf && i == ent)
- return snprintf(buf, size, "%s", str[i]);
- if (buf)
- return -1;
- return i;
+ if (!buf)
+ return nb_rxq + 1;
+ if (ent < nb_rxq)
+ return snprintf(buf, size, "%u", ent);
+ if (ent == nb_rxq)
+ return snprintf(buf, size, "end");
+ return -1;
}
/** Internal context. */
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'app/testpmd: fix lack of flow action configuration' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (18 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'app/testpmd: fix flow completion for RSS queues' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'app/testpmd: fix RSS " luca.boccassi
` (21 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Adrien Mazarguil; +Cc: Nelio Laranjeiro, Ferruh Yigit, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 1038cd07e6234f3db2b5acc2be0f67447806061c Mon Sep 17 00:00:00 2001
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Date: Thu, 19 Apr 2018 12:07:35 +0200
Subject: [PATCH] app/testpmd: fix lack of flow action configuration
[ upstream commit e153717a2614858768eb9a3ed63f7d665ab8864b ]
Configuration structure is not optional with flow rule actions that expect
one; this pointer is not supposed to be NULL and PMDs should not have to
verify it.
Like pattern item spec/last/mask fields, it is currently set when at least
one configuration parameter is provided on the command line. This patch
sets it as soon as an action is created instead.
Fixes: 7a91969ad35e ("app/testpmd: add various actions to flow command")
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
app/test-pmd/cmdline_flow.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 9cac8e9bf..c2cf415ef 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -1909,6 +1909,7 @@ parse_vc(struct context *ctx, const struct token *token,
return -1;
*action = (struct rte_flow_action){
.type = priv->type,
+ .conf = data_size ? data : NULL,
};
++out->args.vc.actions_n;
ctx->object = action;
@@ -1989,7 +1990,6 @@ parse_vc_conf(struct context *ctx, const struct token *token,
void *buf, unsigned int size)
{
struct buffer *out = buf;
- struct rte_flow_action *action;
(void)size;
/* Token name must match. */
@@ -1998,14 +1998,9 @@ parse_vc_conf(struct context *ctx, const struct token *token,
/* Nothing else to do if there is no buffer. */
if (!out)
return len;
- if (!out->args.vc.actions_n)
- return -1;
- action = &out->args.vc.actions[out->args.vc.actions_n - 1];
/* Point to selected object. */
ctx->object = out->args.vc.data;
ctx->objmask = NULL;
- /* Update configuration pointer. */
- action->conf = ctx->object;
return len;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'app/testpmd: fix RSS flow action configuration' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (19 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'app/testpmd: fix lack of flow action configuration' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'app/testpmd: fix missing RSS fields in flow action' " luca.boccassi
` (20 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Adrien Mazarguil; +Cc: Nelio Laranjeiro, Ferruh Yigit, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 716f1aac0b26c618419778fcdffb207484891384 Mon Sep 17 00:00:00 2001
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Date: Thu, 19 Apr 2018 12:07:37 +0200
Subject: [PATCH] app/testpmd: fix RSS flow action configuration
[ upstream commit d0ad8648b1c57c0e311ab7a3192bc3b507de5bf6 ]
Except for a list of queues, RSS configuration (hash key and fields) cannot
be specified from the flow command line and testpmd does not provide safe
defaults either.
In order to validate their implementation with testpmd, PMDs had to
interpret its NULL RSS configuration parameters somehow, however this has
never been valid to begin with.
This patch makes testpmd always provide default values.
The list of RSS types to use is exclusively taken from the global "rss_hf"
variable, itself configured through the "port config all rss" command or
--rss-ip/--rss-udp command-line options.
Fixes: 05d34c6e9d2c ("app/testpmd: add queue actions to flow command")
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
app/test-pmd/cmdline.c | 2 +
app/test-pmd/cmdline_flow.c | 99 +++++++++++++++++++++++++++----
app/test-pmd/config.c | 140 +++++++++++++++++++++++++++++++-------------
3 files changed, 189 insertions(+), 52 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index f22fa935c..de1ce745d 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1914,6 +1914,8 @@ cmd_config_rss_parsed(void *parsed_result,
return;
}
rss_conf.rss_key = NULL;
+ /* Update global configuration for RSS types. */
+ rss_hf = rss_conf.rss_hf;
RTE_ETH_FOREACH_DEV(i) {
diag = rte_eth_dev_rss_hash_update(i, &rss_conf);
if (diag < 0)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index c2cf415ef..0e250d595 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -184,13 +184,19 @@ enum index {
#define ITEM_RAW_SIZE \
(offsetof(struct rte_flow_item_raw, pattern) + ITEM_RAW_PATTERN_SIZE)
-/** Number of queue[] entries in struct rte_flow_action_rss. */
-#define ACTION_RSS_NUM 32
+/** Maximum number of queue indices in struct rte_flow_action_rss. */
+#define ACTION_RSS_QUEUE_NUM 32
-/** Storage size for struct rte_flow_action_rss including queues. */
-#define ACTION_RSS_SIZE \
- (offsetof(struct rte_flow_action_rss, queue) + \
- sizeof(*((struct rte_flow_action_rss *)0)->queue) * ACTION_RSS_NUM)
+/** Storage for struct rte_flow_action_rss including external data. */
+union action_rss_data {
+ struct rte_flow_action_rss conf;
+ struct {
+ uint8_t conf_data[offsetof(struct rte_flow_action_rss, queue)];
+ uint16_t queue[ACTION_RSS_QUEUE_NUM];
+ struct rte_eth_rss_conf rss_conf;
+ uint8_t rss_key[RSS_HASH_KEY_LENGTH];
+ } s;
+};
/** Maximum number of subsequent tokens and arguments on the stack. */
#define CTX_STACK_SIZE 16
@@ -316,6 +322,13 @@ struct token {
.size = (sz), \
})
+/** Static initializer for ARGS() with arbitrary offset and size. */
+#define ARGS_ENTRY_ARB(o, s) \
+ (&(const struct arg){ \
+ .offset = (o), \
+ .size = (s), \
+ })
+
/** Same as ARGS_ENTRY() using network byte ordering. */
#define ARGS_ENTRY_HTON(s, f) \
(&(const struct arg){ \
@@ -650,6 +663,9 @@ static int parse_vc_spec(struct context *, const struct token *,
const char *, unsigned int, void *, unsigned int);
static int parse_vc_conf(struct context *, const struct token *,
const char *, unsigned int, void *, unsigned int);
+static int parse_vc_action_rss(struct context *, const struct token *,
+ const char *, unsigned int, void *,
+ unsigned int);
static int parse_vc_action_rss_queue(struct context *, const struct token *,
const char *, unsigned int, void *,
unsigned int);
@@ -1573,9 +1589,9 @@ static const struct token token_list[] = {
[ACTION_RSS] = {
.name = "rss",
.help = "spread packets among several queues",
- .priv = PRIV_ACTION(RSS, ACTION_RSS_SIZE),
+ .priv = PRIV_ACTION(RSS, sizeof(union action_rss_data)),
.next = NEXT(action_rss),
- .call = parse_vc,
+ .call = parse_vc_action_rss,
},
[ACTION_RSS_QUEUES] = {
.name = "queues",
@@ -2004,6 +2020,61 @@ parse_vc_conf(struct context *ctx, const struct token *token,
return len;
}
+/** Parse RSS action. */
+static int
+parse_vc_action_rss(struct context *ctx, const struct token *token,
+ const char *str, unsigned int len,
+ void *buf, unsigned int size)
+{
+ struct buffer *out = buf;
+ struct rte_flow_action *action;
+ union action_rss_data *action_rss_data;
+ unsigned int i;
+ int ret;
+
+ ret = parse_vc(ctx, token, str, len, buf, size);
+ if (ret < 0)
+ return ret;
+ /* Nothing else to do if there is no buffer. */
+ if (!out)
+ return ret;
+ if (!out->args.vc.actions_n)
+ return -1;
+ action = &out->args.vc.actions[out->args.vc.actions_n - 1];
+ /* Point to selected object. */
+ ctx->object = out->args.vc.data;
+ ctx->objmask = NULL;
+ /* Set up default configuration. */
+ action_rss_data = ctx->object;
+ *action_rss_data = (union action_rss_data){
+ .conf = (struct rte_flow_action_rss){
+ .rss_conf = &action_rss_data->s.rss_conf,
+ .num = RTE_MIN(nb_rxq, ACTION_RSS_QUEUE_NUM),
+ },
+ };
+ action_rss_data->s.rss_conf = (struct rte_eth_rss_conf){
+ .rss_key = action_rss_data->s.rss_key,
+ .rss_key_len = sizeof(action_rss_data->s.rss_key),
+ .rss_hf = rss_hf,
+ };
+ strncpy((void *)action_rss_data->s.rss_key,
+ "testpmd's default RSS hash key",
+ sizeof(action_rss_data->s.rss_key));
+ for (i = 0; i < action_rss_data->conf.num; ++i)
+ action_rss_data->conf.queue[i] = i;
+ if (!port_id_is_invalid(ctx->port, DISABLED_WARN) &&
+ ctx->port != (portid_t)RTE_PORT_ALL) {
+ struct rte_eth_dev_info info;
+
+ rte_eth_dev_info_get(ctx->port, &info);
+ action_rss_data->s.rss_conf.rss_key_len =
+ RTE_MIN(sizeof(action_rss_data->s.rss_key),
+ info.hash_key_size);
+ }
+ action->conf = &action_rss_data->conf;
+ return ret;
+}
+
/**
* Parse queue field for RSS action.
*
@@ -2015,6 +2086,7 @@ parse_vc_action_rss_queue(struct context *ctx, const struct token *token,
void *buf, unsigned int size)
{
static const enum index next[] = NEXT_ENTRY(ACTION_RSS_QUEUE);
+ union action_rss_data *action_rss_data;
int ret;
int i;
@@ -2028,9 +2100,13 @@ parse_vc_action_rss_queue(struct context *ctx, const struct token *token,
ctx->objdata &= 0xffff;
return len;
}
- if (i >= ACTION_RSS_NUM)
+ if (i >= ACTION_RSS_QUEUE_NUM)
return -1;
- if (push_args(ctx, ARGS_ENTRY(struct rte_flow_action_rss, queue[i])))
+ if (push_args(ctx,
+ ARGS_ENTRY_ARB(offsetof(struct rte_flow_action_rss,
+ queue) +
+ i * sizeof(action_rss_data->s.queue[i]),
+ sizeof(action_rss_data->s.queue[i]))))
return -1;
ret = parse_int(ctx, token, str, len, NULL, 0);
if (ret < 0) {
@@ -2045,7 +2121,8 @@ parse_vc_action_rss_queue(struct context *ctx, const struct token *token,
ctx->next[ctx->next_num++] = next;
if (!ctx->object)
return len;
- ((struct rte_flow_action_rss *)ctx->object)->num = i;
+ action_rss_data = ctx->object;
+ action_rss_data->conf.num = i;
return len;
}
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 4bb255c62..aab5db355 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -982,31 +982,51 @@ static const struct {
MK_FLOW_ITEM(GENEVE, sizeof(struct rte_flow_item_geneve)),
};
-/** Compute storage space needed by item specification. */
-static void
-flow_item_spec_size(const struct rte_flow_item *item,
- size_t *size, size_t *pad)
+/** Pattern item specification types. */
+enum item_spec_type {
+ ITEM_SPEC,
+ ITEM_LAST,
+ ITEM_MASK,
+};
+
+/** Compute storage space needed by item specification and copy it. */
+static size_t
+flow_item_spec_copy(void *buf, const struct rte_flow_item *item,
+ enum item_spec_type type)
{
- if (!item->spec) {
- *size = 0;
+ size_t size = 0;
+ const void *item_spec =
+ type == ITEM_SPEC ? item->spec :
+ type == ITEM_LAST ? item->last :
+ type == ITEM_MASK ? item->mask :
+ NULL;
+
+ if (!item_spec)
goto empty;
- }
switch (item->type) {
union {
const struct rte_flow_item_raw *raw;
- } spec;
+ } src;
+ union {
+ struct rte_flow_item_raw *raw;
+ } dst;
case RTE_FLOW_ITEM_TYPE_RAW:
- spec.raw = item->spec;
- *size = offsetof(struct rte_flow_item_raw, pattern) +
- spec.raw->length * sizeof(*spec.raw->pattern);
+ src.raw = item_spec;
+ dst.raw = buf;
+ size = offsetof(struct rte_flow_item_raw, pattern) +
+ src.raw->length * sizeof(*src.raw->pattern);
+ if (dst.raw)
+ memcpy(dst.raw, src.raw, size);
break;
default:
- *size = flow_item[item->type].size;
+ size = flow_item[item->type].size;
+ if (buf)
+ memcpy(buf, item_spec, size);
break;
}
empty:
- *pad = RTE_ALIGN_CEIL(*size, sizeof(double)) - *size;
+ return RTE_ALIGN_CEIL(size, sizeof(double));
}
/** Generate flow_action[] entry. */
@@ -1036,31 +1056,72 @@ static const struct {
MK_FLOW_ACTION(METER, sizeof(struct rte_flow_action_meter)),
};
-/** Compute storage space needed by action configuration. */
-static void
-flow_action_conf_size(const struct rte_flow_action *action,
- size_t *size, size_t *pad)
+/** Compute storage space needed by action configuration and copy it. */
+static size_t
+flow_action_conf_copy(void *buf, const struct rte_flow_action *action)
{
- if (!action->conf) {
- *size = 0;
+ size_t size = 0;
+
+ if (!action->conf)
goto empty;
- }
switch (action->type) {
union {
const struct rte_flow_action_rss *rss;
- } conf;
+ } src;
+ union {
+ struct rte_flow_action_rss *rss;
+ } dst;
+ size_t off;
case RTE_FLOW_ACTION_TYPE_RSS:
- conf.rss = action->conf;
- *size = offsetof(struct rte_flow_action_rss, queue) +
- conf.rss->num * sizeof(*conf.rss->queue);
+ src.rss = action->conf;
+ dst.rss = buf;
+ off = 0;
+ if (dst.rss)
+ *dst.rss = (struct rte_flow_action_rss){
+ .num = src.rss->num,
+ };
+ off += offsetof(struct rte_flow_action_rss, queue);
+ if (src.rss->num) {
+ size = sizeof(*src.rss->queue) * src.rss->num;
+ if (dst.rss)
+ memcpy(dst.rss->queue, src.rss->queue, size);
+ off += size;
+ }
+ off = RTE_ALIGN_CEIL(off, sizeof(double));
+ if (dst.rss) {
+ dst.rss->rss_conf = (void *)((uintptr_t)dst.rss + off);
+ *(struct rte_eth_rss_conf *)(uintptr_t)
+ dst.rss->rss_conf = (struct rte_eth_rss_conf){
+ .rss_key_len = src.rss->rss_conf->rss_key_len,
+ .rss_hf = src.rss->rss_conf->rss_hf,
+ };
+ }
+ off += sizeof(*src.rss->rss_conf);
+ if (src.rss->rss_conf->rss_key_len) {
+ off = RTE_ALIGN_CEIL(off, sizeof(double));
+ size = sizeof(*src.rss->rss_conf->rss_key) *
+ src.rss->rss_conf->rss_key_len;
+ if (dst.rss) {
+ ((struct rte_eth_rss_conf *)(uintptr_t)
+ dst.rss->rss_conf)->rss_key =
+ (void *)((uintptr_t)dst.rss + off);
+ memcpy(dst.rss->rss_conf->rss_key,
+ src.rss->rss_conf->rss_key,
+ size);
+ }
+ off += size;
+ }
+ size = off;
break;
default:
- *size = flow_action[action->type].size;
+ size = flow_action[action->type].size;
+ if (buf)
+ memcpy(buf, action->conf, size);
break;
}
empty:
- *pad = RTE_ALIGN_CEIL(*size, sizeof(double)) - *size;
+ return RTE_ALIGN_CEIL(size, sizeof(double));
}
/** Generate a port_flow entry from attributes/pattern/actions. */
@@ -1073,7 +1134,6 @@ port_flow_new(const struct rte_flow_attr *attr,
const struct rte_flow_action *action;
struct port_flow *pf = NULL;
size_t tmp;
- size_t pad;
size_t off1 = 0;
size_t off2 = 0;
int err = ENOTSUP;
@@ -1091,24 +1151,23 @@ store:
if (pf)
dst = memcpy(pf->data + off1, item, sizeof(*item));
off1 += sizeof(*item);
- flow_item_spec_size(item, &tmp, &pad);
if (item->spec) {
if (pf)
- dst->spec = memcpy(pf->data + off2,
- item->spec, tmp);
- off2 += tmp + pad;
+ dst->spec = pf->data + off2;
+ off2 += flow_item_spec_copy
+ (pf ? pf->data + off2 : NULL, item, ITEM_SPEC);
}
if (item->last) {
if (pf)
- dst->last = memcpy(pf->data + off2,
- item->last, tmp);
- off2 += tmp + pad;
+ dst->last = pf->data + off2;
+ off2 += flow_item_spec_copy
+ (pf ? pf->data + off2 : NULL, item, ITEM_LAST);
}
if (item->mask) {
if (pf)
- dst->mask = memcpy(pf->data + off2,
- item->mask, tmp);
- off2 += tmp + pad;
+ dst->mask = pf->data + off2;
+ off2 += flow_item_spec_copy
+ (pf ? pf->data + off2 : NULL, item, ITEM_MASK);
}
off2 = RTE_ALIGN_CEIL(off2, sizeof(double));
} while ((item++)->type != RTE_FLOW_ITEM_TYPE_END);
@@ -1125,12 +1184,11 @@ store:
if (pf)
dst = memcpy(pf->data + off1, action, sizeof(*action));
off1 += sizeof(*action);
- flow_action_conf_size(action, &tmp, &pad);
if (action->conf) {
if (pf)
- dst->conf = memcpy(pf->data + off2,
- action->conf, tmp);
- off2 += tmp + pad;
+ dst->conf = pf->data + off2;
+ off2 += flow_action_conf_copy
+ (pf ? pf->data + off2 : NULL, action);
}
off2 = RTE_ALIGN_CEIL(off2, sizeof(double));
} while ((action++)->type != RTE_FLOW_ACTION_TYPE_END);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'app/testpmd: fix missing RSS fields in flow action' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (20 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'app/testpmd: fix RSS " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'app/testpmd: fix missing boolean values in flow command' " luca.boccassi
` (19 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Adrien Mazarguil; +Cc: Nelio Laranjeiro, Ferruh Yigit, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 5b9632a2d38e04e55d925e6d0169cdd9eebe3401 Mon Sep 17 00:00:00 2001
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Date: Thu, 19 Apr 2018 12:07:40 +0200
Subject: [PATCH] app/testpmd: fix missing RSS fields in flow action
[ upstream commit f4d623f96119ed720e87b16fb33985879160bfb7 ]
Users cannot override the default RSS settings when entering a RSS action,
only a list of queues can be provided.
This patch enables them to set a RSS hash key and types for a flow rule.
Fixes: 05d34c6e9d2c ("app/testpmd: add queue actions to flow command")
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
app/test-pmd/cmdline_flow.c | 133 +++++++++++++++++++++++++++-
app/test-pmd/config.c | 20 ++---
app/test-pmd/testpmd.h | 13 +++
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 8 ++
4 files changed, 163 insertions(+), 11 deletions(-)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 0e250d595..e43705303 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -167,6 +167,10 @@ enum index {
ACTION_DUP,
ACTION_DUP_INDEX,
ACTION_RSS,
+ ACTION_RSS_TYPES,
+ ACTION_RSS_TYPE,
+ ACTION_RSS_KEY,
+ ACTION_RSS_KEY_LEN,
ACTION_RSS_QUEUES,
ACTION_RSS_QUEUE,
ACTION_PF,
@@ -223,6 +227,9 @@ struct context {
struct arg {
uint32_t hton:1; /**< Use network byte ordering. */
uint32_t sign:1; /**< Value is signed. */
+ uint32_t bounded:1; /**< Value is bounded. */
+ uintmax_t min; /**< Minimum value if bounded. */
+ uintmax_t max; /**< Maximum value if bounded. */
uint32_t offset; /**< Relative offset from ctx->object. */
uint32_t size; /**< Field size. */
const uint8_t *mask; /**< Bit-mask to use instead of offset/size. */
@@ -329,6 +336,16 @@ struct token {
.size = (s), \
})
+/** Same as ARGS_ENTRY_ARB() with bounded values. */
+#define ARGS_ENTRY_ARB_BOUNDED(o, s, i, a) \
+ (&(const struct arg){ \
+ .bounded = 1, \
+ .min = (i), \
+ .max = (a), \
+ .offset = (o), \
+ .size = (s), \
+ })
+
/** Same as ARGS_ENTRY() using network byte ordering. */
#define ARGS_ENTRY_HTON(s, f) \
(&(const struct arg){ \
@@ -635,6 +652,9 @@ static const enum index action_dup[] = {
};
static const enum index action_rss[] = {
+ ACTION_RSS_TYPES,
+ ACTION_RSS_KEY,
+ ACTION_RSS_KEY_LEN,
ACTION_RSS_QUEUES,
ACTION_NEXT,
ZERO,
@@ -666,6 +686,9 @@ static int parse_vc_conf(struct context *, const struct token *,
static int parse_vc_action_rss(struct context *, const struct token *,
const char *, unsigned int, void *,
unsigned int);
+static int parse_vc_action_rss_type(struct context *, const struct token *,
+ const char *, unsigned int, void *,
+ unsigned int);
static int parse_vc_action_rss_queue(struct context *, const struct token *,
const char *, unsigned int, void *,
unsigned int);
@@ -721,6 +744,8 @@ static int comp_port(struct context *, const struct token *,
unsigned int, char *, unsigned int);
static int comp_rule_id(struct context *, const struct token *,
unsigned int, char *, unsigned int);
+static int comp_vc_action_rss_type(struct context *, const struct token *,
+ unsigned int, char *, unsigned int);
static int comp_vc_action_rss_queue(struct context *, const struct token *,
unsigned int, char *, unsigned int);
@@ -1593,6 +1618,43 @@ static const struct token token_list[] = {
.next = NEXT(action_rss),
.call = parse_vc_action_rss,
},
+ [ACTION_RSS_TYPES] = {
+ .name = "types",
+ .help = "RSS hash types",
+ .next = NEXT(action_rss, NEXT_ENTRY(ACTION_RSS_TYPE)),
+ },
+ [ACTION_RSS_TYPE] = {
+ .name = "{type}",
+ .help = "RSS hash type",
+ .call = parse_vc_action_rss_type,
+ .comp = comp_vc_action_rss_type,
+ },
+ [ACTION_RSS_KEY] = {
+ .name = "key",
+ .help = "RSS hash key",
+ .next = NEXT(action_rss, NEXT_ENTRY(STRING)),
+ .args = ARGS(ARGS_ENTRY_ARB
+ (((uintptr_t)&((union action_rss_data *)0)->
+ s.rss_conf.rss_key_len),
+ sizeof(((struct rte_eth_rss_conf *)0)->
+ rss_key_len)),
+ ARGS_ENTRY_ARB
+ (((uintptr_t)((union action_rss_data *)0)->
+ s.rss_key),
+ RSS_HASH_KEY_LENGTH)),
+ },
+ [ACTION_RSS_KEY_LEN] = {
+ .name = "key_len",
+ .help = "RSS hash key length in bytes",
+ .next = NEXT(action_rss, NEXT_ENTRY(UNSIGNED)),
+ .args = ARGS(ARGS_ENTRY_ARB_BOUNDED
+ (((uintptr_t)&((union action_rss_data *)0)->
+ s.rss_conf.rss_key_len),
+ sizeof(((struct rte_eth_rss_conf *)0)->
+ rss_key_len),
+ 0,
+ RSS_HASH_KEY_LENGTH)),
+ },
[ACTION_RSS_QUEUES] = {
.name = "queues",
.help = "queue indices to use",
@@ -2075,6 +2137,50 @@ parse_vc_action_rss(struct context *ctx, const struct token *token,
return ret;
}
+/**
+ * Parse type field for RSS action.
+ *
+ * Valid tokens are type field names and the "end" token.
+ */
+static int
+parse_vc_action_rss_type(struct context *ctx, const struct token *token,
+ const char *str, unsigned int len,
+ void *buf, unsigned int size)
+{
+ static const enum index next[] = NEXT_ENTRY(ACTION_RSS_TYPE);
+ union action_rss_data *action_rss_data;
+ unsigned int i;
+
+ (void)token;
+ (void)buf;
+ (void)size;
+ if (ctx->curr != ACTION_RSS_TYPE)
+ return -1;
+ if (!(ctx->objdata >> 16) && ctx->object) {
+ action_rss_data = ctx->object;
+ action_rss_data->s.rss_conf.rss_hf = 0;
+ }
+ if (!strcmp_partial("end", str, len)) {
+ ctx->objdata &= 0xffff;
+ return len;
+ }
+ for (i = 0; rss_type_table[i].str; ++i)
+ if (!strcmp_partial(rss_type_table[i].str, str, len))
+ break;
+ if (!rss_type_table[i].str)
+ return -1;
+ ctx->objdata = 1 << 16 | (ctx->objdata & 0xffff);
+ /* Repeat token. */
+ if (ctx->next_num == RTE_DIM(ctx->next))
+ return -1;
+ ctx->next[ctx->next_num++] = next;
+ if (!ctx->object)
+ return len;
+ action_rss_data = ctx->object;
+ action_rss_data->s.rss_conf.rss_hf |= rss_type_table[i].rss_type;
+ return len;
+}
+
/**
* Parse queue field for RSS action.
*
@@ -2341,6 +2447,11 @@ parse_int(struct context *ctx, const struct token *token,
strtoumax(str, &end, 0);
if (errno || (size_t)(end - str) != len)
goto error;
+ if (arg->bounded &&
+ ((arg->sign && ((intmax_t)u < (intmax_t)arg->min ||
+ (intmax_t)u > (intmax_t)arg->max)) ||
+ (!arg->sign && (u < arg->min || u > arg->max))))
+ goto error;
if (!ctx->object)
return len;
if (arg->mask) {
@@ -2434,7 +2545,7 @@ parse_string(struct context *ctx, const struct token *token,
buf = (uint8_t *)ctx->object + arg_data->offset;
/* Output buffer is not necessarily NUL-terminated. */
memcpy(buf, str, len);
- memset((uint8_t *)buf + len, 0x55, size - len);
+ memset((uint8_t *)buf + len, 0x00, size - len);
if (ctx->objmask)
memset((uint8_t *)ctx->objmask + arg_data->offset, 0xff, len);
return len;
@@ -2730,6 +2841,26 @@ comp_rule_id(struct context *ctx, const struct token *token,
return i;
}
+/** Complete type field for RSS action. */
+static int
+comp_vc_action_rss_type(struct context *ctx, const struct token *token,
+ unsigned int ent, char *buf, unsigned int size)
+{
+ unsigned int i;
+
+ (void)ctx;
+ (void)token;
+ for (i = 0; rss_type_table[i].str; ++i)
+ ;
+ if (!buf)
+ return i + 1;
+ if (ent < i)
+ return snprintf(buf, size, "%s", rss_type_table[ent].str);
+ if (ent == i)
+ return snprintf(buf, size, "end");
+ return -1;
+}
+
/** Complete queue field for RSS action. */
static int
comp_vc_action_rss_queue(struct context *ctx, const struct token *token,
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index aab5db355..2058e6ec8 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -73,12 +73,7 @@ static const struct {
},
};
-struct rss_type_info {
- char str[32];
- uint64_t rss_type;
-};
-
-static const struct rss_type_info rss_type_table[] = {
+const struct rss_type_info rss_type_table[] = {
{ "ipv4", ETH_RSS_IPV4 },
{ "ipv4-frag", ETH_RSS_FRAG_IPV4 },
{ "ipv4-tcp", ETH_RSS_NONFRAG_IPV4_TCP },
@@ -99,7 +94,12 @@ static const struct rss_type_info rss_type_table[] = {
{ "vxlan", ETH_RSS_VXLAN },
{ "geneve", ETH_RSS_GENEVE },
{ "nvgre", ETH_RSS_NVGRE },
-
+ { "ip", ETH_RSS_IP },
+ { "udp", ETH_RSS_UDP },
+ { "tcp", ETH_RSS_TCP },
+ { "sctp", ETH_RSS_SCTP },
+ { "tunnel", ETH_RSS_TUNNEL },
+ { NULL, 0 },
};
static void
@@ -1819,7 +1819,7 @@ port_rss_hash_conf_show(portid_t port_id, char rss_info[], int show_rss_key)
}
rss_conf.rss_hf = 0;
- for (i = 0; i < RTE_DIM(rss_type_table); i++) {
+ for (i = 0; rss_type_table[i].str; i++) {
if (!strcmp(rss_info, rss_type_table[i].str))
rss_conf.rss_hf = rss_type_table[i].rss_type;
}
@@ -1848,7 +1848,7 @@ port_rss_hash_conf_show(portid_t port_id, char rss_info[], int show_rss_key)
return;
}
printf("RSS functions:\n ");
- for (i = 0; i < RTE_DIM(rss_type_table); i++) {
+ for (i = 0; rss_type_table[i].str; i++) {
if (rss_hf & rss_type_table[i].rss_type)
printf("%s ", rss_type_table[i].str);
}
@@ -1872,7 +1872,7 @@ port_rss_hash_key_update(portid_t port_id, char rss_type[], uint8_t *hash_key,
rss_conf.rss_key = NULL;
rss_conf.rss_key_len = hash_key_len;
rss_conf.rss_hf = 0;
- for (i = 0; i < RTE_DIM(rss_type_table); i++) {
+ for (i = 0; rss_type_table[i].str; i++) {
if (!strcmp(rss_type_table[i].str, rss_type))
rss_conf.rss_hf = rss_type_table[i].rss_type;
}
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 153abea05..593ae2160 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -79,6 +79,19 @@ struct pkt_burst_stats {
};
#endif
+/** Information for a given RSS type. */
+struct rss_type_info {
+ const char *str; /**< Type name. */
+ uint64_t rss_type; /**< Type value. */
+};
+
+/**
+ * RSS type information table.
+ *
+ * An entry with a NULL type name terminates the list.
+ */
+extern const struct rss_type_info rss_type_table[];
+
/**
* The data structure associated with a forwarding stream between a receive
* port/queue and a transmit port/queue.
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index a766ac795..cb6f201e1 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -3406,6 +3406,14 @@ This section lists supported actions and their attributes, if any.
- ``rss``: spread packets among several queues.
+ - ``types [{RSS hash type} [...]] end``: RSS hash types, allowed tokens
+ are the same as `set_hash_input_set`_, an empty list means none (0).
+
+ - ``key {string}``: RSS hash key, overrides ``key_len``.
+
+ - ``key_len {unsigned}``: RSS hash key length in bytes, can be used in
+ conjunction with ``key`` to pad or truncate it.
+
- ``queues [{unsigned} [...]] end``: queue indices to use.
- ``pf``: redirect packets to physical device function.
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'app/testpmd: fix missing boolean values in flow command' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (21 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'app/testpmd: fix missing RSS fields in flow action' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'ethdev: fix shallow copy of flow API RSS action' " luca.boccassi
` (18 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Adrien Mazarguil; +Cc: Nelio Laranjeiro, Ferruh Yigit, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 021b809309a1b8b71797d9a96f1c7c3f070e3a52 Mon Sep 17 00:00:00 2001
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Date: Thu, 19 Apr 2018 12:07:42 +0200
Subject: [PATCH] app/testpmd: fix missing boolean values in flow command
[ upstream commit 5225e84b70c0bb76b926da1aa193e54d43f102fe ]
Original implementation lacks the on/off toggle.
This patch shows up as a fix because it has been a popular request ever
since the first DPDK release with the original implementation but was never
addressed.
Fixes: abc3d81aca1b ("app/testpmd: add item raw to flow command")
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
app/test-pmd/cmdline_flow.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index e43705303..ac4b51a8a 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -2692,6 +2692,7 @@ static const char *const boolean_name[] = {
"false", "true",
"no", "yes",
"N", "Y",
+ "off", "on",
NULL,
};
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'ethdev: fix shallow copy of flow API RSS action' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (22 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'app/testpmd: fix missing boolean values in flow command' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'ethdev: fix missing include in flow API' " luca.boccassi
` (17 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Adrien Mazarguil; +Cc: Nelio Laranjeiro, Ferruh Yigit, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 4249e5cfb8bed6622e915d115366bb666d472370 Mon Sep 17 00:00:00 2001
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Date: Thu, 19 Apr 2018 12:07:44 +0200
Subject: [PATCH] ethdev: fix shallow copy of flow API RSS action
[ upstream commit 972bf3610611264182782281b08dae9e4d39a327 ]
The rss_conf field is defined as a pointer to struct rte_eth_rss_conf.
Even assuming it is permanently allocated and a pointer copy is safe,
pointed data may change and not reflect an applied flow rule anymore.
This patch aligns with testpmd by making a deep copy instead.
Fixes: 18da437b5f63 ("ethdev: add flow rule copy function")
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
lib/librte_ether/rte_flow.c | 145 +++++++++++++++++++++++++++++++-------------
1 file changed, 102 insertions(+), 43 deletions(-)
diff --git a/lib/librte_ether/rte_flow.c b/lib/librte_ether/rte_flow.c
index 38f2d27be..ba6feddee 100644
--- a/lib/librte_ether/rte_flow.c
+++ b/lib/librte_ether/rte_flow.c
@@ -255,60 +255,119 @@ rte_flow_error_set(struct rte_flow_error *error,
return -code;
}
-/** Compute storage space needed by item specification. */
-static void
-flow_item_spec_size(const struct rte_flow_item *item,
- size_t *size, size_t *pad)
+/** Pattern item specification types. */
+enum item_spec_type {
+ ITEM_SPEC,
+ ITEM_LAST,
+ ITEM_MASK,
+};
+
+/** Compute storage space needed by item specification and copy it. */
+static size_t
+flow_item_spec_copy(void *buf, const struct rte_flow_item *item,
+ enum item_spec_type type)
{
- if (!item->spec) {
- *size = 0;
+ size_t size = 0;
+ const void *item_spec =
+ type == ITEM_SPEC ? item->spec :
+ type == ITEM_LAST ? item->last :
+ type == ITEM_MASK ? item->mask :
+ NULL;
+
+ if (!item_spec)
goto empty;
- }
switch (item->type) {
union {
const struct rte_flow_item_raw *raw;
- } spec;
+ } src;
+ union {
+ struct rte_flow_item_raw *raw;
+ } dst;
- /* Not a fall-through */
case RTE_FLOW_ITEM_TYPE_RAW:
- spec.raw = item->spec;
- *size = offsetof(struct rte_flow_item_raw, pattern) +
- spec.raw->length * sizeof(*spec.raw->pattern);
+ src.raw = item_spec;
+ dst.raw = buf;
+ size = offsetof(struct rte_flow_item_raw, pattern) +
+ src.raw->length * sizeof(*src.raw->pattern);
+ if (dst.raw)
+ memcpy(dst.raw, src.raw, size);
break;
default:
- *size = rte_flow_desc_item[item->type].size;
+ size = rte_flow_desc_item[item->type].size;
+ if (buf)
+ memcpy(buf, item_spec, size);
break;
}
empty:
- *pad = RTE_ALIGN_CEIL(*size, sizeof(double)) - *size;
+ return RTE_ALIGN_CEIL(size, sizeof(double));
}
-/** Compute storage space needed by action configuration. */
-static void
-flow_action_conf_size(const struct rte_flow_action *action,
- size_t *size, size_t *pad)
+/** Compute storage space needed by action configuration and copy it. */
+static size_t
+flow_action_conf_copy(void *buf, const struct rte_flow_action *action)
{
- if (!action->conf) {
- *size = 0;
+ size_t size = 0;
+
+ if (!action->conf)
goto empty;
- }
switch (action->type) {
union {
const struct rte_flow_action_rss *rss;
- } conf;
+ } src;
+ union {
+ struct rte_flow_action_rss *rss;
+ } dst;
+ size_t off;
- /* Not a fall-through. */
case RTE_FLOW_ACTION_TYPE_RSS:
- conf.rss = action->conf;
- *size = offsetof(struct rte_flow_action_rss, queue) +
- conf.rss->num * sizeof(*conf.rss->queue);
+ src.rss = action->conf;
+ dst.rss = buf;
+ off = 0;
+ if (dst.rss)
+ *dst.rss = (struct rte_flow_action_rss){
+ .num = src.rss->num,
+ };
+ off += offsetof(struct rte_flow_action_rss, queue);
+ if (src.rss->num) {
+ size = sizeof(*src.rss->queue) * src.rss->num;
+ if (dst.rss)
+ memcpy(dst.rss->queue, src.rss->queue, size);
+ off += size;
+ }
+ off = RTE_ALIGN_CEIL(off, sizeof(double));
+ if (dst.rss) {
+ dst.rss->rss_conf = (void *)((uintptr_t)dst.rss + off);
+ *(struct rte_eth_rss_conf *)(uintptr_t)
+ dst.rss->rss_conf = (struct rte_eth_rss_conf){
+ .rss_key_len = src.rss->rss_conf->rss_key_len,
+ .rss_hf = src.rss->rss_conf->rss_hf,
+ };
+ }
+ off += sizeof(*src.rss->rss_conf);
+ if (src.rss->rss_conf->rss_key_len) {
+ off = RTE_ALIGN_CEIL(off, sizeof(double));
+ size = sizeof(*src.rss->rss_conf->rss_key) *
+ src.rss->rss_conf->rss_key_len;
+ if (dst.rss) {
+ ((struct rte_eth_rss_conf *)(uintptr_t)
+ dst.rss->rss_conf)->rss_key =
+ (void *)((uintptr_t)dst.rss + off);
+ memcpy(dst.rss->rss_conf->rss_key,
+ src.rss->rss_conf->rss_key,
+ size);
+ }
+ off += size;
+ }
+ size = off;
break;
default:
- *size = rte_flow_desc_action[action->type].size;
+ size = rte_flow_desc_action[action->type].size;
+ if (buf)
+ memcpy(buf, action->conf, size);
break;
}
empty:
- *pad = RTE_ALIGN_CEIL(*size, sizeof(double)) - *size;
+ return RTE_ALIGN_CEIL(size, sizeof(double));
}
/** Store a full rte_flow description. */
@@ -320,7 +379,6 @@ rte_flow_copy(struct rte_flow_desc *desc, size_t len,
{
struct rte_flow_desc *fd = NULL;
size_t tmp;
- size_t pad;
size_t off1 = 0;
size_t off2 = 0;
size_t size = 0;
@@ -345,24 +403,26 @@ store:
dst = memcpy(fd->data + off1, item,
sizeof(*item));
off1 += sizeof(*item);
- flow_item_spec_size(item, &tmp, &pad);
if (item->spec) {
if (fd)
- dst->spec = memcpy(fd->data + off2,
- item->spec, tmp);
- off2 += tmp + pad;
+ dst->spec = fd->data + off2;
+ off2 += flow_item_spec_copy
+ (fd ? fd->data + off2 : NULL, item,
+ ITEM_SPEC);
}
if (item->last) {
if (fd)
- dst->last = memcpy(fd->data + off2,
- item->last, tmp);
- off2 += tmp + pad;
+ dst->last = fd->data + off2;
+ off2 += flow_item_spec_copy
+ (fd ? fd->data + off2 : NULL, item,
+ ITEM_LAST);
}
if (item->mask) {
if (fd)
- dst->mask = memcpy(fd->data + off2,
- item->mask, tmp);
- off2 += tmp + pad;
+ dst->mask = fd->data + off2;
+ off2 += flow_item_spec_copy
+ (fd ? fd->data + off2 : NULL, item,
+ ITEM_MASK);
}
off2 = RTE_ALIGN_CEIL(off2, sizeof(double));
} while ((item++)->type != RTE_FLOW_ITEM_TYPE_END);
@@ -387,12 +447,11 @@ store:
dst = memcpy(fd->data + off1, action,
sizeof(*action));
off1 += sizeof(*action);
- flow_action_conf_size(action, &tmp, &pad);
if (action->conf) {
if (fd)
- dst->conf = memcpy(fd->data + off2,
- action->conf, tmp);
- off2 += tmp + pad;
+ dst->conf = fd->data + off2;
+ off2 += flow_action_conf_copy
+ (fd ? fd->data + off2 : NULL, action);
}
off2 = RTE_ALIGN_CEIL(off2, sizeof(double));
} while ((action++)->type != RTE_FLOW_ACTION_TYPE_END);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'ethdev: fix missing include in flow API' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (23 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'ethdev: fix shallow copy of flow API RSS action' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'net/bnx2x: fix for PCI FLR after ungraceful exit' " luca.boccassi
` (16 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Adrien Mazarguil; +Cc: Nelio Laranjeiro, Ferruh Yigit, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From be8b4eded5d5fefc72e331fd4198d92a52c1781b Mon Sep 17 00:00:00 2001
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Date: Thu, 19 Apr 2018 12:07:45 +0200
Subject: [PATCH] ethdev: fix missing include in flow API
[ upstream commit 06dbc8de059d7ab491a52a83842d758d4012a338 ]
Fixes: b1a4b4cbc0a8 ("ethdev: introduce generic flow API")
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
lib/librte_ether/rte_flow.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h
index 13e420218..cdaaa3a5b 100644
--- a/lib/librte_ether/rte_flow.h
+++ b/lib/librte_ether/rte_flow.h
@@ -14,6 +14,8 @@
* associated actions in hardware through flow rules.
*/
+#include <stdint.h>
+
#include <rte_arp.h>
#include <rte_ether.h>
#include <rte_icmp.h>
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bnx2x: fix for PCI FLR after ungraceful exit' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (24 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'ethdev: fix missing include in flow API' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'net/vmxnet3: keep link state consistent' " luca.boccassi
` (15 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Rasesh Mody; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From b2d514595c495b7c3cff4cd050631808773a6cdc Mon Sep 17 00:00:00 2001
From: Rasesh Mody <rasesh.mody@qlogic.com>
Date: Wed, 18 Apr 2018 13:15:08 -0700
Subject: [PATCH] net/bnx2x: fix for PCI FLR after ungraceful exit
[ upstream commit 66ba596aa6b5750b16549a322ef9a09fa7f0e3f6 ]
This patch provides a fix for PCI function level reset after an
ungraceful exit from an application. The fix is to enable internal
target read as part of device attach before getting device information
from device config space, device itself and shared memory. In addition
to that, add a 200ms delay for the recovery flow to complete.
Fixes: 540a211084a7 ("bnx2x: driver core")
Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
---
drivers/net/bnx2x/bnx2x.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index fb02d0f35..7a3b7ff5d 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -8285,16 +8285,6 @@ static int bnx2x_get_device_info(struct bnx2x_softc *sc)
REG_WR(sc, PXP2_REG_PGL_ADDR_90_F1, 0);
REG_WR(sc, PXP2_REG_PGL_ADDR_94_F1, 0);
}
-
-/*
- * Enable internal target-read (in case we are probed after PF
- * FLR). Must be done prior to any BAR read access. Only for
- * 57712 and up
- */
- if (!CHIP_IS_E1x(sc)) {
- REG_WR(sc, PGLUE_B_REG_INTERNAL_PFID_ENABLE_TARGET_READ,
- 1);
- }
}
/* get the nvram size */
@@ -9671,7 +9661,17 @@ int bnx2x_attach(struct bnx2x_softc *sc)
bnx2x_init_rte(sc);
if (IS_PF(sc)) {
-/* get device info and set params */
+ /* Enable internal target-read (in case we are probed after PF
+ * FLR). Must be done prior to any BAR read access. Only for
+ * 57712 and up
+ */
+ if (!CHIP_IS_E1x(sc)) {
+ REG_WR(sc, PGLUE_B_REG_INTERNAL_PFID_ENABLE_TARGET_READ,
+ 1);
+ DELAY(200000);
+ }
+
+ /* get device info and set params */
if (bnx2x_get_device_info(sc) != 0) {
PMD_DRV_LOG(NOTICE, "getting device info");
return -ENXIO;
@@ -9680,7 +9680,7 @@ int bnx2x_attach(struct bnx2x_softc *sc)
/* get phy settings from shmem and 'and' against admin settings */
bnx2x_get_phy_info(sc);
} else {
-/* Left mac of VF unfilled, PF should set it for VF */
+ /* Left mac of VF unfilled, PF should set it for VF */
memset(sc->link_params.mac_addr, 0, ETHER_ADDR_LEN);
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/vmxnet3: keep link state consistent' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (25 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'net/bnx2x: fix for PCI FLR after ungraceful exit' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'net/bnxt: avoid invalid vnic id in set L2 Rx mask' " luca.boccassi
` (14 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Chas Williams; +Cc: Yong Wang, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 3228b47aefd53432074c2d55479834798ced2938 Mon Sep 17 00:00:00 2001
From: Chas Williams <chas3@att.com>
Date: Sat, 17 Mar 2018 21:45:52 -0400
Subject: [PATCH] net/vmxnet3: keep link state consistent
[ upstream commit 3a14b29bff9cc427920c83391b37cededa48fd2f ]
The vmxnet3 never attempts link speed negotiation. As a virtual device
the link speed is vague at best. However, it is important for certain
applications, like bonding, to see a consistent link_status. 802.3ad
requires that only links of the same cost (link speed) be enslaved.
Keeping the link status consistent in vmxnet3 avoids races with bonding
enslavement.
Fixes: 1e3a958f40b3 ("ethdev: fix link autonegotiation value")
Signed-off-by: Chas Williams <chas3@att.com>
Acked-by: Yong Wang <yongwang@vmware.com>
---
drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index f1c24c7bc..9f44a4661 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -1149,7 +1149,7 @@ __vmxnet3_dev_link_update(struct rte_eth_dev *dev,
link.link_status = ETH_LINK_UP;
link.link_duplex = ETH_LINK_FULL_DUPLEX;
link.link_speed = ETH_SPEED_NUM_10G;
- link.link_autoneg = ETH_LINK_AUTONEG;
+ link.link_autoneg = ETH_LINK_FIXED;
}
vmxnet3_dev_atomic_write_link_status(dev, &link);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bnxt: avoid invalid vnic id in set L2 Rx mask' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (26 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'net/vmxnet3: keep link state consistent' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'net/bnxt: fix mbuf data offset initialization' " luca.boccassi
` (13 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Ajit Khaparde; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 7f7375c438d00fedd699cb7157387838c4ca1a23 Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Fri, 20 Apr 2018 07:22:01 -0700
Subject: [PATCH] net/bnxt: avoid invalid vnic id in set L2 Rx mask
[ upstream commit 1b533790f44ee160bae86bdcc5307d7b52225726 ]
In some cases bnxt_hwrm_cfa_l2_set_rx_mask is being called before
VNICs are allocated. The FW returns an error in such cases.
Move bnxt_init_nic to bnxt_dev_init such that the ids are initialized
to an invalid id.
Prevent sending the command to the FW only with a valid vnic id.
Fixes: 244bc98b0da7 ("net/bnxt: set L2 Rx mask")
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 7 ++-----
drivers/net/bnxt/bnxt_hwrm.c | 3 +++
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 14aaf05a8..de8824641 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -392,10 +392,6 @@ static int bnxt_init_nic(struct bnxt *bp)
bnxt_init_vnics(bp);
bnxt_init_filters(bp);
- rc = bnxt_init_chip(bp);
- if (rc)
- return rc;
-
return 0;
}
@@ -585,7 +581,7 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
}
bp->dev_stopped = 0;
- rc = bnxt_init_nic(bp);
+ rc = bnxt_init_chip(bp);
if (rc)
goto error;
@@ -3370,6 +3366,7 @@ skip_init:
goto error_free_int;
bnxt_enable_int(bp);
+ bnxt_init_nic(bp);
return 0;
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 9c7b1f244..3f73a9001 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -248,6 +248,9 @@ int bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt *bp,
struct hwrm_cfa_l2_set_rx_mask_output *resp = bp->hwrm_cmd_resp_addr;
uint32_t mask = 0;
+ if (vnic->fw_vnic_id == INVALID_HW_RING_ID)
+ return rc;
+
HWRM_PREP(req, CFA_L2_SET_RX_MASK);
req.vnic_id = rte_cpu_to_le_16(vnic->fw_vnic_id);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bnxt: fix mbuf data offset initialization' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (27 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'net/bnxt: avoid invalid vnic id in set L2 Rx mask' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'app/testpmd: fix port id type' " luca.boccassi
` (12 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Ajit Khaparde; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From b8fb4861efc31670d77b585313b9daac56d72934 Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Fri, 20 Apr 2018 07:22:02 -0700
Subject: [PATCH] net/bnxt: fix mbuf data offset initialization
[ upstream commit c4fed4ff4fb20dc43036c6874c00846750990704 ]
Initialize mbuf->data_off to RTE_PKTMBUF_HEADROOM after allocation.
Without this, it might be possible that the DMA address provided
to the HW may not be in sync to what is indicated to the application
in bnxt_rx_pkt.
Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code")
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_rxr.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index 8f7ebf8c7..829a95f9f 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -74,6 +74,7 @@ static inline int bnxt_alloc_rx_data(struct bnxt_rx_queue *rxq,
}
rx_buf->mbuf = mbuf;
+ mbuf->data_off = RTE_PKTMBUF_HEADROOM;
rxbd->addr = rte_cpu_to_le_64(rte_mbuf_data_iova_default(mbuf));
@@ -101,6 +102,7 @@ static inline int bnxt_alloc_ag_data(struct bnxt_rx_queue *rxq,
rx_buf->mbuf = mbuf;
+ mbuf->data_off = RTE_PKTMBUF_HEADROOM;
rxbd->addr = rte_cpu_to_le_64(rte_mbuf_data_iova_default(mbuf));
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'app/testpmd: fix port id type' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (28 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'net/bnxt: fix mbuf data offset initialization' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'app/testpmd: fix command token' " luca.boccassi
` (11 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Qi Zhang; +Cc: Ferruh Yigit, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 0adcdaa718170366db23fdb7c1493fc4b5eb2699 Mon Sep 17 00:00:00 2001
From: Qi Zhang <qi.z.zhang@intel.com>
Date: Tue, 24 Apr 2018 13:59:56 +0800
Subject: [PATCH] app/testpmd: fix port id type
[ upstream commit 995d3ab336dfa8a8c4ccedf5f2619eee9d7ca25d ]
Correct couple port id from uint8_t to uint16_t.
Fixes: f8244c6399d9 ("ethdev: increase port id range")
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
app/test-pmd/cmdline.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index de1ce745d..7a76972f2 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1415,7 +1415,7 @@ cmdline_parse_inst_t cmd_config_speed_all = {
struct cmd_config_speed_specific {
cmdline_fixed_string_t port;
cmdline_fixed_string_t keyword;
- uint8_t id;
+ portid_t id;
cmdline_fixed_string_t item1;
cmdline_fixed_string_t item2;
cmdline_fixed_string_t value1;
@@ -1455,7 +1455,7 @@ cmdline_parse_token_string_t cmd_config_speed_specific_keyword =
TOKEN_STRING_INITIALIZER(struct cmd_config_speed_specific, keyword,
"config");
cmdline_parse_token_num_t cmd_config_speed_specific_id =
- TOKEN_NUM_INITIALIZER(struct cmd_config_speed_specific, id, UINT8);
+ TOKEN_NUM_INITIALIZER(struct cmd_config_speed_specific, id, UINT16);
cmdline_parse_token_string_t cmd_config_speed_specific_item1 =
TOKEN_STRING_INITIALIZER(struct cmd_config_speed_specific, item1,
"speed");
@@ -11704,7 +11704,7 @@ struct cmd_config_l2_tunnel_eth_type_result {
cmdline_fixed_string_t port;
cmdline_fixed_string_t config;
cmdline_fixed_string_t all;
- uint8_t id;
+ portid_t id;
cmdline_fixed_string_t l2_tunnel;
cmdline_fixed_string_t l2_tunnel_type;
cmdline_fixed_string_t eth_type;
@@ -11726,7 +11726,7 @@ cmdline_parse_token_string_t cmd_config_l2_tunnel_eth_type_all_str =
cmdline_parse_token_num_t cmd_config_l2_tunnel_eth_type_id =
TOKEN_NUM_INITIALIZER
(struct cmd_config_l2_tunnel_eth_type_result,
- id, UINT8);
+ id, UINT16);
cmdline_parse_token_string_t cmd_config_l2_tunnel_eth_type_l2_tunnel =
TOKEN_STRING_INITIALIZER
(struct cmd_config_l2_tunnel_eth_type_result,
@@ -11839,7 +11839,7 @@ struct cmd_config_l2_tunnel_en_dis_result {
cmdline_fixed_string_t port;
cmdline_fixed_string_t config;
cmdline_fixed_string_t all;
- uint8_t id;
+ portid_t id;
cmdline_fixed_string_t l2_tunnel;
cmdline_fixed_string_t l2_tunnel_type;
cmdline_fixed_string_t en_dis;
@@ -11860,7 +11860,7 @@ cmdline_parse_token_string_t cmd_config_l2_tunnel_en_dis_all_str =
cmdline_parse_token_num_t cmd_config_l2_tunnel_en_dis_id =
TOKEN_NUM_INITIALIZER
(struct cmd_config_l2_tunnel_en_dis_result,
- id, UINT8);
+ id, UINT16);
cmdline_parse_token_string_t cmd_config_l2_tunnel_en_dis_l2_tunnel =
TOKEN_STRING_INITIALIZER
(struct cmd_config_l2_tunnel_en_dis_result,
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'app/testpmd: fix command token' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (29 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'app/testpmd: fix port id type' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'net/vdev_netvsc: remove specified devices IP check' " luca.boccassi
` (10 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Qi Zhang; +Cc: Ferruh Yigit, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From c40c4473dc134afa0f05ed283242b68930370d60 Mon Sep 17 00:00:00 2001
From: Qi Zhang <qi.z.zhang@intel.com>
Date: Tue, 24 Apr 2018 13:59:57 +0800
Subject: [PATCH] app/testpmd: fix command token
[ upstream commit 4c53d4eaf11551c69201b192a7da153d1d88a9a5 ]
Correct token for queue start stop command.
Fixes: 5f4ec54f1d16 ("testpmd: queue start and stop")
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.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 7a76972f2..24ee8b3e5 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -2154,7 +2154,7 @@ cmdline_parse_inst_t cmd_config_rxtx_queue = {
.data = NULL,
.help_str = "port <port_id> rxq|txq <queue_id> start|stop",
.tokens = {
- (void *)&cmd_config_speed_all_port,
+ (void *)&cmd_config_rxtx_queue_port,
(void *)&cmd_config_rxtx_queue_portid,
(void *)&cmd_config_rxtx_queue_rxtxq,
(void *)&cmd_config_rxtx_queue_qid,
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/vdev_netvsc: remove specified devices IP check' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (30 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'app/testpmd: fix command token' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'net/vdev_netvsc: add check for specifying by 1 way' " luca.boccassi
` (9 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Matan Azrad; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From f0e7a03e4e8bfedd482e86d2e8bb3d7f236ab959 Mon Sep 17 00:00:00 2001
From: Matan Azrad <matan@mellanox.com>
Date: Tue, 10 Apr 2018 13:32:06 +0000
Subject: [PATCH] net/vdev_netvsc: remove specified devices IP check
[ upstream commit 0b39cc820ae57319d9d9a3609843c94d0b9a4bbb ]
If the netvsc driver starts in blacklist mode, it does not
automatically probe IP associated netvsc devices. Therefore, the only
way to probe them is to specify them by the EAL command line, using the
"force" parameter to skip the IP check in the driver.
>From now on, the user does not need to add the "force" parameter if he
specifies an IP associated netvsc device by the EAL command line, and the
responsibility of the IP check is now in the user's hands.
However, in the absence of any specification, the driver still skips IP
associated netvsc devices.
Signed-off-by: Matan Azrad <matan@mellanox.com>
---
doc/guides/nics/vdev_netvsc.rst | 10 +++++++---
drivers/net/vdev_netvsc/vdev_netvsc.c | 2 +-
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/doc/guides/nics/vdev_netvsc.rst b/doc/guides/nics/vdev_netvsc.rst
index 55d130a3e..a2d49f4f0 100644
--- a/doc/guides/nics/vdev_netvsc.rst
+++ b/doc/guides/nics/vdev_netvsc.rst
@@ -89,12 +89,16 @@ The following device parameters are supported:
- ``force`` [int]
If nonzero, forces the use of specified interfaces even if not detected as
- NetVSC or detected as routed NETVSC.
+ NetVSC.
- ``ignore`` [int]
If nonzero, ignores the driver runnig (actually used to disable the
auto-detection in Hyper-V VM).
-Not specifying either ``iface`` or ``mac`` makes this driver attach itself to
-all unrouted NetVSC interfaces found on the system.
+.. note::
+
+ Not specifying either ``iface`` or ``mac`` makes this driver attach itself to
+ all unrouted NetVSC interfaces found on the system.
+ Specifying the device makes this driver attach itself to the device
+ regardless the device routes.
diff --git a/drivers/net/vdev_netvsc/vdev_netvsc.c b/drivers/net/vdev_netvsc/vdev_netvsc.c
index db0080a18..d2c41a577 100644
--- a/drivers/net/vdev_netvsc/vdev_netvsc.c
+++ b/drivers/net/vdev_netvsc/vdev_netvsc.c
@@ -569,7 +569,7 @@ vdev_netvsc_netvsc_probe(const struct if_nameindex *iface,
/* Routed NetVSC should not be probed. */
if (vdev_netvsc_has_route(iface, AF_INET) ||
vdev_netvsc_has_route(iface, AF_INET6)) {
- if (!specified || !force)
+ if (!specified)
return 0;
DRV_LOG(WARNING, "probably using routed NetVSC interface \"%s\""
" (index %u)", iface->if_name, iface->if_index);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/vdev_netvsc: add check for specifying by 1 way' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (31 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'net/vdev_netvsc: remove specified devices IP check' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'net/vdev_netvsc: prefer netvsc devices in scan' " luca.boccassi
` (8 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Matan Azrad; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From a97393ad0f10745e633867555df356b570861fe8 Mon Sep 17 00:00:00 2001
From: Matan Azrad <matan@mellanox.com>
Date: Tue, 10 Apr 2018 13:32:07 +0000
Subject: [PATCH] net/vdev_netvsc: add check for specifying by 1 way
[ upstream commit 118d2f8096a528b46e1fa5fe2104cf7140278d94 ]
There are now 2 ways to specify a netvsc device by the EAL command
line - either by the interface name or by the MAC address.
The user should not specify a netvsc device using more than 1 way,
Thus, if a device is specified in more than 1 way, the driver stops
to probe it.
Validate it in the driver initialization.
Signed-off-by: Matan Azrad <matan@mellanox.com>
---
drivers/net/vdev_netvsc/vdev_netvsc.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/vdev_netvsc/vdev_netvsc.c b/drivers/net/vdev_netvsc/vdev_netvsc.c
index d2c41a577..018ffae5d 100644
--- a/drivers/net/vdev_netvsc/vdev_netvsc.c
+++ b/drivers/net/vdev_netvsc/vdev_netvsc.c
@@ -702,6 +702,11 @@ vdev_netvsc_vdev_probe(struct rte_vdev_device *dev)
rte_kvargs_free(kvargs);
return 0;
}
+ if (specified > 1) {
+ DRV_LOG(ERR, "More than one way used to specify the netvsc"
+ " device.");
+ goto error;
+ }
rte_eal_alarm_cancel(vdev_netvsc_alarm, NULL);
/* Gather interfaces. */
ret = vdev_netvsc_foreach_iface(vdev_netvsc_netvsc_probe, name, kvargs,
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/vdev_netvsc: prefer netvsc devices in scan' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (32 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'net/vdev_netvsc: add check for specifying by 1 way' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'net/nfp: fix mbufs releasing when stop or close' " luca.boccassi
` (7 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Matan Azrad; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 9a71a97480e9138429a9c9e432d4b4ed22b9f275 Mon Sep 17 00:00:00 2001
From: Matan Azrad <matan@mellanox.com>
Date: Tue, 10 Apr 2018 13:32:08 +0000
Subject: [PATCH] net/vdev_netvsc: prefer netvsc devices in scan
[ upstream commit 4205da3a470974b879d05d337fff2e8bdfec1f70 ]
There is an option to run a non-netvsc device as a netvsc device only
when the "force" parameter is set to 1 in the EAL command line.
Consequently, more than one device may be found to be matching the
"mac" parameter specifying the device.
Prefer netvsc devices to be scanned before any non-netvsc device, even
when the "force" parameter is set.
Signed-off-by: Matan Azrad <matan@mellanox.com>
---
drivers/net/vdev_netvsc/vdev_netvsc.c | 122 ++++++++++++++++++----------------
1 file changed, 65 insertions(+), 57 deletions(-)
diff --git a/drivers/net/vdev_netvsc/vdev_netvsc.c b/drivers/net/vdev_netvsc/vdev_netvsc.c
index 018ffae5d..75aec8980 100644
--- a/drivers/net/vdev_netvsc/vdev_netvsc.c
+++ b/drivers/net/vdev_netvsc/vdev_netvsc.c
@@ -97,6 +97,43 @@ vdev_netvsc_ctx_destroy(struct vdev_netvsc_ctx *ctx)
free(ctx);
}
+/**
+ * Determine if a network interface is NetVSC.
+ *
+ * @param[in] iface
+ * Pointer to netdevice description structure (name and index).
+ *
+ * @return
+ * A nonzero value when interface is detected as NetVSC. In case of error,
+ * rte_errno is updated and 0 returned.
+ */
+static int
+vdev_netvsc_iface_is_netvsc(const struct if_nameindex *iface)
+{
+ static const char temp[] = "/sys/class/net/%s/device/class_id";
+ char path[sizeof(temp) + IF_NAMESIZE];
+ FILE *f;
+ int ret;
+ int len = 0;
+
+ ret = snprintf(path, sizeof(path), temp, iface->if_name);
+ if (ret == -1 || (size_t)ret >= sizeof(path)) {
+ rte_errno = ENOBUFS;
+ return 0;
+ }
+ f = fopen(path, "r");
+ if (!f) {
+ rte_errno = errno;
+ return 0;
+ }
+ ret = fscanf(f, NETVSC_CLASS_ID "%n", &len);
+ if (ret == EOF)
+ rte_errno = errno;
+ ret = len == (int)strlen(NETVSC_CLASS_ID);
+ fclose(f);
+ return ret;
+}
+
/**
* Iterate over system network interfaces.
*
@@ -106,6 +143,8 @@ vdev_netvsc_ctx_destroy(struct vdev_netvsc_ctx *ctx)
* @param func
* Callback function pointer. List traversal is aborted when this function
* returns a nonzero value.
+ * @param is_netvsc
+ * Indicates the device type to iterate - netvsc or non-netvsc.
* @param ...
* Variable parameter list passed as @p va_list to @p func.
*
@@ -117,7 +156,7 @@ vdev_netvsc_ctx_destroy(struct vdev_netvsc_ctx *ctx)
static int
vdev_netvsc_foreach_iface(int (*func)(const struct if_nameindex *iface,
const struct ether_addr *eth_addr,
- va_list ap), ...)
+ va_list ap), int is_netvsc, ...)
{
struct if_nameindex *iface = if_nameindex();
int s = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP);
@@ -135,10 +174,14 @@ vdev_netvsc_foreach_iface(int (*func)(const struct if_nameindex *iface,
goto error;
}
for (i = 0; iface[i].if_name; ++i) {
+ int is_netvsc_ret;
struct ifreq req;
struct ether_addr eth_addr;
va_list ap;
+ is_netvsc_ret = vdev_netvsc_iface_is_netvsc(&iface[i]) ? 1 : 0;
+ if (is_netvsc ^ is_netvsc_ret)
+ continue;
strncpy(req.ifr_name, iface[i].if_name, sizeof(req.ifr_name));
if (ioctl(s, SIOCGIFHWADDR, &req) == -1) {
DRV_LOG(WARNING, "cannot retrieve information about"
@@ -153,7 +196,7 @@ vdev_netvsc_foreach_iface(int (*func)(const struct if_nameindex *iface,
}
memcpy(eth_addr.addr_bytes, req.ifr_hwaddr.sa_data,
RTE_DIM(eth_addr.addr_bytes));
- va_start(ap, func);
+ va_start(ap, is_netvsc);
ret = func(&iface[i], ð_addr, ap);
va_end(ap);
if (ret)
@@ -167,43 +210,6 @@ error:
return ret;
}
-/**
- * Determine if a network interface is NetVSC.
- *
- * @param[in] iface
- * Pointer to netdevice description structure (name and index).
- *
- * @return
- * A nonzero value when interface is detected as NetVSC. In case of error,
- * rte_errno is updated and 0 returned.
- */
-static int
-vdev_netvsc_iface_is_netvsc(const struct if_nameindex *iface)
-{
- static const char temp[] = "/sys/class/net/%s/device/class_id";
- char path[sizeof(temp) + IF_NAMESIZE];
- FILE *f;
- int ret;
- int len = 0;
-
- ret = snprintf(path, sizeof(path), temp, iface->if_name);
- if (ret == -1 || (size_t)ret >= sizeof(path)) {
- rte_errno = ENOBUFS;
- return 0;
- }
- f = fopen(path, "r");
- if (!f) {
- rte_errno = errno;
- return 0;
- }
- ret = fscanf(f, NETVSC_CLASS_ID "%n", &len);
- if (ret == EOF)
- rte_errno = errno;
- ret = len == (int)strlen(NETVSC_CLASS_ID);
- fclose(f);
- return ret;
-}
-
/**
* Determine if a network interface has a route.
*
@@ -379,8 +385,6 @@ vdev_netvsc_device_probe(const struct if_nameindex *iface,
strncpy(ctx->if_name, iface->if_name, sizeof(ctx->if_name));
return 0;
}
- if (vdev_netvsc_iface_is_netvsc(iface))
- return 0;
if (!is_same_ether_addr(eth_addr, &ctx->if_addr))
return 0;
/* Look for associated PCI device. */
@@ -449,7 +453,8 @@ vdev_netvsc_alarm(__rte_unused void *arg)
int ret;
LIST_FOREACH(ctx, &vdev_netvsc_ctx_list, entry) {
- ret = vdev_netvsc_foreach_iface(vdev_netvsc_device_probe, ctx);
+ ret = vdev_netvsc_foreach_iface(vdev_netvsc_device_probe, 0,
+ ctx);
if (ret < 0)
break;
}
@@ -505,7 +510,6 @@ vdev_netvsc_netvsc_probe(const struct if_nameindex *iface,
{
const char *name = va_arg(ap, const char *);
struct rte_kvargs *kvargs = va_arg(ap, struct rte_kvargs *);
- int force = va_arg(ap, int);
unsigned int specified = va_arg(ap, unsigned int);
unsigned int *matched = va_arg(ap, unsigned int *);
unsigned int i;
@@ -559,13 +563,6 @@ vdev_netvsc_netvsc_probe(const struct if_nameindex *iface,
iface->if_name, iface->if_index);
return 0;
}
- if (!vdev_netvsc_iface_is_netvsc(iface)) {
- if (!specified || !force)
- return 0;
- DRV_LOG(WARNING,
- "using non-NetVSC interface \"%s\" (index %u)",
- iface->if_name, iface->if_index);
- }
/* Routed NetVSC should not be probed. */
if (vdev_netvsc_has_route(iface, AF_INET) ||
vdev_netvsc_has_route(iface, AF_INET6)) {
@@ -632,7 +629,7 @@ vdev_netvsc_netvsc_probe(const struct if_nameindex *iface,
/* Request virtual device generation. */
DRV_LOG(DEBUG, "generating virtual device \"%s\" with arguments \"%s\"",
ctx->devname, ctx->devargs);
- vdev_netvsc_foreach_iface(vdev_netvsc_device_probe, ctx);
+ vdev_netvsc_foreach_iface(vdev_netvsc_device_probe, 0, ctx);
ret = rte_eal_hotplug_add("vdev", ctx->devname, ctx->devargs);
if (ret)
goto error;
@@ -709,14 +706,25 @@ vdev_netvsc_vdev_probe(struct rte_vdev_device *dev)
}
rte_eal_alarm_cancel(vdev_netvsc_alarm, NULL);
/* Gather interfaces. */
- ret = vdev_netvsc_foreach_iface(vdev_netvsc_netvsc_probe, name, kvargs,
- force, specified, &matched);
+ ret = vdev_netvsc_foreach_iface(vdev_netvsc_netvsc_probe, 1, name,
+ kvargs, specified, &matched);
if (ret < 0)
goto error;
- if (matched < specified)
- DRV_LOG(WARNING,
- "some of the specified parameters did not match"
- " recognized network interfaces");
+ if (specified && matched < specified) {
+ if (!force) {
+ DRV_LOG(ERR, "Cannot find the specified netvsc device");
+ goto error;
+ }
+ /* Try to force probing on non-netvsc specified device. */
+ if (vdev_netvsc_foreach_iface(vdev_netvsc_netvsc_probe, 0, name,
+ kvargs, specified, &matched) < 0)
+ goto error;
+ if (matched < specified) {
+ DRV_LOG(ERR, "Cannot find the specified device");
+ goto error;
+ }
+ DRV_LOG(WARNING, "non-netvsc device was probed as netvsc");
+ }
ret = rte_eal_alarm_set(VDEV_NETVSC_PROBE_MS * 1000,
vdev_netvsc_alarm, NULL);
if (ret < 0) {
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/nfp: fix mbufs releasing when stop or close' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (33 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'net/vdev_netvsc: prefer netvsc devices in scan' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'net/tap: fix icc build' " luca.boccassi
` (6 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Alejandro Lucero; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 7e804dd49698bc425acc3088b1922fa2f28f4741 Mon Sep 17 00:00:00 2001
From: Alejandro Lucero <alejandro.lucero@netronome.com>
Date: Mon, 23 Apr 2018 12:23:58 +0100
Subject: [PATCH] net/nfp: fix mbufs releasing when stop or close
[ upstream commit 0c0e46c36bcc5dfe9d2aa605e1a5f714d45e0b7f ]
PMDs have the responsibility of releasing mbufs sent through xmit burst
function. NFP PMD attaches those sent mbufs to the TX ring structure,
and it is at the next time a specific ring descriptor is going to be
used when the previous linked mbuf, already transmitted at that point,
is released. Those mbufs belonging to a chained mbuf got its own link
to a ring descriptor, and they are released independently of the mbuf
head of that chain.
The problem is how those mbufs are released when the PMD is stopped or
closed. Instead of releasing those mbufs as the xmit functions does,
this is independently of being in a mbuf chain, the code calls
rte_pktmbuf_free which will release not just the mbuf head in that
chain but all the chained mbufs. The loop will try to release those
mbufs which have already been released again when chained mbufs exist.
This patch fixes the problem using rte_pktmbuf_free_seg instead.
Fixes: b812daadad0d ("nfp: add Rx and Tx")
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
---
drivers/net/nfp/nfp_net.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 6f795e9d7..d0da35b62 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -310,7 +310,7 @@ nfp_net_tx_queue_release_mbufs(struct nfp_net_txq *txq)
for (i = 0; i < txq->tx_count; i++) {
if (txq->txbufs[i].mbuf) {
- rte_pktmbuf_free(txq->txbufs[i].mbuf);
+ rte_pktmbuf_free_seg(txq->txbufs[i].mbuf);
txq->txbufs[i].mbuf = NULL;
}
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/tap: fix icc build' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (34 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'net/nfp: fix mbufs releasing when stop or close' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'drivers/net: fix link autoneg value for virtual PMDs' " luca.boccassi
` (5 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: Pablo de Lara, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 9c23d323db4d8e0db53708995a6a22447a3a6857 Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@intel.com>
Date: Mon, 12 Mar 2018 19:31:33 +0000
Subject: [PATCH] net/tap: fix icc build
[ upstream commit 6db80eb7c97e7db9c006641cc7ecae46c625d64e ]
build error:
.../dpdk/drivers/net/tap/rte_eth_tap.c(598):
error #279: controlling expression is constant
RTE_ASSERT(!"unsupported request type: must not happen");
Although RTE_ASSERT helps debugging this issue when assert enabled,
constant expression in assert means this path can be taken during
runtime and there is no protection against it when assert is disabled.
Adding error log and error return back, replacing RTE_ASSERT.
Fixes: 7748a4b44196 ("net/tap: add debug messages")
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
drivers/net/tap/rte_eth_tap.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index f09db0ea9..4bf2d9618 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -593,7 +593,9 @@ apply:
case SIOCSIFMTU:
break;
default:
- RTE_ASSERT(!"unsupported request type: must not happen");
+ RTE_LOG(WARNING, PMD, "%s: ioctl() called with wrong arg\n",
+ pmd->name);
+ return -EINVAL;
}
if (ioctl(pmd->ioctl_sock, request, ifr) < 0)
goto error;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'drivers/net: fix link autoneg value for virtual PMDs' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (35 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'net/tap: fix icc build' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'net/sfc: process RSS settings on Rx configure step' " luca.boccassi
` (4 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: Thomas Monjalon, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From f713b58e2fd8224e3291422f62f9514549e4fd3c Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@intel.com>
Date: Fri, 20 Apr 2018 01:01:24 +0100
Subject: [PATCH] drivers/net: fix link autoneg value for virtual PMDs
[ upstream commit 18869f97f163a58d29d45a2e85c6ed444b1c72e1 ]
These drivers never attempt link speed negotiation. Change link_autoneg
value to ETH_LINK_FIXED to be more accurate and consistent between PMDs.
Fixes: 1e3a958f40b3 ("ethdev: fix link autonegotiation value")
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
drivers/net/af_packet/rte_eth_af_packet.c | 2 +-
drivers/net/kni/rte_eth_kni.c | 2 +-
drivers/net/null/rte_eth_null.c | 2 +-
drivers/net/pcap/rte_eth_pcap.c | 2 +-
drivers/net/ring/rte_eth_ring.c | 2 +-
drivers/net/softnic/rte_eth_softnic.c | 2 +-
drivers/net/tap/rte_eth_tap.c | 2 +-
7 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index 57eccfd04..7694b21ca 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -94,7 +94,7 @@ static struct rte_eth_link pmd_link = {
.link_speed = ETH_SPEED_NUM_10G,
.link_duplex = ETH_LINK_FULL_DUPLEX,
.link_status = ETH_LINK_DOWN,
- .link_autoneg = ETH_LINK_AUTONEG
+ .link_autoneg = ETH_LINK_FIXED,
};
static uint16_t
diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c
index dc4e65f5d..57f3c50e3 100644
--- a/drivers/net/kni/rte_eth_kni.c
+++ b/drivers/net/kni/rte_eth_kni.c
@@ -61,7 +61,7 @@ static const struct rte_eth_link pmd_link = {
.link_speed = ETH_SPEED_NUM_10G,
.link_duplex = ETH_LINK_FULL_DUPLEX,
.link_status = ETH_LINK_DOWN,
- .link_autoneg = ETH_LINK_AUTONEG,
+ .link_autoneg = ETH_LINK_FIXED,
};
static int is_kni_initialized;
diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index d003b2839..181785b48 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -91,7 +91,7 @@ static struct rte_eth_link pmd_link = {
.link_speed = ETH_SPEED_NUM_10G,
.link_duplex = ETH_LINK_FULL_DUPLEX,
.link_status = ETH_LINK_DOWN,
- .link_autoneg = ETH_LINK_AUTONEG,
+ .link_autoneg = ETH_LINK_FIXED,
};
static uint16_t
diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
index c1571e1fe..814beedc8 100644
--- a/drivers/net/pcap/rte_eth_pcap.c
+++ b/drivers/net/pcap/rte_eth_pcap.c
@@ -96,7 +96,7 @@ static struct rte_eth_link pmd_link = {
.link_speed = ETH_SPEED_NUM_10G,
.link_duplex = ETH_LINK_FULL_DUPLEX,
.link_status = ETH_LINK_DOWN,
- .link_autoneg = ETH_LINK_AUTONEG,
+ .link_autoneg = ETH_LINK_FIXED,
};
static int
diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index df13c44be..311ec3d5a 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -60,7 +60,7 @@ static struct rte_eth_link pmd_link = {
.link_speed = ETH_SPEED_NUM_10G,
.link_duplex = ETH_LINK_FULL_DUPLEX,
.link_status = ETH_LINK_DOWN,
- .link_autoneg = ETH_LINK_AUTONEG
+ .link_autoneg = ETH_LINK_FIXED,
};
static uint16_t
diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c
index b0c134152..d8ecfc2f0 100644
--- a/drivers/net/softnic/rte_eth_softnic.c
+++ b/drivers/net/softnic/rte_eth_softnic.c
@@ -522,7 +522,7 @@ pmd_ethdev_register(struct rte_vdev_device *vdev,
soft_dev->data->dev_private = dev_private;
soft_dev->data->dev_link.link_speed = hard_speed;
soft_dev->data->dev_link.link_duplex = ETH_LINK_FULL_DUPLEX;
- soft_dev->data->dev_link.link_autoneg = ETH_LINK_AUTONEG;
+ soft_dev->data->dev_link.link_autoneg = ETH_LINK_FIXED;
soft_dev->data->dev_link.link_status = ETH_LINK_DOWN;
soft_dev->data->mac_addrs = ð_addr;
soft_dev->data->promiscuous = 1;
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 4bf2d9618..a55bf8463 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -65,7 +65,7 @@ static struct rte_eth_link pmd_link = {
.link_speed = ETH_SPEED_NUM_10G,
.link_duplex = ETH_LINK_FULL_DUPLEX,
.link_status = ETH_LINK_DOWN,
- .link_autoneg = ETH_LINK_AUTONEG
+ .link_autoneg = ETH_LINK_FIXED,
};
static void
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/sfc: process RSS settings on Rx configure step' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (36 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'drivers/net: fix link autoneg value for virtual PMDs' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:53 ` [dpdk-stable] patch 'net/sfc: ignore spec bits not covered by mask' " luca.boccassi
` (3 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Ivan Malov; +Cc: Andrew Rybchenko, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From e206d4e4a375f9f5d8a268566695cc988186e603 Mon Sep 17 00:00:00 2001
From: Ivan Malov <ivan.malov@oktetlabs.ru>
Date: Wed, 25 Apr 2018 18:51:41 +0100
Subject: [PATCH] net/sfc: process RSS settings on Rx configure step
[ upstream commit 7803554a9e388538fc3ad32dedffbbe2dde055c8 ]
One may submit advanced RSS settings as part of
rte_eth_conf to customise RSS configuration from
the very beginning. Currently the driver does not
check that piece of settings and proceeds with
default choices for RSS hash functions and RSS key.
This patch implements the required processing.
Fixes: 4ec1fc3ba881 ("net/sfc: add basic stubs for RSS support on driver attach")
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
drivers/net/sfc/sfc_rx.c | 42 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index 64bc9d488..81c530079 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -1187,6 +1187,41 @@ sfc_efx_to_rte_hash_type(efx_rx_hash_type_t efx_hash_types)
#endif
#if EFSYS_OPT_RX_SCALE
+static int
+sfc_rx_process_adv_conf_rss(struct sfc_adapter *sa,
+ struct rte_eth_rss_conf *conf)
+{
+ efx_rx_hash_type_t efx_hash_types = sa->rss_hash_types;
+
+ if (sa->rss_support != EFX_RX_SCALE_EXCLUSIVE) {
+ if ((conf->rss_hf != 0 && conf->rss_hf != SFC_RSS_OFFLOADS) ||
+ conf->rss_key != NULL)
+ return EINVAL;
+ }
+
+ if (conf->rss_hf != 0) {
+ if ((conf->rss_hf & ~SFC_RSS_OFFLOADS) != 0) {
+ sfc_err(sa, "unsupported hash functions requested");
+ return EINVAL;
+ }
+
+ efx_hash_types = sfc_rte_to_efx_hash_type(conf->rss_hf);
+ }
+
+ if (conf->rss_key != NULL) {
+ if (conf->rss_key_len != sizeof(sa->rss_key)) {
+ sfc_err(sa, "RSS key size is wrong (should be %lu)",
+ sizeof(sa->rss_key));
+ return EINVAL;
+ }
+ rte_memcpy(sa->rss_key, conf->rss_key, sizeof(sa->rss_key));
+ }
+
+ sa->rss_hash_types = efx_hash_types;
+
+ return 0;
+}
+
static int
sfc_rx_rss_config(struct sfc_adapter *sa)
{
@@ -1415,16 +1450,23 @@ sfc_rx_configure(struct sfc_adapter *sa)
MIN(sa->rxq_count, EFX_MAXRSS) : 0;
if (sa->rss_channels > 0) {
+ struct rte_eth_rss_conf *adv_conf_rss;
unsigned int sw_index;
for (sw_index = 0; sw_index < EFX_RSS_TBL_SIZE; ++sw_index)
sa->rss_tbl[sw_index] = sw_index % sa->rss_channels;
+
+ adv_conf_rss = &dev_conf->rx_adv_conf.rss_conf;
+ rc = sfc_rx_process_adv_conf_rss(sa, adv_conf_rss);
+ if (rc != 0)
+ goto fail_rx_process_adv_conf_rss;
}
#endif
done:
return 0;
+fail_rx_process_adv_conf_rss:
fail_rx_qinit_info:
fail_rxqs_realloc:
fail_rxqs_alloc:
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/sfc: ignore spec bits not covered by mask' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (37 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'net/sfc: process RSS settings on Rx configure step' " luca.boccassi
@ 2018-04-30 14:53 ` luca.boccassi
2018-04-30 14:54 ` [dpdk-stable] patch 'net/tap: return empty port offload capabilities' " luca.boccassi
` (2 subsequent siblings)
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:53 UTC (permalink / raw)
To: Andrew Rybchenko; +Cc: Andy Moreton, Roman Zhukov, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 7598c6bf9d84398a13a44cf6095e6bdbd01cd7b7 Mon Sep 17 00:00:00 2001
From: Andrew Rybchenko <arybchenko@solarflare.com>
Date: Wed, 25 Apr 2018 18:18:34 +0100
Subject: [PATCH] net/sfc: ignore spec bits not covered by mask
[ upstream commit c43e0f690413fc7233b735e641f22e8eb47c50c0 ]
mask is a simple bit-mask applied before interpreting the contents
of spec and last.
Fixes: a9825ccf5bb8 ("net/sfc: support flow API filters")
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
---
drivers/net/sfc/sfc_flow.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c
index 93cdf8f4c..58adcbca3 100644
--- a/drivers/net/sfc/sfc_flow.c
+++ b/drivers/net/sfc/sfc_flow.c
@@ -85,7 +85,6 @@ sfc_flow_parse_init(const struct rte_flow_item *item,
const uint8_t *spec;
const uint8_t *mask;
const uint8_t *last;
- uint8_t match;
uint8_t supp;
unsigned int i;
@@ -146,12 +145,11 @@ sfc_flow_parse_init(const struct rte_flow_item *item,
return -rte_errno;
}
- /* Check that mask and spec not asks for more match than supp_mask */
+ /* Check that mask does not ask for more match than supp_mask */
for (i = 0; i < size; i++) {
- match = spec[i] | mask[i];
supp = ((const uint8_t *)supp_mask)[i];
- if ((match | supp) != supp) {
+ if (~supp & mask[i]) {
rte_flow_error_set(error, ENOTSUP,
RTE_FLOW_ERROR_TYPE_ITEM, item,
"Item's field is not supported");
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/tap: return empty port offload capabilities' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (38 preceding siblings ...)
2018-04-30 14:53 ` [dpdk-stable] patch 'net/sfc: ignore spec bits not covered by mask' " luca.boccassi
@ 2018-04-30 14:54 ` luca.boccassi
2018-04-30 14:54 ` [dpdk-stable] patch 'net/nfp: fix double space in init log' " luca.boccassi
2018-04-30 14:54 ` [dpdk-stable] patch 'net/sfc/base: add equal stride super-buffer prefix layout' " luca.boccassi
41 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:54 UTC (permalink / raw)
To: Ophir Munk; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From b3f92645149b009c1488c022b0d934f69c89d0ad Mon Sep 17 00:00:00 2001
From: Ophir Munk <ophirmu@mellanox.com>
Date: Thu, 26 Apr 2018 11:13:02 +0000
Subject: [PATCH] net/tap: return empty port offload capabilities
[ upstream commit ead63dd3181c9fdf4a191072f622ad2b934a4b9f ]
Fix internal report on port specific offload capabilities to be 0 (no
capabilities). Before this commit port capabilities were a clone of queue
capabilities, however the current TAP offload capabilities (e.g.
checksum calculation) are per queue and are not specific per port.
This commit fixes an internal validation check for new configured
queue offloads.
The port capability API keeps reporting all queue capabilities as port
capabilities.
Fixes: 95ae196ae10b ("net/tap: use new Rx offloads API")
Fixes: 818fe14a9891 ("net/tap: use new Tx offloads API")
Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
---
drivers/net/tap/rte_eth_tap.c | 23 ++++++++---------------
1 file changed, 8 insertions(+), 15 deletions(-)
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index a55bf8463..7f85d4133 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -255,14 +255,9 @@ static uint64_t
tap_rx_offload_get_port_capa(void)
{
/*
- * In order to support legacy apps,
- * report capabilities also as port capabilities.
+ * No specific port Rx offload capabilities.
*/
- return DEV_RX_OFFLOAD_SCATTER |
- DEV_RX_OFFLOAD_IPV4_CKSUM |
- DEV_RX_OFFLOAD_UDP_CKSUM |
- DEV_RX_OFFLOAD_TCP_CKSUM |
- DEV_RX_OFFLOAD_CRC_STRIP;
+ return 0;
}
static uint64_t
@@ -389,13 +384,9 @@ static uint64_t
tap_tx_offload_get_port_capa(void)
{
/*
- * In order to support legacy apps,
- * report capabilities also as port capabilities.
+ * No specific port Tx offload capabilities.
*/
- return DEV_TX_OFFLOAD_MULTI_SEGS |
- DEV_TX_OFFLOAD_IPV4_CKSUM |
- DEV_TX_OFFLOAD_UDP_CKSUM |
- DEV_TX_OFFLOAD_TCP_CKSUM;
+ return 0;
}
static uint64_t
@@ -652,7 +643,8 @@ tap_dev_stop(struct rte_eth_dev *dev)
static int
tap_dev_configure(struct rte_eth_dev *dev)
{
- uint64_t supp_tx_offloads = tap_tx_offload_get_port_capa();
+ uint64_t supp_tx_offloads = tap_tx_offload_get_port_capa() |
+ tap_tx_offload_get_queue_capa();
uint64_t tx_offloads = dev->data->dev_conf.txmode.offloads;
if ((tx_offloads & supp_tx_offloads) != tx_offloads) {
@@ -1157,7 +1149,8 @@ tap_tx_queue_setup(struct rte_eth_dev *dev,
" or supported offloads 0x%" PRIx64,
(void *)dev, tx_conf->offloads,
dev->data->dev_conf.txmode.offloads,
- tap_tx_offload_get_port_capa());
+ (tap_tx_offload_get_port_capa() |
+ tap_tx_offload_get_queue_capa()));
return -rte_errno;
}
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/nfp: fix double space in init log' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (39 preceding siblings ...)
2018-04-30 14:54 ` [dpdk-stable] patch 'net/tap: return empty port offload capabilities' " luca.boccassi
@ 2018-04-30 14:54 ` luca.boccassi
2018-05-03 11:06 ` [dpdk-stable] patch 'net/mlx5: fix flow director rule deletion crash' " luca.boccassi
2018-04-30 14:54 ` [dpdk-stable] patch 'net/sfc/base: add equal stride super-buffer prefix layout' " luca.boccassi
41 siblings, 1 reply; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:54 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Alejandro Lucero, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 87bc6e9c84ba53ac98f33b1e96c15c86c1b5035b Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Wed, 25 Apr 2018 08:45:49 -0700
Subject: [PATCH] net/nfp: fix double space in init log
[ upstream commit c524468ad94a54f1086700fc392600988761fbeb ]
Shouldn't pass extra newline.
Fixes: 7dcb19d78f27 ("net/nfp: fix Rx interrupt when multiqueue")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Alejandro Lucero <alejandro.lucero@netronome.com>
---
drivers/net/nfp/nfp_net.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index d0da35b62..912c3e1a6 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -729,7 +729,7 @@ nfp_configure_rx_interrupt(struct rte_eth_dev *dev,
*/
nn_cfg_writeb(hw, NFP_NET_CFG_RXR_VEC(i), i + 1);
intr_handle->intr_vec[i] = i + 1;
- PMD_INIT_LOG(DEBUG, "intr_vec[%d]= %d\n", i,
+ PMD_INIT_LOG(DEBUG, "intr_vec[%d]= %d", i,
intr_handle->intr_vec[i]);
}
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/mlx5: fix flow director rule deletion crash' has been queued to stable release 18.02.2
2018-04-30 14:54 ` [dpdk-stable] patch 'net/nfp: fix double space in init log' " luca.boccassi
@ 2018-05-03 11:06 ` luca.boccassi
2018-05-03 11:06 ` [dpdk-stable] patch 'net/mlx4: fix Rx resource leak in case of error' " luca.boccassi
` (3 more replies)
0 siblings, 4 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-03 11:06 UTC (permalink / raw)
To: Adrien Mazarguil; +Cc: Nelio Laranjeiro, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/04/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 709766e104fcc53a094927cf8f964418893afa25 Mon Sep 17 00:00:00 2001
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Date: Thu, 26 Apr 2018 18:17:46 +0200
Subject: [PATCH] net/mlx5: fix flow director rule deletion crash
[ upstream commit 6f2f4948b23643d279f38d38f988b122f393270f ]
Flow director rules matching traffic properties above layer 2 do not
target a fixed hash Rx queue (HASH_RXQ_ETH), it actually depends on the
highest protocol layer specified by each flow rule.
mlx5_fdir_filter_delete() makes this wrong assumption and causes a crash
when attempting to destroy flow rules with L3/L4 specifications.
Fixes: 4c3e9bcdd52e ("net/mlx5: support flow director")
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
---
drivers/net/mlx5/mlx5_flow.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 8a5565b30..42dde1cbf 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -2860,13 +2860,13 @@ priv_fdir_filter_delete(struct priv *priv,
if (parser.drop) {
struct ibv_flow_spec_action_drop *drop;
- drop = (void *)((uintptr_t)parser.queue[HASH_RXQ_ETH].ibv_attr +
- parser.queue[HASH_RXQ_ETH].offset);
+ drop = (void *)((uintptr_t)parser.queue[parser.layer].ibv_attr +
+ parser.queue[parser.layer].offset);
*drop = (struct ibv_flow_spec_action_drop){
.type = IBV_FLOW_SPEC_ACTION_DROP,
.size = sizeof(struct ibv_flow_spec_action_drop),
};
- parser.queue[HASH_RXQ_ETH].ibv_attr->num_of_specs++;
+ parser.queue[parser.layer].ibv_attr->num_of_specs++;
}
TAILQ_FOREACH(flow, &priv->flows, next) {
struct ibv_flow_attr *attr;
@@ -2877,8 +2877,8 @@ priv_fdir_filter_delete(struct priv *priv,
void *flow_spec;
unsigned int specs_n;
- attr = parser.queue[HASH_RXQ_ETH].ibv_attr;
- flow_attr = flow->frxq[HASH_RXQ_ETH].ibv_attr;
+ attr = parser.queue[parser.layer].ibv_attr;
+ flow_attr = flow->frxq[parser.layer].ibv_attr;
/* Compare first the attributes. */
if (memcmp(attr, flow_attr, sizeof(struct ibv_flow_attr)))
continue;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/mlx4: fix Rx resource leak in case of error' has been queued to stable release 18.02.2
2018-05-03 11:06 ` [dpdk-stable] patch 'net/mlx5: fix flow director rule deletion crash' " luca.boccassi
@ 2018-05-03 11:06 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
2018-05-03 11:06 ` [dpdk-stable] patch 'net/mlx4: fix default RSS hash fields' " luca.boccassi
` (2 subsequent siblings)
3 siblings, 1 reply; 382+ messages in thread
From: luca.boccassi @ 2018-05-03 11:06 UTC (permalink / raw)
To: Adrien Mazarguil; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/04/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From ab8ddf5ac768b37212dd3a2963bfa45b6d797df7 Mon Sep 17 00:00:00 2001
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Date: Thu, 26 Apr 2018 18:26:13 +0200
Subject: [PATCH] net/mlx4: fix Rx resource leak in case of error
[ upstream commit 84a684862f502f2d885bc5fa112da26265d5a0f4 ]
When creation of a flow rule fails during dev_start(), the usage count of
the common RSS context is not decremented, which triggers an assertion
failure in debug mode during dev_close().
This is addressed by tracking the initialization status of the common RSS
context in order to add missing cleanup code.
A similar issue exists in mlx4_rxq_attach(), where usage count is
incremented on a Rx queue but not released in case of error. This may lead
to the above issue since RSS contexts created by flow rules attach
themselves to Rx queues, incrementing their usage count.
Fixes: 5697a4142107 ("net/mlx4: relax Rx queue configuration order")
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
drivers/net/mlx4/mlx4.c | 6 ++++--
drivers/net/mlx4/mlx4.h | 1 +
drivers/net/mlx4/mlx4_rxq.c | 7 +++++++
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index fb8a8b848..c1f825e75 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -61,6 +61,8 @@ const char *pmd_mlx4_init_params[] = {
NULL,
};
+static void mlx4_dev_stop(struct rte_eth_dev *dev);
+
/**
* DPDK callback for Ethernet device configuration.
*
@@ -143,8 +145,7 @@ mlx4_dev_start(struct rte_eth_dev *dev)
dev->rx_pkt_burst = mlx4_rx_burst;
return 0;
err:
- /* Rollback. */
- priv->started = 0;
+ mlx4_dev_stop(dev);
return ret;
}
@@ -194,6 +195,7 @@ mlx4_dev_close(struct rte_eth_dev *dev)
dev->tx_pkt_burst = mlx4_tx_burst_removed;
rte_wmb();
mlx4_flow_clean(priv);
+ mlx4_rss_deinit(priv);
for (i = 0; i != dev->data->nb_rx_queues; ++i)
mlx4_rx_queue_release(dev->data->rx_queues[i]);
for (i = 0; i != dev->data->nb_tx_queues; ++i)
diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h
index 19c8a223d..0a50e785c 100644
--- a/drivers/net/mlx4/mlx4.h
+++ b/drivers/net/mlx4/mlx4.h
@@ -103,6 +103,7 @@ struct priv {
uint32_t vf:1; /**< This is a VF device. */
uint32_t intr_alarm:1; /**< An interrupt alarm is scheduled. */
uint32_t isolated:1; /**< Toggle isolated mode. */
+ uint32_t rss_init:1; /**< Common RSS context is initialized. */
uint32_t hw_csum:1; /**< Checksum offload is supported. */
uint32_t hw_csum_l2tun:1; /**< Checksum support for L2 tunnels. */
uint64_t hw_rss_sup; /**< Supported RSS hash fields (Verbs format). */
diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
index 7a036ed83..47e19cb0d 100644
--- a/drivers/net/mlx4/mlx4_rxq.c
+++ b/drivers/net/mlx4/mlx4_rxq.c
@@ -336,6 +336,8 @@ mlx4_rss_init(struct priv *priv)
unsigned int i;
int ret;
+ if (priv->rss_init)
+ return 0;
/* Prepare range for RSS contexts before creating the first WQ. */
ret = mlx4_glue->dv_set_context_attr
(priv->ctx,
@@ -418,6 +420,7 @@ wq_num_check:
}
wq_num_prev = wq_num;
}
+ priv->rss_init = 1;
return 0;
error:
ERROR("cannot initialize common RSS resources (queue %u): %s: %s",
@@ -446,6 +449,8 @@ mlx4_rss_deinit(struct priv *priv)
{
unsigned int i;
+ if (!priv->rss_init)
+ return;
for (i = 0; i != priv->dev->data->nb_rx_queues; ++i) {
struct rxq *rxq = priv->dev->data->rx_queues[i];
@@ -454,6 +459,7 @@ mlx4_rss_deinit(struct priv *priv)
mlx4_rxq_detach(rxq);
}
}
+ priv->rss_init = 0;
}
/**
@@ -597,6 +603,7 @@ error:
claim_zero(mlx4_glue->destroy_wq(wq));
if (cq)
claim_zero(mlx4_glue->destroy_cq(cq));
+ --rxq->usecnt;
rte_errno = ret;
ERROR("error while attaching Rx queue %p: %s: %s",
(void *)rxq, msg, strerror(ret));
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' has been queued to stable release 18.02.2
2018-05-03 11:06 ` [dpdk-stable] patch 'net/mlx4: fix Rx resource leak in case of error' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'event/dpaa2: remove check on epoll return' " luca.boccassi
` (70 more replies)
0 siblings, 71 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Qi Zhang; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 2671260c07e98cb089ec4aef4de90029cabfd1a1 Mon Sep 17 00:00:00 2001
From: Qi Zhang <qi.z.zhang@intel.com>
Date: Mon, 7 May 2018 17:50:44 +0800
Subject: [PATCH] app/testpmd: fix copy of raw flow item
[ upstream commit 67af7ecc52ec0abdec3e9d5b35dcd4dc78b595ce ]
When calculate memory size of an RTE_FLOW_ITEM_TYPE_RAW 's mask
mask->length is not the real size of binary pattern, it should take
spec->length, or memory size will be over counted (0xffff) and invalid
memory be access during following memcpy.
Fixes: d0ad8648b1c5 ("app/testpmd: fix RSS flow action configuration")
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
app/test-pmd/config.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 2058e6ec8..a8e511f5f 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1015,7 +1015,8 @@ flow_item_spec_copy(void *buf, const struct rte_flow_item *item,
src.raw = item_spec;
dst.raw = buf;
size = offsetof(struct rte_flow_item_raw, pattern) +
- src.raw->length * sizeof(*src.raw->pattern);
+ ((const struct rte_flow_item_raw *)item->spec)->
+ length * sizeof(*src.raw->pattern);
if (dst.raw)
memcpy(dst.raw, src.raw, size);
break;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'event/dpaa2: remove check on epoll return' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'event/dpaa2: remove link from info structure' " luca.boccassi
` (69 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Nipun Gupta; +Cc: Hemant Agrawal, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From fd92d1ca6266da449af9ee716bb3ae52ae925f02 Mon Sep 17 00:00:00 2001
From: Nipun Gupta <nipun.gupta@nxp.com>
Date: Wed, 9 May 2018 14:50:52 +0530
Subject: [PATCH] event/dpaa2: remove check on epoll return
[ upstream commit 3c21086bcb3786f76ad51d067f9498155aa278af ]
Driver shouldn't take decision on signals received. The return
from epoll was blocking on EINTR which is not the right use-case.
Fixes: 36d87bb92230 ("event/dpaa2: handle timeout using interrupts in dequeue")
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/event/dpaa2/dpaa2_eventdev.c | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)
diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index c3e6fbff1..977e8df85 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -153,26 +153,12 @@ dpaa2_eventdev_enqueue(void *port, const struct rte_event *ev)
static void dpaa2_eventdev_dequeue_wait(uint64_t timeout_ticks)
{
struct epoll_event epoll_ev;
- int ret, i = 0;
qbman_swp_interrupt_clear_status(DPAA2_PER_LCORE_PORTAL,
QBMAN_SWP_INTERRUPT_DQRI);
-RETRY:
- ret = epoll_wait(DPAA2_PER_LCORE_DPIO->epoll_fd,
+ epoll_wait(DPAA2_PER_LCORE_DPIO->epoll_fd,
&epoll_ev, 1, timeout_ticks);
- if (ret < 1) {
- /* sometimes due to some spurious interrupts epoll_wait fails
- * with errno EINTR. so here we are retrying epoll_wait in such
- * case to avoid the problem.
- */
- if (errno == EINTR) {
- DPAA2_EVENTDEV_DEBUG("epoll_wait fails\n");
- if (i++ > 10)
- DPAA2_EVENTDEV_DEBUG("Dequeue burst Failed\n");
- goto RETRY;
- }
- }
}
static void dpaa2_eventdev_process_parallel(struct qbman_swp *swp,
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'event/dpaa2: remove link from info structure' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'event/dpaa2: remove check on epoll return' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'crypto/scheduler: set null pointer after freeing' " luca.boccassi
` (68 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Ashish Jain; +Cc: Hemant Agrawal, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From be6aa9f7e6450f36e131a0c52a2b6633a14e20b8 Mon Sep 17 00:00:00 2001
From: Ashish Jain <ashish.jain@nxp.com>
Date: Wed, 9 May 2018 14:50:53 +0530
Subject: [PATCH] event/dpaa2: remove link from info structure
[ upstream commit 64f5de4194f89390c01ca137185f395ae2a95681 ]
Removing use of link data under evq_info_t structure which was
used to check whether the the associated evq has been linked
or not. Since, an evq can be linked to multiple event ports,
thus setting the link variable only allowed the first event
port to be associated with the evq. This led to huge performance
drop in case of multiple event ports as I/O only worked on
first event port associated with the evq.
Fixes: 0ce3ce7c275c ("event/dpaa2: add configuration functions")
Signed-off-by: Ashish Jain <ashish.jain@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/event/dpaa2/dpaa2_eventdev.c | 5 -----
drivers/event/dpaa2/dpaa2_eventdev.h | 1 -
2 files changed, 6 deletions(-)
diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index 977e8df85..9d5acb374 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -459,7 +459,6 @@ dpaa2_eventdev_port_unlink(struct rte_eventdev *dev, void *port,
dpio_remove_static_dequeue_channel(dpaa2_portal->dpio_dev->dpio,
0, dpaa2_portal->dpio_dev->token,
evq_info->dpcon->dpcon_id);
- evq_info->link = 0;
}
return (int)nb_unlinks;
@@ -480,8 +479,6 @@ dpaa2_eventdev_port_link(struct rte_eventdev *dev, void *port,
for (i = 0; i < nb_links; i++) {
evq_info = &priv->evq_info[queues[i]];
- if (evq_info->link)
- continue;
ret = dpio_add_static_dequeue_channel(
dpaa2_portal->dpio_dev->dpio,
@@ -496,7 +493,6 @@ dpaa2_eventdev_port_link(struct rte_eventdev *dev, void *port,
qbman_swp_push_set(dpaa2_portal->dpio_dev->sw_portal,
channel_index, 1);
evq_info->dpcon->channel_index = channel_index;
- evq_info->link = 1;
}
RTE_SET_USED(priorities);
@@ -510,7 +506,6 @@ err:
dpio_remove_static_dequeue_channel(dpaa2_portal->dpio_dev->dpio,
0, dpaa2_portal->dpio_dev->token,
evq_info->dpcon->dpcon_id);
- evq_info->link = 0;
}
return ret;
}
diff --git a/drivers/event/dpaa2/dpaa2_eventdev.h b/drivers/event/dpaa2/dpaa2_eventdev.h
index 91c8f2a35..229f66afb 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.h
+++ b/drivers/event/dpaa2/dpaa2_eventdev.h
@@ -63,7 +63,6 @@ struct evq_info_t {
struct dpaa2_dpci_dev *dpci;
/* Configuration provided by the user */
uint32_t event_queue_cfg;
- uint8_t link;
};
struct dpaa2_eventdev {
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'crypto/scheduler: set null pointer after freeing' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'event/dpaa2: remove check on epoll return' " luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'event/dpaa2: remove link from info structure' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'crypto/scheduler: fix memory leak' " luca.boccassi
` (67 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Pablo de Lara; +Cc: Fan Zhang, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From e284bcea7f8b3260798d232cf261611763c4974a Mon Sep 17 00:00:00 2001
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Date: Thu, 26 Apr 2018 16:09:49 +0100
Subject: [PATCH] crypto/scheduler: set null pointer after freeing
[ upstream commit 06f0a569972bebe22feeffd92c283954abc08359 ]
When freeing memory, pointers should be set to NULL,
to avoid memory corruption/segmentation faults.
Fixes: 31439ee72b2c ("crypto/scheduler: add API implementations")
Fixes: 50e14527b9d1 ("crypto/scheduler: improve parameters parsing")
Fixes: 57523e682bb7 ("crypto/scheduler: register operation functions")
Fixes: a783aa634410 ("crypto/scheduler: add packet size based mode")
Fixes: 4c07e0552f0a ("crypto/scheduler: add multicore scheduling mode")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
---
drivers/crypto/scheduler/rte_cryptodev_scheduler.c | 8 ++++++--
drivers/crypto/scheduler/scheduler_multicore.c | 6 ++++--
drivers/crypto/scheduler/scheduler_pkt_size_distr.c | 4 +++-
drivers/crypto/scheduler/scheduler_pmd_ops.c | 9 +++++++--
4 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c
index 140c8b418..ed574cc18 100644
--- a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c
+++ b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c
@@ -91,8 +91,10 @@ update_scheduler_capability(struct scheduler_ctx *sched_ctx)
struct rte_cryptodev_capabilities tmp_caps[256] = { {0} };
uint32_t nb_caps = 0, i;
- if (sched_ctx->capabilities)
+ if (sched_ctx->capabilities) {
rte_free(sched_ctx->capabilities);
+ sched_ctx->capabilities = NULL;
+ }
for (i = 0; i < sched_ctx->nb_slaves; i++) {
struct rte_cryptodev_info dev_info;
@@ -462,8 +464,10 @@ rte_cryptodev_scheduler_load_user_scheduler(uint8_t scheduler_id,
sched_ctx->ops.option_set = scheduler->ops->option_set;
sched_ctx->ops.option_get = scheduler->ops->option_get;
- if (sched_ctx->private_ctx)
+ if (sched_ctx->private_ctx) {
rte_free(sched_ctx->private_ctx);
+ sched_ctx->private_ctx = NULL;
+ }
if (sched_ctx->ops.create_private_ctx) {
int ret = (*sched_ctx->ops.create_private_ctx)(dev);
diff --git a/drivers/crypto/scheduler/scheduler_multicore.c b/drivers/crypto/scheduler/scheduler_multicore.c
index b2ce44ceb..15a57c3db 100644
--- a/drivers/crypto/scheduler/scheduler_multicore.c
+++ b/drivers/crypto/scheduler/scheduler_multicore.c
@@ -328,11 +328,13 @@ static int
scheduler_create_private_ctx(struct rte_cryptodev *dev)
{
struct scheduler_ctx *sched_ctx = dev->data->dev_private;
- struct mc_scheduler_ctx *mc_ctx;
+ struct mc_scheduler_ctx *mc_ctx = NULL;
uint16_t i;
- if (sched_ctx->private_ctx)
+ if (sched_ctx->private_ctx) {
rte_free(sched_ctx->private_ctx);
+ sched_ctx->private_ctx = NULL;
+ }
mc_ctx = rte_zmalloc_socket(NULL, sizeof(struct mc_scheduler_ctx), 0,
rte_socket_id());
diff --git a/drivers/crypto/scheduler/scheduler_pkt_size_distr.c b/drivers/crypto/scheduler/scheduler_pkt_size_distr.c
index 96bf01614..d09e849ae 100644
--- a/drivers/crypto/scheduler/scheduler_pkt_size_distr.c
+++ b/drivers/crypto/scheduler/scheduler_pkt_size_distr.c
@@ -334,8 +334,10 @@ scheduler_create_private_ctx(struct rte_cryptodev *dev)
struct scheduler_ctx *sched_ctx = dev->data->dev_private;
struct psd_scheduler_ctx *psd_ctx;
- if (sched_ctx->private_ctx)
+ if (sched_ctx->private_ctx) {
rte_free(sched_ctx->private_ctx);
+ sched_ctx->private_ctx = NULL;
+ }
psd_ctx = rte_zmalloc_socket(NULL, sizeof(struct psd_scheduler_ctx), 0,
rte_socket_id());
diff --git a/drivers/crypto/scheduler/scheduler_pmd_ops.c b/drivers/crypto/scheduler/scheduler_pmd_ops.c
index 680c2afbe..147dc51e9 100644
--- a/drivers/crypto/scheduler/scheduler_pmd_ops.c
+++ b/drivers/crypto/scheduler/scheduler_pmd_ops.c
@@ -46,6 +46,7 @@ scheduler_attach_init_slave(struct rte_cryptodev *dev)
sched_ctx->init_slave_names[i]);
rte_free(sched_ctx->init_slave_names[i]);
+ sched_ctx->init_slave_names[i] = NULL;
sched_ctx->nb_init_slaves -= 1;
}
@@ -261,11 +262,15 @@ scheduler_pmd_close(struct rte_cryptodev *dev)
}
}
- if (sched_ctx->private_ctx)
+ if (sched_ctx->private_ctx) {
rte_free(sched_ctx->private_ctx);
+ sched_ctx->private_ctx = NULL;
+ }
- if (sched_ctx->capabilities)
+ if (sched_ctx->capabilities) {
rte_free(sched_ctx->capabilities);
+ sched_ctx->capabilities = NULL;
+ }
return 0;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'crypto/scheduler: fix memory leak' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (2 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'crypto/scheduler: set null pointer after freeing' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'app/crypto-perf: fix burst size calculation' " luca.boccassi
` (66 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Pablo de Lara; +Cc: Fan Zhang, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 9e0d2079382dc33037492c460292c595fcb07f40 Mon Sep 17 00:00:00 2001
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Date: Thu, 26 Apr 2018 16:09:50 +0100
Subject: [PATCH] crypto/scheduler: fix memory leak
[ upstream commit 7b2491a62dcc4da2ad5afca2dbba458588126c23 ]
If private context creation fails, the memory
allocated for it and for some of the rings created
was being leaked.
In case of failure, it must be freed.
Fixes: 4c07e0552f0a ("crypto/scheduler: add multicore scheduling mode")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
---
drivers/crypto/scheduler/scheduler_multicore.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/crypto/scheduler/scheduler_multicore.c b/drivers/crypto/scheduler/scheduler_multicore.c
index 15a57c3db..644426e93 100644
--- a/drivers/crypto/scheduler/scheduler_multicore.c
+++ b/drivers/crypto/scheduler/scheduler_multicore.c
@@ -352,20 +352,29 @@ scheduler_create_private_ctx(struct rte_cryptodev *dev)
rte_socket_id(), RING_F_SC_DEQ | RING_F_SP_ENQ);
if (!mc_ctx->sched_enq_ring[i]) {
CS_LOG_ERR("Cannot create ring for worker %u", i);
- return -1;
+ goto exit;
}
snprintf(r_name, sizeof(r_name), MC_SCHED_DEQ_RING_NAME_PREFIX "%u", i);
mc_ctx->sched_deq_ring[i] = rte_ring_create(r_name, PER_SLAVE_BUFF_SIZE,
rte_socket_id(), RING_F_SC_DEQ | RING_F_SP_ENQ);
if (!mc_ctx->sched_deq_ring[i]) {
CS_LOG_ERR("Cannot create ring for worker %u", i);
- return -1;
+ goto exit;
}
}
sched_ctx->private_ctx = (void *)mc_ctx;
return 0;
+
+exit:
+ for (i = 0; i < sched_ctx->nb_wc; i++) {
+ rte_ring_free(mc_ctx->sched_enq_ring[i]);
+ rte_ring_free(mc_ctx->sched_deq_ring[i]);
+ }
+ rte_free(mc_ctx);
+
+ return -1;
}
struct rte_cryptodev_scheduler_ops scheduler_mc_ops = {
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'app/crypto-perf: fix burst size calculation' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (3 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'crypto/scheduler: fix memory leak' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'crypto/dpaa2_sec: remove IOVA conversion for fle address' " luca.boccassi
` (65 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Tomasz Jozwiak; +Cc: Pablo de Lara, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 9237f557c95321752a8e0b57c01742f831064d94 Mon Sep 17 00:00:00 2001
From: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Date: Thu, 26 Apr 2018 11:05:49 +0200
Subject: [PATCH] app/crypto-perf: fix burst size calculation
[ upstream commit 3356083a775c816cb1efa41019fa6ddbbec023c8 ]
This patch fixes segmentation fault in pmd_cyclecount_bench_ops
function in case when state->opts->nb_descriptors is not
natural multiple of burst size.
To reproduce run: dpdk-test-crypto-perf with params:
--ptest pmd-cyclecount --pmd-cyclecount-delay-ms 5 \
--devtype crypto_qat --optype cipher-then-auth \
--cipher-algo aes-cbc --cipher-op encrypt \
--cipher-key-sz 16 --cipher-iv-sz 16 \
--auth-algo sha2-256-hmac \
--auth-op generate --auth-key-sz 64 --digest-sz 32 \
--total-ops 10000 --burst-sz 255 --buffer-sz 1024 --silent
Fixes: 96dfeb609be1 ("app/crypto-perf: add new PMD benchmarking mode")
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
app/test-crypto-perf/cperf_test_pmd_cyclecount.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/test-crypto-perf/cperf_test_pmd_cyclecount.c b/app/test-crypto-perf/cperf_test_pmd_cyclecount.c
index 8f7616081..c8d16db6d 100644
--- a/app/test-crypto-perf/cperf_test_pmd_cyclecount.c
+++ b/app/test-crypto-perf/cperf_test_pmd_cyclecount.c
@@ -145,7 +145,7 @@ pmd_cyclecount_bench_ops(struct pmd_cyclecount_state *state, uint32_t cur_op,
for (cur_iter_op = 0; cur_iter_op < iter_ops_needed;
cur_iter_op += test_burst_size) {
- uint32_t burst_size = RTE_MIN(state->opts->total_ops - cur_op,
+ uint32_t burst_size = RTE_MIN(iter_ops_needed - cur_iter_op,
test_burst_size);
struct rte_crypto_op **ops = &state->ctx->ops[cur_iter_op];
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'crypto/dpaa2_sec: remove IOVA conversion for fle address' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (4 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'app/crypto-perf: fix burst size calculation' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'app/crypto-perf: check minimum lcore number' " luca.boccassi
` (64 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Hemant Agrawal; +Cc: Akhil Goyal, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 7401c088b64798bb254a1b8c6f19ea6600aca751 Mon Sep 17 00:00:00 2001
From: Hemant Agrawal <hemant.agrawal@nxp.com>
Date: Wed, 9 May 2018 18:13:24 +0530
Subject: [PATCH] crypto/dpaa2_sec: remove IOVA conversion for fle address
[ upstream commit 48743b0a53363d85e5069581e3f3a42ca846863e ]
fle is already in virtual addressing mode - no need to perform
address conversion for it.
Fixes: 8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation")
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
---
drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 2 +-
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index 9f75f56ff..355a95286 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -198,7 +198,7 @@ enum qbman_fd_format {
} while (0)
#define DPAA2_SET_FLE_INTERNAL_JD(fle, len) ((fle)->frc = (0x80000000 | (len)))
#define DPAA2_GET_FLE_ADDR(fle) \
- (uint64_t)((((uint64_t)((fle)->addr_hi)) << 32) + (fle)->addr_lo)
+ (size_t)((((uint64_t)((fle)->addr_hi)) << 32) + (fle)->addr_lo)
#define DPAA2_SET_FLE_ADDR(fle, addr) do { \
(fle)->addr_lo = lower_32_bits((uint64_t)addr); \
(fle)->addr_hi = upper_32_bits((uint64_t)addr); \
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index f3073aa27..699da0074 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -1254,8 +1254,7 @@ sec_fd_to_mbuf(const struct qbman_fd *fd, uint8_t driver_id)
RTE_LOG(ERR, PMD, "error: Non inline buffer - WHAT to DO?\n");
return NULL;
}
- op = (struct rte_crypto_op *)DPAA2_IOVA_TO_VADDR(
- DPAA2_GET_FLE_ADDR((fle - 1)));
+ op = (struct rte_crypto_op *)DPAA2_GET_FLE_ADDR((fle - 1));
/* Prefeth op */
src = op->sym->m_src;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'app/crypto-perf: check minimum lcore number' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (5 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'crypto/dpaa2_sec: remove IOVA conversion for fle address' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'net/i40e: fix missing defines for non-AVX build' " luca.boccassi
` (63 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Pablo de Lara; +Cc: Fiona Trahe, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 920da9bc48116e35baf8ba48ed95089f2da8f176 Mon Sep 17 00:00:00 2001
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Date: Wed, 9 May 2018 10:44:21 +0100
Subject: [PATCH] app/crypto-perf: check minimum lcore number
[ upstream commit 0bb32d94973987c82351edd6e6e1a4e53dfd83a6 ]
The crypto performance application requires at least
two cores: one master core that launches the other slaves
and one core acting as slave running the crypto device.
Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
---
app/test-crypto-perf/main.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c
index d905e13a1..26e78ff43 100644
--- a/app/test-crypto-perf/main.c
+++ b/app/test-crypto-perf/main.c
@@ -80,6 +80,12 @@ cperf_initialize_cryptodev(struct cperf_options *opts, uint8_t *enabled_cdevs,
nb_lcores = rte_lcore_count() - 1;
+ if (nb_lcores < 1) {
+ RTE_LOG(ERR, USER1,
+ "Number of enabled cores need to be higher than 1\n");
+ return -EINVAL;
+ }
+
/*
* Use less number of devices,
* if there are more available than cores.
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/i40e: fix missing defines for non-AVX build' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (6 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'app/crypto-perf: check minimum lcore number' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'eal: explicit cast of builtin for bsf32' " luca.boccassi
` (62 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Bruce Richardson; +Cc: Shreyansh Jain, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From d7d3b9c5e7e2b51a6f1c7ad1fb60d5c77d94a8fe Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Tue, 8 May 2018 21:10:17 +0100
Subject: [PATCH] net/i40e: fix missing defines for non-AVX build
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[ upstream commit 776d64ffb7cff60a5500c8f33704787d0bae428a ]
For non-AVX builds, the cflags used for compiling the i40e driver files
are not passed to the call to build the AVX-specific code path. This can
cause build failures.
../drivers/net/i40e/i40e_ethdev.h:888:42: error: ‘I40E_PFQF_HKEY_MAX_INDEX’ undeclared here (not in a function)
Fixes: e940646b20fa ("drivers/net: build Intel NIC PMDs with meson")
Reported-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
drivers/net/i40e/meson.build | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/i40e/meson.build b/drivers/net/i40e/meson.build
index 197e611d8..3c99e039a 100644
--- a/drivers/net/i40e/meson.build
+++ b/drivers/net/i40e/meson.build
@@ -23,6 +23,7 @@ sources = files(
)
deps += ['hash']
+includes += include_directories('base')
if arch_subdir == 'x86'
dpdk_conf.set('RTE_LIBRTE_I40E_INC_VECTOR', 1)
@@ -38,11 +39,10 @@ if arch_subdir == 'x86'
'i40e_rxtx_vec_avx2.c',
dependencies: [static_rte_ethdev,
static_rte_kvargs, static_rte_hash],
- c_args: '-mavx2')
+ include_directories: includes,
+ c_args: [cflags, '-mavx2'])
objs += i40e_avx2_lib.extract_objects('i40e_rxtx_vec_avx2.c')
endif
endif
-includes += include_directories('base')
-
install_headers('rte_pmd_i40e.h')
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'eal: explicit cast of builtin for bsf32' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (7 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'net/i40e: fix missing defines for non-AVX build' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'eal: explicit cast of core id when getting index' " luca.boccassi
` (61 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Andy Green; +Cc: Stephen Hemminger, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 3cc1184a1fbf1759137afa35a3422c23ab48ad5d Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Sat, 12 May 2018 09:58:57 +0800
Subject: [PATCH] eal: explicit cast of builtin for bsf32
[ upstream commit 54a93341ccaaf3665352ddad0807cf3ed40c36f9 ]
rte_common.h:416:9:
warning: conversion to 'uint32_t' {aka 'unsigned int'} from
'int' may change the sign of the result [-Wsign-conversion]
return __builtin_ctz(v);
^~~~~~~~~~~~~~~~
The builtin is defined to return int, but we want to
return it as uint32_t. Its only defined valid return
values are positive integers or zero, which is OK for
uint32_t. So just add an explicit cast.
Fixes: 03f6bced5bba ("eal: use intrinsic function")
Signed-off-by: Andy Green <andy@warmcat.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_eal/common/include/rte_common.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h
index c7803e41c..00478007e 100644
--- a/lib/librte_eal/common/include/rte_common.h
+++ b/lib/librte_eal/common/include/rte_common.h
@@ -320,7 +320,7 @@ rte_align64pow2(uint64_t v)
static inline uint32_t
rte_bsf32(uint32_t v)
{
- return __builtin_ctz(v);
+ return (uint32_t)__builtin_ctz(v);
}
/**
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'eal: explicit cast of core id when getting index' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (8 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'eal: explicit cast of builtin for bsf32' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'eal: declare trace buffer at top of own block' " luca.boccassi
` (60 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Andy Green; +Cc: Stephen Hemminger, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From c6b31197f2a6d069bbd1e5d0cc6cfb396f390344 Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Sat, 12 May 2018 09:59:07 +0800
Subject: [PATCH] eal: explicit cast of core id when getting index
[ upstream commit ef3c7b50ff39a37a93ecea47481d392d8fcb2936 ]
rte_lcore.h: In function 'rte_lcore_index':
rte_lcore.h:122:14:
warning: conversion to 'int' from 'unsigned int' may change
the sign of the result [-Wsign-conversion]
lcore_id = rte_lcore_id();
Fixes: 5583037a7950 ("eal: get relative core index")
Signed-off-by: Andy Green <andy@warmcat.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_eal/common/include/rte_lcore.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/common/include/rte_lcore.h
index 047222030..bcf2bfb79 100644
--- a/lib/librte_eal/common/include/rte_lcore.h
+++ b/lib/librte_eal/common/include/rte_lcore.h
@@ -119,7 +119,7 @@ rte_lcore_index(int lcore_id)
if (lcore_id >= RTE_MAX_LCORE)
return -1;
if (lcore_id < 0)
- lcore_id = rte_lcore_id();
+ lcore_id = (int)rte_lcore_id();
return lcore_config[lcore_id].core_index;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'eal: declare trace buffer at top of own block' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (9 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'eal: explicit cast of core id when getting index' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'spinlock/x86: move stack declaration before code' " luca.boccassi
` (59 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Andy Green; +Cc: Stephen Hemminger, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 138987e4f1a7a2683de2d4f4e2b671d69fcb6430 Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Sat, 12 May 2018 09:59:32 +0800
Subject: [PATCH] eal: declare trace buffer at top of own block
[ upstream commit e3908132b7903dbbf45c6d073792cccc890812e0 ]
rte_dev.h:54:2:
warning: ISO C90 forbids mixed declarations and
code [-Wdeclaration-after-statement]
char buffer[vsnprintf(NULL, 0, fmt, ap) + 1];
Fixes: b974e4a40cb5 ("ethdev: make error checking macros public")
Signed-off-by: Andy Green <andy@warmcat.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_eal/common/include/rte_dev.h | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h
index b688f1efd..984bbbbd6 100644
--- a/lib/librte_eal/common/include/rte_dev.h
+++ b/lib/librte_eal/common/include/rte_dev.h
@@ -32,15 +32,18 @@ rte_pmd_debug_trace(const char *func_name, const char *fmt, ...)
va_start(ap, fmt);
- char buffer[vsnprintf(NULL, 0, fmt, ap) + 1];
+ {
+ char buffer[vsnprintf(NULL, 0, fmt, ap) + 1];
- va_end(ap);
+ va_end(ap);
- va_start(ap, fmt);
- vsnprintf(buffer, sizeof(buffer), fmt, ap);
- va_end(ap);
+ va_start(ap, fmt);
+ vsnprintf(buffer, sizeof(buffer), fmt, ap);
+ va_end(ap);
- rte_log(RTE_LOG_ERR, RTE_LOGTYPE_PMD, "%s: %s", func_name, buffer);
+ rte_log(RTE_LOG_ERR, RTE_LOGTYPE_PMD, "%s: %s",
+ func_name, buffer);
+ }
}
/*
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'spinlock/x86: move stack declaration before code' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (10 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'eal: declare trace buffer at top of own block' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'net: move stack variable at top of VLAN strip function' " luca.boccassi
` (58 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Andy Green; +Cc: Stephen Hemminger, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 38e6012219fdf92d09c27a2f88ec77a8930f7d37 Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Sat, 12 May 2018 09:59:17 +0800
Subject: [PATCH] spinlock/x86: move stack declaration before code
[ upstream commit f7f18e92a51276f1e23a0595f59615f79323b358 ]
In function 'rte_try_tm':
rte_spinlock.h:82:2:
warning: ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
int retries = RTE_RTM_MAX_RETRIES;
Fixes: ba7468997ea6 ("spinlock: add HTM lock elision for x86")
Signed-off-by: Andy Green <andy@warmcat.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_eal/common/include/arch/x86/rte_spinlock.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/librte_eal/common/include/arch/x86/rte_spinlock.h b/lib/librte_eal/common/include/arch/x86/rte_spinlock.h
index 4b16887ea..60321da02 100644
--- a/lib/librte_eal/common/include/arch/x86/rte_spinlock.h
+++ b/lib/librte_eal/common/include/arch/x86/rte_spinlock.h
@@ -76,10 +76,12 @@ static inline int rte_tm_supported(void)
static inline int
rte_try_tm(volatile int *lock)
{
+ int retries;
+
if (!rte_rtm_supported)
return 0;
- int retries = RTE_RTM_MAX_RETRIES;
+ retries = RTE_RTM_MAX_RETRIES;
while (likely(retries--)) {
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net: move stack variable at top of VLAN strip function' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (11 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'spinlock/x86: move stack declaration before code' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'ethdev: explicit cast of buffered Tx number' " luca.boccassi
` (57 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Andy Green; +Cc: Stephen Hemminger, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From fe810530d32e0a1cdc6fae7fca3310e36e12a712 Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Sat, 12 May 2018 10:00:17 +0800
Subject: [PATCH] net: move stack variable at top of VLAN strip function
[ upstream commit 5a7e5accc695e5cf0ed840f59042dba4cbe0aae3 ]
In function 'rte_vlan_strip':
rte_ether.h:357:2:
warning: ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
struct vlan_hdr *vh = (struct vlan_hdr *)(eh + 1);
Fixes: c974021a5949 ("ether: add soft vlan encap/decap")
Signed-off-by: Andy Green <andy@warmcat.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_net/rte_ether.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
index 45daa911a..16dddb388 100644
--- a/lib/librte_net/rte_ether.h
+++ b/lib/librte_net/rte_ether.h
@@ -324,11 +324,12 @@ static inline int rte_vlan_strip(struct rte_mbuf *m)
{
struct ether_hdr *eh
= rte_pktmbuf_mtod(m, struct ether_hdr *);
+ struct vlan_hdr *vh;
if (eh->ether_type != rte_cpu_to_be_16(ETHER_TYPE_VLAN))
return -1;
- struct vlan_hdr *vh = (struct vlan_hdr *)(eh + 1);
+ vh = (struct vlan_hdr *)(eh + 1);
m->ol_flags |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED;
m->vlan_tci = rte_be_to_cpu_16(vh->vlan_tci);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'ethdev: explicit cast of buffered Tx number' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (12 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'net: move stack variable at top of VLAN strip function' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'hash: move stack declaration at top of CRC32c function' " luca.boccassi
` (56 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Andy Green; +Cc: Stephen Hemminger, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 4f76dca1c6dd8eff33bbbccbb5157ee3a437e85a Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Sat, 12 May 2018 10:00:27 +0800
Subject: [PATCH] ethdev: explicit cast of buffered Tx number
[ upstream commit b90406b9f7340466cbda287cd7454fae68868348 ]
In function 'rte_eth_tx_buffer_flush':
rte_ethdev.h:4248:55:
warning: conversion from 'int' to 'uint16_t'
{aka 'short unsigned int'} may change value [-Wconversion]
buffer->error_callback(&buffer->pkts[sent], to_send - sent,
Fixes: d6c99e62c852 ("ethdev: add buffered Tx")
Signed-off-by: Andy Green <andy@warmcat.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_ether/rte_ethdev.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 198aceb4f..6774a9c8b 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -4059,8 +4059,9 @@ rte_eth_tx_buffer_flush(uint16_t port_id, uint16_t queue_id,
/* All packets sent, or to be dealt with by callback below */
if (unlikely(sent != to_send))
- buffer->error_callback(&buffer->pkts[sent], to_send - sent,
- buffer->error_userdata);
+ buffer->error_callback(&buffer->pkts[sent],
+ (uint16_t)(to_send - sent),
+ buffer->error_userdata);
return sent;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'hash: move stack declaration at top of CRC32c function' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (13 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'ethdev: explicit cast of buffered Tx number' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'hash: explicit casts for truncation in CRC32c' " luca.boccassi
` (55 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Andy Green; +Cc: Stephen Hemminger, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 3527fcd0d017ded7f9e46dd8b8ea725c04d42057 Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Sat, 12 May 2018 10:00:32 +0800
Subject: [PATCH] hash: move stack declaration at top of CRC32c function
[ upstream commit f1eb05a1dc64e17bb9d9b6ad29b78f181aae36b8 ]
In function 'crc32c_2words':
rte_hash_crc.h:347:2:
warning: ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
uint32_t crc, term1, term2;
Fixes: d983cf41698f ("hash: add software CRC32 implementation")
Signed-off-by: Andy Green <andy@warmcat.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_hash/rte_hash_crc.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/librte_hash/rte_hash_crc.h b/lib/librte_hash/rte_hash_crc.h
index 479f84b14..5f5fb3db1 100644
--- a/lib/librte_hash/rte_hash_crc.h
+++ b/lib/librte_hash/rte_hash_crc.h
@@ -338,14 +338,13 @@ crc32c_1word(uint32_t data, uint32_t init_val)
static inline uint32_t
crc32c_2words(uint64_t data, uint32_t init_val)
{
+ uint32_t crc, term1, term2;
union {
uint64_t u64;
uint32_t u32[2];
} d;
d.u64 = data;
- uint32_t crc, term1, term2;
-
crc = init_val;
crc ^= d.u32[0];
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'hash: explicit casts for truncation in CRC32c' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (14 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'hash: move stack declaration at top of CRC32c function' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'test/reorder: fix freeing mbuf twice' " luca.boccassi
` (54 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Andy Green; +Cc: Stephen Hemminger, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 35420b7eb810b5a27a95c3413e23d0e4f9fcacce Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Sat, 12 May 2018 10:00:37 +0800
Subject: [PATCH] hash: explicit casts for truncation in CRC32c
[ upstream commit c981825388f81fb191f5a79c80adf0fdb074e584 ]
In function 'crc32c_sse42_u64_mimic':
rte_hash_crc.h:402:40:
warning: conversion from 'uint64_t' {aka 'long unsigned int'}
to 'uint32_t' {aka 'unsigned int'} may change value [-Wconversion]
init_val = crc32c_sse42_u32(d.u32[0], init_val);
Fixes: 00bf774bab0b ("hash: add assembly implementation of CRC32 intrinsics")
Signed-off-by: Andy Green <andy@warmcat.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_hash/rte_hash_crc.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/librte_hash/rte_hash_crc.h b/lib/librte_hash/rte_hash_crc.h
index 5f5fb3db1..cf28031b3 100644
--- a/lib/librte_hash/rte_hash_crc.h
+++ b/lib/librte_hash/rte_hash_crc.h
@@ -398,9 +398,9 @@ crc32c_sse42_u64_mimic(uint64_t data, uint64_t init_val)
} d;
d.u64 = data;
- init_val = crc32c_sse42_u32(d.u32[0], init_val);
- init_val = crc32c_sse42_u32(d.u32[1], init_val);
- return init_val;
+ init_val = crc32c_sse42_u32(d.u32[0], (uint32_t)init_val);
+ init_val = crc32c_sse42_u32(d.u32[1], (uint32_t)init_val);
+ return (uint32_t)init_val;
}
#endif
@@ -412,7 +412,7 @@ crc32c_sse42_u64(uint64_t data, uint64_t init_val)
"crc32q %[data], %[init_val];"
: [init_val] "+r" (init_val)
: [data] "rm" (data));
- return init_val;
+ return (uint32_t)init_val;
}
#endif
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'test/reorder: fix freeing mbuf twice' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (15 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'hash: explicit casts for truncation in CRC32c' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'test/distributor: fix return type of thread function' " luca.boccassi
` (53 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Reshma Pattan; +Cc: David Hunt, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From c0b7ae7bf30be96dbedbb6c63cb69ff4c3c32706 Mon Sep 17 00:00:00 2001
From: Reshma Pattan <reshma.pattan@intel.com>
Date: Fri, 4 May 2018 11:47:06 +0100
Subject: [PATCH] test/reorder: fix freeing mbuf twice
[ upstream commit ecd867faa860b41a154b3e24f6ea4536562234ab ]
mbufs are being freed twice in error, once in rte_mempool_put_bulk()
and then in rte_reorder_free(). Refactor the code so that we use
rte_reorder_free() to free mbufs in the reorder buffer, and use
rte_pktmbuf_free() to free any unused or drained mbufs.
Fixes: d0c9b58d71 ("app/test: new reorder unit test")
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Reviewed-by: David Hunt <david.hunt@intel.com>
---
test/test/test_reorder.c | 47 +++++++++++++++++++++++++++++++++++++----------
1 file changed, 37 insertions(+), 10 deletions(-)
diff --git a/test/test/test_reorder.c b/test/test/test_reorder.c
index 65e4f38b2..ccee4d086 100644
--- a/test/test/test_reorder.c
+++ b/test/test/test_reorder.c
@@ -146,11 +146,11 @@ test_reorder_insert(void)
b = rte_reorder_create("test_insert", rte_socket_id(), size);
TEST_ASSERT_NOT_NULL(b, "Failed to create reorder buffer");
- ret = rte_mempool_get_bulk(p, (void *)bufs, num_bufs);
- TEST_ASSERT_SUCCESS(ret, "Error getting mbuf from pool");
-
- for (i = 0; i < num_bufs; i++)
+ for (i = 0; i < num_bufs; i++) {
+ bufs[i] = rte_pktmbuf_alloc(p);
+ TEST_ASSERT_NOT_NULL(bufs[i], "Packet allocation failed\n");
bufs[i]->seqn = i;
+ }
/* This should fill up order buffer:
* reorder_seq = 0
@@ -165,6 +165,7 @@ test_reorder_insert(void)
ret = -1;
goto exit;
}
+ bufs[i] = NULL;
}
/* early packet - should move mbufs to ready buf and move sequence window
@@ -179,6 +180,7 @@ test_reorder_insert(void)
ret = -1;
goto exit;
}
+ bufs[4] = NULL;
/* early packet from current sequence window - full ready buffer */
bufs[5]->seqn = 2 * size;
@@ -189,6 +191,7 @@ test_reorder_insert(void)
ret = -1;
goto exit;
}
+ bufs[5] = NULL;
/* late packet */
bufs[6]->seqn = 3 * size;
@@ -199,11 +202,15 @@ test_reorder_insert(void)
ret = -1;
goto exit;
}
+ bufs[6] = NULL;
ret = 0;
exit:
- rte_mempool_put_bulk(p, (void *)bufs, num_bufs);
rte_reorder_free(b);
+ for (i = 0; i < num_bufs; i++) {
+ if (bufs[i] != NULL)
+ rte_pktmbuf_free(bufs[i]);
+ }
return ret;
}
@@ -219,6 +226,10 @@ test_reorder_drain(void)
int ret = 0;
unsigned i, cnt;
+ /* initialize all robufs to NULL */
+ for (i = 0; i < num_bufs; i++)
+ robufs[i] = NULL;
+
/* This would create a reorder buffer instance consisting of:
* reorder_seq = 0
* ready_buf: RB[size] = {NULL, NULL, NULL, NULL}
@@ -227,9 +238,6 @@ test_reorder_drain(void)
b = rte_reorder_create("test_drain", rte_socket_id(), size);
TEST_ASSERT_NOT_NULL(b, "Failed to create reorder buffer");
- ret = rte_mempool_get_bulk(p, (void *)bufs, num_bufs);
- TEST_ASSERT_SUCCESS(ret, "Error getting mbuf from pool");
-
/* Check no drained packets if reorder is empty */
cnt = rte_reorder_drain(b, robufs, 1);
if (cnt != 0) {
@@ -239,8 +247,11 @@ test_reorder_drain(void)
goto exit;
}
- for (i = 0; i < num_bufs; i++)
+ for (i = 0; i < num_bufs; i++) {
+ bufs[i] = rte_pktmbuf_alloc(p);
+ TEST_ASSERT_NOT_NULL(bufs[i], "Packet allocation failed\n");
bufs[i]->seqn = i;
+ }
/* Insert packet with seqn 1:
* reorder_seq = 0
@@ -248,6 +259,7 @@ test_reorder_drain(void)
* OB[] = {1, NULL, NULL, NULL}
*/
rte_reorder_insert(b, bufs[1]);
+ bufs[1] = NULL;
cnt = rte_reorder_drain(b, robufs, 1);
if (cnt != 1) {
@@ -256,6 +268,8 @@ test_reorder_drain(void)
ret = -1;
goto exit;
}
+ if (robufs[0] != NULL)
+ rte_pktmbuf_free(robufs[i]);
/* Insert more packets
* RB[] = {NULL, NULL, NULL, NULL}
@@ -263,18 +277,22 @@ test_reorder_drain(void)
*/
rte_reorder_insert(b, bufs[2]);
rte_reorder_insert(b, bufs[3]);
+ bufs[2] = NULL;
+ bufs[3] = NULL;
/* Insert more packets
* RB[] = {NULL, NULL, NULL, NULL}
* OB[] = {NULL, 2, 3, 4}
*/
rte_reorder_insert(b, bufs[4]);
+ bufs[4] = NULL;
/* Insert more packets
* RB[] = {2, 3, 4, NULL}
* OB[] = {NULL, NULL, 7, NULL}
*/
rte_reorder_insert(b, bufs[7]);
+ bufs[7] = NULL;
/* drained expected packets */
cnt = rte_reorder_drain(b, robufs, 4);
@@ -284,6 +302,10 @@ test_reorder_drain(void)
ret = -1;
goto exit;
}
+ for (i = 0; i < 3; i++) {
+ if (robufs[i] != NULL)
+ rte_pktmbuf_free(robufs[i]);
+ }
/*
* RB[] = {NULL, NULL, NULL, NULL}
@@ -298,8 +320,13 @@ test_reorder_drain(void)
}
ret = 0;
exit:
- rte_mempool_put_bulk(p, (void *)bufs, num_bufs);
rte_reorder_free(b);
+ for (i = 0; i < num_bufs; i++) {
+ if (bufs[i] != NULL)
+ rte_pktmbuf_free(bufs[i]);
+ if (robufs[i] != NULL)
+ rte_pktmbuf_free(robufs[i]);
+ }
return ret;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'test/distributor: fix return type of thread function' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (16 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'test/reorder: fix freeing mbuf twice' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'test/pipeline: fix return type of stub miss' " luca.boccassi
` (52 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: David Hunt; +Cc: Pablo de Lara, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 244beff23138e68f6a1f5bf45bbd27f750416d3d Mon Sep 17 00:00:00 2001
From: David Hunt <david.hunt@intel.com>
Date: Thu, 10 May 2018 02:25:38 +0100
Subject: [PATCH] test/distributor: fix return type of thread function
[ upstream commit 1d2ff358ff2fe236a17e22eeb28ecf013814f022 ]
New warning with gcc 8.1:
When casting the function pointer passed to
rte_eal_remote_launch() as an lcore_function_t *,
it expects the cast function to return an int, but
instead it was returning void. Fixed to return
an int.
Fixes: c3eabff124e6 ("distributor: add unit tests")
Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
test/test/test_distributor_perf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/test/test/test_distributor_perf.c b/test/test/test_distributor_perf.c
index 557715e13..edf1998ab 100644
--- a/test/test/test_distributor_perf.c
+++ b/test/test/test_distributor_perf.c
@@ -31,7 +31,7 @@ struct worker_stats worker_stats[RTE_MAX_LCORE];
* worker thread used for testing the time to do a round-trip of a cache
* line between two cores and back again
*/
-static void
+static int
flip_bit(volatile uint64_t *arg)
{
uint64_t old_val = 0;
@@ -41,6 +41,7 @@ flip_bit(volatile uint64_t *arg)
old_val = *arg;
*arg = 0;
}
+ return 0;
}
/*
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'test/pipeline: fix return type of stub miss' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (17 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'test/distributor: fix return type of thread function' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'examples/quota_watermark: fix return type of threads' " luca.boccassi
` (51 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: David Hunt; +Cc: Reshma Pattan, Pablo de Lara, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From ed0669ab022fce3d8b25a0907f2d751d3f72e77a Mon Sep 17 00:00:00 2001
From: David Hunt <david.hunt@intel.com>
Date: Thu, 10 May 2018 08:38:15 +0100
Subject: [PATCH] test/pipeline: fix return type of stub miss
[ upstream commit 97d84c7823a3c41c63163d5e70201c0b7fdae1fb ]
New warning with gcc 8.1:
The table_action_stub_miss() function was incorrectly
declared as returning a typedef of
rte_pipeline_table_action_handler_miss, instead of what it
should have been, an int.
Changed this to declare the function as returning an int, and
now when the action_handler_miss is set to table_action_stub_miss
(cast as rte_pipeline_table_action_handler_miss), gcc 8.1 no
longer complains about the cast.
Fixes: 5205954791cb ("app/test: packet framework unit tests")
Signed-off-by: David Hunt <david.hunt@intel.com>
Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
test/test/test_table_pipeline.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/test/test_table_pipeline.c b/test/test/test_table_pipeline.c
index 055a1a4e7..5ec4c5244 100644
--- a/test/test/test_table_pipeline.c
+++ b/test/test/test_table_pipeline.c
@@ -69,7 +69,7 @@ rte_pipeline_table_action_handler_hit
table_action_stub_hit(struct rte_pipeline *p, struct rte_mbuf **pkts,
uint64_t pkts_mask, struct rte_pipeline_table_entry **entry, void *arg);
-rte_pipeline_table_action_handler_miss
+static int
table_action_stub_miss(struct rte_pipeline *p, struct rte_mbuf **pkts,
uint64_t pkts_mask, struct rte_pipeline_table_entry **entry, void *arg);
@@ -101,7 +101,7 @@ table_action_stub_hit(__attribute__((unused)) struct rte_pipeline *p,
return 0;
}
-rte_pipeline_table_action_handler_miss
+static int
table_action_stub_miss(struct rte_pipeline *p,
__attribute__((unused)) struct rte_mbuf **pkts,
uint64_t pkts_mask,
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'examples/quota_watermark: fix return type of threads' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (18 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'test/pipeline: fix return type of stub miss' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'net/dpaa: fix xstats implementation' " luca.boccassi
` (50 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Reshma Pattan; +Cc: Pablo de Lara, Thomas Monjalon, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 174ce88b5f55af0f16ba156c46f106188d8ee3a6 Mon Sep 17 00:00:00 2001
From: Reshma Pattan <reshma.pattan@intel.com>
Date: Wed, 9 May 2018 12:35:28 +0100
Subject: [PATCH] examples/quota_watermark: fix return type of threads
[ upstream commit 491cf0eaa177d6aa14f2a1e124e57d8aee134c2b ]
Gcc 8.0.1 reports incompatible cast between types i.e. from
`void (*)(void *)` to `(int (*)(void *)`.
Change the pipeline_stage prototype to retun int type
to fix the issue.
Fixes: a0ffcb257a ("examples/quota_watermark: correct code indentation")
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
examples/quota_watermark/qw/main.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/examples/quota_watermark/qw/main.c b/examples/quota_watermark/qw/main.c
index 313216f39..c55d38744 100644
--- a/examples/quota_watermark/qw/main.c
+++ b/examples/quota_watermark/qw/main.c
@@ -181,7 +181,7 @@ receive_stage(__attribute__((unused)) void *args)
}
}
-static void
+static int
pipeline_stage(__attribute__((unused)) void *args)
{
int i, ret;
@@ -243,9 +243,11 @@ pipeline_stage(__attribute__((unused)) void *args)
}
}
}
+
+ return 0;
}
-static void
+static int
send_stage(__attribute__((unused)) void *args)
{
uint16_t nb_dq_pkts;
@@ -287,6 +289,8 @@ send_stage(__attribute__((unused)) void *args)
/* TODO: Check if nb_dq_pkts == nb_tx_pkts? */
}
}
+
+ return 0;
}
int
@@ -346,15 +350,13 @@ main(int argc, char **argv)
if (is_bit_set(port_id, portmask))
init_ring(lcore_id, port_id);
- /* typecast is a workaround for GCC 4.3 bug */
- rte_eal_remote_launch((int (*)(void *))pipeline_stage,
+ rte_eal_remote_launch(pipeline_stage,
NULL, lcore_id);
}
}
/* Start send_stage() on the last slave core */
- /* typecast is a workaround for GCC 4.3 bug */
- rte_eal_remote_launch((int (*)(void *))send_stage, NULL, last_lcore_id);
+ rte_eal_remote_launch(send_stage, NULL, last_lcore_id);
/* Start receive_stage() on the master core */
receive_stage(NULL);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/dpaa: fix xstats implementation' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (19 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'examples/quota_watermark: fix return type of threads' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'bus/fslmc: fix memory leak and cleanup' " luca.boccassi
` (49 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Hemant Agrawal; +Cc: Shreyansh Jain, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 464745b5ef3682ebfe2d231f72995911d3f38b8f Mon Sep 17 00:00:00 2001
From: Hemant Agrawal <hemant.agrawal@nxp.com>
Date: Wed, 25 Apr 2018 18:27:01 +0530
Subject: [PATCH] net/dpaa: fix xstats implementation
[ upstream commit 339c1025a87c3eeb38a9ec5bf0679caf21bec7e6 ]
Some of the applications are expecting that if n is 0, it shall
return the supported number of stats. e.g. VPP
Fixes: b21ed3e2a16d ("net/dpaa: support extended statistics")
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
drivers/net/dpaa/dpaa_ethdev.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index f511fa514..0828e0af6 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -316,12 +316,12 @@ dpaa_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
unsigned int i = 0, num = RTE_DIM(dpaa_xstats_strings);
uint64_t values[sizeof(struct dpaa_if_stats) / 8];
- if (xstats == NULL)
- return 0;
-
if (n < num)
return num;
+ if (xstats == NULL)
+ return 0;
+
fman_if_stats_get_all(dpaa_intf->fif, values,
sizeof(struct dpaa_if_stats) / 8);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'bus/fslmc: fix memory leak and cleanup' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (20 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'net/dpaa: fix xstats implementation' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'bus/fslmc: remove dead code' " luca.boccassi
` (48 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Shreyansh Jain; +Cc: Hemant Agrawal, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From da3d251a96eccbdfecb39f1b8eebc465518b76e0 Mon Sep 17 00:00:00 2001
From: Shreyansh Jain <shreyansh.jain@nxp.com>
Date: Wed, 9 May 2018 20:57:51 +0530
Subject: [PATCH] bus/fslmc: fix memory leak and cleanup
[ upstream commit 58b7c9ceed1efced68d4fc7106915fab3b467e47 ]
Coverity issue: 268327
Fixes: 828d51d8fc3e ("bus/fslmc: refactor scan and probe functions")
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/bus/fslmc/fslmc_vfio.c | 38 ++++++++++++++++++++++++++------------
1 file changed, 26 insertions(+), 12 deletions(-)
diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index affc9f80e..f62acb38b 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -466,38 +466,41 @@ fslmc_process_iodevices(struct rte_dpaa2_device *dev)
static int
fslmc_process_mcp(struct rte_dpaa2_device *dev)
{
+ int ret;
int64_t v_addr;
- char *dev_name;
+ char *dev_name = NULL;
struct fsl_mc_io dpmng = {0};
struct mc_version mc_ver_info = {0};
rte_mcp_ptr_list = malloc(sizeof(void *) * 1);
if (!rte_mcp_ptr_list) {
FSLMC_VFIO_LOG(ERR, "Out of memory");
- return -ENOMEM;
+ ret = -ENOMEM;
+ goto cleanup;
}
dev_name = strdup(dev->device.name);
if (!dev_name) {
FSLMC_VFIO_LOG(ERR, "Out of memory.");
- free(rte_mcp_ptr_list);
- rte_mcp_ptr_list = NULL;
- return -ENOMEM;
+ ret = -ENOMEM;
+ goto cleanup;
}
v_addr = vfio_map_mcp_obj(&vfio_group, dev_name);
if (v_addr == (int64_t)MAP_FAILED) {
FSLMC_VFIO_LOG(ERR, "Error mapping region (errno = %d)",
errno);
- free(rte_mcp_ptr_list);
- rte_mcp_ptr_list = NULL;
- return -1;
+ ret = -1;
+ goto cleanup;
}
/* check the MC version compatibility */
dpmng.regs = (void *)v_addr;
- if (mc_get_version(&dpmng, CMD_PRI_LOW, &mc_ver_info))
+ if (mc_get_version(&dpmng, CMD_PRI_LOW, &mc_ver_info)) {
RTE_LOG(WARNING, PMD, "\tmc_get_version failed\n");
+ ret = -1;
+ goto cleanup;
+ }
if ((mc_ver_info.major != MC_VER_MAJOR) ||
(mc_ver_info.minor < MC_VER_MINOR)) {
@@ -506,13 +509,24 @@ fslmc_process_mcp(struct rte_dpaa2_device *dev)
MC_VER_MAJOR, MC_VER_MINOR,
mc_ver_info.major, mc_ver_info.minor,
mc_ver_info.revision);
- free(rte_mcp_ptr_list);
- rte_mcp_ptr_list = NULL;
- return -1;
+ ret = -1;
+ goto cleanup;
}
rte_mcp_ptr_list[0] = (void *)v_addr;
+ free(dev_name);
return 0;
+
+cleanup:
+ if (dev_name)
+ free(dev_name);
+
+ if (rte_mcp_ptr_list) {
+ free(rte_mcp_ptr_list);
+ rte_mcp_ptr_list = NULL;
+ }
+
+ return ret;
}
int
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'bus/fslmc: remove dead code' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (21 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'bus/fslmc: fix memory leak and cleanup' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'raw/skeleton: fix resource leak in test' " luca.boccassi
` (47 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Shreyansh Jain; +Cc: Hemant Agrawal, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 68fbd6626ca1b5269a036eb8d387b4607ea34ff8 Mon Sep 17 00:00:00 2001
From: Shreyansh Jain <shreyansh.jain@nxp.com>
Date: Wed, 9 May 2018 20:57:52 +0530
Subject: [PATCH] bus/fslmc: remove dead code
[ upstream commit 7c5efbb12661408966332cb77da2ae8677d115d8 ]
Coverity issue: 268338
Fixes: 828d51d8fc3e ("bus/fslmc: refactor scan and probe functions")
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/bus/fslmc/fslmc_vfio.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index f62acb38b..abdebcd7c 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -564,9 +564,6 @@ fslmc_vfio_process_group(void)
}
TAILQ_FOREACH_SAFE(dev, &rte_fslmc_bus.device_list, next, dev_temp) {
- if (!dev)
- break;
-
switch (dev->dev_type) {
case DPAA2_ETH:
case DPAA2_CRYPTO:
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'raw/skeleton: fix resource leak in test' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (22 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'bus/fslmc: remove dead code' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'raw/skeleton: remove dead code' " luca.boccassi
` (46 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Shreyansh Jain; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 56579bbb71eb46b8ca4c589f1856767bf514b4b1 Mon Sep 17 00:00:00 2001
From: Shreyansh Jain <shreyansh.jain@nxp.com>
Date: Wed, 9 May 2018 20:56:08 +0530
Subject: [PATCH] raw/skeleton: fix resource leak in test
[ upstream commit 7cd675c2b8dc8d8f100e470693e398e8e6ea100e ]
Coverity issue: 260402
Fixes: 55ca1b0f2151 ("raw/skeleton: add test cases")
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c b/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c
index 795f24bcb..7ad8f19ce 100644
--- a/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c
+++ b/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c
@@ -288,6 +288,7 @@ test_rawdev_attr_set_get(void)
"Attribute (Test2) not set correctly (%" PRIu64 ")",
ret_value);
+ free(dummy_value);
return TEST_SUCCESS;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'raw/skeleton: remove dead code' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (23 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'raw/skeleton: fix resource leak in test' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'rawdev: " luca.boccassi
` (45 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Shreyansh Jain; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From dccc3a52b613bd1c28886fb3ef4db8c6a589378b Mon Sep 17 00:00:00 2001
From: Shreyansh Jain <shreyansh.jain@nxp.com>
Date: Wed, 9 May 2018 20:56:09 +0530
Subject: [PATCH] raw/skeleton: remove dead code
[ upstream commit 564ad58d2d6c9d4f21f62404597380c974e5d6e0 ]
Coverity Issue: 260411
Fixes: 55ca1b0f2151 ("raw/skeleton: add test cases")
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c b/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c
index 7ad8f19ce..3eb5c3a7b 100644
--- a/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c
+++ b/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c
@@ -380,8 +380,6 @@ test_rawdev_enqdeq(void)
cleanup:
if (buffers[0].buf_addr)
free(buffers[0].buf_addr);
- if (deq_buffers)
- free(deq_buffers);
return TEST_FAILED;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'rawdev: remove dead code' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (24 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'raw/skeleton: remove dead code' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'eal: fix mempool ops name parsing' " luca.boccassi
` (44 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Shreyansh Jain; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 3a5d4f91db651aa26ade933aca068c850643a216 Mon Sep 17 00:00:00 2001
From: Shreyansh Jain <shreyansh.jain@nxp.com>
Date: Wed, 9 May 2018 20:56:10 +0530
Subject: [PATCH] rawdev: remove dead code
[ upstream commit 7d3c4fb6de3a21e2a393bf6a1d4b4d11fd65d97b ]
Coverity issue: 260406
Fixes: c88b3f2558ed ("rawdev: introduce raw device library")
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
lib/librte_rawdev/rte_rawdev.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/lib/librte_rawdev/rte_rawdev.c b/lib/librte_rawdev/rte_rawdev.c
index d314ef96b..284e6aec8 100644
--- a/lib/librte_rawdev/rte_rawdev.c
+++ b/lib/librte_rawdev/rte_rawdev.c
@@ -88,9 +88,6 @@ rte_rawdev_info_get(uint16_t dev_id, struct rte_rawdev_info *dev_info)
RTE_RAWDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
RTE_FUNC_PTR_OR_ERR_RET(dev_info, -EINVAL);
- if (dev_info == NULL)
- return -EINVAL;
-
rawdev = &rte_rawdevs[dev_id];
RTE_FUNC_PTR_OR_ERR_RET(*rawdev->dev_ops->dev_info_get, -ENOTSUP);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'eal: fix mempool ops name parsing' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (25 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'rawdev: " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'eal: fix typo in doc of pointer offset macro' " luca.boccassi
` (43 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Ivan Malov; +Cc: Andrew Rybchenko, Santosh Shukla, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From d5b8f05cc5caa97719729e5f3e90423d9f4c85e3 Mon Sep 17 00:00:00 2001
From: Ivan Malov <ivan.malov@oktetlabs.ru>
Date: Fri, 4 May 2018 11:31:54 +0100
Subject: [PATCH] eal: fix mempool ops name parsing
[ upstream commit 33b318179162e4be81720d010fa6466fe03c2a84 ]
The code aimed to pick and remember the value of
mempool ops name from EAL command line arguments does not
copy the string and remembers the pointer provided
by getopt_long() directly. The latter could be clobbered
later and result in reading wrong mbuf pool ops name
by rte_mempool library.
Typically, this flaw could be avoided by using strdup()
to remember the string value of the option.
Fixes: a103a97e7191 ("eal: allow user to override default mempool driver")
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
---
lib/librte_eal/bsdapp/eal/eal.c | 3 ++-
lib/librte_eal/linuxapp/eal/eal.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c
index b1b8f7600..216796e87 100644
--- a/lib/librte_eal/bsdapp/eal/eal.c
+++ b/lib/librte_eal/bsdapp/eal/eal.c
@@ -380,7 +380,8 @@ eal_parse_args(int argc, char **argv)
switch (opt) {
case OPT_MBUF_POOL_OPS_NAME_NUM:
- internal_config.user_mbuf_pool_ops_name = optarg;
+ internal_config.user_mbuf_pool_ops_name =
+ strdup(optarg);
break;
case 'h':
eal_usage(prgname);
diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c
index 38306bf5c..fd48471de 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -591,7 +591,8 @@ eal_parse_args(int argc, char **argv)
break;
case OPT_MBUF_POOL_OPS_NAME_NUM:
- internal_config.user_mbuf_pool_ops_name = optarg;
+ internal_config.user_mbuf_pool_ops_name =
+ strdup(optarg);
break;
default:
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'eal: fix typo in doc of pointer offset macro' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (26 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'eal: fix mempool ops name parsing' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'memzone: fix size on reserving biggest memzone' " luca.boccassi
` (42 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From cafd0468a7bacd9b8d6da58cdd1d7adbcb092c89 Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas@monjalon.net>
Date: Tue, 1 May 2018 21:35:50 +0200
Subject: [PATCH] eal: fix typo in doc of pointer offset macro
[ upstream commit 2b1c4388dd5efb803fb825e9c07f5948e07d86a1 ]
Fixes: af75078fece3 ("first public release")
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
lib/librte_eal/common/include/rte_common.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h
index 00478007e..383b9b82d 100644
--- a/lib/librte_eal/common/include/rte_common.h
+++ b/lib/librte_eal/common/include/rte_common.h
@@ -117,7 +117,7 @@ static void __attribute__((constructor(prio), used)) func(void)
/*********** Macros for pointer arithmetic ********/
/**
- * add a byte-value offset from a pointer
+ * add a byte-value offset to a pointer
*/
#define RTE_PTR_ADD(ptr, x) ((void*)((uintptr_t)(ptr) + (x)))
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'memzone: fix size on reserving biggest memzone' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (27 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'eal: fix typo in doc of pointer offset macro' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix slave port detection' " luca.boccassi
` (41 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Anatoly Burakov; +Cc: Konstantin Ananyev, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From f540e11675052571c6b885e185e3b9ad90b7d444 Mon Sep 17 00:00:00 2001
From: Anatoly Burakov <anatoly.burakov@intel.com>
Date: Thu, 3 May 2018 17:00:47 +0100
Subject: [PATCH] memzone: fix size on reserving biggest memzone
[ upstream commit a82377cab87cea35bdd135fa8b8c4c485e2389f7 ]
Size of malloc heap elements include overhead, which should not
be counted as part of memzone.
Fixes: fafcc11985a2 ("mem: rework memzone to be allocated by malloc")
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
lib/librte_eal/common/eal_common_memzone.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/librte_eal/common/eal_common_memzone.c b/lib/librte_eal/common/eal_common_memzone.c
index 1ab3ade2d..56edc492d 100644
--- a/lib/librte_eal/common/eal_common_memzone.c
+++ b/lib/librte_eal/common/eal_common_memzone.c
@@ -225,7 +225,8 @@ memzone_reserve_aligned_thread_unsafe(const char *name, size_t len,
snprintf(mz->name, sizeof(mz->name), "%s", name);
mz->iova = rte_malloc_virt2iova(mz_addr);
mz->addr = mz_addr;
- mz->len = (requested_len == 0 ? elem->size : requested_len);
+ mz->len = (requested_len == 0 ?
+ (elem->size - MALLOC_ELEM_OVERHEAD) : requested_len);
mz->hugepage_sz = elem->ms->hugepage_sz;
mz->socket_id = elem->ms->socket_id;
mz->flags = 0;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'app/testpmd: fix slave port detection' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (28 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'memzone: fix size on reserving biggest memzone' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix valid ports prints' " luca.boccassi
` (40 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Matan Azrad; +Cc: Bernard Iremonger, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 51bbbb9efb102f96bc21698fb89e0e378fa0ef60 Mon Sep 17 00:00:00 2001
From: Matan Azrad <matan@mellanox.com>
Date: Wed, 28 Mar 2018 11:17:53 +0000
Subject: [PATCH] app/testpmd: fix slave port detection
[ upstream commit b8b8b344cb44bea46ac1d2037e8e5f1e742319f6 ]
Testpmd allows to create and control bonding devices by run time
command lines using the bonding PMD API.
Some bonding device slaves operations (close, stop, etc) should not be
used by the application and must be managed by the bonding PMD.
Thus, Testpmd manages slave flags to prevent the special operations
calls and when a slave is added to bonding device by a run time command
line, the flag is set.
There is one more way to define the slaves for a bonding device using
EAL command line and Testpmd doesn't set the slave flag in this case
what causes to the special operations to be called by Testpmd.
Add one more check to detect bonding slave device.
Fixes: 41b05095c4d1 ("app/testpmd: fix bonding start")
Fixes: 0e545d3047fe ("app/testpmd: check stopping port is not in bonding")
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
app/test-pmd/testpmd.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 0708c32cb..d168805d8 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2248,7 +2248,10 @@ uint8_t port_is_bonding_slave(portid_t slave_pid)
struct rte_port *port;
port = &ports[slave_pid];
- return port->slave_flag;
+ if ((rte_eth_devices[slave_pid].data->dev_flags &
+ RTE_ETH_DEV_BONDED_SLAVE) || (port->slave_flag == 1))
+ return 1;
+ return 0;
}
const uint16_t vlan_tags[] = {
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'app/testpmd: fix valid ports prints' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (29 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix slave port detection' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix forward ports update' " luca.boccassi
` (39 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Matan Azrad; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 7ac687307edfa75901c7c09b2057db17f93d022a Mon Sep 17 00:00:00 2001
From: Matan Azrad <matan@mellanox.com>
Date: Thu, 3 May 2018 10:31:43 +0000
Subject: [PATCH] app/testpmd: fix valid ports prints
[ upstream commit 8f3c4176fc11ed10dac9384a33ca470f3ef52c6a ]
There are several cases of an invalid port data access that causes the
printing of all the valid ports, for example, when the user asks to
receive a port information of an invalid port.
Wrongly, the port with id 0 is printed in all the above described
cases, regardless of its validity.
Print port 0 only if it is valid as done for the rest of the ports.
Fixes: af75078fece3 ("first public release")
Fixes: b6ea6408fbc7 ("ethdev: store numa_node per device")
Fixes: edab33b1c01d ("app/testpmd: support port hotplug")
Signed-off-by: Matan Azrad <matan@mellanox.com>
---
app/test-pmd/config.c | 36 +++++++++++++++---------------------
app/test-pmd/parameters.c | 12 ++----------
app/test-pmd/testpmd.h | 1 +
3 files changed, 18 insertions(+), 31 deletions(-)
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index a8e511f5f..8707debab 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -121,15 +121,11 @@ nic_stats_display(portid_t port_id)
struct rte_eth_stats stats;
struct rte_port *port = &ports[port_id];
uint8_t i;
- portid_t pid;
static const char *nic_stats_border = "########################";
if (port_id_is_invalid(port_id, ENABLED_WARN)) {
- printf("Valid port range is [0");
- RTE_ETH_FOREACH_DEV(pid)
- printf(", %d", pid);
- printf("]\n");
+ print_valid_ports();
return;
}
rte_eth_stats_get(port_id, &stats);
@@ -203,13 +199,8 @@ nic_stats_display(portid_t port_id)
void
nic_stats_clear(portid_t port_id)
{
- portid_t pid;
-
if (port_id_is_invalid(port_id, ENABLED_WARN)) {
- printf("Valid port range is [0");
- RTE_ETH_FOREACH_DEV(pid)
- printf(", %d", pid);
- printf("]\n");
+ print_valid_ports();
return;
}
rte_eth_stats_reset(port_id);
@@ -286,15 +277,11 @@ nic_stats_mapping_display(portid_t port_id)
{
struct rte_port *port = &ports[port_id];
uint16_t i;
- portid_t pid;
static const char *nic_stats_mapping_border = "########################";
if (port_id_is_invalid(port_id, ENABLED_WARN)) {
- printf("Valid port range is [0");
- RTE_ETH_FOREACH_DEV(pid)
- printf(", %d", pid);
- printf("]\n");
+ print_valid_ports();
return;
}
@@ -405,14 +392,10 @@ port_infos_display(portid_t port_id)
int vlan_offload;
struct rte_mempool * mp;
static const char *info_border = "*********************";
- portid_t pid;
uint16_t mtu;
if (port_id_is_invalid(port_id, ENABLED_WARN)) {
- printf("Valid port range is [0");
- RTE_ETH_FOREACH_DEV(pid)
- printf(", %d", pid);
- printf("]\n");
+ print_valid_ports();
return;
}
port = &ports[port_id];
@@ -742,6 +725,17 @@ port_id_is_invalid(portid_t port_id, enum print_warning warning)
return 1;
}
+void print_valid_ports(void)
+{
+ portid_t pid;
+
+ printf("The valid ports array is [");
+ RTE_ETH_FOREACH_DEV(pid) {
+ printf(" %d", pid);
+ }
+ printf(" ]\n");
+}
+
static int
vlan_id_is_invalid(uint16_t vlan_id)
{
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 97d22b860..18506dc24 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -373,7 +373,6 @@ parse_portnuma_config(const char *q_arg)
};
unsigned long int_fld[_NUM_FLD];
char *str_fld[_NUM_FLD];
- portid_t pid;
/* reset from value set at definition */
while ((p = strchr(p0,'(')) != NULL) {
@@ -397,10 +396,7 @@ parse_portnuma_config(const char *q_arg)
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");
- RTE_ETH_FOREACH_DEV(pid)
- printf(", %d", pid);
- printf("]\n");
+ print_valid_ports();
return -1;
}
socket_id = (uint8_t)int_fld[FLD_SOCKET];
@@ -431,7 +427,6 @@ parse_ringnuma_config(const char *q_arg)
};
unsigned long int_fld[_NUM_FLD];
char *str_fld[_NUM_FLD];
- portid_t pid;
#define RX_RING_ONLY 0x1
#define TX_RING_ONLY 0x2
#define RXTX_RING 0x3
@@ -458,10 +453,7 @@ parse_ringnuma_config(const char *q_arg)
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");
- RTE_ETH_FOREACH_DEV(pid)
- printf(", %d", pid);
- printf("]\n");
+ print_valid_ports();
return -1;
}
socket_id = (uint8_t)int_fld[FLD_SOCKET];
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 593ae2160..956a1bf98 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -694,6 +694,7 @@ enum print_warning {
DISABLED_WARN
};
int port_id_is_invalid(portid_t port_id, enum print_warning warning);
+void print_valid_ports(void);
int new_socket_id(unsigned int socket_id);
queueid_t get_allowed_max_nb_rxq(portid_t *pid);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'app/testpmd: fix forward ports update' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (30 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix valid ports prints' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix forward ports Rx flush' " luca.boccassi
` (38 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Matan Azrad; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From e103ed9a228dff5b7362abfc835c1d53f6acc9e9 Mon Sep 17 00:00:00 2001
From: Matan Azrad <matan@mellanox.com>
Date: Thu, 3 May 2018 10:31:44 +0000
Subject: [PATCH] app/testpmd: fix forward ports update
[ upstream commit 1f84c4695a567edc8cd8dc2572aa320cdeb9c358 ]
When the forward ports are changed either by new portlist\portmask
configurations or by a port detachment, all the old forward streams
are freed and new streams are allocated to be aligned with the new
forward ports.
If the number of the forward ports drops to 0, there is an attempt
to wrongly allocate 0 memory for the streams.
Skip the streams memory allocation if no forward ports are configured.
Fixes: ce8d561418d4 ("app/testpmd: add port configuration settings")
Signed-off-by: Matan Azrad <matan@mellanox.com>
---
app/test-pmd/testpmd.c | 27 ++++++++++++++++-----------
1 file changed, 16 insertions(+), 11 deletions(-)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index d168805d8..2f54d22c4 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -871,18 +871,23 @@ init_fwd_streams(void)
/* init new */
nb_fwd_streams = nb_fwd_streams_new;
- fwd_streams = rte_zmalloc("testpmd: fwd_streams",
- sizeof(struct fwd_stream *) * nb_fwd_streams, RTE_CACHE_LINE_SIZE);
- if (fwd_streams == NULL)
- rte_exit(EXIT_FAILURE, "rte_zmalloc(%d (struct fwd_stream *)) "
- "failed\n", nb_fwd_streams);
+ if (nb_fwd_streams) {
+ fwd_streams = rte_zmalloc("testpmd: fwd_streams",
+ sizeof(struct fwd_stream *) * nb_fwd_streams,
+ RTE_CACHE_LINE_SIZE);
+ if (fwd_streams == NULL)
+ rte_exit(EXIT_FAILURE, "rte_zmalloc(%d"
+ " (struct fwd_stream *)) failed\n",
+ nb_fwd_streams);
- for (sm_id = 0; sm_id < nb_fwd_streams; sm_id++) {
- fwd_streams[sm_id] = rte_zmalloc("testpmd: struct fwd_stream",
- sizeof(struct fwd_stream), RTE_CACHE_LINE_SIZE);
- if (fwd_streams[sm_id] == NULL)
- rte_exit(EXIT_FAILURE, "rte_zmalloc(struct fwd_stream)"
- " failed\n");
+ for (sm_id = 0; sm_id < nb_fwd_streams; sm_id++) {
+ fwd_streams[sm_id] = rte_zmalloc("testpmd:"
+ " struct fwd_stream", sizeof(struct fwd_stream),
+ RTE_CACHE_LINE_SIZE);
+ if (fwd_streams[sm_id] == NULL)
+ rte_exit(EXIT_FAILURE, "rte_zmalloc"
+ "(struct fwd_stream) failed\n");
+ }
}
return 0;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'app/testpmd: fix forward ports Rx flush' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (31 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix forward ports update' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix synchronic port hotplug' " luca.boccassi
` (37 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Matan Azrad; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From fc365154064da2603806c31cffc9f1320606e821 Mon Sep 17 00:00:00 2001
From: Matan Azrad <matan@mellanox.com>
Date: Thu, 3 May 2018 10:31:45 +0000
Subject: [PATCH] app/testpmd: fix forward ports Rx flush
[ upstream commit 47a767b2ee253ccdd084af88d3e390ed9e74f20b ]
A port Rx queue flush is done when the packet forwarding starts in
order to clean the port statistics for a new traffic session.
The flush operation is wrongly called before the update of the new
forward ports, and may fail due to flush operation for an invalid port
configured by the old session.
Move the new forward port setup to be done before the Rx queue flush.
Fixes: 7741e4cf16c0 ("app/testpmd: VMDq and DCB updates")
Signed-off-by: Matan Azrad <matan@mellanox.com>
---
app/test-pmd/testpmd.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 2f54d22c4..8487c99fe 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1238,10 +1238,6 @@ start_packet_forwarding(int with_tx_first)
return;
}
- if (init_fwd_streams() < 0) {
- printf("Fail from init_fwd_streams()\n");
- return;
- }
if(dcb_test) {
for (i = 0; i < nb_fwd_ports; i++) {
@@ -1261,10 +1257,11 @@ start_packet_forwarding(int with_tx_first)
}
test_done = 0;
+ fwd_config_setup();
+
if(!no_flush_rx)
flush_fwd_rx_queues();
- fwd_config_setup();
pkt_fwd_config_display(&cur_fwd_config);
rxtx_config_display();
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'app/testpmd: fix synchronic port hotplug' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (32 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix forward ports Rx flush' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix removed device link status asking' " luca.boccassi
` (36 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Matan Azrad; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 0035d0a222b0ef0227f9be2f4564bfeaa91a8c81 Mon Sep 17 00:00:00 2001
From: Matan Azrad <matan@mellanox.com>
Date: Thu, 3 May 2018 10:31:46 +0000
Subject: [PATCH] app/testpmd: fix synchronic port hotplug
[ upstream commit 03ce2c53a3905b11e54c424ca395ae5bea186cbd ]
When the user uses the synchronic hot-plug commands, attach\detach, in
order to insert\remove a port from the system, the forward ports list
update is missed in the current implementation.
Thus, an invalid port may be used for data-path in case of detach
because the detached port was not removed from the forward port list.
In addition, a new port is not used for data-path in case of attach, as the
default behavior of Testpmd, because the attached port was not inserted
to the forward port list.
Update the forward port list in the above cases to allow the correct
port usage for data-path in the next packet forwarding start.
Fixes: edab33b1c01d ("app/testpmd: support port hotplug")
Signed-off-by: Matan Azrad <matan@mellanox.com>
---
app/test-pmd/testpmd.c | 29 +++++++++++++++++++++++++++++
app/test-pmd/testpmd.h | 1 +
2 files changed, 30 insertions(+)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 8487c99fe..fed7d509f 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1203,6 +1203,31 @@ launch_packet_forwarding(lcore_function_t *pkt_fwd_on_lcore)
}
}
+/*
+ * Update the forward ports list.
+ */
+void
+update_fwd_ports(portid_t new_pid)
+{
+ unsigned int i;
+ unsigned int new_nb_fwd_ports = 0;
+ int move = 0;
+
+ for (i = 0; i < nb_fwd_ports; ++i) {
+ if (port_id_is_invalid(fwd_ports_ids[i], DISABLED_WARN))
+ move = 1;
+ else if (move)
+ fwd_ports_ids[new_nb_fwd_ports++] = fwd_ports_ids[i];
+ else
+ new_nb_fwd_ports++;
+ }
+ if (new_pid < RTE_MAX_ETHPORTS)
+ fwd_ports_ids[new_nb_fwd_ports++] = new_pid;
+
+ nb_fwd_ports = new_nb_fwd_ports;
+ nb_cfg_ports = new_nb_fwd_ports;
+}
+
/*
* Launch packet forwarding configuration.
*/
@@ -1879,6 +1904,8 @@ attach_port(char *identifier)
ports[pi].port_status = RTE_PORT_STOPPED;
+ update_fwd_ports(pi);
+
printf("Port %d is attached. Now total ports is %d\n", pi, nb_ports);
printf("Done\n");
}
@@ -1905,6 +1932,8 @@ detach_port(portid_t port_id)
nb_ports = rte_eth_dev_count();
+ update_fwd_ports(RTE_MAX_ETHPORTS);
+
printf("Port '%s' is detached. Now total ports is %d\n",
name, nb_ports);
printf("Done\n");
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 956a1bf98..de7b67c7b 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -564,6 +564,7 @@ void fwd_config_setup(void);
void set_def_fwd_config(void);
void reconfig(portid_t new_port_id, unsigned socket_id);
int init_fwd_streams(void);
+void update_fwd_ports(portid_t new_pid);
void set_fwd_eth_peer(portid_t port_id, char *peer_addr);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'app/testpmd: fix removed device link status asking' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (33 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix synchronic port hotplug' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix asynchronic port removal' " luca.boccassi
` (35 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Matan Azrad; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From bbf546801e3b6fe15124ae448e8c1bd002b144f2 Mon Sep 17 00:00:00 2001
From: Matan Azrad <matan@mellanox.com>
Date: Thu, 3 May 2018 10:31:47 +0000
Subject: [PATCH] app/testpmd: fix removed device link status asking
[ upstream commit 0da2a62bf9d72625fb5b779d9fd91e471ed2fb4a ]
In the RMV device event callback, there is a call for the removed
device stop operation which triggers a link status operation for the
removed device.
It may casue an error from the removed device PMD.
Skip the link status operation in the above described case.
Fixes: 284c908cc588 ("app/testpmd: request device removal interrupt")
Signed-off-by: Matan Azrad <matan@mellanox.com>
---
app/test-pmd/testpmd.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index fed7d509f..3c92e899b 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2027,13 +2027,16 @@ check_all_ports_link_status(uint32_t port_mask)
static void
rmv_event_callback(void *arg)
{
+ int org_no_link_check = no_link_check;
struct rte_eth_dev *dev;
portid_t port_id = (intptr_t)arg;
RTE_ETH_VALID_PORTID_OR_RET(port_id);
dev = &rte_eth_devices[port_id];
+ no_link_check = 1;
stop_port(port_id);
+ no_link_check = org_no_link_check;
close_port(port_id);
printf("removing device %s\n", dev->device->name);
if (rte_eal_dev_detach(dev->device))
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'app/testpmd: fix asynchronic port removal' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (34 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix removed device link status asking' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'examples/performance-thread: fix return type of threads' " luca.boccassi
` (34 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Matan Azrad; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 157baa268d911d22b9496e77e0b165b8fca21396 Mon Sep 17 00:00:00 2001
From: Matan Azrad <matan@mellanox.com>
Date: Thu, 3 May 2018 10:31:48 +0000
Subject: [PATCH] app/testpmd: fix asynchronic port removal
[ upstream commit 3b97888ab2a8405bcbe198abdcc8ac98ee0f0e96 ]
When a removable device is plugged-out, a RMV interrupt is invoked and
the application can catch the event in order to stop the device
management.
The Testpmd wrong behavior in this case is to detach the removed device
using the EAL detach API.
The EAL API does not invalidate the ethdev port and the port keeps
appearing as valid from the ethdev point of view.
Thus, the next operations for the ethtev port X may trigger an invalid
rte_device access. For example, calling "show port info X" may cause
segfault.
Moreover, the removed port is not removed from the Testpmd data-path
structures. Therefore, the invalid device may still be used by the
Testpmd data-path.
Call the Testpmd detach_port() function which uses the ethdev detach
API, and prepare the Testpmd forward ports database for a new
forwarding session without the detached port.
Fixes: 284c908cc588 ("app/testpmd: request device removal interrupt")
Signed-off-by: Matan Azrad <matan@mellanox.com>
---
app/test-pmd/testpmd.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 3c92e899b..9ab44813d 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2027,21 +2027,23 @@ check_all_ports_link_status(uint32_t port_mask)
static void
rmv_event_callback(void *arg)
{
+ int need_to_start = 0;
int org_no_link_check = no_link_check;
- struct rte_eth_dev *dev;
portid_t port_id = (intptr_t)arg;
RTE_ETH_VALID_PORTID_OR_RET(port_id);
- dev = &rte_eth_devices[port_id];
+ if (!test_done && port_is_forwarding(port_id)) {
+ need_to_start = 1;
+ stop_packet_forwarding();
+ }
no_link_check = 1;
stop_port(port_id);
no_link_check = org_no_link_check;
close_port(port_id);
- printf("removing device %s\n", dev->device->name);
- if (rte_eal_dev_detach(dev->device))
- TESTPMD_LOG(ERR, "Failed to detach device %s\n",
- dev->device->name);
+ detach_port(port_id);
+ if (need_to_start)
+ start_packet_forwarding(0);
}
/* This function is used by the interrupt thread */
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'examples/performance-thread: fix return type of threads' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (35 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix asynchronic port removal' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'test/pipeline: fix type of table entry parameter' " luca.boccassi
` (33 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: David Hunt; +Cc: Pablo de Lara, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 19a441472af6ce087b8ab63701e76695332ffaa5 Mon Sep 17 00:00:00 2001
From: David Hunt <david.hunt@intel.com>
Date: Mon, 14 May 2018 03:53:15 +0100
Subject: [PATCH] examples/performance-thread: fix return type of threads
[ upstream commit 803ee2ebd32d019d54011f185819f3b76b113c4f ]
The function pthread_create() expects void *(*func) (void *)
for function pointer, however, lthread_func_t was defined as
void (*func) (void *), so now gcc 8.1 warns that the cast is
incorrect, causing a compilation failure. This patch changes
the declaration of lthread_func_t from returning a void to
returning a void*, and then changes the sample app in the
relevant places that are affected by the typedef change.
Fixes: 116819b9ed0d ("examples/performance-thread: add lthread subsystem")
Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
examples/performance-thread/common/lthread.c | 3 ++-
examples/performance-thread/common/lthread_api.h | 2 +-
examples/performance-thread/l3fwd-thread/main.c | 20 +++++++++++++-------
examples/performance-thread/pthread_shim/main.c | 6 ++----
.../performance-thread/pthread_shim/pthread_shim.c | 4 ++--
5 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/examples/performance-thread/common/lthread.c b/examples/performance-thread/common/lthread.c
index 7d76c8c46..0b60a42a8 100644
--- a/examples/performance-thread/common/lthread.c
+++ b/examples/performance-thread/common/lthread.c
@@ -320,13 +320,14 @@ struct lthread *lthread_current(void)
/*
* Tasklet to cancel a thread
*/
-static void
+static void *
_cancel(void *arg)
{
struct lthread *lt = (struct lthread *) arg;
lt->state |= BIT(ST_LT_CANCELLED);
lthread_detach();
+ return NULL;
}
diff --git a/examples/performance-thread/common/lthread_api.h b/examples/performance-thread/common/lthread_api.h
index ff245a082..a74680bf7 100644
--- a/examples/performance-thread/common/lthread_api.h
+++ b/examples/performance-thread/common/lthread_api.h
@@ -143,7 +143,7 @@ struct lthread_mutex;
struct lthread_condattr;
struct lthread_mutexattr;
-typedef void (*lthread_func_t) (void *);
+typedef void *(*lthread_func_t) (void *);
/*
* Define the size of stack for an lthread
diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c
index 699b99d00..c5a173ed3 100644
--- a/examples/performance-thread/l3fwd-thread/main.c
+++ b/examples/performance-thread/l3fwd-thread/main.c
@@ -1990,17 +1990,18 @@ cpu_load_collector(__rte_unused void *arg) {
*
* This loop is used to start empty scheduler on lcore.
*/
-static void
+static void *
lthread_null(__rte_unused void *args)
{
int lcore_id = rte_lcore_id();
RTE_LOG(INFO, L3FWD, "Starting scheduler on lcore %d.\n", lcore_id);
lthread_exit(NULL);
+ return NULL;
}
/* main processing loop */
-static void
+static void *
lthread_tx_per_ring(void *dummy)
{
int nb_rx;
@@ -2045,6 +2046,7 @@ lthread_tx_per_ring(void *dummy)
lthread_cond_wait(ready, 0);
}
+ return NULL;
}
/*
@@ -2053,7 +2055,7 @@ lthread_tx_per_ring(void *dummy)
* This lthread is used to spawn one new lthread per ring from producers.
*
*/
-static void
+static void *
lthread_tx(void *args)
{
struct lthread *lt;
@@ -2098,9 +2100,10 @@ lthread_tx(void *args)
}
}
+ return NULL;
}
-static void
+static void *
lthread_rx(void *dummy)
{
int ret;
@@ -2124,7 +2127,7 @@ lthread_rx(void *dummy)
if (rx_conf->n_rx_queue == 0) {
RTE_LOG(INFO, L3FWD, "lcore %u has nothing to do\n", rte_lcore_id());
- return;
+ return NULL;
}
RTE_LOG(INFO, L3FWD, "Entering main Rx loop on lcore %u\n", rte_lcore_id());
@@ -2196,6 +2199,7 @@ lthread_rx(void *dummy)
lthread_yield();
}
}
+ return NULL;
}
/*
@@ -2204,8 +2208,9 @@ lthread_rx(void *dummy)
* This lthread loop spawns all rx and tx lthreads on master lcore
*/
-static void
-lthread_spawner(__rte_unused void *arg) {
+static void *
+lthread_spawner(__rte_unused void *arg)
+{
struct lthread *lt[MAX_THREAD];
int i;
int n_thread = 0;
@@ -2246,6 +2251,7 @@ lthread_spawner(__rte_unused void *arg) {
for (i = 0; i < n_thread; i++)
lthread_join(lt[i], NULL);
+ return NULL;
}
/*
diff --git a/examples/performance-thread/pthread_shim/main.c b/examples/performance-thread/pthread_shim/main.c
index 964ea252d..7d0d58116 100644
--- a/examples/performance-thread/pthread_shim/main.c
+++ b/examples/performance-thread/pthread_shim/main.c
@@ -119,8 +119,7 @@ void *helloworld_pthread(void *arg)
*/
__thread pthread_t tid[HELLOW_WORLD_MAX_LTHREADS];
-static void initial_lthread(void *args);
-static void initial_lthread(void *args __attribute__((unused)))
+static void *initial_lthread(void *args __attribute__((unused)))
{
int lcore = (int) rte_lcore_id();
/*
@@ -195,6 +194,7 @@ static void initial_lthread(void *args __attribute__((unused)))
/* shutdown the lthread scheduler */
lthread_scheduler_shutdown(rte_lcore_id());
lthread_detach();
+ return NULL;
}
@@ -205,8 +205,6 @@ static void initial_lthread(void *args __attribute__((unused)))
* in the core mask
*/
static int
-lthread_scheduler(void *args);
-static int
lthread_scheduler(void *args __attribute__((unused)))
{
/* create initial thread */
diff --git a/examples/performance-thread/pthread_shim/pthread_shim.c b/examples/performance-thread/pthread_shim/pthread_shim.c
index c31de4e9d..53f12437f 100644
--- a/examples/performance-thread/pthread_shim/pthread_shim.c
+++ b/examples/performance-thread/pthread_shim/pthread_shim.c
@@ -365,7 +365,7 @@ int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
int
pthread_create(pthread_t *__restrict tid,
const pthread_attr_t *__restrict attr,
- void *(func) (void *),
+ lthread_func_t func,
void *__restrict arg)
{
if (override) {
@@ -390,7 +390,7 @@ pthread_create(pthread_t *__restrict tid,
}
}
return lthread_create((struct lthread **)tid, lcore,
- (void (*)(void *))func, arg);
+ func, arg);
}
return _sys_pthread_funcs.f_pthread_create(tid, attr, func, arg);
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'test/pipeline: fix type of table entry parameter' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (36 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'examples/performance-thread: fix return type of threads' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'ip_frag: fix some debug logs' " luca.boccassi
` (32 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Jasvinder Singh; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 0e0449eb20a5e71a96c5dad875adec05b3603fa6 Mon Sep 17 00:00:00 2001
From: Jasvinder Singh <jasvinder.singh@intel.com>
Date: Mon, 14 May 2018 14:35:24 +0100
Subject: [PATCH] test/pipeline: fix type of table entry parameter
[ upstream commit 37181824ccedb10d2a8e3f37d12d5815937db586 ]
Fixes the wrong argument in table action miss function.
Fixes: 4c387fcdf777 ("pipeline: add new functions for action handlers")
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
---
test/test/test_table_pipeline.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/test/test/test_table_pipeline.c b/test/test/test_table_pipeline.c
index 5ec4c5244..441338ac0 100644
--- a/test/test/test_table_pipeline.c
+++ b/test/test/test_table_pipeline.c
@@ -71,7 +71,7 @@ table_action_stub_hit(struct rte_pipeline *p, struct rte_mbuf **pkts,
static int
table_action_stub_miss(struct rte_pipeline *p, struct rte_mbuf **pkts,
- uint64_t pkts_mask, struct rte_pipeline_table_entry **entry, void *arg);
+ uint64_t pkts_mask, struct rte_pipeline_table_entry *entry, void *arg);
rte_pipeline_table_action_handler_hit
table_action_0x00(__attribute__((unused)) struct rte_pipeline *p,
@@ -105,7 +105,7 @@ static int
table_action_stub_miss(struct rte_pipeline *p,
__attribute__((unused)) struct rte_mbuf **pkts,
uint64_t pkts_mask,
- __attribute__((unused)) struct rte_pipeline_table_entry **entry,
+ __attribute__((unused)) struct rte_pipeline_table_entry *entry,
__attribute__((unused)) void *arg)
{
printf("STUB Table Action Miss - setting mask to 0x%"PRIx64"\n",
@@ -517,8 +517,7 @@ test_table_pipeline(void)
/* TEST - one packet per port */
action_handler_hit = NULL;
- action_handler_miss =
- (rte_pipeline_table_action_handler_miss) table_action_stub_miss;
+ action_handler_miss = table_action_stub_miss;
table_entry_default_action = RTE_PIPELINE_ACTION_PORT;
override_miss_mask = 0x01; /* one packet per port */
setup_pipeline(e_TEST_STUB);
@@ -553,8 +552,7 @@ test_table_pipeline(void)
printf("TEST - two tables, hitmask override to 0x01\n");
connect_miss_action_to_table = 1;
- action_handler_miss =
- (rte_pipeline_table_action_handler_miss)table_action_stub_miss;
+ action_handler_miss = table_action_stub_miss;
override_miss_mask = 0x01;
setup_pipeline(e_TEST_STUB);
if (test_pipeline_single_filter(e_TEST_STUB, 2) < 0)
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'ip_frag: fix some debug logs' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (37 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'test/pipeline: fix type of table entry parameter' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'vhost: fix dead lock on closing in server mode' " luca.boccassi
` (31 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Li Han; +Cc: Konstantin Ananyev, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From a6bc07a7188a6cafd51d36776696f3368fd218aa Mon Sep 17 00:00:00 2001
From: Li Han <han.li1@zte.com.cn>
Date: Wed, 18 Apr 2018 04:51:37 -0400
Subject: [PATCH] ip_frag: fix some debug logs
[ upstream commit 3375e7f28649881fc53d83ee91772d97c8b1eb9b ]
In ip_frag_process, some IP_FRAG_LOG content is wrong.
Fixes: 4f1a8f633862 ("ip_frag: add IPv6 reassembly")
Signed-off-by: Li Han <han.li1@zte.com.cn>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
lib/librte_ip_frag/ip_frag_internal.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/librte_ip_frag/ip_frag_internal.c b/lib/librte_ip_frag/ip_frag_internal.c
index 7397aa69a..2560c7713 100644
--- a/lib/librte_ip_frag/ip_frag_internal.c
+++ b/lib/librte_ip_frag/ip_frag_internal.c
@@ -152,7 +152,7 @@ ip_frag_process(struct ip_frag_pkt *fp, struct rte_ip_frag_death_row *dr,
fp->frags[IP_LAST_FRAG_IDX].len);
else
IP_FRAG_LOG(DEBUG, "%s:%d invalid fragmented packet:\n"
- "ipv4_frag_pkt: %p, key: <" IPv6_KEY_BYTES_FMT ", %#x>, "
+ "ipv6_frag_pkt: %p, key: <" IPv6_KEY_BYTES_FMT ", %#x>, "
"total_size: %u, frag_size: %u, last_idx: %u\n"
"first fragment: ofs: %u, len: %u\n"
"last fragment: ofs: %u, len: %u\n\n",
@@ -210,7 +210,7 @@ ip_frag_process(struct ip_frag_pkt *fp, struct rte_ip_frag_death_row *dr,
fp->frags[IP_LAST_FRAG_IDX].len);
else
IP_FRAG_LOG(DEBUG, "%s:%d invalid fragmented packet:\n"
- "ipv4_frag_pkt: %p, key: <" IPv6_KEY_BYTES_FMT ", %#x>, "
+ "ipv6_frag_pkt: %p, key: <" IPv6_KEY_BYTES_FMT ", %#x>, "
"total_size: %u, frag_size: %u, last_idx: %u\n"
"first fragment: ofs: %u, len: %u\n"
"last fragment: ofs: %u, len: %u\n\n",
@@ -331,7 +331,7 @@ ip_frag_lookup(struct rte_ip_frag_tbl *tbl,
if (p1->key.key_len == IPV4_KEYLEN)
IP_FRAG_LOG(DEBUG, "%s:%d:\n"
"tbl: %p, max_entries: %u, use_entries: %u\n"
- "ipv6_frag_pkt line0: %p, index: %u from %u\n"
+ "ipv4_frag_pkt line0: %p, index: %u from %u\n"
"key: <%" PRIx64 ", %#x>, start: %" PRIu64 "\n",
__func__, __LINE__,
tbl, tbl->max_entries, tbl->use_entries,
@@ -357,7 +357,7 @@ ip_frag_lookup(struct rte_ip_frag_tbl *tbl,
if (p2->key.key_len == IPV4_KEYLEN)
IP_FRAG_LOG(DEBUG, "%s:%d:\n"
"tbl: %p, max_entries: %u, use_entries: %u\n"
- "ipv6_frag_pkt line1: %p, index: %u from %u\n"
+ "ipv4_frag_pkt line1: %p, index: %u from %u\n"
"key: <%" PRIx64 ", %#x>, start: %" PRIu64 "\n",
__func__, __LINE__,
tbl, tbl->max_entries, tbl->use_entries,
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'vhost: fix dead lock on closing in server mode' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (38 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'ip_frag: fix some debug logs' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'vhost: fix typo in comment' " luca.boccassi
` (30 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Tonghao Zhang; +Cc: Maxime Coquelin, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 7a4840237ebeb339845f14bfb2d37859fc9ffcf0 Mon Sep 17 00:00:00 2001
From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Date: Fri, 27 Apr 2018 08:19:43 -0700
Subject: [PATCH] vhost: fix dead lock on closing in server mode
[ upstream commit 8b4b949144b80cc7312bbc189d38a3feaf2c74e5 ]
When qemu close the unix socket fd of the vhostuser as a
server, and then immediately delete the vhostuser port on
openvswitch. There will be a deadlock.
A thread (fdset event thread): B thread:
1. fdset_event_dispatch rte_vhost_driver_unregister
2. set the fd busy to 1. lock vsocket->conn_mutex
3. vhost_user_read_cb fdset_del waits busy changed to 0.
4. vhost peer closed, remove the
conn from vsocket->conn_list:
lock vsocket->conn_mutex
5. set the fd busy to 0
Fixes: 65388b43f592 ("vhost: fix fd leaks for vhost-user server mode")
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
lib/librte_vhost/fd_man.c | 32 ++++++++++++++++++++++++++++++++
lib/librte_vhost/fd_man.h | 1 +
lib/librte_vhost/socket.c | 14 +++++++++++++-
3 files changed, 46 insertions(+), 1 deletion(-)
diff --git a/lib/librte_vhost/fd_man.c b/lib/librte_vhost/fd_man.c
index 181711c2a..7b209d274 100644
--- a/lib/librte_vhost/fd_man.c
+++ b/lib/librte_vhost/fd_man.c
@@ -171,6 +171,38 @@ fdset_del(struct fdset *pfdset, int fd)
return dat;
}
+/**
+ * Unregister the fd from the fdset.
+ *
+ * If parameters are invalid, return directly -2.
+ * And check whether fd is busy, if yes, return -1.
+ * Otherwise, try to delete the fd from fdset and
+ * return true.
+ */
+int
+fdset_try_del(struct fdset *pfdset, int fd)
+{
+ int i;
+
+ if (pfdset == NULL || fd == -1)
+ return -2;
+
+ pthread_mutex_lock(&pfdset->fd_mutex);
+ i = fdset_find_fd(pfdset, fd);
+ if (i != -1 && pfdset->fd[i].busy) {
+ pthread_mutex_unlock(&pfdset->fd_mutex);
+ return -1;
+ }
+
+ if (i != -1) {
+ pfdset->fd[i].fd = -1;
+ pfdset->fd[i].rcb = pfdset->fd[i].wcb = NULL;
+ pfdset->fd[i].dat = NULL;
+ }
+
+ pthread_mutex_unlock(&pfdset->fd_mutex);
+ return 0;
+}
/**
* This functions runs in infinite blocking loop until there is no fd in
diff --git a/lib/librte_vhost/fd_man.h b/lib/librte_vhost/fd_man.h
index 3a9276c3c..57cf9ec4b 100644
--- a/lib/librte_vhost/fd_man.h
+++ b/lib/librte_vhost/fd_man.h
@@ -34,6 +34,7 @@ int fdset_add(struct fdset *pfdset, int fd,
fd_cb rcb, fd_cb wcb, void *dat);
void *fdset_del(struct fdset *pfdset, int fd);
+int fdset_try_del(struct fdset *pfdset, int fd);
void *fdset_event_dispatch(void *arg);
diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c
index 8fd47a4d8..5aa482fd4 100644
--- a/lib/librte_vhost/socket.c
+++ b/lib/librte_vhost/socket.c
@@ -756,13 +756,25 @@ rte_vhost_driver_unregister(const char *path)
vhost_user_remove_reconnect(vsocket);
}
+again:
pthread_mutex_lock(&vsocket->conn_mutex);
for (conn = TAILQ_FIRST(&vsocket->conn_list);
conn != NULL;
conn = next) {
next = TAILQ_NEXT(conn, next);
- fdset_del(&vhost_user.fdset, conn->connfd);
+ /*
+ * If r/wcb is executing, release the
+ * conn_mutex lock, and try again since
+ * the r/wcb may use the conn_mutex lock.
+ */
+ if (fdset_try_del(&vhost_user.fdset,
+ conn->connfd) == -1) {
+ pthread_mutex_unlock(
+ &vsocket->conn_mutex);
+ goto again;
+ }
+
RTE_LOG(INFO, VHOST_CONFIG,
"free connfd = %d for device '%s'\n",
conn->connfd, path);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'vhost: fix typo in comment' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (39 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'vhost: fix dead lock on closing in server mode' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'net/vhost: initialise device as inactive' " luca.boccassi
` (29 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Tonghao Zhang; +Cc: Maxime Coquelin, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From c7ba404a135d9668851a24a99db494c1ca31d422 Mon Sep 17 00:00:00 2001
From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Date: Fri, 27 Apr 2018 08:19:45 -0700
Subject: [PATCH] vhost: fix typo in comment
[ upstream commit bfbf0143d1002efae3d30986ad766de51f838b74 ]
Fixes: 3670686ab99f ("vhost: fix race for connection fd")
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
lib/librte_vhost/fd_man.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_vhost/fd_man.c b/lib/librte_vhost/fd_man.c
index 7b209d274..805c46c89 100644
--- a/lib/librte_vhost/fd_man.c
+++ b/lib/librte_vhost/fd_man.c
@@ -290,7 +290,7 @@ fdset_event_dispatch(void *arg)
* because the fd is closed in the cb,
* the old fd val could be reused by when creates new
* listen fd in another thread, we couldn't call
- * fd_set_del.
+ * fdset_del.
*/
if (remove1 || remove2) {
pfdentry->fd = -1;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/vhost: initialise device as inactive' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (40 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'vhost: fix typo in comment' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'net/virtio-user: fix hugepage files enumeration' " luca.boccassi
` (28 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Ciara Loftus; +Cc: Maxime Coquelin, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 98615efc2819b0cc56f8ab41a810de402515288e Mon Sep 17 00:00:00 2001
From: Ciara Loftus <ciara.loftus@intel.com>
Date: Thu, 3 May 2018 14:17:03 +0100
Subject: [PATCH] net/vhost: initialise device as inactive
[ upstream commit aee6c97f006cea7b1c791b21b222442437ee5403 ]
rte_eth_vhost_get_vid_from_port_id returns a value of 0 if
called before the first call to the new_device callback.
A vid value >=0 suggests the device is active which is not
the case in this instance. Initialise vid to a negative
value to prevent this.
Fixes: ee584e9710b9 ("vhost: add driver on top of the library")
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
drivers/net/vhost/rte_eth_vhost.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index e392d719b..1a1d532e7 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -117,7 +117,7 @@ struct pmd_internal {
char *dev_name;
char *iface_name;
uint16_t max_queues;
- uint16_t vid;
+ int vid;
rte_atomic32_t started;
};
@@ -1105,6 +1105,7 @@ eth_dev_vhost_create(struct rte_vdev_device *dev, char *iface_name,
data->nb_rx_queues = queues;
data->nb_tx_queues = queues;
internal->max_queues = queues;
+ internal->vid = -1;
data->dev_link = pmd_link;
data->mac_addrs = eth_addr;
data->dev_flags = RTE_ETH_DEV_INTR_LSC;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/virtio-user: fix hugepage files enumeration' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (41 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'net/vhost: initialise device as inactive' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'net/mlx4: fix UDP flow rule limitation enforcement' " luca.boccassi
` (27 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Jianfeng Tan; +Cc: Maxime Coquelin, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From becbf25bf99968d3153475ea339008334185fb83 Mon Sep 17 00:00:00 2001
From: Jianfeng Tan <jianfeng.tan@intel.com>
Date: Thu, 26 Apr 2018 15:34:07 +0000
Subject: [PATCH] net/virtio-user: fix hugepage files enumeration
[ upstream commit 169a9da64a859e1782e49886e7214982304a580f ]
After the commit 2a04139f66b4 ("eal: add single file segments option"),
one hugepage file could contain multiple hugepages which are further
mapped to different memory regions.
Original enumeration implementation cannot handle this situation.
This patch filters out the duplicated files; and adjust the size after
the enumeration.
Fixes: 6a84c37e3975 ("net/virtio-user: add vhost-user adapter layer")
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
.../howto/virtio_user_for_container_networking.rst | 3 ++-
drivers/net/virtio/virtio_user/vhost_user.c | 28 ++++++++++++++++++++--
2 files changed, 28 insertions(+), 3 deletions(-)
diff --git a/doc/guides/howto/virtio_user_for_container_networking.rst b/doc/guides/howto/virtio_user_for_container_networking.rst
index aa68b5315..476ce3a63 100644
--- a/doc/guides/howto/virtio_user_for_container_networking.rst
+++ b/doc/guides/howto/virtio_user_for_container_networking.rst
@@ -109,7 +109,8 @@ We have below limitations in this solution:
* Cannot work with --no-huge option. Currently, DPDK uses anonymous mapping
under this option which cannot be reopened to share with vhost backend.
* Cannot work when there are more than VHOST_MEMORY_MAX_NREGIONS(8) hugepages.
- In another word, do not use 2MB hugepage so far.
+ If you have more regions (especially when 2MB hugepages are used), the option,
+ --single-file-segments, can help to reduce the number of shared files.
* Applications should not use file name like HUGEFILE_FMT ("%smap_%d"). That
will bring confusion when sharing hugepage files with backend by name.
* Root privilege is a must. DPDK resolves physical addresses of hugepages
diff --git a/drivers/net/virtio/virtio_user/vhost_user.c b/drivers/net/virtio/virtio_user/vhost_user.c
index 91c6449bb..163bf93ea 100644
--- a/drivers/net/virtio/virtio_user/vhost_user.c
+++ b/drivers/net/virtio/virtio_user/vhost_user.c
@@ -138,12 +138,13 @@ struct hugepage_file_info {
static int
get_hugepage_file_info(struct hugepage_file_info huges[], int max)
{
- int idx;
+ int idx, k, exist;
FILE *f;
char buf[BUFSIZ], *tmp, *tail;
char *str_underline, *str_start;
int huge_index;
uint64_t v_start, v_end;
+ struct stat stats;
f = fopen("/proc/self/maps", "r");
if (!f) {
@@ -183,16 +184,39 @@ get_hugepage_file_info(struct hugepage_file_info huges[], int max)
if (sscanf(str_start, "map_%d", &huge_index) != 1)
continue;
+ /* skip duplicated file which is mapped to different regions */
+ for (k = 0, exist = -1; k < idx; ++k) {
+ if (!strcmp(huges[k].path, tmp)) {
+ exist = k;
+ break;
+ }
+ }
+ if (exist >= 0)
+ continue;
+
if (idx >= max) {
PMD_DRV_LOG(ERR, "Exceed maximum of %d", max);
goto error;
}
+
huges[idx].addr = v_start;
- huges[idx].size = v_end - v_start;
+ huges[idx].size = v_end - v_start; /* To be corrected later */
snprintf(huges[idx].path, PATH_MAX, "%s", tmp);
idx++;
}
+ /* correct the size for files who have many regions */
+ for (k = 0; k < idx; ++k) {
+ if (stat(huges[k].path, &stats) < 0) {
+ PMD_DRV_LOG(ERR, "Failed to stat %s, %s\n",
+ huges[k].path, strerror(errno));
+ continue;
+ }
+ huges[k].size = stats.st_size;
+ PMD_DRV_LOG(INFO, "file %s, size %zx\n",
+ huges[k].path, huges[k].size);
+ }
+
fclose(f);
return idx;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/mlx4: fix UDP flow rule limitation enforcement' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (42 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'net/virtio-user: fix hugepage files enumeration' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'net/bnxt: set MTU in dev config for jumbo packets' " luca.boccassi
` (26 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Adrien Mazarguil; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 7a15b4bbf85842f4e0a68d89b290a89317591d4e Mon Sep 17 00:00:00 2001
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Date: Fri, 4 May 2018 17:17:44 +0200
Subject: [PATCH] net/mlx4: fix UDP flow rule limitation enforcement
[ upstream commit bf959ec58b5d9127f187e98de6d2d0976c111360 ]
For some unknown reason, priorities do not have any effect on flow rules
that happen to match UDP destination ports. Those are always matched first
regardless.
This patch is a workaround that enforces this limitation at the PMD level;
such flow rules can only be created at the highest priority level for
correctness.
Fixes: a5171594fc3b ("net/mlx4: expose support for flow rule priorities")
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
drivers/net/mlx4/mlx4_flow.c | 9 +++++++++
drivers/net/mlx4/mlx4_flow.h | 1 +
2 files changed, 10 insertions(+)
diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c
index d7a02e90c..4b22b0634 100644
--- a/drivers/net/mlx4/mlx4_flow.c
+++ b/drivers/net/mlx4/mlx4_flow.c
@@ -357,6 +357,9 @@ error:
* Additional mlx4-specific constraints on supported fields:
*
* - No support for partial masks.
+ * - Due to HW/FW limitation, flow rule priority is not taken into account
+ * when matching UDP destination ports, doing is therefore only supported
+ * at the highest priority level (0).
*
* @param[in, out] flow
* Flow rule handle to update.
@@ -388,6 +391,11 @@ mlx4_flow_merge_udp(struct rte_flow *flow,
msg = "mlx4 does not support matching partial UDP fields";
goto error;
}
+ if (mask && mask->hdr.dst_port && flow->priority) {
+ msg = "combining UDP destination port matching with a nonzero"
+ " priority level is not supported";
+ goto error;
+ }
if (!flow->ibv_attr)
return 0;
++flow->ibv_attr->num_of_specs;
@@ -652,6 +660,7 @@ mlx4_flow_prepare(struct priv *priv,
NULL, "only ingress is supported");
fill:
proc = mlx4_flow_proc_item_list;
+ flow->priority = attr->priority;
/* Go over pattern. */
for (item = pattern; item->type; ++item) {
const struct mlx4_flow_proc_item *next = NULL;
diff --git a/drivers/net/mlx4/mlx4_flow.h b/drivers/net/mlx4/mlx4_flow.h
index 00188a65c..4eba34868 100644
--- a/drivers/net/mlx4/mlx4_flow.h
+++ b/drivers/net/mlx4/mlx4_flow.h
@@ -42,6 +42,7 @@ struct rte_flow {
uint32_t promisc:1; /**< This rule matches everything. */
uint32_t allmulti:1; /**< This rule matches all multicast traffic. */
uint32_t drop:1; /**< This rule drops packets. */
+ uint32_t priority; /**< Flow rule priority. */
struct mlx4_rss *rss; /**< Rx target. */
};
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bnxt: set MTU in dev config for jumbo packets' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (43 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'net/mlx4: fix UDP flow rule limitation enforcement' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'net/bnxt: fix MTU calculation' " luca.boccassi
` (25 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Qingmin Liu
Cc: Scott Branden, Jay Ding, Randy Schacher, Ajit Khaparde, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 84678b89f8b36d26005d76d821e6ab14c98c52b9 Mon Sep 17 00:00:00 2001
From: Qingmin Liu <qingmin.liu@broadcom.com>
Date: Mon, 30 Apr 2018 18:06:10 -0700
Subject: [PATCH] net/bnxt: set MTU in dev config for jumbo packets
[ upstream commit a1a716c1c645e1bfbc30f9ef6ba68473646bcf4e ]
MTU setting does not take effect after rte_eth_dev_configure
is called with jumbo enable unless it is configured using the
set_mtu dev_op.
Fixes: daef48efe5e5 ("net/bnxt: support set MTU")
Signed-off-by: Qingmin Liu <qingmin.liu@broadcom.com>
Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Reviewed-by: Jay Ding <jay.ding@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index de8824641..22de7f9f3 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -151,6 +151,7 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
static int bnxt_vlan_offload_set_op(struct rte_eth_dev *dev, int mask);
static void bnxt_print_link_info(struct rte_eth_dev *eth_dev);
+static int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu);
/***********************/
@@ -540,10 +541,12 @@ static int bnxt_dev_configure_op(struct rte_eth_dev *eth_dev)
bp->rx_cp_nr_rings = bp->rx_nr_rings;
bp->tx_cp_nr_rings = bp->tx_nr_rings;
- if (eth_dev->data->dev_conf.rxmode.jumbo_frame)
+ if (eth_dev->data->dev_conf.rxmode.jumbo_frame) {
eth_dev->data->mtu =
eth_dev->data->dev_conf.rxmode.max_rx_pkt_len -
ETHER_HDR_LEN - ETHER_CRC_LEN - VLAN_TAG_SIZE;
+ bnxt_mtu_set_op(eth_dev, eth_dev->data->mtu);
+ }
return 0;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bnxt: fix MTU calculation' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (44 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'net/bnxt: set MTU in dev config for jumbo packets' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:46 ` [dpdk-stable] patch 'net/bnxt: return error in stats if init is not complete' " luca.boccassi
` (24 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Ajit Khaparde
Cc: Qingmin Liu, Scott Branden, Jay Ding, Randy Schacher, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From b73c0d87dcce8958321a82092fa0aac47f61dc0f Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Mon, 30 Apr 2018 18:06:11 -0700
Subject: [PATCH] net/bnxt: fix MTU calculation
[ upstream commit 3d911af8607b2c4a546f118cde89e04b58671caf ]
We were not considering the case of nested VLANs while
calculating MTU. This patch takes care of the same.
Fixes: daef48efe5e5 ("net/bnxt: support set MTU")
Signed-off-by: Qingmin Liu <qingmin.liu@broadcom.com>
Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Reviewed-by: Jay Ding <jay.ding@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt.h | 1 +
drivers/net/bnxt/bnxt_ethdev.c | 3 ++-
drivers/net/bnxt/bnxt_hwrm.c | 9 ++++++---
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index b5a0badfc..81637e370 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -51,6 +51,7 @@
#define BNXT_MAX_MTU 9500
#define VLAN_TAG_SIZE 4
#define BNXT_MAX_LED 4
+#define BNXT_NUM_VLANS 2
struct bnxt_led_info {
uint8_t led_id;
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 22de7f9f3..e5486b58a 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -544,7 +544,8 @@ static int bnxt_dev_configure_op(struct rte_eth_dev *eth_dev)
if (eth_dev->data->dev_conf.rxmode.jumbo_frame) {
eth_dev->data->mtu =
eth_dev->data->dev_conf.rxmode.max_rx_pkt_len -
- ETHER_HDR_LEN - ETHER_CRC_LEN - VLAN_TAG_SIZE;
+ ETHER_HDR_LEN - ETHER_CRC_LEN - VLAN_TAG_SIZE *
+ BNXT_NUM_VLANS;
bnxt_mtu_set_op(eth_dev, eth_dev->data->mtu);
}
return 0;
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 3f73a9001..460523624 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -2366,7 +2366,8 @@ static int bnxt_hwrm_pf_func_cfg(struct bnxt *bp, int tx_rings)
req.flags = rte_cpu_to_le_32(bp->pf.func_cfg_flags);
req.mtu = rte_cpu_to_le_16(BNXT_MAX_MTU);
req.mru = rte_cpu_to_le_16(bp->eth_dev->data->mtu + ETHER_HDR_LEN +
- ETHER_CRC_LEN + VLAN_TAG_SIZE);
+ ETHER_CRC_LEN + VLAN_TAG_SIZE *
+ BNXT_NUM_VLANS);
req.num_rsscos_ctxs = rte_cpu_to_le_16(bp->max_rsscos_ctx);
req.num_stat_ctxs = rte_cpu_to_le_16(bp->max_stat_ctx);
req.num_cmpl_rings = rte_cpu_to_le_16(bp->max_cp_rings);
@@ -2403,9 +2404,11 @@ static void populate_vf_func_cfg_req(struct bnxt *bp,
HWRM_FUNC_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS);
req->mtu = rte_cpu_to_le_16(bp->eth_dev->data->mtu + ETHER_HDR_LEN +
- ETHER_CRC_LEN + VLAN_TAG_SIZE);
+ ETHER_CRC_LEN + VLAN_TAG_SIZE *
+ BNXT_NUM_VLANS);
req->mru = rte_cpu_to_le_16(bp->eth_dev->data->mtu + ETHER_HDR_LEN +
- ETHER_CRC_LEN + VLAN_TAG_SIZE);
+ ETHER_CRC_LEN + VLAN_TAG_SIZE *
+ BNXT_NUM_VLANS);
req->num_rsscos_ctxs = rte_cpu_to_le_16(bp->max_rsscos_ctx /
(num_vfs + 1));
req->num_stat_ctxs = rte_cpu_to_le_16(bp->max_stat_ctx / (num_vfs + 1));
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bnxt: return error in stats if init is not complete' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (45 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'net/bnxt: fix MTU calculation' " luca.boccassi
@ 2018-05-15 13:46 ` luca.boccassi
2018-05-15 13:47 ` [dpdk-stable] patch 'net/bnxt: fix to reset status of initialization' " luca.boccassi
` (23 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:46 UTC (permalink / raw)
To: Jay Ding; +Cc: Scott Branden, Ajit Khaparde, Randy Schacher, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From fb8acb75adc247673ddb21deb6a676cce08ead4c Mon Sep 17 00:00:00 2001
From: Jay Ding <jay.ding@broadcom.com>
Date: Mon, 30 Apr 2018 18:06:12 -0700
Subject: [PATCH] net/bnxt: return error in stats if init is not complete
[ upstream commit 327cf9fd1001f9bd4df1159084f091ca384d804d ]
return error if init is not complete before accessing stats.
Fixes: ed2ced6fe927 ("net/bnxt: check initialization before accessing stats")
Signed-off-by: Jay Ding <jay.ding@broadcom.com>
Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_stats.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/bnxt/bnxt_stats.c b/drivers/net/bnxt/bnxt_stats.c
index bd93cc834..00bbef65f 100644
--- a/drivers/net/bnxt/bnxt_stats.c
+++ b/drivers/net/bnxt/bnxt_stats.c
@@ -238,7 +238,7 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
memset(bnxt_stats, 0, sizeof(*bnxt_stats));
if (!(bp->flags & BNXT_FLAG_INIT_DONE)) {
PMD_DRV_LOG(ERR, "Device Initialization not complete!\n");
- return 0;
+ return -1;
}
for (i = 0; i < bp->rx_cp_nr_rings; i++) {
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bnxt: fix to reset status of initialization' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (46 preceding siblings ...)
2018-05-15 13:46 ` [dpdk-stable] patch 'net/bnxt: return error in stats if init is not complete' " luca.boccassi
@ 2018-05-15 13:47 ` luca.boccassi
2018-05-15 13:47 ` [dpdk-stable] patch 'net/bnxt: fix Rx mbuf and agg ring leak in dev stop' " luca.boccassi
` (22 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:47 UTC (permalink / raw)
To: Ajit Khaparde; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From a9d3ec1ea28a948b5a5ece2bc32a01bcd65581ce Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Mon, 30 Apr 2018 18:06:13 -0700
Subject: [PATCH] net/bnxt: fix to reset status of initialization
[ upstream commit e40981101925a2b4403c8760658e6e7b36c35cfa ]
clear flag on stop at proper location to avoid race conditions.
Fixes: ed2ced6fe927 ("net/bnxt: check initialization before accessing stats")
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index e5486b58a..90eb787f4 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -639,13 +639,13 @@ static void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
{
struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private;
+ bp->flags &= ~BNXT_FLAG_INIT_DONE;
if (bp->eth_dev->data->dev_started) {
/* TBD: STOP HW queues DMA */
eth_dev->data->dev_link.link_status = 0;
}
bnxt_set_hwrm_link_config(bp, false);
bnxt_hwrm_port_clr_stats(bp);
- bp->flags &= ~BNXT_FLAG_INIT_DONE;
bnxt_shutdown_nic(bp);
bp->dev_stopped = 1;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bnxt: fix Rx mbuf and agg ring leak in dev stop' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (47 preceding siblings ...)
2018-05-15 13:47 ` [dpdk-stable] patch 'net/bnxt: fix to reset status of initialization' " luca.boccassi
@ 2018-05-15 13:47 ` luca.boccassi
2018-05-15 13:47 ` [dpdk-stable] patch 'net/bnxt: fix usage of vnic id' " luca.boccassi
` (21 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:47 UTC (permalink / raw)
To: Xiaoxin Peng
Cc: Jay Ding, Scott Branden, Ray Jui, Randy Schacher, Ajit Khaparde,
dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From de3fae4aaf8d47dce4bad353a1910bcfc402b038 Mon Sep 17 00:00:00 2001
From: Xiaoxin Peng <xiaoxin.peng@broadcom.com>
Date: Mon, 30 Apr 2018 18:06:14 -0700
Subject: [PATCH] net/bnxt: fix Rx mbuf and agg ring leak in dev stop
[ upstream commit 3f07f2da6ca91febb67816ce8818cbdec4976413 ]
In the start/stop_op operation, mbufs allocated for rings were not freed
1) add bnxt_free_tx_mbuf/bnxt_free_rx_mbuf in bnxt_dev_stop_op to free MBUF
before freeing the rings.
2) MBUF allocation and free routines were not in sync. Allocation uses the
ring->ring_size including any rounded up and multiple factors while the
free routine uses the requested queue size.
Fixes: c09f57b49c13 ("net/bnxt: add start/stop/link update operations")
Signed-off-by: Jay Ding <jay.ding@broadcom.com>
Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Reviewed-by: Ray Jui <ray.jui@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Signed-off-by: Xiaoxin Peng <xiaoxin.peng@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 4 ++--
drivers/net/bnxt/bnxt_rxq.c | 6 ++++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 90eb787f4..a74afc831 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -646,6 +646,8 @@ static void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
}
bnxt_set_hwrm_link_config(bp, false);
bnxt_hwrm_port_clr_stats(bp);
+ bnxt_free_tx_mbufs(bp);
+ bnxt_free_rx_mbufs(bp);
bnxt_shutdown_nic(bp);
bp->dev_stopped = 1;
}
@@ -657,8 +659,6 @@ static void bnxt_dev_close_op(struct rte_eth_dev *eth_dev)
if (bp->dev_stopped == 0)
bnxt_dev_stop_op(eth_dev);
- bnxt_free_tx_mbufs(bp);
- bnxt_free_rx_mbufs(bp);
bnxt_free_mem(bp);
if (eth_dev->data->mac_addrs != NULL) {
rte_free(eth_dev->data->mac_addrs);
diff --git a/drivers/net/bnxt/bnxt_rxq.c b/drivers/net/bnxt/bnxt_rxq.c
index 33cca9263..e5749b974 100644
--- a/drivers/net/bnxt/bnxt_rxq.c
+++ b/drivers/net/bnxt/bnxt_rxq.c
@@ -237,7 +237,8 @@ static void bnxt_rx_queue_release_mbufs(struct bnxt_rx_queue *rxq)
if (rxq) {
sw_ring = rxq->rx_ring->rx_buf_ring;
if (sw_ring) {
- for (i = 0; i < rxq->nb_rx_desc; i++) {
+ for (i = 0;
+ i < rxq->rx_ring->rx_ring_struct->ring_size; i++) {
if (sw_ring[i].mbuf) {
rte_pktmbuf_free_seg(sw_ring[i].mbuf);
sw_ring[i].mbuf = NULL;
@@ -247,7 +248,8 @@ static void bnxt_rx_queue_release_mbufs(struct bnxt_rx_queue *rxq)
/* Free up mbufs in Agg ring */
sw_ring = rxq->rx_ring->ag_buf_ring;
if (sw_ring) {
- for (i = 0; i < rxq->nb_rx_desc; i++) {
+ for (i = 0;
+ i < rxq->rx_ring->ag_ring_struct->ring_size; i++) {
if (sw_ring[i].mbuf) {
rte_pktmbuf_free_seg(sw_ring[i].mbuf);
sw_ring[i].mbuf = NULL;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bnxt: fix usage of vnic id' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (48 preceding siblings ...)
2018-05-15 13:47 ` [dpdk-stable] patch 'net/bnxt: fix Rx mbuf and agg ring leak in dev stop' " luca.boccassi
@ 2018-05-15 13:47 ` luca.boccassi
2018-05-15 13:47 ` [dpdk-stable] patch 'net/mlx5: fix double free on error handling' " luca.boccassi
` (20 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:47 UTC (permalink / raw)
To: Ajit Khaparde
Cc: Scott Branden, Michael Wildt, Randy Schacher, Ray Jui, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 9a7a05a643ee87545629a6fc2cb6233ab9fde289 Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Mon, 30 Apr 2018 18:06:15 -0700
Subject: [PATCH] net/bnxt: fix usage of vnic id
[ upstream commit a6f4bb2a1510a633040ea1f90ba576cf816bd2b7 ]
VNIC ID returned by the FW is a 16-bit field.
We are incorrectly using it as a 32-bit value in few places.
This patch corrects that.
Fixes: daef48efe5e5 ("net/bnxt: support set MTU")
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Reviewed-by: Michael Wildt <michael.wildt@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Ray Jui <ray.jui@broadcom.com>
---
drivers/net/bnxt/bnxt_hwrm.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 460523624..ea40e4961 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -1218,7 +1218,7 @@ static int bnxt_hwrm_vnic_plcmodes_qcfg(struct bnxt *bp,
HWRM_PREP(req, VNIC_PLCMODES_QCFG);
- req.vnic_id = rte_cpu_to_le_32(vnic->fw_vnic_id);
+ req.vnic_id = rte_cpu_to_le_16(vnic->fw_vnic_id);
rc = bnxt_hwrm_send_message(bp, &req, sizeof(req));
@@ -1246,7 +1246,7 @@ static int bnxt_hwrm_vnic_plcmodes_cfg(struct bnxt *bp,
HWRM_PREP(req, VNIC_PLCMODES_CFG);
- req.vnic_id = rte_cpu_to_le_32(vnic->fw_vnic_id);
+ req.vnic_id = rte_cpu_to_le_16(vnic->fw_vnic_id);
req.flags = rte_cpu_to_le_32(pmode->flags);
req.jumbo_thresh = rte_cpu_to_le_16(pmode->jumbo_thresh);
req.hds_offset = rte_cpu_to_le_16(pmode->hds_offset);
@@ -1490,7 +1490,7 @@ int bnxt_hwrm_vnic_plcmode_cfg(struct bnxt *bp,
size -= RTE_PKTMBUF_HEADROOM;
req.jumbo_thresh = rte_cpu_to_le_16(size);
- req.vnic_id = rte_cpu_to_le_32(vnic->fw_vnic_id);
+ req.vnic_id = rte_cpu_to_le_16(vnic->fw_vnic_id);
rc = bnxt_hwrm_send_message(bp, &req, sizeof(req));
@@ -1526,7 +1526,7 @@ int bnxt_hwrm_vnic_tpa_cfg(struct bnxt *bp,
rte_cpu_to_le_16(HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX);
req.min_agg_len = rte_cpu_to_le_32(512);
}
- req.vnic_id = rte_cpu_to_le_32(vnic->fw_vnic_id);
+ req.vnic_id = rte_cpu_to_le_16(vnic->fw_vnic_id);
rc = bnxt_hwrm_send_message(bp, &req, sizeof(req));
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/mlx5: fix double free on error handling' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (49 preceding siblings ...)
2018-05-15 13:47 ` [dpdk-stable] patch 'net/bnxt: fix usage of vnic id' " luca.boccassi
@ 2018-05-15 13:47 ` luca.boccassi
2018-05-15 13:47 ` [dpdk-stable] patch 'net/mlx5: fix resource leak in case of error' " luca.boccassi
` (19 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:47 UTC (permalink / raw)
To: Raslan Darawsheh; +Cc: Yongseok Koh, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 2f982d9a3f8a4431192f57ce2df12c0a5f46d010 Mon Sep 17 00:00:00 2001
From: Raslan Darawsheh <rasland@mellanox.com>
Date: Tue, 8 May 2018 12:11:26 +0300
Subject: [PATCH] net/mlx5: fix double free on error handling
[ upstream commit e9f4166014cb7abf8c74b913ff046487d0e7bea2 ]
When attr_ctx is NULL it will attempt to free the list of devices twice.
Avoid double freeing the list by directly going to error handling.
Fixes: 771fa900b73a ("mlx5: introduce new driver for Mellanox ConnectX-4 adapters")
Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
---
drivers/net/mlx5/mlx5.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index b9e9fa9f1..9cd4243e4 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -636,16 +636,16 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
break;
}
if (attr_ctx == NULL) {
- mlx5_glue->free_device_list(list);
switch (err) {
case 0:
ERROR("cannot access device, is mlx5_ib loaded?");
err = ENODEV;
- goto error;
+ break;
case EINVAL:
ERROR("cannot use device, are drivers up to date?");
- goto error;
+ break;
}
+ goto error;
}
ibv_dev = list[i];
DEBUG("device opened");
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/mlx5: fix resource leak in case of error' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (50 preceding siblings ...)
2018-05-15 13:47 ` [dpdk-stable] patch 'net/mlx5: fix double free on error handling' " luca.boccassi
@ 2018-05-15 13:47 ` luca.boccassi
2018-05-15 13:47 ` [dpdk-stable] patch 'net/mlx5: fix calculation of Tx TSO inline room size' " luca.boccassi
` (18 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:47 UTC (permalink / raw)
To: Raslan Darawsheh; +Cc: Yongseok Koh, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 84b009cc2186a93adff2f5d984c4ffcf4de066fa Mon Sep 17 00:00:00 2001
From: Raslan Darawsheh <rasland@mellanox.com>
Date: Tue, 8 May 2018 12:11:27 +0300
Subject: [PATCH] net/mlx5: fix resource leak in case of error
[ upstream commit 690de2850b26466ad5325fde3e1aff040e3868f8 ]
If something went wrong in mlx5_pci_prob the allocated eth dev
will cause a memory leak.
This commit release the eth dev that was previously allocated.
Fixes: 771fa900b73a ("mlx5: introduce new driver for Mellanox ConnectX-4 adapters")
Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
---
drivers/net/mlx5/mlx5.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 9cd4243e4..81057f438 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -956,6 +956,8 @@ port_error:
claim_zero(mlx5_glue->dealloc_pd(pd));
if (ctx)
claim_zero(mlx5_glue->close_device(ctx));
+ if (eth_dev && rte_eal_process_type() == RTE_PROC_PRIMARY)
+ rte_eth_dev_release_port(eth_dev);
break;
}
/*
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/mlx5: fix calculation of Tx TSO inline room size' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (51 preceding siblings ...)
2018-05-15 13:47 ` [dpdk-stable] patch 'net/mlx5: fix resource leak in case of error' " luca.boccassi
@ 2018-05-15 13:47 ` luca.boccassi
2018-05-15 13:47 ` [dpdk-stable] patch 'net/enic: set rte errno to positive value' " luca.boccassi
` (17 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:47 UTC (permalink / raw)
To: Yongseok Koh; +Cc: Shahaf Shuler, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 58c1ca6154da75d6a23f7c03bd236d866d6e7bdb Mon Sep 17 00:00:00 2001
From: Yongseok Koh <yskoh@mellanox.com>
Date: Tue, 8 May 2018 11:48:19 -0700
Subject: [PATCH] net/mlx5: fix calculation of Tx TSO inline room size
[ upstream commit 95d7e115be89f071d672d9cfd5c0eb1b23fce5fc ]
rdma-core doesn't add up max_tso_header size to max_inline_data size. The
library takes bigger value between the two.
Fixes: 43e9d9794cde ("net/mlx5: support upstream rdma-core")
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
---
drivers/net/mlx5/mlx5_txq.c | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index 9b96abef0..18892ff90 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -693,18 +693,6 @@ txq_set_params(struct mlx5_txq_ctrl *txq_ctrl)
inline_max_packet_sz) +
(RTE_CACHE_LINE_SIZE - 1)) /
RTE_CACHE_LINE_SIZE) * RTE_CACHE_LINE_SIZE;
- } else if (tso) {
- int inline_diff = txq_ctrl->txq.max_inline -
- max_tso_inline;
-
- /*
- * Adjust inline value as Verbs aggregates
- * tso_inline and txq_inline fields.
- */
- txq_ctrl->max_inline_data = inline_diff > 0 ?
- inline_diff *
- RTE_CACHE_LINE_SIZE :
- 0;
} else {
txq_ctrl->max_inline_data =
txq_ctrl->txq.max_inline * RTE_CACHE_LINE_SIZE;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/enic: set rte errno to positive value' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (52 preceding siblings ...)
2018-05-15 13:47 ` [dpdk-stable] patch 'net/mlx5: fix calculation of Tx TSO inline room size' " luca.boccassi
@ 2018-05-15 13:47 ` luca.boccassi
2018-05-15 13:47 ` [dpdk-stable] patch 'app/testpmd: fix empty list of RSS queues for flow' " luca.boccassi
` (16 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:47 UTC (permalink / raw)
To: John Daley; +Cc: Hyong Youb Kim, Aaron Conole, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 063de84af94a6f0f42613ccc90382e6f674d1918 Mon Sep 17 00:00:00 2001
From: John Daley <johndale@cisco.com>
Date: Thu, 3 May 2018 12:37:10 -0700
Subject: [PATCH] net/enic: set rte errno to positive value
[ upstream commit 579cc855af69099d52edd69b96c608254ad5f295 ]
Related to d9fff8a31, where rte_errno should always have positive
errno values.
Technically this is an ABI change since it fixes an error code
introduced in 18.02, but is minor and inconsequential.
Fixes: 1e81dbb5321b ("net/enic: add Tx prepare handler")
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
Reviewed-by: Aaron Conole <aconole@redhat.com>
---
drivers/net/enic/enic_rxtx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c
index 2fe5a3fa3..736c71d10 100644
--- a/drivers/net/enic/enic_rxtx.c
+++ b/drivers/net/enic/enic_rxtx.c
@@ -455,7 +455,7 @@ uint16_t enic_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
m = tx_pkts[i];
ol_flags = m->ol_flags;
if (ol_flags & ENIC_TX_OFFLOAD_NOTSUP_MASK) {
- rte_errno = -ENOTSUP;
+ rte_errno = ENOTSUP;
return i;
}
#ifdef RTE_LIBRTE_ETHDEV_DEBUG
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'app/testpmd: fix empty list of RSS queues for flow' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (53 preceding siblings ...)
2018-05-15 13:47 ` [dpdk-stable] patch 'net/enic: set rte errno to positive value' " luca.boccassi
@ 2018-05-15 13:47 ` luca.boccassi
2018-05-15 13:47 ` [dpdk-stable] patch 'net/dpaa: fix max push mode queue' " luca.boccassi
` (15 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:47 UTC (permalink / raw)
To: Adrien Mazarguil; +Cc: Ferruh Yigit, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From ad4bf119674101b58f4c5060d08b9a666687ac5a Mon Sep 17 00:00:00 2001
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Date: Thu, 3 May 2018 13:59:42 +0200
Subject: [PATCH] app/testpmd: fix empty list of RSS queues for flow
[ upstream commit 9278a4333ad021754c0822a7db18d574c5103209 ]
Since the commit referenced below, specifying a RSS action without any
queues (e.g. "actions rss queues end / end") does not override the default
set automatically generated by testpmd.
In short, one cannot instantiate a RSS action with 0 target queues anymore
in order to determine how PMDs react (hint: this is currently undocumented
so they may reject it, however ideally they should interpret it as a
default setting like for other fields where empty values stand for
"defaults".)
Fixes: d0ad8648b1c5 ("app/testpmd: fix RSS flow action configuration")
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
app/test-pmd/cmdline_flow.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index ac4b51a8a..105e245bf 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -2204,7 +2204,7 @@ parse_vc_action_rss_queue(struct context *ctx, const struct token *token,
i = ctx->objdata >> 16;
if (!strcmp_partial("end", str, len)) {
ctx->objdata &= 0xffff;
- return len;
+ goto end;
}
if (i >= ACTION_RSS_QUEUE_NUM)
return -1;
@@ -2225,6 +2225,7 @@ parse_vc_action_rss_queue(struct context *ctx, const struct token *token,
if (ctx->next_num == RTE_DIM(ctx->next))
return -1;
ctx->next[ctx->next_num++] = next;
+end:
if (!ctx->object)
return len;
action_rss_data = ctx->object;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/dpaa: fix max push mode queue' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (54 preceding siblings ...)
2018-05-15 13:47 ` [dpdk-stable] patch 'app/testpmd: fix empty list of RSS queues for flow' " luca.boccassi
@ 2018-05-15 13:47 ` luca.boccassi
2018-05-15 13:47 ` [dpdk-stable] patch 'net/failsafe: fix probe cleanup' " luca.boccassi
` (14 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:47 UTC (permalink / raw)
To: Shreyansh Jain; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 50ea26ff8284b21677e0e86a7a888840ff7a68fc Mon Sep 17 00:00:00 2001
From: Shreyansh Jain <shreyansh.jain@nxp.com>
Date: Wed, 9 May 2018 15:19:43 +0530
Subject: [PATCH] net/dpaa: fix max push mode queue
[ upstream commit 0b5deefbe61cc91e2bdddb26b1797000e4ee1f6a ]
Split default and max push mode queues to 4 and 8, respectively.
Fixes: 0c504f6950b6 ("net/dpaa: support push mode")
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
drivers/net/dpaa/dpaa_ethdev.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index 0828e0af6..7f841bd0c 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -47,12 +47,13 @@
/* Keep track of whether QMAN and BMAN have been globally initialized */
static int is_global_init;
-/* At present we only allow up to 4 push mode queues - as each of this queue
- * need dedicated portal and we are short of portals.
+/* At present we only allow up to 4 push mode queues as default - as each of
+ * this queue need dedicated portal and we are short of portals.
*/
-#define DPAA_MAX_PUSH_MODE_QUEUE 4
+#define DPAA_MAX_PUSH_MODE_QUEUE 8
+#define DPAA_DEFAULT_PUSH_MODE_QUEUE 4
-static int dpaa_push_mode_max_queue = DPAA_MAX_PUSH_MODE_QUEUE;
+static int dpaa_push_mode_max_queue = DPAA_DEFAULT_PUSH_MODE_QUEUE;
static int dpaa_push_queue_idx; /* Queue index which are in push mode*/
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/failsafe: fix probe cleanup' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (55 preceding siblings ...)
2018-05-15 13:47 ` [dpdk-stable] patch 'net/dpaa: fix max push mode queue' " luca.boccassi
@ 2018-05-15 13:47 ` luca.boccassi
2018-05-15 13:47 ` [dpdk-stable] patch 'net/i40e: fix link status update' " luca.boccassi
` (13 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:47 UTC (permalink / raw)
To: Raslan Darawsheh; +Cc: Matan Azrad, Gaetan Rivet, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From f811ccd32d16ef119bbc9d04e8861e6dd72552fc Mon Sep 17 00:00:00 2001
From: Raslan Darawsheh <rasland@mellanox.com>
Date: Wed, 9 May 2018 18:57:39 +0300
Subject: [PATCH] net/failsafe: fix probe cleanup
[ upstream commit 95e7a72f9decd1db38dfb754b485dd4ac6859def ]
The hot-plug alarm mechanism is responsible to practically execute both
plug in and out operations. It periodically tries to detect missed
sub-devices to be reconfigured and clean the resources of the removed
sub-devices.
The hot-plug alarm is started by the failsafe probe function, and it's
wrongly not stopped if failsafe instance got an error. for example
when starting failsafe with a MAC option, and giving it an invalid MAC
address this will lead to a NULL pointer for the dev private field. Then
when the hotplug alarm is called it will try to access this pointer,
which will lead to a segmentation fault.
Uninstall the hot-plug alarm in case of error in probe function.
Fixes: ebea83f8 ("net/failsafe: add plug-in support")
Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
drivers/net/failsafe/failsafe.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c
index c499bfb98..5b177c7a1 100644
--- a/drivers/net/failsafe/failsafe.c
+++ b/drivers/net/failsafe/failsafe.c
@@ -224,7 +224,7 @@ fs_eth_dev_create(struct rte_vdev_device *vdev)
mac);
if (ret) {
ERROR("Failed to set default MAC address");
- goto free_args;
+ goto cancel_alarm;
}
}
} else {
@@ -258,6 +258,8 @@ fs_eth_dev_create(struct rte_vdev_device *vdev)
.type = RTE_INTR_HANDLE_EXT,
};
return 0;
+cancel_alarm:
+ failsafe_hotplug_alarm_cancel(dev);
free_args:
failsafe_args_free(dev);
free_subs:
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/i40e: fix link status update' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (56 preceding siblings ...)
2018-05-15 13:47 ` [dpdk-stable] patch 'net/failsafe: fix probe cleanup' " luca.boccassi
@ 2018-05-15 13:47 ` luca.boccassi
2018-05-15 13:47 ` [dpdk-stable] patch 'net/sfc: fix inner TCP/UDP checksum offload control' " luca.boccassi
` (12 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:47 UTC (permalink / raw)
To: Beilei Xing; +Cc: Keith Wiles, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 84c37440e25629dcd52f9c3bfb7e63943d4724b1 Mon Sep 17 00:00:00 2001
From: Beilei Xing <beilei.xing@intel.com>
Date: Thu, 10 May 2018 10:26:29 +0800
Subject: [PATCH] net/i40e: fix link status update
[ upstream commit b5f6272c242f12fa3403b0d7e9da18fb83da17d4 ]
Link status is not updated correctly, link speed is 0
when link is up and link speed is not 0 when link is
down. This patch fixes the issue.
Fixes: eef2daf2e199 ("net/i40e: fix link update no wait")
Signed-off-by: Keith Wiles <keith.wiles@intel.com>
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
drivers/net/i40e/i40e_ethdev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 2322d6043..c1550ff07 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2471,7 +2471,7 @@ update_link_no_wait(struct i40e_hw *hw, struct rte_eth_link *link)
reg_val &= I40E_REG_LINK_UP;
link->link_status = (reg_val == I40E_REG_LINK_UP) ? 1 : 0;
- if (unlikely(link->link_status != 0))
+ if (unlikely(link->link_status == 0))
return;
/* Parse the link status */
@@ -2528,7 +2528,7 @@ update_link_wait(struct i40e_hw *hw, struct rte_eth_link *link,
link->link_status = link_status.link_info & I40E_AQ_LINK_UP;
if (unlikely(link->link_status != 0))
- return;
+ break;
rte_delay_ms(CHECK_INTERVAL);
} while (--rep_cnt);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/sfc: fix inner TCP/UDP checksum offload control' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (57 preceding siblings ...)
2018-05-15 13:47 ` [dpdk-stable] patch 'net/i40e: fix link status update' " luca.boccassi
@ 2018-05-15 13:47 ` luca.boccassi
2018-05-15 13:47 ` [dpdk-stable] patch 'net/i40e: print global register change info' " luca.boccassi
` (11 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:47 UTC (permalink / raw)
To: Andrew Rybchenko; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From eac9b1ddb3545d3a9009a7cba42569d83bdd1bb0 Mon Sep 17 00:00:00 2001
From: Andrew Rybchenko <arybchenko@solarflare.com>
Date: Thu, 10 May 2018 12:59:42 +0100
Subject: [PATCH] net/sfc: fix inner TCP/UDP checksum offload control
[ upstream commit 4436cf988bfd046a49666a34cf55587997ba263c ]
If application uses Tx offload API and sets ETH_TXQ_FLAGS_IGNORE flag,
it still should have inner TCP/UDP checksum offload enabled if it is
supported and TCP/UDP checksum offload is requested.
Fixes: c78d280e88ef ("net/sfc: convert to new Tx offload API")
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
drivers/net/sfc/sfc_tx.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/sfc/sfc_tx.c b/drivers/net/sfc/sfc_tx.c
index 757b03ba8..5b004fda5 100644
--- a/drivers/net/sfc/sfc_tx.c
+++ b/drivers/net/sfc/sfc_tx.c
@@ -495,8 +495,7 @@ sfc_tx_qstart(struct sfc_adapter *sa, unsigned int sw_index)
(txq->offloads & DEV_TX_OFFLOAD_UDP_CKSUM)) {
flags |= EFX_TXQ_CKSUM_TCPUDP;
- if ((~txq->flags & ETH_TXQ_FLAGS_IGNORE) &&
- (offloads_supported & DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM))
+ if (offloads_supported & DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM)
flags |= EFX_TXQ_CKSUM_INNER_TCPUDP;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/i40e: print global register change info' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (58 preceding siblings ...)
2018-05-15 13:47 ` [dpdk-stable] patch 'net/sfc: fix inner TCP/UDP checksum offload control' " luca.boccassi
@ 2018-05-15 13:47 ` luca.boccassi
2018-05-15 13:47 ` [dpdk-stable] patch 'ethdev: fix debug log of owner id' " luca.boccassi
` (10 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:47 UTC (permalink / raw)
To: Beilei Xing; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 7d39632c52b278b90853e8165b04c8a54e0a44b7 Mon Sep 17 00:00:00 2001
From: Beilei Xing <beilei.xing@intel.com>
Date: Fri, 11 May 2018 06:48:38 +0800
Subject: [PATCH] net/i40e: print global register change info
[ upstream commit 9153411e447d300793148c986f9d9d0e8f6d4220 ]
Global register change info during enabling
flexible payload is not printed.
This patch changes macro to print the global
register change info.
Fixes: d2f9fe8ae309 ("net/i40e: turn off flexible payload on driver init")
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
drivers/net/i40e/i40e_fdir.c | 2 +-
drivers/net/i40e/i40e_flow.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index b83a0cff9..a4a61d1c3 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -525,7 +525,7 @@ i40e_set_flx_pld_cfg(struct i40e_pf *pf,
flx_ort = (1 << I40E_GLQF_ORT_FLX_PAYLOAD_SHIFT) |
(num << I40E_GLQF_ORT_FIELD_CNT_SHIFT) |
(layer_idx * I40E_MAX_FLXPLD_FIED);
- I40E_WRITE_REG(hw, I40E_GLQF_ORT(33 + layer_idx), flx_ort);
+ I40E_WRITE_GLB_REG(hw, I40E_GLQF_ORT(33 + layer_idx), flx_ort);
i40e_global_cfg_warning(I40E_WARNING_ENA_FLX_PLD);
}
diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index f1c492a18..a30e071a8 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -2259,7 +2259,7 @@ i40e_flow_set_fdir_flex_pit(struct i40e_pf *pf,
flx_ort = (1 << I40E_GLQF_ORT_FLX_PAYLOAD_SHIFT) |
(raw_id << I40E_GLQF_ORT_FIELD_CNT_SHIFT) |
(layer_idx * I40E_MAX_FLXPLD_FIED);
- I40E_WRITE_REG(hw, I40E_GLQF_ORT(33 + layer_idx), flx_ort);
+ I40E_WRITE_GLB_REG(hw, I40E_GLQF_ORT(33 + layer_idx), flx_ort);
i40e_global_cfg_warning(I40E_WARNING_ENA_FLX_PLD);
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'ethdev: fix debug log of owner id' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (59 preceding siblings ...)
2018-05-15 13:47 ` [dpdk-stable] patch 'net/i40e: print global register change info' " luca.boccassi
@ 2018-05-15 13:47 ` luca.boccassi
2018-05-15 13:47 ` [dpdk-stable] patch 'net/failsafe: fix sub-device visibility' " luca.boccassi
` (9 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:47 UTC (permalink / raw)
To: Thomas Monjalon
Cc: Ferruh Yigit, Andrew Rybchenko, Stephen Hemminger, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From fea89aaf9a9703d943443d12f04af5797f6f4cc3 Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas@monjalon.net>
Date: Fri, 11 May 2018 01:58:26 +0200
Subject: [PATCH] ethdev: fix debug log of owner id
[ upstream commit 444e2b78295d340cc33ea8f3bf24d1222ef8e824 ]
The owner id is 64-bit.
On 32-bit environment, it must be printed with PRIX64.
Fixes: 5b7ba31148a8 ("ethdev: add port ownership")
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_ether/rte_ethdev.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 137428402..30a0ba7da 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -370,7 +370,7 @@ rte_eth_is_valid_owner_id(uint64_t owner_id)
{
if (owner_id == RTE_ETH_DEV_NO_OWNER ||
rte_eth_dev_shared_data->next_owner_id <= owner_id) {
- RTE_PMD_DEBUG_TRACE("Invalid owner_id=%016lX.\n", owner_id);
+ RTE_PMD_DEBUG_TRACE("Invalid owner_id=%016"PRIX64".\n", owner_id);
return 0;
}
return 1;
@@ -420,7 +420,7 @@ _rte_eth_dev_owner_set(const uint16_t port_id, const uint64_t old_owner_id,
port_owner = &rte_eth_devices[port_id].data->owner;
if (port_owner->id != old_owner_id) {
RTE_PMD_DEBUG_TRACE("Cannot set owner to port %d already owned"
- " by %s_%016lX.\n", port_id,
+ " by %s_%016"PRIX64".\n", port_id,
port_owner->name, port_owner->id);
return -EPERM;
}
@@ -433,7 +433,7 @@ _rte_eth_dev_owner_set(const uint16_t port_id, const uint64_t old_owner_id,
port_owner->id = new_owner->id;
- RTE_PMD_DEBUG_TRACE("Port %d owner is %s_%016lX.\n", port_id,
+ RTE_PMD_DEBUG_TRACE("Port %d owner is %s_%016"PRIX64".\n", port_id,
new_owner->name, new_owner->id);
return 0;
@@ -485,8 +485,8 @@ rte_eth_dev_owner_delete(const uint64_t owner_id)
RTE_ETH_FOREACH_DEV_OWNED_BY(port_id, owner_id)
memset(&rte_eth_devices[port_id].data->owner, 0,
sizeof(struct rte_eth_dev_owner));
- RTE_PMD_DEBUG_TRACE("All port owners owned by %016X identifier"
- " have removed.\n", owner_id);
+ RTE_PMD_DEBUG_TRACE("All port owners owned by %016"PRIX64
+ " identifier have removed.\n", owner_id);
}
rte_spinlock_unlock(&rte_eth_dev_shared_data->ownership_lock);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/failsafe: fix sub-device visibility' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (60 preceding siblings ...)
2018-05-15 13:47 ` [dpdk-stable] patch 'ethdev: fix debug log of owner id' " luca.boccassi
@ 2018-05-15 13:47 ` luca.boccassi
2018-05-15 13:47 ` [dpdk-stable] patch 'ethdev: add doxygen comments for each state' " luca.boccassi
` (8 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:47 UTC (permalink / raw)
To: Thomas Monjalon
Cc: Matan Azrad, Gaetan Rivet, Andrew Rybchenko, Stephen Hemminger,
dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 8012d832fd1e7d5c79b58ee2c98e318601996122 Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas@monjalon.net>
Date: Fri, 11 May 2018 01:58:27 +0200
Subject: [PATCH] net/failsafe: fix sub-device visibility
[ upstream commit 195814264037593031fbec73d3b989c71e149768 ]
The iterator function rte_eth_find_next_owned_by(), used by the
iterator macro RTE_ETH_FOREACH_DEV_OWNED_BY, are ignoring the devices
which are neither ATTACHED nor REMOVED. Thus sub-devices, having
the state DEFERRED, cannot be seen with the ethdev iterator.
The state RTE_ETH_DEV_DEFERRED can be replaced by
RTE_ETH_DEV_ATTACHED + owner.
Fixes: dcd0c9c32b8d ("net/failsafe: use ownership mechanism for slaves")
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Matan Azrad <matan@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/failsafe/failsafe_eal.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/failsafe/failsafe_eal.c b/drivers/net/failsafe/failsafe_eal.c
index c3d673125..e0fd60598 100644
--- a/drivers/net/failsafe/failsafe_eal.c
+++ b/drivers/net/failsafe/failsafe_eal.c
@@ -98,7 +98,6 @@ fs_bus_init(struct rte_eth_dev *dev)
SUB_ID(sdev) = i;
sdev->fs_dev = dev;
sdev->dev = ETH(sdev)->device;
- ETH(sdev)->state = RTE_ETH_DEV_DEFERRED;
sdev->state = DEV_PROBED;
}
return 0;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'ethdev: add doxygen comments for each state' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (61 preceding siblings ...)
2018-05-15 13:47 ` [dpdk-stable] patch 'net/failsafe: fix sub-device visibility' " luca.boccassi
@ 2018-05-15 13:47 ` luca.boccassi
2018-05-15 13:47 ` [dpdk-stable] patch 'drivers/net: use higher level of probing helper for PCI' " luca.boccassi
` (7 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:47 UTC (permalink / raw)
To: Thomas Monjalon
Cc: Matan Azrad, Ferruh Yigit, Andrew Rybchenko, Stephen Hemminger,
dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 4551b0c399afa15b17f851acffabeed79b589eff Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas@monjalon.net>
Date: Fri, 11 May 2018 01:58:28 +0200
Subject: [PATCH] ethdev: add doxygen comments for each state
[ upstream commit d5e54c355cc67912f33de69fd45e145d47f18579 ]
The enum rte_eth_dev_state was not properly documented.
Its values did not appear in the doxygen output,
and may be misunderstood.
The state RTE_ETH_DEV_DEFERRED has no interest anymore
since the ownership mechanism brings a more flexible categorization.
This state could be removed later.
Fixes: d52268a8b24b ("ethdev: expose device states")
Fixes: cb894d99eceb ("ethdev: add deferred intermediate device state")
Fixes: 5b7ba31148a8 ("ethdev: add port ownership")
Fixes: 7106edc12380 ("ethdev: add devop to check removal status")
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Matan Azrad <matan@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_ether/rte_ethdev.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 6774a9c8b..ad235364a 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1197,12 +1197,16 @@ typedef uint16_t (*rte_tx_callback_fn)(uint16_t port_id, uint16_t queue,
struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param);
/**
- * A set of values to describe the possible states of an eth device.
+ * Possible states of an ethdev port.
*/
enum rte_eth_dev_state {
+ /** Device is unused before being probed. */
RTE_ETH_DEV_UNUSED = 0,
+ /** Device is attached when allocated in probing. */
RTE_ETH_DEV_ATTACHED,
+ /** The deferred state is useless and replaced by ownership. */
RTE_ETH_DEV_DEFERRED,
+ /** Device is in removed state when plug-out is detected. */
RTE_ETH_DEV_REMOVED,
};
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'drivers/net: use higher level of probing helper for PCI' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (62 preceding siblings ...)
2018-05-15 13:47 ` [dpdk-stable] patch 'ethdev: add doxygen comments for each state' " luca.boccassi
@ 2018-05-15 13:47 ` luca.boccassi
2018-05-15 13:47 ` [dpdk-stable] patch 'ethdev: add lock to port allocation check' " luca.boccassi
` (6 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:47 UTC (permalink / raw)
To: Thomas Monjalon
Cc: Ferruh Yigit, Andrew Rybchenko, Stephen Hemminger, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 19257cae198cd351a33cdb3a022f5d8a50d62123 Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas@monjalon.net>
Date: Fri, 11 May 2018 01:58:29 +0200
Subject: [PATCH] drivers/net: use higher level of probing helper for PCI
[ upstream commit 01a98fdd088d9ed7c3da9e3a2f0696ac29bcc037 ]
The drivers avp, bnx2x and liquidio were using the helper function
rte_eth_dev_pci_allocate() and can be replaced by
rte_eth_dev_pci_generic_probe() which calls the former.
Fixes: dcd5c8112bc3 ("ethdev: add PCI driver helpers")
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/avp/avp_ethdev.c | 15 ++-------------
drivers/net/bnx2x/bnx2x_ethdev.c | 20 +++++---------------
drivers/net/liquidio/lio_ethdev.c | 15 ++-------------
3 files changed, 9 insertions(+), 41 deletions(-)
diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c
index dba99120f..2caa94801 100644
--- a/drivers/net/avp/avp_ethdev.c
+++ b/drivers/net/avp/avp_ethdev.c
@@ -1076,19 +1076,8 @@ static int
eth_avp_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
struct rte_pci_device *pci_dev)
{
- struct rte_eth_dev *eth_dev;
- int ret;
-
- eth_dev = rte_eth_dev_pci_allocate(pci_dev,
- sizeof(struct avp_adapter));
- if (eth_dev == NULL)
- return -ENOMEM;
-
- ret = eth_avp_dev_init(eth_dev);
- if (ret)
- rte_eth_dev_pci_release(eth_dev);
-
- return ret;
+ return rte_eth_dev_pci_generic_probe(pci_dev, sizeof(struct avp_adapter),
+ eth_avp_dev_init);
}
static int
diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c
index 483d5a17c..07a69900b 100644
--- a/drivers/net/bnx2x/bnx2x_ethdev.c
+++ b/drivers/net/bnx2x/bnx2x_ethdev.c
@@ -642,24 +642,14 @@ static struct rte_pci_driver rte_bnx2xvf_pmd;
static int eth_bnx2x_pci_probe(struct rte_pci_driver *pci_drv,
struct rte_pci_device *pci_dev)
{
- struct rte_eth_dev *eth_dev;
- int ret;
-
- eth_dev = rte_eth_dev_pci_allocate(pci_dev, sizeof(struct bnx2x_softc));
- if (!eth_dev)
- return -ENOMEM;
-
if (pci_drv == &rte_bnx2x_pmd)
- ret = eth_bnx2x_dev_init(eth_dev);
+ return rte_eth_dev_pci_generic_probe(pci_dev,
+ sizeof(struct bnx2x_softc), eth_bnx2x_dev_init);
else if (pci_drv == &rte_bnx2xvf_pmd)
- ret = eth_bnx2xvf_dev_init(eth_dev);
+ return rte_eth_dev_pci_generic_probe(pci_dev,
+ sizeof(struct bnx2x_softc), eth_bnx2xvf_dev_init);
else
- ret = -EINVAL;
-
- if (ret)
- rte_eth_dev_pci_release(eth_dev);
-
- return ret;
+ return -EINVAL;
}
static int eth_bnx2x_pci_remove(struct rte_pci_device *pci_dev)
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index e1a20cd65..eebe0b798 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -2146,19 +2146,8 @@ static int
lio_eth_dev_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
struct rte_pci_device *pci_dev)
{
- struct rte_eth_dev *eth_dev;
- int ret;
-
- eth_dev = rte_eth_dev_pci_allocate(pci_dev,
- sizeof(struct lio_device));
- if (eth_dev == NULL)
- return -ENOMEM;
-
- ret = lio_eth_dev_init(eth_dev);
- if (ret)
- rte_eth_dev_pci_release(eth_dev);
-
- return ret;
+ return rte_eth_dev_pci_generic_probe(pci_dev, sizeof(struct lio_device),
+ lio_eth_dev_init);
}
static int
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'ethdev: add lock to port allocation check' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (63 preceding siblings ...)
2018-05-15 13:47 ` [dpdk-stable] patch 'drivers/net: use higher level of probing helper for PCI' " luca.boccassi
@ 2018-05-15 13:47 ` luca.boccassi
2018-05-15 13:47 ` [dpdk-stable] patch 'net/failsafe: fix sub-device ownership race' " luca.boccassi
` (5 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:47 UTC (permalink / raw)
To: Matan Azrad
Cc: Thomas Monjalon, Andrew Rybchenko, Stephen Hemminger, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From e765733c1aa7a1da7ecc46c0223323965e8e437f Mon Sep 17 00:00:00 2001
From: Matan Azrad <matan@mellanox.com>
Date: Fri, 11 May 2018 01:58:32 +0200
Subject: [PATCH] ethdev: add lock to port allocation check
[ upstream commit ac7d3b6ddf87e1e0435de6d40cfe2749dc0ff9a4 ]
When comparing the port name, there can be a race condition with
a thread allocating a new port and writing the name at the same time.
It can lead to match with a partial name by error.
The check of the port is now considered as a critical section
protected with locks.
This fix will be even more required for multi-process when the
port availability will rely only on the name, in a following patch.
Fixes: 84934303a17c ("ethdev: synchronize port allocation")
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_ether/rte_ethdev.c | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 30a0ba7da..e7f2b809c 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -222,8 +222,8 @@ rte_eth_dev_shared_data_prepare(void)
rte_spinlock_unlock(&rte_eth_shared_data_lock);
}
-struct rte_eth_dev *
-rte_eth_dev_allocated(const char *name)
+static struct rte_eth_dev *
+_rte_eth_dev_allocated(const char *name)
{
unsigned i;
@@ -235,6 +235,22 @@ rte_eth_dev_allocated(const char *name)
return NULL;
}
+struct rte_eth_dev *
+rte_eth_dev_allocated(const char *name)
+{
+ struct rte_eth_dev *ethdev;
+
+ rte_eth_dev_shared_data_prepare();
+
+ rte_spinlock_lock(&rte_eth_dev_shared_data->ownership_lock);
+
+ ethdev = _rte_eth_dev_allocated(name);
+
+ rte_spinlock_unlock(&rte_eth_dev_shared_data->ownership_lock);
+
+ return ethdev;
+}
+
static uint16_t
rte_eth_dev_find_free_port(void)
{
@@ -281,7 +297,7 @@ rte_eth_dev_allocate(const char *name)
goto unlock;
}
- if (rte_eth_dev_allocated(name) != NULL) {
+ if (_rte_eth_dev_allocated(name) != NULL) {
RTE_LOG(ERR, EAL, "Ethernet Device with name %s already allocated!\n",
name);
goto unlock;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/failsafe: fix sub-device ownership race' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (64 preceding siblings ...)
2018-05-15 13:47 ` [dpdk-stable] patch 'ethdev: add lock to port allocation check' " luca.boccassi
@ 2018-05-15 13:47 ` luca.boccassi
2018-05-15 13:47 ` [dpdk-stable] patch 'ethdev: fix port removal notification timing' " luca.boccassi
` (4 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:47 UTC (permalink / raw)
To: Matan Azrad; +Cc: Gaetan Rivet, Stephen Hemminger, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 80c21d589c88ac0614ff0c96eacd839384ccfaa7 Mon Sep 17 00:00:00 2001
From: Matan Azrad <matan@mellanox.com>
Date: Fri, 11 May 2018 01:58:35 +0200
Subject: [PATCH] net/failsafe: fix sub-device ownership race
[ upstream commit 7fda13d3a508473d21238bf20de39245f584a38c ]
There is time between the sub-device port probing by the sub-device PMD
to the sub-device port ownership taking by a fail-safe port.
In this time, the port is available for the application usage. For
example, the port will be exposed to the applications which use
RTE_ETH_FOREACH_DEV iterator.
Thus, ownership unaware applications may manage the port in this time
what may cause a lot of problematic behaviors in the fail-safe
sub-device initialization.
Register to the ethdev NEW event to take the sub-device port ownership
before it becomes exposed to the application.
Fixes: a46f8d584eb8 ("net/failsafe: add fail-safe PMD")
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/failsafe/failsafe.c | 20 ++++++++++--
drivers/net/failsafe/failsafe_eal.c | 56 ++++++++++++++++++++++-----------
drivers/net/failsafe/failsafe_ether.c | 23 ++++++++++++++
drivers/net/failsafe/failsafe_private.h | 3 ++
4 files changed, 80 insertions(+), 22 deletions(-)
diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c
index 5b177c7a1..da2c7f07a 100644
--- a/drivers/net/failsafe/failsafe.c
+++ b/drivers/net/failsafe/failsafe.c
@@ -202,16 +202,25 @@ fs_eth_dev_create(struct rte_vdev_device *vdev)
}
snprintf(priv->my_owner.name, sizeof(priv->my_owner.name),
FAILSAFE_OWNER_NAME);
+ DEBUG("Failsafe port %u owner info: %s_%016"PRIX64, dev->data->port_id,
+ priv->my_owner.name, priv->my_owner.id);
+ ret = rte_eth_dev_callback_register(RTE_ETH_ALL, RTE_ETH_EVENT_NEW,
+ failsafe_eth_new_event_callback,
+ dev);
+ if (ret) {
+ ERROR("Failed to register NEW callback");
+ goto free_args;
+ }
ret = failsafe_eal_init(dev);
if (ret)
- goto free_args;
+ goto unregister_new_callback;
ret = fs_mutex_init(priv);
if (ret)
- goto free_args;
+ goto unregister_new_callback;
ret = failsafe_hotplug_alarm_install(dev);
if (ret) {
ERROR("Could not set up plug-in event detection");
- goto free_args;
+ goto unregister_new_callback;
}
mac = &dev->data->mac_addrs[0];
if (mac_from_arg) {
@@ -260,6 +269,9 @@ fs_eth_dev_create(struct rte_vdev_device *vdev)
return 0;
cancel_alarm:
failsafe_hotplug_alarm_cancel(dev);
+unregister_new_callback:
+ rte_eth_dev_callback_unregister(RTE_ETH_ALL, RTE_ETH_EVENT_NEW,
+ failsafe_eth_new_event_callback, dev);
free_args:
failsafe_args_free(dev);
free_subs:
@@ -279,6 +291,8 @@ fs_rte_eth_free(const char *name)
dev = rte_eth_dev_allocated(name);
if (dev == NULL)
return -ENODEV;
+ rte_eth_dev_callback_unregister(RTE_ETH_ALL, RTE_ETH_EVENT_NEW,
+ failsafe_eth_new_event_callback, dev);
ret = failsafe_eal_uninit(dev);
if (ret)
ERROR("Error while uninitializing sub-EAL");
diff --git a/drivers/net/failsafe/failsafe_eal.c b/drivers/net/failsafe/failsafe_eal.c
index e0fd60598..74b97db5c 100644
--- a/drivers/net/failsafe/failsafe_eal.c
+++ b/drivers/net/failsafe/failsafe_eal.c
@@ -18,8 +18,9 @@ fs_ethdev_portid_get(const char *name, uint16_t *port_id)
return -EINVAL;
}
len = strlen(name);
- RTE_ETH_FOREACH_DEV(pid) {
- if (!strncmp(name, rte_eth_devices[pid].device->name, len)) {
+ for (pid = 0; pid < RTE_MAX_ETHPORTS; pid++) {
+ if (rte_eth_dev_is_valid_port(pid) &&
+ !strncmp(name, rte_eth_devices[pid].device->name, len)) {
*port_id = pid;
return 0;
}
@@ -41,6 +42,8 @@ fs_bus_init(struct rte_eth_dev *dev)
continue;
da = &sdev->devargs;
if (fs_ethdev_portid_get(da->name, &pid) != 0) {
+ struct rte_eth_dev_owner pid_owner;
+
ret = rte_eal_hotplug_add(da->bus->name,
da->name,
da->args);
@@ -55,12 +58,26 @@ fs_bus_init(struct rte_eth_dev *dev)
ERROR("sub_device %d init went wrong", i);
return -ENODEV;
}
+ /*
+ * The NEW callback tried to take ownership, check
+ * whether it succeed or didn't.
+ */
+ rte_eth_dev_owner_get(pid, &pid_owner);
+ if (pid_owner.id != PRIV(dev)->my_owner.id) {
+ INFO("sub_device %d owner(%s_%016"PRIX64") is not my,"
+ " owner(%s_%016"PRIX64"), will try again later",
+ i, pid_owner.name, pid_owner.id,
+ PRIV(dev)->my_owner.name,
+ PRIV(dev)->my_owner.id);
+ continue;
+ }
} else {
+ /* The sub-device port was found. */
char devstr[DEVARGS_MAXLEN] = "";
struct rte_devargs *probed_da =
rte_eth_devices[pid].device->devargs;
- /* Take control of device probed by EAL options. */
+ /* Take control of probed device. */
free(da->args);
memset(da, 0, sizeof(*da));
if (probed_da != NULL)
@@ -77,22 +94,23 @@ fs_bus_init(struct rte_eth_dev *dev)
}
INFO("Taking control of a probed sub device"
" %d named %s", i, da->name);
- }
- ret = rte_eth_dev_owner_set(pid, &PRIV(dev)->my_owner);
- if (ret < 0) {
- INFO("sub_device %d owner set failed (%s),"
- " will try again later", i, strerror(-ret));
- continue;
- } else if (strncmp(rte_eth_devices[pid].device->name, da->name,
- strlen(da->name)) != 0) {
- /*
- * The device probably was removed and its port id was
- * reallocated before ownership set.
- */
- rte_eth_dev_owner_unset(pid, PRIV(dev)->my_owner.id);
- INFO("sub_device %d was probably removed before taking"
- " ownership, will try again later", i);
- continue;
+ ret = rte_eth_dev_owner_set(pid, &PRIV(dev)->my_owner);
+ if (ret < 0) {
+ INFO("sub_device %d owner set failed (%s), "
+ "will try again later", i, strerror(-ret));
+ continue;
+ } else if (strncmp(rte_eth_devices[pid].device->name,
+ da->name, strlen(da->name)) != 0) {
+ /*
+ * The device probably was removed and its port
+ * id was reallocated before ownership set.
+ */
+ rte_eth_dev_owner_unset(pid,
+ PRIV(dev)->my_owner.id);
+ INFO("sub_device %d was removed before taking"
+ " ownership, will try again later", i);
+ continue;
+ }
}
ETH(sdev) = &rte_eth_devices[pid];
SUB_ID(sdev) = i;
diff --git a/drivers/net/failsafe/failsafe_ether.c b/drivers/net/failsafe/failsafe_ether.c
index 2c0bf9366..780bfa4bc 100644
--- a/drivers/net/failsafe/failsafe_ether.c
+++ b/drivers/net/failsafe/failsafe_ether.c
@@ -463,3 +463,26 @@ failsafe_eth_lsc_event_callback(uint16_t port_id __rte_unused,
else
return 0;
}
+
+/* Take sub-device ownership before it becomes exposed to the application. */
+int
+failsafe_eth_new_event_callback(uint16_t port_id,
+ enum rte_eth_event_type event __rte_unused,
+ void *cb_arg, void *out __rte_unused)
+{
+ struct rte_eth_dev *fs_dev = cb_arg;
+ struct sub_device *sdev;
+ struct rte_eth_dev *dev = &rte_eth_devices[port_id];
+ uint8_t i;
+
+ FOREACH_SUBDEV_STATE(sdev, i, fs_dev, DEV_PARSED) {
+ if (sdev->state >= DEV_PROBED)
+ continue;
+ if (strcmp(sdev->devargs.name, dev->device->name) != 0)
+ continue;
+ rte_eth_dev_owner_set(port_id, &PRIV(fs_dev)->my_owner);
+ /* The actual owner will be checked after the port probing. */
+ break;
+ }
+ return 0;
+}
diff --git a/drivers/net/failsafe/failsafe_private.h b/drivers/net/failsafe/failsafe_private.h
index 2d16ba4ca..155207423 100644
--- a/drivers/net/failsafe/failsafe_private.h
+++ b/drivers/net/failsafe/failsafe_private.h
@@ -220,6 +220,9 @@ int failsafe_eth_rmv_event_callback(uint16_t port_id,
int failsafe_eth_lsc_event_callback(uint16_t port_id,
enum rte_eth_event_type event,
void *cb_arg, void *out);
+int failsafe_eth_new_event_callback(uint16_t port_id,
+ enum rte_eth_event_type event,
+ void *cb_arg, void *out);
/* GLOBALS */
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'ethdev: fix port removal notification timing' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (65 preceding siblings ...)
2018-05-15 13:47 ` [dpdk-stable] patch 'net/failsafe: fix sub-device ownership race' " luca.boccassi
@ 2018-05-15 13:47 ` luca.boccassi
2018-05-15 13:47 ` [dpdk-stable] patch 'net/i40e: print original value for global register change' " luca.boccassi
` (3 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:47 UTC (permalink / raw)
To: Matan Azrad
Cc: Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko,
Stephen Hemminger, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From aa0eb1b25c376c01c186a31056fcb84e414082bc Mon Sep 17 00:00:00 2001
From: Matan Azrad <matan@mellanox.com>
Date: Fri, 11 May 2018 01:58:36 +0200
Subject: [PATCH] ethdev: fix port removal notification timing
[ upstream commit bafa9aa0d7bb07f78cdad518647a61c808945f4e ]
When an ethdev port is released, a destroy event is triggered to notify
the users about the released port.
A bit before the destroy event is triggered, the port becomes invalid
by changing its state to UNUSED and cleaning its data. Therefore, the
port is invalid for the destroy event callback process and the users
may get a wrong information of the port.
Move the destroy event emitting to be called before the port
invalidation.
Fixes: 133b54779aa1 ("ethdev: fix port data reset timing")
Fixes: 29aa41e36de7 ("ethdev: add notifications for probing and removal")
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_ether/rte_ethdev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index e7f2b809c..25fd3bc46 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -358,6 +358,8 @@ rte_eth_dev_release_port(struct rte_eth_dev *eth_dev)
rte_eth_dev_shared_data_prepare();
+ _rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_DESTROY, NULL);
+
rte_spinlock_lock(&rte_eth_dev_shared_data->ownership_lock);
eth_dev->state = RTE_ETH_DEV_UNUSED;
@@ -366,8 +368,6 @@ rte_eth_dev_release_port(struct rte_eth_dev *eth_dev)
rte_spinlock_unlock(&rte_eth_dev_shared_data->ownership_lock);
- _rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_DESTROY, NULL);
-
return 0;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/i40e: print original value for global register change' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (66 preceding siblings ...)
2018-05-15 13:47 ` [dpdk-stable] patch 'ethdev: fix port removal notification timing' " luca.boccassi
@ 2018-05-15 13:47 ` luca.boccassi
2018-05-15 13:47 ` [dpdk-stable] patch 'ethdev: improve doc for name by port ID API' " luca.boccassi
` (2 subsequent siblings)
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:47 UTC (permalink / raw)
To: Beilei Xing; +Cc: Qi Zhang, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 0e18c22790b425a70d8c08ddcb27353437f3997e Mon Sep 17 00:00:00 2001
From: Beilei Xing <beilei.xing@intel.com>
Date: Sat, 12 May 2018 02:17:07 +0800
Subject: [PATCH] net/i40e: print original value for global register change
[ upstream commit 3d4faec9857f04dd25130ab51e356209b2559a39 ]
Currently, only new value is printed during global
register change. Add original value to help debugging
facility.
Fixes: bc66b9717c50 ("net/i40e: add debug logs when writing global registers")
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
drivers/net/i40e/i40e_ethdev.c | 56 +++++++++++++++++++++++++++++++++---------
drivers/net/i40e/i40e_ethdev.h | 8 +++---
2 files changed, 49 insertions(+), 15 deletions(-)
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index c1550ff07..4f4456d4a 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -656,12 +656,16 @@ rte_i40e_dev_atomic_write_link_status(struct rte_eth_dev *dev,
}
static inline void
-i40e_write_global_rx_ctl(struct i40e_hw *hw, u32 reg_addr, u32 reg_val)
+i40e_write_global_rx_ctl(struct i40e_hw *hw, uint32_t reg_addr,
+ uint32_t reg_val)
{
+ uint32_t ori_reg_val;
+
+ ori_reg_val = i40e_read_rx_ctl(hw, reg_addr);
i40e_write_rx_ctl(hw, reg_addr, reg_val);
- PMD_DRV_LOG(DEBUG, "Global register 0x%08x is modified "
- "with value 0x%08x",
- reg_addr, reg_val);
+ PMD_DRV_LOG(DEBUG,
+ "Global register [0x%08x] original: 0x%08x, after: 0x%08x",
+ reg_addr, ori_reg_val, reg_val);
}
RTE_PMD_REGISTER_PCI(net_i40e, rte_i40e_pmd);
@@ -1117,6 +1121,30 @@ i40e_support_multi_driver(struct rte_eth_dev *dev)
return 0;
}
+static int
+i40e_aq_debug_write_global_register(struct i40e_hw *hw,
+ uint32_t reg_addr, uint64_t reg_val,
+ struct i40e_asq_cmd_details *cmd_details)
+{
+ uint64_t ori_reg_val;
+ int ret;
+
+ ret = i40e_aq_debug_read_register(hw, reg_addr, &ori_reg_val, NULL);
+ if (ret != I40E_SUCCESS) {
+ PMD_DRV_LOG(ERR,
+ "Fail to debug read from 0x%08x",
+ reg_addr);
+ return -EIO;
+ }
+
+ PMD_DRV_LOG(DEBUG,
+ "Global register [0x%08x] original: 0x%"PRIx64
+ ", after: 0x%"PRIx64,
+ reg_addr, ori_reg_val, reg_val);
+
+ return i40e_aq_debug_write_register(hw, reg_addr, reg_val, cmd_details);
+}
+
static int
eth_i40e_dev_init(struct rte_eth_dev *dev)
{
@@ -1224,7 +1252,8 @@ eth_i40e_dev_init(struct rte_eth_dev *dev)
/* initialise the L3_MAP register */
if (!pf->support_multi_driver) {
- ret = i40e_aq_debug_write_register(hw, I40E_GLQF_L3_MAP(40),
+ ret = i40e_aq_debug_write_global_register(hw,
+ I40E_GLQF_L3_MAP(40),
0x00000028, NULL);
if (ret)
PMD_INIT_LOG(ERR, "Failed to write L3 MAP register %d",
@@ -3381,7 +3410,8 @@ i40e_vlan_tpid_set_by_registers(struct rte_eth_dev *dev,
return 0;
}
- ret = i40e_aq_debug_write_register(hw, I40E_GL_SWT_L2TAGCTRL(reg_id),
+ ret = i40e_aq_debug_write_global_register(hw,
+ I40E_GL_SWT_L2TAGCTRL(reg_id),
reg_w, NULL);
if (ret != I40E_SUCCESS) {
PMD_DRV_LOG(ERR,
@@ -3393,6 +3423,8 @@ i40e_vlan_tpid_set_by_registers(struct rte_eth_dev *dev,
"Global register 0x%08x is changed with value 0x%08x",
I40E_GL_SWT_L2TAGCTRL(reg_id), (uint32_t)reg_w);
+ i40e_global_cfg_warning(I40E_WARNING_TPID);
+
return 0;
}
@@ -3441,7 +3473,6 @@ i40e_vlan_tpid_set(struct rte_eth_dev *dev,
/* If NVM API < 1.7, keep the register setting */
ret = i40e_vlan_tpid_set_by_registers(dev, vlan_type,
tpid, qinq);
- i40e_global_cfg_warning(I40E_WARNING_TPID);
return ret;
}
@@ -8268,7 +8299,8 @@ i40e_dev_set_gre_key_len(struct i40e_hw *hw, uint8_t len)
}
if (reg != val) {
- ret = i40e_aq_debug_write_register(hw, I40E_GL_PRS_FVBM(2),
+ ret = i40e_aq_debug_write_global_register(hw,
+ I40E_GL_PRS_FVBM(2),
reg, NULL);
if (ret != 0)
return ret;
@@ -9161,11 +9193,11 @@ i40e_check_write_global_reg(struct i40e_hw *hw, uint32_t addr, uint32_t val)
{
uint32_t reg = i40e_read_rx_ctl(hw, addr);
- PMD_DRV_LOG(DEBUG, "[0x%08x] original: 0x%08x", addr, reg);
if (reg != val)
- i40e_write_global_rx_ctl(hw, addr, val);
- PMD_DRV_LOG(DEBUG, "[0x%08x] after: 0x%08x", addr,
- (uint32_t)i40e_read_rx_ctl(hw, addr));
+ i40e_write_rx_ctl(hw, addr, val);
+ PMD_DRV_LOG(DEBUG,
+ "Global register [0x%08x] original: 0x%08x, after: 0x%08x",
+ addr, reg, (uint32_t)i40e_read_rx_ctl(hw, addr));
}
static void
diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index a51bd4b07..e6b08e0ad 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -81,11 +81,13 @@
#define I40E_WRITE_GLB_REG(hw, reg, value) \
do { \
+ uint32_t ori_val; \
+ ori_val = I40E_READ_REG((hw), (reg)); \
I40E_PCI_REG_WRITE(I40E_PCI_REG_ADDR((hw), \
(reg)), (value)); \
- PMD_DRV_LOG(DEBUG, "Global register 0x%08x is modified " \
- "with value 0x%08x", \
- (reg), (value)); \
+ PMD_DRV_LOG(DEBUG, "global register [0x%08x] " \
+ "original: 0x%08x, after: 0x%08x ", \
+ (reg), (ori_val), (value)); \
} while (0)
/* index flex payload per layer */
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'ethdev: improve doc for name by port ID API' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (67 preceding siblings ...)
2018-05-15 13:47 ` [dpdk-stable] patch 'net/i40e: print original value for global register change' " luca.boccassi
@ 2018-05-15 13:47 ` luca.boccassi
2018-05-15 13:47 ` [dpdk-stable] patch 'app/testpmd: check if CRC strip offload supported' " luca.boccassi
2018-05-15 13:47 ` [dpdk-stable] patch 'net/mlx5: fix inlining segmented TSO packet' " luca.boccassi
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:47 UTC (permalink / raw)
To: Ivan Malov; +Cc: Andrew Rybchenko, Ferruh Yigit, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 15b91d2ca6572b733e039d42d76406f0f37a83a5 Mon Sep 17 00:00:00 2001
From: Ivan Malov <ivan.malov@oktetlabs.ru>
Date: Fri, 11 May 2018 15:05:51 +0100
Subject: [PATCH] ethdev: improve doc for name by port ID API
[ upstream commit 2d65bf3cfb1bb6063476a078ab43b60cac6cbfa7 ]
Description of rte_eth_dev_get_name_by_port() calls
port ID argument a pointer, which is misleading.
Also, output buffer minimal size is not mentioned.
These points need to be improved.
Fixes: bde516d5a85a ("ethdev: get port by name")
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
lib/librte_ether/rte_ethdev.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index ad235364a..2243039e7 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -3475,9 +3475,9 @@ rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id);
* Get the device name from port id
*
* @param port_id
-* pointer to port identifier of the device
+* Port identifier of the device.
* @param name
-* pci address or name of the device
+* Buffer of size RTE_ETH_NAME_MAX_LEN to store the name.
* @return
* - (0) if successful.
* - (-EINVAL) on failure.
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'app/testpmd: check if CRC strip offload supported' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (68 preceding siblings ...)
2018-05-15 13:47 ` [dpdk-stable] patch 'ethdev: improve doc for name by port ID API' " luca.boccassi
@ 2018-05-15 13:47 ` luca.boccassi
2018-05-15 13:47 ` [dpdk-stable] patch 'net/mlx5: fix inlining segmented TSO packet' " luca.boccassi
70 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:47 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: Shahaf Shuler, Bernard Iremonger, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 7d78080e186feed1093ac8725738930065ca1eb3 Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@intel.com>
Date: Wed, 9 May 2018 23:09:04 +0100
Subject: [PATCH] app/testpmd: check if CRC strip offload supported
[ upstream commit 7c45f6c0794858999696f1f54b59d2a0e436e68b ]
Testpmd set CRC_STRIP offload blindly, this is wrong according offload
API definition, and will cause error for the PMDs that doesn't support
CRC_STRIP like virtual PMDs.
Check if underlying device report this capability and don't set it if
not supported.
Fixes: 0074d02fca21 ("app/testpmd: convert to new Rx offloads API")
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
app/test-pmd/testpmd.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 9ab44813d..85d5cde09 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -690,6 +690,11 @@ init_config(void)
port->dev_conf.txmode = tx_mode;
port->dev_conf.rxmode = rx_mode;
rte_eth_dev_info_get(pid, &port->dev_info);
+
+ if (!(port->dev_info.rx_offload_capa &
+ DEV_RX_OFFLOAD_CRC_STRIP))
+ port->dev_conf.rxmode.offloads &=
+ ~DEV_RX_OFFLOAD_CRC_STRIP;
if (!(port->dev_info.tx_offload_capa &
DEV_TX_OFFLOAD_MBUF_FAST_FREE))
port->dev_conf.txmode.offloads &=
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/mlx5: fix inlining segmented TSO packet' has been queued to stable release 18.02.2
2018-05-15 13:46 ` [dpdk-stable] patch 'app/testpmd: fix copy of raw flow item' " luca.boccassi
` (69 preceding siblings ...)
2018-05-15 13:47 ` [dpdk-stable] patch 'app/testpmd: check if CRC strip offload supported' " luca.boccassi
@ 2018-05-15 13:47 ` luca.boccassi
2018-05-15 13:53 ` [dpdk-stable] patch 'net/avf: fix Rx interrupt mapping' " luca.boccassi
70 siblings, 1 reply; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:47 UTC (permalink / raw)
To: Yongseok Koh; +Cc: Xueming Li, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 9fd363e3c37aafb7e45367049c381e711f880479 Mon Sep 17 00:00:00 2001
From: Yongseok Koh <yskoh@mellanox.com>
Date: Fri, 11 May 2018 10:39:13 -0700
Subject: [PATCH] net/mlx5: fix inlining segmented TSO packet
[ upstream commit 5f44cfd011478bcf00430c53f276ddf9b795d443 ]
When a multi-segmented packet is inlined, data can be further inlined even
after the first segment. In case of TSO packet, extra inline data after TSO
header should be carried by an inline DSEG which has 4B inline header
recording the length of the inline data. If more than one segment is
inlined, the length doesn't count from the second segment. This will cause
a fault in HW and CQE will have an error, which is ignored by PMD.
Fixes: f895536be4fa ("net/mlx5: enable inlining data from multiple segments")
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
---
drivers/net/mlx5/mlx5_rxtx.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index 11dd1b84e..b99fc9038 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -507,7 +507,8 @@ pkt_inline:
if (unlikely(max_wqe < n))
break;
max_wqe -= n;
- if (tso && !inl) {
+ if (tso) {
+ assert(inl == 0);
inl = rte_cpu_to_be_32(copy_b |
MLX5_INLINE_SEG);
rte_memcpy((void *)raw,
@@ -542,8 +543,17 @@ pkt_inline:
} else if (!segs_n) {
goto next_pkt;
} else {
- raw += copy_b;
- inline_room -= copy_b;
+ /*
+ * Further inline the next segment only for
+ * non-TSO packets.
+ */
+ if (!tso) {
+ raw += copy_b;
+ inline_room -= copy_b;
+ } else {
+ inline_room = 0;
+ }
+ /* Move to the next segment. */
--segs_n;
buf = buf->next;
assert(buf);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/avf: fix Rx interrupt mapping' has been queued to stable release 18.02.2
2018-05-15 13:47 ` [dpdk-stable] patch 'net/mlx5: fix inlining segmented TSO packet' " luca.boccassi
@ 2018-05-15 13:53 ` luca.boccassi
2018-05-15 13:53 ` [dpdk-stable] patch 'net/bonding: fix slave activation simultaneously' " luca.boccassi
` (6 more replies)
0 siblings, 7 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:53 UTC (permalink / raw)
To: Jingjing Wu; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From f2f7212b9ce3bde8e87a72e34b537eb6f2e30eb3 Mon Sep 17 00:00:00 2001
From: Jingjing Wu <jingjing.wu@intel.com>
Date: Fri, 11 May 2018 23:09:48 +0800
Subject: [PATCH] net/avf: fix Rx interrupt mapping
[ upstream commit efe73c0d1d2bcfc17f726245bd880acdc06f9718 ]
Vector used for rx mapping is different if WB_ON_ITR
is supported. The mapping table need to be updated.
Fixes: d6bde6b5eae9 ("net/avf: enable Rx interrupt")
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
---
drivers/net/avf/avf_ethdev.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/avf/avf_ethdev.c b/drivers/net/avf/avf_ethdev.c
index 4442c3cd8..03f7ce408 100644
--- a/drivers/net/avf/avf_ethdev.c
+++ b/drivers/net/avf/avf_ethdev.c
@@ -339,17 +339,18 @@ static int avf_config_rx_queues_irqs(struct rte_eth_dev *dev,
AVF_WRITE_FLUSH(hw);
/* map all queues to the same interrupt */
for (i = 0; i < dev->data->nb_rx_queues; i++)
- vf->rxq_map[0] |= 1 << i;
+ vf->rxq_map[vf->msix_base] |= 1 << i;
} else {
if (!rte_intr_allow_others(intr_handle)) {
vf->nb_msix = 1;
vf->msix_base = AVF_MISC_VEC_ID;
for (i = 0; i < dev->data->nb_rx_queues; i++) {
- vf->rxq_map[0] |= 1 << i;
+ vf->rxq_map[vf->msix_base] |= 1 << i;
intr_handle->intr_vec[i] = AVF_MISC_VEC_ID;
}
PMD_DRV_LOG(DEBUG,
- "vector 0 are mapping to all Rx queues");
+ "vector %u are mapping to all Rx queues",
+ vf->msix_base);
} else {
/* If Rx interrupt is reuquired, and we can use
* multi interrupts, then the vec is from 1
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bonding: fix slave activation simultaneously' has been queued to stable release 18.02.2
2018-05-15 13:53 ` [dpdk-stable] patch 'net/avf: fix Rx interrupt mapping' " luca.boccassi
@ 2018-05-15 13:53 ` luca.boccassi
2018-05-16 10:13 ` [dpdk-stable] patch 'mempool: fix virtual address population' " luca.boccassi
2018-05-15 13:53 ` [dpdk-stable] patch 'bus/dpaa: fix inconsistent struct alignment' " luca.boccassi
` (5 subsequent siblings)
6 siblings, 1 reply; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:53 UTC (permalink / raw)
To: Matan Azrad; +Cc: Declan Doherty, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From d17bd55481294300771de19e9e98968d447ddee4 Mon Sep 17 00:00:00 2001
From: Matan Azrad <matan@mellanox.com>
Date: Tue, 24 Apr 2018 11:29:30 +0000
Subject: [PATCH] net/bonding: fix slave activation simultaneously
[ upstream commit 59056833cc72e6ec2431cf990380394bc96e078a ]
The bonding PMD decides to activate\deactivate its slaves according to
the slaves link statuses.
Thus, it registers to the LSC events of the slaves ports and
activates\deactivates them from its LSC callbacks called asynchronously
by the host thread when the slave link status is changed.
In addition, the bonding PMD uses the callback for slave activation
when it tries to start it, this operation is probably called by the
master thread.
Consequently, a slave may be activated in the same time by two
different threads and may cause a lot of optional errors, for example,
slave mempool recreation with the same name causes an error.
Synchronize the critical section in the LSC callback using a special
new spinlock.
Fixes: 414b202343ce ("bonding: fix initial link status of slave")
Fixes: a45b288ef21a ("bond: support link status polling")
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
---
drivers/net/bonding/rte_eth_bond_pmd.c | 17 +++++++++++++++--
drivers/net/bonding/rte_eth_bond_private.h | 1 +
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 32613703b..324753484 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -2638,14 +2638,21 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
if (!valid_slave)
return rc;
+ /* Synchronize lsc callback parallel calls either by real link event
+ * from the slaves PMDs or by the bonding PMD itself.
+ */
+ rte_spinlock_lock(&internals->lsc_lock);
+
/* Search for port in active port list */
active_pos = find_slave_by_id(internals->active_slaves,
internals->active_slave_count, port_id);
rte_eth_link_get_nowait(port_id, &link);
if (link.link_status) {
- if (active_pos < internals->active_slave_count)
+ if (active_pos < internals->active_slave_count) {
+ rte_spinlock_unlock(&internals->lsc_lock);
return rc;
+ }
/* if no active slave ports then set this port to be primary port */
if (internals->active_slave_count < 1) {
@@ -2664,8 +2671,10 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
internals->primary_port == port_id)
bond_ethdev_primary_set(internals, port_id);
} else {
- if (active_pos == internals->active_slave_count)
+ if (active_pos == internals->active_slave_count) {
+ rte_spinlock_unlock(&internals->lsc_lock);
return rc;
+ }
/* Remove from active slave list */
deactivate_slave(bonded_eth_dev, port_id);
@@ -2718,6 +2727,9 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
NULL);
}
}
+
+ rte_spinlock_unlock(&internals->lsc_lock);
+
return 0;
}
@@ -2922,6 +2934,7 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode)
eth_dev->data->dev_flags = RTE_ETH_DEV_INTR_LSC;
rte_spinlock_init(&internals->lock);
+ rte_spinlock_init(&internals->lsc_lock);
internals->port_id = eth_dev->data->port_id;
internals->mode = BONDING_MODE_INVALID;
diff --git a/drivers/net/bonding/rte_eth_bond_private.h b/drivers/net/bonding/rte_eth_bond_private.h
index 92e15f8cc..2fad25fe1 100644
--- a/drivers/net/bonding/rte_eth_bond_private.h
+++ b/drivers/net/bonding/rte_eth_bond_private.h
@@ -89,6 +89,7 @@ struct bond_dev_private {
uint8_t mode; /**< Link Bonding Mode */
rte_spinlock_t lock;
+ rte_spinlock_t lsc_lock;
uint16_t primary_port; /**< Primary Slave Port */
uint16_t current_primary_port; /**< Primary Slave Port */
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'mempool: fix virtual address population' has been queued to stable release 18.02.2
2018-05-15 13:53 ` [dpdk-stable] patch 'net/bonding: fix slave activation simultaneously' " luca.boccassi
@ 2018-05-16 10:13 ` luca.boccassi
2018-05-16 10:13 ` [dpdk-stable] patch 'net/bnx2x: do not cast function pointers as a policy' " luca.boccassi
` (2 more replies)
0 siblings, 3 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-16 10:13 UTC (permalink / raw)
To: Anatoly Burakov; +Cc: Olivier Matz, Andrew Rybchenko, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/18/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 0be1c573e0366a7ebec5c455799a63160952c00d Mon Sep 17 00:00:00 2001
From: Anatoly Burakov <anatoly.burakov@intel.com>
Date: Mon, 14 May 2018 17:06:15 +0100
Subject: [PATCH] mempool: fix virtual address population
[ upstream commit 460354cd4ede8e8cf27710d645524caeecf49b47 ]
Currently, populate_virt will check if mempool is already populated.
This will cause inability to reserve multi-chunk mempools if
contiguous memory is not a hard requirement, because if allocating
all-contiguous memory fails, mempool will retry with virtual addresses
and will call populate_virt. It seems that the original code never
anticipated more than one non-physically contiguous area.
Fix it by removing the check in populate virt. populate_anon() function
calls populate_virt() also, and it can be reasonably inferred that it is
expecting that virtual area is not already populated. Even though a
similar check is already in place there, also add the check that was
part of populate_virt() just in case.
Fixes: aab4f62d6c1c ("mempool: support no hugepage mode")
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
lib/librte_mempool/rte_mempool.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c
index 80bf941c9..abbee587a 100644
--- a/lib/librte_mempool/rte_mempool.c
+++ b/lib/librte_mempool/rte_mempool.c
@@ -491,9 +491,6 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr,
size_t off, phys_len;
int ret, cnt = 0;
- /* mempool must not be populated */
- if (mp->nb_mem_chunks != 0)
- return -EEXIST;
/* address and len must be page-aligned */
if (RTE_PTR_ALIGN_CEIL(addr, pg_sz) != addr)
return -EINVAL;
@@ -662,7 +659,7 @@ rte_mempool_populate_anon(struct rte_mempool *mp)
char *addr;
/* mempool is already populated, error */
- if (!STAILQ_EMPTY(&mp->mem_list)) {
+ if ((!STAILQ_EMPTY(&mp->mem_list)) || mp->nb_mem_chunks != 0) {
rte_errno = EINVAL;
return 0;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bnx2x: do not cast function pointers as a policy' has been queued to stable release 18.02.2
2018-05-16 10:13 ` [dpdk-stable] patch 'mempool: fix virtual address population' " luca.boccassi
@ 2018-05-16 10:13 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
2018-05-16 10:13 ` [dpdk-stable] patch 'net/bnx2x: fix KR2 device check' " luca.boccassi
2018-05-16 10:13 ` [dpdk-stable] patch 'net/bnx2x: fix memzone name overrun' " luca.boccassi
2 siblings, 1 reply; 382+ messages in thread
From: luca.boccassi @ 2018-05-16 10:13 UTC (permalink / raw)
To: Andy Green; +Cc: Rasesh Mody, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/18/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 9fb3dc2c3f0effa4e4c27d43b20b48d7b47509ee Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Mon, 14 May 2018 13:04:28 +0800
Subject: [PATCH] net/bnx2x: do not cast function pointers as a policy
[ upstream commit d88b346d9a75c7ec6c4c973e16920e5e5161bab9 ]
This is stopping the compiler telling you when you have
done something stupid... that is something none of us
can afford...
Now gcc 8.x can tell you did something stupid despite
trying to hide the evidence.
Remove all the "black magic" casts.
Fix the actual problems.
Fixes: b5bf7719221d ("bnx2x: driver support routines")
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Rasesh Mody <rasesh.mody@cavium.com>
---
drivers/net/bnx2x/elink.c | 342 +++++++++++++++++++++++-----------------------
1 file changed, 172 insertions(+), 170 deletions(-)
diff --git a/drivers/net/bnx2x/elink.c b/drivers/net/bnx2x/elink.c
index 9d0f31364..cceae6f9b 100644
--- a/drivers/net/bnx2x/elink.c
+++ b/drivers/net/bnx2x/elink.c
@@ -4143,9 +4143,9 @@ static void elink_sfp_e3_set_transmitter(struct elink_params *params,
elink_set_cfg_pin(sc, cfg_pin + 3, tx_en ^ 1);
}
-static void elink_warpcore_config_init(struct elink_phy *phy,
- struct elink_params *params,
- struct elink_vars *vars)
+static uint8_t elink_warpcore_config_init(struct elink_phy *phy,
+ struct elink_params *params,
+ struct elink_vars *vars)
{
struct bnx2x_softc *sc = params->sc;
uint32_t serdes_net_if;
@@ -4222,7 +4222,7 @@ static void elink_warpcore_config_init(struct elink_phy *phy,
case PORT_HW_CFG_NET_SERDES_IF_DXGXS:
if (vars->line_speed != ELINK_SPEED_20000) {
PMD_DRV_LOG(DEBUG, "Speed not supported yet");
- return;
+ return 0;
}
PMD_DRV_LOG(DEBUG, "Setting 20G DXGXS");
elink_warpcore_set_20G_DXGXS(sc, phy, lane);
@@ -4242,13 +4242,15 @@ static void elink_warpcore_config_init(struct elink_phy *phy,
PMD_DRV_LOG(DEBUG,
"Unsupported Serdes Net Interface 0x%x",
serdes_net_if);
- return;
+ return 0;
}
}
/* Take lane out of reset after configuration is finished */
elink_warpcore_reset_lane(sc, phy, 0);
PMD_DRV_LOG(DEBUG, "Exit config init");
+
+ return 0;
}
static void elink_warpcore_link_reset(struct elink_phy *phy,
@@ -5226,9 +5228,9 @@ static elink_status_t elink_get_link_speed_duplex(struct elink_phy *phy,
return ELINK_STATUS_OK;
}
-static elink_status_t elink_link_settings_status(struct elink_phy *phy,
- struct elink_params *params,
- struct elink_vars *vars)
+static uint8_t elink_link_settings_status(struct elink_phy *phy,
+ struct elink_params *params,
+ struct elink_vars *vars)
{
struct bnx2x_softc *sc = params->sc;
@@ -5299,9 +5301,9 @@ static elink_status_t elink_link_settings_status(struct elink_phy *phy,
return rc;
}
-static elink_status_t elink_warpcore_read_status(struct elink_phy *phy,
- struct elink_params *params,
- struct elink_vars *vars)
+static uint8_t elink_warpcore_read_status(struct elink_phy *phy,
+ struct elink_params *params,
+ struct elink_vars *vars)
{
struct bnx2x_softc *sc = params->sc;
uint8_t lane;
@@ -5520,9 +5522,9 @@ static void elink_set_preemphasis(struct elink_phy *phy,
}
}
-static void elink_xgxs_config_init(struct elink_phy *phy,
- struct elink_params *params,
- struct elink_vars *vars)
+static uint8_t elink_xgxs_config_init(struct elink_phy *phy,
+ struct elink_params *params,
+ struct elink_vars *vars)
{
uint8_t enable_cl73 = (ELINK_SINGLE_MEDIA_DIRECT(params) ||
(params->loopback_mode == ELINK_LOOPBACK_XGXS));
@@ -5567,6 +5569,8 @@ static void elink_xgxs_config_init(struct elink_phy *phy,
elink_initialize_sgmii_process(phy, params, vars);
}
+
+ return 0;
}
static elink_status_t elink_prepare_xgxs(struct elink_phy *phy,
@@ -5751,8 +5755,8 @@ static void elink_link_int_ack(struct elink_params *params,
}
}
-static elink_status_t elink_format_ver(uint32_t num, uint8_t * str,
- uint16_t * len)
+static uint8_t elink_format_ver(uint32_t num, uint8_t * str,
+ uint16_t * len)
{
uint8_t *str_ptr = str;
uint32_t mask = 0xf0000000;
@@ -5790,8 +5794,8 @@ static elink_status_t elink_format_ver(uint32_t num, uint8_t * str,
return ELINK_STATUS_OK;
}
-static elink_status_t elink_null_format_ver(__rte_unused uint32_t spirom_ver,
- uint8_t * str, uint16_t * len)
+static uint8_t elink_null_format_ver(__rte_unused uint32_t spirom_ver,
+ uint8_t * str, uint16_t * len)
{
str[0] = '\0';
(*len)--;
@@ -6802,9 +6806,9 @@ static void elink_8073_specific_func(struct elink_phy *phy,
}
}
-static elink_status_t elink_8073_config_init(struct elink_phy *phy,
- struct elink_params *params,
- struct elink_vars *vars)
+static uint8_t elink_8073_config_init(struct elink_phy *phy,
+ struct elink_params *params,
+ struct elink_vars *vars)
{
struct bnx2x_softc *sc = params->sc;
uint16_t val = 0, tmp1;
@@ -7097,9 +7101,9 @@ static void elink_8073_link_reset(__rte_unused struct elink_phy *phy,
/******************************************************************/
/* BNX2X8705 PHY SECTION */
/******************************************************************/
-static elink_status_t elink_8705_config_init(struct elink_phy *phy,
- struct elink_params *params,
- __rte_unused struct elink_vars
+static uint8_t elink_8705_config_init(struct elink_phy *phy,
+ struct elink_params *params,
+ __rte_unused struct elink_vars
*vars)
{
struct bnx2x_softc *sc = params->sc;
@@ -8403,9 +8407,9 @@ static uint8_t elink_8706_config_init(struct elink_phy *phy,
return ELINK_STATUS_OK;
}
-static elink_status_t elink_8706_read_status(struct elink_phy *phy,
- struct elink_params *params,
- struct elink_vars *vars)
+static uint8_t elink_8706_read_status(struct elink_phy *phy,
+ struct elink_params *params,
+ struct elink_vars *vars)
{
return elink_8706_8726_read_status(phy, params, vars);
}
@@ -8477,9 +8481,9 @@ static uint8_t elink_8726_read_status(struct elink_phy *phy,
return link_up;
}
-static elink_status_t elink_8726_config_init(struct elink_phy *phy,
- struct elink_params *params,
- struct elink_vars *vars)
+static uint8_t elink_8726_config_init(struct elink_phy *phy,
+ struct elink_params *params,
+ struct elink_vars *vars)
{
struct bnx2x_softc *sc = params->sc;
PMD_DRV_LOG(DEBUG, "Initializing BNX2X8726");
@@ -8684,9 +8688,9 @@ static void elink_8727_config_speed(struct elink_phy *phy,
}
}
-static elink_status_t elink_8727_config_init(struct elink_phy *phy,
- struct elink_params *params,
- __rte_unused struct elink_vars
+static uint8_t elink_8727_config_init(struct elink_phy *phy,
+ struct elink_params *params,
+ __rte_unused struct elink_vars
*vars)
{
uint32_t tx_en_mode;
@@ -9291,7 +9295,7 @@ static elink_status_t elink_848xx_cmn_config_init(struct elink_phy *phy,
return ELINK_STATUS_OK;
}
-static elink_status_t elink_8481_config_init(struct elink_phy *phy,
+static uint8_t elink_8481_config_init(struct elink_phy *phy,
struct elink_params *params,
struct elink_vars *vars)
{
@@ -9442,8 +9446,8 @@ static uint8_t elink_84833_get_reset_gpios(struct bnx2x_softc *sc,
return reset_gpios;
}
-static elink_status_t elink_84833_hw_reset_phy(struct elink_phy *phy,
- struct elink_params *params)
+static void elink_84833_hw_reset_phy(struct elink_phy *phy,
+ struct elink_params *params)
{
struct bnx2x_softc *sc = params->sc;
uint8_t reset_gpios;
@@ -9471,8 +9475,6 @@ static elink_status_t elink_84833_hw_reset_phy(struct elink_phy *phy,
MISC_REGISTERS_GPIO_OUTPUT_LOW);
DELAY(10);
PMD_DRV_LOG(DEBUG, "84833 hw reset on pin values 0x%x", reset_gpios);
-
- return ELINK_STATUS_OK;
}
static elink_status_t elink_8483x_disable_eee(struct elink_phy *phy,
@@ -9513,9 +9515,9 @@ static elink_status_t elink_8483x_enable_eee(struct elink_phy *phy,
}
#define PHY84833_CONSTANT_LATENCY 1193
-static elink_status_t elink_848x3_config_init(struct elink_phy *phy,
- struct elink_params *params,
- struct elink_vars *vars)
+static uint8_t elink_848x3_config_init(struct elink_phy *phy,
+ struct elink_params *params,
+ struct elink_vars *vars)
{
struct bnx2x_softc *sc = params->sc;
uint8_t port, initialize = 1;
@@ -9819,7 +9821,7 @@ static uint8_t elink_848xx_read_status(struct elink_phy *phy,
return link_up;
}
-static elink_status_t elink_848xx_format_ver(uint32_t raw_ver, uint8_t * str,
+static uint8_t elink_848xx_format_ver(uint32_t raw_ver, uint8_t * str,
uint16_t * len)
{
elink_status_t status = ELINK_STATUS_OK;
@@ -10146,9 +10148,9 @@ static void elink_54618se_specific_func(struct elink_phy *phy,
}
}
-static elink_status_t elink_54618se_config_init(struct elink_phy *phy,
- struct elink_params *params,
- struct elink_vars *vars)
+static uint8_t elink_54618se_config_init(struct elink_phy *phy,
+ struct elink_params *params,
+ struct elink_vars *vars)
{
struct bnx2x_softc *sc = params->sc;
uint8_t port;
@@ -10542,9 +10544,9 @@ static void elink_7101_config_loopback(struct elink_phy *phy,
MDIO_XS_DEVAD, MDIO_XS_SFX7101_XGXS_TEST1, 0x100);
}
-static elink_status_t elink_7101_config_init(struct elink_phy *phy,
- struct elink_params *params,
- struct elink_vars *vars)
+static uint8_t elink_7101_config_init(struct elink_phy *phy,
+ struct elink_params *params,
+ struct elink_vars *vars)
{
uint16_t fw_ver1, fw_ver2, val;
struct bnx2x_softc *sc = params->sc;
@@ -10614,8 +10616,8 @@ static uint8_t elink_7101_read_status(struct elink_phy *phy,
return link_up;
}
-static elink_status_t elink_7101_format_ver(uint32_t spirom_ver, uint8_t * str,
- uint16_t * len)
+static uint8_t elink_7101_format_ver(uint32_t spirom_ver, uint8_t * str,
+ uint16_t * len)
{
if (*len < 5)
return ELINK_STATUS_ERROR;
@@ -10680,14 +10682,14 @@ static const struct elink_phy phy_null = {
.speed_cap_mask = 0,
.req_duplex = 0,
.rsrv = 0,
- .config_init = (config_init_t) NULL,
- .read_status = (read_status_t) NULL,
- .link_reset = (link_reset_t) NULL,
- .config_loopback = (config_loopback_t) NULL,
- .format_fw_ver = (format_fw_ver_t) NULL,
- .hw_reset = (hw_reset_t) NULL,
- .set_link_led = (set_link_led_t) NULL,
- .phy_specific_func = (phy_specific_func_t) NULL
+ .config_init = NULL,
+ .read_status = NULL,
+ .link_reset = NULL,
+ .config_loopback = NULL,
+ .format_fw_ver = NULL,
+ .hw_reset = NULL,
+ .set_link_led = NULL,
+ .phy_specific_func = NULL
};
static const struct elink_phy phy_serdes = {
@@ -10714,14 +10716,14 @@ static const struct elink_phy phy_serdes = {
.speed_cap_mask = 0,
.req_duplex = 0,
.rsrv = 0,
- .config_init = (config_init_t) elink_xgxs_config_init,
- .read_status = (read_status_t) elink_link_settings_status,
- .link_reset = (link_reset_t) elink_int_link_reset,
- .config_loopback = (config_loopback_t) NULL,
- .format_fw_ver = (format_fw_ver_t) NULL,
- .hw_reset = (hw_reset_t) NULL,
- .set_link_led = (set_link_led_t) NULL,
- .phy_specific_func = (phy_specific_func_t) NULL
+ .config_init = elink_xgxs_config_init,
+ .read_status = elink_link_settings_status,
+ .link_reset = elink_int_link_reset,
+ .config_loopback = NULL,
+ .format_fw_ver = NULL,
+ .hw_reset = NULL,
+ .set_link_led = NULL,
+ .phy_specific_func = NULL
};
static const struct elink_phy phy_xgxs = {
@@ -10749,14 +10751,14 @@ static const struct elink_phy phy_xgxs = {
.speed_cap_mask = 0,
.req_duplex = 0,
.rsrv = 0,
- .config_init = (config_init_t) elink_xgxs_config_init,
- .read_status = (read_status_t) elink_link_settings_status,
- .link_reset = (link_reset_t) elink_int_link_reset,
- .config_loopback = (config_loopback_t) elink_set_xgxs_loopback,
- .format_fw_ver = (format_fw_ver_t) NULL,
- .hw_reset = (hw_reset_t) NULL,
- .set_link_led = (set_link_led_t) NULL,
- .phy_specific_func = (phy_specific_func_t) elink_xgxs_specific_func
+ .config_init = elink_xgxs_config_init,
+ .read_status = elink_link_settings_status,
+ .link_reset = elink_int_link_reset,
+ .config_loopback = elink_set_xgxs_loopback,
+ .format_fw_ver = NULL,
+ .hw_reset = NULL,
+ .set_link_led = NULL,
+ .phy_specific_func = elink_xgxs_specific_func
};
static const struct elink_phy phy_warpcore = {
@@ -10785,14 +10787,14 @@ static const struct elink_phy phy_warpcore = {
.speed_cap_mask = 0,
/* req_duplex = */ 0,
/* rsrv = */ 0,
- .config_init = (config_init_t) elink_warpcore_config_init,
- .read_status = (read_status_t) elink_warpcore_read_status,
- .link_reset = (link_reset_t) elink_warpcore_link_reset,
- .config_loopback = (config_loopback_t) elink_set_warpcore_loopback,
- .format_fw_ver = (format_fw_ver_t) NULL,
- .hw_reset = (hw_reset_t) elink_warpcore_hw_reset,
- .set_link_led = (set_link_led_t) NULL,
- .phy_specific_func = (phy_specific_func_t) NULL
+ .config_init = elink_warpcore_config_init,
+ .read_status = elink_warpcore_read_status,
+ .link_reset = elink_warpcore_link_reset,
+ .config_loopback = elink_set_warpcore_loopback,
+ .format_fw_ver = NULL,
+ .hw_reset = elink_warpcore_hw_reset,
+ .set_link_led = NULL,
+ .phy_specific_func = NULL
};
static const struct elink_phy phy_7101 = {
@@ -10814,14 +10816,14 @@ static const struct elink_phy phy_7101 = {
.speed_cap_mask = 0,
.req_duplex = 0,
.rsrv = 0,
- .config_init = (config_init_t) elink_7101_config_init,
- .read_status = (read_status_t) elink_7101_read_status,
- .link_reset = (link_reset_t) elink_common_ext_link_reset,
- .config_loopback = (config_loopback_t) elink_7101_config_loopback,
- .format_fw_ver = (format_fw_ver_t) elink_7101_format_ver,
- .hw_reset = (hw_reset_t) elink_7101_hw_reset,
- .set_link_led = (set_link_led_t) elink_7101_set_link_led,
- .phy_specific_func = (phy_specific_func_t) NULL
+ .config_init = elink_7101_config_init,
+ .read_status = elink_7101_read_status,
+ .link_reset = elink_common_ext_link_reset,
+ .config_loopback = elink_7101_config_loopback,
+ .format_fw_ver = elink_7101_format_ver,
+ .hw_reset = elink_7101_hw_reset,
+ .set_link_led = elink_7101_set_link_led,
+ .phy_specific_func = NULL
};
static const struct elink_phy phy_8073 = {
@@ -10845,14 +10847,14 @@ static const struct elink_phy phy_8073 = {
.speed_cap_mask = 0,
.req_duplex = 0,
.rsrv = 0,
- .config_init = (config_init_t) elink_8073_config_init,
- .read_status = (read_status_t) elink_8073_read_status,
- .link_reset = (link_reset_t) elink_8073_link_reset,
- .config_loopback = (config_loopback_t) NULL,
- .format_fw_ver = (format_fw_ver_t) elink_format_ver,
- .hw_reset = (hw_reset_t) NULL,
- .set_link_led = (set_link_led_t) NULL,
- .phy_specific_func = (phy_specific_func_t) elink_8073_specific_func
+ .config_init = elink_8073_config_init,
+ .read_status = elink_8073_read_status,
+ .link_reset = elink_8073_link_reset,
+ .config_loopback = NULL,
+ .format_fw_ver = elink_format_ver,
+ .hw_reset = NULL,
+ .set_link_led = NULL,
+ .phy_specific_func = elink_8073_specific_func
};
static const struct elink_phy phy_8705 = {
@@ -10873,14 +10875,14 @@ static const struct elink_phy phy_8705 = {
.speed_cap_mask = 0,
.req_duplex = 0,
.rsrv = 0,
- .config_init = (config_init_t) elink_8705_config_init,
- .read_status = (read_status_t) elink_8705_read_status,
- .link_reset = (link_reset_t) elink_common_ext_link_reset,
- .config_loopback = (config_loopback_t) NULL,
- .format_fw_ver = (format_fw_ver_t) elink_null_format_ver,
- .hw_reset = (hw_reset_t) NULL,
- .set_link_led = (set_link_led_t) NULL,
- .phy_specific_func = (phy_specific_func_t) NULL
+ .config_init = elink_8705_config_init,
+ .read_status = elink_8705_read_status,
+ .link_reset = elink_common_ext_link_reset,
+ .config_loopback = NULL,
+ .format_fw_ver = elink_null_format_ver,
+ .hw_reset = NULL,
+ .set_link_led = NULL,
+ .phy_specific_func = NULL
};
static const struct elink_phy phy_8706 = {
@@ -10902,14 +10904,14 @@ static const struct elink_phy phy_8706 = {
.speed_cap_mask = 0,
.req_duplex = 0,
.rsrv = 0,
- .config_init = (config_init_t) elink_8706_config_init,
- .read_status = (read_status_t) elink_8706_read_status,
- .link_reset = (link_reset_t) elink_common_ext_link_reset,
- .config_loopback = (config_loopback_t) NULL,
- .format_fw_ver = (format_fw_ver_t) elink_format_ver,
- .hw_reset = (hw_reset_t) NULL,
- .set_link_led = (set_link_led_t) NULL,
- .phy_specific_func = (phy_specific_func_t) NULL
+ .config_init = elink_8706_config_init,
+ .read_status = elink_8706_read_status,
+ .link_reset = elink_common_ext_link_reset,
+ .config_loopback = NULL,
+ .format_fw_ver = elink_format_ver,
+ .hw_reset = NULL,
+ .set_link_led = NULL,
+ .phy_specific_func = NULL
};
static const struct elink_phy phy_8726 = {
@@ -10932,14 +10934,14 @@ static const struct elink_phy phy_8726 = {
.speed_cap_mask = 0,
.req_duplex = 0,
.rsrv = 0,
- .config_init = (config_init_t) elink_8726_config_init,
- .read_status = (read_status_t) elink_8726_read_status,
- .link_reset = (link_reset_t) elink_8726_link_reset,
- .config_loopback = (config_loopback_t) elink_8726_config_loopback,
- .format_fw_ver = (format_fw_ver_t) elink_format_ver,
- .hw_reset = (hw_reset_t) NULL,
- .set_link_led = (set_link_led_t) NULL,
- .phy_specific_func = (phy_specific_func_t) NULL
+ .config_init = elink_8726_config_init,
+ .read_status = elink_8726_read_status,
+ .link_reset = elink_8726_link_reset,
+ .config_loopback = elink_8726_config_loopback,
+ .format_fw_ver = elink_format_ver,
+ .hw_reset = NULL,
+ .set_link_led = NULL,
+ .phy_specific_func = NULL
};
static const struct elink_phy phy_8727 = {
@@ -10961,14 +10963,14 @@ static const struct elink_phy phy_8727 = {
.speed_cap_mask = 0,
.req_duplex = 0,
.rsrv = 0,
- .config_init = (config_init_t) elink_8727_config_init,
- .read_status = (read_status_t) elink_8727_read_status,
- .link_reset = (link_reset_t) elink_8727_link_reset,
- .config_loopback = (config_loopback_t) NULL,
- .format_fw_ver = (format_fw_ver_t) elink_format_ver,
- .hw_reset = (hw_reset_t) elink_8727_hw_reset,
- .set_link_led = (set_link_led_t) elink_8727_set_link_led,
- .phy_specific_func = (phy_specific_func_t) elink_8727_specific_func
+ .config_init = elink_8727_config_init,
+ .read_status = elink_8727_read_status,
+ .link_reset = elink_8727_link_reset,
+ .config_loopback = NULL,
+ .format_fw_ver = elink_format_ver,
+ .hw_reset = elink_8727_hw_reset,
+ .set_link_led = elink_8727_set_link_led,
+ .phy_specific_func = elink_8727_specific_func
};
static const struct elink_phy phy_8481 = {
@@ -10996,14 +10998,14 @@ static const struct elink_phy phy_8481 = {
.speed_cap_mask = 0,
.req_duplex = 0,
.rsrv = 0,
- .config_init = (config_init_t) elink_8481_config_init,
- .read_status = (read_status_t) elink_848xx_read_status,
- .link_reset = (link_reset_t) elink_8481_link_reset,
- .config_loopback = (config_loopback_t) NULL,
- .format_fw_ver = (format_fw_ver_t) elink_848xx_format_ver,
- .hw_reset = (hw_reset_t) elink_8481_hw_reset,
- .set_link_led = (set_link_led_t) elink_848xx_set_link_led,
- .phy_specific_func = (phy_specific_func_t) NULL
+ .config_init = elink_8481_config_init,
+ .read_status = elink_848xx_read_status,
+ .link_reset = elink_8481_link_reset,
+ .config_loopback = NULL,
+ .format_fw_ver = elink_848xx_format_ver,
+ .hw_reset = elink_8481_hw_reset,
+ .set_link_led = elink_848xx_set_link_led,
+ .phy_specific_func = NULL
};
static const struct elink_phy phy_84823 = {
@@ -11031,14 +11033,14 @@ static const struct elink_phy phy_84823 = {
.speed_cap_mask = 0,
.req_duplex = 0,
.rsrv = 0,
- .config_init = (config_init_t) elink_848x3_config_init,
- .read_status = (read_status_t) elink_848xx_read_status,
- .link_reset = (link_reset_t) elink_848x3_link_reset,
- .config_loopback = (config_loopback_t) NULL,
- .format_fw_ver = (format_fw_ver_t) elink_848xx_format_ver,
- .hw_reset = (hw_reset_t) NULL,
- .set_link_led = (set_link_led_t) elink_848xx_set_link_led,
- .phy_specific_func = (phy_specific_func_t) elink_848xx_specific_func
+ .config_init = elink_848x3_config_init,
+ .read_status = elink_848xx_read_status,
+ .link_reset = elink_848x3_link_reset,
+ .config_loopback = NULL,
+ .format_fw_ver = elink_848xx_format_ver,
+ .hw_reset = NULL,
+ .set_link_led = elink_848xx_set_link_led,
+ .phy_specific_func = elink_848xx_specific_func
};
static const struct elink_phy phy_84833 = {
@@ -11065,14 +11067,14 @@ static const struct elink_phy phy_84833 = {
.speed_cap_mask = 0,
.req_duplex = 0,
.rsrv = 0,
- .config_init = (config_init_t) elink_848x3_config_init,
- .read_status = (read_status_t) elink_848xx_read_status,
- .link_reset = (link_reset_t) elink_848x3_link_reset,
- .config_loopback = (config_loopback_t) NULL,
- .format_fw_ver = (format_fw_ver_t) elink_848xx_format_ver,
- .hw_reset = (hw_reset_t) elink_84833_hw_reset_phy,
- .set_link_led = (set_link_led_t) elink_848xx_set_link_led,
- .phy_specific_func = (phy_specific_func_t) elink_848xx_specific_func
+ .config_init = elink_848x3_config_init,
+ .read_status = elink_848xx_read_status,
+ .link_reset = elink_848x3_link_reset,
+ .config_loopback = NULL,
+ .format_fw_ver = elink_848xx_format_ver,
+ .hw_reset = elink_84833_hw_reset_phy,
+ .set_link_led = elink_848xx_set_link_led,
+ .phy_specific_func = elink_848xx_specific_func
};
static const struct elink_phy phy_84834 = {
@@ -11098,14 +11100,14 @@ static const struct elink_phy phy_84834 = {
.speed_cap_mask = 0,
.req_duplex = 0,
.rsrv = 0,
- .config_init = (config_init_t) elink_848x3_config_init,
- .read_status = (read_status_t) elink_848xx_read_status,
- .link_reset = (link_reset_t) elink_848x3_link_reset,
- .config_loopback = (config_loopback_t) NULL,
- .format_fw_ver = (format_fw_ver_t) elink_848xx_format_ver,
- .hw_reset = (hw_reset_t) elink_84833_hw_reset_phy,
- .set_link_led = (set_link_led_t) elink_848xx_set_link_led,
- .phy_specific_func = (phy_specific_func_t) elink_848xx_specific_func
+ .config_init = elink_848x3_config_init,
+ .read_status = elink_848xx_read_status,
+ .link_reset = elink_848x3_link_reset,
+ .config_loopback = NULL,
+ .format_fw_ver = elink_848xx_format_ver,
+ .hw_reset = elink_84833_hw_reset_phy,
+ .set_link_led = elink_848xx_set_link_led,
+ .phy_specific_func = elink_848xx_specific_func
};
static const struct elink_phy phy_54618se = {
@@ -11131,14 +11133,14 @@ static const struct elink_phy phy_54618se = {
.speed_cap_mask = 0,
/* req_duplex = */ 0,
/* rsrv = */ 0,
- .config_init = (config_init_t) elink_54618se_config_init,
- .read_status = (read_status_t) elink_54618se_read_status,
- .link_reset = (link_reset_t) elink_54618se_link_reset,
- .config_loopback = (config_loopback_t) elink_54618se_config_loopback,
- .format_fw_ver = (format_fw_ver_t) NULL,
- .hw_reset = (hw_reset_t) NULL,
- .set_link_led = (set_link_led_t) elink_5461x_set_link_led,
- .phy_specific_func = (phy_specific_func_t) elink_54618se_specific_func
+ .config_init = elink_54618se_config_init,
+ .read_status = elink_54618se_read_status,
+ .link_reset = elink_54618se_link_reset,
+ .config_loopback = elink_54618se_config_loopback,
+ .format_fw_ver = NULL,
+ .hw_reset = NULL,
+ .set_link_led = elink_5461x_set_link_led,
+ .phy_specific_func = elink_54618se_specific_func
};
/*****************************************************************/
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' has been queued to stable release 18.02.2
2018-05-16 10:13 ` [dpdk-stable] patch 'net/bnx2x: do not cast function pointers as a policy' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'vhost: improve dirty pages logging performance' " luca.boccassi
` (57 more replies)
0 siblings, 58 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Shahaf Shuler; +Cc: Adrien Mazarguil, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 6d97987003e3934445bce722060502251415b0df Mon Sep 17 00:00:00 2001
From: Shahaf Shuler <shahafs@mellanox.com>
Date: Tue, 15 May 2018 09:26:35 +0300
Subject: [PATCH] net/mlx5: fix flow director drop rule deletion crash
[ upstream commit 8fe576ad17a6f091c100dc1c61c11c5fb857f864 ]
Drop flow rules are created on the ETH queue even though the parser layer
matches the flow rule layer (L3/L4)
Fixes: 6f2f4948b236 ("net/mlx5: fix flow director rule deletion crash")
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
drivers/net/mlx5/mlx5_flow.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index b40c3cac7..f48b68945 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -2854,13 +2854,13 @@ mlx5_fdir_filter_delete(struct rte_eth_dev *dev,
if (parser.drop) {
struct ibv_flow_spec_action_drop *drop;
- drop = (void *)((uintptr_t)parser.queue[parser.layer].ibv_attr +
- parser.queue[parser.layer].offset);
+ drop = (void *)((uintptr_t)parser.queue[HASH_RXQ_ETH].ibv_attr +
+ parser.queue[HASH_RXQ_ETH].offset);
*drop = (struct ibv_flow_spec_action_drop){
.type = IBV_FLOW_SPEC_ACTION_DROP,
.size = sizeof(struct ibv_flow_spec_action_drop),
};
- parser.queue[parser.layer].ibv_attr->num_of_specs++;
+ parser.queue[HASH_RXQ_ETH].ibv_attr->num_of_specs++;
}
TAILQ_FOREACH(flow, &priv->flows, next) {
struct ibv_flow_attr *attr;
@@ -2870,11 +2870,14 @@ mlx5_fdir_filter_delete(struct rte_eth_dev *dev,
struct ibv_spec_header *flow_h;
void *flow_spec;
unsigned int specs_n;
+ unsigned int queue_id = parser.drop ? HASH_RXQ_ETH :
+ parser.layer;
- attr = parser.queue[parser.layer].ibv_attr;
- flow_attr = flow->frxq[parser.layer].ibv_attr;
+ attr = parser.queue[queue_id].ibv_attr;
+ flow_attr = flow->frxq[queue_id].ibv_attr;
/* Compare first the attributes. */
- if (memcmp(attr, flow_attr, sizeof(struct ibv_flow_attr)))
+ if (!flow_attr ||
+ memcmp(attr, flow_attr, sizeof(struct ibv_flow_attr)))
continue;
if (attr->num_of_specs == 0)
continue;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'vhost: improve dirty pages logging performance' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'net/tap: fix isolation mode toggling' " luca.boccassi
` (56 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Maxime Coquelin; +Cc: Michael S . Tsirkin, Tiwei Bie, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From e11c7fff31f2cc91fea4e6acb89f51539b7109da Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin@redhat.com>
Date: Thu, 17 May 2018 13:44:47 +0200
Subject: [PATCH] vhost: improve dirty pages logging performance
[ upstream commit c16915b8710911a75f0fbdb1aa5243f4cdfaf26a ]
This patch caches all dirty pages logging until the used ring index
is updated.
The goal of this optimization is to fix a performance regression
introduced when the vhost library started to use atomic operations
to set bits in the shared dirty log map. While the fix was valid
as previous implementation wasn't safe against concurrent accesses,
contention was induced.
With this patch, during migration, we have:
1. Less atomic operations as only a single atomic OR operation
per 32 or 64 (depending on CPU) pages.
2. Less atomic operations as during a burst, the same page will
be marked dirty only once.
3. Less write memory barriers.
Fixes: 897f13a1f726 ("vhost: make page logging atomic")
Suggested-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
---
lib/librte_vhost/vhost.h | 119 +++++++++++++++++++++++++++++++++++++++++-
lib/librte_vhost/virtio_net.c | 29 ++++++----
2 files changed, 137 insertions(+), 11 deletions(-)
diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
index bab0b456e..b3b8bc2e0 100644
--- a/lib/librte_vhost/vhost.h
+++ b/lib/librte_vhost/vhost.h
@@ -32,6 +32,8 @@
#define BUF_VECTOR_MAX 256
+#define VHOST_LOG_CACHE_NR 32
+
/**
* Structure contains buffer address, length and descriptor index
* from vring to do scatter RX.
@@ -65,6 +67,14 @@ struct batch_copy_elem {
uint64_t log_addr;
};
+/*
+ * Structure that contains the info for batched dirty logging.
+ */
+struct log_cache_entry {
+ uint32_t offset;
+ unsigned long val;
+};
+
/**
* Structure contains variables relevant to RX/TX virtqueues.
*/
@@ -108,6 +118,9 @@ struct vhost_virtqueue {
struct batch_copy_elem *batch_copy_elems;
uint16_t batch_copy_nb_elems;
+ struct log_cache_entry log_cache[VHOST_LOG_CACHE_NR];
+ uint16_t log_cache_nb_elem;
+
rte_rwlock_t iotlb_lock;
rte_rwlock_t iotlb_pending_lock;
struct rte_mempool *iotlb_pool;
@@ -252,7 +265,15 @@ struct virtio_net {
static __rte_always_inline void
vhost_set_bit(unsigned int nr, volatile uint8_t *addr)
{
- __sync_fetch_and_or_8(addr, (1U << nr));
+#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION < 70100)
+ /*
+ * __sync_ built-ins are deprecated, but __atomic_ ones
+ * are sub-optimized in older GCC versions.
+ */
+ __sync_fetch_and_or_1(addr, (1U << nr));
+#else
+ __atomic_fetch_or(addr, (1U << nr), __ATOMIC_RELAXED);
+#endif
}
static __rte_always_inline void
@@ -283,6 +304,102 @@ vhost_log_write(struct virtio_net *dev, uint64_t addr, uint64_t len)
}
}
+static __rte_always_inline void
+vhost_log_cache_sync(struct virtio_net *dev, struct vhost_virtqueue *vq)
+{
+ unsigned long *log_base;
+ int i;
+
+ if (likely(((dev->features & (1ULL << VHOST_F_LOG_ALL)) == 0) ||
+ !dev->log_base))
+ return;
+
+ log_base = (unsigned long *)(uintptr_t)dev->log_base;
+
+ /*
+ * It is expected a write memory barrier has been issued
+ * before this function is called.
+ */
+
+ for (i = 0; i < vq->log_cache_nb_elem; i++) {
+ struct log_cache_entry *elem = vq->log_cache + i;
+
+#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION < 70100)
+ /*
+ * '__sync' builtins are deprecated, but '__atomic' ones
+ * are sub-optimized in older GCC versions.
+ */
+ __sync_fetch_and_or(log_base + elem->offset, elem->val);
+#else
+ __atomic_fetch_or(log_base + elem->offset, elem->val,
+ __ATOMIC_RELAXED);
+#endif
+ }
+
+ rte_smp_wmb();
+
+ vq->log_cache_nb_elem = 0;
+}
+
+static __rte_always_inline void
+vhost_log_cache_page(struct virtio_net *dev, struct vhost_virtqueue *vq,
+ uint64_t page)
+{
+ uint32_t bit_nr = page % (sizeof(unsigned long) << 3);
+ uint32_t offset = page / (sizeof(unsigned long) << 3);
+ int i;
+
+ for (i = 0; i < vq->log_cache_nb_elem; i++) {
+ struct log_cache_entry *elem = vq->log_cache + i;
+
+ if (elem->offset == offset) {
+ elem->val |= (1UL << bit_nr);
+ return;
+ }
+ }
+
+ if (unlikely(i >= VHOST_LOG_CACHE_NR)) {
+ /*
+ * No more room for a new log cache entry,
+ * so write the dirty log map directly.
+ */
+ rte_smp_wmb();
+ vhost_log_page((uint8_t *)(uintptr_t)dev->log_base, page);
+
+ return;
+ }
+
+ vq->log_cache[i].offset = offset;
+ vq->log_cache[i].val = (1UL << bit_nr);
+}
+
+static __rte_always_inline void
+vhost_log_cache_write(struct virtio_net *dev, struct vhost_virtqueue *vq,
+ uint64_t addr, uint64_t len)
+{
+ uint64_t page;
+
+ if (likely(((dev->features & (1ULL << VHOST_F_LOG_ALL)) == 0) ||
+ !dev->log_base || !len))
+ return;
+
+ if (unlikely(dev->log_size <= ((addr + len - 1) / VHOST_LOG_PAGE / 8)))
+ return;
+
+ page = addr / VHOST_LOG_PAGE;
+ while (page * VHOST_LOG_PAGE < addr + len) {
+ vhost_log_cache_page(dev, vq, page);
+ page += 1;
+ }
+}
+
+static __rte_always_inline void
+vhost_log_cache_used_vring(struct virtio_net *dev, struct vhost_virtqueue *vq,
+ uint64_t offset, uint64_t len)
+{
+ vhost_log_cache_write(dev, vq, vq->log_guest_addr + offset, len);
+}
+
static __rte_always_inline void
vhost_log_used_vring(struct virtio_net *dev, struct vhost_virtqueue *vq,
uint64_t offset, uint64_t len)
diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
index 5fdd4172b..ac42cdbd0 100644
--- a/lib/librte_vhost/virtio_net.c
+++ b/lib/librte_vhost/virtio_net.c
@@ -78,7 +78,7 @@ do_flush_shadow_used_ring(struct virtio_net *dev, struct vhost_virtqueue *vq,
rte_memcpy(&vq->used->ring[to],
&vq->shadow_used_ring[from],
size * sizeof(struct vring_used_elem));
- vhost_log_used_vring(dev, vq,
+ vhost_log_cache_used_vring(dev, vq,
offsetof(struct vring_used, ring[to]),
size * sizeof(struct vring_used_elem));
}
@@ -106,6 +106,8 @@ flush_shadow_used_ring(struct virtio_net *dev, struct vhost_virtqueue *vq)
rte_smp_wmb();
+ vhost_log_cache_sync(dev, vq);
+
*(volatile uint16_t *)&vq->used->idx += vq->shadow_used_idx;
vhost_log_used_vring(dev, vq, offsetof(struct vring_used, idx),
sizeof(vq->used->idx));
@@ -130,7 +132,7 @@ do_data_copy_enqueue(struct virtio_net *dev, struct vhost_virtqueue *vq)
for (i = 0; i < count; i++) {
rte_memcpy(elem[i].dst, elem[i].src, elem[i].len);
- vhost_log_write(dev, elem[i].log_addr, elem[i].len);
+ vhost_log_cache_write(dev, vq, elem[i].log_addr, elem[i].len);
PRINT_PACKET(dev, (uintptr_t)elem[i].dst, elem[i].len, 0);
}
}
@@ -251,7 +253,7 @@ copy_mbuf_to_desc(struct virtio_net *dev, struct vhost_virtqueue *vq,
virtio_enqueue_offload(m,
(struct virtio_net_hdr *)(uintptr_t)desc_addr);
PRINT_PACKET(dev, (uintptr_t)desc_addr, dev->vhost_hlen, 0);
- vhost_log_write(dev, desc_gaddr, dev->vhost_hlen);
+ vhost_log_cache_write(dev, vq, desc_gaddr, dev->vhost_hlen);
} else {
struct virtio_net_hdr vnet_hdr;
uint64_t remain = dev->vhost_hlen;
@@ -274,7 +276,7 @@ copy_mbuf_to_desc(struct virtio_net *dev, struct vhost_virtqueue *vq,
(void *)(uintptr_t)src, len);
PRINT_PACKET(dev, (uintptr_t)dst, (uint32_t)len, 0);
- vhost_log_write(dev, guest_addr, len);
+ vhost_log_cache_write(dev, vq, guest_addr, len);
remain -= len;
guest_addr += len;
dst += len;
@@ -355,7 +357,8 @@ copy_mbuf_to_desc(struct virtio_net *dev, struct vhost_virtqueue *vq,
desc_offset)),
rte_pktmbuf_mtod_offset(m, void *, mbuf_offset),
cpy_len);
- vhost_log_write(dev, desc_gaddr + desc_offset, cpy_len);
+ vhost_log_cache_write(dev, vq, desc_gaddr + desc_offset,
+ cpy_len);
PRINT_PACKET(dev, (uintptr_t)(desc_addr + desc_offset),
cpy_len, 0);
} else {
@@ -444,7 +447,7 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id,
vq->used->ring[used_idx].id = desc_indexes[i];
vq->used->ring[used_idx].len = pkts[i]->pkt_len +
dev->vhost_hlen;
- vhost_log_used_vring(dev, vq,
+ vhost_log_cache_used_vring(dev, vq,
offsetof(struct vring_used, ring[used_idx]),
sizeof(vq->used->ring[used_idx]));
}
@@ -504,6 +507,8 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id,
rte_smp_wmb();
+ vhost_log_cache_sync(dev, vq);
+
*(volatile uint16_t *)&vq->used->idx += count;
vq->last_used_idx += count;
vhost_log_used_vring(dev, vq,
@@ -767,7 +772,8 @@ copy_mbuf_to_desc_mergeable(struct virtio_net *dev, struct vhost_virtqueue *vq,
PRINT_PACKET(dev, (uintptr_t)dst,
(uint32_t)len, 0);
- vhost_log_write(dev, guest_addr, len);
+ vhost_log_cache_write(dev, vq,
+ guest_addr, len);
remain -= len;
guest_addr += len;
@@ -776,7 +782,7 @@ copy_mbuf_to_desc_mergeable(struct virtio_net *dev, struct vhost_virtqueue *vq,
} else {
PRINT_PACKET(dev, (uintptr_t)hdr_addr,
dev->vhost_hlen, 0);
- vhost_log_write(dev, hdr_phys_addr,
+ vhost_log_cache_write(dev, vq, hdr_phys_addr,
dev->vhost_hlen);
}
@@ -790,7 +796,8 @@ copy_mbuf_to_desc_mergeable(struct virtio_net *dev, struct vhost_virtqueue *vq,
desc_offset)),
rte_pktmbuf_mtod_offset(m, void *, mbuf_offset),
cpy_len);
- vhost_log_write(dev, desc_gaddr + desc_offset, cpy_len);
+ vhost_log_cache_write(dev, vq, desc_gaddr + desc_offset,
+ cpy_len);
PRINT_PACKET(dev, (uintptr_t)(desc_addr + desc_offset),
cpy_len, 0);
} else {
@@ -1320,7 +1327,7 @@ update_used_ring(struct virtio_net *dev, struct vhost_virtqueue *vq,
{
vq->used->ring[used_idx].id = desc_idx;
vq->used->ring[used_idx].len = 0;
- vhost_log_used_vring(dev, vq,
+ vhost_log_cache_used_vring(dev, vq,
offsetof(struct vring_used, ring[used_idx]),
sizeof(vq->used->ring[used_idx]));
}
@@ -1335,6 +1342,8 @@ update_used_idx(struct virtio_net *dev, struct vhost_virtqueue *vq,
rte_smp_wmb();
rte_smp_rmb();
+ vhost_log_cache_sync(dev, vq);
+
vq->used->idx += count;
vhost_log_used_vring(dev, vq, offsetof(struct vring_used, idx),
sizeof(vq->used->idx));
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/tap: fix isolation mode toggling' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'vhost: improve dirty pages logging performance' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 13:40 ` Wiles, Keith
2018-05-23 12:09 ` [dpdk-stable] patch 'net/i40e: fix failing to disable FDIR Tx queue' " luca.boccassi
` (55 subsequent siblings)
57 siblings, 1 reply; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Ophir Munk; +Cc: Raslan Darawsheh, Keith Wiles, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From f7b5d10171989dec8a4322594e1d3d8e8790d518 Mon Sep 17 00:00:00 2001
From: Ophir Munk <ophirmu@mellanox.com>
Date: Mon, 14 May 2018 22:26:27 +0000
Subject: [PATCH] net/tap: fix isolation mode toggling
[ upstream commit 2ef1c0da894a9534d41475b8240cff1d04e79fdf ]
Running testpmd command "flow isolae <port> 0" (i.e. disabling flow
isolation) followed by command "flow isolate <port> 1" (i.e. enabling
flow isolation) may result in a TAP error:
PMD: Kernel refused TC filter rule creation (17): File exists
Root cause analysis: when disabling flow isolation we keep the local
rule to redirect packets on TX (TAP_REMOTE_TX index) while we add it
again when enabling flow isolation. As a result this rule is added
two times in a row which results in "File exists" error.
The fix is to identify the "File exists" error and silently ignore it.
Another issue occurs when enabling isolation mode several times in a
row in which case the same tc rules are added consecutively and
rte_flow structs are added to a linked list before removing the
previous rte_flow structs.
The fix is to act upon isolation mode command only when there is a
change from "0" to "1" (or vice versa).
Fixes: f503d2694825 ("net/tap: support flow API isolated mode")
Reviewed-by: Raslan Darawsheh <rasland@mellanox.com>
Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
---
drivers/net/tap/tap_flow.c | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/drivers/net/tap/tap_flow.c b/drivers/net/tap/tap_flow.c
index 551b2d83d..84ecf0936 100644
--- a/drivers/net/tap/tap_flow.c
+++ b/drivers/net/tap/tap_flow.c
@@ -1545,10 +1545,14 @@ tap_flow_isolate(struct rte_eth_dev *dev,
{
struct pmd_internals *pmd = dev->data->dev_private;
+ /* normalize 'set' variable to contain 0 or 1 values */
if (set)
- pmd->flow_isolate = 1;
- else
- pmd->flow_isolate = 0;
+ set = 1;
+ /* if already in the right isolation mode - nothing to do */
+ if ((set ^ pmd->flow_isolate) == 0)
+ return 0;
+ /* mark the isolation mode for tap_flow_implicit_create() */
+ pmd->flow_isolate = set;
/*
* If netdevice is there, setup appropriate flow rules immediately.
* Otherwise it will be set when bringing up the netdevice (tun_alloc).
@@ -1556,20 +1560,20 @@ tap_flow_isolate(struct rte_eth_dev *dev,
if (!pmd->rxq[0].fd)
return 0;
if (set) {
- struct rte_flow *flow;
+ struct rte_flow *remote_flow;
while (1) {
- flow = LIST_FIRST(&pmd->implicit_flows);
- if (!flow)
+ remote_flow = LIST_FIRST(&pmd->implicit_flows);
+ if (!remote_flow)
break;
/*
* Remove all implicit rules on the remote.
* Keep the local rule to redirect packets on TX.
* Keep also the last implicit local rule: ISOLATE.
*/
- if (flow->msg.t.tcm_ifindex == pmd->if_index)
+ if (remote_flow->msg.t.tcm_ifindex == pmd->if_index)
break;
- if (tap_flow_destroy_pmd(pmd, flow, NULL) < 0)
+ if (tap_flow_destroy_pmd(pmd, remote_flow, NULL) < 0)
goto error;
}
/* Switch the TC rule according to pmd->flow_isolate */
@@ -1716,8 +1720,8 @@ int tap_flow_implicit_create(struct pmd_internals *pmd,
}
err = tap_nl_recv_ack(pmd->nlsk_fd);
if (err < 0) {
- /* Silently ignore re-entering remote promiscuous rule */
- if (errno == EEXIST && idx == TAP_REMOTE_PROMISC)
+ /* Silently ignore re-entering existing rule */
+ if (errno == EEXIST)
goto success;
RTE_LOG(ERR, PMD,
"Kernel refused TC filter rule creation (%d): %s\n",
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* Re: [dpdk-stable] patch 'net/tap: fix isolation mode toggling' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/tap: fix isolation mode toggling' " luca.boccassi
@ 2018-05-23 13:40 ` Wiles, Keith
2018-05-23 14:36 ` Luca Boccassi
0 siblings, 1 reply; 382+ messages in thread
From: Wiles, Keith @ 2018-05-23 13:40 UTC (permalink / raw)
To: luca.boccassi; +Cc: Ophir Munk, Raslan Darawsheh, dpdk stable
> On May 23, 2018, at 7:09 AM, luca.boccassi@gmail.com wrote:
>
> Hi,
>
> FYI, your patch has been queued to stable release 18.02.2
>
> Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
> It will be pushed if I get no objections before 05/25/18. So please
> shout if anyone has objections.
>
> Thanks.
>
> Luca Boccassi
>
> ---
> From f7b5d10171989dec8a4322594e1d3d8e8790d518 Mon Sep 17 00:00:00 2001
> From: Ophir Munk <ophirmu@mellanox.com>
> Date: Mon, 14 May 2018 22:26:27 +0000
> Subject: [PATCH] net/tap: fix isolation mode toggling
>
> [ upstream commit 2ef1c0da894a9534d41475b8240cff1d04e79fdf ]
>
> Running testpmd command "flow isolae <port> 0" (i.e. disabling flow
/isolae/isolate/
> isolation) followed by command "flow isolate <port> 1" (i.e. enabling
> flow isolation) may result in a TAP error:
> PMD: Kernel refused TC filter rule creation (17): File exists
>
> Root cause analysis: when disabling flow isolation we keep the local
> rule to redirect packets on TX (TAP_REMOTE_TX index) while we add it
> again when enabling flow isolation. As a result this rule is added
> two times in a row which results in "File exists" error.
> The fix is to identify the "File exists" error and silently ignore it.
>
> Another issue occurs when enabling isolation mode several times in a
> row in which case the same tc rules are added consecutively and
> rte_flow structs are added to a linked list before removing the
> previous rte_flow structs.
> The fix is to act upon isolation mode command only when there is a
> change from "0" to "1" (or vice versa).
>
> Fixes: f503d2694825 ("net/tap: support flow API isolated mode")
>
> Reviewed-by: Raslan Darawsheh <rasland@mellanox.com>
> Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
> Acked-by: Keith Wiles <keith.wiles@intel.com>
> ---
> drivers/net/tap/tap_flow.c | 24 ++++++++++++++----------
> 1 file changed, 14 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/net/tap/tap_flow.c b/drivers/net/tap/tap_flow.c
> index 551b2d83d..84ecf0936 100644
> --- a/drivers/net/tap/tap_flow.c
> +++ b/drivers/net/tap/tap_flow.c
> @@ -1545,10 +1545,14 @@ tap_flow_isolate(struct rte_eth_dev *dev,
> {
> struct pmd_internals *pmd = dev->data->dev_private;
>
> + /* normalize 'set' variable to contain 0 or 1 values */
> if (set)
> - pmd->flow_isolate = 1;
> - else
> - pmd->flow_isolate = 0;
> + set = 1;
> + /* if already in the right isolation mode - nothing to do */
> + if ((set ^ pmd->flow_isolate) == 0)
> + return 0;
> + /* mark the isolation mode for tap_flow_implicit_create() */
> + pmd->flow_isolate = set;
> /*
> * If netdevice is there, setup appropriate flow rules immediately.
> * Otherwise it will be set when bringing up the netdevice (tun_alloc).
> @@ -1556,20 +1560,20 @@ tap_flow_isolate(struct rte_eth_dev *dev,
> if (!pmd->rxq[0].fd)
> return 0;
> if (set) {
> - struct rte_flow *flow;
> + struct rte_flow *remote_flow;
>
> while (1) {
> - flow = LIST_FIRST(&pmd->implicit_flows);
> - if (!flow)
> + remote_flow = LIST_FIRST(&pmd->implicit_flows);
> + if (!remote_flow)
> break;
> /*
> * Remove all implicit rules on the remote.
> * Keep the local rule to redirect packets on TX.
> * Keep also the last implicit local rule: ISOLATE.
> */
> - if (flow->msg.t.tcm_ifindex == pmd->if_index)
> + if (remote_flow->msg.t.tcm_ifindex == pmd->if_index)
> break;
> - if (tap_flow_destroy_pmd(pmd, flow, NULL) < 0)
> + if (tap_flow_destroy_pmd(pmd, remote_flow, NULL) < 0)
> goto error;
> }
> /* Switch the TC rule according to pmd->flow_isolate */
> @@ -1716,8 +1720,8 @@ int tap_flow_implicit_create(struct pmd_internals *pmd,
> }
> err = tap_nl_recv_ack(pmd->nlsk_fd);
> if (err < 0) {
> - /* Silently ignore re-entering remote promiscuous rule */
> - if (errno == EEXIST && idx == TAP_REMOTE_PROMISC)
> + /* Silently ignore re-entering existing rule */
> + if (errno == EEXIST)
> goto success;
> RTE_LOG(ERR, PMD,
> "Kernel refused TC filter rule creation (%d): %s\n",
> --
> 2.14.2
>
Regards,
Keith
^ permalink raw reply [flat|nested] 382+ messages in thread
* Re: [dpdk-stable] patch 'net/tap: fix isolation mode toggling' has been queued to stable release 18.02.2
2018-05-23 13:40 ` Wiles, Keith
@ 2018-05-23 14:36 ` Luca Boccassi
0 siblings, 0 replies; 382+ messages in thread
From: Luca Boccassi @ 2018-05-23 14:36 UTC (permalink / raw)
To: Wiles, Keith; +Cc: Ophir Munk, Raslan Darawsheh, dpdk stable
On Wed, 2018-05-23 at 13:40 +0000, Wiles, Keith wrote:
> > On May 23, 2018, at 7:09 AM, luca.boccassi@gmail.com wrote:
> >
> > Hi,
> >
> > FYI, your patch has been queued to stable release 18.02.2
> >
> > Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable
> > yet.
> > It will be pushed if I get no objections before 05/25/18. So please
> > shout if anyone has objections.
> >
> > Thanks.
> >
> > Luca Boccassi
> >
> > ---
> > From f7b5d10171989dec8a4322594e1d3d8e8790d518 Mon Sep 17 00:00:00
> > 2001
> > From: Ophir Munk <ophirmu@mellanox.com>
> > Date: Mon, 14 May 2018 22:26:27 +0000
> > Subject: [PATCH] net/tap: fix isolation mode toggling
> >
> > [ upstream commit 2ef1c0da894a9534d41475b8240cff1d04e79fdf ]
> >
> > Running testpmd command "flow isolae <port> 0" (i.e. disabling flow
>
> /isolae/isolate/
Fixed, thanks
--
Kind regards,
Luca Boccassi
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/i40e: fix failing to disable FDIR Tx queue' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'vhost: improve dirty pages logging performance' " luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'net/tap: fix isolation mode toggling' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'net/ixgbe: fix too many interrupts' " luca.boccassi
` (54 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Beilei Xing; +Cc: Qi Zhang, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From c56c154c4dd505aac07499c5186c6d4bf67db3e9 Mon Sep 17 00:00:00 2001
From: Beilei Xing <beilei.xing@intel.com>
Date: Wed, 16 May 2018 00:19:05 +0800
Subject: [PATCH] net/i40e: fix failing to disable FDIR Tx queue
[ upstream commit ba2e8c6f29346245c0e1ff23f84fd10e076a9bbc ]
If flow director is enabled, FDIR Tx queue can't
be disabled when exiting application. Root cause
is FDIR Tx queue is not disabled before removing
HMC backing store.
Fixes: 71d35259ff67 ("i40e: tear down flow director")
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
drivers/net/i40e/i40e_ethdev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 4f4456d4a..1ebda8dbd 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2327,6 +2327,8 @@ i40e_dev_close(struct rte_eth_dev *dev)
i40e_pf_disable_irq0(hw);
rte_intr_disable(intr_handle);
+ i40e_fdir_teardown(pf);
+
/* shutdown and destroy the HMC */
i40e_shutdown_lan_hmc(hw);
@@ -2338,7 +2340,6 @@ i40e_dev_close(struct rte_eth_dev *dev)
pf->vmdq = NULL;
/* release all the existing VSIs and VEBs */
- i40e_fdir_teardown(pf);
i40e_vsi_release(pf->main_vsi);
/* shutdown the adminq */
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/ixgbe: fix too many interrupts' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (2 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'net/i40e: fix failing to disable FDIR Tx queue' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'net/avf: fix traffic blocked on reset' " luca.boccassi
` (53 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Wenzhuo Lu; +Cc: Michael Luo, Qi Zhang, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From ef57a7afbc3a68768a4aaa815f8a434e96b88bc2 Mon Sep 17 00:00:00 2001
From: Wenzhuo Lu <wenzhuo.lu@intel.com>
Date: Thu, 17 May 2018 13:34:09 +0800
Subject: [PATCH] net/ixgbe: fix too many interrupts
[ upstream commit 874f79102d2a15dd50293082842006fbc06572c7 ]
To support kernel VF, PBA bit is always set. But it may
cause the too many interrupts issue on specific Linux
kernel versions, e.g. 4.4.0-116.
PF host should set the auto clean, mask and throttling
as we always set the register for kernel VF.
Fixes: 6b75183ac4d0 ("net/ixgbe: fix wrong PBA setting")
Signed-off-by: Michael Luo <michael.luo@intel.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
---
drivers/net/ixgbe/ixgbe_ethdev.c | 49 +++++++++++++++++++++++-----------------
1 file changed, 28 insertions(+), 21 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index c28551322..ad8b4fcc8 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -5813,8 +5813,12 @@ ixgbe_configure_msix(struct rte_eth_dev *dev)
/* won't configure msix register if no mapping is done
* between intr vector and event fd
+ * but if misx has been enabled already, need to configure
+ * auto clean, auto mask and throttling.
*/
- if (!rte_intr_dp_is_en(intr_handle))
+ gpie = IXGBE_READ_REG(hw, IXGBE_GPIE);
+ if (!rte_intr_dp_is_en(intr_handle) &&
+ !(gpie & (IXGBE_GPIE_MSIX_MODE | IXGBE_GPIE_PBA_SUPPORT)))
return;
if (rte_intr_allow_others(intr_handle))
@@ -5838,27 +5842,30 @@ ixgbe_configure_msix(struct rte_eth_dev *dev)
/* Populate the IVAR table and set the ITR values to the
* corresponding register.
*/
- for (queue_id = 0; queue_id < dev->data->nb_rx_queues;
- queue_id++) {
- /* by default, 1:1 mapping */
- ixgbe_set_ivar_map(hw, 0, queue_id, vec);
- intr_handle->intr_vec[queue_id] = vec;
- if (vec < base + intr_handle->nb_efd - 1)
- vec++;
- }
+ if (rte_intr_dp_is_en(intr_handle)) {
+ for (queue_id = 0; queue_id < dev->data->nb_rx_queues;
+ queue_id++) {
+ /* by default, 1:1 mapping */
+ ixgbe_set_ivar_map(hw, 0, queue_id, vec);
+ intr_handle->intr_vec[queue_id] = vec;
+ if (vec < base + intr_handle->nb_efd - 1)
+ vec++;
+ }
- switch (hw->mac.type) {
- case ixgbe_mac_82598EB:
- ixgbe_set_ivar_map(hw, -1, IXGBE_IVAR_OTHER_CAUSES_INDEX,
- IXGBE_MISC_VEC_ID);
- break;
- case ixgbe_mac_82599EB:
- case ixgbe_mac_X540:
- case ixgbe_mac_X550:
- ixgbe_set_ivar_map(hw, -1, 1, IXGBE_MISC_VEC_ID);
- break;
- default:
- break;
+ switch (hw->mac.type) {
+ case ixgbe_mac_82598EB:
+ ixgbe_set_ivar_map(hw, -1,
+ IXGBE_IVAR_OTHER_CAUSES_INDEX,
+ IXGBE_MISC_VEC_ID);
+ break;
+ case ixgbe_mac_82599EB:
+ case ixgbe_mac_X540:
+ case ixgbe_mac_X550:
+ ixgbe_set_ivar_map(hw, -1, 1, IXGBE_MISC_VEC_ID);
+ break;
+ default:
+ break;
+ }
}
IXGBE_WRITE_REG(hw, IXGBE_EITR(IXGBE_MISC_VEC_ID),
IXGBE_MIN_INTER_INTERRUPT_INTERVAL_DEFAULT & 0xFFF);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/avf: fix traffic blocked on reset' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (3 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'net/ixgbe: fix too many interrupts' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx4: fix shifts of signed values in Tx' " luca.boccassi
` (52 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Xiaoyun Li; +Cc: Helin Zhang, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 5157a77937b43944bdb1a5f1ea7448c2a9c59720 Mon Sep 17 00:00:00 2001
From: Xiaoyun Li <xiaoyun.li@intel.com>
Date: Thu, 17 May 2018 19:24:14 +0800
Subject: [PATCH] net/avf: fix traffic blocked on reset
[ upstream commit f59917c840f0077406d393f0a4fb73fb977aee19 ]
When resetting ports, traffic will be blocked. There is a mistake when
getting hw info at avf_dev_stop. This causes the device stop without
stopping queues. This patch fixes this issue.
Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
---
drivers/net/avf/avf_ethdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/avf/avf_ethdev.c b/drivers/net/avf/avf_ethdev.c
index 03f7ce408..3e06d1f03 100644
--- a/drivers/net/avf/avf_ethdev.c
+++ b/drivers/net/avf/avf_ethdev.c
@@ -475,7 +475,7 @@ avf_dev_stop(struct rte_eth_dev *dev)
{
struct avf_adapter *adapter =
AVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
- struct avf_hw *hw = AVF_DEV_PRIVATE_TO_HW(dev);
+ struct avf_hw *hw = AVF_DEV_PRIVATE_TO_HW(dev->data->dev_private);
struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
struct rte_intr_handle *intr_handle = dev->intr_handle;
int ret, i;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/mlx4: fix shifts of signed values in Tx' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (4 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'net/avf: fix traffic blocked on reset' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'net/sfc: fix errno if flow API RSS action parse fails' " luca.boccassi
` (51 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Adrien Mazarguil; +Cc: Ferruh Yigit, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From dc32ae8e71017a3d7a0fd0016fa02656668ac058 Mon Sep 17 00:00:00 2001
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Date: Wed, 16 May 2018 18:20:54 +0200
Subject: [PATCH] net/mlx4: fix shifts of signed values in Tx
[ upstream commit 911bbb0f7cae2c182471bebb4d72895083ce9fb9 ]
This patch addresses the following issues reported by cppcheck:
[drivers/net/mlx4/mlx4_rxtx.c:266]: (error) Shifting signed 32-bit value
by 31 bits is undefined behaviour
[drivers/net/mlx4/mlx4_rxtx.c:624]: (error) Shifting signed 32-bit value
by 31 bits is undefined behaviour
[drivers/net/mlx4/mlx4_txq.c:89]: (error) Shifting signed 32-bit value by
31 bits is undefined behaviour
[drivers/net/mlx4/mlx4_txq.c:91]: (error) Shifting signed 32-bit value by
31 bits is undefined behaviour
Fixes: 78e81a9844f8 ("net/mlx4: merge Tx queue rings management")
Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
drivers/net/mlx4/mlx4_rxtx.c | 4 ++--
drivers/net/mlx4/mlx4_txq.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/mlx4/mlx4_rxtx.c b/drivers/net/mlx4/mlx4_rxtx.c
index 8ca8b77cc..0cff1067f 100644
--- a/drivers/net/mlx4/mlx4_rxtx.c
+++ b/drivers/net/mlx4/mlx4_rxtx.c
@@ -263,7 +263,7 @@ mlx4_txq_stamp_freed_wqe(struct mlx4_sq *sq, volatile uint32_t *start,
} while (start != (volatile uint32_t *)sq->eob);
start = (volatile uint32_t *)sq->buf;
/* Flip invalid stamping ownership. */
- stamp ^= RTE_BE32(0x1 << MLX4_SQ_OWNER_BIT);
+ stamp ^= RTE_BE32(1u << MLX4_SQ_OWNER_BIT);
sq->stamp = stamp;
if (start == end)
return size;
@@ -639,7 +639,7 @@ mlx4_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
ctrl_next = (volatile struct mlx4_wqe_ctrl_seg *)
((volatile uint8_t *)ctrl_next - sq->size);
/* Flip HW valid ownership. */
- sq->owner_opcode ^= 0x1 << MLX4_SQ_OWNER_BIT;
+ sq->owner_opcode ^= 1u << MLX4_SQ_OWNER_BIT;
}
/*
* For raw Ethernet, the SOLICIT flag is used to indicate
diff --git a/drivers/net/mlx4/mlx4_txq.c b/drivers/net/mlx4/mlx4_txq.c
index 071b2d5d8..d1977a735 100644
--- a/drivers/net/mlx4/mlx4_txq.c
+++ b/drivers/net/mlx4/mlx4_txq.c
@@ -144,9 +144,9 @@ mlx4_txq_fill_dv_obj_info(struct txq *txq, struct mlx4dv_obj *mlxdv)
uint32_t headroom_size = 2048 + (1 << dqp->sq.wqe_shift);
/* Continuous headroom size bytes must always stay freed. */
sq->remain_size = sq->size - headroom_size;
- sq->owner_opcode = MLX4_OPCODE_SEND | (0 << MLX4_SQ_OWNER_BIT);
+ sq->owner_opcode = MLX4_OPCODE_SEND | (0u << MLX4_SQ_OWNER_BIT);
sq->stamp = rte_cpu_to_be_32(MLX4_SQ_STAMP_VAL |
- (0 << MLX4_SQ_OWNER_BIT));
+ (0u << MLX4_SQ_OWNER_BIT));
sq->db = dqp->sdb;
sq->doorbell_qpn = dqp->doorbell_qpn;
cq->buf = dcq->buf.buf;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/sfc: fix errno if flow API RSS action parse fails' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (5 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx4: fix shifts of signed values in Tx' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'eal: fix casts in random functions' " luca.boccassi
` (50 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Roman Zhukov; +Cc: Andrew Rybchenko, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From e4657d56b6af3084d312f58ec1a86d467e936f09 Mon Sep 17 00:00:00 2001
From: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Date: Wed, 16 May 2018 15:21:23 +0100
Subject: [PATCH] net/sfc: fix errno if flow API RSS action parse fails
[ upstream commit 1613848c2cd109d525d60cb6e84c9b893ef0ccce ]
The value of rte_errno must be positive in case of an error.
Fixes: d77d07391d4d ("net/sfc: support flow API RSS action")
Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
drivers/net/sfc/sfc_flow.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c
index 58adcbca3..1902e04e9 100644
--- a/drivers/net/sfc/sfc_flow.c
+++ b/drivers/net/sfc/sfc_flow.c
@@ -1063,7 +1063,7 @@ sfc_flow_parse_actions(struct sfc_adapter *sa,
case RTE_FLOW_ACTION_TYPE_RSS:
rc = sfc_flow_parse_rss(sa, actions->conf, flow);
if (rc != 0) {
- rte_flow_error_set(error, rc,
+ rte_flow_error_set(error, -rc,
RTE_FLOW_ERROR_TYPE_ACTION, actions,
"Bad RSS action");
return -rte_errno;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'eal: fix casts in random functions' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (6 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'net/sfc: fix errno if flow API RSS action parse fails' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'eal: explicit cast in constant byte swap' " luca.boccassi
` (49 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Andy Green; +Cc: Bruce Richardson, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 4f4dbdadb7a4206ec07accfb5f39742629ef22aa Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Thu, 17 May 2018 21:49:12 +0800
Subject: [PATCH] eal: fix casts in random functions
[ upstream commit d3db77d7d88e1f9227c2847f3355fc3e4bd256e8 ]
GCC 8.1 warns:
In function 'rte_srand':
rte_random.h:34:10:
warning: conversion to 'long int' from 'long unsigned int'
may change the sign of the result [-Wsign-conversion]
srand48((long unsigned int)seedval);
rte_random.h:51:8:
warning: conversion to 'uint64_t' {aka 'long unsigned int'}
from 'long int' may change the sign of the result
[-Wsign-conversion]
val = lrand48();
^~~~~~~
rte_random.h:53:6:
warning: conversion to 'long unsigned int' from 'long int'
may change the sign of the result [-Wsign-conversion]
val += lrand48();
Fixes: af75078fece3 ("first public release")
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/librte_eal/common/include/rte_random.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/librte_eal/common/include/rte_random.h b/lib/librte_eal/common/include/rte_random.h
index 63bb28088..b2ca1c209 100644
--- a/lib/librte_eal/common/include/rte_random.h
+++ b/lib/librte_eal/common/include/rte_random.h
@@ -31,7 +31,7 @@ extern "C" {
static inline void
rte_srand(uint64_t seedval)
{
- srand48((long unsigned int)seedval);
+ srand48((long)seedval);
}
/**
@@ -48,9 +48,9 @@ static inline uint64_t
rte_rand(void)
{
uint64_t val;
- val = lrand48();
+ val = (uint64_t)lrand48();
val <<= 32;
- val += lrand48();
+ val += (uint64_t)lrand48();
return val;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'eal: explicit cast in constant byte swap' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (7 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'eal: fix casts in random functions' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'ring: remove useless variables' " luca.boccassi
` (48 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Andy Green; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From e911551b9d59bb551c6bf39b468d1d6be1abbfb2 Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Thu, 17 May 2018 21:50:37 +0800
Subject: [PATCH] eal: explicit cast in constant byte swap
[ upstream commit c7bf8093820b0d740e15f166c3fceb1edb2b2a83 ]
GCC 8.1 warns:
rte_byteorder.h: In function 'rte_constant_bswap16':
rte_byteorder.h:54:45: warning: conversion from
'int' to 'uint16_t' {aka 'short unsigned int'}
may change value [-Wconversion]
((((uint16_t)(v) & UINT16_C(0x00ff)) << 8) | \
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
(((uint16_t)(v) & UINT16_C(0xff00)) >> 8))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rte_byteorder.h:126:9: note: in expansion of macro
'RTE_STATIC_BSWAP16'
return RTE_STATIC_BSWAP16(x);
^~~~~~~~~~~~~~~~~~
The other two sizes are going to be afflicted the
same, so get the same fix.
Fixes: b75667ef9f7e ("eal: add static endianness conversion macros")
Signed-off-by: Andy Green <andy@warmcat.com>
---
lib/librte_eal/common/include/generic/rte_byteorder.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/librte_eal/common/include/generic/rte_byteorder.h b/lib/librte_eal/common/include/generic/rte_byteorder.h
index 9bed85cca..7d9a1463c 100644
--- a/lib/librte_eal/common/include/generic/rte_byteorder.h
+++ b/lib/librte_eal/common/include/generic/rte_byteorder.h
@@ -123,7 +123,7 @@ typedef uint64_t rte_le64_t; /**< 64-bit little-endian value. */
static inline uint16_t
rte_constant_bswap16(uint16_t x)
{
- return RTE_STATIC_BSWAP16(x);
+ return (uint16_t)RTE_STATIC_BSWAP16(x);
}
/*
@@ -135,7 +135,7 @@ rte_constant_bswap16(uint16_t x)
static inline uint32_t
rte_constant_bswap32(uint32_t x)
{
- return RTE_STATIC_BSWAP32(x);
+ return (uint32_t)RTE_STATIC_BSWAP32(x);
}
/*
@@ -147,7 +147,7 @@ rte_constant_bswap32(uint32_t x)
static inline uint64_t
rte_constant_bswap64(uint64_t x)
{
- return RTE_STATIC_BSWAP64(x);
+ return (uint64_t)RTE_STATIC_BSWAP64(x);
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'ring: remove useless variables' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (8 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'eal: explicit cast in constant byte swap' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'ring: remove signed type flip-flopping' " luca.boccassi
` (47 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Andy Green; +Cc: Olivier Matz, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From d19a188b625cab7391a037795ac204b4db9d97ff Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Thu, 17 May 2018 21:49:17 +0800
Subject: [PATCH] ring: remove useless variables
[ upstream commit 712a3db0b5b2c7e6380bdeb84b803bb0e0f97c15 ]
There were warnings with GCC 8.1:
In function '__rte_ring_move_prod_head':
rte_ring_generic.h:76:3:
warning: ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
const uint32_t cons_tail = r->cons.tail;
^~~~~
In function '__rte_ring_move_cons_head':
rte_ring_generic.h:147:3:
warning: ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
const uint32_t prod_tail = r->prod.tail;
Fixes: 0dfc98c507b1 ("ring: separate out head index manipulation")
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
lib/librte_ring/rte_ring_generic.h | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/lib/librte_ring/rte_ring_generic.h b/lib/librte_ring/rte_ring_generic.h
index 5b110425f..c2d482bc9 100644
--- a/lib/librte_ring/rte_ring_generic.h
+++ b/lib/librte_ring/rte_ring_generic.h
@@ -73,14 +73,13 @@ __rte_ring_move_prod_head(struct rte_ring *r, int is_sp,
*/
rte_smp_rmb();
- const uint32_t 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
* *old_head > cons_tail). So 'free_entries' is always between 0
* and capacity (which is < size).
*/
- *free_entries = (capacity + cons_tail - *old_head);
+ *free_entries = (capacity + r->cons.tail - *old_head);
/* check that we have enough room in ring */
if (unlikely(n > *free_entries))
@@ -144,13 +143,12 @@ __rte_ring_move_cons_head(struct rte_ring *r, int is_sc,
*/
rte_smp_rmb();
- const uint32_t 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
* cons_head > prod_tail). So 'entries' is always between 0
* and size(ring)-1.
*/
- *entries = (prod_tail - *old_head);
+ *entries = (r->prod.tail - *old_head);
/* Set the actual entries for dequeue */
if (n > *entries)
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'ring: remove signed type flip-flopping' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (9 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'ring: remove useless variables' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'mbuf: fix reference counter integer promotion' " luca.boccassi
` (46 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Andy Green; +Cc: Olivier Matz, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From fd0d1abc83939595cb6a5dd3b21f9d9eec4d4178 Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Thu, 17 May 2018 21:49:22 +0800
Subject: [PATCH] ring: remove signed type flip-flopping
[ upstream commit e8ed5056c8747cd5d95a41749e48987ad44dc9b3 ]
GCC 8.1 warns:
rte_ring.h:350:46:
warning: conversion to 'uint32_t' {aka 'unsigned int'}
from 'int' may change the sign of the result
[-Wsign-conversion]
update_tail(&r->prod, prod_head, prod_next, is_sp, 1);
The visible apis take unsigned int, then call a private
api taking an int, which finally calls an api taking an
unsigned int.
Convert the private api to take unsigned int removing
5 x warning similar to that shown above.
Fixes: 0dfc98c507b1 ("ring: separate out head index manipulation")
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
lib/librte_ring/rte_ring.h | 4 ++--
lib/librte_ring/rte_ring_c11_mem.h | 2 +-
lib/librte_ring/rte_ring_generic.h | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h
index 253cdc96a..91b3657a3 100644
--- a/lib/librte_ring/rte_ring.h
+++ b/lib/librte_ring/rte_ring.h
@@ -339,7 +339,7 @@ void rte_ring_dump(FILE *f, const struct rte_ring *r);
static __rte_always_inline unsigned int
__rte_ring_do_enqueue(struct rte_ring *r, void * const *obj_table,
unsigned int n, enum rte_ring_queue_behavior behavior,
- int is_sp, unsigned int *free_space)
+ unsigned int is_sp, unsigned int *free_space)
{
uint32_t prod_head, prod_next;
uint32_t free_entries;
@@ -381,7 +381,7 @@ end:
static __rte_always_inline unsigned int
__rte_ring_do_dequeue(struct rte_ring *r, void **obj_table,
unsigned int n, enum rte_ring_queue_behavior behavior,
- int is_sc, unsigned int *available)
+ unsigned int is_sc, unsigned int *available)
{
uint32_t cons_head, cons_next;
uint32_t entries;
diff --git a/lib/librte_ring/rte_ring_c11_mem.h b/lib/librte_ring/rte_ring_c11_mem.h
index 08825ea5b..cb3f82b1a 100644
--- a/lib/librte_ring/rte_ring_c11_mem.h
+++ b/lib/librte_ring/rte_ring_c11_mem.h
@@ -51,7 +51,7 @@ update_tail(struct rte_ring_headtail *ht, uint32_t old_val, uint32_t new_val,
* If behavior == RTE_RING_QUEUE_FIXED, this will be 0 or n only.
*/
static __rte_always_inline unsigned int
-__rte_ring_move_prod_head(struct rte_ring *r, int is_sp,
+__rte_ring_move_prod_head(struct rte_ring *r, unsigned int is_sp,
unsigned int n, enum rte_ring_queue_behavior behavior,
uint32_t *old_head, uint32_t *new_head,
uint32_t *free_entries)
diff --git a/lib/librte_ring/rte_ring_generic.h b/lib/librte_ring/rte_ring_generic.h
index c2d482bc9..ea7dbe5b9 100644
--- a/lib/librte_ring/rte_ring_generic.h
+++ b/lib/librte_ring/rte_ring_generic.h
@@ -53,7 +53,7 @@ update_tail(struct rte_ring_headtail *ht, uint32_t old_val, uint32_t new_val,
* If behavior == RTE_RING_QUEUE_FIXED, this will be 0 or n only.
*/
static __rte_always_inline unsigned int
-__rte_ring_move_prod_head(struct rte_ring *r, int is_sp,
+__rte_ring_move_prod_head(struct rte_ring *r, unsigned int is_sp,
unsigned int n, enum rte_ring_queue_behavior behavior,
uint32_t *old_head, uint32_t *new_head,
uint32_t *free_entries)
@@ -123,7 +123,7 @@ __rte_ring_move_prod_head(struct rte_ring *r, int is_sp,
* If behavior == RTE_RING_QUEUE_FIXED, this will be 0 or n only.
*/
static __rte_always_inline unsigned int
-__rte_ring_move_cons_head(struct rte_ring *r, int is_sc,
+__rte_ring_move_cons_head(struct rte_ring *r, unsigned int is_sc,
unsigned int n, enum rte_ring_queue_behavior behavior,
uint32_t *old_head, uint32_t *new_head,
uint32_t *entries)
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'mbuf: fix reference counter integer promotion' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (10 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'ring: remove signed type flip-flopping' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'mbuf: explicit casts of reference counter' " luca.boccassi
` (45 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Andy Green; +Cc: Olivier Matz, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From b7cdf92c0f6f5a209582a1a952f9efe56cbaf0d4 Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Thu, 17 May 2018 21:49:27 +0800
Subject: [PATCH] mbuf: fix reference counter integer promotion
[ upstream commit ee07d519ceb05e59dd970c48a42cf2f09b3ac4dc ]
GCC 8.1 warned:
"1 + value", where value is an uint16_t causes promotion
to a signed int. The compiler complained that we are
shoving an int into a uint16_t return type with different
size and sign.
Bumping and returning value directly instead removes the
promotion and the problem.
Fixes: f20b50b946da ("mbuf: optimize refcnt update")
Fixes: a53aa2b9f3be ("mbuf: support attaching external buffer")
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
lib/librte_mbuf/rte_mbuf.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 54a917ba8..5db76e725 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -771,8 +771,9 @@ rte_mbuf_refcnt_update(struct rte_mbuf *m, int16_t value)
* reference counter can occur.
*/
if (likely(rte_mbuf_refcnt_read(m) == 1)) {
- rte_mbuf_refcnt_set(m, 1 + value);
- return 1 + value;
+ ++value;
+ rte_mbuf_refcnt_set(m, value);
+ return value;
}
return __rte_mbuf_refcnt_update(m, value);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'mbuf: explicit casts of reference counter' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (11 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'mbuf: fix reference counter integer promotion' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'mbuf: explicit cast of headroom on reset' " luca.boccassi
` (44 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Andy Green; +Cc: Olivier Matz, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From d19fd046ebf98168ac12d64227f5dfbac0ae9408 Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Thu, 17 May 2018 21:49:32 +0800
Subject: [PATCH] mbuf: explicit casts of reference counter
[ upstream commit f6ffdf1c2c1cfbb2a3cbce246b545560609abeb5 ]
differences to the atomic16 are signed, but the
atomic16 itself is unsigned. It needs to be
made explicit with casts.
Fixes: af75078fece3 ("first public release")
Fixes: a53aa2b9f3be ("mbuf: support attaching external buffer")
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
lib/librte_mbuf/rte_mbuf.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 5db76e725..a95001b76 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -741,7 +741,7 @@ rte_mbuf_refcnt_read(const struct rte_mbuf *m)
static inline void
rte_mbuf_refcnt_set(struct rte_mbuf *m, uint16_t new_value)
{
- rte_atomic16_set(&m->refcnt_atomic, new_value);
+ rte_atomic16_set(&m->refcnt_atomic, (int16_t)new_value);
}
/* internal */
@@ -772,8 +772,8 @@ rte_mbuf_refcnt_update(struct rte_mbuf *m, int16_t value)
*/
if (likely(rte_mbuf_refcnt_read(m) == 1)) {
++value;
- rte_mbuf_refcnt_set(m, value);
- return value;
+ rte_mbuf_refcnt_set(m, (uint16_t)value);
+ return (uint16_t)value;
}
return __rte_mbuf_refcnt_update(m, value);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'mbuf: explicit cast of headroom on reset' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (12 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'mbuf: explicit casts of reference counter' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'mbuf: explicit cast of size on detach' " luca.boccassi
` (43 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Andy Green; +Cc: Bruce Richardson, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From c200960a49e0d71e99fbdc52c76b39e788cd7325 Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Thu, 17 May 2018 21:49:37 +0800
Subject: [PATCH] mbuf: explicit cast of headroom on reset
[ upstream commit 553ff494cb4d7fa9539911d3bbb4d94de5f69f20 ]
GCC 8.1 warned:
rte_common.h:384:2:
warning: conversion from 'int' to 'uint16_t'
{aka 'short unsigned int'} may change value [-Wconversion]
__extension__ ({ \
^~~~~~~~~~~~~
rte_mbuf.h:1204:16:
note: in expansion of macro 'RTE_MIN'
m->data_off = RTE_MIN(RTE_PKTMBUF_HEADROOM, (uint16_t)m->buf_len);
RTE_PKTMBUF_HEADROOM is typ 128, so it doesn't make trouble.
Fixes: 08b563ffb19d ("mbuf: replace data pointer by an offset")
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/librte_mbuf/rte_mbuf.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index a95001b76..a66ac781c 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -1166,7 +1166,8 @@ rte_pktmbuf_priv_size(struct rte_mempool *mp)
*/
static inline void rte_pktmbuf_reset_headroom(struct rte_mbuf *m)
{
- m->data_off = RTE_MIN(RTE_PKTMBUF_HEADROOM, (uint16_t)m->buf_len);
+ m->data_off = (uint16_t)RTE_MIN((uint16_t)RTE_PKTMBUF_HEADROOM,
+ (uint16_t)m->buf_len);
}
/**
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'mbuf: explicit cast of size on detach' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (13 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'mbuf: explicit cast of headroom on reset' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'net: explicit cast of multicast bit clearing' " luca.boccassi
` (42 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Andy Green; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 92acd3e399352bef5b9b9fd503a40b4f2ccd529c Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Thu, 17 May 2018 21:50:22 +0800
Subject: [PATCH] mbuf: explicit cast of size on detach
[ upstream commit c779ebdca0e4765158bd1eaa6f65c9d714605fae ]
GCC 8.1 warned:
In function 'rte_pktmbuf_detach':
rte_mbuf.h:1580:14: warning: conversion from 'long unsigned int'
to 'uint32_t' {aka 'unsigned int'} may change value [-Wconversion]
mbuf_size = sizeof(struct rte_mbuf) + priv_size;
^~~~~~
Fixes: 355e6735b335 ("mbuf: fix cloning with private mbuf data")
Signed-off-by: Andy Green <andy@warmcat.com>
---
lib/librte_mbuf/rte_mbuf.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index a66ac781c..f50607c8c 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -1350,7 +1350,7 @@ static inline void rte_pktmbuf_detach(struct rte_mbuf *m)
uint32_t mbuf_size, buf_len, priv_size;
priv_size = rte_pktmbuf_priv_size(mp);
- mbuf_size = sizeof(struct rte_mbuf) + priv_size;
+ mbuf_size = (uint32_t)(sizeof(struct rte_mbuf) + priv_size);
buf_len = rte_pktmbuf_data_room_size(mp);
m->priv_size = priv_size;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net: explicit cast of multicast bit clearing' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (14 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'mbuf: explicit cast of size on detach' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'net: explicit cast of IP checksum to 16-bit' " luca.boccassi
` (41 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Andy Green; +Cc: Bruce Richardson, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 7fe415ff0cb92c03b4989e10035997abbe69a674 Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Thu, 17 May 2018 21:49:47 +0800
Subject: [PATCH] net: explicit cast of multicast bit clearing
[ upstream commit beb4076567441bb6f936f99f442c2a8de911bb3c ]
GCC 8.1 warned:
rte_ether.h:213:13:
warning: conversion from 'int' to 'uint8_t'
{aka 'unsigned char'} may change value [-Wconversion]
addr[0] &= ~ETHER_GROUP_ADDR;
Fixes: 7ef007291004 ("ethdev: random MAC address")
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/librte_net/rte_ether.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
index 16dddb388..6cd822950 100644
--- a/lib/librte_net/rte_ether.h
+++ b/lib/librte_net/rte_ether.h
@@ -210,7 +210,7 @@ static inline void eth_random_addr(uint8_t *addr)
uint8_t *p = (uint8_t *)&rand;
rte_memcpy(addr, p, ETHER_ADDR_LEN);
- addr[0] &= ~ETHER_GROUP_ADDR; /* clear multicast bit */
+ addr[0] &= (uint8_t)~ETHER_GROUP_ADDR; /* clear multicast bit */
addr[0] |= ETHER_LOCAL_ADMIN_ADDR; /* set local assignment bit */
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net: explicit cast of IP checksum to 16-bit' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (15 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'net: explicit cast of multicast bit clearing' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'net: explicit cast of protocol in IPv6 checksum' " luca.boccassi
` (40 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Andy Green; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From ba4ef407c811f10fb52dba749ed1a95c651bb438 Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Thu, 17 May 2018 21:49:57 +0800
Subject: [PATCH] net: explicit cast of IP checksum to 16-bit
[ upstream commit 466de6d5d8648f6a2c6cfc90c2d1bf217dd06e90 ]
GCC 8.1 warned:
In function 'rte_raw_cksum_mbuf':
rte_ip.h:225:22: warning: conversion from 'uint32_t'
{aka 'unsigned int'} to 'uint16_t' {aka 'short unsigned int'}
may change value [-Wconversion]
tmp = rte_bswap16(tmp);
^~~
In function 'rte_ipv4_cksum':
rte_ip.h:256:35: warning: conversion from 'int' to 'uint16_t'
{aka 'short unsigned int'} may change value [-Wconversion]
return (cksum == 0xffff) ? cksum : ~cksum;
~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
rte_ip.h:332:9: warning: conversion from 'uint32_t'
{aka 'unsigned int'} to 'uint16_t' {aka 'short unsigned int'}
may change value [-Wconversion]
return cksum;
^~~~~
In function 'rte_ipv6_udptcp_cksum':
rte_ip.h:421:9: warning: conversion from 'uint32_t' {aka 'unsigned int'}
to 'uint16_t' {aka 'short unsigned int'} may change value [-Wconversion]
return cksum;
^~~~~
Fixes: 6006818cfb26 ("net: new checksum functions")
Fixes: 4199fdea60c3 ("mbuf: generic support for TCP segmentation offload")
Signed-off-by: Andy Green <andy@warmcat.com>
---
lib/librte_net/rte_ip.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h
index f32684c66..edbe4335c 100644
--- a/lib/librte_net/rte_ip.h
+++ b/lib/librte_net/rte_ip.h
@@ -222,7 +222,7 @@ rte_raw_cksum_mbuf(const struct rte_mbuf *m, uint32_t off, uint32_t len,
for (;;) {
tmp = __rte_raw_cksum(buf, seglen, 0);
if (done & 1)
- tmp = rte_bswap16(tmp);
+ tmp = rte_bswap16((uint16_t)tmp);
sum += tmp;
done += seglen;
if (done == len)
@@ -253,7 +253,7 @@ rte_ipv4_cksum(const struct ipv4_hdr *ipv4_hdr)
{
uint16_t cksum;
cksum = rte_raw_cksum(ipv4_hdr, sizeof(struct ipv4_hdr));
- return (cksum == 0xffff) ? cksum : ~cksum;
+ return (cksum == 0xffff) ? cksum : (uint16_t)~cksum;
}
/**
@@ -329,7 +329,7 @@ rte_ipv4_udptcp_cksum(const struct ipv4_hdr *ipv4_hdr, const void *l4_hdr)
if (cksum == 0)
cksum = 0xffff;
- return cksum;
+ return (uint16_t)cksum;
}
/**
@@ -418,7 +418,7 @@ rte_ipv6_udptcp_cksum(const struct ipv6_hdr *ipv6_hdr, const void *l4_hdr)
if (cksum == 0)
cksum = 0xffff;
- return cksum;
+ return (uint16_t)cksum;
}
#ifdef __cplusplus
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net: explicit cast of protocol in IPv6 checksum' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (16 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'net: explicit cast of IP checksum to 16-bit' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'ethdev: explicit cast of queue count return' " luca.boccassi
` (39 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Andy Green; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 5be4597ab2937fa41489f537a0767a0209c7464f Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Thu, 17 May 2018 21:50:17 +0800
Subject: [PATCH] net: explicit cast of protocol in IPv6 checksum
[ upstream commit 8bf255bb3862d8f35496b26bc8c2511239bdc18b ]
GCC 8.1 warned:
In function 'rte_ipv6_phdr_cksum':
rte_ip.h:378:18: warning: conversion to 'uint32_t' {aka 'unsigned int'}
from 'int' may change the sign of the result [-Wsign-conversion]
psd_hdr.proto = (ipv6_hdr->proto << 24);
Fixes: 6006818cfb26 ("net: new checksum functions")
Signed-off-by: Andy Green <andy@warmcat.com>
---
lib/librte_net/rte_ip.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h
index edbe4335c..c924aca7f 100644
--- a/lib/librte_net/rte_ip.h
+++ b/lib/librte_net/rte_ip.h
@@ -375,7 +375,7 @@ rte_ipv6_phdr_cksum(const struct ipv6_hdr *ipv6_hdr, uint64_t ol_flags)
uint32_t proto; /* L4 protocol - top 3 bytes must be zero */
} psd_hdr;
- psd_hdr.proto = (ipv6_hdr->proto << 24);
+ psd_hdr.proto = (uint32_t)(ipv6_hdr->proto << 24);
if (ol_flags & PKT_TX_TCP_SEG) {
psd_hdr.len = 0;
} else {
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'ethdev: explicit cast of queue count return' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (17 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'net: explicit cast of protocol in IPv6 checksum' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix build with clang on ARM' " luca.boccassi
` (38 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Andy Green; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From cf79056e3713274f7899616918fd04859876eed8 Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Fri, 18 May 2018 21:02:38 +0800
Subject: [PATCH] ethdev: explicit cast of queue count return
[ upstream commit 45d1be93b9020dfe9c1f3e81822621580312dcc3 ]
GCC 8.1 produces a warning:
rte_ethdev.h: In function 'rte_eth_rx_queue_count':
rte_ethdev.h:3882:10: warning: conversion to 'int' from 'uint32_t'
{aka 'unsigned int'} may change the sign of the result [-Wsign-conversion]
return (*dev->dev_ops->rx_queue_count)(dev, queue_id);
~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fixes: 33cf6be04d60 ("ethdev: add sanity checks to functions")
Signed-off-by: Andy Green <andy@warmcat.com>
---
lib/librte_ether/rte_ethdev.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 2243039e7..877c13cd2 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -3675,7 +3675,7 @@ rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id)
if (queue_id >= dev->data->nb_rx_queues)
return -EINVAL;
- return (*dev->dev_ops->rx_queue_count)(dev, queue_id);
+ return (int)(*dev->dev_ops->rx_queue_count)(dev, queue_id);
}
/**
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/mlx5: fix build with clang on ARM' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (18 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'ethdev: explicit cast of queue count return' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'test/eventdev: fix ethdev port id to 16-bit' " luca.boccassi
` (37 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Gavin Hu
Cc: Sirshak Das, Phil Yang, Honnappa Nagarahalli, Jerin Jacob,
Yongseok Koh, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 02881b774dbfba5dc101762fe9705720a3f01cee Mon Sep 17 00:00:00 2001
From: Gavin Hu <gavin.hu@arm.com>
Date: Thu, 17 May 2018 10:46:08 +0800
Subject: [PATCH] net/mlx5: fix build with clang on ARM
[ upstream commit 74572f23cd6003d93007ebd3131d93833215463e ]
This patch adds a pair of "()" to embrace the argument
input to the function-like macro invocation.
drivers/net/mlx5/mlx5_rxtx_vec.c:37:
drivers/net/mlx5/mlx5_rxtx_vec_neon.h:170:24: error: too many arguments
provided to function-like macro invocation
(uint16x8_t) { 0, 0, cs_flags, rte_cpu_to_be_16(len),
Fixes: 570acdb1da ("net/mlx5: add vectorized Rx/Tx burst for ARM")
Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Signed-off-by: Sirshak Das <sirshak.das@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
---
drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
index bbe1818ef..7a8a181f1 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
+++ b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
@@ -167,8 +167,8 @@ txq_scatter_v(struct mlx5_txq_data *txq, struct rte_mbuf **pkts,
vst1q_u8((void *)t_wqe, ctrl);
/* Fill ESEG in the header. */
vst1q_u16((void *)(t_wqe + 1),
- (uint16x8_t) { 0, 0, cs_flags, rte_cpu_to_be_16(len),
- 0, 0, 0, 0 });
+ ((uint16x8_t) { 0, 0, cs_flags, rte_cpu_to_be_16(len),
+ 0, 0, 0, 0 }));
txq->wqe_ci = wqe_ci;
}
if (!n)
@@ -300,10 +300,10 @@ txq_burst_v(struct mlx5_txq_data *txq, struct rte_mbuf **pkts, uint16_t pkts_n,
vst1q_u8((void *)t_wqe, ctrl);
/* Fill ESEG in the header. */
vst1q_u8((void *)(t_wqe + 1),
- (uint8x16_t) { 0, 0, 0, 0,
- cs_flags, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0 });
+ ((uint8x16_t) { 0, 0, 0, 0,
+ cs_flags, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0 }));
#ifdef MLX5_PMD_SOFT_COUNTERS
txq->stats.opackets += pkts_n;
#endif
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'test/eventdev: fix ethdev port id to 16-bit' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (19 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix build with clang on ARM' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'bus/vdev: fix double space in logs' " luca.boccassi
` (36 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Vipin Varghese; +Cc: Nikhil Rao, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 0208515bd01108d60f7e9bb06fb873e64e04d042 Mon Sep 17 00:00:00 2001
From: Vipin Varghese <vipin.varghese@intel.com>
Date: Tue, 15 May 2018 23:36:42 +0530
Subject: [PATCH] test/eventdev: fix ethdev port id to 16-bit
[ upstream commit 84e22d6177be2eee974a4c4978ed800cae6bf332 ]
port id in test case is update to unsigned int 16 bit, to
prevent compilation failure when RTE_MAX_ETHPORTS port is
set more than 255.
Fixes: fc8030eb8fe9 ("test/eventdev: add tests for eth Rx adapter APIs")
Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Acked-by: Nikhil Rao <nikhil.rao@intel.com>
---
test/test/test_event_eth_rx_adapter.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/test/test_event_eth_rx_adapter.c b/test/test/test_event_eth_rx_adapter.c
index 2234df0eb..af232d650 100644
--- a/test/test/test_event_eth_rx_adapter.c
+++ b/test/test/test_event_eth_rx_adapter.c
@@ -107,7 +107,7 @@ port_init(uint8_t port, struct rte_mempool *mp)
static int
init_ports(int num_ports)
{
- uint8_t portid;
+ uint16_t portid;
int retval;
default_params.mp = rte_pktmbuf_pool_create("packet_pool",
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'bus/vdev: fix double space in logs' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (20 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'test/eventdev: fix ethdev port id to 16-bit' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'app/testpmd: fix burst stats reporting' " luca.boccassi
` (35 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Ferruh Yigit, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From e4c878d1641e966610ca59214b85e71d8ca7b800 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Wed, 16 May 2018 14:51:40 -0700
Subject: [PATCH] bus/vdev: fix double space in logs
[ upstream commit 999951c86bcb95b3c72a193a15f01692045544fc ]
The VDEV_LOG() macro already adds a newline, don't duplicate.
Fixes: d22fcb225c24 ("bus/vdev: change log type")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
drivers/bus/vdev/vdev.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
index 66fe63e85..a070438f2 100644
--- a/drivers/bus/vdev/vdev.c
+++ b/drivers/bus/vdev/vdev.c
@@ -165,7 +165,7 @@ vdev_probe_all_drivers(struct rte_vdev_device *dev)
name = rte_vdev_device_name(dev);
- VDEV_LOG(DEBUG, "Search driver %s to probe device %s\n", name,
+ VDEV_LOG(DEBUG, "Search driver %s to probe device %s", name,
rte_vdev_device_name(dev));
if (vdev_parse(name, &driver))
@@ -275,7 +275,7 @@ vdev_remove_driver(struct rte_vdev_device *dev)
const struct rte_vdev_driver *driver;
if (!dev->device.driver) {
- VDEV_LOG(DEBUG, "no driver attach to device %s\n", name);
+ VDEV_LOG(DEBUG, "no driver attach to device %s", name);
return 1;
}
@@ -373,7 +373,7 @@ vdev_probe(void)
continue;
if (vdev_probe_all_drivers(dev)) {
- VDEV_LOG(ERR, "failed to initialize %s device\n",
+ VDEV_LOG(ERR, "failed to initialize %s device",
rte_vdev_device_name(dev));
ret = -1;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'app/testpmd: fix burst stats reporting' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (21 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'bus/vdev: fix double space in logs' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'eal/x86: fix type of variable in memcpy function' " luca.boccassi
` (34 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Daniel Shelepov; +Cc: Bernard Iremonger, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 2c89029253b5914eb232600723ae8120d19cf38f Mon Sep 17 00:00:00 2001
From: Daniel Shelepov <dashel@microsoft.com>
Date: Mon, 14 May 2018 21:12:15 +0000
Subject: [PATCH] app/testpmd: fix burst stats reporting
[ upstream commit fe613657ce486083a3ed96890c95de4f35c8593b ]
When RTE_TEST_PMD_RECORD_BURST_STATS is enabled, testpmd collects
burst statistics and includes them in the port stats report. The
summary should include top 2 most frequent burst sizes, but there is a
bug in finding the top-2. During the scan of burst size counts, the
top-2 can change only if top-1 also changes.
Added logic to update the top-2 if current burst size is larger than
existing top-2, but smaller than existing top-1.
Fixes: af75078fece3 ("first public release")
Signed-off-by: Daniel Shelepov <dashel@microsoft.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
app/test-pmd/testpmd.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 85d5cde09..05a68a068 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -926,6 +926,9 @@ pkt_burst_stats_display(const char *rx_tx, struct pkt_burst_stats *pbs)
pktnb_stats[1] = pktnb_stats[0];
burst_stats[0] = nb_burst;
pktnb_stats[0] = nb_pkt;
+ } else if (nb_burst > burst_stats[1]) {
+ burst_stats[1] = nb_burst;
+ pktnb_stats[1] = nb_pkt;
}
}
if (total_burst == 0)
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'eal/x86: fix type of variable in memcpy function' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (22 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'app/testpmd: fix burst stats reporting' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'eal: explicit cast in rwlock functions' " luca.boccassi
` (33 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Andy Green; +Cc: Bruce Richardson, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 7facb239731152549cd498980fb34bf61fdf7160 Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Tue, 22 May 2018 09:24:12 +0800
Subject: [PATCH] eal/x86: fix type of variable in memcpy function
[ upstream commit 14035e5fadff19efb17069c6dc463670a8e8b6c1 ]
GCC 8.1 warned:
rte_memcpy.h:793:2: note: in expansion of macro 'MOVEUNALIGNED_LEFT47'
MOVEUNALIGNED_LEFT47(dst, src, n, srcofs);
^~~~~~~~~~~~~~~~~~~~
rte_memcpy.h:649:51: warning: conversion from 'size_t'
{aka 'long unsigned int'} to 'int' may change value [-Wconversion]
case 0x0B: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x0B); break;
^
rte_memcpy.h:616:15: note: in definition of macro 'MOVEUNALIGNED_LEFT47_IMM'
tmp = len;
^~~
rte_memcpy.h:793:2: note: in expansion of macro 'MOVEUNALIGNED_LEFT47'
MOVEUNALIGNED_LEFT47(dst, src, n, srcofs);
^~~~~~~~~~~~~~~~~~~~
rte_memcpy.h:618:13: warning: conversion to 'size_t'
{aka 'long unsigned int'} from 'int'
may change the sign of the result [-Wsign-conversion]
tmp -= len;
^~
rte_memcpy.h:649:16: note: in expansion of macro 'MOVEUNALIGNED_LEFT47_IMM'
case 0x0B: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x0B); break;
^~~~~~~~~~~~~~~~~~~~~~~~
rte_memcpy.h:793:2: note: in expansion of macro 'MOVEUNALIGNED_LEFT47'
MOVEUNALIGNED_LEFT47(dst, src, n, srcofs);
^~~~~~~~~~~~~~~~~~~~
rte_memcpy.h:618:13: warning: conversion to 'size_t'
{aka 'long unsigned int'} from 'int'
may change the sign of the result [-Wsign-conversion]
tmp -= len;
^~
We can eliminate the problems by setting the type of tmp to
size_t in the first place.
Fixes: d35cc1fe6a ("eal/x86: revert select optimized memcpy at run-time")
Suggested-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/librte_eal/common/include/arch/x86/rte_memcpy.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h
index cc140ecca..5f9b1bb3b 100644
--- a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h
+++ b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h
@@ -574,7 +574,7 @@ rte_mov256(uint8_t *dst, const uint8_t *src)
*/
#define MOVEUNALIGNED_LEFT47_IMM(dst, src, len, offset) \
__extension__ ({ \
- int tmp; \
+ size_t tmp; \
while (len >= 128 + 16 - offset) { \
xmm0 = _mm_loadu_si128((const __m128i *)((const uint8_t *)src - offset + 0 * 16)); \
len -= 128; \
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'eal: explicit cast in rwlock functions' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (23 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'eal/x86: fix type of variable in memcpy function' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'net: explicit cast in L4 checksum' " luca.boccassi
` (32 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Andy Green; +Cc: Bruce Richardson, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 9eb018ee6f675c01856295ee94c2740b89e605b4 Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Tue, 22 May 2018 09:24:17 +0800
Subject: [PATCH] eal: explicit cast in rwlock functions
[ upstream commit 1587d36e22d0cf0e037a104e1e851acefd6597f0 ]
GCC 8.1 warned:
In function 'rte_rwlock_read_lock':
rte_rwlock.h:74:12: warning: conversion to 'uint32_t'
{aka 'unsigned int'} from 'int32_t' {aka 'int'} may
change the sign of the result [-Wsign-conversion]
x, x + 1);
^
rte_rwlock.h:74:17: warning: conversion to 'uint32_t'
{aka 'unsigned int'} from 'int' may change the sign
of the result [-Wsign-conversion]
x, x + 1);
~~^~~
In function 'rte_rwlock_write_lock':
rte_rwlock.h:110:15: warning: unsigned conversion
from 'int' to 'uint32_t' {aka 'unsigned int'}
changes value from '-1' to '4294967295' [-Wsign-conversion]
0, -1);
^~
Again in this case we are making explicit the exact cast
that was always happening implicitly. The patch does not
change the generated code.
The int32_t temp "x" is required to be signed to detect
a < 0 error condition from the lock status. Afterwards,
it has always been implicitly cast to uint32_t when it
is used in the arguments to rte_atomic32_cmpset()...
gcc8.1 objects to the implicit cast now and requires us
to cast it explicitly.
Fixes: af75078fec ("first public release")
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/librte_eal/common/include/generic/rte_rwlock.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/librte_eal/common/include/generic/rte_rwlock.h b/lib/librte_eal/common/include/generic/rte_rwlock.h
index 899e9bc43..5751a0e6d 100644
--- a/lib/librte_eal/common/include/generic/rte_rwlock.h
+++ b/lib/librte_eal/common/include/generic/rte_rwlock.h
@@ -71,7 +71,7 @@ rte_rwlock_read_lock(rte_rwlock_t *rwl)
continue;
}
success = rte_atomic32_cmpset((volatile uint32_t *)&rwl->cnt,
- x, x + 1);
+ (uint32_t)x, (uint32_t)(x + 1));
}
}
@@ -107,7 +107,7 @@ rte_rwlock_write_lock(rte_rwlock_t *rwl)
continue;
}
success = rte_atomic32_cmpset((volatile uint32_t *)&rwl->cnt,
- 0, -1);
+ 0, (uint32_t)-1);
}
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net: explicit cast in L4 checksum' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (24 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'eal: explicit cast in rwlock functions' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'mbuf: fix type of private size in detach' " luca.boccassi
` (31 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Andy Green; +Cc: Bruce Richardson, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 819c4e0bdc5e6b5143e338f06019358eaf5a5e9b Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Tue, 22 May 2018 09:24:22 +0800
Subject: [PATCH] net: explicit cast in L4 checksum
[ upstream commit f37a2e7c747b0758fcd8390482aeeac490f688b5 ]
GCC 8.1 warned:
In function 'rte_ipv4_udptcp_cksum':
rte_byteorder.h:51:24: warning: conversion from 'long unsigned int' to
'uint32_t' {aka 'unsigned int'} may change value [-Wconversion]
#define rte_bswap16(x) ((uint16_t) (__builtin_constant_p(x) ? \
^
rte_byteorder.h:85:29: note: in expansion of macro 'rte_bswap16'
#define rte_be_to_cpu_16(x) rte_bswap16(x)
^~~~~~~~~~~
rte_ip.h:321:11: note: in expansion of macro 'rte_be_to_cpu_16'
l4_len = rte_be_to_cpu_16(ipv4_hdr->total_length) -
^~~~~~~~~~~~~~~~
Also with this one, it is a cast that always occurred
and is just being done explicitly, with no changes to
the generated code.
The warning stack is misleading, it points to the last
element in the macro that produced the lhs of the subtraction
above. But the only "unsigned long int" in the expression is
the result of the sizeof() on the rhs, it promotes the
subtraction result to unsigned long. So the error actually
relates to the result of the outer subtraction.
The actual error is "you are trying to put an unsigned long
into a uint32_t". We always did so, the fix is just to inform
the compiler it is intentional with an explicit cast.
Fixes: 6006818cfb ("net: new checksum functions")
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/librte_net/rte_ip.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h
index c924aca7f..72dc2456a 100644
--- a/lib/librte_net/rte_ip.h
+++ b/lib/librte_net/rte_ip.h
@@ -318,8 +318,8 @@ rte_ipv4_udptcp_cksum(const struct ipv4_hdr *ipv4_hdr, const void *l4_hdr)
uint32_t cksum;
uint32_t l4_len;
- l4_len = rte_be_to_cpu_16(ipv4_hdr->total_length) -
- sizeof(struct ipv4_hdr);
+ l4_len = (uint32_t)(rte_be_to_cpu_16(ipv4_hdr->total_length) -
+ sizeof(struct ipv4_hdr));
cksum = rte_raw_cksum(l4_hdr, l4_len);
cksum += rte_ipv4_phdr_cksum(ipv4_hdr, 0);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'mbuf: fix type of private size in detach' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (25 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'net: explicit cast in L4 checksum' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'mbuf: fix type of variables in linearize function' " luca.boccassi
` (30 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Andy Green; +Cc: Bruce Richardson, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 665c8e2a5c7f0900ebe938cecab8c22e3b4bfeea Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Tue, 22 May 2018 09:24:27 +0800
Subject: [PATCH] mbuf: fix type of private size in detach
[ upstream commit ad3781066261848c163e700c3c5baa16fecc2247 ]
GCC 8.1 warned:
In function 'rte_pktmbuf_detach':
rte_mbuf.h:1583:17: warning: conversion from 'uint32_t'
{aka 'unsigned int'} to 'uint16_t' {aka 'short unsigned int'}
may change value [-Wconversion]
m->priv_size = priv_size;
^~~~~~~~~
The temp priv_size is declared as a uint32_t. But it
only deals in uint16_t. m->priv_size is a uint16_t.
Change it to a uint16_t.
Fixes: 355e6735b3 ("mbuf: fix cloning with private mbuf data")
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/librte_mbuf/rte_mbuf.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index f50607c8c..198ba8e22 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -1347,7 +1347,8 @@ static inline void rte_pktmbuf_detach(struct rte_mbuf *m)
{
struct rte_mbuf *md = rte_mbuf_from_indirect(m);
struct rte_mempool *mp = m->pool;
- uint32_t mbuf_size, buf_len, priv_size;
+ uint32_t mbuf_size, buf_len;
+ uint16_t priv_size;
priv_size = rte_pktmbuf_priv_size(mp);
mbuf_size = (uint32_t)(sizeof(struct rte_mbuf) + priv_size);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'mbuf: fix type of variables in linearize function' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (26 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'mbuf: fix type of private size in detach' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'mbuf: avoid implicit demotion in 64-bit arithmetic' " luca.boccassi
` (29 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Andy Green; +Cc: Bruce Richardson, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From a099e527773f7c849edeb165b18f6f4528552178 Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Tue, 22 May 2018 09:24:37 +0800
Subject: [PATCH] mbuf: fix type of variables in linearize function
[ upstream commit 50f239c9087df9b1a3c14e77f4279c7d5f523138 ]
GCC 8.1 warned:
In function 'rte_pktmbuf_linearize':
rte_mbuf.h:1873:32: warning: conversion to 'int' from 'uint32_t'
{aka 'unsigned int'} may change the sign of the result [-Wsign-conversion]
rte_mbuf.h:2166:13: note: in expansion of macro 'rte_pktmbuf_pkt_len'
copy_len = rte_pktmbuf_pkt_len(mbuf) - rte_pktmbuf_data_len(mbuf);
rte_mbuf.h:2180:51: warning: conversion to 'size_t'
{aka 'long unsigned int'} from 'int' may change the
sign of the result [-Wsign-conversion]
rte_memcpy(buffer, rte_pktmbuf_mtod(m, char *), seg_len);
^~~~~~~
The temp is consumed as a size_t. So let's make it
a size_t in the first place.
Fixes: 1feda4d8fc ("mbuf: add a function to linearize a packet")
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/librte_mbuf/rte_mbuf.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 198ba8e22..741204193 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -1935,7 +1935,7 @@ rte_validate_tx_offload(const struct rte_mbuf *m)
static inline int
rte_pktmbuf_linearize(struct rte_mbuf *mbuf)
{
- int seg_len, copy_len;
+ size_t seg_len, copy_len;
struct rte_mbuf *m;
struct rte_mbuf *m_next;
char *buffer;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'mbuf: avoid implicit demotion in 64-bit arithmetic' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (27 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'mbuf: fix type of variables in linearize function' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'mbuf: avoid integer promotion in prepend/adj/chain' " luca.boccassi
` (28 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Andy Green; +Cc: Bruce Richardson, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From b4e46189cb23c80752ab197a466f8f7dc013f705 Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Tue, 22 May 2018 09:24:32 +0800
Subject: [PATCH] mbuf: avoid implicit demotion in 64-bit arithmetic
[ upstream commit ef5092e16b137fd5e23d19b4b17b32f330d4a4ad ]
GCC 8.1 warned:
In function 'rte_validate_tx_offload':
rte_mbuf.h:2112:19: warning: conversion to 'uint64_t'
{aka 'long unsigned int'} from 'int' may change the
sign of the result [-Wsign-conversion]
inner_l3_offset += m->outer_l2_len + m->outer_l3_len;
^~
uint64_t inner_l3_offset...
/* fields for TX offloading of tunnels */
uint64_t outer_l3_len:9; /**< Outer L3 (IP) Hdr Length. */
uint64_t outer_l2_len:7; /**< Outer L2 (MAC) Hdr Length. */
We want to do the arithmetic entirely in uint64_t
space, but with the +=, the rhs type becomes int since the
bitfields will fit in int.
Elaborate the artithmetic to be u64 = u64 + int + int, so
the type of the result is correct to be stored in the u64.
Fixes: 4fb7e803eb ("ethdev: add Tx preparation")
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/librte_mbuf/rte_mbuf.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 741204193..38299992e 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -1890,7 +1890,11 @@ rte_validate_tx_offload(const struct rte_mbuf *m)
return 0;
if (ol_flags & PKT_TX_OUTER_IP_CKSUM)
- inner_l3_offset += m->outer_l2_len + m->outer_l3_len;
+ /* NB: elaborating the addition like this instead of using
+ * += gives the result uint64_t type instead of int,
+ * avoiding compiler warnings on gcc 8.1 at least */
+ inner_l3_offset = inner_l3_offset + m->outer_l2_len +
+ m->outer_l3_len;
/* Headers are fragmented */
if (rte_pktmbuf_data_len(m) < inner_l3_offset + m->l3_len + m->l4_len)
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'mbuf: avoid integer promotion in prepend/adj/chain' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (28 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'mbuf: avoid implicit demotion in 64-bit arithmetic' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'ethdev: fix type and scope of variables in Rx burst' " luca.boccassi
` (27 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Andy Green; +Cc: Bruce Richardson, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From f622d2e35942e94e43746ef9f1fe64f4a0f54a4b Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Tue, 22 May 2018 09:24:42 +0800
Subject: [PATCH] mbuf: avoid integer promotion in prepend/adj/chain
[ upstream commit 9d0b59f84e1170b12a128cdcccab5711f25b5dd8 ]
GCC 8.1 warned:
In function 'rte_pktmbuf_prepend':
rte_mbuf.h:1908:17: warning: conversion from 'int' to 'uint16_t'
{aka 'short unsigned int'} may change value [-Wconversion]
m->data_off -= len;
^~~
m->data_off is a uint16_t
uint16_t data_off;
len (a uint16_t) is promoted to an int using -=. Do the
subtraction explicitly and cast the result to uint16_t.
The below += or -= changes are solving the same thing.
In function 'rte_pktmbuf_adj':
rte_mbuf.h:1969:17: warning: conversion from 'int' to 'uint16_t'
{aka 'short unsigned int'} may change value [-Wconversion]
m->data_off += len;
^~~
In function 'rte_pktmbuf_chain':
rte_mbuf.h:2082:19: warning: conversion from 'int' to 'uint16_t'
{aka 'short unsigned int'} may change value [-Wconversion]
head->nb_segs += tail->nb_segs;
^~~~
Also uint16_t
uint16_t nb_segs; /**< Number of segments. */
Fixes: 08b563ffb19d ("mbuf: replace data pointer by an offset")
Fixes: 1a60a0daa6e4 ("mbuf: fix segments number type increase")
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/librte_mbuf/rte_mbuf.h | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 38299992e..f247e43ca 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -1686,7 +1686,10 @@ static inline char *rte_pktmbuf_prepend(struct rte_mbuf *m,
if (unlikely(len > rte_pktmbuf_headroom(m)))
return NULL;
- m->data_off -= len;
+ /* NB: elaborating the subtraction like this instead of using
+ * -= allows us to ensure the result type is uint16_t
+ * avoiding compiler warnings on gcc 8.1 at least */
+ m->data_off = (uint16_t)(m->data_off - len);
m->data_len = (uint16_t)(m->data_len + len);
m->pkt_len = (m->pkt_len + len);
@@ -1746,8 +1749,11 @@ static inline char *rte_pktmbuf_adj(struct rte_mbuf *m, uint16_t len)
if (unlikely(len > m->data_len))
return NULL;
+ /* NB: elaborating the addition like this instead of using
+ * += allows us to ensure the result type is uint16_t
+ * avoiding compiler warnings on gcc 8.1 at least */
m->data_len = (uint16_t)(m->data_len - len);
- m->data_off += len;
+ m->data_off = (uint16_t)(m->data_off + len);
m->pkt_len = (m->pkt_len - len);
return (char *)m->buf_addr + m->data_off;
}
@@ -1859,8 +1865,11 @@ static inline int rte_pktmbuf_chain(struct rte_mbuf *head, struct rte_mbuf *tail
cur_tail = rte_pktmbuf_lastseg(head);
cur_tail->next = tail;
- /* accumulate number of segments and total length. */
- head->nb_segs += tail->nb_segs;
+ /* accumulate number of segments and total length.
+ * NB: elaborating the addition like this instead of using
+ * -= allows us to ensure the result type is uint16_t
+ * avoiding compiler warnings on gcc 8.1 at least */
+ head->nb_segs = (uint16_t)(head->nb_segs + tail->nb_segs);
head->pkt_len += tail->pkt_len;
/* pkt_len is only set in the head */
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'ethdev: fix type and scope of variables in Rx burst' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (29 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'mbuf: avoid integer promotion in prepend/adj/chain' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'app/bbdev: fix unchecked return value' " luca.boccassi
` (26 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Andy Green; +Cc: Bruce Richardson, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From c09ee80e3258d36d8ac4304003f4c101ad73d9ad Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Tue, 22 May 2018 09:24:47 +0800
Subject: [PATCH] ethdev: fix type and scope of variables in Rx burst
[ upstream commit 3291abb5a2a5f24c109ab74e6aad0545927333a7 ]
GCC 8.1 warned:
In function 'rte_eth_rx_burst':
rte_ethdev.h:3836:18: warning: conversion to 'int16_t'
{aka 'short int'} from 'uint16_t' {aka 'short unsigned int'}
may change the sign of the result [-Wsign-conversion]
int16_t nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
^
rte_ethdev.h:3844:50: warning: conversion to 'uint16_t'
{aka 'short unsigned int'} from 'int16_t' {aka 'short int'}
may change the sign of the result [-Wsign-conversion]
nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx,
^~~~~
rte_ethdev.h:3844:12: warning: conversion to 'int16_t'
{aka 'short int'} from 'uint16_t' {aka 'short unsigned int'}
may change the sign of the result [-Wsign-conversion]
nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx,
^~
rte_ethdev.h:3851:9: warning: conversion to 'uint16_t'
{aka 'short unsigned int'} from 'int16_t' {aka 'short int'}
may change the sign of the result [-Wsign-conversion]
return nb_rx;
^~~~~
The second part of the patch is solved by its own basic
block because it is inside a preprocessor conditional.
Bringing the declaration of the var to the top of the
function would require that also being given its own
preprocessor conditional, or a (void)var to avoid an
unused var warning. The basic block is no worse than
those imho.
Fixes: 467465d86df1 ("ethdev: add packet count parameter to Rx callback")
Fixes: 4dc294158cac ("ethdev: support optional Rx and Tx callbacks")
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/librte_ether/rte_ethdev.h | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 877c13cd2..822af90de 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -3624,6 +3624,7 @@ rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id,
struct rte_mbuf **rx_pkts, const uint16_t nb_pkts)
{
struct rte_eth_dev *dev = &rte_eth_devices[port_id];
+ uint16_t nb_rx;
#ifdef RTE_LIBRTE_ETHDEV_DEBUG
RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
@@ -3634,13 +3635,14 @@ rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id,
return 0;
}
#endif
- int16_t nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
- rx_pkts, nb_pkts);
+ nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
+ rx_pkts, nb_pkts);
#ifdef RTE_ETHDEV_RXTX_CALLBACKS
- struct rte_eth_rxtx_callback *cb = dev->post_rx_burst_cbs[queue_id];
+ if (unlikely(dev->post_rx_burst_cbs[queue_id] != NULL)) {
+ struct rte_eth_rxtx_callback *cb =
+ dev->post_rx_burst_cbs[queue_id];
- if (unlikely(cb != NULL)) {
do {
nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx,
nb_pkts, cb->param);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'app/bbdev: fix unchecked return value' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (30 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'ethdev: fix type and scope of variables in Rx burst' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'crypto/scheduler: fix multicore rings re-use' " luca.boccassi
` (25 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Kamil Chalupnik; +Cc: Amr Mokhtar, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 710ef769b6258f6917adfe35f2a0dfdfd56f1253 Mon Sep 17 00:00:00 2001
From: Kamil Chalupnik <kamilx.chalupnik@intel.com>
Date: Wed, 16 May 2018 15:57:14 +0200
Subject: [PATCH] app/bbdev: fix unchecked return value
[ upstream commit b1bc4217fd880cd89a6dae78b8aeb90d130854d9 ]
Fixing CHECKED_RETURN issue by checking values returned
by rte_bbdev_dec_op_alloc_bulk and rte_bbdev_enc_op_alloc_bulk
functions.
Coverity issue: 279447, 279456
Fixes: f714a18885a6 ("app/testbbdev: add test application for bbdev")
Signed-off-by: Kamil Chalupnik <kamilx.chalupnik@intel.com>
Acked-by: Amr Mokhtar <amr.mokhtar@intel.com>
---
app/test-bbdev/test_bbdev_perf.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 00f3b085f..b912a4ea2 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -1667,7 +1667,9 @@ operation_latency_test_dec(struct rte_mempool *mempool,
if (unlikely(num_to_process - dequeued < burst_sz))
burst_sz = num_to_process - dequeued;
- rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz);
+ ret = rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz);
+ TEST_ASSERT_SUCCESS(ret,
+ "rte_bbdev_dec_op_alloc_bulk() failed");
if (test_vector.op_type != RTE_BBDEV_OP_NONE)
copy_reference_dec_op(ops_enq, burst_sz, dequeued,
bufs->inputs,
@@ -1729,7 +1731,9 @@ operation_latency_test_enc(struct rte_mempool *mempool,
if (unlikely(num_to_process - dequeued < burst_sz))
burst_sz = num_to_process - dequeued;
- rte_bbdev_enc_op_alloc_bulk(mempool, ops_enq, burst_sz);
+ ret = rte_bbdev_enc_op_alloc_bulk(mempool, ops_enq, burst_sz);
+ TEST_ASSERT_SUCCESS(ret,
+ "rte_bbdev_enc_op_alloc_bulk() failed");
if (test_vector.op_type != RTE_BBDEV_OP_NONE)
copy_reference_enc_op(ops_enq, burst_sz, dequeued,
bufs->inputs,
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'crypto/scheduler: fix multicore rings re-use' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (31 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'app/bbdev: fix unchecked return value' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'crypto/scheduler: fix possible duplicated ring names' " luca.boccassi
` (24 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Kirill Rybalchenko; +Cc: Pablo de Lara, Fan Zhang, Reshma Pattan, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 4036400be71f6501e48286844132e89a6ee16cb1 Mon Sep 17 00:00:00 2001
From: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
Date: Wed, 16 May 2018 15:24:31 +0100
Subject: [PATCH] crypto/scheduler: fix multicore rings re-use
[ upstream commit cc32201a8d834a690d76cd281acf553182894d9f ]
When scheduler mode changed from multicore to roundrobin and
back to multicore, scheduler tries to create memory rings with
the same name and fails. The fix allows to lookup and re-use
previously allocated memory rings.
Fixes: 4c07e0552f0a ("crypto/scheduler: add multicore scheduling mode")
Signed-off-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Tested-by: Reshma Pattan <reshma.pattan@intel.com>
---
drivers/crypto/scheduler/scheduler_multicore.c | 28 ++++++++++++++++++--------
1 file changed, 20 insertions(+), 8 deletions(-)
diff --git a/drivers/crypto/scheduler/scheduler_multicore.c b/drivers/crypto/scheduler/scheduler_multicore.c
index 644426e93..555c405c1 100644
--- a/drivers/crypto/scheduler/scheduler_multicore.c
+++ b/drivers/crypto/scheduler/scheduler_multicore.c
@@ -348,18 +348,30 @@ scheduler_create_private_ctx(struct rte_cryptodev *dev)
char r_name[16];
snprintf(r_name, sizeof(r_name), MC_SCHED_ENQ_RING_NAME_PREFIX "%u", i);
- mc_ctx->sched_enq_ring[i] = rte_ring_create(r_name, PER_SLAVE_BUFF_SIZE,
- rte_socket_id(), RING_F_SC_DEQ | RING_F_SP_ENQ);
+ mc_ctx->sched_enq_ring[i] = rte_ring_lookup(r_name);
if (!mc_ctx->sched_enq_ring[i]) {
- CS_LOG_ERR("Cannot create ring for worker %u", i);
- goto exit;
+ mc_ctx->sched_enq_ring[i] = rte_ring_create(r_name,
+ PER_SLAVE_BUFF_SIZE,
+ rte_socket_id(),
+ RING_F_SC_DEQ | RING_F_SP_ENQ);
+ if (!mc_ctx->sched_enq_ring[i]) {
+ CS_LOG_ERR("Cannot create ring for worker %u",
+ i);
+ goto exit;
+ }
}
snprintf(r_name, sizeof(r_name), MC_SCHED_DEQ_RING_NAME_PREFIX "%u", i);
- mc_ctx->sched_deq_ring[i] = rte_ring_create(r_name, PER_SLAVE_BUFF_SIZE,
- rte_socket_id(), RING_F_SC_DEQ | RING_F_SP_ENQ);
+ mc_ctx->sched_deq_ring[i] = rte_ring_lookup(r_name);
if (!mc_ctx->sched_deq_ring[i]) {
- CS_LOG_ERR("Cannot create ring for worker %u", i);
- goto exit;
+ mc_ctx->sched_deq_ring[i] = rte_ring_create(r_name,
+ PER_SLAVE_BUFF_SIZE,
+ rte_socket_id(),
+ RING_F_SC_DEQ | RING_F_SP_ENQ);
+ if (!mc_ctx->sched_deq_ring[i]) {
+ CS_LOG_ERR("Cannot create ring for worker %u",
+ i);
+ goto exit;
+ }
}
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'crypto/scheduler: fix possible duplicated ring names' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (32 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'crypto/scheduler: fix multicore rings re-use' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'app/crypto-perf: use strcpy for allocated string' " luca.boccassi
` (23 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Fan Zhang; +Cc: Pablo de Lara, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 8a3d07e9de488daf3b9be33ea88625f402a79053 Mon Sep 17 00:00:00 2001
From: Fan Zhang <roy.fan.zhang@intel.com>
Date: Wed, 16 May 2018 14:10:32 +0100
Subject: [PATCH] crypto/scheduler: fix possible duplicated ring names
[ upstream commit 91b9c522d61c752708db7005452ebb4b05baff7a ]
This patch fixes the possible duplicated ring names in multi-core
scheduler. Originally two or more multi-core schedulers may have
same worker ring names thus will cause initialization error.
Fixes: 4c07e0552f0a ("crypto/scheduler: add multicore scheduling mode")
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
drivers/crypto/scheduler/scheduler_multicore.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/crypto/scheduler/scheduler_multicore.c b/drivers/crypto/scheduler/scheduler_multicore.c
index 555c405c1..b4c29d72f 100644
--- a/drivers/crypto/scheduler/scheduler_multicore.c
+++ b/drivers/crypto/scheduler/scheduler_multicore.c
@@ -347,7 +347,8 @@ scheduler_create_private_ctx(struct rte_cryptodev *dev)
for (i = 0; i < sched_ctx->nb_wc; i++) {
char r_name[16];
- snprintf(r_name, sizeof(r_name), MC_SCHED_ENQ_RING_NAME_PREFIX "%u", i);
+ snprintf(r_name, sizeof(r_name), MC_SCHED_ENQ_RING_NAME_PREFIX
+ "%u_%u", dev->data->dev_id, i);
mc_ctx->sched_enq_ring[i] = rte_ring_lookup(r_name);
if (!mc_ctx->sched_enq_ring[i]) {
mc_ctx->sched_enq_ring[i] = rte_ring_create(r_name,
@@ -360,7 +361,8 @@ scheduler_create_private_ctx(struct rte_cryptodev *dev)
goto exit;
}
}
- snprintf(r_name, sizeof(r_name), MC_SCHED_DEQ_RING_NAME_PREFIX "%u", i);
+ snprintf(r_name, sizeof(r_name), MC_SCHED_DEQ_RING_NAME_PREFIX
+ "%u_%u", dev->data->dev_id, i);
mc_ctx->sched_deq_ring[i] = rte_ring_lookup(r_name);
if (!mc_ctx->sched_deq_ring[i]) {
mc_ctx->sched_deq_ring[i] = rte_ring_create(r_name,
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'app/crypto-perf: use strcpy for allocated string' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (33 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'crypto/scheduler: fix possible duplicated ring names' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'app/crypto-perf: fix parameters copy' " luca.boccassi
` (22 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Jerin Jacob; +Cc: Pablo de Lara, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 7e35818f4cf31e46e3f5e4bfd6e985a6fae92015 Mon Sep 17 00:00:00 2001
From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Date: Wed, 16 May 2018 17:58:03 +0530
Subject: [PATCH] app/crypto-perf: use strcpy for allocated string
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[ upstream commit 21f579fcefd3ac21d1894be662f774cf48bb914e ]
inlined from ‘cperf_test_vector_get_from_file’ at
app/test-crypto-perf/cperf_test_vector_parsing.c:578:11:
app/test-crypto-perf/cperf_test_vector_parsing.c:510:3: error:
‘strncpy’ output truncated before terminating nul copying as many bytes
from a string as its length [-Werror=stringop-truncation]
strncpy(entry, line, strlen(line));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/test-crypto-perf/cperf_test_vector_parsing.c:528:5: error:
‘strncat’ output truncated before terminating nul copying as many bytes
from a string as its length [-Werror=stringop-truncation]
strncat(entry, line, strlen(line));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found this issue with meson build and gcc 8.1.
Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application")
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
app/test-crypto-perf/cperf_test_vector_parsing.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/app/test-crypto-perf/cperf_test_vector_parsing.c b/app/test-crypto-perf/cperf_test_vector_parsing.c
index 26321d004..92932a230 100644
--- a/app/test-crypto-perf/cperf_test_vector_parsing.c
+++ b/app/test-crypto-perf/cperf_test_vector_parsing.c
@@ -506,8 +506,7 @@ parse_file(struct cperf_test_vector *vector, struct cperf_options *opts)
if (entry == NULL)
return -1;
- memset(entry, 0, strlen(line) + 1);
- strncpy(entry, line, strlen(line));
+ strcpy(entry, line);
/* check if entry ends with , or = */
if (entry[strlen(entry) - 1] == ','
@@ -524,8 +523,8 @@ parse_file(struct cperf_test_vector *vector, struct cperf_options *opts)
if (entry_extended == NULL)
goto err;
entry = entry_extended;
-
- strncat(entry, line, strlen(line));
+ /* entry has been allocated accordingly */
+ strcpy(&entry[strlen(entry)], line);
if (entry[strlen(entry) - 1] != ',')
break;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'app/crypto-perf: fix parameters copy' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (34 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'app/crypto-perf: use strcpy for allocated string' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'crypto/aesni_gcm: remove unneeded cast' " luca.boccassi
` (21 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Jerin Jacob; +Cc: Pablo de Lara, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 5a8dd4fb43af51d5db8736c581d6f4cd8dec0a68 Mon Sep 17 00:00:00 2001
From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Date: Wed, 16 May 2018 17:58:04 +0530
Subject: [PATCH] app/crypto-perf: fix parameters copy
[ upstream commit 873dac8ec608ca02d59214b4a3022b2f25de717b ]
Since arm64 was using plain memcpy for rte_memcpy, gcc 8.1, could
detect size was more than source address range. In this case, the
source was wrong.
test/test/test_cryptodev.c: In function 'test_multi_session_random_usage':
rte_memcpy_64.h:364:29: error: 'memcpy'
forming offset [113, 184] is out of the bounds [0, 112] of object
'testsuite_params' with type 'struct crypto_testsuite_params'
[-Werror=array-bounds]
#define rte_memcpy(d, s, n) memcpy((d), (s), (n))
^~~~~~~~~~~~~~~~~~~~~
test/test/test_cryptodev.c:6618:3: note:
in expansion of macro 'rte_memcpy'
rte_memcpy(&ut_paramz[i].ut_params, &testsuite_params,
^~~~~~~~~~
test/test/test_cryptodev.c:140:39: note:
'testsuite_params' declared here
static struct crypto_testsuite_params testsuite_params = { NULL };
Fixes: ffbe3be0d4b5 ("app/test: add libcrypto")
Suggested-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
test/test/test_cryptodev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/test/test_cryptodev.c b/test/test/test_cryptodev.c
index 1417482c3..9d3c851c1 100644
--- a/test/test/test_cryptodev.c
+++ b/test/test/test_cryptodev.c
@@ -6456,7 +6456,7 @@ test_multi_session_random_usage(void)
sessions[i] = rte_cryptodev_sym_session_create(
ts_params->session_mpool);
- rte_memcpy(&ut_paramz[i].ut_params, &testsuite_params,
+ rte_memcpy(&ut_paramz[i].ut_params, &unittest_params,
sizeof(struct crypto_unittest_params));
test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'crypto/aesni_gcm: remove unneeded cast' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (35 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'app/crypto-perf: fix parameters copy' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'cryptodev: fix supported size check' " luca.boccassi
` (20 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Pablo de Lara; +Cc: Fiona Trahe, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 5bd4a62b93d76166688eedbb0aec810d69386c91 Mon Sep 17 00:00:00 2001
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Date: Tue, 15 May 2018 21:21:02 +0100
Subject: [PATCH] crypto/aesni_gcm: remove unneeded cast
[ upstream commit 5fa2a3089b5df4089009558e9d2f9b8aa31fccfb ]
qp->temp_digest is already an array of uint8_t,
so no need to cast to uint8_t*.
Fixes: baf1e63bfd65 ("crypto/aesni_gcm: do not append digest")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
---
drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
index 83e544809..4bcc7408e 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
@@ -352,7 +352,7 @@ post_process_gcm_crypto_op(struct aesni_gcm_qp *qp,
session->op == AESNI_GMAC_OP_VERIFY) {
uint8_t *digest;
- uint8_t *tag = (uint8_t *)&qp->temp_digest;
+ uint8_t *tag = qp->temp_digest;
if (session->op == AESNI_GMAC_OP_VERIFY)
digest = op->sym->auth.digest.data;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'cryptodev: fix supported size check' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (36 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'crypto/aesni_gcm: remove unneeded cast' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'cryptodev: add missing security feature string' " luca.boccassi
` (19 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Pablo de Lara; +Cc: Fiona Trahe, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From cb3df2753561dfcefbc0ee18c747c9d501ff1e33 Mon Sep 17 00:00:00 2001
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Date: Tue, 15 May 2018 20:13:13 +0100
Subject: [PATCH] cryptodev: fix supported size check
[ upstream commit 23f0db51adbeb5ec098a9a6ed7b888f96ef7729b ]
Crypto capability structure contains supported
sizes for key, IV, digest, etc. on different algorithms.
These sizes can be expressed as a single value or
a range of values.
The check was broken when a size was checked against
a range with multiple values.
Also, for more clarity, the param_range_check macro
has been converted into a function.
Fixes: 38227c0e3ad2 ("cryptodev: retrieve device info")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
---
lib/librte_cryptodev/rte_cryptodev.c | 45 ++++++++++++++++++++++++++----------
1 file changed, 33 insertions(+), 12 deletions(-)
diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
index 8745b6b02..5728d2e05 100644
--- a/lib/librte_cryptodev/rte_cryptodev.c
+++ b/lib/librte_cryptodev/rte_cryptodev.c
@@ -262,19 +262,40 @@ rte_cryptodev_sym_capability_get(uint8_t dev_id,
}
-#define param_range_check(x, y) \
- (((x < y.min) || (x > y.max)) || \
- (y.increment != 0 && (x % y.increment) != 0))
+static int
+param_range_check(uint16_t size, const struct rte_crypto_param_range *range)
+{
+ unsigned int next_size;
+
+ /* Check lower/upper bounds */
+ if (size < range->min)
+ return -1;
+
+ if (size > range->max)
+ return -1;
+
+ /* If range is actually only one value, size is correct */
+ if (range->increment == 0)
+ return 0;
+
+ /* Check if value is one of the supported sizes */
+ for (next_size = range->min; next_size <= range->max;
+ next_size += range->increment)
+ if (size == next_size)
+ return 0;
+
+ return -1;
+}
int
rte_cryptodev_sym_capability_check_cipher(
const struct rte_cryptodev_symmetric_capability *capability,
uint16_t key_size, uint16_t iv_size)
{
- if (param_range_check(key_size, capability->cipher.key_size))
+ if (param_range_check(key_size, &capability->cipher.key_size) != 0)
return -1;
- if (param_range_check(iv_size, capability->cipher.iv_size))
+ if (param_range_check(iv_size, &capability->cipher.iv_size) != 0)
return -1;
return 0;
@@ -285,13 +306,13 @@ rte_cryptodev_sym_capability_check_auth(
const struct rte_cryptodev_symmetric_capability *capability,
uint16_t key_size, uint16_t digest_size, uint16_t iv_size)
{
- if (param_range_check(key_size, capability->auth.key_size))
+ if (param_range_check(key_size, &capability->auth.key_size) != 0)
return -1;
- if (param_range_check(digest_size, capability->auth.digest_size))
+ if (param_range_check(digest_size, &capability->auth.digest_size) != 0)
return -1;
- if (param_range_check(iv_size, capability->auth.iv_size))
+ if (param_range_check(iv_size, &capability->auth.iv_size) != 0)
return -1;
return 0;
@@ -303,16 +324,16 @@ rte_cryptodev_sym_capability_check_aead(
uint16_t key_size, uint16_t digest_size, uint16_t aad_size,
uint16_t iv_size)
{
- if (param_range_check(key_size, capability->aead.key_size))
+ if (param_range_check(key_size, &capability->aead.key_size) != 0)
return -1;
- if (param_range_check(digest_size, capability->aead.digest_size))
+ if (param_range_check(digest_size, &capability->aead.digest_size) != 0)
return -1;
- if (param_range_check(aad_size, capability->aead.aad_size))
+ if (param_range_check(aad_size, &capability->aead.aad_size) != 0)
return -1;
- if (param_range_check(iv_size, capability->aead.iv_size))
+ if (param_range_check(iv_size, &capability->aead.iv_size) != 0)
return -1;
return 0;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'cryptodev: add missing security feature string' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (37 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'cryptodev: fix supported size check' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'crypto/scheduler: fix 64-bit mask of workers cores' " luca.boccassi
` (18 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Pablo de Lara; +Cc: Vipin Varghese, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 07c3e626ff8cd6d5a18e8960608195a81961942a Mon Sep 17 00:00:00 2001
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Date: Fri, 18 May 2018 14:23:50 +0100
Subject: [PATCH] cryptodev: add missing security feature string
[ upstream commit 0a004add1cbc2cb061a9a428ff6fa9a900561921 ]
Security protocol flag string was not added
when the actual flag was added.
Fixes: eadb4fa1e1fe ("cryptodev: support security APIs")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Vipin Varghese <vipin.varghese@intel.com>
---
lib/librte_cryptodev/rte_cryptodev.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
index 5728d2e05..3d503a8a9 100644
--- a/lib/librte_cryptodev/rte_cryptodev.c
+++ b/lib/librte_cryptodev/rte_cryptodev.c
@@ -367,6 +367,8 @@ rte_cryptodev_get_feature_name(uint64_t flag)
return "CPU_NEON";
case RTE_CRYPTODEV_FF_CPU_ARM_CE:
return "CPU_ARM_CE";
+ case RTE_CRYPTODEV_FF_SECURITY:
+ return "SECURITY_PROTOCOL";
default:
return NULL;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'crypto/scheduler: fix 64-bit mask of workers cores' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (38 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'cryptodev: add missing security feature string' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'ethdev: fix storage type of latest port id' " luca.boccassi
` (17 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Kirill Rybalchenko; +Cc: Pablo de Lara, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 2c22491d2f3d73abf56c87642097974b0bd62e38 Mon Sep 17 00:00:00 2001
From: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
Date: Mon, 21 May 2018 11:22:12 +0100
Subject: [PATCH] crypto/scheduler: fix 64-bit mask of workers cores
[ upstream commit 1b78e3f26f59fd9efc5739839d8a14ebe3aa7818 ]
The list of workers cores was represented by 64-bit bitmask.
It doesn't work if system has cores with id higher than 63.
This fix changes list of workers cores to array of uint16_t.
The size of array equals to RTE_MAX_LCORE.
Fixes: 4c07e0552f0a ("crypto/scheduler: add multicore scheduling mode")
Signed-off-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
drivers/crypto/scheduler/rte_cryptodev_scheduler.h | 2 +-
drivers/crypto/scheduler/scheduler_multicore.c | 4 +-
drivers/crypto/scheduler/scheduler_pmd.c | 68 +++++++++++++++++-----
drivers/crypto/scheduler/scheduler_pmd_private.h | 2 +-
4 files changed, 56 insertions(+), 20 deletions(-)
diff --git a/drivers/crypto/scheduler/rte_cryptodev_scheduler.h b/drivers/crypto/scheduler/rte_cryptodev_scheduler.h
index 01e7646ca..1c164da7c 100644
--- a/drivers/crypto/scheduler/rte_cryptodev_scheduler.h
+++ b/drivers/crypto/scheduler/rte_cryptodev_scheduler.h
@@ -30,7 +30,7 @@ extern "C" {
#endif
/** Maximum number of multi-core worker cores */
-#define RTE_CRYPTODEV_SCHEDULER_MAX_NB_WORKER_CORES (64)
+#define RTE_CRYPTODEV_SCHEDULER_MAX_NB_WORKER_CORES (RTE_MAX_LCORE - 1)
/** Round-robin scheduling mode string */
#define SCHEDULER_MODE_NAME_ROUND_ROBIN round-robin
diff --git a/drivers/crypto/scheduler/scheduler_multicore.c b/drivers/crypto/scheduler/scheduler_multicore.c
index b4c29d72f..91fb06681 100644
--- a/drivers/crypto/scheduler/scheduler_multicore.c
+++ b/drivers/crypto/scheduler/scheduler_multicore.c
@@ -21,8 +21,8 @@ struct mc_scheduler_ctx {
uint32_t num_workers; /**< Number of workers polling */
uint32_t stop_signal;
- struct rte_ring *sched_enq_ring[RTE_CRYPTODEV_SCHEDULER_MAX_NB_WORKER_CORES];
- struct rte_ring *sched_deq_ring[RTE_CRYPTODEV_SCHEDULER_MAX_NB_WORKER_CORES];
+ struct rte_ring *sched_enq_ring[RTE_MAX_LCORE];
+ struct rte_ring *sched_deq_ring[RTE_MAX_LCORE];
};
struct mc_scheduler_qp_ctx {
diff --git a/drivers/crypto/scheduler/scheduler_pmd.c b/drivers/crypto/scheduler/scheduler_pmd.c
index 51a85fa64..d7157cac1 100644
--- a/drivers/crypto/scheduler/scheduler_pmd.c
+++ b/drivers/crypto/scheduler/scheduler_pmd.c
@@ -20,7 +20,8 @@ struct scheduler_init_params {
uint32_t nb_slaves;
enum rte_cryptodev_scheduler_mode mode;
uint32_t enable_ordering;
- uint64_t wcmask;
+ uint16_t wc_pool[RTE_MAX_LCORE];
+ uint16_t nb_wc;
char slave_names[RTE_CRYPTODEV_SCHEDULER_MAX_NB_SLAVES]
[RTE_CRYPTODEV_SCHEDULER_NAME_MAX_LEN];
};
@@ -86,10 +87,6 @@ cryptodev_scheduler_create(const char *name,
return -EFAULT;
}
- if (init_params->wcmask != 0)
- RTE_LOG(INFO, PMD, " workers core mask = %"PRIx64"\n",
- init_params->wcmask);
-
dev->driver_id = cryptodev_driver_id;
dev->dev_ops = rte_crypto_scheduler_pmd_ops;
@@ -100,15 +97,12 @@ cryptodev_scheduler_create(const char *name,
if (init_params->mode == CDEV_SCHED_MODE_MULTICORE) {
uint16_t i;
- sched_ctx->nb_wc = 0;
+ sched_ctx->nb_wc = init_params->nb_wc;
- for (i = 0; i < RTE_CRYPTODEV_SCHEDULER_MAX_NB_WORKER_CORES; i++) {
- if (init_params->wcmask & (1ULL << i)) {
- sched_ctx->wc_pool[sched_ctx->nb_wc++] = i;
- RTE_LOG(INFO, PMD,
- " Worker core[%u]=%u added\n",
- sched_ctx->nb_wc-1, i);
- }
+ for (i = 0; i < sched_ctx->nb_wc; i++) {
+ sched_ctx->wc_pool[i] = init_params->wc_pool[i];
+ RTE_LOG(INFO, PMD, " Worker core[%u]=%u added\n",
+ i, sched_ctx->wc_pool[i]);
}
}
@@ -232,9 +226,47 @@ static int
parse_coremask_arg(const char *key __rte_unused,
const char *value, void *extra_args)
{
+ int i, j, val;
+ uint16_t idx = 0;
+ char c;
struct scheduler_init_params *params = extra_args;
- params->wcmask = strtoull(value, NULL, 16);
+ params->nb_wc = 0;
+
+ if (value == NULL)
+ return -1;
+ /* Remove all blank characters ahead and after .
+ * Remove 0x/0X if exists.
+ */
+ while (isblank(*value))
+ value++;
+ if (value[0] == '0' && ((value[1] == 'x') || (value[1] == 'X')))
+ value += 2;
+ i = strlen(value);
+ while ((i > 0) && isblank(value[i - 1]))
+ i--;
+
+ if (i == 0)
+ return -1;
+
+ for (i = i - 1; i >= 0 && idx < RTE_MAX_LCORE; i--) {
+ c = value[i];
+ if (isxdigit(c) == 0) {
+ /* invalid characters */
+ return -1;
+ }
+ if (isdigit(c))
+ val = c - '0';
+ else if (isupper(c))
+ val = c - 'A' + 10;
+ else
+ val = c - 'a' + 10;
+
+ for (j = 0; j < 4 && idx < RTE_MAX_LCORE; j++, idx++) {
+ if ((1 << j) & val)
+ params->wc_pool[params->nb_wc++] = idx;
+ }
+ }
return 0;
}
@@ -246,7 +278,7 @@ parse_corelist_arg(const char *key __rte_unused,
{
struct scheduler_init_params *params = extra_args;
- params->wcmask = 0ULL;
+ params->nb_wc = 0;
const char *token = value;
@@ -254,7 +286,11 @@ parse_corelist_arg(const char *key __rte_unused,
char *rval;
unsigned int core = strtoul(token, &rval, 10);
- params->wcmask |= 1ULL << core;
+ if (core >= RTE_MAX_LCORE) {
+ CS_LOG_ERR("Invalid worker core %u, should be smaller "
+ "than %u.\n", core, RTE_MAX_LCORE);
+ }
+ params->wc_pool[params->nb_wc++] = (uint16_t)core;
token = (const char *)rval;
if (token[0] == '\0')
break;
diff --git a/drivers/crypto/scheduler/scheduler_pmd_private.h b/drivers/crypto/scheduler/scheduler_pmd_private.h
index dd7ca5a4e..12410b483 100644
--- a/drivers/crypto/scheduler/scheduler_pmd_private.h
+++ b/drivers/crypto/scheduler/scheduler_pmd_private.h
@@ -60,7 +60,7 @@ struct scheduler_ctx {
char name[RTE_CRYPTODEV_SCHEDULER_NAME_MAX_LEN];
char description[RTE_CRYPTODEV_SCHEDULER_DESC_MAX_LEN];
- uint16_t wc_pool[RTE_CRYPTODEV_SCHEDULER_MAX_NB_WORKER_CORES];
+ uint16_t wc_pool[RTE_MAX_LCORE];
uint16_t nb_wc;
char *init_slave_names[RTE_CRYPTODEV_SCHEDULER_MAX_NB_SLAVES];
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'ethdev: fix storage type of latest port id' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (39 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'crypto/scheduler: fix 64-bit mask of workers cores' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'app/testpmd: fix exit for virtio-user' " luca.boccassi
` (16 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Zhiyong Yang; +Cc: Ferruh Yigit, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 73325e45437ea8b875b5e217de67850dc903d0e4 Mon Sep 17 00:00:00 2001
From: Zhiyong Yang <zhiyong.yang@intel.com>
Date: Fri, 18 May 2018 18:41:10 +0800
Subject: [PATCH] ethdev: fix storage type of latest port id
[ upstream commit 4462814d850fadcbdbbadb324d125aefbb83a2b8 ]
eth_dev_last_created_port is used to store port id type and should
be extended to 16bits corresponding to ethdev port id range.
Fixes: f8244c6399d9 ("ethdev: increase port id range")
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
lib/librte_ether/rte_ethdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 8ce5ec999..939b668f8 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -44,7 +44,7 @@
static const char *MZ_RTE_ETH_DEV_DATA = "rte_eth_dev_data";
struct rte_eth_dev rte_eth_devices[RTE_MAX_ETHPORTS];
-static uint8_t eth_dev_last_created_port;
+static uint16_t eth_dev_last_created_port;
/* spinlock for eth device callbacks */
static rte_spinlock_t rte_eth_dev_cb_lock = RTE_SPINLOCK_INITIALIZER;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'app/testpmd: fix exit for virtio-user' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (40 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'ethdev: fix storage type of latest port id' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-27 4:14 ` Yuanhan Liu
2018-05-23 12:09 ` [dpdk-stable] patch 'net/ixgbe: fix DCB configuration' " luca.boccassi
` (15 subsequent siblings)
57 siblings, 1 reply; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Zhiyong Yang; +Cc: Lei Yao, Bernard Iremonger, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 8e96cf1276094a75ad0d3fd32912c672489e9811 Mon Sep 17 00:00:00 2001
From: Zhiyong Yang <zhiyong.yang@intel.com>
Date: Fri, 18 May 2018 17:59:37 +0800
Subject: [PATCH] app/testpmd: fix exit for virtio-user
[ upstream commit 124909d7e1bf299c959b58c2db7c5fbd7abbb7c0 ]
For vdev, just calling rte_eth_dev_close() isn't enough to free all
the resources allocated during device probe, e.g. for virtio-user,
virtio_user_pmd_remove(), i.e. the remove() method of a vdev driver,
needs to be called to unlink the socket file created during device
probe. So this patch calls the rte_eth_dev_detach() for vdev when
quitting testpmd.
vdevs detach on testpmd exit implemented as workaround to fix
a virtio-user issue. The issue was virtio-user cleanup is not
called and existing socket file not cleaned up which will fail
next run.
Added a comment that this workaround should be converted to a proper
cleanup, not something specific to virtio-user, and not something
specific to vdev and testpmd.
Fixes: af75078fece3 ("first public release")
Fixes: bd8f50a45d0f ("net/virtio-user: support server mode")
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
app/test-pmd/testpmd.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 05a68a068..98e0a9dc6 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1951,6 +1951,7 @@ detach_port(portid_t port_id)
void
pmd_test_exit(void)
{
+ struct rte_device *device;
portid_t pt_id;
if (test_done == 0)
@@ -1963,6 +1964,18 @@ pmd_test_exit(void)
fflush(stdout);
stop_port(pt_id);
close_port(pt_id);
+
+ /*
+ * This is a workaround to fix a virtio-user issue that
+ * requires to call clean-up routine to remove existing
+ * socket.
+ * This workaround valid only for testpmd, needs a fix
+ * valid for all applications.
+ * TODO: Implement proper resource cleanup
+ */
+ device = rte_eth_devices[pt_id].device;
+ if (device && !strcmp(device->driver->name, "net_virtio_user"))
+ detach_port(pt_id);
}
}
printf("\nBye...\n");
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* Re: [dpdk-stable] patch 'app/testpmd: fix exit for virtio-user' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'app/testpmd: fix exit for virtio-user' " luca.boccassi
@ 2018-05-27 4:14 ` Yuanhan Liu
2018-05-27 14:36 ` Yang, Zhiyong
0 siblings, 1 reply; 382+ messages in thread
From: Yuanhan Liu @ 2018-05-27 4:14 UTC (permalink / raw)
To: luca.boccassi; +Cc: Zhiyong Yang, Lei Yao, Bernard Iremonger, dpdk stable
On Wed, May 23, 2018 at 01:09:54PM +0100, luca.boccassi@gmail.com wrote:
> Hi,
>
> FYI, your patch has been queued to stable release 18.02.2
>
> Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
> It will be pushed if I get no objections before 05/25/18. So please
> shout if anyone has objections.
I'm late, but I'd suggest you to not include this patch, for
- it's a workaround
- it tries to "fix" an issue introduced in v18.05, for adding virtio-user
server mode.
--yliu
>
> Thanks.
>
> Luca Boccassi
>
> ---
> >From 8e96cf1276094a75ad0d3fd32912c672489e9811 Mon Sep 17 00:00:00 2001
> From: Zhiyong Yang <zhiyong.yang@intel.com>
> Date: Fri, 18 May 2018 17:59:37 +0800
> Subject: [PATCH] app/testpmd: fix exit for virtio-user
>
> [ upstream commit 124909d7e1bf299c959b58c2db7c5fbd7abbb7c0 ]
>
> For vdev, just calling rte_eth_dev_close() isn't enough to free all
> the resources allocated during device probe, e.g. for virtio-user,
> virtio_user_pmd_remove(), i.e. the remove() method of a vdev driver,
> needs to be called to unlink the socket file created during device
> probe. So this patch calls the rte_eth_dev_detach() for vdev when
> quitting testpmd.
>
> vdevs detach on testpmd exit implemented as workaround to fix
> a virtio-user issue. The issue was virtio-user cleanup is not
> called and existing socket file not cleaned up which will fail
> next run.
>
> Added a comment that this workaround should be converted to a proper
> cleanup, not something specific to virtio-user, and not something
> specific to vdev and testpmd.
>
> Fixes: af75078fece3 ("first public release")
> Fixes: bd8f50a45d0f ("net/virtio-user: support server mode")
>
> Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
> Tested-by: Lei Yao <lei.a.yao@intel.com>
> Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---
> app/test-pmd/testpmd.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> index 05a68a068..98e0a9dc6 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -1951,6 +1951,7 @@ detach_port(portid_t port_id)
> void
> pmd_test_exit(void)
> {
> + struct rte_device *device;
> portid_t pt_id;
>
> if (test_done == 0)
> @@ -1963,6 +1964,18 @@ pmd_test_exit(void)
> fflush(stdout);
> stop_port(pt_id);
> close_port(pt_id);
> +
> + /*
> + * This is a workaround to fix a virtio-user issue that
> + * requires to call clean-up routine to remove existing
> + * socket.
> + * This workaround valid only for testpmd, needs a fix
> + * valid for all applications.
> + * TODO: Implement proper resource cleanup
> + */
> + device = rte_eth_devices[pt_id].device;
> + if (device && !strcmp(device->driver->name, "net_virtio_user"))
> + detach_port(pt_id);
> }
> }
> printf("\nBye...\n");
> --
> 2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* Re: [dpdk-stable] patch 'app/testpmd: fix exit for virtio-user' has been queued to stable release 18.02.2
2018-05-27 4:14 ` Yuanhan Liu
@ 2018-05-27 14:36 ` Yang, Zhiyong
2018-05-29 10:24 ` Luca Boccassi
0 siblings, 1 reply; 382+ messages in thread
From: Yang, Zhiyong @ 2018-05-27 14:36 UTC (permalink / raw)
To: Yuanhan Liu, luca.boccassi; +Cc: Yao, Lei A, Iremonger, Bernard, dpdk stable
Agreed with yuanhan, The patch doesn't resolve resource leakage issue except virtio-user.
rte_eal_cleanup is defined to do this, while it is not implemented completely for now.
> -----Original Message-----
> From: Yuanhan Liu [mailto:yliu@fridaylinux.org]
> Sent: Sunday, May 27, 2018 12:14 PM
> To: luca.boccassi@gmail.com
> Cc: Yang, Zhiyong <zhiyong.yang@intel.com>; Yao, Lei A <lei.a.yao@intel.com>;
> Iremonger, Bernard <bernard.iremonger@intel.com>; dpdk stable
> <stable@dpdk.org>
> Subject: Re: [dpdk-stable] patch 'app/testpmd: fix exit for virtio-user' has been
> queued to stable release 18.02.2
>
> On Wed, May 23, 2018 at 01:09:54PM +0100, luca.boccassi@gmail.com wrote:
> > Hi,
> >
> > FYI, your patch has been queued to stable release 18.02.2
> >
> > Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
> > It will be pushed if I get no objections before 05/25/18. So please
> > shout if anyone has objections.
>
> I'm late, but I'd suggest you to not include this patch, for
>
> - it's a workaround
>
> - it tries to "fix" an issue introduced in v18.05, for adding virtio-user
> server mode.
>
> --yliu
> >
> > Thanks.
> >
> > Luca Boccassi
> >
> > ---
> > >From 8e96cf1276094a75ad0d3fd32912c672489e9811 Mon Sep 17 00:00:00
> > >2001
> > From: Zhiyong Yang <zhiyong.yang@intel.com>
> > Date: Fri, 18 May 2018 17:59:37 +0800
> > Subject: [PATCH] app/testpmd: fix exit for virtio-user
> >
> > [ upstream commit 124909d7e1bf299c959b58c2db7c5fbd7abbb7c0 ]
> >
> > For vdev, just calling rte_eth_dev_close() isn't enough to free all
> > the resources allocated during device probe, e.g. for virtio-user,
> > virtio_user_pmd_remove(), i.e. the remove() method of a vdev driver,
> > needs to be called to unlink the socket file created during device
> > probe. So this patch calls the rte_eth_dev_detach() for vdev when
> > quitting testpmd.
> >
> > vdevs detach on testpmd exit implemented as workaround to fix a
> > virtio-user issue. The issue was virtio-user cleanup is not called and
> > existing socket file not cleaned up which will fail next run.
> >
> > Added a comment that this workaround should be converted to a proper
> > cleanup, not something specific to virtio-user, and not something
> > specific to vdev and testpmd.
> >
> > Fixes: af75078fece3 ("first public release")
> > Fixes: bd8f50a45d0f ("net/virtio-user: support server mode")
> >
> > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
> > Tested-by: Lei Yao <lei.a.yao@intel.com>
> > Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > ---
> > app/test-pmd/testpmd.c | 13 +++++++++++++
> > 1 file changed, 13 insertions(+)
> >
> > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index
> > 05a68a068..98e0a9dc6 100644
> > --- a/app/test-pmd/testpmd.c
> > +++ b/app/test-pmd/testpmd.c
> > @@ -1951,6 +1951,7 @@ detach_port(portid_t port_id) void
> > pmd_test_exit(void)
> > {
> > + struct rte_device *device;
> > portid_t pt_id;
> >
> > if (test_done == 0)
> > @@ -1963,6 +1964,18 @@ pmd_test_exit(void)
> > fflush(stdout);
> > stop_port(pt_id);
> > close_port(pt_id);
> > +
> > + /*
> > + * This is a workaround to fix a virtio-user issue that
> > + * requires to call clean-up routine to remove existing
> > + * socket.
> > + * This workaround valid only for testpmd, needs a fix
> > + * valid for all applications.
> > + * TODO: Implement proper resource cleanup
> > + */
> > + device = rte_eth_devices[pt_id].device;
> > + if (device && !strcmp(device->driver->name,
> "net_virtio_user"))
> > + detach_port(pt_id);
> > }
> > }
> > printf("\nBye...\n");
> > --
> > 2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* Re: [dpdk-stable] patch 'app/testpmd: fix exit for virtio-user' has been queued to stable release 18.02.2
2018-05-27 14:36 ` Yang, Zhiyong
@ 2018-05-29 10:24 ` Luca Boccassi
0 siblings, 0 replies; 382+ messages in thread
From: Luca Boccassi @ 2018-05-29 10:24 UTC (permalink / raw)
To: Yang, Zhiyong, Yuanhan Liu; +Cc: Yao, Lei A, Iremonger, Bernard, dpdk stable
On Sun, 2018-05-27 at 14:36 +0000, Yang, Zhiyong wrote:
> Agreed with yuanhan, The patch doesn't resolve resource leakage issue
> except virtio-user.
> rte_eal_cleanup is defined to do this, while it is not implemented
> completely for now.
Ok, I will revert it, thanks.
> > -----Original Message-----
> > From: Yuanhan Liu [mailto:yliu@fridaylinux.org]
> > Sent: Sunday, May 27, 2018 12:14 PM
> > To: luca.boccassi@gmail.com
> > Cc: Yang, Zhiyong <zhiyong.yang@intel.com>; Yao, Lei A <lei.a.yao@i
> > ntel.com>;
> > Iremonger, Bernard <bernard.iremonger@intel.com>; dpdk stable
> > <stable@dpdk.org>
> > Subject: Re: [dpdk-stable] patch 'app/testpmd: fix exit for virtio-
> > user' has been
> > queued to stable release 18.02.2
> >
> > On Wed, May 23, 2018 at 01:09:54PM +0100, luca.boccassi@gmail.com
> > wrote:
> > > Hi,
> > >
> > > FYI, your patch has been queued to stable release 18.02.2
> > >
> > > Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable
> > > yet.
> > > It will be pushed if I get no objections before 05/25/18. So
> > > please
> > > shout if anyone has objections.
> >
> > I'm late, but I'd suggest you to not include this patch, for
> >
> > - it's a workaround
> >
> > - it tries to "fix" an issue introduced in v18.05, for adding
> > virtio-user
> > server mode.
> >
> > --yliu
> > >
> > > Thanks.
> > >
> > > Luca Boccassi
> > >
> > > ---
> > > > From 8e96cf1276094a75ad0d3fd32912c672489e9811 Mon Sep 17
> > > > 00:00:00
> > > > 2001
> > >
> > > From: Zhiyong Yang <zhiyong.yang@intel.com>
> > > Date: Fri, 18 May 2018 17:59:37 +0800
> > > Subject: [PATCH] app/testpmd: fix exit for virtio-user
> > >
> > > [ upstream commit 124909d7e1bf299c959b58c2db7c5fbd7abbb7c0 ]
> > >
> > > For vdev, just calling rte_eth_dev_close() isn't enough to free
> > > all
> > > the resources allocated during device probe, e.g. for virtio-
> > > user,
> > > virtio_user_pmd_remove(), i.e. the remove() method of a vdev
> > > driver,
> > > needs to be called to unlink the socket file created during
> > > device
> > > probe. So this patch calls the rte_eth_dev_detach() for vdev when
> > > quitting testpmd.
> > >
> > > vdevs detach on testpmd exit implemented as workaround to fix a
> > > virtio-user issue. The issue was virtio-user cleanup is not
> > > called and
> > > existing socket file not cleaned up which will fail next run.
> > >
> > > Added a comment that this workaround should be converted to a
> > > proper
> > > cleanup, not something specific to virtio-user, and not something
> > > specific to vdev and testpmd.
> > >
> > > Fixes: af75078fece3 ("first public release")
> > > Fixes: bd8f50a45d0f ("net/virtio-user: support server mode")
> > >
> > > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
> > > Tested-by: Lei Yao <lei.a.yao@intel.com>
> > > Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > > ---
> > > app/test-pmd/testpmd.c | 13 +++++++++++++
> > > 1 file changed, 13 insertions(+)
> > >
> > > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> > > index
> > > 05a68a068..98e0a9dc6 100644
> > > --- a/app/test-pmd/testpmd.c
> > > +++ b/app/test-pmd/testpmd.c
> > > @@ -1951,6 +1951,7 @@ detach_port(portid_t port_id) void
> > > pmd_test_exit(void)
> > > {
> > > + struct rte_device *device;
> > > portid_t pt_id;
> > >
> > > if (test_done == 0)
> > > @@ -1963,6 +1964,18 @@ pmd_test_exit(void)
> > > fflush(stdout);
> > > stop_port(pt_id);
> > > close_port(pt_id);
> > > +
> > > + /*
> > > + * This is a workaround to fix a virtio-
> > > user issue that
> > > + * requires to call clean-up routine to
> > > remove existing
> > > + * socket.
> > > + * This workaround valid only for
> > > testpmd, needs a fix
> > > + * valid for all applications.
> > > + * TODO: Implement proper resource
> > > cleanup
> > > + */
> > > + device = rte_eth_devices[pt_id].device;
> > > + if (device && !strcmp(device->driver-
> > > >name,
> >
> > "net_virtio_user"))
> > > + detach_port(pt_id);
> > > }
> > > }
> > > printf("\nBye...\n");
> > > --
> > > 2.14.2
--
Kind regards,
Luca Boccassi
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/ixgbe: fix DCB configuration' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (41 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'app/testpmd: fix exit for virtio-user' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'net/qede: fix multicast filtering' " luca.boccassi
` (14 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Qiming Yang; +Cc: Wenzhuo Lu, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 6fd5f6a119c01b0ed4fbd903fe71654e9989513a Mon Sep 17 00:00:00 2001
From: Qiming Yang <qiming.yang@intel.com>
Date: Fri, 18 May 2018 17:51:56 +0800
Subject: [PATCH] net/ixgbe: fix DCB configuration
[ upstream commit 3e8d16a0fbb3c9f33b9611e8e1644683e9ece23d ]
This patch removes unnecessary check in ixgbe_check_mq_mode, which
fixes the DCB configuration issue.
Fixes: 27b609cbd1c6 ("ethdev: move the multi-queue mode check to specific drivers")
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
drivers/net/ixgbe/ixgbe_ethdev.c | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index ad8b4fcc8..bdb553add 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -2303,11 +2303,6 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
if (dev_conf->rxmode.mq_mode == ETH_MQ_RX_DCB) {
const struct rte_eth_dcb_rx_conf *conf;
- if (nb_rx_q != IXGBE_DCB_NB_QUEUES) {
- PMD_INIT_LOG(ERR, "DCB selected, nb_rx_q != %d.",
- IXGBE_DCB_NB_QUEUES);
- return -EINVAL;
- }
conf = &dev_conf->rx_adv_conf.dcb_rx_conf;
if (!(conf->nb_tcs == ETH_4_TCS ||
conf->nb_tcs == ETH_8_TCS)) {
@@ -2321,11 +2316,6 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
if (dev_conf->txmode.mq_mode == ETH_MQ_TX_DCB) {
const struct rte_eth_dcb_tx_conf *conf;
- if (nb_tx_q != IXGBE_DCB_NB_QUEUES) {
- PMD_INIT_LOG(ERR, "DCB, nb_tx_q != %d.",
- IXGBE_DCB_NB_QUEUES);
- return -EINVAL;
- }
conf = &dev_conf->tx_adv_conf.dcb_tx_conf;
if (!(conf->nb_tcs == ETH_4_TCS ||
conf->nb_tcs == ETH_8_TCS)) {
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/qede: fix multicast filtering' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (42 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'net/ixgbe: fix DCB configuration' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'net/qede: fix missing loop index in Tx SG mode' " luca.boccassi
` (13 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Harish Patil; +Cc: Shahed Shaikh, Rasesh Mody, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 5896de8c76117cf30962a0dd4ee1a777e8fff73a Mon Sep 17 00:00:00 2001
From: Harish Patil <harish.patil@cavium.com>
Date: Sat, 19 May 2018 17:15:43 -0700
Subject: [PATCH] net/qede: fix multicast filtering
[ upstream commit 413ecf29425174f25383ea43fba003fd651ddc89 ]
This patch is to fix multicast filtering using set_mc_addr_list().
Fixes: 77fac1b54fc9 ("net/qede: fix filtering code")
Signed-off-by: Harish Patil <harish.patil@cavium.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
drivers/net/qede/base/ecore_l2.c | 12 +--
drivers/net/qede/base/ecore_l2_api.h | 2 +-
drivers/net/qede/base/ecore_sriov.c | 3 +-
drivers/net/qede/base/ecore_vf.c | 5 +-
drivers/net/qede/base/ecore_vfpf_if.h | 8 +-
drivers/net/qede/qede_ethdev.c | 179 +++++++++++++++++++---------------
6 files changed, 114 insertions(+), 95 deletions(-)
diff --git a/drivers/net/qede/base/ecore_l2.c b/drivers/net/qede/base/ecore_l2.c
index e3afc8a3d..1f16697ec 100644
--- a/drivers/net/qede/base/ecore_l2.c
+++ b/drivers/net/qede/base/ecore_l2.c
@@ -687,7 +687,7 @@ ecore_sp_update_mcast_bin(struct vport_update_ramrod_data *p_ramrod,
p_ramrod->common.update_approx_mcast_flg = 1;
for (i = 0; i < ETH_MULTICAST_MAC_BINS_IN_REGS; i++) {
- u32 *p_bins = (u32 *)p_params->bins;
+ u32 *p_bins = p_params->bins;
p_ramrod->approx_mcast.bins[i] = OSAL_CPU_TO_LE32(p_bins[i]);
}
@@ -1556,8 +1556,8 @@ ecore_sp_eth_filter_mcast(struct ecore_hwfn *p_hwfn,
enum spq_mode comp_mode,
struct ecore_spq_comp_cb *p_comp_data)
{
- unsigned long bins[ETH_MULTICAST_MAC_BINS_IN_REGS];
struct vport_update_ramrod_data *p_ramrod = OSAL_NULL;
+ u32 bins[ETH_MULTICAST_MAC_BINS_IN_REGS];
struct ecore_spq_entry *p_ent = OSAL_NULL;
struct ecore_sp_init_data init_data;
u8 abs_vport_id = 0;
@@ -1596,8 +1596,7 @@ ecore_sp_eth_filter_mcast(struct ecore_hwfn *p_hwfn,
/* explicitly clear out the entire vector */
OSAL_MEMSET(&p_ramrod->approx_mcast.bins,
0, sizeof(p_ramrod->approx_mcast.bins));
- OSAL_MEMSET(bins, 0, sizeof(unsigned long) *
- ETH_MULTICAST_MAC_BINS_IN_REGS);
+ OSAL_MEMSET(bins, 0, sizeof(u32) * ETH_MULTICAST_MAC_BINS_IN_REGS);
/* filter ADD op is explicit set op and it removes
* any existing filters for the vport.
*/
@@ -1606,16 +1605,15 @@ ecore_sp_eth_filter_mcast(struct ecore_hwfn *p_hwfn,
u32 bit;
bit = ecore_mcast_bin_from_mac(p_filter_cmd->mac[i]);
- OSAL_SET_BIT(bit, bins);
+ bins[bit / 32] |= 1 << (bit % 32);
}
/* Convert to correct endianity */
for (i = 0; i < ETH_MULTICAST_MAC_BINS_IN_REGS; i++) {
struct vport_update_ramrod_mcast *p_ramrod_bins;
- u32 *p_bins = (u32 *)bins;
p_ramrod_bins = &p_ramrod->approx_mcast;
- p_ramrod_bins->bins[i] = OSAL_CPU_TO_LE32(p_bins[i]);
+ p_ramrod_bins->bins[i] = OSAL_CPU_TO_LE32(bins[i]);
}
}
diff --git a/drivers/net/qede/base/ecore_l2_api.h b/drivers/net/qede/base/ecore_l2_api.h
index ed9837bfd..8cbe8dde6 100644
--- a/drivers/net/qede/base/ecore_l2_api.h
+++ b/drivers/net/qede/base/ecore_l2_api.h
@@ -332,7 +332,7 @@ struct ecore_sp_vport_update_params {
u8 anti_spoofing_en;
u8 update_accept_any_vlan_flg;
u8 accept_any_vlan;
- unsigned long bins[8];
+ u32 bins[8];
struct ecore_rss_params *rss_params;
struct ecore_filter_accept_flags accept_flags;
struct ecore_sge_tpa_params *sge_tpa_params;
diff --git a/drivers/net/qede/base/ecore_sriov.c b/drivers/net/qede/base/ecore_sriov.c
index b1e26d6f3..68f40f8a0 100644
--- a/drivers/net/qede/base/ecore_sriov.c
+++ b/drivers/net/qede/base/ecore_sriov.c
@@ -2975,8 +2975,7 @@ ecore_iov_vp_update_mcast_bin_param(struct ecore_hwfn *p_hwfn,
p_data->update_approx_mcast_flg = 1;
OSAL_MEMCPY(p_data->bins, p_mcast_tlv->bins,
- sizeof(unsigned long) *
- ETH_MULTICAST_MAC_BINS_IN_REGS);
+ sizeof(u32) * ETH_MULTICAST_MAC_BINS_IN_REGS);
*tlvs_mask |= 1 << ECORE_IOV_VP_UPDATE_MCAST;
}
diff --git a/drivers/net/qede/base/ecore_vf.c b/drivers/net/qede/base/ecore_vf.c
index e0f2dd5a2..8a08911a3 100644
--- a/drivers/net/qede/base/ecore_vf.c
+++ b/drivers/net/qede/base/ecore_vf.c
@@ -1275,8 +1275,7 @@ ecore_vf_pf_vport_update(struct ecore_hwfn *p_hwfn,
resp_size += sizeof(struct pfvf_def_resp_tlv);
OSAL_MEMCPY(p_mcast_tlv->bins, p_params->bins,
- sizeof(unsigned long) *
- ETH_MULTICAST_MAC_BINS_IN_REGS);
+ sizeof(u32) * ETH_MULTICAST_MAC_BINS_IN_REGS);
}
update_rx = p_params->accept_flags.update_rx_mode_config;
@@ -1473,7 +1472,7 @@ void ecore_vf_pf_filter_mcast(struct ecore_hwfn *p_hwfn,
u32 bit;
bit = ecore_mcast_bin_from_mac(p_filter_cmd->mac[i]);
- OSAL_SET_BIT(bit, sp_params.bins);
+ sp_params.bins[bit / 32] |= 1 << (bit % 32);
}
}
diff --git a/drivers/net/qede/base/ecore_vfpf_if.h b/drivers/net/qede/base/ecore_vfpf_if.h
index ecb006496..c6af9caf7 100644
--- a/drivers/net/qede/base/ecore_vfpf_if.h
+++ b/drivers/net/qede/base/ecore_vfpf_if.h
@@ -396,7 +396,13 @@ struct vfpf_vport_update_mcast_bin_tlv {
struct channel_tlv tl;
u8 padding[4];
- u64 bins[8];
+ /* This was a mistake; There are only 256 approx bins,
+ * and in HSI they're divided into 32-bit values.
+ * As old VFs used to set-bit to the values on its side,
+ * the upper half of the array is never expected to contain any data.
+ */
+ u64 bins[4];
+ u64 obsolete_bins[4];
};
struct vfpf_vport_update_accept_param_tlv {
diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 0708dc8ba..a59efbec6 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -854,47 +854,69 @@ qede_ucast_filter(struct rte_eth_dev *eth_dev, struct ecore_filter_ucast *ucast,
}
static int
-qede_mcast_filter(struct rte_eth_dev *eth_dev, struct ecore_filter_ucast *mcast,
- bool add)
+qede_add_mcast_filters(struct rte_eth_dev *eth_dev, struct ether_addr *mc_addrs,
+ uint32_t mc_addrs_num)
{
struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev);
struct ecore_dev *edev = QEDE_INIT_EDEV(qdev);
- struct ether_addr *mac_addr;
- struct qede_mcast_entry *tmp = NULL;
- struct qede_mcast_entry *m;
+ struct ecore_filter_mcast mcast;
+ struct qede_mcast_entry *m = NULL;
+ uint8_t i;
+ int rc;
- mac_addr = (struct ether_addr *)mcast->mac;
- if (add) {
- SLIST_FOREACH(tmp, &qdev->mc_list_head, list) {
- if (memcmp(mac_addr, &tmp->mac, ETHER_ADDR_LEN) == 0) {
- DP_ERR(edev,
- "Multicast MAC is already added\n");
- return -EEXIST;
- }
- }
+ for (i = 0; i < mc_addrs_num; i++) {
m = rte_malloc(NULL, sizeof(struct qede_mcast_entry),
- RTE_CACHE_LINE_SIZE);
+ RTE_CACHE_LINE_SIZE);
if (!m) {
- DP_ERR(edev,
- "Did not allocate memory for mcast\n");
+ DP_ERR(edev, "Did not allocate memory for mcast\n");
return -ENOMEM;
}
- ether_addr_copy(mac_addr, &m->mac);
+ ether_addr_copy(&mc_addrs[i], &m->mac);
SLIST_INSERT_HEAD(&qdev->mc_list_head, m, list);
- qdev->num_mc_addr++;
- } else {
- SLIST_FOREACH(tmp, &qdev->mc_list_head, list) {
- if (memcmp(mac_addr, &tmp->mac, ETHER_ADDR_LEN) == 0)
- break;
- }
- if (tmp == NULL) {
- DP_INFO(edev, "Multicast mac is not found\n");
- return -EINVAL;
- }
- SLIST_REMOVE(&qdev->mc_list_head, tmp,
- qede_mcast_entry, list);
- qdev->num_mc_addr--;
}
+ memset(&mcast, 0, sizeof(mcast));
+ mcast.num_mc_addrs = mc_addrs_num;
+ mcast.opcode = ECORE_FILTER_ADD;
+ for (i = 0; i < mc_addrs_num; i++)
+ ether_addr_copy(&mc_addrs[i], (struct ether_addr *)
+ &mcast.mac[i]);
+ rc = ecore_filter_mcast_cmd(edev, &mcast, ECORE_SPQ_MODE_CB, NULL);
+ if (rc != ECORE_SUCCESS) {
+ DP_ERR(edev, "Failed to add multicast filter (rc = %d\n)", rc);
+ return -1;
+ }
+
+ return 0;
+}
+
+static int qede_del_mcast_filters(struct rte_eth_dev *eth_dev)
+{
+ struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev);
+ struct ecore_dev *edev = QEDE_INIT_EDEV(qdev);
+ struct qede_mcast_entry *tmp = NULL;
+ struct ecore_filter_mcast mcast;
+ int j;
+ int rc;
+
+ memset(&mcast, 0, sizeof(mcast));
+ mcast.num_mc_addrs = qdev->num_mc_addr;
+ mcast.opcode = ECORE_FILTER_REMOVE;
+ j = 0;
+ SLIST_FOREACH(tmp, &qdev->mc_list_head, list) {
+ ether_addr_copy(&tmp->mac, (struct ether_addr *)&mcast.mac[j]);
+ j++;
+ }
+ rc = ecore_filter_mcast_cmd(edev, &mcast, ECORE_SPQ_MODE_CB, NULL);
+ if (rc != ECORE_SUCCESS) {
+ DP_ERR(edev, "Failed to delete multicast filter\n");
+ return -1;
+ }
+ /* Init the list */
+ while (!SLIST_EMPTY(&qdev->mc_list_head)) {
+ tmp = SLIST_FIRST(&qdev->mc_list_head);
+ SLIST_REMOVE_HEAD(&qdev->mc_list_head, list);
+ }
+ SLIST_INIT(&qdev->mc_list_head);
return 0;
}
@@ -905,59 +927,22 @@ qede_mac_int_ops(struct rte_eth_dev *eth_dev, struct ecore_filter_ucast *ucast,
{
struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev);
struct ecore_dev *edev = QEDE_INIT_EDEV(qdev);
- enum _ecore_status_t rc;
- struct ecore_filter_mcast mcast;
- struct qede_mcast_entry *tmp;
- uint16_t j = 0;
+ enum _ecore_status_t rc = ECORE_INVAL;
- /* Multicast */
- if (is_multicast_ether_addr((struct ether_addr *)ucast->mac)) {
- if (add) {
- if (qdev->num_mc_addr >= ECORE_MAX_MC_ADDRS) {
- DP_ERR(edev,
- "Mcast filter table limit exceeded, "
- "Please enable mcast promisc mode\n");
- return -ECORE_INVAL;
- }
- }
- rc = qede_mcast_filter(eth_dev, ucast, add);
- if (rc == 0) {
- DP_INFO(edev, "num_mc_addrs = %u\n", qdev->num_mc_addr);
- memset(&mcast, 0, sizeof(mcast));
- mcast.num_mc_addrs = qdev->num_mc_addr;
- mcast.opcode = ECORE_FILTER_ADD;
- SLIST_FOREACH(tmp, &qdev->mc_list_head, list) {
- ether_addr_copy(&tmp->mac,
- (struct ether_addr *)&mcast.mac[j]);
- j++;
- }
- rc = ecore_filter_mcast_cmd(edev, &mcast,
- ECORE_SPQ_MODE_CB, NULL);
- }
- if (rc != ECORE_SUCCESS) {
- DP_ERR(edev, "Failed to add multicast filter"
- " rc = %d, op = %d\n", rc, add);
- }
- } else { /* Unicast */
- if (add) {
- if (qdev->num_uc_addr >=
- qdev->dev_info.num_mac_filters) {
- DP_ERR(edev,
- "Ucast filter table limit exceeded,"
- " Please enable promisc mode\n");
- return -ECORE_INVAL;
- }
- }
- rc = qede_ucast_filter(eth_dev, ucast, add);
- if (rc == 0)
- rc = ecore_filter_ucast_cmd(edev, ucast,
- ECORE_SPQ_MODE_CB, NULL);
- if (rc != ECORE_SUCCESS) {
- DP_ERR(edev, "MAC filter failed, rc = %d, op = %d\n",
- rc, add);
- }
+ if (add && (qdev->num_uc_addr >= qdev->dev_info.num_mac_filters)) {
+ DP_ERR(edev, "Ucast filter table limit exceeded,"
+ " Please enable promisc mode\n");
+ return ECORE_INVAL;
}
+ rc = qede_ucast_filter(eth_dev, ucast, add);
+ if (rc == 0)
+ rc = ecore_filter_ucast_cmd(edev, ucast,
+ ECORE_SPQ_MODE_CB, NULL);
+ if (rc != ECORE_SUCCESS)
+ DP_ERR(edev, "MAC filter failed, rc = %d, op = %d\n",
+ rc, add);
+
return rc;
}
@@ -1993,6 +1978,35 @@ static void qede_allmulticast_disable(struct rte_eth_dev *eth_dev)
QED_FILTER_RX_MODE_TYPE_REGULAR);
}
+static int
+qede_set_mc_addr_list(struct rte_eth_dev *eth_dev, struct ether_addr *mc_addrs,
+ uint32_t mc_addrs_num)
+{
+ struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev);
+ struct ecore_dev *edev = QEDE_INIT_EDEV(qdev);
+ uint8_t i;
+
+ if (mc_addrs_num > ECORE_MAX_MC_ADDRS) {
+ DP_ERR(edev, "Reached max multicast filters limit,"
+ "Please enable multicast promisc mode\n");
+ return -ENOSPC;
+ }
+
+ for (i = 0; i < mc_addrs_num; i++) {
+ if (!is_multicast_ether_addr(&mc_addrs[i])) {
+ DP_ERR(edev, "Not a valid multicast MAC\n");
+ return -EINVAL;
+ }
+ }
+
+ /* Flush all existing entries */
+ if (qede_del_mcast_filters(eth_dev))
+ return -1;
+
+ /* Set new mcast list */
+ return qede_add_mcast_filters(eth_dev, mc_addrs, mc_addrs_num);
+}
+
static int qede_flow_ctrl_set(struct rte_eth_dev *eth_dev,
struct rte_eth_fc_conf *fc_conf)
{
@@ -2879,6 +2893,7 @@ static const struct eth_dev_ops qede_eth_dev_ops = {
.promiscuous_disable = qede_promiscuous_disable,
.allmulticast_enable = qede_allmulticast_enable,
.allmulticast_disable = qede_allmulticast_disable,
+ .set_mc_addr_list = qede_set_mc_addr_list,
.dev_stop = qede_dev_stop,
.dev_close = qede_dev_close,
.stats_get = qede_get_stats,
@@ -2919,6 +2934,7 @@ static const struct eth_dev_ops qede_eth_vf_dev_ops = {
.promiscuous_disable = qede_promiscuous_disable,
.allmulticast_enable = qede_allmulticast_enable,
.allmulticast_disable = qede_allmulticast_disable,
+ .set_mc_addr_list = qede_set_mc_addr_list,
.dev_stop = qede_dev_stop,
.dev_close = qede_dev_close,
.stats_get = qede_get_stats,
@@ -3127,6 +3143,7 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
SLIST_INIT(&adapter->fdir_info.fdir_list_head);
SLIST_INIT(&adapter->vlan_list_head);
SLIST_INIT(&adapter->uc_list_head);
+ SLIST_INIT(&adapter->mc_list_head);
adapter->mtu = ETHER_MTU;
adapter->vport_started = false;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/qede: fix missing loop index in Tx SG mode' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (43 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'net/qede: fix multicast filtering' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'net/qede: fix unicast filter routine return code' " luca.boccassi
` (12 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Rasesh Mody; +Cc: Harish Patil, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From a93e13da07152f3b0bd2bb95908b7eacb0bb7676 Mon Sep 17 00:00:00 2001
From: Rasesh Mody <rasesh.mody@cavium.com>
Date: Sat, 19 May 2018 17:15:44 -0700
Subject: [PATCH] net/qede: fix missing loop index in Tx SG mode
[ upstream commit 917481cad8695f4241f9c018d403e860007e5140 ]
Fixes: 3d4bb4411683 ("net/qede: add fastpath support for VXLAN tunneling")
Signed-off-by: Harish Patil <harish.patil@cavium.com>
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
drivers/net/qede/qede_rxtx.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c
index 906f26f08..4f425950a 100644
--- a/drivers/net/qede/qede_rxtx.c
+++ b/drivers/net/qede/qede_rxtx.c
@@ -1632,6 +1632,7 @@ qede_encode_sg_bd(struct qede_tx_queue *p_txq, struct rte_mbuf *m_seg,
QEDE_BD_SET_ADDR_LEN(tx_bd, mapping, m_seg->data_len);
PMD_TX_LOG(DEBUG, txq, "BD len %04x", m_seg->data_len);
}
+ start_seg++;
m_seg = m_seg->next;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/qede: fix unicast filter routine return code' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (44 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'net/qede: fix missing loop index in Tx SG mode' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:09 ` [dpdk-stable] patch 'net/tap: fix device removal when no queue exist' " luca.boccassi
` (11 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Shahed Shaikh; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 62089f45e0423f6207debbdcb988a1814f5d88b1 Mon Sep 17 00:00:00 2001
From: Shahed Shaikh <shahed.shaikh@cavium.com>
Date: Sat, 19 May 2018 17:15:46 -0700
Subject: [PATCH] net/qede: fix unicast filter routine return code
[ upstream commit f8d2581ecbba056db08888d562eafe5181a009ba ]
There is no need to return failure (-EEXIST) when the requested
filter is already configured.
Fixes: d6cb17535f88 ("net/qede: fix VLAN filters")
Fixes: 77fac1b54fc9 ("net/qede: fix filtering code")
Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
---
drivers/net/qede/qede_ethdev.c | 14 +++++++-------
drivers/net/qede/qede_fdir.c | 4 ++--
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index a59efbec6..65eb33e73 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -817,10 +817,10 @@ qede_ucast_filter(struct rte_eth_dev *eth_dev, struct ecore_filter_ucast *ucast,
ETHER_ADDR_LEN) == 0) &&
ucast->vni == tmp->vni &&
ucast->vlan == tmp->vlan) {
- DP_ERR(edev, "Unicast MAC is already added"
- " with vlan = %u, vni = %u\n",
- ucast->vlan, ucast->vni);
- return -EEXIST;
+ DP_INFO(edev, "Unicast MAC is already added"
+ " with vlan = %u, vni = %u\n",
+ ucast->vlan, ucast->vni);
+ return 0;
}
}
u = rte_malloc(NULL, sizeof(struct qede_ucast_entry),
@@ -1078,9 +1078,9 @@ static int qede_vlan_filter_set(struct rte_eth_dev *eth_dev,
SLIST_FOREACH(tmp, &qdev->vlan_list_head, list) {
if (tmp->vid == vlan_id) {
- DP_ERR(edev, "VLAN %u already configured\n",
- vlan_id);
- return -EEXIST;
+ DP_INFO(edev, "VLAN %u already configured\n",
+ vlan_id);
+ return 0;
}
}
diff --git a/drivers/net/qede/qede_fdir.c b/drivers/net/qede/qede_fdir.c
index da6364ee5..153ef9640 100644
--- a/drivers/net/qede/qede_fdir.c
+++ b/drivers/net/qede/qede_fdir.c
@@ -141,8 +141,8 @@ qede_config_cmn_fdir_filter(struct rte_eth_dev *eth_dev,
if (add) {
SLIST_FOREACH(tmp, &qdev->fdir_info.fdir_list_head, list) {
if (memcmp(tmp->mz->addr, pkt, pkt_len) == 0) {
- DP_ERR(edev, "flowdir filter exist\n");
- rc = -EEXIST;
+ DP_INFO(edev, "flowdir filter exist\n");
+ rc = 0;
goto err2;
}
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/tap: fix device removal when no queue exist' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (45 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'net/qede: fix unicast filter routine return code' " luca.boccassi
@ 2018-05-23 12:09 ` luca.boccassi
2018-05-23 12:10 ` [dpdk-stable] patch 'net/e1000: fix build of igb only' " luca.boccassi
` (10 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:09 UTC (permalink / raw)
To: Ophir Munk; +Cc: Keith Wiles, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 94106a31e6645023b9a942dc4dd58fee334a6321 Mon Sep 17 00:00:00 2001
From: Ophir Munk <ophirmu@mellanox.com>
Date: Mon, 21 May 2018 07:54:33 +0000
Subject: [PATCH] net/tap: fix device removal when no queue exist
[ upstream commit 3101191c63ab25a9d743b96cc004eec2e9a8c1cc ]
TAP device is created following its first queue creation. Multiple
queues can be added or removed over time. In Linux terminology those
are file descriptors which are opened or closed over time. As long as
the number of opened file descriptors is positive - TAP device will
appear as a Linux device. In case all queues are released (the
equivalent of all file descriptors being closed) the TAP device will
be removed. This can lead to abnormalities in different scenarios
where the TAP device should exist even if all its queues are released.
In order to make TAP existence independent of its number of queues -
an extra file descriptor is opened on TAP creation and is closed on
TAP closure. Its only purpose is to serve as a keep-alive mechanism
for the TAP device.
Fixes: bf7b7f437b49 ("net/tap: create netdevice during probing")
Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
---
drivers/net/tap/rte_eth_tap.c | 31 ++++++++++++++++++++++++-------
drivers/net/tap/rte_eth_tap.h | 1 +
2 files changed, 25 insertions(+), 7 deletions(-)
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 6ce02c9b6..b9b9397b9 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -824,6 +824,15 @@ tap_dev_close(struct rte_eth_dev *dev)
ioctl(internals->ioctl_sock, SIOCSIFFLAGS,
&internals->remote_initial_flags);
}
+
+ if (internals->ka_fd != -1) {
+ close(internals->ka_fd);
+ internals->ka_fd = -1;
+ }
+ /*
+ * Since TUN device has no more opened file descriptors
+ * it will be removed from kernel
+ */
}
static void
@@ -1389,6 +1398,7 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, char *tap_name,
dev->intr_handle = &pmd->intr_handle;
/* Presetup the fds to -1 as being not valid */
+ pmd->ka_fd = -1;
for (i = 0; i < RTE_PMD_TAP_MAX_QUEUES; i++) {
pmd->rxq[i].fd = -1;
pmd->txq[i].fd = -1;
@@ -1405,13 +1415,17 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, char *tap_name,
eth_random_addr((uint8_t *)&pmd->eth_addr);
}
- /* Immediately create the netdevice (this will create the 1st queue). */
- /* rx queue */
- if (tap_setup_queue(dev, pmd, 0, 1) == -1)
- goto error_exit;
- /* tx queue */
- if (tap_setup_queue(dev, pmd, 0, 0) == -1)
+ /*
+ * Allocate a TUN device keep-alive file descriptor that will only be
+ * closed when the TUN device itself is closed or removed.
+ * This keep-alive file descriptor will guarantee that the TUN device
+ * exists even when all of its queues are closed
+ */
+ pmd->ka_fd = tun_alloc(pmd);
+ if (pmd->ka_fd == -1) {
+ RTE_LOG(ERR, PMD, "Unable to create %s interface", tap_name);
goto error_exit;
+ }
ifr.ifr_mtu = dev->data->mtu;
if (tap_ioctl(pmd, SIOCSIFMTU, &ifr, 1, LOCAL_AND_REMOTE) < 0)
@@ -1685,9 +1699,12 @@ rte_pmd_tap_remove(struct rte_vdev_device *dev)
close(internals->ioctl_sock);
rte_free(eth_dev->data->dev_private);
rte_free(eth_dev->data);
-
rte_eth_dev_release_port(eth_dev);
+ if (internals->ka_fd != -1) {
+ close(internals->ka_fd);
+ internals->ka_fd = -1;
+ }
return 0;
}
diff --git a/drivers/net/tap/rte_eth_tap.h b/drivers/net/tap/rte_eth_tap.h
index 53a506add..dcafd6df1 100644
--- a/drivers/net/tap/rte_eth_tap.h
+++ b/drivers/net/tap/rte_eth_tap.h
@@ -76,6 +76,7 @@ struct pmd_internals {
struct rx_queue rxq[RTE_PMD_TAP_MAX_QUEUES]; /* List of RX queues */
struct tx_queue txq[RTE_PMD_TAP_MAX_QUEUES]; /* List of TX queues */
struct rte_intr_handle intr_handle; /* LSC interrupt handle. */
+ int ka_fd; /* keep-alive file descriptor */
};
/* tap_intr.c */
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/e1000: fix build of igb only' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (46 preceding siblings ...)
2018-05-23 12:09 ` [dpdk-stable] patch 'net/tap: fix device removal when no queue exist' " luca.boccassi
@ 2018-05-23 12:10 ` luca.boccassi
2018-05-23 12:10 ` [dpdk-stable] patch 'net/i40e: fix shifts of signed values' " luca.boccassi
` (9 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:10 UTC (permalink / raw)
To: Harry van Haaren; +Cc: Vipin Varghese, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 8ac2743ed3c0c1c47d35a47181517787e038ce7f Mon Sep 17 00:00:00 2001
From: Harry van Haaren <harry.van.haaren@intel.com>
Date: Mon, 21 May 2018 10:31:41 +0100
Subject: [PATCH] net/e1000: fix build of igb only
[ upstream commit 4ebbe84dae82290ed2e49e36bf894efec0dc2123 ]
This commit fixes a compilation error if EM_PMD is
not defined, bug IGB_PMD is. The root cause of the
issue was that log init variables are declared as
extern in a header file, while the definition of the
variables was in e1000_ethdev.c. Hence, the definitions
were not available if the e1000 PMD is disabled.
To fix this, a new file is added e1000_logs.c, which
matches the e1000_logs.h header. The log variables are
always compiled in, but the PMD logs are only registered
if a PMD is enabled in the configuration. Extra checks
are added in order to avoid duplicate registering.
Fixes: ed5bbb767c3e ("net/e1000: implement dynamic logging")
Reported-by: Vipin Varghese <vipin.varghese@intel.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Vipin Varghese <vipin.varghese@intel.com>
---
drivers/net/e1000/Makefile | 1 +
drivers/net/e1000/e1000_logs.c | 26 ++++++++++++++++++++++++++
drivers/net/e1000/e1000_logs.h | 6 ++++++
drivers/net/e1000/em_ethdev.c | 16 ++++------------
drivers/net/e1000/igb_ethdev.c | 8 ++++++++
drivers/net/e1000/meson.build | 1 +
6 files changed, 46 insertions(+), 12 deletions(-)
create mode 100644 drivers/net/e1000/e1000_logs.c
diff --git a/drivers/net/e1000/Makefile b/drivers/net/e1000/Makefile
index 87cfb265d..9c87e883b 100644
--- a/drivers/net/e1000/Makefile
+++ b/drivers/net/e1000/Makefile
@@ -62,6 +62,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += e1000_82575.c
SRCS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += e1000_i210.c
SRCS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += e1000_api.c
SRCS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += e1000_ich8lan.c
+SRCS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += e1000_logs.c
SRCS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += e1000_mac.c
SRCS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += e1000_manage.c
SRCS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += e1000_mbx.c
diff --git a/drivers/net/e1000/e1000_logs.c b/drivers/net/e1000/e1000_logs.c
new file mode 100644
index 000000000..22173939f
--- /dev/null
+++ b/drivers/net/e1000/e1000_logs.c
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2018 Intel Corporation
+ */
+
+#include "e1000_logs.h"
+
+/* declared as extern in e1000_logs.h */
+int e1000_logtype_init;
+int e1000_logtype_driver;
+
+/* avoids double registering of logs if EM and IGB drivers are in use */
+static int e1000_log_initialized;
+
+void
+e1000_igb_init_log(void)
+{
+ if (!e1000_log_initialized) {
+ e1000_logtype_init = rte_log_register("pmd.net.e1000.init");
+ if (e1000_logtype_init >= 0)
+ rte_log_set_level(e1000_logtype_init, RTE_LOG_NOTICE);
+ e1000_logtype_driver = rte_log_register("pmd.net.e1000.driver");
+ if (e1000_logtype_driver >= 0)
+ rte_log_set_level(e1000_logtype_driver, RTE_LOG_NOTICE);
+ e1000_log_initialized = 1;
+ }
+}
diff --git a/drivers/net/e1000/e1000_logs.h b/drivers/net/e1000/e1000_logs.h
index 50348e9ed..69d3d3118 100644
--- a/drivers/net/e1000/e1000_logs.h
+++ b/drivers/net/e1000/e1000_logs.h
@@ -5,6 +5,8 @@
#ifndef _E1000_LOGS_H_
#define _E1000_LOGS_H_
+#include <rte_log.h>
+
extern int e1000_logtype_init;
#define PMD_INIT_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, e1000_logtype_init, \
@@ -41,4 +43,8 @@ extern int e1000_logtype_driver;
#define PMD_DRV_LOG(level, fmt, args...) \
PMD_DRV_LOG_RAW(level, fmt "\n", ## args)
+
+/* log init function shared by e1000 and igb drivers */
+void e1000_igb_init_log(void);
+
#endif /* _E1000_LOGS_H_ */
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index 242375ff1..f84914032 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -11,7 +11,6 @@
#include <rte_common.h>
#include <rte_interrupts.h>
#include <rte_byteorder.h>
-#include <rte_log.h>
#include <rte_debug.h>
#include <rte_pci.h>
#include <rte_bus_pci.h>
@@ -105,9 +104,6 @@ static int eth_em_set_mc_addr_list(struct rte_eth_dev *dev,
static enum e1000_fc_mode em_fc_setting = e1000_fc_full;
-int e1000_logtype_init;
-int e1000_logtype_driver;
-
/*
* The set of PCI devices this driver supports
*/
@@ -1864,14 +1860,10 @@ RTE_PMD_REGISTER_PCI(net_e1000_em, rte_em_pmd);
RTE_PMD_REGISTER_PCI_TABLE(net_e1000_em, pci_id_em_map);
RTE_PMD_REGISTER_KMOD_DEP(net_e1000_em, "* igb_uio | uio_pci_generic | vfio-pci");
-RTE_INIT(e1000_init_log);
+/* see e1000_logs.c */
+RTE_INIT(igb_init_log);
static void
-e1000_init_log(void)
+igb_init_log(void)
{
- e1000_logtype_init = rte_log_register("pmd.net.e1000.init");
- if (e1000_logtype_init >= 0)
- rte_log_set_level(e1000_logtype_init, RTE_LOG_NOTICE);
- e1000_logtype_driver = rte_log_register("pmd.net.e1000.driver");
- if (e1000_logtype_driver >= 0)
- rte_log_set_level(e1000_logtype_driver, RTE_LOG_NOTICE);
+ e1000_igb_init_log();
}
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 3c5138dea..d0aa1ef8f 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -5654,3 +5654,11 @@ RTE_PMD_REGISTER_KMOD_DEP(net_e1000_igb, "* igb_uio | uio_pci_generic | vfio-pci
RTE_PMD_REGISTER_PCI(net_e1000_igb_vf, rte_igbvf_pmd);
RTE_PMD_REGISTER_PCI_TABLE(net_e1000_igb_vf, pci_id_igbvf_map);
RTE_PMD_REGISTER_KMOD_DEP(net_e1000_igb_vf, "* igb_uio | vfio-pci");
+
+/* see e1000_logs.c */
+RTE_INIT(e1000_init_log);
+static void
+e1000_init_log(void)
+{
+ e1000_igb_init_log();
+}
diff --git a/drivers/net/e1000/meson.build b/drivers/net/e1000/meson.build
index 3a1bf5af2..cf456995c 100644
--- a/drivers/net/e1000/meson.build
+++ b/drivers/net/e1000/meson.build
@@ -5,6 +5,7 @@ subdir('base')
objs = [base_objs]
sources = files(
+ 'e1000_logs.c',
'em_ethdev.c',
'em_rxtx.c',
'igb_ethdev.c',
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/i40e: fix shifts of signed values' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (47 preceding siblings ...)
2018-05-23 12:10 ` [dpdk-stable] patch 'net/e1000: fix build of igb only' " luca.boccassi
@ 2018-05-23 12:10 ` luca.boccassi
2018-05-23 12:10 ` [dpdk-stable] patch 'net/vdev_netvsc: fix automatic probing' " luca.boccassi
` (8 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:10 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: Qi Zhang, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 1bfd781a4281b401aaee0dcf88d7180d7de96ca0 Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@intel.com>
Date: Mon, 21 May 2018 15:45:59 +0100
Subject: [PATCH] net/i40e: fix shifts of signed values
[ upstream commit 1962193cc86a23c0a6d89c7e8563818a40f5dedd ]
Following error reported by cppcheck:
(error) Shifting signed 32-bit value by 31 bits is
undefined behaviour. The patch fixes it.
Fixes: 8db9e2a1b232 ("i40e: base driver")
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
drivers/net/i40e/base/i40e_register.h | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/net/i40e/base/i40e_register.h b/drivers/net/i40e/base/i40e_register.h
index a482ab904..df66e76a3 100644
--- a/drivers/net/i40e/base/i40e_register.h
+++ b/drivers/net/i40e/base/i40e_register.h
@@ -90,7 +90,7 @@ POSSIBILITY OF SUCH DAMAGE.
#define I40E_PF_ARQLEN_ARQCRIT_SHIFT 30
#define I40E_PF_ARQLEN_ARQCRIT_MASK I40E_MASK(0x1, I40E_PF_ARQLEN_ARQCRIT_SHIFT)
#define I40E_PF_ARQLEN_ARQENABLE_SHIFT 31
-#define I40E_PF_ARQLEN_ARQENABLE_MASK I40E_MASK(0x1, I40E_PF_ARQLEN_ARQENABLE_SHIFT)
+#define I40E_PF_ARQLEN_ARQENABLE_MASK I40E_MASK(0x1u, I40E_PF_ARQLEN_ARQENABLE_SHIFT)
#define I40E_PF_ARQT 0x00080480 /* Reset: EMPR */
#define I40E_PF_ARQT_ARQT_SHIFT 0
#define I40E_PF_ARQT_ARQT_MASK I40E_MASK(0x3FF, I40E_PF_ARQT_ARQT_SHIFT)
@@ -113,7 +113,7 @@ POSSIBILITY OF SUCH DAMAGE.
#define I40E_PF_ATQLEN_ATQCRIT_SHIFT 30
#define I40E_PF_ATQLEN_ATQCRIT_MASK I40E_MASK(0x1, I40E_PF_ATQLEN_ATQCRIT_SHIFT)
#define I40E_PF_ATQLEN_ATQENABLE_SHIFT 31
-#define I40E_PF_ATQLEN_ATQENABLE_MASK I40E_MASK(0x1, I40E_PF_ATQLEN_ATQENABLE_SHIFT)
+#define I40E_PF_ATQLEN_ATQENABLE_MASK I40E_MASK(0x1u, I40E_PF_ATQLEN_ATQENABLE_SHIFT)
#define I40E_PF_ATQT 0x00080400 /* Reset: EMPR */
#define I40E_PF_ATQT_ATQT_SHIFT 0
#define I40E_PF_ATQT_ATQT_MASK I40E_MASK(0x3FF, I40E_PF_ATQT_ATQT_SHIFT)
@@ -140,7 +140,7 @@ POSSIBILITY OF SUCH DAMAGE.
#define I40E_VF_ARQLEN_ARQCRIT_SHIFT 30
#define I40E_VF_ARQLEN_ARQCRIT_MASK I40E_MASK(0x1, I40E_VF_ARQLEN_ARQCRIT_SHIFT)
#define I40E_VF_ARQLEN_ARQENABLE_SHIFT 31
-#define I40E_VF_ARQLEN_ARQENABLE_MASK I40E_MASK(0x1, I40E_VF_ARQLEN_ARQENABLE_SHIFT)
+#define I40E_VF_ARQLEN_ARQENABLE_MASK I40E_MASK(0x1u, I40E_VF_ARQLEN_ARQENABLE_SHIFT)
#define I40E_VF_ARQT(_VF) (0x00082C00 + ((_VF) * 4)) /* _i=0...127 */ /* Reset: EMPR */
#define I40E_VF_ARQT_MAX_INDEX 127
#define I40E_VF_ARQT_ARQT_SHIFT 0
@@ -168,7 +168,7 @@ POSSIBILITY OF SUCH DAMAGE.
#define I40E_VF_ATQLEN_ATQCRIT_SHIFT 30
#define I40E_VF_ATQLEN_ATQCRIT_MASK I40E_MASK(0x1, I40E_VF_ATQLEN_ATQCRIT_SHIFT)
#define I40E_VF_ATQLEN_ATQENABLE_SHIFT 31
-#define I40E_VF_ATQLEN_ATQENABLE_MASK I40E_MASK(0x1, I40E_VF_ATQLEN_ATQENABLE_SHIFT)
+#define I40E_VF_ATQLEN_ATQENABLE_MASK I40E_MASK(0x1u, I40E_VF_ATQLEN_ATQENABLE_SHIFT)
#define I40E_VF_ATQT(_VF) (0x00082800 + ((_VF) * 4)) /* _i=0...127 */ /* Reset: EMPR */
#define I40E_VF_ATQT_MAX_INDEX 127
#define I40E_VF_ATQT_ATQT_SHIFT 0
@@ -291,7 +291,7 @@ POSSIBILITY OF SUCH DAMAGE.
#define I40E_PRTDCB_RETSTCC_UPINTC_MODE_SHIFT 30
#define I40E_PRTDCB_RETSTCC_UPINTC_MODE_MASK I40E_MASK(0x1, I40E_PRTDCB_RETSTCC_UPINTC_MODE_SHIFT)
#define I40E_PRTDCB_RETSTCC_ETSTC_SHIFT 31
-#define I40E_PRTDCB_RETSTCC_ETSTC_MASK I40E_MASK(0x1, I40E_PRTDCB_RETSTCC_ETSTC_SHIFT)
+#define I40E_PRTDCB_RETSTCC_ETSTC_MASK I40E_MASK(0x1u, I40E_PRTDCB_RETSTCC_ETSTC_SHIFT)
#define I40E_PRTDCB_RPPMC 0x001223A0 /* Reset: CORER */
#define I40E_PRTDCB_RPPMC_LANRPPM_SHIFT 0
#define I40E_PRTDCB_RPPMC_LANRPPM_MASK I40E_MASK(0xFF, I40E_PRTDCB_RPPMC_LANRPPM_SHIFT)
@@ -535,7 +535,7 @@ POSSIBILITY OF SUCH DAMAGE.
#define I40E_GLGEN_MSCA_MDICMD_SHIFT 30
#define I40E_GLGEN_MSCA_MDICMD_MASK I40E_MASK(0x1, I40E_GLGEN_MSCA_MDICMD_SHIFT)
#define I40E_GLGEN_MSCA_MDIINPROGEN_SHIFT 31
-#define I40E_GLGEN_MSCA_MDIINPROGEN_MASK I40E_MASK(0x1, I40E_GLGEN_MSCA_MDIINPROGEN_SHIFT)
+#define I40E_GLGEN_MSCA_MDIINPROGEN_MASK I40E_MASK(0x1u, I40E_GLGEN_MSCA_MDIINPROGEN_SHIFT)
#define I40E_GLGEN_MSRWD(_i) (0x0008819C + ((_i) * 4)) /* _i=0...3 */ /* Reset: POR */
#define I40E_GLGEN_MSRWD_MAX_INDEX 3
#define I40E_GLGEN_MSRWD_MDIWRDATA_SHIFT 0
@@ -1274,14 +1274,14 @@ POSSIBILITY OF SUCH DAMAGE.
#define I40E_GLLAN_TXPRE_QDIS_SET_QDIS_SHIFT 30
#define I40E_GLLAN_TXPRE_QDIS_SET_QDIS_MASK I40E_MASK(0x1, I40E_GLLAN_TXPRE_QDIS_SET_QDIS_SHIFT)
#define I40E_GLLAN_TXPRE_QDIS_CLEAR_QDIS_SHIFT 31
-#define I40E_GLLAN_TXPRE_QDIS_CLEAR_QDIS_MASK I40E_MASK(0x1, I40E_GLLAN_TXPRE_QDIS_CLEAR_QDIS_SHIFT)
+#define I40E_GLLAN_TXPRE_QDIS_CLEAR_QDIS_MASK I40E_MASK(0x1u, I40E_GLLAN_TXPRE_QDIS_CLEAR_QDIS_SHIFT)
#define I40E_PFLAN_QALLOC 0x001C0400 /* Reset: CORER */
#define I40E_PFLAN_QALLOC_FIRSTQ_SHIFT 0
#define I40E_PFLAN_QALLOC_FIRSTQ_MASK I40E_MASK(0x7FF, I40E_PFLAN_QALLOC_FIRSTQ_SHIFT)
#define I40E_PFLAN_QALLOC_LASTQ_SHIFT 16
#define I40E_PFLAN_QALLOC_LASTQ_MASK I40E_MASK(0x7FF, I40E_PFLAN_QALLOC_LASTQ_SHIFT)
#define I40E_PFLAN_QALLOC_VALID_SHIFT 31
-#define I40E_PFLAN_QALLOC_VALID_MASK I40E_MASK(0x1, I40E_PFLAN_QALLOC_VALID_SHIFT)
+#define I40E_PFLAN_QALLOC_VALID_MASK I40E_MASK(0x1u, I40E_PFLAN_QALLOC_VALID_SHIFT)
#define I40E_QRX_ENA(_Q) (0x00120000 + ((_Q) * 4)) /* _i=0...1535 */ /* Reset: PFR */
#define I40E_QRX_ENA_MAX_INDEX 1535
#define I40E_QRX_ENA_QENA_REQ_SHIFT 0
@@ -1692,7 +1692,7 @@ POSSIBILITY OF SUCH DAMAGE.
#define I40E_GLNVM_SRCTL_START_SHIFT 30
#define I40E_GLNVM_SRCTL_START_MASK I40E_MASK(0x1, I40E_GLNVM_SRCTL_START_SHIFT)
#define I40E_GLNVM_SRCTL_DONE_SHIFT 31
-#define I40E_GLNVM_SRCTL_DONE_MASK I40E_MASK(0x1, I40E_GLNVM_SRCTL_DONE_SHIFT)
+#define I40E_GLNVM_SRCTL_DONE_MASK I40E_MASK(0x1u, I40E_GLNVM_SRCTL_DONE_SHIFT)
#define I40E_GLNVM_SRDATA 0x000B6114 /* Reset: POR */
#define I40E_GLNVM_SRDATA_WRDATA_SHIFT 0
#define I40E_GLNVM_SRDATA_WRDATA_MASK I40E_MASK(0xFFFF, I40E_GLNVM_SRDATA_WRDATA_SHIFT)
@@ -3059,7 +3059,7 @@ POSSIBILITY OF SUCH DAMAGE.
#define I40E_PF_VT_PFALLOC_LASTVF_SHIFT 8
#define I40E_PF_VT_PFALLOC_LASTVF_MASK I40E_MASK(0xFF, I40E_PF_VT_PFALLOC_LASTVF_SHIFT)
#define I40E_PF_VT_PFALLOC_VALID_SHIFT 31
-#define I40E_PF_VT_PFALLOC_VALID_MASK I40E_MASK(0x1, I40E_PF_VT_PFALLOC_VALID_SHIFT)
+#define I40E_PF_VT_PFALLOC_VALID_MASK I40E_MASK(0x1u, I40E_PF_VT_PFALLOC_VALID_SHIFT)
#define I40E_VP_MDET_RX(_VF) (0x0012A000 + ((_VF) * 4)) /* _i=0...127 */ /* Reset: CORER */
#define I40E_VP_MDET_RX_MAX_INDEX 127
#define I40E_VP_MDET_RX_VALID_SHIFT 0
@@ -3196,7 +3196,7 @@ POSSIBILITY OF SUCH DAMAGE.
#define I40E_VF_ARQLEN1_ARQCRIT_SHIFT 30
#define I40E_VF_ARQLEN1_ARQCRIT_MASK I40E_MASK(0x1, I40E_VF_ARQLEN1_ARQCRIT_SHIFT)
#define I40E_VF_ARQLEN1_ARQENABLE_SHIFT 31
-#define I40E_VF_ARQLEN1_ARQENABLE_MASK I40E_MASK(0x1, I40E_VF_ARQLEN1_ARQENABLE_SHIFT)
+#define I40E_VF_ARQLEN1_ARQENABLE_MASK I40E_MASK(0x1u, I40E_VF_ARQLEN1_ARQENABLE_SHIFT)
#define I40E_VF_ARQT1 0x00007000 /* Reset: EMPR */
#define I40E_VF_ARQT1_ARQT_SHIFT 0
#define I40E_VF_ARQT1_ARQT_MASK I40E_MASK(0x3FF, I40E_VF_ARQT1_ARQT_SHIFT)
@@ -3219,7 +3219,7 @@ POSSIBILITY OF SUCH DAMAGE.
#define I40E_VF_ATQLEN1_ATQCRIT_SHIFT 30
#define I40E_VF_ATQLEN1_ATQCRIT_MASK I40E_MASK(0x1, I40E_VF_ATQLEN1_ATQCRIT_SHIFT)
#define I40E_VF_ATQLEN1_ATQENABLE_SHIFT 31
-#define I40E_VF_ATQLEN1_ATQENABLE_MASK I40E_MASK(0x1, I40E_VF_ATQLEN1_ATQENABLE_SHIFT)
+#define I40E_VF_ATQLEN1_ATQENABLE_MASK I40E_MASK(0x1u, I40E_VF_ATQLEN1_ATQENABLE_SHIFT)
#define I40E_VF_ATQT1 0x00008400 /* Reset: EMPR */
#define I40E_VF_ATQT1_ATQT_SHIFT 0
#define I40E_VF_ATQT1_ATQT_MASK I40E_MASK(0x3FF, I40E_VF_ATQT1_ATQT_SHIFT)
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/vdev_netvsc: fix automatic probing' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (48 preceding siblings ...)
2018-05-23 12:10 ` [dpdk-stable] patch 'net/i40e: fix shifts of signed values' " luca.boccassi
@ 2018-05-23 12:10 ` luca.boccassi
2018-05-23 12:10 ` [dpdk-stable] patch 'net/bonding: export mode 4 slave info routine' " luca.boccassi
` (7 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:10 UTC (permalink / raw)
To: Matan Azrad; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 408bea9a5b6920d89dac9e151297e6b5a1dd2248 Mon Sep 17 00:00:00 2001
From: Matan Azrad <matan@mellanox.com>
Date: Mon, 21 May 2018 16:23:30 +0000
Subject: [PATCH] net/vdev_netvsc: fix automatic probing
[ upstream commit 83d63f0903b3951c76a4508693e8bade582b28b0 ]
The vdev_netvsc driver allows an automatic probe in Hyper-V VM systems
unless it was already specified by the EAL command line.
The detection of a specified NetVSC device is wrongly done by comparing
the vdev_netvsc driver name to all the vdev devices names, including
the suffix device index. Thus, if the user specifies the vdev_netvsc
device by adding an index to the device name, the comparison fails.
Consequently, the vdev_netvsc driver may automatically probe NetVSC
devices, despite the NetVSC device that was specified by the EAL command
line.
Compare the vdev_netvsc driver name to the devices names without the
index.
Fixes: 56252de779a6 ("net/vdev_netvsc: add automatic probing")
Signed-off-by: Matan Azrad <matan@mellanox.com>
---
drivers/net/vdev_netvsc/vdev_netvsc.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/vdev_netvsc/vdev_netvsc.c b/drivers/net/vdev_netvsc/vdev_netvsc.c
index f746433b5..bdd02e09c 100644
--- a/drivers/net/vdev_netvsc/vdev_netvsc.c
+++ b/drivers/net/vdev_netvsc/vdev_netvsc.c
@@ -38,6 +38,7 @@
#define VDEV_NETVSC_DRIVER net_vdev_netvsc
#define VDEV_NETVSC_DRIVER_NAME RTE_STR(VDEV_NETVSC_DRIVER)
+#define VDEV_NETVSC_DRIVER_NAME_LEN 15
#define VDEV_NETVSC_ARG_IFACE "iface"
#define VDEV_NETVSC_ARG_MAC "mac"
#define VDEV_NETVSC_ARG_FORCE "force"
@@ -797,7 +798,8 @@ static int
vdev_netvsc_cmp_rte_device(const struct rte_device *dev1,
__rte_unused const void *_dev2)
{
- return strcmp(dev1->devargs->name, VDEV_NETVSC_DRIVER_NAME);
+ return strncmp(dev1->devargs->name, VDEV_NETVSC_DRIVER_NAME,
+ VDEV_NETVSC_DRIVER_NAME_LEN);
}
/**
@@ -813,7 +815,8 @@ vdev_netvsc_scan_callback(__rte_unused void *arg)
struct rte_bus *vbus = rte_bus_find_by_name("vdev");
TAILQ_FOREACH(devargs, &devargs_list, next)
- if (!strcmp(devargs->name, VDEV_NETVSC_DRIVER_NAME))
+ if (!strncmp(devargs->name, VDEV_NETVSC_DRIVER_NAME,
+ VDEV_NETVSC_DRIVER_NAME_LEN))
return;
dev = (struct rte_vdev_device *)vbus->find_device(NULL,
vdev_netvsc_cmp_rte_device, VDEV_NETVSC_DRIVER_NAME);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bonding: export mode 4 slave info routine' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (49 preceding siblings ...)
2018-05-23 12:10 ` [dpdk-stable] patch 'net/vdev_netvsc: fix automatic probing' " luca.boccassi
@ 2018-05-23 12:10 ` luca.boccassi
2018-05-23 12:10 ` [dpdk-stable] patch 'net/failsafe: fix removed sub-device cleanup' " luca.boccassi
` (6 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:10 UTC (permalink / raw)
To: Chas Williams; +Cc: Ferruh Yigit, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 316ffa58a481e061af99a5650ea0c751590676af Mon Sep 17 00:00:00 2001
From: Chas Williams <chas3@att.com>
Date: Thu, 17 May 2018 19:22:51 -0400
Subject: [PATCH] net/bonding: export mode 4 slave info routine
[ upstream commit ab2e38e82889dbfd89eddda731f8a1185800f29c ]
rte_eth_bond_8023ad_slave_info() wasn't exported in the original work.
Useful to extract information about the current 802.3ad state.
Fixes: 46fb43683679 ("bond: add mode 4")
Signed-off-by: Chas Williams <chas3@att.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
drivers/net/bonding/rte_pmd_bond_version.map | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/bonding/rte_pmd_bond_version.map b/drivers/net/bonding/rte_pmd_bond_version.map
index ec3374b0f..03ddb44e7 100644
--- a/drivers/net/bonding/rte_pmd_bond_version.map
+++ b/drivers/net/bonding/rte_pmd_bond_version.map
@@ -1,6 +1,7 @@
DPDK_2.0 {
global:
+ rte_eth_bond_8023ad_slave_info;
rte_eth_bond_active_slaves_get;
rte_eth_bond_create;
rte_eth_bond_link_monitoring_set;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/failsafe: fix removed sub-device cleanup' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (50 preceding siblings ...)
2018-05-23 12:10 ` [dpdk-stable] patch 'net/bonding: export mode 4 slave info routine' " luca.boccassi
@ 2018-05-23 12:10 ` luca.boccassi
2018-05-23 12:10 ` [dpdk-stable] patch 'net/failsafe: fix duplicate event registration' " luca.boccassi
` (5 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:10 UTC (permalink / raw)
To: Matan Azrad; +Cc: Gaetan Rivet, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 7e42c81e3d86de2a3c3209f4663f4210adf2adda Mon Sep 17 00:00:00 2001
From: Matan Azrad <matan@mellanox.com>
Date: Tue, 22 May 2018 12:38:46 +0000
Subject: [PATCH] net/failsafe: fix removed sub-device cleanup
[ upstream commit 0545c580fc377d33711786eaed665ee60e801bbd ]
The fail-safe PMD registers to RMV event for each removable sub-device
port in order to cleanup the sub-device resources and switch the Tx
sub-device directly when it is plugged-out.
During removal time, the fail-safe PMD stops and closes the sub-device
but it doesn't unregister the LSC and RMV callbacks of the sub-device
port.
It can lead the callbacks to be called for a port which is no more
associated with the fail-safe sub-device, because there is not a
guarantee that a sub-device gets the same port ID for each plug-in
process. This port, for example, may belong to another sub-device of a
different fail-safe device.
Unregister the LSC and RMV callbacks for sub-devices which are not
used.
Fixes: 598fb8aec6f6 ("net/failsafe: support device removal")
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
drivers/net/failsafe/failsafe_ether.c | 30 ++++++++++++++++++++++++++++++
drivers/net/failsafe/failsafe_ops.c | 5 +++++
drivers/net/failsafe/failsafe_private.h | 5 +++++
3 files changed, 40 insertions(+)
diff --git a/drivers/net/failsafe/failsafe_ether.c b/drivers/net/failsafe/failsafe_ether.c
index 780bfa4bc..9bf8d0802 100644
--- a/drivers/net/failsafe/failsafe_ether.c
+++ b/drivers/net/failsafe/failsafe_ether.c
@@ -260,6 +260,7 @@ fs_dev_remove(struct sub_device *sdev)
sdev->state = DEV_ACTIVE;
/* fallthrough */
case DEV_ACTIVE:
+ failsafe_eth_dev_unregister_callbacks(sdev);
rte_eth_dev_close(PORT_ID(sdev));
sdev->state = DEV_PROBED;
/* fallthrough */
@@ -320,6 +321,35 @@ fs_rxtx_clean(struct sub_device *sdev)
return 1;
}
+void
+failsafe_eth_dev_unregister_callbacks(struct sub_device *sdev)
+{
+ int ret;
+
+ if (sdev == NULL)
+ return;
+ if (sdev->rmv_callback) {
+ ret = rte_eth_dev_callback_unregister(PORT_ID(sdev),
+ RTE_ETH_EVENT_INTR_RMV,
+ failsafe_eth_rmv_event_callback,
+ sdev);
+ if (ret)
+ WARN("Failed to unregister RMV callback for sub_device"
+ " %d", SUB_ID(sdev));
+ sdev->rmv_callback = 0;
+ }
+ if (sdev->lsc_callback) {
+ ret = rte_eth_dev_callback_unregister(PORT_ID(sdev),
+ RTE_ETH_EVENT_INTR_LSC,
+ failsafe_eth_lsc_event_callback,
+ sdev);
+ if (ret)
+ WARN("Failed to unregister LSC callback for sub_device"
+ " %d", SUB_ID(sdev));
+ sdev->lsc_callback = 0;
+ }
+}
+
void
failsafe_dev_remove(struct rte_eth_dev *dev)
{
diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c
index 057e435cf..2f9f60b16 100644
--- a/drivers/net/failsafe/failsafe_ops.c
+++ b/drivers/net/failsafe/failsafe_ops.c
@@ -153,6 +153,8 @@ fs_dev_configure(struct rte_eth_dev *dev)
if (ret)
WARN("Failed to register RMV callback for sub_device %d",
SUB_ID(sdev));
+ else
+ sdev->rmv_callback = 1;
}
dev->data->dev_conf.intr_conf.rmv = 0;
if (lsc_interrupt) {
@@ -163,6 +165,8 @@ fs_dev_configure(struct rte_eth_dev *dev)
if (ret)
WARN("Failed to register LSC callback for sub_device %d",
SUB_ID(sdev));
+ else
+ sdev->lsc_callback = 1;
}
dev->data->dev_conf.intr_conf.lsc = lsc_enabled;
sdev->state = DEV_ACTIVE;
@@ -289,6 +293,7 @@ fs_dev_close(struct rte_eth_dev *dev)
PRIV(dev)->state = DEV_ACTIVE - 1;
FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) {
DEBUG("Closing sub_device %d", i);
+ failsafe_eth_dev_unregister_callbacks(sdev);
rte_eth_dev_close(PORT_ID(sdev));
sdev->state = DEV_ACTIVE - 1;
}
diff --git a/drivers/net/failsafe/failsafe_private.h b/drivers/net/failsafe/failsafe_private.h
index 155207423..404b24923 100644
--- a/drivers/net/failsafe/failsafe_private.h
+++ b/drivers/net/failsafe/failsafe_private.h
@@ -119,6 +119,10 @@ struct sub_device {
volatile unsigned int remove:1;
/* flow isolation state */
int flow_isolated:1;
+ /* RMV callback registration state */
+ unsigned int rmv_callback:1;
+ /* LSC callback registration state */
+ unsigned int lsc_callback:1;
};
struct fs_priv {
@@ -211,6 +215,7 @@ int failsafe_eal_uninit(struct rte_eth_dev *dev);
/* ETH_DEV */
int failsafe_eth_dev_state_sync(struct rte_eth_dev *dev);
+void failsafe_eth_dev_unregister_callbacks(struct sub_device *sdev);
void failsafe_dev_remove(struct rte_eth_dev *dev);
void failsafe_stats_increment(struct rte_eth_stats *to,
struct rte_eth_stats *from);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/failsafe: fix duplicate event registration' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (51 preceding siblings ...)
2018-05-23 12:10 ` [dpdk-stable] patch 'net/failsafe: fix removed sub-device cleanup' " luca.boccassi
@ 2018-05-23 12:10 ` luca.boccassi
2018-05-23 12:10 ` [dpdk-stable] patch 'net/bnxt: fix Tx and Rx burst for secondary process' " luca.boccassi
` (4 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:10 UTC (permalink / raw)
To: Matan Azrad; +Cc: Gaetan Rivet, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From e43d7b2b401b39ad50035fe76997ccb9630d34d3 Mon Sep 17 00:00:00 2001
From: Matan Azrad <matan@mellanox.com>
Date: Tue, 22 May 2018 12:38:47 +0000
Subject: [PATCH] net/failsafe: fix duplicate event registration
[ upstream commit 602c5623c8a884036aa81712f89542159a243a58 ]
When the fail-safe device is reconfigured, it attempts to register
again for the sub-devices LSC and RMV events.
Prevent an event registration if it is already done.
Fixes: 598fb8aec6f6 ("net/failsafe: support device removal")
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
drivers/net/failsafe/failsafe_ops.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c
index 2f9f60b16..d9fc480f9 100644
--- a/drivers/net/failsafe/failsafe_ops.c
+++ b/drivers/net/failsafe/failsafe_ops.c
@@ -145,7 +145,7 @@ fs_dev_configure(struct rte_eth_dev *dev)
fs_unlock(dev, 0);
return ret;
}
- if (rmv_interrupt) {
+ if (rmv_interrupt && sdev->rmv_callback == 0) {
ret = rte_eth_dev_callback_register(PORT_ID(sdev),
RTE_ETH_EVENT_INTR_RMV,
failsafe_eth_rmv_event_callback,
@@ -157,7 +157,7 @@ fs_dev_configure(struct rte_eth_dev *dev)
sdev->rmv_callback = 1;
}
dev->data->dev_conf.intr_conf.rmv = 0;
- if (lsc_interrupt) {
+ if (lsc_interrupt && sdev->lsc_callback == 0) {
ret = rte_eth_dev_callback_register(PORT_ID(sdev),
RTE_ETH_EVENT_INTR_LSC,
failsafe_eth_lsc_event_callback,
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bnxt: fix Tx and Rx burst for secondary process' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (52 preceding siblings ...)
2018-05-23 12:10 ` [dpdk-stable] patch 'net/failsafe: fix duplicate event registration' " luca.boccassi
@ 2018-05-23 12:10 ` luca.boccassi
2018-05-23 12:10 ` [dpdk-stable] patch 'net/bnxt: use first completion ring for fwd and async event' " luca.boccassi
` (3 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:10 UTC (permalink / raw)
To: Ajit Khaparde; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 2a10f7f2d963148d5575401c0104b5e399e9e57e Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Tue, 22 May 2018 11:13:42 -0700
Subject: [PATCH] net/bnxt: fix Tx and Rx burst for secondary process
[ upstream commit 08aa0ebaca2ca9f39df89bccf87cd55baaa5b769 ]
We were initializing Tx and Rx burst functions only for primary
processes. Fixing it in this patch.
Fixes: 88920136688c ("net/bnxt: support xstats get by id")
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index a74afc831..58cfbf9c6 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -3136,10 +3136,10 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
}
skip_init:
eth_dev->dev_ops = &bnxt_dev_ops;
- if (rte_eal_process_type() != RTE_PROC_PRIMARY)
- return 0;
eth_dev->rx_pkt_burst = &bnxt_recv_pkts;
eth_dev->tx_pkt_burst = &bnxt_xmit_pkts;
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return 0;
if (BNXT_PF(bp) && pci_dev->id.device_id != BROADCOM_DEV_ID_NS2) {
snprintf(mz_name, RTE_MEMZONE_NAMESIZE,
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bnxt: use first completion ring for fwd and async event' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (53 preceding siblings ...)
2018-05-23 12:10 ` [dpdk-stable] patch 'net/bnxt: fix Tx and Rx burst for secondary process' " luca.boccassi
@ 2018-05-23 12:10 ` luca.boccassi
2018-05-23 12:10 ` [dpdk-stable] patch 'net/bnxt: fix xstats for VF' " luca.boccassi
` (2 subsequent siblings)
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:10 UTC (permalink / raw)
To: Ajit Khaparde; +Cc: Qingmin Liu, Somnath Kotur, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 4a7aec6135f302ead8277a948b3f0dd63722f254 Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Tue, 22 May 2018 11:13:44 -0700
Subject: [PATCH] net/bnxt: use first completion ring for fwd and async event
[ upstream commit 2b947bd294ffce2d980d092683de82269abe3676 ]
In order to save completion resource, use the first completion ring from
PF or VF as the default completion ring for async event & HWRM forward
response handling. Add bnxt_hwrm_set_async_event_cr() to set
async_event_cr for either PF or VF.
Fixes: 7bc8e9a227cc ("net/bnxt: support async link notification")
Signed-off-by: Qingmin Liu <qingmin.liu@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_cpr.c | 90 ++++++++++++------------------------------
drivers/net/bnxt/bnxt_cpr.h | 5 +--
drivers/net/bnxt/bnxt_ethdev.c | 20 +---------
drivers/net/bnxt/bnxt_hwrm.c | 19 +++++++--
drivers/net/bnxt/bnxt_hwrm.h | 1 +
drivers/net/bnxt/bnxt_irq.c | 28 +++----------
drivers/net/bnxt/bnxt_ring.c | 45 ++++++++++++++-------
drivers/net/bnxt/bnxt_rxr.c | 17 ++++++--
8 files changed, 94 insertions(+), 131 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c
index 737bb060a..ced1643c9 100644
--- a/drivers/net/bnxt/bnxt_cpr.c
+++ b/drivers/net/bnxt/bnxt_cpr.c
@@ -159,69 +159,31 @@ reject:
return;
}
-/* For the default completion ring only */
-int bnxt_alloc_def_cp_ring(struct bnxt *bp)
+int bnxt_event_hwrm_resp_handler(struct bnxt *bp, struct cmpl_base *cmp)
{
- struct bnxt_cp_ring_info *cpr = bp->def_cp_ring;
- struct bnxt_ring *cp_ring = cpr->cp_ring_struct;
- int rc;
-
- rc = bnxt_hwrm_ring_alloc(bp, cp_ring,
- HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL,
- 0, HWRM_NA_SIGNATURE,
- HWRM_NA_SIGNATURE);
- if (rc)
- goto err_out;
- cpr->cp_doorbell = bp->pdev->mem_resource[2].addr;
- B_CP_DIS_DB(cpr, cpr->cp_raw_cons);
- if (BNXT_PF(bp))
- rc = bnxt_hwrm_func_cfg_def_cp(bp);
- else
- rc = bnxt_hwrm_vf_func_cfg_def_cp(bp);
-
-err_out:
- return rc;
-}
-
-void bnxt_free_def_cp_ring(struct bnxt *bp)
-{
- struct bnxt_cp_ring_info *cpr = bp->def_cp_ring;
-
- if (cpr == NULL)
- 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 */
-int bnxt_init_def_ring_struct(struct bnxt *bp, unsigned int socket_id)
-{
- struct bnxt_cp_ring_info *cpr;
- struct bnxt_ring *ring;
-
- cpr = rte_zmalloc_socket("cpr",
- sizeof(struct bnxt_cp_ring_info),
- RTE_CACHE_LINE_SIZE, socket_id);
- if (cpr == NULL)
- return -ENOMEM;
- bp->def_cp_ring = cpr;
-
- ring = rte_zmalloc_socket("bnxt_cp_ring_struct",
- sizeof(struct bnxt_ring),
- RTE_CACHE_LINE_SIZE, socket_id);
- if (ring == NULL)
- return -ENOMEM;
- cpr->cp_ring_struct = ring;
- ring->bd = (void *)cpr->cp_desc_ring;
- ring->bd_dma = cpr->cp_desc_mapping;
- ring->ring_size = rte_align32pow2(DEFAULT_CP_RING_SIZE);
- ring->ring_mask = ring->ring_size - 1;
- ring->vmem_size = 0;
- ring->vmem = NULL;
-
- return 0;
+ bool evt = 0;
+
+ if (bp == NULL || cmp == NULL) {
+ PMD_DRV_LOG(ERR, "invalid NULL argument\n");
+ return evt;
+ }
+
+ switch (CMP_TYPE(cmp)) {
+ case CMPL_BASE_TYPE_HWRM_ASYNC_EVENT:
+ /* Handle any async event */
+ bnxt_handle_async_event(bp, cmp);
+ evt = 1;
+ break;
+ case CMPL_BASE_TYPE_HWRM_FWD_RESP:
+ /* Handle HWRM forwarded responses */
+ bnxt_handle_fwd_req(bp, cmp);
+ evt = 1;
+ break;
+ default:
+ /* Ignore any other events */
+ PMD_DRV_LOG(INFO, "Ignoring %02x completion\n", CMP_TYPE(cmp));
+ break;
+ }
+
+ return evt;
}
diff --git a/drivers/net/bnxt/bnxt_cpr.h b/drivers/net/bnxt/bnxt_cpr.h
index ce2b0cb8a..10216193a 100644
--- a/drivers/net/bnxt/bnxt_cpr.h
+++ b/drivers/net/bnxt/bnxt_cpr.h
@@ -100,12 +100,9 @@ struct bnxt_cp_ring_info {
#define RX_CMP_L2_ERRORS \
(RX_PKT_CMPL_ERRORS_BUFFER_ERROR_MASK | RX_PKT_CMPL_ERRORS_CRC_ERROR)
-
struct bnxt;
-int bnxt_alloc_def_cp_ring(struct bnxt *bp);
-void bnxt_free_def_cp_ring(struct bnxt *bp);
-int bnxt_init_def_ring_struct(struct bnxt *bp, unsigned int socket_id);
void bnxt_handle_async_event(struct bnxt *bp, struct cmpl_base *cmp);
void bnxt_handle_fwd_req(struct bnxt *bp, struct cmpl_base *cmp);
+int bnxt_event_hwrm_resp_handler(struct bnxt *bp, struct cmpl_base *cmp);
#endif
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 58cfbf9c6..6a3572823 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -168,23 +168,12 @@ static void bnxt_free_mem(struct bnxt *bp)
bnxt_free_stats(bp);
bnxt_free_tx_rings(bp);
bnxt_free_rx_rings(bp);
- bnxt_free_def_cp_ring(bp);
}
static int bnxt_alloc_mem(struct bnxt *bp)
{
int rc;
- /* Default completion ring */
- rc = bnxt_init_def_ring_struct(bp, SOCKET_ID_ANY);
- if (rc)
- goto alloc_mem_err;
-
- rc = bnxt_alloc_rings(bp, 0, NULL, NULL,
- bp->def_cp_ring, "def_cp");
- if (rc)
- goto alloc_mem_err;
-
rc = bnxt_alloc_vnic_mem(bp);
if (rc)
goto alloc_mem_err;
@@ -518,11 +507,11 @@ static int bnxt_dev_configure_op(struct rte_eth_dev *eth_dev)
/* Inherit new configurations */
if (eth_dev->data->nb_rx_queues > bp->max_rx_rings ||
eth_dev->data->nb_tx_queues > bp->max_tx_rings ||
- eth_dev->data->nb_rx_queues + eth_dev->data->nb_tx_queues + 1 >
+ eth_dev->data->nb_rx_queues + eth_dev->data->nb_tx_queues >
bp->max_cp_rings ||
eth_dev->data->nb_rx_queues + eth_dev->data->nb_tx_queues >
bp->max_stat_ctx ||
- (uint32_t)(eth_dev->data->nb_rx_queues + 1) > bp->max_ring_grps) {
+ (uint32_t)(eth_dev->data->nb_rx_queues) > bp->max_ring_grps) {
PMD_DRV_LOG(ERR,
"Insufficient resources to support requested config\n");
PMD_DRV_LOG(ERR,
@@ -3365,10 +3354,6 @@ skip_init:
if (rc)
goto error_free_int;
- rc = bnxt_alloc_def_cp_ring(bp);
- if (rc)
- goto error_free_int;
-
bnxt_enable_int(bp);
bnxt_init_nic(bp);
@@ -3376,7 +3361,6 @@ skip_init:
error_free_int:
bnxt_disable_int(bp);
- bnxt_free_def_cp_ring(bp);
bnxt_hwrm_func_buf_unrgtr(bp);
bnxt_free_int(bp);
bnxt_free_mem(bp);
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index ea40e4961..f5358a44f 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -1759,7 +1759,7 @@ int bnxt_free_all_hwrm_rings(struct bnxt *bp)
struct bnxt_tx_ring_info *txr = txq->tx_ring;
struct bnxt_ring *ring = txr->tx_ring_struct;
struct bnxt_cp_ring_info *cpr = txq->cp_ring;
- unsigned int idx = bp->rx_cp_nr_rings + i + 1;
+ unsigned int idx = bp->rx_cp_nr_rings + i;
if (ring->fw_ring_id != INVALID_HW_RING_ID) {
bnxt_hwrm_ring_free(bp, ring,
@@ -1785,13 +1785,12 @@ int bnxt_free_all_hwrm_rings(struct bnxt *bp)
struct bnxt_rx_ring_info *rxr = rxq->rx_ring;
struct bnxt_ring *ring = rxr->rx_ring_struct;
struct bnxt_cp_ring_info *cpr = rxq->cp_ring;
- unsigned int idx = i + 1;
if (ring->fw_ring_id != INVALID_HW_RING_ID) {
bnxt_hwrm_ring_free(bp, ring,
HWRM_RING_FREE_INPUT_RING_TYPE_RX);
ring->fw_ring_id = INVALID_HW_RING_ID;
- bp->grp_info[idx].rx_fw_ring_id = INVALID_HW_RING_ID;
+ bp->grp_info[i].rx_fw_ring_id = INVALID_HW_RING_ID;
memset(rxr->rx_desc_ring, 0,
rxr->rx_ring_struct->ring_size *
sizeof(*rxr->rx_desc_ring));
@@ -1812,7 +1811,7 @@ int bnxt_free_all_hwrm_rings(struct bnxt *bp)
bp->grp_info[i].ag_fw_ring_id = INVALID_HW_RING_ID;
}
if (cpr->cp_ring_struct->fw_ring_id != INVALID_HW_RING_ID) {
- bnxt_free_cp_ring(bp, cpr, idx);
+ bnxt_free_cp_ring(bp, cpr, i);
bp->grp_info[i].cp_fw_ring_id = INVALID_HW_RING_ID;
cpr->cp_ring_struct->fw_ring_id = INVALID_HW_RING_ID;
}
@@ -2922,6 +2921,18 @@ int bnxt_hwrm_set_vf_vlan(struct bnxt *bp, int vf)
return rc;
}
+int bnxt_hwrm_set_async_event_cr(struct bnxt *bp)
+{
+ int rc;
+
+ if (BNXT_PF(bp))
+ rc = bnxt_hwrm_func_cfg_def_cp(bp);
+ else
+ rc = bnxt_hwrm_vf_func_cfg_def_cp(bp);
+
+ return rc;
+}
+
int bnxt_hwrm_reject_fwd_resp(struct bnxt *bp, uint16_t target_id,
void *encaped, size_t ec_size)
{
diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h
index f11e72a35..2a667c88a 100644
--- a/drivers/net/bnxt/bnxt_hwrm.h
+++ b/drivers/net/bnxt/bnxt_hwrm.h
@@ -88,6 +88,7 @@ int bnxt_hwrm_vf_func_cfg_def_cp(struct bnxt *bp);
int bnxt_hwrm_queue_qportcfg(struct bnxt *bp);
+int bnxt_hwrm_set_async_event_cr(struct bnxt *bp);
int bnxt_hwrm_ring_alloc(struct bnxt *bp,
struct bnxt_ring *ring,
uint32_t ring_type, uint32_t map_index,
diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c
index 8ab986936..3510120ed 100644
--- a/drivers/net/bnxt/bnxt_irq.c
+++ b/drivers/net/bnxt/bnxt_irq.c
@@ -68,30 +68,10 @@ static void bnxt_int_handler(void *param)
if (!CMP_VALID(cmp, raw_cons, cpr->cp_ring_struct))
break;
- switch (CMP_TYPE(cmp)) {
- case CMPL_BASE_TYPE_HWRM_ASYNC_EVENT:
- /* Handle any async event */
- bnxt_handle_async_event(bp, cmp);
- break;
- case CMPL_BASE_TYPE_HWRM_FWD_REQ:
- /* Handle HWRM forwarded responses */
- bnxt_handle_fwd_req(bp, cmp);
- break;
- default:
- /* Ignore any other events */
- if (cmp->type & rte_cpu_to_le_16(0x01)) {
- if (!CMP_VALID(cmp, raw_cons,
- cpr->cp_ring_struct))
- goto no_more;
- }
- PMD_DRV_LOG(INFO,
- "Ignoring %02x completion\n", CMP_TYPE(cmp));
- break;
- }
+ bnxt_event_hwrm_resp_handler(bp, cmp);
raw_cons = NEXT_RAW_CMP(raw_cons);
-
};
-no_more:
+
cpr->cp_raw_cons = raw_cons;
B_CP_DB_REARM(cpr, cpr->cp_raw_cons);
}
@@ -127,7 +107,9 @@ void bnxt_enable_int(struct bnxt *bp)
{
struct bnxt_cp_ring_info *cpr = bp->def_cp_ring;
- B_CP_DB_ARM(cpr);
+ /* Only the default completion ring */
+ if (cpr != NULL && cpr->cp_doorbell != NULL)
+ B_CP_DB_ARM(cpr);
}
int bnxt_setup_int(struct bnxt *bp)
diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index 75c0830fe..c0b844d4f 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -297,33 +297,50 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp)
struct bnxt_ring *cp_ring = cpr->cp_ring_struct;
struct bnxt_rx_ring_info *rxr = rxq->rx_ring;
struct bnxt_ring *ring = rxr->rx_ring_struct;
- unsigned int idx = i + 1;
- unsigned int map_idx = idx + bp->rx_cp_nr_rings;
+ unsigned int map_idx = i + bp->rx_cp_nr_rings;
bp->grp_info[i].fw_stats_ctx = cpr->hw_stats_ctx_id;
/* Rx cmpl */
- rc = bnxt_hwrm_ring_alloc(bp, cp_ring,
- HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL,
- idx, HWRM_NA_SIGNATURE,
- HWRM_NA_SIGNATURE);
+ rc = bnxt_hwrm_ring_alloc
+ (bp,
+ cp_ring,
+ HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL,
+ i,
+ HWRM_NA_SIGNATURE,
+ HWRM_NA_SIGNATURE);
if (rc)
goto err_out;
cpr->cp_doorbell = (char *)pci_dev->mem_resource[2].addr +
- idx * 0x80;
+ i * 0x80;
bp->grp_info[i].cp_fw_ring_id = cp_ring->fw_ring_id;
B_CP_DIS_DB(cpr, cpr->cp_raw_cons);
+ if (!i) {
+ /*
+ * In order to save completion resource, use the first
+ * completion ring from PF or VF as the default
+ * completion ring for async event & HWRM
+ * forward response handling.
+ */
+ bp->def_cp_ring = cpr;
+ rc = bnxt_hwrm_set_async_event_cr(bp);
+ if (rc)
+ goto err_out;
+ }
+
/* Rx ring */
- rc = bnxt_hwrm_ring_alloc(bp, ring,
- HWRM_RING_ALLOC_INPUT_RING_TYPE_RX,
- idx, cpr->hw_stats_ctx_id,
- cp_ring->fw_ring_id);
+ rc = bnxt_hwrm_ring_alloc(bp,
+ ring,
+ HWRM_RING_ALLOC_INPUT_RING_TYPE_RX,
+ i,
+ cpr->hw_stats_ctx_id,
+ cp_ring->fw_ring_id);
if (rc)
goto err_out;
rxr->rx_prod = 0;
rxr->rx_doorbell = (char *)pci_dev->mem_resource[2].addr +
- idx * 0x80;
+ i * 0x80;
bp->grp_info[i].rx_fw_ring_id = ring->fw_ring_id;
B_RX_DB(rxr->rx_doorbell, rxr->rx_prod);
@@ -357,7 +374,7 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp)
}
B_RX_DB(rxr->rx_doorbell, rxr->rx_prod);
B_RX_DB(rxr->ag_doorbell, rxr->ag_prod);
- rxq->index = idx;
+ rxq->index = i;
}
for (i = 0; i < bp->tx_cp_nr_rings; i++) {
@@ -366,7 +383,7 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp)
struct bnxt_ring *cp_ring = cpr->cp_ring_struct;
struct bnxt_tx_ring_info *txr = txq->tx_ring;
struct bnxt_ring *ring = txr->tx_ring_struct;
- unsigned int idx = i + 1 + bp->rx_cp_nr_rings;
+ unsigned int idx = i + bp->rx_cp_nr_rings;
/* Tx cmpl */
rc = bnxt_hwrm_ring_alloc(bp, cp_ring,
diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index 829a95f9f..de6719122 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -562,6 +562,7 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
uint16_t prod = rxr->rx_prod;
uint16_t ag_prod = rxr->ag_prod;
int rc = 0;
+ bool evt = false;
/* If Rx Q was stopped return */
if (rxq->rx_deferred_start)
@@ -586,14 +587,19 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
nb_rx_pkts++;
if (rc == -EBUSY) /* partial completion */
break;
+ } else {
+ evt =
+ bnxt_event_hwrm_resp_handler(rxq->bp,
+ (struct cmpl_base *)rxcmp);
}
+
raw_cons = NEXT_RAW_CMP(raw_cons);
- if (nb_rx_pkts == nb_pkts)
+ if (nb_rx_pkts == nb_pkts || evt)
break;
}
cpr->cp_raw_cons = raw_cons;
- if (prod == rxr->rx_prod && ag_prod == rxr->ag_prod) {
+ if ((prod == rxr->rx_prod && ag_prod == rxr->ag_prod) && !evt) {
/*
* For PMD, there is no need to keep on pushing to REARM
* the doorbell if there are no new completions
@@ -602,9 +608,12 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
}
B_CP_DIS_DB(cpr, cpr->cp_raw_cons);
- B_RX_DB(rxr->rx_doorbell, rxr->rx_prod);
+ if (prod != rxr->rx_prod)
+ B_RX_DB(rxr->rx_doorbell, rxr->rx_prod);
+
/* Ring the AGG ring DB */
- B_RX_DB(rxr->ag_doorbell, rxr->ag_prod);
+ if (ag_prod != rxr->ag_prod)
+ B_RX_DB(rxr->ag_doorbell, rxr->ag_prod);
/* Attempt to alloc Rx buf in case of a previous allocation failure. */
if (rc == -ENOMEM) {
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bnxt: fix xstats for VF' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (54 preceding siblings ...)
2018-05-23 12:10 ` [dpdk-stable] patch 'net/bnxt: use first completion ring for fwd and async event' " luca.boccassi
@ 2018-05-23 12:10 ` luca.boccassi
2018-05-23 12:10 ` [dpdk-stable] patch 'net/bnxt: fix Rx checksum flags' " luca.boccassi
2018-05-23 12:10 ` [dpdk-stable] patch 'net/liquidio: fix link state fetching during start' " luca.boccassi
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:10 UTC (permalink / raw)
To: Ajit Khaparde; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From ce8b0aba13b89db421e8ee36f05295372031229e Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Tue, 22 May 2018 11:13:46 -0700
Subject: [PATCH] net/bnxt: fix xstats for VF
[ upstream commit 7f799071fe75842e9e76cef98d019c1072cfb649 ]
Query of port stats is permitted for VF interfaces as well.
Fix the code to allow VFs to query port stats.
Fixes: bfb9c2260be2 ("net/bnxt: support xstats get/reset")
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 2 +-
drivers/net/bnxt/bnxt_hwrm.c | 3 ---
drivers/net/bnxt/bnxt_stats.c | 5 -----
3 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 6a3572823..132d81ea3 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -3130,7 +3130,7 @@ skip_init:
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return 0;
- if (BNXT_PF(bp) && pci_dev->id.device_id != BROADCOM_DEV_ID_NS2) {
+ if (pci_dev->id.device_id != BROADCOM_DEV_ID_NS2) {
snprintf(mz_name, RTE_MEMZONE_NAMESIZE,
"bnxt_%04x:%02x:%02x:%02x-%s", pci_dev->addr.domain,
pci_dev->addr.bus, pci_dev->addr.devid,
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index f5358a44f..5af69083f 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -3047,9 +3047,6 @@ int bnxt_hwrm_port_qstats(struct bnxt *bp)
struct bnxt_pf_info *pf = &bp->pf;
int rc;
- if (!(bp->flags & BNXT_FLAG_PORT_STATS))
- return 0;
-
HWRM_PREP(req, PORT_QSTATS);
req.port_id = rte_cpu_to_le_16(pf->port_id);
diff --git a/drivers/net/bnxt/bnxt_stats.c b/drivers/net/bnxt/bnxt_stats.c
index 00bbef65f..911ac6b87 100644
--- a/drivers/net/bnxt/bnxt_stats.c
+++ b/drivers/net/bnxt/bnxt_stats.c
@@ -288,11 +288,6 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,
unsigned int count, i;
uint64_t tx_drop_pkts;
- if (!(bp->flags & BNXT_FLAG_PORT_STATS)) {
- PMD_DRV_LOG(ERR, "xstats not supported for VF\n");
- return 0;
- }
-
bnxt_hwrm_port_qstats(bp);
bnxt_hwrm_func_qstats_tx_drop(bp, 0xffff, &tx_drop_pkts);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bnxt: fix Rx checksum flags' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (55 preceding siblings ...)
2018-05-23 12:10 ` [dpdk-stable] patch 'net/bnxt: fix xstats for VF' " luca.boccassi
@ 2018-05-23 12:10 ` luca.boccassi
2018-05-23 12:10 ` [dpdk-stable] patch 'net/liquidio: fix link state fetching during start' " luca.boccassi
57 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:10 UTC (permalink / raw)
To: Ajit Khaparde; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 65a18cf1acc8c3eca2cd31df67b42a0d286ccf78 Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Tue, 22 May 2018 11:13:47 -0700
Subject: [PATCH] net/bnxt: fix Rx checksum flags
[ upstream commit 65ee636872ebd13b85bb0bebeb3cade56f94e6f1 ]
For frames where the hardware is not able to calculate checksum
we are indicating such frames to be bad. And that is incorrect.
Indicate PKT_RX_IP_CKSUM_UNKNOWN or PKT_RX_L4_CKSUM_UNKNOWN
for such frames.
Fixes: 7ec39d8c524b ("net/bnxt: update status of Rx IP/L4 CKSUM")
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_rxr.c | 4 ++++
drivers/net/bnxt/bnxt_rxr.h | 6 ++++++
2 files changed, 10 insertions(+)
diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index de6719122..216ca7144 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -492,11 +492,15 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
if (likely(RX_CMP_IP_CS_OK(rxcmp1)))
mbuf->ol_flags |= PKT_RX_IP_CKSUM_GOOD;
+ else if (likely(RX_CMP_IP_CS_UNKNOWN(rxcmp1)))
+ mbuf->ol_flags |= PKT_RX_IP_CKSUM_UNKNOWN;
else
mbuf->ol_flags |= PKT_RX_IP_CKSUM_BAD;
if (likely(RX_CMP_L4_CS_OK(rxcmp1)))
mbuf->ol_flags |= PKT_RX_L4_CKSUM_GOOD;
+ else if (likely(RX_CMP_L4_CS_UNKNOWN(rxcmp1)))
+ mbuf->ol_flags |= PKT_RX_L4_CKSUM_UNKNOWN;
else
mbuf->ol_flags |= PKT_RX_L4_CKSUM_BAD;
diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h
index 174e1832f..d26fefd4a 100644
--- a/drivers/net/bnxt/bnxt_rxr.h
+++ b/drivers/net/bnxt/bnxt_rxr.h
@@ -64,6 +64,9 @@
(((rxcmp1)->flags2 & RX_CMP_L4_CS_BITS) && \
!((rxcmp1)->errors_v2 & RX_CMP_L4_CS_ERR_BITS))
+#define RX_CMP_L4_CS_UNKNOWN(rxcmp1) \
+ !((rxcmp1)->flags2 & RX_CMP_L4_CS_BITS)
+
#define RX_CMP_IP_CS_ERR_BITS \
rte_cpu_to_le_32(RX_PKT_CMPL_ERRORS_IP_CS_ERROR | \
RX_PKT_CMPL_ERRORS_T_IP_CS_ERROR)
@@ -76,6 +79,9 @@
(((rxcmp1)->flags2 & RX_CMP_IP_CS_BITS) && \
!((rxcmp1)->errors_v2 & RX_CMP_IP_CS_ERR_BITS))
+#define RX_CMP_IP_CS_UNKNOWN(rxcmp1) \
+ !((rxcmp1)->flags2 & RX_CMP_IP_CS_BITS)
+
enum pkt_hash_types {
PKT_HASH_TYPE_NONE, /* Undefined type */
PKT_HASH_TYPE_L2, /* Input: src_MAC, dest_MAC */
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/liquidio: fix link state fetching during start' has been queued to stable release 18.02.2
2018-05-23 12:09 ` [dpdk-stable] patch 'net/mlx5: fix flow director drop rule deletion crash' " luca.boccassi
` (56 preceding siblings ...)
2018-05-23 12:10 ` [dpdk-stable] patch 'net/bnxt: fix Rx checksum flags' " luca.boccassi
@ 2018-05-23 12:10 ` luca.boccassi
2018-05-29 10:25 ` [dpdk-stable] patch 'net/qede: fix slow path completion timeout' " luca.boccassi
57 siblings, 1 reply; 382+ messages in thread
From: luca.boccassi @ 2018-05-23 12:10 UTC (permalink / raw)
To: Chuhong Yao; +Cc: Shijith Thotton, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 0e5aa4bdc959d12b773db73e90f83b56193ac15c Mon Sep 17 00:00:00 2001
From: Chuhong Yao <ych@panath.cn>
Date: Tue, 22 May 2018 22:33:29 +0800
Subject: [PATCH] net/liquidio: fix link state fetching during start
[ upstream commit fe242d514d1ae8e7c73b6f3a14bf2578ebe55091 ]
Clear link state information during device start for fetching new state
before function completion.
Fixes: 605164c8e79d ("net/liquidio: add API to validate VF MTU")
Signed-off-by: Chuhong Yao <ych@panath.cn>
Acked-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
---
drivers/net/liquidio/lio_ethdev.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index eebe0b798..b0d201230 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -1441,6 +1441,11 @@ lio_dev_start(struct rte_eth_dev *eth_dev)
/* Configure RSS if device configured with multiple RX queues. */
lio_dev_mq_rx_configure(eth_dev);
+ /* Before update the link info,
+ * must set linfo.link.link_status64 to 0.
+ */
+ lio_dev->linfo.link.link_status64 = 0;
+
/* start polling for lsc */
ret = rte_eal_alarm_set(LIO_LSC_TIMEOUT,
lio_sync_link_state_check,
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/qede: fix slow path completion timeout' has been queued to stable release 18.02.2
2018-05-23 12:10 ` [dpdk-stable] patch 'net/liquidio: fix link state fetching during start' " luca.boccassi
@ 2018-05-29 10:25 ` luca.boccassi
2018-05-29 10:25 ` [dpdk-stable] patch 'doc: remove deprecated terms from thunderx guide' " luca.boccassi
` (3 more replies)
0 siblings, 4 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-29 10:25 UTC (permalink / raw)
To: Shahed Shaikh; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/31/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From e6d531b7aef43ffc4e5331d822d94ddf073172e6 Mon Sep 17 00:00:00 2001
From: Shahed Shaikh <shahed.shaikh@cavium.com>
Date: Wed, 23 May 2018 11:48:53 -0700
Subject: [PATCH] net/qede: fix slow path completion timeout
[ upstream commit 0833120f20f0aeae8496d39bddaad0c1a70b0bfc ]
In 100G mode, we poll firmware slow path completion for every 1 second,
which is not enough and may result in completion timeout if
driver misses that window.
Patch "eal: set affinity for control threads" exposed this issue since
alarm callback runs in control thread context.
Fix this issue by update polling period to 100ms.
Fixes: d651ee4919cd ("eal: set affinity for control threads")
Fixes: 2af14ca79c0a ("net/qede: support 100G")
Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
---
drivers/net/qede/qede_ethdev.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 65eb33e73..6dfff07e2 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -16,7 +16,7 @@ int qede_logtype_init;
int qede_logtype_driver;
static const struct qed_eth_ops *qed_ops;
-static int64_t timer_period = 1;
+#define QEDE_SP_TIMER_PERIOD 10000 /* 100ms */
/* VXLAN tunnel classification mapping */
const struct _qede_udp_tunn_types {
@@ -1649,7 +1649,7 @@ static void qede_poll_sp_sb_cb(void *param)
qede_interrupt_action(ECORE_LEADING_HWFN(edev));
qede_interrupt_action(&edev->hwfns[1]);
- rc = rte_eal_alarm_set(timer_period * US_PER_S,
+ rc = rte_eal_alarm_set(QEDE_SP_TIMER_PERIOD,
qede_poll_sp_sb_cb,
(void *)eth_dev);
if (rc != 0) {
@@ -3046,7 +3046,7 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
* interrupt vector but we need one for each engine.
*/
if (ECORE_IS_CMT(edev) && IS_PF(edev)) {
- rc = rte_eal_alarm_set(timer_period * US_PER_S,
+ rc = rte_eal_alarm_set(QEDE_SP_TIMER_PERIOD,
qede_poll_sp_sb_cb,
(void *)eth_dev);
if (rc != 0) {
--
2.17.0
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'doc: remove deprecated terms from thunderx guide' has been queued to stable release 18.02.2
2018-05-29 10:25 ` [dpdk-stable] patch 'net/qede: fix slow path completion timeout' " luca.boccassi
@ 2018-05-29 10:25 ` luca.boccassi
2018-05-29 10:25 ` [dpdk-stable] patch 'net/tap: fix keep-alive queue not detached' " luca.boccassi
` (2 subsequent siblings)
3 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-29 10:25 UTC (permalink / raw)
To: Jerin Jacob; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/31/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 3ff8436fc483539632e0ca844a5e681352d31ccb Mon Sep 17 00:00:00 2001
From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Date: Thu, 24 May 2018 13:38:55 +0530
Subject: [PATCH] doc: remove deprecated terms from thunderx guide
[ upstream commit 6e2320bec5efd5a1a79f09c7a75b1c3b3aba3266 ]
Remove reference to deprecated ethdev offload parameter from thunderx
documentation.
Fixes: c97da2cbc2c2 ("net/thunderx: convert to new offload API")
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
doc/guides/nics/thunderx.rst | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/doc/guides/nics/thunderx.rst b/doc/guides/nics/thunderx.rst
index 5270ef23e..264237472 100644
--- a/doc/guides/nics/thunderx.rst
+++ b/doc/guides/nics/thunderx.rst
@@ -319,8 +319,7 @@ CRC striping
~~~~~~~~~~~~
The ThunderX SoC family NICs strip the CRC for every packets coming into the
-host interface. So, CRC will be stripped even when the
-``rxmode.hw_strip_crc`` member is set to 0 in ``struct rte_eth_conf``.
+host interface irrespective of the offload configuration.
Maximum packet length
~~~~~~~~~~~~~~~~~~~~~
--
2.17.0
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/tap: fix keep-alive queue not detached' has been queued to stable release 18.02.2
2018-05-29 10:25 ` [dpdk-stable] patch 'net/qede: fix slow path completion timeout' " luca.boccassi
2018-05-29 10:25 ` [dpdk-stable] patch 'doc: remove deprecated terms from thunderx guide' " luca.boccassi
@ 2018-05-29 10:25 ` luca.boccassi
2018-05-29 10:25 ` [dpdk-stable] patch 'ethdev: add missing TM function to export map' " luca.boccassi
2018-05-29 10:25 ` [dpdk-stable] patch 'doc: fix a typo in flow API howto' " luca.boccassi
3 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-29 10:25 UTC (permalink / raw)
To: Ophir Munk; +Cc: Keith Wiles, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/31/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 78f59529854f96cd7337126dca033d8a46be7319 Mon Sep 17 00:00:00 2001
From: Ophir Munk <ophirmu@mellanox.com>
Date: Thu, 24 May 2018 23:10:40 +0000
Subject: [PATCH] net/tap: fix keep-alive queue not detached
[ upstream commit 42ec78eaeb22fb17fcd5315c8607b80ffd4c64d2 ]
The TAP keep-alive queue was created in order to keep the TAP device
in Linux even in case all of its Rx/Tx queues are released (in Linux
terminology: even in case all of the TAP device file descriptors are
closed), however, the keep-alive queue itself is attached to the TAP
device like all other Rx/Tx queues and therefore the kernel will
enqueue to it some Rx packets based on the kernel RSS distribution
rules. Those packets are unknown to the application and will remain
lost in the keep-alive queue.
All queues are attached by default to the TAP device after they are
created though TUNSETIFF ioctl call.
The fix is to detach the keep-alive queue after its creation through
TUNSETQUEUE ioctl call.
Fixes: 3101191c63ab ("net/tap: fix device removal when no queue exist")
Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
---
drivers/net/tap/rte_eth_tap.c | 33 +++++++++++++++++++++++++++------
1 file changed, 27 insertions(+), 6 deletions(-)
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index b9b9397b9..881cdd19f 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -84,13 +84,20 @@ enum ioctl_mode {
static int tap_intr_handle_set(struct rte_eth_dev *dev, int set);
-/* Tun/Tap allocation routine
+/**
+ * Tun/Tap allocation routine
*
- * name is the number of the interface to use, unless NULL to take the host
- * supplied name.
+ * @param[in] pmd
+ * Pointer to private structure.
+ *
+ * @param[in] is_keepalive
+ * Keepalive flag
+ *
+ * @return
+ * -1 on failure, fd on success
*/
static int
-tun_alloc(struct pmd_internals *pmd)
+tun_alloc(struct pmd_internals *pmd, int is_keepalive)
{
struct ifreq ifr;
#ifdef IFF_MULTI_QUEUE
@@ -143,6 +150,20 @@ tun_alloc(struct pmd_internals *pmd)
goto error;
}
+ if (is_keepalive) {
+ /*
+ * Detach the TUN/TAP keep-alive queue
+ * to avoid traffic through it
+ */
+ ifr.ifr_flags = IFF_DETACH_QUEUE;
+ if (ioctl(fd, TUNSETQUEUE, (void *)&ifr) < 0) {
+ RTE_LOG(WARNING, PMD,
+ "Unable to detach keep-alive queue for %s: %s\n",
+ ifr.ifr_name, strerror(errno));
+ goto error;
+ }
+ }
+
/* Always set the file descriptor to non-blocking */
if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0) {
RTE_LOG(WARNING, PMD,
@@ -1015,7 +1036,7 @@ tap_setup_queue(struct rte_eth_dev *dev,
pmd->name, *other_fd, dir, qid, *fd);
} else {
/* Both RX and TX fds do not exist (equal -1). Create fd */
- *fd = tun_alloc(pmd);
+ *fd = tun_alloc(pmd, 0);
if (*fd < 0) {
*fd = -1; /* restore original value */
RTE_LOG(ERR, PMD, "%s: tun_alloc() failed.\n",
@@ -1421,7 +1442,7 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, char *tap_name,
* This keep-alive file descriptor will guarantee that the TUN device
* exists even when all of its queues are closed
*/
- pmd->ka_fd = tun_alloc(pmd);
+ pmd->ka_fd = tun_alloc(pmd, 1);
if (pmd->ka_fd == -1) {
RTE_LOG(ERR, PMD, "Unable to create %s interface", tap_name);
goto error_exit;
--
2.17.0
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'ethdev: add missing TM function to export map' has been queued to stable release 18.02.2
2018-05-29 10:25 ` [dpdk-stable] patch 'net/qede: fix slow path completion timeout' " luca.boccassi
2018-05-29 10:25 ` [dpdk-stable] patch 'doc: remove deprecated terms from thunderx guide' " luca.boccassi
2018-05-29 10:25 ` [dpdk-stable] patch 'net/tap: fix keep-alive queue not detached' " luca.boccassi
@ 2018-05-29 10:25 ` luca.boccassi
2018-05-29 10:25 ` [dpdk-stable] patch 'doc: fix a typo in flow API howto' " luca.boccassi
3 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-29 10:25 UTC (permalink / raw)
To: Ben Shelton; +Cc: Ferruh Yigit, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/31/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From f2ed4f0fb0cd76ed0db03540628d38d4f1fcf849 Mon Sep 17 00:00:00 2001
From: Ben Shelton <benjamin.h.shelton@intel.com>
Date: Fri, 25 May 2018 14:59:43 -0500
Subject: [PATCH] ethdev: add missing TM function to export map
[ upstream commit 527eefac655bb5e3b75dc0fa5819cee38c8be6f9 ]
The rte_tm_get_number_of_leaf_nodes() API function was added in DPDK
17.08. However, it was added to the .map file with the wrong function
name (rte_tm_get_leaf_nodes), which was subsequently removed in commit
3e8ea3d ('lib: remove unused map symbols').
Add it back under the 17.08 release with the correct function name.
Fixes: 5d109deffa87 ("ethdev: add traffic management API")
Signed-off-by: Ben Shelton <benjamin.h.shelton@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
lib/librte_ether/rte_ethdev_version.map | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/librte_ether/rte_ethdev_version.map b/lib/librte_ether/rte_ethdev_version.map
index d7143a0a7..360c630fa 100644
--- a/lib/librte_ether/rte_ethdev_version.map
+++ b/lib/librte_ether/rte_ethdev_version.map
@@ -156,6 +156,7 @@ DPDK_17.08 {
rte_flow_copy;
rte_flow_isolate;
rte_tm_capabilities_get;
+ rte_tm_get_number_of_leaf_nodes;
rte_tm_hierarchy_commit;
rte_tm_level_capabilities_get;
rte_tm_mark_ip_dscp;
--
2.17.0
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'doc: fix a typo in flow API howto' has been queued to stable release 18.02.2
2018-05-29 10:25 ` [dpdk-stable] patch 'net/qede: fix slow path completion timeout' " luca.boccassi
` (2 preceding siblings ...)
2018-05-29 10:25 ` [dpdk-stable] patch 'ethdev: add missing TM function to export map' " luca.boccassi
@ 2018-05-29 10:25 ` luca.boccassi
2018-05-31 8:34 ` [dpdk-stable] patch 'net/i40e: fix link status update' " luca.boccassi
3 siblings, 1 reply; 382+ messages in thread
From: luca.boccassi @ 2018-05-29 10:25 UTC (permalink / raw)
To: Jerin Jacob; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/31/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 9365e4b0a46afa5fe270ff33b77bb139138239c3 Mon Sep 17 00:00:00 2001
From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Date: Mon, 28 May 2018 00:25:58 +0530
Subject: [PATCH] doc: fix a typo in flow API howto
[ upstream commit d80e42cce4c7017ed8c99dabb8ae444a492acc1c ]
Fixes: 3e0ceb9f17ff ("doc: add basic howto for flow API")
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
doc/guides/howto/rte_flow.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/guides/howto/rte_flow.rst b/doc/guides/howto/rte_flow.rst
index 4a27c995d..75d278e3d 100644
--- a/doc/guides/howto/rte_flow.rst
+++ b/doc/guides/howto/rte_flow.rst
@@ -276,7 +276,7 @@ Code
/* end the pattern array */
pattern[2].type = RTE_FLOW_ITEM)TYPE_END;
- /* create the drop action */
+ /* create the queue action */
actions[0].type = RTE_FLOW_ACTION_TYPE_QUEUE;
actions[0].conf = &queue
actions[1].type = RTE_FLOW_ACTION_TYPE_END;
--
2.17.0
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/i40e: fix link status update' has been queued to stable release 18.02.2
2018-05-29 10:25 ` [dpdk-stable] patch 'doc: fix a typo in flow API howto' " luca.boccassi
@ 2018-05-31 8:34 ` luca.boccassi
2018-05-31 8:34 ` [dpdk-stable] patch 'crypto/armv8: fix HMAC supported digest sizes' " luca.boccassi
0 siblings, 1 reply; 382+ messages in thread
From: luca.boccassi @ 2018-05-31 8:34 UTC (permalink / raw)
To: Fan Zhang; +Cc: Qi Zhang, Pablo de Lara, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From f10ff9d64a0785881e62a6bcd29af3d79c3482db Mon Sep 17 00:00:00 2001
From: Fan Zhang <roy.fan.zhang@intel.com>
Date: Wed, 30 May 2018 09:30:47 +0100
Subject: [PATCH] net/i40e: fix link status update
[ upstream commit c60869e2b742d2d0b7c5d568ad31f67f29d4f450 ]
This patch fixes link status update problem in interrupt mode.
Previously, directly reading link status register instead of
accessing via admin queue command may cause the link status
change interrupt callback inactive. This patch fixes the
problem by making the driver only read the register in
"no wait" and polling mode.
Bugzilla ID: 54
Fixes: eef2daf2e199 ("net/i40e: fix link update no wait")
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Tested-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
drivers/net/i40e/i40e_ethdev.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 1ebda8dbd..ccfd6069d 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2480,7 +2480,7 @@ i40e_dev_set_link_down(struct rte_eth_dev *dev)
}
static __rte_always_inline void
-update_link_no_wait(struct i40e_hw *hw, struct rte_eth_link *link)
+update_link_reg(struct i40e_hw *hw, struct rte_eth_link *link)
{
/* Link status registers and values*/
#define I40E_PRTMAC_LINKSTA 0x001E2420
@@ -2534,8 +2534,8 @@ update_link_no_wait(struct i40e_hw *hw, struct rte_eth_link *link)
}
static __rte_always_inline void
-update_link_wait(struct i40e_hw *hw, struct rte_eth_link *link,
- bool enable_lse)
+update_link_aq(struct i40e_hw *hw, struct rte_eth_link *link,
+ bool enable_lse, int wait_to_complete)
{
#define CHECK_INTERVAL 100 /* 100ms */
#define MAX_REPEAT_TIME 10 /* 1s (10 * 100ms) in total */
@@ -2557,7 +2557,7 @@ update_link_wait(struct i40e_hw *hw, struct rte_eth_link *link,
}
link->link_status = link_status.link_info & I40E_AQ_LINK_UP;
- if (unlikely(link->link_status != 0))
+ if (!wait_to_complete || link->link_status)
break;
rte_delay_ms(CHECK_INTERVAL);
@@ -2607,10 +2607,10 @@ i40e_dev_link_update(struct rte_eth_dev *dev,
link.link_autoneg = !(dev->data->dev_conf.link_speeds &
ETH_LINK_SPEED_FIXED);
- if (!wait_to_complete)
- update_link_no_wait(hw, &link);
+ if (!wait_to_complete && !enable_lse)
+ update_link_reg(hw, &link);
else
- update_link_wait(hw, &link, enable_lse);
+ update_link_aq(hw, &link, enable_lse, wait_to_complete);
rte_i40e_dev_atomic_write_link_status(dev, &link);
if (link.link_status == old.link_status)
--
2.17.1
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'crypto/armv8: fix HMAC supported digest sizes' has been queued to stable release 18.02.2
2018-05-31 8:34 ` [dpdk-stable] patch 'net/i40e: fix link status update' " luca.boccassi
@ 2018-05-31 8:34 ` luca.boccassi
0 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-31 8:34 UTC (permalink / raw)
To: Anoob Joseph; +Cc: Sachin Saxena, Akhil Goyal, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From b809866cf9fb6e3170abd6d2413f9650e4dbe3b1 Mon Sep 17 00:00:00 2001
From: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Date: Tue, 29 May 2018 16:15:36 +0530
Subject: [PATCH] crypto/armv8: fix HMAC supported digest sizes
[ upstream commit 670c6dabca9e3f6c684af158d08a97ec05307ce7 ]
For HMAC algorithms (SHAx-HMAC), the supported digest sizes are not a
fixed value, but a range between 1 and the maximum digest size for those
algorithms.
Fixes: 0f89def76127 ("crypto/armv8: fix HMAC supported key sizes")
Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Signed-off-by: Sachin Saxena <sachin.saxena@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
---
drivers/crypto/armv8/rte_armv8_pmd_ops.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/crypto/armv8/rte_armv8_pmd_ops.c b/drivers/crypto/armv8/rte_armv8_pmd_ops.c
index 3817ad7b1..c64aef09f 100644
--- a/drivers/crypto/armv8/rte_armv8_pmd_ops.c
+++ b/drivers/crypto/armv8/rte_armv8_pmd_ops.c
@@ -27,9 +27,9 @@ static const struct rte_cryptodev_capabilities
.increment = 1
},
.digest_size = {
- .min = 20,
+ .min = 1,
.max = 20,
- .increment = 0
+ .increment = 1
},
.iv_size = { 0 }
}, }
@@ -48,9 +48,9 @@ static const struct rte_cryptodev_capabilities
.increment = 1
},
.digest_size = {
- .min = 32,
+ .min = 1,
.max = 32,
- .increment = 0
+ .increment = 1
},
.iv_size = { 0 }
}, }
--
2.17.1
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bnx2x: fix KR2 device check' has been queued to stable release 18.02.2
2018-05-16 10:13 ` [dpdk-stable] patch 'mempool: fix virtual address population' " luca.boccassi
2018-05-16 10:13 ` [dpdk-stable] patch 'net/bnx2x: do not cast function pointers as a policy' " luca.boccassi
@ 2018-05-16 10:13 ` luca.boccassi
2018-05-16 10:13 ` [dpdk-stable] patch 'net/bnx2x: fix memzone name overrun' " luca.boccassi
2 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-16 10:13 UTC (permalink / raw)
To: Andy Green; +Cc: Rasesh Mody, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/18/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From ddbfb55c25936144971f365a745f17b2bb6b4cf4 Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Mon, 14 May 2018 13:04:33 +0800
Subject: [PATCH] net/bnx2x: fix KR2 device check
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[ upstream commit d9b8838ab2e90713827ee8843d836b0fccbaf2f7 ]
In function ‘elink_check_kr2_wa’:
drivers/net/bnx2x/elink.c:12922:28:
error: bitwise comparison always evaluates to false
[-Werror=tautological-compare]
((next_page & 0xe0) == 0x2))));
This was fixed elsewhere in 2014
Fixes: b5bf7719221d ("bnx2x: driver support routines")
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Rasesh Mody <rasesh.mody@cavium.com>
---
drivers/net/bnx2x/elink.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/bnx2x/elink.c b/drivers/net/bnx2x/elink.c
index cceae6f9b..74e1bead3 100644
--- a/drivers/net/bnx2x/elink.c
+++ b/drivers/net/bnx2x/elink.c
@@ -12921,7 +12921,7 @@ static void elink_check_kr2_wa(struct elink_params *params,
*/
not_kr2_device = (((base_page & 0x8000) == 0) ||
(((base_page & 0x8000) &&
- ((next_page & 0xe0) == 0x2))));
+ ((next_page & 0xe0) == 0x20))));
/* In case KR2 is already disabled, check if we need to re-enable it */
if (!(vars->link_attr_sync & LINK_ATTR_SYNC_KR2_ENABLE)) {
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/bnx2x: fix memzone name overrun' has been queued to stable release 18.02.2
2018-05-16 10:13 ` [dpdk-stable] patch 'mempool: fix virtual address population' " luca.boccassi
2018-05-16 10:13 ` [dpdk-stable] patch 'net/bnx2x: do not cast function pointers as a policy' " luca.boccassi
2018-05-16 10:13 ` [dpdk-stable] patch 'net/bnx2x: fix KR2 device check' " luca.boccassi
@ 2018-05-16 10:13 ` luca.boccassi
2 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-16 10:13 UTC (permalink / raw)
To: Andy Green; +Cc: Pablo de Lara, Rasesh Mody, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/18/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 717286d6c13889c527197d2731ab0c480096c728 Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Mon, 14 May 2018 13:04:43 +0800
Subject: [PATCH] net/bnx2x: fix memzone name overrun
[ upstream commit 52f766443423a7728a9dedda13fd8b23d7e50665 ]
Fixes: 540a211084a7 ("bnx2x: driver core")
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Rasesh Mody <rasesh.mody@cavium.com>
---
drivers/net/bnx2x/bnx2x.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index 7a3b7ff5d..80cc4f579 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -170,10 +170,10 @@ bnx2x_dma_alloc(struct bnx2x_softc *sc, size_t size, struct bnx2x_dma *dma,
dma->sc = sc;
if (IS_PF(sc))
- sprintf(mz_name, "bnx2x%d_%s_%" PRIx64, SC_ABS_FUNC(sc), msg,
+ snprintf(mz_name, sizeof(mz_name), "bnx2x%d_%s_%" PRIx64, SC_ABS_FUNC(sc), msg,
rte_get_timer_cycles());
else
- sprintf(mz_name, "bnx2x%d_%s_%" PRIx64, sc->pcie_device, msg,
+ snprintf(mz_name, sizeof(mz_name), "bnx2x%d_%s_%" PRIx64, sc->pcie_device, msg,
rte_get_timer_cycles());
/* Caller must take care that strlen(mz_name) < RTE_MEMZONE_NAMESIZE */
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'bus/dpaa: fix inconsistent struct alignment' has been queued to stable release 18.02.2
2018-05-15 13:53 ` [dpdk-stable] patch 'net/avf: fix Rx interrupt mapping' " luca.boccassi
2018-05-15 13:53 ` [dpdk-stable] patch 'net/bonding: fix slave activation simultaneously' " luca.boccassi
@ 2018-05-15 13:53 ` luca.boccassi
2018-05-15 13:53 ` [dpdk-stable] patch 'net/nfp: fix memcpy out of source range' " luca.boccassi
` (4 subsequent siblings)
6 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:53 UTC (permalink / raw)
To: Andy Green; +Cc: Hemant Agrawal, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From d33b0a1efb0866391b06f43aa0bf6525890f5dc5 Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Mon, 14 May 2018 13:00:12 +0800
Subject: [PATCH] bus/dpaa: fix inconsistent struct alignment
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[ upstream commit dd6f8d712e927397da27f2a3d90a759eeac4f694 ]
The actual descriptor for qm_mr_entry is 64-byte aligned.
But the original code plays a trick, and puts a u8 common
to the three descriptor subtypes in the union afterwards
outside their structure definitions.
Unfortunately since they compose a struct qm_fd with
alignment 8, this trick destroys the ability of the compiler
to understand what has happened, resulting in this kind of
problem:
drivers/bus/dpaa/include/fsl_qman.h:354:3: error:
alignment 1 of ‘struct <anonymous>’ is less than 8 [-Werror=packed-not-aligned]
} __packed dcern;
on gcc 8 / Fedora 28 out of the box.
This patch moves the u8 verb into the structure definitions
composed into the union, so the alignment of the parent struct
containing the alignment 8 object can also be seen to be
alignment 8 by the compiler. Uses of .verb are fixed up to use
.ern.verb (the same offset of +0 inside all the structs in
the union).
The final struct layout should be unchanged.
Fixes: c47ff048b99a ("bus/dpaa: add QMAN driver core routines")
Fixes: f6fadc3e6310 ("bus/dpaa: add QMAN interface driver")
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/bus/dpaa/base/qbman/qman.c | 14 +++++++-------
drivers/bus/dpaa/include/fsl_qman.h | 24 +++++++++++++-----------
2 files changed, 20 insertions(+), 18 deletions(-)
diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c
index 2810fdd26..27d98cc10 100644
--- a/drivers/bus/dpaa/base/qbman/qman.c
+++ b/drivers/bus/dpaa/base/qbman/qman.c
@@ -314,9 +314,9 @@ loop:
if (!msg)
return 0;
}
- if ((msg->verb & QM_MR_VERB_TYPE_MASK) != QM_MR_VERB_FQRNI) {
+ if ((msg->ern.verb & QM_MR_VERB_TYPE_MASK) != QM_MR_VERB_FQRNI) {
/* We aren't draining anything but FQRNIs */
- pr_err("Found verb 0x%x in MR\n", msg->verb);
+ pr_err("Found verb 0x%x in MR\n", msg->ern.verb);
return -1;
}
qm_mr_next(p);
@@ -483,7 +483,7 @@ static inline void qm_mr_pvb_update(struct qm_portal *portal)
/* when accessing 'verb', use __raw_readb() to ensure that compiler
* inlining doesn't try to optimise out "excess reads".
*/
- if ((__raw_readb(&res->verb) & QM_MR_VERB_VBIT) == mr->vbit) {
+ if ((__raw_readb(&res->ern.verb) & QM_MR_VERB_VBIT) == mr->vbit) {
mr->pi = (mr->pi + 1) & (QM_MR_SIZE - 1);
if (!mr->pi)
mr->vbit ^= QM_MR_VERB_VBIT;
@@ -832,7 +832,7 @@ mr_loop:
goto mr_done;
swapped_msg = *msg;
hw_fd_to_cpu(&swapped_msg.ern.fd);
- verb = msg->verb & QM_MR_VERB_TYPE_MASK;
+ verb = msg->ern.verb & QM_MR_VERB_TYPE_MASK;
/* The message is a software ERN iff the 0x20 bit is set */
if (verb & 0x20) {
switch (verb) {
@@ -1666,7 +1666,7 @@ int qman_retire_fq(struct qman_fq *fq, u32 *flags)
*/
struct qm_mr_entry msg;
- msg.verb = QM_MR_VERB_FQRNI;
+ msg.ern.verb = QM_MR_VERB_FQRNI;
msg.fq.fqs = mcr->alterfq.fqs;
msg.fq.fqid = fq->fqid;
#ifdef CONFIG_FSL_QMAN_FQ_LOOKUP
@@ -2643,7 +2643,7 @@ int qman_shutdown_fq(u32 fqid)
qm_mr_pvb_update(low_p);
msg = qm_mr_current(low_p);
while (msg) {
- if ((msg->verb &
+ if ((msg->ern.verb &
QM_MR_VERB_TYPE_MASK)
== QM_MR_VERB_FQRN)
found_fqrn = 1;
@@ -2711,7 +2711,7 @@ int qman_shutdown_fq(u32 fqid)
qm_mr_pvb_update(low_p);
msg = qm_mr_current(low_p);
while (msg) {
- if ((msg->verb & QM_MR_VERB_TYPE_MASK) ==
+ if ((msg->ern.verb & QM_MR_VERB_TYPE_MASK) ==
QM_MR_VERB_FQRL)
orl_empty = 1;
qm_mr_next(low_p);
diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h
index e9793f30d..e4ad7ae48 100644
--- a/drivers/bus/dpaa/include/fsl_qman.h
+++ b/drivers/bus/dpaa/include/fsl_qman.h
@@ -284,20 +284,20 @@ static inline dma_addr_t qm_sg_addr(const struct qm_sg_entry *sg)
} while (0)
/* See 1.5.8.1: "Enqueue Command" */
-struct qm_eqcr_entry {
+struct __rte_aligned(8) qm_eqcr_entry {
u8 __dont_write_directly__verb;
u8 dca;
u16 seqnum;
u32 orp; /* 24-bit */
u32 fqid; /* 24-bit */
u32 tag;
- struct qm_fd fd;
+ struct qm_fd fd; /* this has alignment 8 */
u8 __reserved3[32];
} __packed;
/* "Frame Dequeue Response" */
-struct qm_dqrr_entry {
+struct __rte_aligned(8) qm_dqrr_entry {
u8 verb;
u8 stat;
u16 seqnum; /* 15-bit */
@@ -305,7 +305,7 @@ struct qm_dqrr_entry {
u8 __reserved2[3];
u32 fqid; /* 24-bit */
u32 contextB;
- struct qm_fd fd;
+ struct qm_fd fd; /* this has alignment 8 */
u8 __reserved4[32];
};
@@ -323,18 +323,19 @@ struct qm_dqrr_entry {
/* "ERN Message Response" */
/* "FQ State Change Notification" */
struct qm_mr_entry {
- u8 verb;
union {
struct {
+ u8 verb;
u8 dca;
u16 seqnum;
u8 rc; /* Rejection Code */
u32 orp:24;
u32 fqid; /* 24-bit */
u32 tag;
- struct qm_fd fd;
- } __packed ern;
+ struct qm_fd fd; /* this has alignment 8 */
+ } __packed __rte_aligned(8) ern;
struct {
+ u8 verb;
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
u8 colour:2; /* See QM_MR_DCERN_COLOUR_* */
u8 __reserved1:4;
@@ -349,18 +350,19 @@ struct qm_mr_entry {
u32 __reserved3:24;
u32 fqid; /* 24-bit */
u32 tag;
- struct qm_fd fd;
- } __packed dcern;
+ struct qm_fd fd; /* this has alignment 8 */
+ } __packed __rte_aligned(8) dcern;
struct {
+ u8 verb;
u8 fqs; /* Frame Queue Status */
u8 __reserved1[6];
u32 fqid; /* 24-bit */
u32 contextB;
u8 __reserved2[16];
- } __packed fq; /* FQRN/FQRNI/FQRL/FQPN */
+ } __packed __rte_aligned(8) fq; /* FQRN/FQRNI/FQRL/FQPN */
};
u8 __reserved2[32];
-} __packed;
+} __packed __rte_aligned(8);
#define QM_MR_VERB_VBIT 0x80
/*
* ERNs originating from direct-connect portals ("dcern") use 0x20 as a verb
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/nfp: fix memcpy out of source range' has been queued to stable release 18.02.2
2018-05-15 13:53 ` [dpdk-stable] patch 'net/avf: fix Rx interrupt mapping' " luca.boccassi
2018-05-15 13:53 ` [dpdk-stable] patch 'net/bonding: fix slave activation simultaneously' " luca.boccassi
2018-05-15 13:53 ` [dpdk-stable] patch 'bus/dpaa: fix inconsistent struct alignment' " luca.boccassi
@ 2018-05-15 13:53 ` luca.boccassi
2018-05-15 13:53 ` [dpdk-stable] patch 'net/vdev_netvsc: readlink inputs cannot be aliased' " luca.boccassi
` (3 subsequent siblings)
6 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:53 UTC (permalink / raw)
To: Andy Green; +Cc: Alejandro Lucero, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 71335de3f9d02cef22e2d98eaf707ea2cbabf1f9 Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Mon, 14 May 2018 13:00:32 +0800
Subject: [PATCH] net/nfp: fix memcpy out of source range
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[ upstream commit 1bcb5ecb179cbca81ff3fe15432326c1c3ca9e9b ]
drivers/net/nfp/nfp_net.c:669:2: error:
‘memcpy’ forming offset [5, 6] is out of the bounds [0, 4]
of object ‘tmp’ with type ‘uint32_t’ {aka ‘unsigned int’}
[-Werror=array-bounds]
memcpy(&hw->mac_addr[0], &tmp, sizeof(struct ether_addr));
Fixes: e6decee38209 ("net/nfp: use random MAC address if not configured")
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Tested-by: Alejandro Lucero <alejandro.lucero@netronome.com>
---
drivers/net/nfp/nfp_net.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 912c3e1a6..16adbb29e 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -675,7 +675,7 @@ nfp_net_vf_read_mac(struct nfp_net_hw *hw)
uint32_t tmp;
tmp = rte_be_to_cpu_32(nn_cfg_readl(hw, NFP_NET_CFG_MACADDR));
- memcpy(&hw->mac_addr[0], &tmp, sizeof(struct ether_addr));
+ memcpy(&hw->mac_addr[0], &tmp, 4);
tmp = rte_be_to_cpu_32(nn_cfg_readl(hw, NFP_NET_CFG_MACADDR + 4));
memcpy(&hw->mac_addr[4], &tmp, 2);
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/vdev_netvsc: readlink inputs cannot be aliased' has been queued to stable release 18.02.2
2018-05-15 13:53 ` [dpdk-stable] patch 'net/avf: fix Rx interrupt mapping' " luca.boccassi
` (2 preceding siblings ...)
2018-05-15 13:53 ` [dpdk-stable] patch 'net/nfp: fix memcpy out of source range' " luca.boccassi
@ 2018-05-15 13:53 ` luca.boccassi
2018-05-15 13:53 ` [dpdk-stable] patch 'app/procinfo: fix sprintf overrun' " luca.boccassi
` (2 subsequent siblings)
6 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:53 UTC (permalink / raw)
To: Andy Green; +Cc: Pablo de Lara, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 66662328204491df9f99bc21ad6b6d32cdae1c6e Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Mon, 14 May 2018 13:00:52 +0800
Subject: [PATCH] net/vdev_netvsc: readlink inputs cannot be aliased
[ upstream commit 2e4d2e563f23930b06c24b7bc543bf04321d81f7 ]
drivers/net/vdev_netvsc/vdev_netvsc.c:335:2:error:
passing argument 2 to restrict-qualified parameter aliases with argument 1
ret = readlink(buf, buf, size);
^~~
Fixes: e7dc5d7becc5 ("net/vdev_netvsc: implement core functionality")
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
drivers/net/vdev_netvsc/vdev_netvsc.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/vdev_netvsc/vdev_netvsc.c b/drivers/net/vdev_netvsc/vdev_netvsc.c
index 75aec8980..f746433b5 100644
--- a/drivers/net/vdev_netvsc/vdev_netvsc.c
+++ b/drivers/net/vdev_netvsc/vdev_netvsc.c
@@ -327,12 +327,15 @@ static int
vdev_netvsc_sysfs_readlink(char *buf, size_t size, const char *if_name,
const char *relpath)
{
+ struct vdev_netvsc_ctx *ctx;
+ char in[RTE_MAX(sizeof(ctx->yield), 256u)];
int ret;
- ret = snprintf(buf, size, "/sys/class/net/%s/%s", if_name, relpath);
- if (ret == -1 || (size_t)ret >= size)
+ ret = snprintf(in, sizeof(in) - 1, "/sys/class/net/%s/%s",
+ if_name, relpath);
+ if (ret == -1 || (size_t)ret >= sizeof(in))
return -ENOBUFS;
- ret = readlink(buf, buf, size);
+ ret = readlink(in, buf, size);
if (ret == -1)
return -errno;
if ((size_t)ret >= size - 1)
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'app/procinfo: fix sprintf overrun' has been queued to stable release 18.02.2
2018-05-15 13:53 ` [dpdk-stable] patch 'net/avf: fix Rx interrupt mapping' " luca.boccassi
` (3 preceding siblings ...)
2018-05-15 13:53 ` [dpdk-stable] patch 'net/vdev_netvsc: readlink inputs cannot be aliased' " luca.boccassi
@ 2018-05-15 13:53 ` luca.boccassi
2018-05-15 13:53 ` [dpdk-stable] patch 'app/bbdev: use strcpy for allocated string' " luca.boccassi
2018-05-15 13:53 ` [dpdk-stable] patch 'eal: remove unused path pattern' " luca.boccassi
6 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:53 UTC (permalink / raw)
To: Andy Green; +Cc: Ferruh Yigit, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 11e7cf319cb528aa77bbea28acdf07d1f1bb0cc2 Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Mon, 14 May 2018 13:01:02 +0800
Subject: [PATCH] app/procinfo: fix sprintf overrun
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[ upstream commit 3cef37eb98769935fbc12e01f06d9ac36d430071 ]
app/proc-info/main.c: In function ‘nic_xstats_display’:
app/proc-info/main.c:495:45: error:
‘%s’ directive writing up to 255 bytes into a regioni of size between 165 and 232
[-Werror=format-overflow=]
sprintf(buf, "PUTVAL %s/dpdkstat-port.%u/%s-%s N:%"
^~
PRIu64"\n", host_id, port_id, counter_type,
~~~~~~~~~~~~
app/proc-info/main.c:495:4: note:
‘sprintf’ output between 31 and 435 bytes into a destination of size 256
sprintf(buf, "PUTVAL %s/dpdkstat-port.%u/%s-%s N:%"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PRIu64"\n", host_id, port_id, counter_type,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xstats_names[i].name, values[i]);
Fixes: 2deb6b5246d7 ("app/procinfo: add collectd format and host id")
Signed-off-by: Andy Green <andy@warmcat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
app/proc_info/main.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/app/proc_info/main.c b/app/proc_info/main.c
index 115df9d96..5ccf7ad94 100644
--- a/app/proc_info/main.c
+++ b/app/proc_info/main.c
@@ -488,14 +488,18 @@ nic_xstats_display(uint16_t port_id)
if (enable_collectd_format) {
char counter_type[MAX_STRING_LEN];
char buf[MAX_STRING_LEN];
+ size_t n;
collectd_resolve_cnt_type(counter_type,
sizeof(counter_type),
xstats_names[i].name);
- sprintf(buf, "PUTVAL %s/dpdkstat-port.%u/%s-%s N:%"
+ n = snprintf(buf, MAX_STRING_LEN,
+ "PUTVAL %s/dpdkstat-port.%u/%s-%s N:%"
PRIu64"\n", host_id, port_id, counter_type,
xstats_names[i].name, values[i]);
- ret = write(stdout_fd, buf, strlen(buf));
+ if (n > sizeof(buf) - 1)
+ n = sizeof(buf) - 1;
+ ret = write(stdout_fd, buf, n);
if (ret < 0)
goto err;
} else {
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'app/bbdev: use strcpy for allocated string' has been queued to stable release 18.02.2
2018-05-15 13:53 ` [dpdk-stable] patch 'net/avf: fix Rx interrupt mapping' " luca.boccassi
` (4 preceding siblings ...)
2018-05-15 13:53 ` [dpdk-stable] patch 'app/procinfo: fix sprintf overrun' " luca.boccassi
@ 2018-05-15 13:53 ` luca.boccassi
2018-05-15 13:53 ` [dpdk-stable] patch 'eal: remove unused path pattern' " luca.boccassi
6 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:53 UTC (permalink / raw)
To: Andy Green; +Cc: Ferruh Yigit, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From ac04624478cb9bbb1e7a9c659f9b22fae74a73e2 Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
Date: Mon, 14 May 2018 13:01:07 +0800
Subject: [PATCH] app/bbdev: use strcpy for allocated string
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[ upstream commit f2790f9cf8486b01576c6ddfd60d2ce434a2b3e4 ]
app/test-bbdev/test_bbdev_vector.c:895:3:
error: ‘strncpy’ output truncated before terminating nul copying as
many bytes from a string as its length [-Werror=stringop-truncation]
strncpy(entry, line, strlen(line));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/test-bbdev/test_bbdev_vector.c:917:5:
error: ‘strncat’ output truncated before terminating nul copying as
many bytes from a string as its length [-Werror=stringop-truncation]
strncat(entry, line, strlen(line));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fixes: f714a18885a6 ("app/testbbdev: add test application for bbdev")
Signed-off-by: Andy Green <andy@warmcat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
app/test-bbdev/test_bbdev_vector.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/test-bbdev/test_bbdev_vector.c b/app/test-bbdev/test_bbdev_vector.c
index addef0572..5b694dd90 100644
--- a/app/test-bbdev/test_bbdev_vector.c
+++ b/app/test-bbdev/test_bbdev_vector.c
@@ -889,8 +889,7 @@ test_bbdev_vector_read(const char *filename,
goto exit;
}
- memset(entry, 0, strlen(line) + 1);
- strncpy(entry, line, strlen(line));
+ strcpy(entry, line);
/* check if entry ends with , or = */
if (entry[strlen(entry) - 1] == ','
@@ -912,7 +911,8 @@ test_bbdev_vector_read(const char *filename,
}
entry = entry_extended;
- strncat(entry, line, strlen(line));
+ /* entry has been allocated accordingly */
+ strcpy(&entry[strlen(entry)], line);
if (entry[strlen(entry) - 1] != ',')
break;
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'eal: remove unused path pattern' has been queued to stable release 18.02.2
2018-05-15 13:53 ` [dpdk-stable] patch 'net/avf: fix Rx interrupt mapping' " luca.boccassi
` (5 preceding siblings ...)
2018-05-15 13:53 ` [dpdk-stable] patch 'app/bbdev: use strcpy for allocated string' " luca.boccassi
@ 2018-05-15 13:53 ` luca.boccassi
6 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-15 13:53 UTC (permalink / raw)
To: Anatoly Burakov; +Cc: David Marchand, dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From a6c52125103d465874e8e882a43412c70296546f Mon Sep 17 00:00:00 2001
From: Anatoly Burakov <anatoly.burakov@intel.com>
Date: Mon, 14 May 2018 17:27:39 +0100
Subject: [PATCH] eal: remove unused path pattern
[ upstream commit dcbfbe3c80f2e0b7c65715f6d93498fcdda097d6 ]
The define was a leftover from IVSHMEM library.
Fixes: c711ccb30987 ("ivshmem: remove library and its EAL integration")
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: David Marchand <david.marchand@6wind.com>
---
lib/librte_eal/common/eal_filesystem.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/lib/librte_eal/common/eal_filesystem.h b/lib/librte_eal/common/eal_filesystem.h
index 4708dd549..382289838 100644
--- a/lib/librte_eal/common/eal_filesystem.h
+++ b/lib/librte_eal/common/eal_filesystem.h
@@ -74,8 +74,6 @@ eal_hugepage_info_path(void)
/** String format for hugepage map files. */
#define HUGEFILE_FMT "%s/%smap_%d"
-#define TEMP_HUGEFILE_FMT "%s/%smap_temp_%d"
-
static inline const char *
eal_get_hugefile_path(char *buffer, size_t buflen, const char *hugedir, int f_id)
{
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/mlx4: fix default RSS hash fields' has been queued to stable release 18.02.2
2018-05-03 11:06 ` [dpdk-stable] patch 'net/mlx5: fix flow director rule deletion crash' " luca.boccassi
2018-05-03 11:06 ` [dpdk-stable] patch 'net/mlx4: fix Rx resource leak in case of error' " luca.boccassi
@ 2018-05-03 11:06 ` luca.boccassi
2018-05-03 11:06 ` [dpdk-stable] patch 'net/mlx4: fix inner RSS support for broken kernels' " luca.boccassi
2018-05-03 11:06 ` [dpdk-stable] patch 'net/dpaa: fix RSS hash support' " luca.boccassi
3 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-03 11:06 UTC (permalink / raw)
To: Adrien Mazarguil; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/04/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 4da4da9d55e86db126aaee76369a58289dcb2bbd Mon Sep 17 00:00:00 2001
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Date: Thu, 26 Apr 2018 18:26:15 +0200
Subject: [PATCH] net/mlx4: fix default RSS hash fields
[ upstream commit 1d173da83ef2176b7ef107b76a4c5b80d47e1d00 ]
Using special types value -1 with mlx4_conv_rss_types() is supposed to
return a supported set of Verbs RSS hash fields, that is, priv->hw_rss_sup
unmodified.
Due to the way this function is written and because it is also used to
initially populate priv->hw_rss_sup however, this special value works
properly only once and fails with ENOTSUP errors afterward.
This problem can be seen when re-creating default flows (e.g. by entering
and leaving isolated mode).
Fixes: 024e87bef40b ("net/mlx4: restore UDP RSS by probing capabilities")
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
drivers/net/mlx4/mlx4.c | 15 +++++++--------
drivers/net/mlx4/mlx4_flow.c | 13 ++++---------
2 files changed, 11 insertions(+), 17 deletions(-)
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index c1f825e75..3a95e1d5e 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -569,14 +569,13 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
if (!priv->hw_rss_sup) {
WARN("no RSS capabilities reported; disabling support"
" for UDP RSS and inner VXLAN RSS");
- /* Fake support for all possible RSS hash fields. */
- priv->hw_rss_sup = ~UINT64_C(0);
- priv->hw_rss_sup = mlx4_conv_rss_hf(priv, -1);
- /* Filter out known unsupported fields. */
- priv->hw_rss_sup &=
- ~(uint64_t)(IBV_RX_HASH_SRC_PORT_UDP |
- IBV_RX_HASH_DST_PORT_UDP |
- IBV_RX_HASH_INNER);
+ priv->hw_rss_sup =
+ IBV_RX_HASH_SRC_IPV4 |
+ IBV_RX_HASH_DST_IPV4 |
+ IBV_RX_HASH_SRC_IPV6 |
+ IBV_RX_HASH_DST_IPV6 |
+ IBV_RX_HASH_SRC_PORT_TCP |
+ IBV_RX_HASH_DST_PORT_TCP;
}
DEBUG("supported RSS hash fields mask: %016" PRIx64,
priv->hw_rss_sup);
diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c
index 4d26df326..d7a02e90c 100644
--- a/drivers/net/mlx4/mlx4_flow.c
+++ b/drivers/net/mlx4/mlx4_flow.c
@@ -125,20 +125,15 @@ mlx4_conv_rss_hf(struct priv *priv, uint64_t rss_hf)
uint64_t conv = 0;
unsigned int i;
+ if (rss_hf == (uint64_t)-1)
+ return priv->hw_rss_sup;
for (i = 0; i != RTE_DIM(in); ++i)
if (rss_hf & in[i]) {
seen |= rss_hf & in[i];
conv |= out[i];
}
- if ((conv & priv->hw_rss_sup) == conv) {
- if (rss_hf == (uint64_t)-1) {
- /* Include inner RSS by default if supported. */
- conv |= priv->hw_rss_sup & IBV_RX_HASH_INNER;
- return conv;
- }
- if (!(rss_hf & ~seen))
- return conv;
- }
+ if ((conv & priv->hw_rss_sup) == conv && !(rss_hf & ~seen))
+ return conv;
rte_errno = ENOTSUP;
return (uint64_t)-1;
}
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/mlx4: fix inner RSS support for broken kernels' has been queued to stable release 18.02.2
2018-05-03 11:06 ` [dpdk-stable] patch 'net/mlx5: fix flow director rule deletion crash' " luca.boccassi
2018-05-03 11:06 ` [dpdk-stable] patch 'net/mlx4: fix Rx resource leak in case of error' " luca.boccassi
2018-05-03 11:06 ` [dpdk-stable] patch 'net/mlx4: fix default RSS hash fields' " luca.boccassi
@ 2018-05-03 11:06 ` luca.boccassi
2018-05-03 11:06 ` [dpdk-stable] patch 'net/dpaa: fix RSS hash support' " luca.boccassi
3 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-03 11:06 UTC (permalink / raw)
To: Adrien Mazarguil; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/04/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From bbc84c3cb9d8237ea10b9fc9a3e79dda08eb4786 Mon Sep 17 00:00:00 2001
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Date: Thu, 26 Apr 2018 18:26:16 +0200
Subject: [PATCH] net/mlx4: fix inner RSS support for broken kernels
[ upstream commit 828a4ce3c941b2ab3cf6bb65d30339cf8bb2bdf6 ]
Linux 4.15 and 4.16 may report inner RSS as a supported capability of the
device, however it can't be used due to missing code in the kernel.
This triggers an error when creating the default hash QP and prevents this
PMD from starting up without a prior call to rte_flow_isolate().
Fixes: 55e8991e3199 ("net/mlx4: restore inner VXLAN RSS support")
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
drivers/net/mlx4/mlx4.c | 107 ++++++++++++++++++++++++++++++++++++++++++------
1 file changed, 95 insertions(+), 12 deletions(-)
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 3a95e1d5e..bc12b6030 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -387,6 +387,99 @@ free_kvlist:
return ret;
}
+/**
+ * Interpret RSS capabilities reported by device.
+ *
+ * This function returns the set of usable Verbs RSS hash fields, kernel
+ * quirks taken into account.
+ *
+ * @param ctx
+ * Verbs context.
+ * @param pd
+ * Verbs protection domain.
+ * @param device_attr_ex
+ * Extended device attributes to interpret.
+ *
+ * @return
+ * Usable RSS hash fields mask in Verbs format.
+ */
+static uint64_t
+mlx4_hw_rss_sup(struct ibv_context *ctx, struct ibv_pd *pd,
+ struct ibv_device_attr_ex *device_attr_ex)
+{
+ uint64_t hw_rss_sup = device_attr_ex->rss_caps.rx_hash_fields_mask;
+ struct ibv_cq *cq = NULL;
+ struct ibv_wq *wq = NULL;
+ struct ibv_rwq_ind_table *ind = NULL;
+ struct ibv_qp *qp = NULL;
+
+ if (!hw_rss_sup) {
+ WARN("no RSS capabilities reported; disabling support for UDP"
+ " RSS and inner VXLAN RSS");
+ return IBV_RX_HASH_SRC_IPV4 | IBV_RX_HASH_DST_IPV4 |
+ IBV_RX_HASH_SRC_IPV6 | IBV_RX_HASH_DST_IPV6 |
+ IBV_RX_HASH_SRC_PORT_TCP | IBV_RX_HASH_DST_PORT_TCP;
+ }
+ if (!(hw_rss_sup & IBV_RX_HASH_INNER))
+ return hw_rss_sup;
+ /*
+ * Although reported as supported, missing code in some Linux
+ * versions (v4.15, v4.16) prevents the creation of hash QPs with
+ * inner capability.
+ *
+ * There is no choice but to attempt to instantiate a temporary RSS
+ * context in order to confirm its support.
+ */
+ cq = mlx4_glue->create_cq(ctx, 1, NULL, NULL, 0);
+ wq = cq ? mlx4_glue->create_wq
+ (ctx,
+ &(struct ibv_wq_init_attr){
+ .wq_type = IBV_WQT_RQ,
+ .max_wr = 1,
+ .max_sge = 1,
+ .pd = pd,
+ .cq = cq,
+ }) : NULL;
+ ind = wq ? mlx4_glue->create_rwq_ind_table
+ (ctx,
+ &(struct ibv_rwq_ind_table_init_attr){
+ .log_ind_tbl_size = 0,
+ .ind_tbl = &wq,
+ .comp_mask = 0,
+ }) : NULL;
+ qp = ind ? mlx4_glue->create_qp_ex
+ (ctx,
+ &(struct ibv_qp_init_attr_ex){
+ .comp_mask =
+ (IBV_QP_INIT_ATTR_PD |
+ IBV_QP_INIT_ATTR_RX_HASH |
+ IBV_QP_INIT_ATTR_IND_TABLE),
+ .qp_type = IBV_QPT_RAW_PACKET,
+ .pd = pd,
+ .rwq_ind_tbl = ind,
+ .rx_hash_conf = {
+ .rx_hash_function = IBV_RX_HASH_FUNC_TOEPLITZ,
+ .rx_hash_key_len = MLX4_RSS_HASH_KEY_SIZE,
+ .rx_hash_key = mlx4_rss_hash_key_default,
+ .rx_hash_fields_mask = hw_rss_sup,
+ },
+ }) : NULL;
+ if (!qp) {
+ WARN("disabling unusable inner RSS capability due to kernel"
+ " quirk");
+ hw_rss_sup &= ~IBV_RX_HASH_INNER;
+ } else {
+ claim_zero(mlx4_glue->destroy_qp(qp));
+ }
+ if (ind)
+ claim_zero(mlx4_glue->destroy_rwq_ind_table(ind));
+ if (wq)
+ claim_zero(mlx4_glue->destroy_wq(wq));
+ if (cq)
+ claim_zero(mlx4_glue->destroy_cq(cq));
+ return hw_rss_sup;
+}
+
static struct rte_pci_driver mlx4_driver;
/**
@@ -565,18 +658,8 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
PCI_DEVICE_ID_MELLANOX_CONNECTX3PRO);
DEBUG("L2 tunnel checksum offloads are %ssupported",
(priv->hw_csum_l2tun ? "" : "not "));
- priv->hw_rss_sup = device_attr_ex.rss_caps.rx_hash_fields_mask;
- if (!priv->hw_rss_sup) {
- WARN("no RSS capabilities reported; disabling support"
- " for UDP RSS and inner VXLAN RSS");
- priv->hw_rss_sup =
- IBV_RX_HASH_SRC_IPV4 |
- IBV_RX_HASH_DST_IPV4 |
- IBV_RX_HASH_SRC_IPV6 |
- IBV_RX_HASH_DST_IPV6 |
- IBV_RX_HASH_SRC_PORT_TCP |
- IBV_RX_HASH_DST_PORT_TCP;
- }
+ priv->hw_rss_sup = mlx4_hw_rss_sup(priv->ctx, priv->pd,
+ &device_attr_ex);
DEBUG("supported RSS hash fields mask: %016" PRIx64,
priv->hw_rss_sup);
/* Configure the first MAC address by default. */
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/dpaa: fix RSS hash support' has been queued to stable release 18.02.2
2018-05-03 11:06 ` [dpdk-stable] patch 'net/mlx5: fix flow director rule deletion crash' " luca.boccassi
` (2 preceding siblings ...)
2018-05-03 11:06 ` [dpdk-stable] patch 'net/mlx4: fix inner RSS support for broken kernels' " luca.boccassi
@ 2018-05-03 11:06 ` luca.boccassi
3 siblings, 0 replies; 382+ messages in thread
From: luca.boccassi @ 2018-05-03 11:06 UTC (permalink / raw)
To: Hemant Agrawal; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/04/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 072091c90593612c24d29a24ca24238ec7896df2 Mon Sep 17 00:00:00 2001
From: Hemant Agrawal <hemant.agrawal@nxp.com>
Date: Tue, 1 May 2018 16:14:27 +0530
Subject: [PATCH] net/dpaa: fix RSS hash support
[ upstream commit 1475ad99a0476819b6168f2f1aa361187fc3800c ]
Fixes: 4fa5e0bbc573 ("net/dpaa: support hashed RSS")
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/net/dpaa/dpaa_ethdev.h | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h
index c051ae32a..df2b38444 100644
--- a/drivers/net/dpaa/dpaa_ethdev.h
+++ b/drivers/net/dpaa/dpaa_ethdev.h
@@ -74,14 +74,10 @@
#define DPAA_DEBUG_FQ_TX_ERROR 1
#define DPAA_RSS_OFFLOAD_ALL ( \
- ETH_RSS_FRAG_IPV4 | \
- ETH_RSS_NONFRAG_IPV4_TCP | \
- ETH_RSS_NONFRAG_IPV4_UDP | \
- ETH_RSS_NONFRAG_IPV4_SCTP | \
- ETH_RSS_FRAG_IPV6 | \
- ETH_RSS_NONFRAG_IPV6_TCP | \
- ETH_RSS_NONFRAG_IPV6_UDP | \
- ETH_RSS_NONFRAG_IPV6_SCTP)
+ ETH_RSS_IP | \
+ ETH_RSS_UDP | \
+ ETH_RSS_TCP | \
+ ETH_RSS_SCTP)
#define DPAA_TX_CKSUM_OFFLOAD_MASK ( \
PKT_TX_IP_CKSUM | \
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* [dpdk-stable] patch 'net/sfc/base: add equal stride super-buffer prefix layout' has been queued to stable release 18.02.2
2018-04-30 14:53 ` [dpdk-stable] patch 'bus/pci: fix find device implementation' " luca.boccassi
` (40 preceding siblings ...)
2018-04-30 14:54 ` [dpdk-stable] patch 'net/nfp: fix double space in init log' " luca.boccassi
@ 2018-04-30 14:54 ` luca.boccassi
2018-05-01 5:37 ` Andrew Rybchenko
41 siblings, 1 reply; 382+ messages in thread
From: luca.boccassi @ 2018-04-30 14:54 UTC (permalink / raw)
To: Andrew Rybchenko; +Cc: dpdk stable
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From e1295d198da4c5977f6b19757173feb9c1468070 Mon Sep 17 00:00:00 2001
From: Andrew Rybchenko <arybchenko@solarflare.com>
Date: Thu, 19 Apr 2018 12:36:48 +0100
Subject: [PATCH] net/sfc/base: add equal stride super-buffer prefix layout
[ upstream commit 9a5d5f180586d8887dc68c44b02cd8afb4b5173d ]
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
drivers/net/sfc/base/efx_regs_ef10.h | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/net/sfc/base/efx_regs_ef10.h b/drivers/net/sfc/base/efx_regs_ef10.h
index 5f978305e..217f89c16 100644
--- a/drivers/net/sfc/base/efx_regs_ef10.h
+++ b/drivers/net/sfc/base/efx_regs_ef10.h
@@ -533,6 +533,21 @@ extern "C" {
#define ES_DZ_PS_RX_PREFIX_ORIG_LEN_LBN 48
#define ES_DZ_PS_RX_PREFIX_ORIG_LEN_WIDTH 16
+/* Equal stride super-buffer RX packet prefix (see SF-119419-TC) */
+#define ES_EZ_ESSB_RX_PREFIX_LEN 8
+#define ES_EZ_ESSB_RX_PREFIX_DATA_LEN_LBN 0
+#define ES_EZ_ESSB_RX_PREFIX_DATA_LEN_WIDTH 16
+#define ES_EZ_ESSB_RX_PREFIX_MARK_LBN 16
+#define ES_EZ_ESSB_RX_PREFIX_MARK_WIDTH 8
+#define ES_EZ_ESSB_RX_PREFIX_HASH_VALID_LBN 28
+#define ES_EZ_ESSB_RX_PREFIX_HASH_VALID_WIDTH 1
+#define ES_EZ_ESSB_RX_PREFIX_MARK_VALID_LBN 29
+#define ES_EZ_ESSB_RX_PREFIX_MARK_VALID_WIDTH 1
+#define ES_EZ_ESSB_RX_PREFIX_MATCH_FLAG_LBN 30
+#define ES_EZ_ESSB_RX_PREFIX_MATCH_FLAG_WIDTH 1
+#define ES_EZ_ESSB_RX_PREFIX_HASH_LBN 32
+#define ES_EZ_ESSB_RX_PREFIX_HASH_WIDTH 32
+
/*
* An extra flag for the packed stream mode,
* signalling the start of a new buffer
--
2.14.2
^ permalink raw reply [flat|nested] 382+ messages in thread
* Re: [dpdk-stable] patch 'net/sfc/base: add equal stride super-buffer prefix layout' has been queued to stable release 18.02.2
2018-04-30 14:54 ` [dpdk-stable] patch 'net/sfc/base: add equal stride super-buffer prefix layout' " luca.boccassi
@ 2018-05-01 5:37 ` Andrew Rybchenko
2018-05-01 10:12 ` Luca Boccassi
0 siblings, 1 reply; 382+ messages in thread
From: Andrew Rybchenko @ 2018-05-01 5:37 UTC (permalink / raw)
To: luca.boccassi; +Cc: dpdk stable
Hi Luca,
I don't understand why below patch is included to the stable release queue.
It should not be. The feature is first added to the 18.05 release.
Andrew.
On 04/30/2018 05:54 PM, luca.boccassi@gmail.com wrote:
> Hi,
>
> FYI, your patch has been queued to stable release 18.02.2
>
> Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
> It will be pushed if I get no objections before 05/02/18. So please
> shout if anyone has objections.
>
> Thanks.
>
> Luca Boccassi
>
> ---
> From e1295d198da4c5977f6b19757173feb9c1468070 Mon Sep 17 00:00:00 2001
> From: Andrew Rybchenko <arybchenko@solarflare.com>
> Date: Thu, 19 Apr 2018 12:36:48 +0100
> Subject: [PATCH] net/sfc/base: add equal stride super-buffer prefix layout
>
> [ upstream commit 9a5d5f180586d8887dc68c44b02cd8afb4b5173d ]
>
> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
> ---
> drivers/net/sfc/base/efx_regs_ef10.h | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/drivers/net/sfc/base/efx_regs_ef10.h b/drivers/net/sfc/base/efx_regs_ef10.h
> index 5f978305e..217f89c16 100644
> --- a/drivers/net/sfc/base/efx_regs_ef10.h
> +++ b/drivers/net/sfc/base/efx_regs_ef10.h
> @@ -533,6 +533,21 @@ extern "C" {
> #define ES_DZ_PS_RX_PREFIX_ORIG_LEN_LBN 48
> #define ES_DZ_PS_RX_PREFIX_ORIG_LEN_WIDTH 16
>
> +/* Equal stride super-buffer RX packet prefix (see SF-119419-TC) */
> +#define ES_EZ_ESSB_RX_PREFIX_LEN 8
> +#define ES_EZ_ESSB_RX_PREFIX_DATA_LEN_LBN 0
> +#define ES_EZ_ESSB_RX_PREFIX_DATA_LEN_WIDTH 16
> +#define ES_EZ_ESSB_RX_PREFIX_MARK_LBN 16
> +#define ES_EZ_ESSB_RX_PREFIX_MARK_WIDTH 8
> +#define ES_EZ_ESSB_RX_PREFIX_HASH_VALID_LBN 28
> +#define ES_EZ_ESSB_RX_PREFIX_HASH_VALID_WIDTH 1
> +#define ES_EZ_ESSB_RX_PREFIX_MARK_VALID_LBN 29
> +#define ES_EZ_ESSB_RX_PREFIX_MARK_VALID_WIDTH 1
> +#define ES_EZ_ESSB_RX_PREFIX_MATCH_FLAG_LBN 30
> +#define ES_EZ_ESSB_RX_PREFIX_MATCH_FLAG_WIDTH 1
> +#define ES_EZ_ESSB_RX_PREFIX_HASH_LBN 32
> +#define ES_EZ_ESSB_RX_PREFIX_HASH_WIDTH 32
> +
> /*
> * An extra flag for the packed stream mode,
> * signalling the start of a new buffer
^ permalink raw reply [flat|nested] 382+ messages in thread
* Re: [dpdk-stable] patch 'net/sfc/base: add equal stride super-buffer prefix layout' has been queued to stable release 18.02.2
2018-05-01 5:37 ` Andrew Rybchenko
@ 2018-05-01 10:12 ` Luca Boccassi
0 siblings, 0 replies; 382+ messages in thread
From: Luca Boccassi @ 2018-05-01 10:12 UTC (permalink / raw)
To: Andrew Rybchenko; +Cc: dpdk stable
On Tue, 2018-05-01 at 08:37 +0300, Andrew Rybchenko wrote:
> Hi Luca,
>
> I don't understand why below patch is included to the stable release
> queue.
> It should not be. The feature is first added to the 18.05 release.
>
> Andrew.
Hi,
Yes that is strange - it wasn't cc'ed to stable nor contains "Fixes"
line, so I'm not sure why it was picked up by the script. I'll have a
look, in the meanwhile I've removed it.
> On 04/30/2018 05:54 PM, luca.boccassi@gmail.com wrote:
> > Hi,
> >
> > FYI, your patch has been queued to stable release 18.02.2
> >
> > Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable
> > yet.
> > It will be pushed if I get no objections before 05/02/18. So please
> > shout if anyone has objections.
> >
> > Thanks.
> >
> > Luca Boccassi
> >
> > ---
> > From e1295d198da4c5977f6b19757173feb9c1468070 Mon Sep 17 00:00:00
> > 2001
> > From: Andrew Rybchenko <arybchenko@solarflare.com>
> > Date: Thu, 19 Apr 2018 12:36:48 +0100
> > Subject: [PATCH] net/sfc/base: add equal stride super-buffer prefix
> > layout
> >
> > [ upstream commit 9a5d5f180586d8887dc68c44b02cd8afb4b5173d ]
> >
> > Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
> > ---
> > drivers/net/sfc/base/efx_regs_ef10.h | 15 +++++++++++++++
> > 1 file changed, 15 insertions(+)
> >
> > diff --git a/drivers/net/sfc/base/efx_regs_ef10.h
> > b/drivers/net/sfc/base/efx_regs_ef10.h
> > index 5f978305e..217f89c16 100644
> > --- a/drivers/net/sfc/base/efx_regs_ef10.h
> > +++ b/drivers/net/sfc/base/efx_regs_ef10.h
> > @@ -533,6 +533,21 @@ extern "C" {
> > #define ES_DZ_PS_RX_PREFIX_ORIG_LEN_LBN 48
> > #define ES_DZ_PS_RX_PREFIX_ORIG_LEN_WIDTH 16
> >
> > +/* Equal stride super-buffer RX packet prefix (see SF-119419-TC)
> > */
> > +#define ES_EZ_ESSB_RX_PREFIX_LEN 8
> > +#define ES_EZ_ESSB_RX_PREFIX_DATA_LEN_LBN 0
> > +#define ES_EZ_ESSB_RX_PREFIX_DATA_LEN_WIDTH 16
> > +#define ES_EZ_ESSB_RX_PREFIX_MARK_LBN 16
> > +#define ES_EZ_ESSB_RX_PREFIX_MARK_WIDTH 8
> > +#define ES_EZ_ESSB_RX_PREFIX_HASH_VALID_LBN 28
> > +#define ES_EZ_ESSB_RX_PREFIX_HASH_VALID_WIDTH 1
> > +#define ES_EZ_ESSB_RX_PREFIX_MARK_VALID_LBN 29
> > +#define ES_EZ_ESSB_RX_PREFIX_MARK_VALID_WIDTH 1
> > +#define ES_EZ_ESSB_RX_PREFIX_MATCH_FLAG_LBN 30
> > +#define ES_EZ_ESSB_RX_PREFIX_MATCH_FLAG_WIDTH 1
> > +#define ES_EZ_ESSB_RX_PREFIX_HASH_LBN 32
> > +#define ES_EZ_ESSB_RX_PREFIX_HASH_WIDTH 32
> > +
> > /*
> > * An extra flag for the packed stream mode,
> > * signalling the start of a new buffer
>
>
--
Kind regards,
Luca Boccassi
^ permalink raw reply [flat|nested] 382+ messages in thread