patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] examples/multi_process: fix buffer underrun
@ 2019-04-09 22:59 Yongseok Koh
  2019-04-10  9:14 ` [dpdk-stable] [dpdk-dev] " Bruce Richardson
  2019-04-10 19:41 ` [dpdk-stable] " Yongseok Koh
  0 siblings, 2 replies; 6+ messages in thread
From: Yongseok Koh @ 2019-04-09 22:59 UTC (permalink / raw)
  To: anatoly.burakov; +Cc: dev, stable

For client_server_mp, the total number of buffers for the mbuf mempool
should be correctly calculated. Otherwise, having more clients will stop
traffic.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
---
 examples/multi_process/client_server_mp/mp_server/init.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/examples/multi_process/client_server_mp/mp_server/init.c b/examples/multi_process/client_server_mp/mp_server/init.c
index 30c8e44bc0..0491ba8a1a 100644
--- a/examples/multi_process/client_server_mp/mp_server/init.c
+++ b/examples/multi_process/client_server_mp/mp_server/init.c
@@ -37,8 +37,6 @@
 #include "args.h"
 #include "init.h"
 
-#define MBUFS_PER_CLIENT 1536
-#define MBUFS_PER_PORT 1536
 #define MBUF_CACHE_SIZE 512
 
 #define RTE_MP_RX_DESC_DEFAULT 1024
@@ -63,8 +61,12 @@ struct port_info *ports;
 static int
 init_mbuf_pools(void)
 {
-	const unsigned num_mbufs = (num_clients * MBUFS_PER_CLIENT) \
-			+ (ports->num_ports * MBUFS_PER_PORT);
+	const unsigned int num_mbufs =
+		RTE_MP_RX_DESC_DEFAULT * ports->num_ports + /* Sever */
+		num_clients *
+		(CLIENT_QUEUE_RINGSIZE +
+		 RTE_MP_TX_DESC_DEFAULT * ports->num_ports) + /* Clients */
+		(num_clients + 1) * MBUF_CACHE_SIZE; /* Mempool cache */
 
 	/* don't pass single-producer/single-consumer flags to mbuf create as it
 	 * seems faster to use a cache instead */
-- 
2.11.0


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

* Re: [dpdk-stable] [dpdk-dev] [PATCH] examples/multi_process: fix buffer underrun
  2019-04-09 22:59 [dpdk-stable] [PATCH] examples/multi_process: fix buffer underrun Yongseok Koh
@ 2019-04-10  9:14 ` Bruce Richardson
  2019-04-10 19:41 ` [dpdk-stable] " Yongseok Koh
  1 sibling, 0 replies; 6+ messages in thread
From: Bruce Richardson @ 2019-04-10  9:14 UTC (permalink / raw)
  To: Yongseok Koh; +Cc: anatoly.burakov, dev, stable

On Tue, Apr 09, 2019 at 03:59:37PM -0700, Yongseok Koh wrote:
> For client_server_mp, the total number of buffers for the mbuf mempool
> should be correctly calculated. Otherwise, having more clients will stop
> traffic.
> 
> Fixes: af75078fece3 ("first public release")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
> ---
>  examples/multi_process/client_server_mp/mp_server/init.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/examples/multi_process/client_server_mp/mp_server/init.c b/examples/multi_process/client_server_mp/mp_server/init.c
> index 30c8e44bc0..0491ba8a1a 100644
> --- a/examples/multi_process/client_server_mp/mp_server/init.c
> +++ b/examples/multi_process/client_server_mp/mp_server/init.c
> @@ -37,8 +37,6 @@
>  #include "args.h"
>  #include "init.h"
>  
> -#define MBUFS_PER_CLIENT 1536
> -#define MBUFS_PER_PORT 1536
>  #define MBUF_CACHE_SIZE 512
>  
>  #define RTE_MP_RX_DESC_DEFAULT 1024
> @@ -63,8 +61,12 @@ struct port_info *ports;
>  static int
>  init_mbuf_pools(void)
>  {
> -	const unsigned num_mbufs = (num_clients * MBUFS_PER_CLIENT) \
> -			+ (ports->num_ports * MBUFS_PER_PORT);
> +	const unsigned int num_mbufs =
> +		RTE_MP_RX_DESC_DEFAULT * ports->num_ports + /* Sever */

typo: server

> +		num_clients *
> +		(CLIENT_QUEUE_RINGSIZE +
> +		 RTE_MP_TX_DESC_DEFAULT * ports->num_ports) + /* Clients */
> +		(num_clients + 1) * MBUF_CACHE_SIZE; /* Mempool cache */
>  

The calculation looks correct to me, it's just rather long with strange
wrapping. I'd suggest either splitting up the calculation to have a
separate variable for per-client mbuf counts, or else just use a longer
line for readability for the client calculation.

>  	/* don't pass single-producer/single-consumer flags to mbuf create as it
>  	 * seems faster to use a cache instead */
> -- 
> 2.11.0
> 

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

* [dpdk-stable] [PATCH] examples/multi_process: fix buffer underrun
  2019-04-09 22:59 [dpdk-stable] [PATCH] examples/multi_process: fix buffer underrun Yongseok Koh
  2019-04-10  9:14 ` [dpdk-stable] [dpdk-dev] " Bruce Richardson
@ 2019-04-10 19:41 ` Yongseok Koh
  2019-04-11  7:18   ` [dpdk-stable] [PATCH v2] " Yongseok Koh
  2019-05-02 23:36   ` [dpdk-stable] [dpdk-dev] [PATCH] " Thomas Monjalon
  1 sibling, 2 replies; 6+ messages in thread
From: Yongseok Koh @ 2019-04-10 19:41 UTC (permalink / raw)
  To: anatoly.burakov; +Cc: dev, bruce.richardson, stable

For client_server_mp, the total number of buffers for the mbuf mempool
should be correctly calculated. Otherwise, having more clients will stop
traffic.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
---

v2:
* split up the calculation

 examples/multi_process/client_server_mp/mp_server/init.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/examples/multi_process/client_server_mp/mp_server/init.c b/examples/multi_process/client_server_mp/mp_server/init.c
index 30c8e44bc0..3af5dc6994 100644
--- a/examples/multi_process/client_server_mp/mp_server/init.c
+++ b/examples/multi_process/client_server_mp/mp_server/init.c
@@ -37,8 +37,6 @@
 #include "args.h"
 #include "init.h"
 
-#define MBUFS_PER_CLIENT 1536
-#define MBUFS_PER_PORT 1536
 #define MBUF_CACHE_SIZE 512
 
 #define RTE_MP_RX_DESC_DEFAULT 1024
@@ -63,8 +61,15 @@ struct port_info *ports;
 static int
 init_mbuf_pools(void)
 {
-	const unsigned num_mbufs = (num_clients * MBUFS_PER_CLIENT) \
-			+ (ports->num_ports * MBUFS_PER_PORT);
+	const unsigned int num_mbufs_server =
+		RTE_MP_RX_DESC_DEFAULT * ports->num_ports;
+	const unsigned int num_mbufs_client =
+		num_clients * (CLIENT_QUEUE_RINGSIZE +
+			       RTE_MP_TX_DESC_DEFAULT * ports->num_ports);
+	const unsigned int num_mbufs_mp_cache =
+		(num_clients + 1) * MBUF_CACHE_SIZE;
+	const unsigned int num_mbufs =
+		num_mbufs_server + num_mbufs_client + num_mbufs_mp_cache;
 
 	/* don't pass single-producer/single-consumer flags to mbuf create as it
 	 * seems faster to use a cache instead */
-- 
2.11.0


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

* Re: [dpdk-stable] [PATCH v2] examples/multi_process: fix buffer underrun
  2019-04-10 19:41 ` [dpdk-stable] " Yongseok Koh
@ 2019-04-11  7:18   ` Yongseok Koh
  2019-04-30 18:01     ` Yongseok Koh
  2019-05-02 23:36   ` [dpdk-stable] [dpdk-dev] [PATCH] " Thomas Monjalon
  1 sibling, 1 reply; 6+ messages in thread
From: Yongseok Koh @ 2019-04-11  7:18 UTC (permalink / raw)
  To: Burakov, Anatoly, Bruce Richardson; +Cc: dev, dpdk stable

> On Apr 10, 2019, at 12:41 PM, Yongseok Koh <yskoh@mellanox.com> wrote:
> 
> For client_server_mp, the total number of buffers for the mbuf mempool
> should be correctly calculated. Otherwise, having more clients will stop
> traffic.
> 
> Fixes: af75078fece3 ("first public release")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
> ---
> 
> v2:
> * split up the calculation

Sorry, I forgot to specify 'v2' in the title of this email.


Thanks,
Yongseok

> examples/multi_process/client_server_mp/mp_server/init.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/examples/multi_process/client_server_mp/mp_server/init.c b/examples/multi_process/client_server_mp/mp_server/init.c
> index 30c8e44bc0..3af5dc6994 100644
> --- a/examples/multi_process/client_server_mp/mp_server/init.c
> +++ b/examples/multi_process/client_server_mp/mp_server/init.c
> @@ -37,8 +37,6 @@
> #include "args.h"
> #include "init.h"
> 
> -#define MBUFS_PER_CLIENT 1536
> -#define MBUFS_PER_PORT 1536
> #define MBUF_CACHE_SIZE 512
> 
> #define RTE_MP_RX_DESC_DEFAULT 1024
> @@ -63,8 +61,15 @@ struct port_info *ports;
> static int
> init_mbuf_pools(void)
> {
> -	const unsigned num_mbufs = (num_clients * MBUFS_PER_CLIENT) \
> -			+ (ports->num_ports * MBUFS_PER_PORT);
> +	const unsigned int num_mbufs_server =
> +		RTE_MP_RX_DESC_DEFAULT * ports->num_ports;
> +	const unsigned int num_mbufs_client =
> +		num_clients * (CLIENT_QUEUE_RINGSIZE +
> +			       RTE_MP_TX_DESC_DEFAULT * ports->num_ports);
> +	const unsigned int num_mbufs_mp_cache =
> +		(num_clients + 1) * MBUF_CACHE_SIZE;
> +	const unsigned int num_mbufs =
> +		num_mbufs_server + num_mbufs_client + num_mbufs_mp_cache;
> 
> 	/* don't pass single-producer/single-consumer flags to mbuf create as it
> 	 * seems faster to use a cache instead */
> -- 
> 2.11.0
> 


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

* Re: [dpdk-stable] [PATCH v2] examples/multi_process: fix buffer underrun
  2019-04-11  7:18   ` [dpdk-stable] [PATCH v2] " Yongseok Koh
@ 2019-04-30 18:01     ` Yongseok Koh
  0 siblings, 0 replies; 6+ messages in thread
From: Yongseok Koh @ 2019-04-30 18:01 UTC (permalink / raw)
  To: Burakov, Anatoly, Bruce Richardson, Thomas Monjalon; +Cc: dev, dpdk stable


> On Apr 11, 2019, at 12:18 AM, Yongseok Koh <yskoh@mellanox.com> wrote:
> 
>> On Apr 10, 2019, at 12:41 PM, Yongseok Koh <yskoh@mellanox.com> wrote:
>> 
>> For client_server_mp, the total number of buffers for the mbuf mempool
>> should be correctly calculated. Otherwise, having more clients will stop
>> traffic.
>> 
>> Fixes: af75078fece3 ("first public release")
>> Cc: stable@dpdk.org
>> 
>> Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
>> ---
>> 
>> v2:
>> * split up the calculation
> 
> Sorry, I forgot to specify 'v2' in the title of this email.

No ack? No merge?

Yongseok

> 
>> examples/multi_process/client_server_mp/mp_server/init.c | 13 +++++++++----
>> 1 file changed, 9 insertions(+), 4 deletions(-)
>> 
>> diff --git a/examples/multi_process/client_server_mp/mp_server/init.c b/examples/multi_process/client_server_mp/mp_server/init.c
>> index 30c8e44bc0..3af5dc6994 100644
>> --- a/examples/multi_process/client_server_mp/mp_server/init.c
>> +++ b/examples/multi_process/client_server_mp/mp_server/init.c
>> @@ -37,8 +37,6 @@
>> #include "args.h"
>> #include "init.h"
>> 
>> -#define MBUFS_PER_CLIENT 1536
>> -#define MBUFS_PER_PORT 1536
>> #define MBUF_CACHE_SIZE 512
>> 
>> #define RTE_MP_RX_DESC_DEFAULT 1024
>> @@ -63,8 +61,15 @@ struct port_info *ports;
>> static int
>> init_mbuf_pools(void)
>> {
>> -	const unsigned num_mbufs = (num_clients * MBUFS_PER_CLIENT) \
>> -			+ (ports->num_ports * MBUFS_PER_PORT);
>> +	const unsigned int num_mbufs_server =
>> +		RTE_MP_RX_DESC_DEFAULT * ports->num_ports;
>> +	const unsigned int num_mbufs_client =
>> +		num_clients * (CLIENT_QUEUE_RINGSIZE +
>> +			       RTE_MP_TX_DESC_DEFAULT * ports->num_ports);
>> +	const unsigned int num_mbufs_mp_cache =
>> +		(num_clients + 1) * MBUF_CACHE_SIZE;
>> +	const unsigned int num_mbufs =
>> +		num_mbufs_server + num_mbufs_client + num_mbufs_mp_cache;
>> 
>> 	/* don't pass single-producer/single-consumer flags to mbuf create as it
>> 	 * seems faster to use a cache instead */
>> -- 
>> 2.11.0
>> 
> 


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

* Re: [dpdk-stable] [dpdk-dev] [PATCH] examples/multi_process: fix buffer underrun
  2019-04-10 19:41 ` [dpdk-stable] " Yongseok Koh
  2019-04-11  7:18   ` [dpdk-stable] [PATCH v2] " Yongseok Koh
@ 2019-05-02 23:36   ` Thomas Monjalon
  1 sibling, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2019-05-02 23:36 UTC (permalink / raw)
  To: Yongseok Koh; +Cc: dev, anatoly.burakov, bruce.richardson, stable

10/04/2019 21:41, Yongseok Koh:
> For client_server_mp, the total number of buffers for the mbuf mempool
> should be correctly calculated. Otherwise, having more clients will stop
> traffic.
> 
> Fixes: af75078fece3 ("first public release")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Yongseok Koh <yskoh@mellanox.com>

Applied, thanks




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

end of thread, other threads:[~2019-05-02 23:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-09 22:59 [dpdk-stable] [PATCH] examples/multi_process: fix buffer underrun Yongseok Koh
2019-04-10  9:14 ` [dpdk-stable] [dpdk-dev] " Bruce Richardson
2019-04-10 19:41 ` [dpdk-stable] " Yongseok Koh
2019-04-11  7:18   ` [dpdk-stable] [PATCH v2] " Yongseok Koh
2019-04-30 18:01     ` Yongseok Koh
2019-05-02 23:36   ` [dpdk-stable] [dpdk-dev] [PATCH] " 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).