[PATCH] net/sfc: invalidate switch port entry on representor unplug

Ferruh Yigit ferruh.yigit at amd.com
Mon Mar 13 11:32:12 CET 2023


On 3/12/2023 7:28 AM, Andrew Rybchenko wrote:
> On 3/10/23 20:07, Ivan Malov wrote:
>> 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: 1fb65e4dae8a ("net/sfc: support flow action port ID in transfer
>> rules")
>> Fixes: a62ec90522a6 ("net/sfc: add port representors infrastructure")
>> Cc: stable at dpdk.org
>>
>> Signed-off-by: Ivan Malov <ivan.malov at arknetworks.am>
>> Reviewed-by: Andy Moreton <amoreton at xilinx.com>
> 
> Acked-by: Andrew Rybchenko <andrew.rybchenko at oktetlabs.ru>
> 
> 

Applied to dpdk-next-net/main, thanks.


More information about the stable mailing list