DPDK usage discussions
 help / color / Atom feed
* [dpdk-users] Help with mbuf and mempool
@ 2019-09-17 18:05 Tran (US), Katherine K
  2019-09-18  4:12 ` Singh, Satish 1. (Nokia - IN/Bangalore)
  0 siblings, 1 reply; 7+ messages in thread
From: Tran (US), Katherine K @ 2019-09-17 18:05 UTC (permalink / raw)
  To: users

Hello,

I am trying to allocate an mbuf to use for IP fragmentation. When instantiating a mempool using rte_pktmbuf_pool_create() function, I keep getting the following error message.

Error Message:
* MEMPOOL: Cannot allocate tailq entry!

Will you please let me know what I am missing?

Regards,
Katie


--------------- Code ---------------------

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#include <sys/types.h>
#include <sys/param.h>
#include <string.h>
#include <sys/queue.h>
#include <stdarg.h>
#include <errno.h>
#include <getopt.h>

#include <rte_common.h>
#include <rte_byteorder.h>
#include <rte_log.h>
#include <rte_memory.h>
#include <rte_memcpy.h>
#include <rte_memzone.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_launch.h>
#include <rte_atomic.h>
#include <rte_cycles.h>
#include <rte_prefetch.h>
#include <rte_lcore.h>
#include <rte_per_lcore.h>
#include <rte_branch_prediction.h>
#include <rte_interrupts.h>
#include <rte_pci.h>
#include <rte_random.h>
#include <rte_debug.h>
#include <rte_ether.h>
#include <rte_ethdev.h>
#include <rte_ring.h>
#include <rte_mempool.h>
#include <rte_mbuf.h>
#include <rte_lpm.h>
#include <rte_lpm6.h>
#include <rte_ip.h>
#include <rte_string_fns.h>

#include <rte_ip_frag.h>

struct rte_mempool *mempool = NULL;
#define NB_MBUF         8192
#define AERO_FRAG_SIZE  1024
#define PATH_MAX        4096

//static struct rte_mempool *socket_direct_pool[RTE_MAX_NUMA_NODES];

int
main(int argc, char **argv)
{

        struct rte_mbuf *mbuf = NULL;
        struct node_queue_conf *qconf;

        char buf[PATH_MAX];
        struct rte_mempool *mp;
        struct rte_lpm *lpm;
        struct rte_lpm6 *lpm6;
        struct rte_lpm_config lpm_config; /*KT Readded*/
        int socket;
        unsigned lcore_id;

        unsigned elt_size;

        lcore_id = 1;
        socket = rte_lcore_to_socket_id(lcore_id);

        if (rte_lcore_is_enabled(lcore_id) == 0)
                printf("RTE LCORE is enabled!");

        socket = rte_lcore_to_socket_id(lcore_id);
        if (socket == SOCKET_ID_ANY)
                socket = 0;

        elt_size = sizeof(struct rte_mbuf) + (unsigned)RTE_MBUF_DEFAULT_BUF_SIZE;

        //mp = rte_mempool_create_empty(buf, NB_MBUF, elt_size, RTE_MBUF_DEFAULT_BUF_SIZE, sizeof(struct rte_pktmbuf_pool_private), socket, 0);

        mp = rte_pktmbuf_pool_create(buf, NB_MBUF, 32, 0, RTE_MBUF_DEFAULT_BUF_SIZE, socket);

/*
        if (socket_direct_pool[socket] == NULL) {
                RTE_LOG(INFO, IP_FRAG, "Creating direct mempool on socket %i\n",
                                socket);
                snprintf(buf, sizeof(buf), "pool_direct_%i", socket);

                mp = rte_pktmbuf_pool_create(buf, NB_MBUF, 32,
                        0, AERO_FRAG_SIZE, socket);

                if (mp == NULL) {
                        RTE_LOG(ERR, IP_FRAG, "Cannot create direct mempool\n");
                        return -1;
                }
                socket_direct_pool[socket] = mp;

        }
*/
        //mbuf = rte_pktmbuf_alloc(mp);

        //fragment(mbuf, qconf);


}

------------------------------------------


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fragment.c
URL: <http://mails.dpdk.org/archives/users/attachments/20190917/3e7f791b/attachment.c>

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

* Re: [dpdk-users] Help with mbuf and mempool
  2019-09-18  4:12 ` Singh, Satish 1. (Nokia - IN/Bangalore)
@ 2019-09-17 23:32   ` Suraj R Gupta
  2019-09-18 14:31     ` Tran (US), Katherine K
  0 siblings, 1 reply; 7+ messages in thread
From: Suraj R Gupta @ 2019-09-17 23:32 UTC (permalink / raw)
  To: Singh, Satish 1. (Nokia - IN/Bangalore); +Cc: Tran (US), Katherine K, users

Make sure you have allocated hugepages before running the application

On Wed, Sep 18, 2019 at 9:42 AM Singh, Satish 1. (Nokia - IN/Bangalore) <
satish.1.singh@nokia.com> wrote:

> Hi,
>
> You are using Socket 0, and might be there is no memory in this socket or
> no memory left in this socket 0. Try with SOCKET_ID_ANY.
>
> Regards,
> SATISH SINGH
>
> -----Original Message-----
> From: users <users-bounces@dpdk.org> On Behalf Of Tran (US), Katherine K
> Sent: Tuesday, September 17, 2019 11:36 PM
> To: users@dpdk.org
> Subject: [dpdk-users] Help with mbuf and mempool
>
> Hello,
>
> I am trying to allocate an mbuf to use for IP fragmentation. When
> instantiating a mempool using rte_pktmbuf_pool_create() function, I keep
> getting the following error message.
>
> Error Message:
> * MEMPOOL: Cannot allocate tailq entry!
>
> Will you please let me know what I am missing?
>
> Regards,
> Katie
>
>
> --------------- Code ---------------------
>
> #include <stdio.h>
> #include <stdlib.h>
> #include <stdint.h>
> #include <inttypes.h>
> #include <sys/types.h>
> #include <sys/param.h>
> #include <string.h>
> #include <sys/queue.h>
> #include <stdarg.h>
> #include <errno.h>
> #include <getopt.h>
>
> #include <rte_common.h>
> #include <rte_byteorder.h>
> #include <rte_log.h>
> #include <rte_memory.h>
> #include <rte_memcpy.h>
> #include <rte_memzone.h>
> #include <rte_eal.h>
> #include <rte_per_lcore.h>
> #include <rte_launch.h>
> #include <rte_atomic.h>
> #include <rte_cycles.h>
> #include <rte_prefetch.h>
> #include <rte_lcore.h>
> #include <rte_per_lcore.h>
> #include <rte_branch_prediction.h>
> #include <rte_interrupts.h>
> #include <rte_pci.h>
> #include <rte_random.h>
> #include <rte_debug.h>
> #include <rte_ether.h>
> #include <rte_ethdev.h>
> #include <rte_ring.h>
> #include <rte_mempool.h>
> #include <rte_mbuf.h>
> #include <rte_lpm.h>
> #include <rte_lpm6.h>
> #include <rte_ip.h>
> #include <rte_string_fns.h>
>
> #include <rte_ip_frag.h>
>
> struct rte_mempool *mempool = NULL;
> #define NB_MBUF         8192
> #define AERO_FRAG_SIZE  1024
> #define PATH_MAX        4096
>
> //static struct rte_mempool *socket_direct_pool[RTE_MAX_NUMA_NODES];
>
> int
> main(int argc, char **argv)
> {
>
>         struct rte_mbuf *mbuf = NULL;
>         struct node_queue_conf *qconf;
>
>         char buf[PATH_MAX];
>         struct rte_mempool *mp;
>         struct rte_lpm *lpm;
>         struct rte_lpm6 *lpm6;
>         struct rte_lpm_config lpm_config; /*KT Readded*/
>         int socket;
>         unsigned lcore_id;
>
>         unsigned elt_size;
>
>         lcore_id = 1;
>         socket = rte_lcore_to_socket_id(lcore_id);
>
>         if (rte_lcore_is_enabled(lcore_id) == 0)
>                 printf("RTE LCORE is enabled!");
>
>         socket = rte_lcore_to_socket_id(lcore_id);
>         if (socket == SOCKET_ID_ANY)
>                 socket = 0;
>
>         elt_size = sizeof(struct rte_mbuf) +
> (unsigned)RTE_MBUF_DEFAULT_BUF_SIZE;
>
>         //mp = rte_mempool_create_empty(buf, NB_MBUF, elt_size,
> RTE_MBUF_DEFAULT_BUF_SIZE, sizeof(struct rte_pktmbuf_pool_private), socket,
> 0);
>
>         mp = rte_pktmbuf_pool_create(buf, NB_MBUF, 32, 0,
> RTE_MBUF_DEFAULT_BUF_SIZE, socket);
>
> /*
>         if (socket_direct_pool[socket] == NULL) {
>                 RTE_LOG(INFO, IP_FRAG, "Creating direct mempool on socket
> %i\n",
>                                 socket);
>                 snprintf(buf, sizeof(buf), "pool_direct_%i", socket);
>
>                 mp = rte_pktmbuf_pool_create(buf, NB_MBUF, 32,
>                         0, AERO_FRAG_SIZE, socket);
>
>                 if (mp == NULL) {
>                         RTE_LOG(ERR, IP_FRAG, "Cannot create direct
> mempool\n");
>                         return -1;
>                 }
>                 socket_direct_pool[socket] = mp;
>
>         }
> */
>         //mbuf = rte_pktmbuf_alloc(mp);
>
>         //fragment(mbuf, qconf);
>
>
> }
>
> ------------------------------------------
>
>
> -------------- next part --------------
> An embedded and charset-unspecified text was scrubbed...
> Name: fragment.c
> URL: <
> http://mails.dpdk.org/archives/users/attachments/20190917/3e7f791b/attachment.c
> >
>


-- 
Thanks and Regards
Suraj R Gupta

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

* Re: [dpdk-users] Help with mbuf and mempool
  2019-09-17 18:05 [dpdk-users] Help with mbuf and mempool Tran (US), Katherine K
@ 2019-09-18  4:12 ` Singh, Satish 1. (Nokia - IN/Bangalore)
  2019-09-17 23:32   ` Suraj R Gupta
  0 siblings, 1 reply; 7+ messages in thread
From: Singh, Satish 1. (Nokia - IN/Bangalore) @ 2019-09-18  4:12 UTC (permalink / raw)
  To: Tran (US), Katherine K, users

Hi,

You are using Socket 0, and might be there is no memory in this socket or no memory left in this socket 0. Try with SOCKET_ID_ANY.

Regards,
SATISH SINGH

-----Original Message-----
From: users <users-bounces@dpdk.org> On Behalf Of Tran (US), Katherine K
Sent: Tuesday, September 17, 2019 11:36 PM
To: users@dpdk.org
Subject: [dpdk-users] Help with mbuf and mempool

Hello,

I am trying to allocate an mbuf to use for IP fragmentation. When instantiating a mempool using rte_pktmbuf_pool_create() function, I keep getting the following error message.

Error Message:
* MEMPOOL: Cannot allocate tailq entry!

Will you please let me know what I am missing?

Regards,
Katie


--------------- Code ---------------------

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#include <sys/types.h>
#include <sys/param.h>
#include <string.h>
#include <sys/queue.h>
#include <stdarg.h>
#include <errno.h>
#include <getopt.h>

#include <rte_common.h>
#include <rte_byteorder.h>
#include <rte_log.h>
#include <rte_memory.h>
#include <rte_memcpy.h>
#include <rte_memzone.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_launch.h>
#include <rte_atomic.h>
#include <rte_cycles.h>
#include <rte_prefetch.h>
#include <rte_lcore.h>
#include <rte_per_lcore.h>
#include <rte_branch_prediction.h>
#include <rte_interrupts.h>
#include <rte_pci.h>
#include <rte_random.h>
#include <rte_debug.h>
#include <rte_ether.h>
#include <rte_ethdev.h>
#include <rte_ring.h>
#include <rte_mempool.h>
#include <rte_mbuf.h>
#include <rte_lpm.h>
#include <rte_lpm6.h>
#include <rte_ip.h>
#include <rte_string_fns.h>

#include <rte_ip_frag.h>

struct rte_mempool *mempool = NULL;
#define NB_MBUF         8192
#define AERO_FRAG_SIZE  1024
#define PATH_MAX        4096

//static struct rte_mempool *socket_direct_pool[RTE_MAX_NUMA_NODES];

int
main(int argc, char **argv)
{

        struct rte_mbuf *mbuf = NULL;
        struct node_queue_conf *qconf;

        char buf[PATH_MAX];
        struct rte_mempool *mp;
        struct rte_lpm *lpm;
        struct rte_lpm6 *lpm6;
        struct rte_lpm_config lpm_config; /*KT Readded*/
        int socket;
        unsigned lcore_id;

        unsigned elt_size;

        lcore_id = 1;
        socket = rte_lcore_to_socket_id(lcore_id);

        if (rte_lcore_is_enabled(lcore_id) == 0)
                printf("RTE LCORE is enabled!");

        socket = rte_lcore_to_socket_id(lcore_id);
        if (socket == SOCKET_ID_ANY)
                socket = 0;

        elt_size = sizeof(struct rte_mbuf) + (unsigned)RTE_MBUF_DEFAULT_BUF_SIZE;

        //mp = rte_mempool_create_empty(buf, NB_MBUF, elt_size, RTE_MBUF_DEFAULT_BUF_SIZE, sizeof(struct rte_pktmbuf_pool_private), socket, 0);

        mp = rte_pktmbuf_pool_create(buf, NB_MBUF, 32, 0, RTE_MBUF_DEFAULT_BUF_SIZE, socket);

/*
        if (socket_direct_pool[socket] == NULL) {
                RTE_LOG(INFO, IP_FRAG, "Creating direct mempool on socket %i\n",
                                socket);
                snprintf(buf, sizeof(buf), "pool_direct_%i", socket);

                mp = rte_pktmbuf_pool_create(buf, NB_MBUF, 32,
                        0, AERO_FRAG_SIZE, socket);

                if (mp == NULL) {
                        RTE_LOG(ERR, IP_FRAG, "Cannot create direct mempool\n");
                        return -1;
                }
                socket_direct_pool[socket] = mp;

        }
*/
        //mbuf = rte_pktmbuf_alloc(mp);

        //fragment(mbuf, qconf);


}

------------------------------------------


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fragment.c
URL: <http://mails.dpdk.org/archives/users/attachments/20190917/3e7f791b/attachment.c>

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

* Re: [dpdk-users] Help with mbuf and mempool
  2019-09-17 23:32   ` Suraj R Gupta
@ 2019-09-18 14:31     ` Tran (US), Katherine K
  2019-09-18 14:36       ` Arvind Narayanan
  0 siblings, 1 reply; 7+ messages in thread
From: Tran (US), Katherine K @ 2019-09-18 14:31 UTC (permalink / raw)
  To: Suraj R Gupta, Singh, Satish 1. (Nokia - IN/Bangalore); +Cc: users

Hi,

I have allocated hugepages. I still get the same error.

I changed the code to the following but I still get the same error:

------------- Code ---------------

struct rte_mempool *mempool = NULL;
#define NB_MBUF           8192
#define PATH_MAX        4096

int
main(int argc, char **argv)
{

               struct rte_mbuf *mbuf = NULL;
               char buf[PATH_MAX];
               struct rte_mempool *mp;
               int socket;

               socket = SOCKET_ID_ANY;
               mp = rte_pktmbuf_pool_create(buf, NB_MBUF, 32, 0, RTE_MBUF_DEFAULT_BUF_SIZE, socket);

}

regards,
Katie

From: Suraj R Gupta [mailto:surajrgupta@iith.ac.in]
Sent: Tuesday, September 17, 2019 4:33 PM
To: Singh, Satish 1. (Nokia - IN/Bangalore) <satish.1.singh@nokia.com>
Cc: Tran (US), Katherine K <katherine.k.tran@boeing.com>; users@dpdk.org
Subject: Re: [dpdk-users] Help with mbuf and mempool

Make sure you have allocated hugepages before running the application

On Wed, Sep 18, 2019 at 9:42 AM Singh, Satish 1. (Nokia - IN/Bangalore) <satish.1.singh@nokia.com<mailto:satish.1.singh@nokia.com>> wrote:
Hi,

You are using Socket 0, and might be there is no memory in this socket or no memory left in this socket 0. Try with SOCKET_ID_ANY.

Regards,
SATISH SINGH

-----Original Message-----
From: users <users-bounces@dpdk.org<mailto:users-bounces@dpdk.org>> On Behalf Of Tran (US), Katherine K
Sent: Tuesday, September 17, 2019 11:36 PM
To: users@dpdk.org<mailto:users@dpdk.org>
Subject: [dpdk-users] Help with mbuf and mempool

Hello,

I am trying to allocate an mbuf to use for IP fragmentation. When instantiating a mempool using rte_pktmbuf_pool_create() function, I keep getting the following error message.

Error Message:
* MEMPOOL: Cannot allocate tailq entry!

Will you please let me know what I am missing?

Regards,
Katie


--------------- Code ---------------------

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#include <sys/types.h>
#include <sys/param.h>
#include <string.h>
#include <sys/queue.h>
#include <stdarg.h>
#include <errno.h>
#include <getopt.h>

#include <rte_common.h>
#include <rte_byteorder.h>
#include <rte_log.h>
#include <rte_memory.h>
#include <rte_memcpy.h>
#include <rte_memzone.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_launch.h>
#include <rte_atomic.h>
#include <rte_cycles.h>
#include <rte_prefetch.h>
#include <rte_lcore.h>
#include <rte_per_lcore.h>
#include <rte_branch_prediction.h>
#include <rte_interrupts.h>
#include <rte_pci.h>
#include <rte_random.h>
#include <rte_debug.h>
#include <rte_ether.h>
#include <rte_ethdev.h>
#include <rte_ring.h>
#include <rte_mempool.h>
#include <rte_mbuf.h>
#include <rte_lpm.h>
#include <rte_lpm6.h>
#include <rte_ip.h>
#include <rte_string_fns.h>

#include <rte_ip_frag.h>

struct rte_mempool *mempool = NULL;
#define NB_MBUF         8192
#define AERO_FRAG_SIZE  1024
#define PATH_MAX        4096

//static struct rte_mempool *socket_direct_pool[RTE_MAX_NUMA_NODES];

int
main(int argc, char **argv)
{

        struct rte_mbuf *mbuf = NULL;
        struct node_queue_conf *qconf;

        char buf[PATH_MAX];
        struct rte_mempool *mp;
        struct rte_lpm *lpm;
        struct rte_lpm6 *lpm6;
        struct rte_lpm_config lpm_config; /*KT Readded*/
        int socket;
        unsigned lcore_id;

        unsigned elt_size;

        lcore_id = 1;
        socket = rte_lcore_to_socket_id(lcore_id);

        if (rte_lcore_is_enabled(lcore_id) == 0)
                printf("RTE LCORE is enabled!");

        socket = rte_lcore_to_socket_id(lcore_id);
        if (socket == SOCKET_ID_ANY)
                socket = 0;

        elt_size = sizeof(struct rte_mbuf) + (unsigned)RTE_MBUF_DEFAULT_BUF_SIZE;

        //mp = rte_mempool_create_empty(buf, NB_MBUF, elt_size, RTE_MBUF_DEFAULT_BUF_SIZE, sizeof(struct rte_pktmbuf_pool_private), socket, 0);

        mp = rte_pktmbuf_pool_create(buf, NB_MBUF, 32, 0, RTE_MBUF_DEFAULT_BUF_SIZE, socket);

/*
        if (socket_direct_pool[socket] == NULL) {
                RTE_LOG(INFO, IP_FRAG, "Creating direct mempool on socket %i\n",
                                socket);
                snprintf(buf, sizeof(buf), "pool_direct_%i", socket);

                mp = rte_pktmbuf_pool_create(buf, NB_MBUF, 32,
                        0, AERO_FRAG_SIZE, socket);

                if (mp == NULL) {
                        RTE_LOG(ERR, IP_FRAG, "Cannot create direct mempool\n");
                        return -1;
                }
                socket_direct_pool[socket] = mp;

        }
*/
        //mbuf = rte_pktmbuf_alloc(mp);

        //fragment(mbuf, qconf);


}

------------------------------------------


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fragment.c
URL: <http://mails.dpdk.org/archives/users/attachments/20190917/3e7f791b/attachment.c>


--
Thanks and Regards
Suraj R Gupta

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

* Re: [dpdk-users] Help with mbuf and mempool
  2019-09-18 14:31     ` Tran (US), Katherine K
@ 2019-09-18 14:36       ` Arvind Narayanan
  2019-09-18 14:55         ` Suraj R Gupta
  0 siblings, 1 reply; 7+ messages in thread
From: Arvind Narayanan @ 2019-09-18 14:36 UTC (permalink / raw)
  To: Tran (US), Katherine K
  Cc: Suraj R Gupta, Singh, Satish 1. (Nokia - IN/Bangalore), users

Not sure, did you try to initialize the EAL first before creating mempool,
etc.?
rte_eal_init()
<https://doc.dpdk.org/api/rte__eal_8h.html#a5c3f4dddc25e38c5a186ecd8a69260e3>

Arvind


On Wed, Sep 18, 2019 at 9:31 AM Tran (US), Katherine K <
katherine.k.tran@boeing.com> wrote:

> Hi,
>
> I have allocated hugepages. I still get the same error.
>
> I changed the code to the following but I still get the same error:
>
> ------------- Code ---------------
>
> struct rte_mempool *mempool = NULL;
> #define NB_MBUF           8192
> #define PATH_MAX        4096
>
> int
> main(int argc, char **argv)
> {
>
>                struct rte_mbuf *mbuf = NULL;
>                char buf[PATH_MAX];
>                struct rte_mempool *mp;
>                int socket;
>
>                socket = SOCKET_ID_ANY;
>                mp = rte_pktmbuf_pool_create(buf, NB_MBUF, 32, 0,
> RTE_MBUF_DEFAULT_BUF_SIZE, socket);
>
> }
>
> regards,
> Katie
>
> From: Suraj R Gupta [mailto:surajrgupta@iith.ac.in]
> Sent: Tuesday, September 17, 2019 4:33 PM
> To: Singh, Satish 1. (Nokia - IN/Bangalore) <satish.1.singh@nokia.com>
> Cc: Tran (US), Katherine K <katherine.k.tran@boeing.com>; users@dpdk.org
> Subject: Re: [dpdk-users] Help with mbuf and mempool
>
> Make sure you have allocated hugepages before running the application
>
> On Wed, Sep 18, 2019 at 9:42 AM Singh, Satish 1. (Nokia - IN/Bangalore) <
> satish.1.singh@nokia.com<mailto:satish.1.singh@nokia.com>> wrote:
> Hi,
>
> You are using Socket 0, and might be there is no memory in this socket or
> no memory left in this socket 0. Try with SOCKET_ID_ANY.
>
> Regards,
> SATISH SINGH
>
> -----Original Message-----
> From: users <users-bounces@dpdk.org<mailto:users-bounces@dpdk.org>> On
> Behalf Of Tran (US), Katherine K
> Sent: Tuesday, September 17, 2019 11:36 PM
> To: users@dpdk.org<mailto:users@dpdk.org>
> Subject: [dpdk-users] Help with mbuf and mempool
>
> Hello,
>
> I am trying to allocate an mbuf to use for IP fragmentation. When
> instantiating a mempool using rte_pktmbuf_pool_create() function, I keep
> getting the following error message.
>
> Error Message:
> * MEMPOOL: Cannot allocate tailq entry!
>
> Will you please let me know what I am missing?
>
> Regards,
> Katie
>
>
> --------------- Code ---------------------
>
> #include <stdio.h>
> #include <stdlib.h>
> #include <stdint.h>
> #include <inttypes.h>
> #include <sys/types.h>
> #include <sys/param.h>
> #include <string.h>
> #include <sys/queue.h>
> #include <stdarg.h>
> #include <errno.h>
> #include <getopt.h>
>
> #include <rte_common.h>
> #include <rte_byteorder.h>
> #include <rte_log.h>
> #include <rte_memory.h>
> #include <rte_memcpy.h>
> #include <rte_memzone.h>
> #include <rte_eal.h>
> #include <rte_per_lcore.h>
> #include <rte_launch.h>
> #include <rte_atomic.h>
> #include <rte_cycles.h>
> #include <rte_prefetch.h>
> #include <rte_lcore.h>
> #include <rte_per_lcore.h>
> #include <rte_branch_prediction.h>
> #include <rte_interrupts.h>
> #include <rte_pci.h>
> #include <rte_random.h>
> #include <rte_debug.h>
> #include <rte_ether.h>
> #include <rte_ethdev.h>
> #include <rte_ring.h>
> #include <rte_mempool.h>
> #include <rte_mbuf.h>
> #include <rte_lpm.h>
> #include <rte_lpm6.h>
> #include <rte_ip.h>
> #include <rte_string_fns.h>
>
> #include <rte_ip_frag.h>
>
> struct rte_mempool *mempool = NULL;
> #define NB_MBUF         8192
> #define AERO_FRAG_SIZE  1024
> #define PATH_MAX        4096
>
> //static struct rte_mempool *socket_direct_pool[RTE_MAX_NUMA_NODES];
>
> int
> main(int argc, char **argv)
> {
>
>         struct rte_mbuf *mbuf = NULL;
>         struct node_queue_conf *qconf;
>
>         char buf[PATH_MAX];
>         struct rte_mempool *mp;
>         struct rte_lpm *lpm;
>         struct rte_lpm6 *lpm6;
>         struct rte_lpm_config lpm_config; /*KT Readded*/
>         int socket;
>         unsigned lcore_id;
>
>         unsigned elt_size;
>
>         lcore_id = 1;
>         socket = rte_lcore_to_socket_id(lcore_id);
>
>         if (rte_lcore_is_enabled(lcore_id) == 0)
>                 printf("RTE LCORE is enabled!");
>
>         socket = rte_lcore_to_socket_id(lcore_id);
>         if (socket == SOCKET_ID_ANY)
>                 socket = 0;
>
>         elt_size = sizeof(struct rte_mbuf) +
> (unsigned)RTE_MBUF_DEFAULT_BUF_SIZE;
>
>         //mp = rte_mempool_create_empty(buf, NB_MBUF, elt_size,
> RTE_MBUF_DEFAULT_BUF_SIZE, sizeof(struct rte_pktmbuf_pool_private), socket,
> 0);
>
>         mp = rte_pktmbuf_pool_create(buf, NB_MBUF, 32, 0,
> RTE_MBUF_DEFAULT_BUF_SIZE, socket);
>
> /*
>         if (socket_direct_pool[socket] == NULL) {
>                 RTE_LOG(INFO, IP_FRAG, "Creating direct mempool on socket
> %i\n",
>                                 socket);
>                 snprintf(buf, sizeof(buf), "pool_direct_%i", socket);
>
>                 mp = rte_pktmbuf_pool_create(buf, NB_MBUF, 32,
>                         0, AERO_FRAG_SIZE, socket);
>
>                 if (mp == NULL) {
>                         RTE_LOG(ERR, IP_FRAG, "Cannot create direct
> mempool\n");
>                         return -1;
>                 }
>                 socket_direct_pool[socket] = mp;
>
>         }
> */
>         //mbuf = rte_pktmbuf_alloc(mp);
>
>         //fragment(mbuf, qconf);
>
>
> }
>
> ------------------------------------------
>
>
> -------------- next part --------------
> An embedded and charset-unspecified text was scrubbed...
> Name: fragment.c
> URL: <
> http://mails.dpdk.org/archives/users/attachments/20190917/3e7f791b/attachment.c
> >
>
>
> --
> Thanks and Regards
> Suraj R Gupta
>

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

* Re: [dpdk-users] Help with mbuf and mempool
  2019-09-18 14:36       ` Arvind Narayanan
@ 2019-09-18 14:55         ` Suraj R Gupta
  2019-09-19 21:55           ` Tran (US), Katherine K
  0 siblings, 1 reply; 7+ messages in thread
From: Suraj R Gupta @ 2019-09-18 14:55 UTC (permalink / raw)
  To: Arvind Narayanan
  Cc: Tran (US), Katherine K, Singh, Satish 1. (Nokia - IN/Bangalore), users

Also char buf[PATH_MAX] is not initialised or assigned any value. Assign a
name to it.
The PATH_MAX need not be 4096, use a lesser value say 100.

On Wed, Sep 18, 2019 at 8:07 PM Arvind Narayanan <webguru2688@gmail.com>
wrote:

> Not sure, did you try to initialize the EAL first before creating mempool,
> etc.?
> rte_eal_init()
> <https://doc.dpdk.org/api/rte__eal_8h.html#a5c3f4dddc25e38c5a186ecd8a69260e3>
>
> Arvind
>
>
> On Wed, Sep 18, 2019 at 9:31 AM Tran (US), Katherine K <
> katherine.k.tran@boeing.com> wrote:
>
>> Hi,
>>
>> I have allocated hugepages. I still get the same error.
>>
>> I changed the code to the following but I still get the same error:
>>
>> ------------- Code ---------------
>>
>> struct rte_mempool *mempool = NULL;
>> #define NB_MBUF           8192
>> #define PATH_MAX        4096
>>
>> int
>> main(int argc, char **argv)
>> {
>>
>>                struct rte_mbuf *mbuf = NULL;
>>                char buf[PATH_MAX];
>>                struct rte_mempool *mp;
>>                int socket;
>>
>>                socket = SOCKET_ID_ANY;
>>                mp = rte_pktmbuf_pool_create(buf, NB_MBUF, 32, 0,
>> RTE_MBUF_DEFAULT_BUF_SIZE, socket);
>>
>> }
>>
>> regards,
>> Katie
>>
>> From: Suraj R Gupta [mailto:surajrgupta@iith.ac.in]
>> Sent: Tuesday, September 17, 2019 4:33 PM
>> To: Singh, Satish 1. (Nokia - IN/Bangalore) <satish.1.singh@nokia.com>
>> Cc: Tran (US), Katherine K <katherine.k.tran@boeing.com>; users@dpdk.org
>> Subject: Re: [dpdk-users] Help with mbuf and mempool
>>
>> Make sure you have allocated hugepages before running the application
>>
>> On Wed, Sep 18, 2019 at 9:42 AM Singh, Satish 1. (Nokia - IN/Bangalore) <
>> satish.1.singh@nokia.com<mailto:satish.1.singh@nokia.com>> wrote:
>> Hi,
>>
>> You are using Socket 0, and might be there is no memory in this socket or
>> no memory left in this socket 0. Try with SOCKET_ID_ANY.
>>
>> Regards,
>> SATISH SINGH
>>
>> -----Original Message-----
>> From: users <users-bounces@dpdk.org<mailto:users-bounces@dpdk.org>> On
>> Behalf Of Tran (US), Katherine K
>> Sent: Tuesday, September 17, 2019 11:36 PM
>> To: users@dpdk.org<mailto:users@dpdk.org>
>> Subject: [dpdk-users] Help with mbuf and mempool
>>
>> Hello,
>>
>> I am trying to allocate an mbuf to use for IP fragmentation. When
>> instantiating a mempool using rte_pktmbuf_pool_create() function, I keep
>> getting the following error message.
>>
>> Error Message:
>> * MEMPOOL: Cannot allocate tailq entry!
>>
>> Will you please let me know what I am missing?
>>
>> Regards,
>> Katie
>>
>>
>> --------------- Code ---------------------
>>
>> #include <stdio.h>
>> #include <stdlib.h>
>> #include <stdint.h>
>> #include <inttypes.h>
>> #include <sys/types.h>
>> #include <sys/param.h>
>> #include <string.h>
>> #include <sys/queue.h>
>> #include <stdarg.h>
>> #include <errno.h>
>> #include <getopt.h>
>>
>> #include <rte_common.h>
>> #include <rte_byteorder.h>
>> #include <rte_log.h>
>> #include <rte_memory.h>
>> #include <rte_memcpy.h>
>> #include <rte_memzone.h>
>> #include <rte_eal.h>
>> #include <rte_per_lcore.h>
>> #include <rte_launch.h>
>> #include <rte_atomic.h>
>> #include <rte_cycles.h>
>> #include <rte_prefetch.h>
>> #include <rte_lcore.h>
>> #include <rte_per_lcore.h>
>> #include <rte_branch_prediction.h>
>> #include <rte_interrupts.h>
>> #include <rte_pci.h>
>> #include <rte_random.h>
>> #include <rte_debug.h>
>> #include <rte_ether.h>
>> #include <rte_ethdev.h>
>> #include <rte_ring.h>
>> #include <rte_mempool.h>
>> #include <rte_mbuf.h>
>> #include <rte_lpm.h>
>> #include <rte_lpm6.h>
>> #include <rte_ip.h>
>> #include <rte_string_fns.h>
>>
>> #include <rte_ip_frag.h>
>>
>> struct rte_mempool *mempool = NULL;
>> #define NB_MBUF         8192
>> #define AERO_FRAG_SIZE  1024
>> #define PATH_MAX        4096
>>
>> //static struct rte_mempool *socket_direct_pool[RTE_MAX_NUMA_NODES];
>>
>> int
>> main(int argc, char **argv)
>> {
>>
>>         struct rte_mbuf *mbuf = NULL;
>>         struct node_queue_conf *qconf;
>>
>>         char buf[PATH_MAX];
>>         struct rte_mempool *mp;
>>         struct rte_lpm *lpm;
>>         struct rte_lpm6 *lpm6;
>>         struct rte_lpm_config lpm_config; /*KT Readded*/
>>         int socket;
>>         unsigned lcore_id;
>>
>>         unsigned elt_size;
>>
>>         lcore_id = 1;
>>         socket = rte_lcore_to_socket_id(lcore_id);
>>
>>         if (rte_lcore_is_enabled(lcore_id) == 0)
>>                 printf("RTE LCORE is enabled!");
>>
>>         socket = rte_lcore_to_socket_id(lcore_id);
>>         if (socket == SOCKET_ID_ANY)
>>                 socket = 0;
>>
>>         elt_size = sizeof(struct rte_mbuf) +
>> (unsigned)RTE_MBUF_DEFAULT_BUF_SIZE;
>>
>>         //mp = rte_mempool_create_empty(buf, NB_MBUF, elt_size,
>> RTE_MBUF_DEFAULT_BUF_SIZE, sizeof(struct rte_pktmbuf_pool_private), socket,
>> 0);
>>
>>         mp = rte_pktmbuf_pool_create(buf, NB_MBUF, 32, 0,
>> RTE_MBUF_DEFAULT_BUF_SIZE, socket);
>>
>> /*
>>         if (socket_direct_pool[socket] == NULL) {
>>                 RTE_LOG(INFO, IP_FRAG, "Creating direct mempool on socket
>> %i\n",
>>                                 socket);
>>                 snprintf(buf, sizeof(buf), "pool_direct_%i", socket);
>>
>>                 mp = rte_pktmbuf_pool_create(buf, NB_MBUF, 32,
>>                         0, AERO_FRAG_SIZE, socket);
>>
>>                 if (mp == NULL) {
>>                         RTE_LOG(ERR, IP_FRAG, "Cannot create direct
>> mempool\n");
>>                         return -1;
>>                 }
>>                 socket_direct_pool[socket] = mp;
>>
>>         }
>> */
>>         //mbuf = rte_pktmbuf_alloc(mp);
>>
>>         //fragment(mbuf, qconf);
>>
>>
>> }
>>
>> ------------------------------------------
>>
>>
>> -------------- next part --------------
>> An embedded and charset-unspecified text was scrubbed...
>> Name: fragment.c
>> URL: <
>> http://mails.dpdk.org/archives/users/attachments/20190917/3e7f791b/attachment.c
>> >
>>
>>
>> --
>> Thanks and Regards
>> Suraj R Gupta
>>
>

-- 
Thanks and Regards
Suraj R Gupta

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

* Re: [dpdk-users] Help with mbuf and mempool
  2019-09-18 14:55         ` Suraj R Gupta
@ 2019-09-19 21:55           ` Tran (US), Katherine K
  0 siblings, 0 replies; 7+ messages in thread
From: Tran (US), Katherine K @ 2019-09-19 21:55 UTC (permalink / raw)
  To: Suraj R Gupta, Arvind Narayanan
  Cc: Singh, Satish 1. (Nokia - IN/Bangalore), users

Thank you – The rte_eal_init() function helped to resolve the compile error.

From: Suraj R Gupta [mailto:surajrgupta@iith.ac.in]
Sent: Wednesday, September 18, 2019 7:55 AM
To: Arvind Narayanan <webguru2688@gmail.com>
Cc: Tran (US), Katherine K <katherine.k.tran@boeing.com>; Singh, Satish 1. (Nokia - IN/Bangalore) <satish.1.singh@nokia.com>; users@dpdk.org
Subject: Re: [dpdk-users] Help with mbuf and mempool

Also char buf[PATH_MAX] is not initialised or assigned any value. Assign a name to it.
The PATH_MAX need not be 4096, use a lesser value say 100.

On Wed, Sep 18, 2019 at 8:07 PM Arvind Narayanan <webguru2688@gmail.com<mailto:webguru2688@gmail.com>> wrote:
Not sure, did you try to initialize the EAL first before creating mempool, etc.?
rte_eal_init()<https://doc.dpdk.org/api/rte__eal_8h.html#a5c3f4dddc25e38c5a186ecd8a69260e3>

Arvind

On Wed, Sep 18, 2019 at 9:31 AM Tran (US), Katherine K <katherine.k.tran@boeing.com<mailto:katherine.k.tran@boeing.com>> wrote:
Hi,

I have allocated hugepages. I still get the same error.

I changed the code to the following but I still get the same error:

------------- Code ---------------

struct rte_mempool *mempool = NULL;
#define NB_MBUF           8192
#define PATH_MAX        4096

int
main(int argc, char **argv)
{

               struct rte_mbuf *mbuf = NULL;
               char buf[PATH_MAX];
               struct rte_mempool *mp;
               int socket;

               socket = SOCKET_ID_ANY;
               mp = rte_pktmbuf_pool_create(buf, NB_MBUF, 32, 0, RTE_MBUF_DEFAULT_BUF_SIZE, socket);

}

regards,
Katie

From: Suraj R Gupta [mailto:surajrgupta@iith.ac.in<mailto:surajrgupta@iith.ac.in>]
Sent: Tuesday, September 17, 2019 4:33 PM
To: Singh, Satish 1. (Nokia - IN/Bangalore) <satish.1.singh@nokia.com<mailto:satish.1.singh@nokia.com>>
Cc: Tran (US), Katherine K <katherine.k.tran@boeing.com<mailto:katherine.k.tran@boeing.com>>; users@dpdk.org<mailto:users@dpdk.org>
Subject: Re: [dpdk-users] Help with mbuf and mempool

Make sure you have allocated hugepages before running the application

On Wed, Sep 18, 2019 at 9:42 AM Singh, Satish 1. (Nokia - IN/Bangalore) <satish.1.singh@nokia.com<mailto:satish.1.singh@nokia.com><mailto:satish.1.singh@nokia.com<mailto:satish.1.singh@nokia.com>>> wrote:
Hi,

You are using Socket 0, and might be there is no memory in this socket or no memory left in this socket 0. Try with SOCKET_ID_ANY.

Regards,
SATISH SINGH

-----Original Message-----
From: users <users-bounces@dpdk.org<mailto:users-bounces@dpdk.org><mailto:users-bounces@dpdk.org<mailto:users-bounces@dpdk.org>>> On Behalf Of Tran (US), Katherine K
Sent: Tuesday, September 17, 2019 11:36 PM
To: users@dpdk.org<mailto:users@dpdk.org><mailto:users@dpdk.org<mailto:users@dpdk.org>>
Subject: [dpdk-users] Help with mbuf and mempool

Hello,

I am trying to allocate an mbuf to use for IP fragmentation. When instantiating a mempool using rte_pktmbuf_pool_create() function, I keep getting the following error message.

Error Message:
* MEMPOOL: Cannot allocate tailq entry!

Will you please let me know what I am missing?

Regards,
Katie


--------------- Code ---------------------

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#include <sys/types.h>
#include <sys/param.h>
#include <string.h>
#include <sys/queue.h>
#include <stdarg.h>
#include <errno.h>
#include <getopt.h>

#include <rte_common.h>
#include <rte_byteorder.h>
#include <rte_log.h>
#include <rte_memory.h>
#include <rte_memcpy.h>
#include <rte_memzone.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_launch.h>
#include <rte_atomic.h>
#include <rte_cycles.h>
#include <rte_prefetch.h>
#include <rte_lcore.h>
#include <rte_per_lcore.h>
#include <rte_branch_prediction.h>
#include <rte_interrupts.h>
#include <rte_pci.h>
#include <rte_random.h>
#include <rte_debug.h>
#include <rte_ether.h>
#include <rte_ethdev.h>
#include <rte_ring.h>
#include <rte_mempool.h>
#include <rte_mbuf.h>
#include <rte_lpm.h>
#include <rte_lpm6.h>
#include <rte_ip.h>
#include <rte_string_fns.h>

#include <rte_ip_frag.h>

struct rte_mempool *mempool = NULL;
#define NB_MBUF         8192
#define AERO_FRAG_SIZE  1024
#define PATH_MAX        4096

//static struct rte_mempool *socket_direct_pool[RTE_MAX_NUMA_NODES];

int
main(int argc, char **argv)
{

        struct rte_mbuf *mbuf = NULL;
        struct node_queue_conf *qconf;

        char buf[PATH_MAX];
        struct rte_mempool *mp;
        struct rte_lpm *lpm;
        struct rte_lpm6 *lpm6;
        struct rte_lpm_config lpm_config; /*KT Readded*/
        int socket;
        unsigned lcore_id;

        unsigned elt_size;

        lcore_id = 1;
        socket = rte_lcore_to_socket_id(lcore_id);

        if (rte_lcore_is_enabled(lcore_id) == 0)
                printf("RTE LCORE is enabled!");

        socket = rte_lcore_to_socket_id(lcore_id);
        if (socket == SOCKET_ID_ANY)
                socket = 0;

        elt_size = sizeof(struct rte_mbuf) + (unsigned)RTE_MBUF_DEFAULT_BUF_SIZE;

        //mp = rte_mempool_create_empty(buf, NB_MBUF, elt_size, RTE_MBUF_DEFAULT_BUF_SIZE, sizeof(struct rte_pktmbuf_pool_private), socket, 0);

        mp = rte_pktmbuf_pool_create(buf, NB_MBUF, 32, 0, RTE_MBUF_DEFAULT_BUF_SIZE, socket);

/*
        if (socket_direct_pool[socket] == NULL) {
                RTE_LOG(INFO, IP_FRAG, "Creating direct mempool on socket %i\n",
                                socket);
                snprintf(buf, sizeof(buf), "pool_direct_%i", socket);

                mp = rte_pktmbuf_pool_create(buf, NB_MBUF, 32,
                        0, AERO_FRAG_SIZE, socket);

                if (mp == NULL) {
                        RTE_LOG(ERR, IP_FRAG, "Cannot create direct mempool\n");
                        return -1;
                }
                socket_direct_pool[socket] = mp;

        }
*/
        //mbuf = rte_pktmbuf_alloc(mp);

        //fragment(mbuf, qconf);


}

------------------------------------------


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fragment.c
URL: <http://mails.dpdk.org/archives/users/attachments/20190917/3e7f791b/attachment.c>


--
Thanks and Regards
Suraj R Gupta


--
Thanks and Regards
Suraj R Gupta

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

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-17 18:05 [dpdk-users] Help with mbuf and mempool Tran (US), Katherine K
2019-09-18  4:12 ` Singh, Satish 1. (Nokia - IN/Bangalore)
2019-09-17 23:32   ` Suraj R Gupta
2019-09-18 14:31     ` Tran (US), Katherine K
2019-09-18 14:36       ` Arvind Narayanan
2019-09-18 14:55         ` Suraj R Gupta
2019-09-19 21:55           ` Tran (US), Katherine K

DPDK usage discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/users/0 users/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 users users/ http://inbox.dpdk.org/users \
		users@dpdk.org
	public-inbox-index users


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.users


AGPL code for this site: git clone https://public-inbox.org/ public-inbox