Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual PMD devices are not freed up #31

Closed
sangjinhan opened this issue Jul 1, 2016 · 2 comments
Closed

Virtual PMD devices are not freed up #31

sangjinhan opened this issue Jul 1, 2016 · 2 comments

Comments

@sangjinhan
Copy link
Member

According to @tootoonchian, in the deinit() function of the PMD driver should do something more than just calling rte_eth_dev_stop(). I suspect rte_eth_dev_stop() is enough for physical PMDs, but for virtual PMDs (e.g., bonding) we need explicit resource deallocation.

@tootoonchian
Copy link
Member

Two reasons I do this (i.e., rte_eth_dev_close() + rte_eth_dev_detach() after rte_eth_dev_stop()):

  1. As you said, with virtual PMDs stopping the port is not enough to attach to it again later.
  2. I can safely change the physical port's driver after detaching if the driver has hotplug support.

We can guard the rte_eth_dev_detach() call with a check similar to lib/librte_ethdev/rte_ethdev.c > rte_eth_dev_is_detachable() (which is not public), or just call it and have its internal check fail in which case it logs an error and does nothing.

@sangjinhan
Copy link
Member Author

Now the port is closed & detached if and only if it was dynamically attached (hot plugged).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants