On 25/02/16 15:53, Zoltan Kiss wrote:
pktio_entry already has a 'state' field, why not using that?
Sorry for the slow reply. The state field in pktio_entry is modified
outside dpdk
pktio code, so it cannot be used to track if rte_eth_dev_start() has
been actually
called. If rte_eth_dev_start() has not been called,
rte_eth_dev_close() cannot
be used in dpdk_close().
"state" is set to STATE_START only if rte_eth_dev_start() succeeded (and
everything else), and the stop function will call rte_eth_dev_close()
only if "state" is STATE_START. I think it's good enough for tracking
It is not the stop() function, which is calling rte_eth_dev_close().
It is close(). And because close() can be called only on a stopped
interface the "state" variable cannot be used to check if the
interface has been started.
I see. It seems DPDK has a different startup process, but I think it's
definitely a bug for them that close() crashes when you call it on an
interface never been started. Either they should document that the
application should track that, or even better, check "struct
rte_eth_dev" for that (dev->data->dev_started == 1) before closing.
Anyhow, we can work that around by checking ourselves, we don't need an
extra variable for that.
Oh wait, we can't work it around as that variable is not exposed. Then
your solution remains, and patching it in DPDK later.
Zoli
_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp