DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ogawa Yasufumi <yasufum.o@gmail.com>
To: dev@dpdk.org
Subject: [dpdk-dev] Failed to hotplug add a device from secondary process
Date: Thu, 11 Jul 2019 21:57:50 +0900	[thread overview]
Message-ID: <CAASPJr=VGDyv7Hm6bJxV750oEx4CGoBqyavTy686d0HhEJj2+Q@mail.gmail.com> (raw)

Hi all,

I have developed a multi-process app and am struggling to fix an error
while adding PMD from secondary process with hotplug feature. As we
reported in [1], I think it is because initializing hogplugged device is
changed to be done by primary first, then secondary. However,
initialization in secondary might work properly, so `rx_pkt_burst` and
`tx_pkt_burst` are NULL.

[1] https://bugs.dpdk.org/show_bug.cgi?id=194

It might happen other than vhost. I confirmed that ring and pcap PMD work
fine, but failed to run null PMD. I've got realized there is a bug in probe
function, such as rte_pmd_vhsot_probe() in
drivers/net/vhost/rte_eth_vhost.c, called from secondary.

I have fixed the issue in nullpmd by simply adding burst functions as
following. However, I'm not sure if it is correct way. In addition, cannot
fix for vhost because there are still some variables shold be setup in
secondary.

diff --git a/drivers/net/null/rte_eth_null.c
b/drivers/net/null/rte_eth_null.c
index 159c1c1fd..5e5b719c0 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -623,6 +623,13 @@ rte_pmd_null_probe(struct rte_vdev_device *dev)
                /* TODO: request info from primary to set up Rx and Tx */
                eth_dev->dev_ops = &ops;
                eth_dev->device = &dev->device;
+               if (packet_copy) {
+                       eth_dev->rx_pkt_burst = eth_null_copy_rx;
+                       eth_dev->tx_pkt_burst = eth_null_copy_tx;
+               } else {
+                       eth_dev->rx_pkt_burst = eth_null_rx;
+                       eth_dev->tx_pkt_burst = eth_null_tx;
+               }
                rte_eth_dev_probing_finish(eth_dev);
                return 0;


Could anyone help us for fixing the issue, or give us some advice?

Regards,
Yasufumi

                 reply	other threads:[~2019-07-11 12:59 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='CAASPJr=VGDyv7Hm6bJxV750oEx4CGoBqyavTy686d0HhEJj2+Q@mail.gmail.com' \
    --to=yasufum.o@gmail.com \
    --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 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).