Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net/sfc: invalidate switch port entry on representor unplug
[ upstream commit 723327bed49fb434bfb24b1e4393d5c4db537fda ] Once allocated, a switch port list entry always stays there, even after unplugging the ethdev that created it. Currently, the entry's ethdev ID is not cleared on unplug. Referencing the ethdev ID of a detached representor from a flow rule is going to succeed, which is a bug. Also, if the user unplugs endpoint "A" representor and plugs one for "B" instead, the latter will pick the same ethdev ID as the gone representor, but it will have a new port list entry added for it. If the user tries to reference the ethdev ID from a flow rule, the code will fetch the wrong entry ("A" rather than "B") since it sits closer to the list head. That is a serious bug, too. Make the driver invalidate ethdev ID field on ethdev unplug. Fixes: 1fb65e4 ("net/sfc: support flow action port ID in transfer rules") Fixes: a62ec90 ("net/sfc: add port representors infrastructure") Signed-off-by: Ivan Malov <ivan.malov@arknetworks.am> Reviewed-by: Andy Moreton <amoreton@xilinx.com> Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
- Loading branch information