All of lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla@dpdk.org
To: dev@dpdk.org
Subject: [Bug 918] RTE EAL is unable to complete its work
Date: Mon, 27 Dec 2021 13:53:23 +0000	[thread overview]
Message-ID: <bug-918-3@http.bugs.dpdk.org/> (raw)

https://bugs.dpdk.org/show_bug.cgi?id=918

            Bug ID: 918
           Summary: RTE EAL is unable to complete its work
           Product: DPDK
           Version: 20.11
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: core
          Assignee: dev@dpdk.org
          Reporter: interferation3@gmail.com
  Target Milestone: ---

Hi guys,

I am one of two authors of Dataplane SDK, where a lot of C-based OOP modules.
Part of them is related to DPDK.

For example:

sb_class.dpdk.eal
sb_class.dpdk.lpm
sb_class.dpdk.mempool
sb_class.dpdk.ring
sb_class.netdev.dpdk
sb_class.netdev.dpdk.eth
sb_class.netdev.dpdk.eth.bonding
sb_class.netdev.dpdk.pcap
sb_class.netdev.dpdk.tap
sb_class.task.node.group.dpdk.eth
sb_class.task.node.group.dpdk.tap

I also have a module sb_class.hal (Hardware Abstraction Layer) his object runs
before sb_object.dpdk.eal and its task is to determine the hardware and
initialize the synonym table between DPDK device number and SDK object name.

Also sb_object.hal calls /usr/bin/dpdk-devbind.py script in order to connect
network cards to the required drivers.

that is, the order of initialization is as follows:

sb_object.some_project       - children initialization (they below)
sb_object.hal                - hardware detection, bind drivers
sb_object.dpdk.eal           - rte_eal_init
sb_object.dpdk.mempool       - rte_pktmbuf_pool_create
sb_object.netdev.dpdk.eth    - rte_eth_dev_configure queues etc
sb_object.lcore.scheduler.roundrobin - sb_lcore_launch
*** other objects ***

the application terminates in reverse order

and this is what I noticed when sb_object.dpdk.eal exits, I call the following
code (on the lcore that started everything)

void IMPLEMENTATION (object_free) (
    sb_status_t * a_out_err,
    sb_class_t * a_class,
    sb_object_t * a_obj)
{
    sb_object_dpdk_eal_t * obj
        = (sb_object_dpdk_eal_t *) a_obj;

    sb_object_super_class_free (a_out_err, a_class, a_obj);

    obj-> eal_cmd_line [0] = '\ 0';

#if RTE_VERSION_NUM (19, 2, 0, 0) <= RTE_VERSION
    {
        unsigned lcore_id;
        // wait for threads to stop
        // RTE_LCORE_FOREACH_WORKER (lcore_id) {
        RTE_LCORE_FOREACH (lcore_id) {
            rte_eal_wait_lcore (lcore_id);
        }
        // clean up the EAL
        rte_eal_cleanup ();
    }
#endif
}

and in gdb I still see that DPDK has not finished working and its threads are
still running.

how can I stop DPDK completely?

because when object_free of sb_object.hal is called, it attempts to bind
network cards back to the kernel stack, but DPDK is still running and the
parent would be killed as a result thole application would be marked as
"defunct" and only hardware reboot can help

Please tell me how to correctly shutdown DPDK so that:
all DPDK resources were freed
all threads created by DPDK were closed

Regards, screenshots attached


Hi guys,

I am one of two authors of Dataplane SDK, where a lot of C-based OOP modules.
Part of them is related to DPDK.

For example:

sb_class.dpdk.eal
sb_class.dpdk.lpm
sb_class.dpdk.mempool
sb_class.dpdk.ring
sb_class.netdev.dpdk
sb_class.netdev.dpdk.eth
sb_class.netdev.dpdk.eth.bonding
sb_class.netdev.dpdk.pcap
sb_class.netdev.dpdk.tap
sb_class.task.node.group.dpdk.eth
sb_class.task.node.group.dpdk.tap

I also have a module sb_class.hal (Hardware Abstraction Layer) his object runs
before sb_object.dpdk.eal and its task is to determine the hardware and
initialize the synonym table between DPDK device number and SDK object name.

Also sb_object.hal calls /usr/bin/dpdk-devbind.py script in order to connect
network cards to the required drivers.

that is, the order of initialization is as follows:

sb_object.some_project       - children initialization (they below)
sb_object.hal                - hardware detection, bind drivers
sb_object.dpdk.eal           - rte_eal_init
sb_object.dpdk.mempool       - rte_pktmbuf_pool_create
sb_object.netdev.dpdk.eth    - rte_eth_dev_configure queues etc
sb_object.lcore.scheduler.roundrobin - sb_lcore_launch
*** other objects ***

the application terminates in reverse order

and this is what I noticed when sb_object.dpdk.eal exits, I call the following
code (on the lcore that started everything)

void IMPLEMENTATION (object_free) (
    sb_status_t * a_out_err,
    sb_class_t * a_class,
    sb_object_t * a_obj)
{
    sb_object_dpdk_eal_t * obj
        = (sb_object_dpdk_eal_t *) a_obj;

    sb_object_super_class_free (a_out_err, a_class, a_obj);

    obj-> eal_cmd_line [0] = '\ 0';

#if RTE_VERSION_NUM (19, 2, 0, 0) <= RTE_VERSION
    {
        unsigned lcore_id;
        // wait for threads to stop
        // RTE_LCORE_FOREACH_WORKER (lcore_id) {
        RTE_LCORE_FOREACH (lcore_id) {
            rte_eal_wait_lcore (lcore_id);
        }
        // clean up the EAL
        rte_eal_cleanup ();
    }
#endif
}

and in gdb I still see that DPDK has not finished working and its threads are
still running.

how can I stop DPDK completely?

because when object_free of sb_object.hal is called, it attempts to bind
network cards back to the kernel stack, but DPDK is still running and the
parent would be killed as a result thole application would be marked as
"defunct" and only hardware reboot can help

Please tell me how to correctly shutdown DPDK so that:
all DPDK resources were freed
all threads created by DPDK were closed

Regards, screenshots attached

-- 
You are receiving this mail because:
You are the assignee for the bug.

                 reply	other threads:[~2021-12-27 13:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=bug-918-3@http.bugs.dpdk.org/ \
    --to=bugzilla@dpdk.org \
    --cc=dev@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.