DPDK usage discussions
 help / color / mirror / Atom feed
From: Nirmal R <raja.nirmalraj@gmail.com>
To: users@dpdk.org
Subject: Re: [dpdk-users] DPDK: IP reassemble segmentation fault for rte_ip_frag_table_create.
Date: Tue, 20 Oct 2020 11:49:21 +0200	[thread overview]
Message-ID: <CAPk29mLmgaMa4E6ZE5=QgkHTDM+=JO_p0VUp3Ey7HwofoeJLEQ@mail.gmail.com> (raw)
In-Reply-To: <CAPk29mLVRj4Yj_AtPnAbBzTxzPgtz8JXnHh8+j0SS7003DBa-w@mail.gmail.com>

Hello,

Issue resolved after assigning memory to each lcore. Thank you.

With Regards,
Nirmal

On Mon, Oct 19, 2020 at 12:35 PM Nirmal R <raja.nirmalraj@gmail.com> wrote:

> Hello,
>
>
>
> I am new to DPDK and writing the code in c++ language, currently working
> on IP reassembling the packets below is my sample code which is giving me
> segmentation fault for rte_ip_frag_table_create, I am unable to debug the
> issue. Much appreciated if someone can explain to me where did I go wrong
> and how to do it in a proper manner. At the moment I am finding it
> difficult. Thanks in advance.
>
>
>
> #define BUFFER_RING_SIZE 65536
>
> #define BUFFER_LENGTH 1500
>
> #define POOL_SIZE 8192
>
> #define POOL_CACHE_SIZE 256
>
>
>
> #define DEF_FLOW_NUM    0x1000
>
> #define DEF_FLOW_TTL    MS_PER_S
>
> #define IP_FRAG_TBL_BUCKET_ENTRIES  4
>
> static uint32_t max_flow_num = DEF_FLOW_NUM;
>
> static uint32_t max_flow_ttl = DEF_FLOW_TTL;
>
> #define RTE_LOGTYPE_IP_RSMBL RTE_LOGTYPE_USER1
>
>
>
> struct lcore_queue_conf {
>
>             struct rte_ip_frag_tbl *frag_tbl;
>
>             struct rte_ip_frag_death_row death_row;
>
> } __rte_cache_aligned;
>
>
>
>
>
> static inline int setup_queue_tbl(struct lcore_queue_conf *qconf)
>
> {
>
>     uint64_t frag_cycles = (rte_get_tsc_hz() + MS_PER_S - 1) / MS_PER_S *
> max_flow_ttl;
>
>     qconf->frag_tbl = rte_ip_frag_table_create(max_flow_num,
> IP_FRAG_TBL_BUCKET_ENTRIES, max_flow_num, frag_cycles, rte_socket_id());
>
>     if((qconf->frag_tbl) == NULL){
>
>                         RTE_LOG(ERR, IP_RSMBL, "Table Failed.");
>
>                         return -1;
>
>      }
>
>     return 0;
>
> }
>
>
>
> static int
>
> lcore_main()
>
> {
>
>             struct lcore_queue_conf *qconf;
>
>
>
>             if(setup_queue_tbl(qconf) != 0)
>
>             rte_exit(EXIT_FAILURE, "%s\n", rte_strerror(rte_errno));
>
>
>
> .
>
> .
>
> .
>
> .
>
>
>
> }
>
>
>
> int main(int argc, char *argv[])
>
> {
>
>
>
>             struct rte_mempool *mbuf_pool;
>
>             struct rte_ring *ring;
>
>             uint16_t portcheck;
>
>
>
>             /* catch ctrl-c so we can print on exit */
>
>             signal(SIGINT, int_handler);
>
>
>
>             /* EAL setup */
>
>             ret=rte_eal_init(argc, argv);
>
>             cout <<
> "=====================================================" << endl;
>
>             if(ret < 0)
>
>                         cout << EAL initialising failed." <<
> strerror(-ret) << endl;
>
>             else
>
>                         cout << EAL initialisation success." << endl;
>
>
>
>             /* Mempool creation */
>
>
>
>             mbuf_pool=rte_pktmbuf_pool_create("BUFFER", POOL_SIZE,
> POOL_CACHE_SIZE, 0, RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id());
>
>
>
>             if(mbuf_pool== NULL)
>
>             rte_exit(EXIT_FAILURE, "%s\n", rte_strerror(rte_errno));
>
> .
>
> .
>
> .
>
> .
>
>             /* Master core call */
>
>             lcore_main();
>
>
>
>             return 0;
>
> }
>
>
>
>
>
> EAL: Detected 12 lcore(s)
>
> EAL: Detected 1 NUMA nodes
>
> EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
>
> EAL: Selected IOVA mode 'VA'
>
> EAL: Probing VFIO support...
>
> EAL: VFIO support initialized
>
> EAL:   Invalid NUMA socket, default to 0
>
> EAL:   Invalid NUMA socket, default to 0
>
> EAL:   using IOMMU type 1 (Type 1)
>
> EAL: Probe PCI driver: net_ixgbe (8086:15d1) device: 0000:01:00.0 (socket
> 0)
>
> EAL:   Invalid NUMA socket, default to 0
>
> EAL: No legacy callbacks, legacy socket not created
>
> =====================================================
>
> EAL initialisation success.
>
> PORT 0: Ethernet configuration success.
>
> TX queue configuration success.
>
> RX queue configuration success.
>
> PORT 0: NIC started successfully.
>
> PORT 0: Enabled promiscuous mode.
>
> MAC Addr b4:96:91:3f:21:b6
>
> =====================================================
>
> USER1: rte_ip_frag_table_create: allocated of 6291584 bytes at socket 0
>
> Segmentation fault
>
>
>
> With Regards,
>
> Nirmal.
>
>

      reply	other threads:[~2020-10-20  9:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-19 10:35 Nirmal R
2020-10-20  9:49 ` Nirmal R [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPk29mLmgaMa4E6ZE5=QgkHTDM+=JO_p0VUp3Ey7HwofoeJLEQ@mail.gmail.com' \
    --to=raja.nirmalraj@gmail.com \
    --cc=users@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).