net/ena: make ethdev references multi-process safe
authorStanislaw Kardach <kda@semihalf.com>
Wed, 12 May 2021 10:13:45 +0000 (12:13 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 12 May 2021 12:19:02 +0000 (14:19 +0200)
commitaab58857330bb4bd03f6699bf1ee716f72993774
treedcb0dd9f3a82bd2e3c564d4acac156cb9597eeea
parentb418f0d29977f031e18185d78198f2717bcfb361
net/ena: make ethdev references multi-process safe

rte_pci_device and rte_eth_dev are process-local structures. Therefore
ena_adapter::pdev and ena_adapter::rte_dev cannot be used universally.

Both ena_timer_wd_callback and ena_interrupt_handler_rte needs access to
the rte_eth_dev, but as they are being setup and executed in the primary
process, it is safe to pass there the same pointer, which is used for
the device configuration.

In all other cases, except the eth_ena_dev_init(), the rte_eth_dev_data
is used instead.

Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shay Agroskin <shayagr@amazon.com>
drivers/net/ena/ena_ethdev.c
drivers/net/ena/ena_ethdev.h