* Re: [dpdk-dev] [PATCH] examples/ip_reassembly: use pktmbuf to create pool
2017-09-06 9:34 [dpdk-dev] [PATCH] examples/ip_reassembly: use pktmbuf to create pool Hemant Agrawal
@ 2017-10-12 4:51 ` Hemant Agrawal
2017-10-12 10:38 ` Ananyev, Konstantin
2017-10-12 13:25 ` [dpdk-dev] [PATCH v2] " Hemant Agrawal
2 siblings, 0 replies; 8+ messages in thread
From: Hemant Agrawal @ 2017-10-12 4:51 UTC (permalink / raw)
To: konstantin.ananyev; +Cc: dev, ashish.jain
Hi Konstantin,
Please review?
Regards,
Hemant
On 9/6/2017 3:04 PM, Hemant Agrawal wrote:
> From: Ashish Jain <ashish.jain@nxp.com>
>
> Use of rte_mempool_create() with the helper provided in
> librte_mbuf: rte_pktmbuf_pool_create().
> This is the preferred way to create a mbuf pool else
> it may not work on implementation using the HW buffer pool
>
> Signed-off-by: Ashish Jain <ashish.jain@nxp.com>
> ---
> examples/ip_reassembly/main.c | 13 ++++++-------
> 1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
> index e62636c..20caeb3 100644
> --- a/examples/ip_reassembly/main.c
> +++ b/examples/ip_reassembly/main.c
> @@ -84,8 +84,7 @@
> #define MAX_JUMBO_PKT_LEN 9600
>
> #define BUF_SIZE RTE_MBUF_DEFAULT_DATAROOM
> -#define MBUF_SIZE \
> - (BUF_SIZE + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
> +#define MBUF_DATA_SIZE RTE_MBUF_DEFAULT_BUF_SIZE
>
> #define NB_MBUF 8192
>
> @@ -909,11 +908,11 @@ setup_queue_tbl(struct rx_queue *rxq, uint32_t lcore, uint32_t queue)
>
> snprintf(buf, sizeof(buf), "mbuf_pool_%u_%u", lcore, queue);
>
> - if ((rxq->pool = rte_mempool_create(buf, nb_mbuf, MBUF_SIZE, 0,
> - sizeof(struct rte_pktmbuf_pool_private),
> - rte_pktmbuf_pool_init, NULL, rte_pktmbuf_init, NULL,
> - socket, MEMPOOL_F_SP_PUT | MEMPOOL_F_SC_GET)) == NULL) {
> - RTE_LOG(ERR, IP_RSMBL, "mempool_create(%s) failed", buf);
> + rxq->pool = rte_pktmbuf_pool_create(buf, nb_mbuf, 0, 0,
> + MBUF_DATA_SIZE, socket);
> + if (rxq->pool == NULL) {
> + RTE_LOG(ERR, IP_RSMBL,
> + "rte_pktmbuf_pool_create(%s) failed", buf);
> return -1;
> }
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH] examples/ip_reassembly: use pktmbuf to create pool
2017-09-06 9:34 [dpdk-dev] [PATCH] examples/ip_reassembly: use pktmbuf to create pool Hemant Agrawal
2017-10-12 4:51 ` Hemant Agrawal
@ 2017-10-12 10:38 ` Ananyev, Konstantin
2017-10-12 11:02 ` Hemant Agrawal
2017-10-12 13:25 ` [dpdk-dev] [PATCH v2] " Hemant Agrawal
2 siblings, 1 reply; 8+ messages in thread
From: Ananyev, Konstantin @ 2017-10-12 10:38 UTC (permalink / raw)
To: Hemant Agrawal, dev; +Cc: ashish.jain
> -----Original Message-----
> From: Hemant Agrawal [mailto:hemant.agrawal@nxp.com]
> Sent: Wednesday, September 6, 2017 10:34 AM
> To: dev@dpdk.org
> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; ashish.jain@nxp.com
> Subject: [PATCH] examples/ip_reassembly: use pktmbuf to create pool
>
> From: Ashish Jain <ashish.jain@nxp.com>
>
> Use of rte_mempool_create() with the helper provided in
> librte_mbuf: rte_pktmbuf_pool_create().
> This is the preferred way to create a mbuf pool else
> it may not work on implementation using the HW buffer pool
>
> Signed-off-by: Ashish Jain <ashish.jain@nxp.com>
> ---
> examples/ip_reassembly/main.c | 13 ++++++-------
> 1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
> index e62636c..20caeb3 100644
> --- a/examples/ip_reassembly/main.c
> +++ b/examples/ip_reassembly/main.c
> @@ -84,8 +84,7 @@
> #define MAX_JUMBO_PKT_LEN 9600
>
> #define BUF_SIZE RTE_MBUF_DEFAULT_DATAROOM
> -#define MBUF_SIZE \
> - (BUF_SIZE + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
> +#define MBUF_DATA_SIZE RTE_MBUF_DEFAULT_BUF_SIZE
>
> #define NB_MBUF 8192
>
> @@ -909,11 +908,11 @@ setup_queue_tbl(struct rx_queue *rxq, uint32_t lcore, uint32_t queue)
>
> snprintf(buf, sizeof(buf), "mbuf_pool_%u_%u", lcore, queue);
>
> - if ((rxq->pool = rte_mempool_create(buf, nb_mbuf, MBUF_SIZE, 0,
> - sizeof(struct rte_pktmbuf_pool_private),
> - rte_pktmbuf_pool_init, NULL, rte_pktmbuf_init, NULL,
> - socket, MEMPOOL_F_SP_PUT | MEMPOOL_F_SC_GET)) == NULL) {
> - RTE_LOG(ERR, IP_RSMBL, "mempool_create(%s) failed", buf);
> + rxq->pool = rte_pktmbuf_pool_create(buf, nb_mbuf, 0, 0,
> + MBUF_DATA_SIZE, socket);
As we can't pass SC|SP anymore can we then setup mempool cache size to some non-zero value?
Konstantin
> + if (rxq->pool == NULL) {
> + RTE_LOG(ERR, IP_RSMBL,
> + "rte_pktmbuf_pool_create(%s) failed", buf);
> return -1;
> }
>
> --
> 2.7.4
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH] examples/ip_reassembly: use pktmbuf to create pool
2017-10-12 10:38 ` Ananyev, Konstantin
@ 2017-10-12 11:02 ` Hemant Agrawal
2017-10-12 11:38 ` Ananyev, Konstantin
0 siblings, 1 reply; 8+ messages in thread
From: Hemant Agrawal @ 2017-10-12 11:02 UTC (permalink / raw)
To: Ananyev, Konstantin, dev; +Cc: ashish.jain
On 10/12/2017 4:08 PM, Ananyev, Konstantin wrote:
>
>
>> -----Original Message-----
>> From: Hemant Agrawal [mailto:hemant.agrawal@nxp.com]
>> Sent: Wednesday, September 6, 2017 10:34 AM
>> To: dev@dpdk.org
>> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; ashish.jain@nxp.com
>> Subject: [PATCH] examples/ip_reassembly: use pktmbuf to create pool
>>
>> From: Ashish Jain <ashish.jain@nxp.com>
>>
>> Use of rte_mempool_create() with the helper provided in
>> librte_mbuf: rte_pktmbuf_pool_create().
>> This is the preferred way to create a mbuf pool else
>> it may not work on implementation using the HW buffer pool
>>
>> Signed-off-by: Ashish Jain <ashish.jain@nxp.com>
>> ---
>> examples/ip_reassembly/main.c | 13 ++++++-------
>> 1 file changed, 6 insertions(+), 7 deletions(-)
>>
>> diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
>> index e62636c..20caeb3 100644
>> --- a/examples/ip_reassembly/main.c
>> +++ b/examples/ip_reassembly/main.c
>> @@ -84,8 +84,7 @@
>> #define MAX_JUMBO_PKT_LEN 9600
>>
>> #define BUF_SIZE RTE_MBUF_DEFAULT_DATAROOM
>> -#define MBUF_SIZE \
>> - (BUF_SIZE + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
>> +#define MBUF_DATA_SIZE RTE_MBUF_DEFAULT_BUF_SIZE
>>
>> #define NB_MBUF 8192
>>
>> @@ -909,11 +908,11 @@ setup_queue_tbl(struct rx_queue *rxq, uint32_t lcore, uint32_t queue)
>>
>> snprintf(buf, sizeof(buf), "mbuf_pool_%u_%u", lcore, queue);
>>
>> - if ((rxq->pool = rte_mempool_create(buf, nb_mbuf, MBUF_SIZE, 0,
>> - sizeof(struct rte_pktmbuf_pool_private),
>> - rte_pktmbuf_pool_init, NULL, rte_pktmbuf_init, NULL,
>> - socket, MEMPOOL_F_SP_PUT | MEMPOOL_F_SC_GET)) == NULL) {
>> - RTE_LOG(ERR, IP_RSMBL, "mempool_create(%s) failed", buf);
>> + rxq->pool = rte_pktmbuf_pool_create(buf, nb_mbuf, 0, 0,
>> + MBUF_DATA_SIZE, socket);
>
> As we can't pass SC|SP anymore can we then setup mempool cache size to some non-zero value?
> Konstantin
>
#define MEMPOOL_CACHE_SIZE 256
do you think "256" will be ok?
>> + if (rxq->pool == NULL) {
>> + RTE_LOG(ERR, IP_RSMBL,
>> + "rte_pktmbuf_pool_create(%s) failed", buf);
>> return -1;
>> }
>>
>> --
>> 2.7.4
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH] examples/ip_reassembly: use pktmbuf to create pool
2017-10-12 11:02 ` Hemant Agrawal
@ 2017-10-12 11:38 ` Ananyev, Konstantin
0 siblings, 0 replies; 8+ messages in thread
From: Ananyev, Konstantin @ 2017-10-12 11:38 UTC (permalink / raw)
To: Hemant Agrawal, dev; +Cc: ashish.jain
> -----Original Message-----
> From: Hemant Agrawal [mailto:hemant.agrawal@nxp.com]
> Sent: Thursday, October 12, 2017 12:03 PM
> To: Ananyev, Konstantin <konstantin.ananyev@intel.com>; dev@dpdk.org
> Cc: ashish.jain@nxp.com
> Subject: Re: [PATCH] examples/ip_reassembly: use pktmbuf to create pool
>
> On 10/12/2017 4:08 PM, Ananyev, Konstantin wrote:
> >
> >
> >> -----Original Message-----
> >> From: Hemant Agrawal [mailto:hemant.agrawal@nxp.com]
> >> Sent: Wednesday, September 6, 2017 10:34 AM
> >> To: dev@dpdk.org
> >> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; ashish.jain@nxp.com
> >> Subject: [PATCH] examples/ip_reassembly: use pktmbuf to create pool
> >>
> >> From: Ashish Jain <ashish.jain@nxp.com>
> >>
> >> Use of rte_mempool_create() with the helper provided in
> >> librte_mbuf: rte_pktmbuf_pool_create().
> >> This is the preferred way to create a mbuf pool else
> >> it may not work on implementation using the HW buffer pool
> >>
> >> Signed-off-by: Ashish Jain <ashish.jain@nxp.com>
> >> ---
> >> examples/ip_reassembly/main.c | 13 ++++++-------
> >> 1 file changed, 6 insertions(+), 7 deletions(-)
> >>
> >> diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
> >> index e62636c..20caeb3 100644
> >> --- a/examples/ip_reassembly/main.c
> >> +++ b/examples/ip_reassembly/main.c
> >> @@ -84,8 +84,7 @@
> >> #define MAX_JUMBO_PKT_LEN 9600
> >>
> >> #define BUF_SIZE RTE_MBUF_DEFAULT_DATAROOM
> >> -#define MBUF_SIZE \
> >> - (BUF_SIZE + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
> >> +#define MBUF_DATA_SIZE RTE_MBUF_DEFAULT_BUF_SIZE
> >>
> >> #define NB_MBUF 8192
> >>
> >> @@ -909,11 +908,11 @@ setup_queue_tbl(struct rx_queue *rxq, uint32_t lcore, uint32_t queue)
> >>
> >> snprintf(buf, sizeof(buf), "mbuf_pool_%u_%u", lcore, queue);
> >>
> >> - if ((rxq->pool = rte_mempool_create(buf, nb_mbuf, MBUF_SIZE, 0,
> >> - sizeof(struct rte_pktmbuf_pool_private),
> >> - rte_pktmbuf_pool_init, NULL, rte_pktmbuf_init, NULL,
> >> - socket, MEMPOOL_F_SP_PUT | MEMPOOL_F_SC_GET)) == NULL) {
> >> - RTE_LOG(ERR, IP_RSMBL, "mempool_create(%s) failed", buf);
> >> + rxq->pool = rte_pktmbuf_pool_create(buf, nb_mbuf, 0, 0,
> >> + MBUF_DATA_SIZE, socket);
> >
> > As we can't pass SC|SP anymore can we then setup mempool cache size to some non-zero value?
> > Konstantin
> >
>
> #define MEMPOOL_CACHE_SIZE 256
> do you think "256" will be ok?
Yes, sounds good enough.
Konstantin
>
>
> >> + if (rxq->pool == NULL) {
> >> + RTE_LOG(ERR, IP_RSMBL,
> >> + "rte_pktmbuf_pool_create(%s) failed", buf);
> >> return -1;
> >> }
> >>
> >> --
> >> 2.7.4
> >
> >
^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-dev] [PATCH v2] examples/ip_reassembly: use pktmbuf to create pool
2017-09-06 9:34 [dpdk-dev] [PATCH] examples/ip_reassembly: use pktmbuf to create pool Hemant Agrawal
2017-10-12 4:51 ` Hemant Agrawal
2017-10-12 10:38 ` Ananyev, Konstantin
@ 2017-10-12 13:25 ` Hemant Agrawal
2017-10-12 13:29 ` Ananyev, Konstantin
2 siblings, 1 reply; 8+ messages in thread
From: Hemant Agrawal @ 2017-10-12 13:25 UTC (permalink / raw)
To: dev, konstantin.ananyev
From: Ashish Jain <ashish.jain@nxp.com>
Use of rte_mempool_create() with the helper provided in
librte_mbuf: rte_pktmbuf_pool_create().
This is the preferred way to create a mbuf pool else
it may not work on implementation using the HW buffer pool
Signed-off-by: Ashish Jain <ashish.jain@nxp.com>
---
v2: add mempool caches - as suggested by Konstantin
examples/ip_reassembly/main.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index cadf4c5..2f662ba 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -84,10 +84,10 @@
#define MAX_JUMBO_PKT_LEN 9600
#define BUF_SIZE RTE_MBUF_DEFAULT_DATAROOM
-#define MBUF_SIZE \
- (BUF_SIZE + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATA_SIZE RTE_MBUF_DEFAULT_BUF_SIZE
#define NB_MBUF 8192
+#define MEMPOOL_CACHE_SIZE 256
/* allow max jumbo frame 9.5 KB */
#define JUMBO_FRAME_MAX_SIZE 0x2600
@@ -909,11 +909,11 @@ setup_queue_tbl(struct rx_queue *rxq, uint32_t lcore, uint32_t queue)
snprintf(buf, sizeof(buf), "mbuf_pool_%u_%u", lcore, queue);
- if ((rxq->pool = rte_mempool_create(buf, nb_mbuf, MBUF_SIZE, 0,
- sizeof(struct rte_pktmbuf_pool_private),
- rte_pktmbuf_pool_init, NULL, rte_pktmbuf_init, NULL,
- socket, MEMPOOL_F_SP_PUT | MEMPOOL_F_SC_GET)) == NULL) {
- RTE_LOG(ERR, IP_RSMBL, "mempool_create(%s) failed", buf);
+ rxq->pool = rte_pktmbuf_pool_create(buf, nb_mbuf, MEMPOOL_CACHE_SIZE, 0,
+ MBUF_DATA_SIZE, socket);
+ if (rxq->pool == NULL) {
+ RTE_LOG(ERR, IP_RSMBL,
+ "rte_pktmbuf_pool_create(%s) failed", buf);
return -1;
}
--
2.7.4
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH v2] examples/ip_reassembly: use pktmbuf to create pool
2017-10-12 13:25 ` [dpdk-dev] [PATCH v2] " Hemant Agrawal
@ 2017-10-12 13:29 ` Ananyev, Konstantin
2017-10-13 22:56 ` Thomas Monjalon
0 siblings, 1 reply; 8+ messages in thread
From: Ananyev, Konstantin @ 2017-10-12 13:29 UTC (permalink / raw)
To: Hemant Agrawal, dev
> -----Original Message-----
> From: Hemant Agrawal [mailto:hemant.agrawal@nxp.com]
> Sent: Thursday, October 12, 2017 2:25 PM
> To: dev@dpdk.org; Ananyev, Konstantin <konstantin.ananyev@intel.com>
> Subject: [PATCH v2] examples/ip_reassembly: use pktmbuf to create pool
>
> From: Ashish Jain <ashish.jain@nxp.com>
>
> Use of rte_mempool_create() with the helper provided in
> librte_mbuf: rte_pktmbuf_pool_create().
> This is the preferred way to create a mbuf pool else
> it may not work on implementation using the HW buffer pool
>
> Signed-off-by: Ashish Jain <ashish.jain@nxp.com>
> ---
> v2: add mempool caches - as suggested by Konstantin
>
> examples/ip_reassembly/main.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
> index cadf4c5..2f662ba 100644
> --- a/examples/ip_reassembly/main.c
> +++ b/examples/ip_reassembly/main.c
> @@ -84,10 +84,10 @@
> #define MAX_JUMBO_PKT_LEN 9600
>
> #define BUF_SIZE RTE_MBUF_DEFAULT_DATAROOM
> -#define MBUF_SIZE \
> - (BUF_SIZE + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
> +#define MBUF_DATA_SIZE RTE_MBUF_DEFAULT_BUF_SIZE
>
> #define NB_MBUF 8192
> +#define MEMPOOL_CACHE_SIZE 256
>
> /* allow max jumbo frame 9.5 KB */
> #define JUMBO_FRAME_MAX_SIZE 0x2600
> @@ -909,11 +909,11 @@ setup_queue_tbl(struct rx_queue *rxq, uint32_t lcore, uint32_t queue)
>
> snprintf(buf, sizeof(buf), "mbuf_pool_%u_%u", lcore, queue);
>
> - if ((rxq->pool = rte_mempool_create(buf, nb_mbuf, MBUF_SIZE, 0,
> - sizeof(struct rte_pktmbuf_pool_private),
> - rte_pktmbuf_pool_init, NULL, rte_pktmbuf_init, NULL,
> - socket, MEMPOOL_F_SP_PUT | MEMPOOL_F_SC_GET)) == NULL) {
> - RTE_LOG(ERR, IP_RSMBL, "mempool_create(%s) failed", buf);
> + rxq->pool = rte_pktmbuf_pool_create(buf, nb_mbuf, MEMPOOL_CACHE_SIZE, 0,
> + MBUF_DATA_SIZE, socket);
> + if (rxq->pool == NULL) {
> + RTE_LOG(ERR, IP_RSMBL,
> + "rte_pktmbuf_pool_create(%s) failed", buf);
> return -1;
> }
>
> --
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> 2.7.4
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH v2] examples/ip_reassembly: use pktmbuf to create pool
2017-10-12 13:29 ` Ananyev, Konstantin
@ 2017-10-13 22:56 ` Thomas Monjalon
0 siblings, 0 replies; 8+ messages in thread
From: Thomas Monjalon @ 2017-10-13 22:56 UTC (permalink / raw)
To: Hemant Agrawal, Ashish Jain; +Cc: dev, Ananyev, Konstantin
> > Use of rte_mempool_create() with the helper provided in
> > librte_mbuf: rte_pktmbuf_pool_create().
> > This is the preferred way to create a mbuf pool else
> > it may not work on implementation using the HW buffer pool
> >
> > Signed-off-by: Ashish Jain <ashish.jain@nxp.com>
>
> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Applied, thanks
^ permalink raw reply [flat|nested] 8+ messages in thread