dpdk: fix crash with chelsio pmd 38/27038/2
authorBenoît Ganne <bganne@cisco.com>
Wed, 13 May 2020 12:48:01 +0000 (14:48 +0200)
committerDamjan Marion <dmarion@me.com>
Thu, 14 May 2020 12:25:27 +0000 (12:25 +0000)
commit31eb471d0cb0105ab74ee637028f4ab3cc00cf2a
treee0420f75015dc67db42dc14ca2c8d1620ecb13e6
parent3f0579e8df831d42745e0b97191eb5e4bcffb011
dpdk: fix crash with chelsio pmd

cxgbe PMD initializes its control channel as part of dev_configure(),
and trying to get link status prior to it will lead to a crash.

DPDK documentation loosely hints that we should not call any device
function before dev_start(), call link_state() only for the relevant
PMDs.

From DPDK API documentation:
The functions exported by the application Ethernet API to setup a device
designated by its port identifier must be invoked in the following
order:
    rte_eth_dev_configure()
    rte_eth_tx_queue_setup()
    rte_eth_rx_queue_setup()
    rte_eth_dev_start()
Then, the network application can invoke, in any order, the functions
exported by the Ethernet API to get the MAC address of a given device,
to get the speed and the status of a device physical link, to
receive/transmit [burst of] packets, and so on.

Type: fix

Change-Id: I12d2ab4d84e6bd72a9f695447e86f3222929c804
Signed-off-by: Benoît Ganne <bganne@cisco.com>
src/plugins/dpdk/device/init.c