Go to file
Jianfeng Tan a33c81e38c ethdev: fix secondary process crash on unused virtio
Suppose we have 2 virtio devices for a VM, with only the first one,
virtio0, binding to igb_uio. Start a primary DPDK process, driving
only virtio0. Then start a secondary DPDK process, it encounters
segfault at eth_virtio_dev_init() because hw is NULL, when trying
to initialize the 2nd virtio devices.
    1539                    if (!hw->virtio_user_dev) {

We could add a precheck to return error when hw is NULL. But the
root cause is that virtio devices which are not driven by the primary
process are not exluded by secondary eal probe function.

To support legacy virtio devices bound to none kernel driver, we
removed RTE_PCI_DRV_NEED_MAPPING in
commit 962cf902e6 ("pci: export device mapping functions").
At the boot of primary process, ether dev is allocated in rte_eth_devices
array, rte_eth_dev_data is also allocated in rte_eth_dev_data array; then
probe function fails; and ether dev is released. However, the entry in
rte_eth_dev_data array is not cleared. Then we start secondary process,
and try to attach the virtio device that not used in primary process,
the field, dev_private (or hw), in rte_eth_dev_data, is NULL.

To fail the dev attach, we need to clear the field, name, when we
release any ether devices in primary, so that below loop in
rte_eth_dev_attach_secondary() will not find any matched names.
        for (i = 0; i < RTE_MAX_ETHPORTS; i++) {
                if (strcmp(rte_eth_dev_data[i].name, name) == 0)
                        break;
        }

Fixes: 6d890f8ab5 ("net/virtio: fix multiple process support")
Cc: stable@dpdk.org

Reported-by: Reshma Pattan <reshma.pattan@intel.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
2017-07-05 12:10:40 +02:00
app ethdev: use device handle to detach 2017-07-04 01:22:19 +02:00
buildtools mk: optimize directory dependencies 2017-03-27 23:28:43 +02:00
config config: support clang for ARMv8 Linux 2017-07-03 22:28:19 +02:00
devtools mem: balanced allocation of hugepages 2017-06-30 17:54:32 +02:00
doc eal: introduce architecture specific pause function 2017-07-03 23:57:49 +02:00
drivers net/ixgbe: remove fallback code for x86 non-SSE4 2017-07-04 14:39:18 +02:00
examples examples/l3fwd: add loop count for hash multi-lookup 2017-07-04 17:41:53 +02:00
lib ethdev: fix secondary process crash on unused virtio 2017-07-05 12:10:40 +02:00
mk mk: add crypto capability for armv8a and thunderx 2017-07-04 15:56:58 +02:00
pkg version: 17.05.0 2017-05-11 03:11:34 +02:00
test net: implement CRC for ARM64 NEON 2017-07-04 15:58:45 +02:00
usertools usertools: add Cavium pkx as network device 2017-05-07 14:32:17 +02:00
.gitattributes improve git diff 2016-11-13 15:25:12 +01:00
.gitignore devtools: add tags and cscope index generation 2017-04-30 12:57:04 +02:00
GNUmakefile mk: do not build tests by default 2017-02-28 16:04:18 +01:00
LICENSE.GPL
LICENSE.LGPL
MAINTAINERS net: implement CRC for ARM64 NEON 2017-07-04 15:58:45 +02:00
Makefile
README

DPDK is a set of libraries and drivers for fast packet processing.
It supports many processor architectures and both FreeBSD and Linux.

The DPDK uses the Open Source BSD license for the core libraries and
drivers. The kernel components are GPLv2 licensed.

Please check the doc directory for release notes,
API documentation, and sample application information.

For questions and usage discussions, subscribe to: users@dpdk.org
Report bugs and issues to the development mailing list: dev@dpdk.org