From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id ACA7241E7C; Sun, 12 Mar 2023 08:28:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 45D80406A2; Sun, 12 Mar 2023 08:28:04 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 7F41C40395; Sun, 12 Mar 2023 08:28:03 +0100 (CET) Received: from [192.168.38.17] (aros.oktetlabs.ru [192.168.38.17]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 5C7D567; Sun, 12 Mar 2023 10:28:02 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 5C7D567 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1678606082; bh=uQ2dR80GlsAwO7hkOYPzhzH9WyDKwJa/bs7xn1cTpu8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=VmpkJEA1YDG4cGDLxK4PWiGhwzIES9jKyTplqJFrevo2zay4cKDTyg0OiPx/GyjcM xi1cHBgMB7Z2RwVUXUMmTegWbS9hGOwwgLyfajhQ5oer1CSpgDk440ZcaIslhsii8p IrJPK5isze/Si/ppfaQY4g8abI9PBH9IgwjL7D40= Message-ID: <9e7ba4dd-c8b7-879b-fc2d-7b7a601277e1@oktetlabs.ru> Date: Sun, 12 Mar 2023 10:28:02 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH] net/sfc: invalidate switch port entry on representor unplug Content-Language: en-US To: Ivan Malov , dev@dpdk.org Cc: Ferruh Yigit , stable@dpdk.org, Andy Moreton References: <20230310170717.7352-1-ivan.malov@arknetworks.am> From: Andrew Rybchenko Organization: OKTET Labs In-Reply-To: <20230310170717.7352-1-ivan.malov@arknetworks.am> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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@dpdk.org > > Signed-off-by: Ivan Malov > Reviewed-by: Andy Moreton Acked-by: Andrew Rybchenko