* [dpdk-dev] [PATCH] examples/l2fwd-keepalive: fix packet drops limited mbufs
@ 2020-03-11 12:04 Louise Kilheeney
2020-03-13 3:07 ` [dpdk-dev] [dpdk-stable] " Jiang, MaoX
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Louise Kilheeney @ 2020-03-11 12:04 UTC (permalink / raw)
To: dev; +Cc: Louise Kilheeney, stable
MBUF pool of size 8192 was causing packet loss when using four ports. To
fix this issue this patch specifies the number of MBUF's per port
instead of having one set MBUF pool size, this way it will adapt to any
number of ports.
Fixes: e64833f2273a ("examples/l2fwd-keepalive: add sample application")
Cc: stable@dpdk.org
Signed-off-by: Louise Kilheeney <louise.kilheeney@intel.com>
---
examples/l2fwd-keepalive/main.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
index b36834974..0f0010d51 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -44,7 +44,7 @@
#define RTE_LOGTYPE_L2FWD RTE_LOGTYPE_USER1
-#define NB_MBUF 8192
+#define NB_MBUF_PER_PORT 3000
#define MAX_PKT_BURST 32
#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */
@@ -561,16 +561,19 @@ main(int argc, char **argv)
if (ret < 0)
rte_exit(EXIT_FAILURE, "Invalid L2FWD arguments\n");
- /* create the mbuf pool */
- l2fwd_pktmbuf_pool = rte_pktmbuf_pool_create("mbuf_pool", NB_MBUF, 32,
- 0, RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id());
- if (l2fwd_pktmbuf_pool == NULL)
- rte_exit(EXIT_FAILURE, "Cannot init mbuf pool\n");
-
nb_ports = rte_eth_dev_count_avail();
if (nb_ports == 0)
rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
+ /* create the mbuf pool */
+ unsigned int total_nb_mbufs = NB_MBUF_PER_PORT * nb_ports;
+
+ l2fwd_pktmbuf_pool = rte_pktmbuf_pool_create("mbuf_pool",
+ total_nb_mbufs, 32, 0, RTE_MBUF_DEFAULT_BUF_SIZE,
+ rte_socket_id());
+ if (l2fwd_pktmbuf_pool == NULL)
+ rte_exit(EXIT_FAILURE, "Cannot init mbuf pool\n");
+
/* reset l2fwd_dst_ports */
for (portid = 0; portid < RTE_MAX_ETHPORTS; portid++)
l2fwd_dst_ports[portid] = 0;
--
2.17.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [PATCH] examples/l2fwd-keepalive: fix packet drops limited mbufs
2020-03-11 12:04 [dpdk-dev] [PATCH] examples/l2fwd-keepalive: fix packet drops limited mbufs Louise Kilheeney
@ 2020-03-13 3:07 ` Jiang, MaoX
2020-04-26 21:13 ` Thomas Monjalon
2020-04-26 21:12 ` Thomas Monjalon
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Jiang, MaoX @ 2020-03-13 3:07 UTC (permalink / raw)
To: Kilheeney, Louise, dev; +Cc: Kilheeney, Louise, stable
Tested-by:xix.zhang@intel.com
Best regards,
Jiang Mao
> -----Original Message-----
> From: stable [mailto:stable-bounces@dpdk.org] On Behalf Of Louise
> Kilheeney
> Sent: Wednesday, March 11, 2020 8:05 PM
> To: dev@dpdk.org
> Cc: Kilheeney, Louise <louise.kilheeney@intel.com>; stable@dpdk.org
> Subject: [dpdk-stable] [PATCH] examples/l2fwd-keepalive: fix packet drops
> limited mbufs
>
> MBUF pool of size 8192 was causing packet loss when using four ports. To fix
> this issue this patch specifies the number of MBUF's per port instead of
> having one set MBUF pool size, this way it will adapt to any number of ports.
>
> Fixes: e64833f2273a ("examples/l2fwd-keepalive: add sample application")
>
> Cc: stable@dpdk.org
>
> Signed-off-by: Louise Kilheeney <louise.kilheeney@intel.com>
> ---
> examples/l2fwd-keepalive/main.c | 17 ++++++++++-------
> 1 file changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-
> keepalive/main.c index b36834974..0f0010d51 100644
> --- a/examples/l2fwd-keepalive/main.c
> +++ b/examples/l2fwd-keepalive/main.c
> @@ -44,7 +44,7 @@
>
> #define RTE_LOGTYPE_L2FWD RTE_LOGTYPE_USER1
>
> -#define NB_MBUF 8192
> +#define NB_MBUF_PER_PORT 3000
>
> #define MAX_PKT_BURST 32
> #define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ @@ -561,16
> +561,19 @@ main(int argc, char **argv)
> if (ret < 0)
> rte_exit(EXIT_FAILURE, "Invalid L2FWD arguments\n");
>
> - /* create the mbuf pool */
> - l2fwd_pktmbuf_pool = rte_pktmbuf_pool_create("mbuf_pool",
> NB_MBUF, 32,
> - 0, RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id());
> - if (l2fwd_pktmbuf_pool == NULL)
> - rte_exit(EXIT_FAILURE, "Cannot init mbuf pool\n");
> -
> nb_ports = rte_eth_dev_count_avail();
> if (nb_ports == 0)
> rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
>
> + /* create the mbuf pool */
> + unsigned int total_nb_mbufs = NB_MBUF_PER_PORT * nb_ports;
> +
> + l2fwd_pktmbuf_pool = rte_pktmbuf_pool_create("mbuf_pool",
> + total_nb_mbufs, 32, 0,
> RTE_MBUF_DEFAULT_BUF_SIZE,
> + rte_socket_id());
> + if (l2fwd_pktmbuf_pool == NULL)
> + rte_exit(EXIT_FAILURE, "Cannot init mbuf pool\n");
> +
> /* reset l2fwd_dst_ports */
> for (portid = 0; portid < RTE_MAX_ETHPORTS; portid++)
> l2fwd_dst_ports[portid] = 0;
> --
> 2.17.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [PATCH] examples/l2fwd-keepalive: fix packet drops limited mbufs
2020-03-11 12:04 [dpdk-dev] [PATCH] examples/l2fwd-keepalive: fix packet drops limited mbufs Louise Kilheeney
2020-03-13 3:07 ` [dpdk-dev] [dpdk-stable] " Jiang, MaoX
@ 2020-04-26 21:12 ` Thomas Monjalon
2020-04-27 1:38 ` Jiang, MaoX
2020-04-27 14:57 ` [dpdk-dev] [PATCH v2] " Louise Kilheeney
3 siblings, 0 replies; 8+ messages in thread
From: Thomas Monjalon @ 2020-04-26 21:12 UTC (permalink / raw)
To: Louise Kilheeney; +Cc: dev, stable
11/03/2020 13:04, Louise Kilheeney:
> MBUF pool of size 8192 was causing packet loss when using four ports. To
> fix this issue this patch specifies the number of MBUF's per port
> instead of having one set MBUF pool size, this way it will adapt to any
> number of ports.
>
> Fixes: e64833f2273a ("examples/l2fwd-keepalive: add sample application")
>
> Cc: stable@dpdk.org
No blank line between Fixes and Cc lines please.
>
> Signed-off-by: Louise Kilheeney <louise.kilheeney@intel.com>
> ---
> examples/l2fwd-keepalive/main.c | 17 ++++++++++-------
> 1 file changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
> index b36834974..0f0010d51 100644
> --- a/examples/l2fwd-keepalive/main.c
> +++ b/examples/l2fwd-keepalive/main.c
> nb_ports = rte_eth_dev_count_avail();
> if (nb_ports == 0)
> rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
>
> + /* create the mbuf pool */
> + unsigned int total_nb_mbufs = NB_MBUF_PER_PORT * nb_ports;
Please avoid declaring a variable in the middle of a function.
This code style is too much modern for DPDK ;-)
It could break on a random compiler.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [PATCH] examples/l2fwd-keepalive: fix packet drops limited mbufs
2020-03-13 3:07 ` [dpdk-dev] [dpdk-stable] " Jiang, MaoX
@ 2020-04-26 21:13 ` Thomas Monjalon
0 siblings, 0 replies; 8+ messages in thread
From: Thomas Monjalon @ 2020-04-26 21:13 UTC (permalink / raw)
To: Jiang, MaoX, xix.zhang; +Cc: stable, Kilheeney, Louise, dev
13/03/2020 04:07, Jiang, MaoX:
> Tested-by:xix.zhang@intel.com
Please provide full name.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [PATCH] examples/l2fwd-keepalive: fix packet drops limited mbufs
2020-03-11 12:04 [dpdk-dev] [PATCH] examples/l2fwd-keepalive: fix packet drops limited mbufs Louise Kilheeney
2020-03-13 3:07 ` [dpdk-dev] [dpdk-stable] " Jiang, MaoX
2020-04-26 21:12 ` Thomas Monjalon
@ 2020-04-27 1:38 ` Jiang, MaoX
2020-04-27 14:57 ` [dpdk-dev] [PATCH v2] " Louise Kilheeney
3 siblings, 0 replies; 8+ messages in thread
From: Jiang, MaoX @ 2020-04-27 1:38 UTC (permalink / raw)
To: Kilheeney, Louise, dev; +Cc: Kilheeney, Louise, stable
Tested-by:zhang,xi <xix.zhang@intel.com>
Best regards,
Jiang Mao
> -----Original Message-----
> From: stable [mailto:stable-bounces@dpdk.org] On Behalf Of Louise
> Kilheeney
> Sent: Wednesday, March 11, 2020 8:05 PM
> To: dev@dpdk.org
> Cc: Kilheeney, Louise <louise.kilheeney@intel.com>; stable@dpdk.org
> Subject: [dpdk-stable] [PATCH] examples/l2fwd-keepalive: fix packet drops
> limited mbufs
>
> MBUF pool of size 8192 was causing packet loss when using four ports. To fix
> this issue this patch specifies the number of MBUF's per port instead of
> having one set MBUF pool size, this way it will adapt to any number of ports.
>
> Fixes: e64833f2273a ("examples/l2fwd-keepalive: add sample application")
>
> Cc: stable@dpdk.org
>
> Signed-off-by: Louise Kilheeney <louise.kilheeney@intel.com>
> ---
> examples/l2fwd-keepalive/main.c | 17 ++++++++++-------
> 1 file changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-
> keepalive/main.c index b36834974..0f0010d51 100644
> --- a/examples/l2fwd-keepalive/main.c
> +++ b/examples/l2fwd-keepalive/main.c
> @@ -44,7 +44,7 @@
>
> #define RTE_LOGTYPE_L2FWD RTE_LOGTYPE_USER1
>
> -#define NB_MBUF 8192
> +#define NB_MBUF_PER_PORT 3000
>
> #define MAX_PKT_BURST 32
> #define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ @@ -561,16
> +561,19 @@ main(int argc, char **argv)
> if (ret < 0)
> rte_exit(EXIT_FAILURE, "Invalid L2FWD arguments\n");
>
> - /* create the mbuf pool */
> - l2fwd_pktmbuf_pool = rte_pktmbuf_pool_create("mbuf_pool",
> NB_MBUF, 32,
> - 0, RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id());
> - if (l2fwd_pktmbuf_pool == NULL)
> - rte_exit(EXIT_FAILURE, "Cannot init mbuf pool\n");
> -
> nb_ports = rte_eth_dev_count_avail();
> if (nb_ports == 0)
> rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
>
> + /* create the mbuf pool */
> + unsigned int total_nb_mbufs = NB_MBUF_PER_PORT * nb_ports;
> +
> + l2fwd_pktmbuf_pool = rte_pktmbuf_pool_create("mbuf_pool",
> + total_nb_mbufs, 32, 0,
> RTE_MBUF_DEFAULT_BUF_SIZE,
> + rte_socket_id());
> + if (l2fwd_pktmbuf_pool == NULL)
> + rte_exit(EXIT_FAILURE, "Cannot init mbuf pool\n");
> +
> /* reset l2fwd_dst_ports */
> for (portid = 0; portid < RTE_MAX_ETHPORTS; portid++)
> l2fwd_dst_ports[portid] = 0;
> --
> 2.17.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-dev] [PATCH v2] examples/l2fwd-keepalive: fix packet drops limited mbufs
2020-03-11 12:04 [dpdk-dev] [PATCH] examples/l2fwd-keepalive: fix packet drops limited mbufs Louise Kilheeney
` (2 preceding siblings ...)
2020-04-27 1:38 ` Jiang, MaoX
@ 2020-04-27 14:57 ` Louise Kilheeney
2020-04-29 2:29 ` Xie, WeiX
2020-05-11 16:16 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
3 siblings, 2 replies; 8+ messages in thread
From: Louise Kilheeney @ 2020-04-27 14:57 UTC (permalink / raw)
To: dev; +Cc: Louise Kilheeney, stable
MBUF pool of size 8192 was causing packet loss when using four ports. To
fix this issue this patch specifies the number of MBUF's per port
instead of having one set MBUF pool size, this way it will adapt to any
number of ports.
Fixes: e64833f2273a ("examples/l2fwd-keepalive: add sample application")
Cc: stable@dpdk.org
Signed-off-by: Louise Kilheeney <louise.kilheeney@intel.com>
Tested-by: Xi Zhang <xix.zhang@intel.com>
---
v2: moved variable initialisation to top of function.
---
examples/l2fwd-keepalive/main.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
index 2ae5a3c6a..32482158d 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -44,7 +44,7 @@
#define RTE_LOGTYPE_L2FWD RTE_LOGTYPE_USER1
-#define NB_MBUF 8192
+#define NB_MBUF_PER_PORT 3000
#define MAX_PKT_BURST 32
#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */
@@ -536,6 +536,7 @@ main(int argc, char **argv)
uint16_t portid, last_port;
unsigned lcore_id, rx_lcore_id;
unsigned nb_ports_in_mask = 0;
+ unsigned int total_nb_mbufs;
struct sigaction signal_handler;
struct rte_keepalive_shm *ka_shm;
@@ -561,16 +562,19 @@ main(int argc, char **argv)
if (ret < 0)
rte_exit(EXIT_FAILURE, "Invalid L2FWD arguments\n");
- /* create the mbuf pool */
- l2fwd_pktmbuf_pool = rte_pktmbuf_pool_create("mbuf_pool", NB_MBUF, 32,
- 0, RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id());
- if (l2fwd_pktmbuf_pool == NULL)
- rte_exit(EXIT_FAILURE, "Cannot init mbuf pool\n");
-
nb_ports = rte_eth_dev_count_avail();
if (nb_ports == 0)
rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
+ /* create the mbuf pool */
+ total_nb_mbufs = NB_MBUF_PER_PORT * nb_ports;
+
+ l2fwd_pktmbuf_pool = rte_pktmbuf_pool_create("mbuf_pool",
+ total_nb_mbufs, 32, 0, RTE_MBUF_DEFAULT_BUF_SIZE,
+ rte_socket_id());
+ if (l2fwd_pktmbuf_pool == NULL)
+ rte_exit(EXIT_FAILURE, "Cannot init mbuf pool\n");
+
/* reset l2fwd_dst_ports */
for (portid = 0; portid < RTE_MAX_ETHPORTS; portid++)
l2fwd_dst_ports[portid] = 0;
--
2.17.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH v2] examples/l2fwd-keepalive: fix packet drops limited mbufs
2020-04-27 14:57 ` [dpdk-dev] [PATCH v2] " Louise Kilheeney
@ 2020-04-29 2:29 ` Xie, WeiX
2020-05-11 16:16 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
1 sibling, 0 replies; 8+ messages in thread
From: Xie, WeiX @ 2020-04-29 2:29 UTC (permalink / raw)
To: Kilheeney, Louise, dev; +Cc: Kilheeney, Louise, stable
Tested-by:zhang,xi <xix.zhang@intel.com>
Regards,
Xie Wei
-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Louise Kilheeney
Sent: Monday, April 27, 2020 10:58 PM
To: dev@dpdk.org
Cc: Kilheeney, Louise <louise.kilheeney@intel.com>; stable@dpdk.org
Subject: [dpdk-dev] [PATCH v2] examples/l2fwd-keepalive: fix packet drops limited mbufs
MBUF pool of size 8192 was causing packet loss when using four ports. To fix this issue this patch specifies the number of MBUF's per port instead of having one set MBUF pool size, this way it will adapt to any number of ports.
Fixes: e64833f2273a ("examples/l2fwd-keepalive: add sample application")
Cc: stable@dpdk.org
Signed-off-by: Louise Kilheeney <louise.kilheeney@intel.com>
Tested-by: Xi Zhang <xix.zhang@intel.com>
---
v2: moved variable initialisation to top of function.
---
examples/l2fwd-keepalive/main.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c index 2ae5a3c6a..32482158d 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -44,7 +44,7 @@
#define RTE_LOGTYPE_L2FWD RTE_LOGTYPE_USER1
-#define NB_MBUF 8192
+#define NB_MBUF_PER_PORT 3000
#define MAX_PKT_BURST 32
#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ @@ -536,6 +536,7 @@ main(int argc, char **argv)
uint16_t portid, last_port;
unsigned lcore_id, rx_lcore_id;
unsigned nb_ports_in_mask = 0;
+ unsigned int total_nb_mbufs;
struct sigaction signal_handler;
struct rte_keepalive_shm *ka_shm;
@@ -561,16 +562,19 @@ main(int argc, char **argv)
if (ret < 0)
rte_exit(EXIT_FAILURE, "Invalid L2FWD arguments\n");
- /* create the mbuf pool */
- l2fwd_pktmbuf_pool = rte_pktmbuf_pool_create("mbuf_pool", NB_MBUF, 32,
- 0, RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id());
- if (l2fwd_pktmbuf_pool == NULL)
- rte_exit(EXIT_FAILURE, "Cannot init mbuf pool\n");
-
nb_ports = rte_eth_dev_count_avail();
if (nb_ports == 0)
rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
+ /* create the mbuf pool */
+ total_nb_mbufs = NB_MBUF_PER_PORT * nb_ports;
+
+ l2fwd_pktmbuf_pool = rte_pktmbuf_pool_create("mbuf_pool",
+ total_nb_mbufs, 32, 0, RTE_MBUF_DEFAULT_BUF_SIZE,
+ rte_socket_id());
+ if (l2fwd_pktmbuf_pool == NULL)
+ rte_exit(EXIT_FAILURE, "Cannot init mbuf pool\n");
+
/* reset l2fwd_dst_ports */
for (portid = 0; portid < RTE_MAX_ETHPORTS; portid++)
l2fwd_dst_ports[portid] = 0;
--
2.17.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [PATCH v2] examples/l2fwd-keepalive: fix packet drops limited mbufs
2020-04-27 14:57 ` [dpdk-dev] [PATCH v2] " Louise Kilheeney
2020-04-29 2:29 ` Xie, WeiX
@ 2020-05-11 16:16 ` Thomas Monjalon
1 sibling, 0 replies; 8+ messages in thread
From: Thomas Monjalon @ 2020-05-11 16:16 UTC (permalink / raw)
To: Louise Kilheeney; +Cc: dev, stable
27/04/2020 16:57, Louise Kilheeney:
> MBUF pool of size 8192 was causing packet loss when using four ports. To
> fix this issue this patch specifies the number of MBUF's per port
> instead of having one set MBUF pool size, this way it will adapt to any
> number of ports.
>
> Fixes: e64833f2273a ("examples/l2fwd-keepalive: add sample application")
> Cc: stable@dpdk.org
>
> Signed-off-by: Louise Kilheeney <louise.kilheeney@intel.com>
> Tested-by: Xi Zhang <xix.zhang@intel.com>
>
> ---
> v2: moved variable initialisation to top of function.
Applied, thanks
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2020-05-11 16:16 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-11 12:04 [dpdk-dev] [PATCH] examples/l2fwd-keepalive: fix packet drops limited mbufs Louise Kilheeney
2020-03-13 3:07 ` [dpdk-dev] [dpdk-stable] " Jiang, MaoX
2020-04-26 21:13 ` Thomas Monjalon
2020-04-26 21:12 ` Thomas Monjalon
2020-04-27 1:38 ` Jiang, MaoX
2020-04-27 14:57 ` [dpdk-dev] [PATCH v2] " Louise Kilheeney
2020-04-29 2:29 ` Xie, WeiX
2020-05-11 16:16 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).