numam-dpdk/drivers
Hyong Youb Kim 8d782f3f89 net/enic: allocate stats DMA buffer upfront during probe
The driver provides a DMA buffer to the firmware when it requests port
stats. The NIC then fills that buffer with latest stats. Currently,
the driver allocates the DMA buffer the first time it requests stats
and saves it for later use. This can lead to crashes when
primary/secondary processes are involved. For example, the following
sequence crashes the secondary process.

1. Start a primary app that does not call rte_eth_stats_get()
2. dpdk-procinfo -- --stats

dpdk-procinfo crashes while trying to allocate the stats DMA buffer
because the alloc function pointer (vdev.alloc_consistent) is valid
only in the primary process, not in the secondary process.

Overwriting the alloc function pointer in the secondary process is not
an option, as it will simply make the pointer invalid in the primary
process. Instead, allocate the DMA buffer during probe so that only
the primary process does both allocate and free. This allows the
secondary process to dump stats as well.

Fixes: 9913fbb91d ("enic/base: common code")
Cc: stable@dpdk.org

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2018-03-30 14:08:43 +02:00
..
baseband drivers: rename bbdev directory to baseband 2018-03-21 22:43:05 +01:00
bus bus/vdev: fix finding device by name 2018-03-28 00:35:37 +02:00
crypto build: add meson support for dpaaX platforms 2018-03-15 17:50:02 +01:00
event build: add meson support for dpaaX platforms 2018-03-15 17:50:02 +01:00
mempool build: add meson support for dpaaX platforms 2018-03-15 17:50:02 +01:00
net net/enic: allocate stats DMA buffer upfront during probe 2018-03-30 14:08:43 +02:00
raw raw/skeleton: fix device start test 2018-02-06 17:32:34 +01:00
Makefile drivers: rename bbdev directory to baseband 2018-03-21 22:43:05 +01:00
meson.build drivers: improve pmdinfo generation with meson 2018-01-30 21:59:00 +01:00