From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796295430; b=m5ItXUjON9rBOD6JtcNQ89KdoiuGw+Wzsmr09d6Ndzdgjmai8NDfF8xwGM85hAA8EB64 w6k2ni//RUYw7SH38fiEvsVKWj75cBlnNzF2cSiYe6+dwbH9CdV37ghebQbFWJFO2sBk1 I6Z9F1DPdAzGsplXK00XvAr6MEYsnxzZl8SCioZuLXn2nTEu7zAKvngNH1TIcCt3Ta0ud iRx8tU3yaCMZogDlNezLdCbDN6eWXjj7IAbn3yI5HUfM0YpkI+4UXplDmb4ji2AOGrxYo i0KXSw5VKuxoRcKpYgq2C3mMdsE5kOJU62KZfRSzVr6tnIOMH6peBlhZdq+dWlShEag== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796295430; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:Received:Message-ID:Date:MIME-Version: User-Agent:Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding:X-Scanned-By; bh=+chvTWOddx7snZi0UNNdkvmOuCN29zBRbMCrEBQzHEI=; b=BrgfQuFV5OKJm/TDWnqgr9fzjVw2p7TSZYvqI/Rxl0iHT2q9M6TlyYhvz5gOCaBIGoPv TUV1EBaOnBkSRJtLawkdkECSXH3e4QvSl1lUS+KQcmFFZgV64p9aTz8SiAHt+7XOIg1ZT lsTxCfHdnmOyTWw9rEqTHFYB6SWCcRrztKcwBkQ6nZo3zsLZIpMdPbqWAl2fPcQ6ptpG1 LT4QuwefCoJV6bSYlWxBSElqVU3BqScLXGyEHVa71vhrMD696kMlDVFHX4QDgcZVTu61o sJyKJkIjzfoaUt54DnbZFTlxPjG8xTQ1/PG5GpSEHMRS+Rq0K1psKlhtuaXil4svFoQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=DFnk3Uff; arc=none smtp.remote-ip=170.10.133.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 37CDA606A32C for ; Thu, 3 Dec 2026 10:57:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 37CDA606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=DFnk3Uff DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796295429; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+chvTWOddx7snZi0UNNdkvmOuCN29zBRbMCrEBQzHEI=; b=DFnk3UffJ0xQMMLDNPqtuOLhWn1Kx/gVo8t07OP165KlXXQUZ/FvzlmxqpLsZSGbAoFxeC KwXsPNSMaQZCiUS9CrInRUsa+PhHkkPXqJs6e96hMMQQvBC4SBSdskC6NlBhYJgjG5zQMP +f6KJYgfEzoCyfFGwFYDe7xoADck+38= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-684-v7I64LYANfKe_d6owITP2g-1; Thu, 3 Dec 2026 10:57:04 +0000 X-MC-Unique: v7I64LYANfKe_d6owITP2g-1 X-Mimecast-MFC-AGG-ID: v7I64LYANfKe_d6owITP2g_1796295422 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BD4EC19774F4; Thu, 3 Dec 2026 10:57:01 +0000 (UTC) Received: from [100.91.101.41] (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5F19D1801904; Thu, 3 Dec 2026 10:56:55 +0000 (UTC) Message-ID: Date: Thu, 3 Dec 2026 11:56:54 +0100 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net v7 3/4] ice: resync uplink filters after a switchdev session To: Petr Oros , netdev@vger.kernel.org Cc: Tony Nguyen , Przemek Kitszel , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Aleksandr Loktionov , Simon Horman , Michal Swiatkowski , Grzegorz Nitka , Paul Menzel , Wojciech Drewek , Marcin Szycik , Martyna Szapar-Mudlaw , Alice Michael , Jacob Keller , Jesse Brandeburg , Patryk Holda , Rinitha S , Aaron Ma , intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org References: <20261202071642.2527605-1-poros@redhat.com> <20261202071642.2527605-4-poros@redhat.com> Content-Language: en-US From: Ivan Vecera In-Reply-To: <20261202071642.2527605-4-poros@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 On 12/2/26 08:16, Petr Oros wrote: > A switchdev session leaves the uplink filters out of sync with its > netdev. ice_eswitch_setup_env() removes the multicast promisc rules, and > ice_eswitch_release_env() removes the default VSI (DFLT) Rx rule that a > promiscuous uplink needs. ice_set_rx_mode() ignores the uplink during > the session and nothing syncs it when the session ends, so these rules > are not installed again, and flag changes made meanwhile are lost. > > Let the eswitch own the uplink promisc configuration during a session. > While the new ICE_VSI_ESWITCH_UPLINK bit is set, ice_vsi_sync_fltr() > leaves the promisc configuration of the uplink alone. Its address list > filters are still installed again during a session that starts with > the uplink up, an older behavior this patch does not change. When the > session ends, after is_running is cleared, ice_eswitch_resync_uplink() > clears the bit and queues a full filter sync, which programs the uplink > from the netdev flags. As before this patch, nothing retries a failed > promisc step on its own. A full barrier in ice_set_rx_mode() orders the > flag change of its caller before the is_running test, so a change made > while the session ends is not lost. The is_running accesses use > READ_ONCE() and WRITE_ONCE(), they are read locklessly in the Tx path. > ice_vsi_sync_fltr() releases ICE_CFG_BUSY with clear_bit_unlock() now, > like the new sections, so the stores it makes in its section are > ordered before the next one takes the bit. > ice_eswitch_setup_env() drops a filter sync that is still pending, so a > session that a reset creates again does not run the sync queued when > the old one ended. Also subscribe a promiscuous VSI to multicast when it > already holds the DFLT rule, and enable VLAN pruning on every promisc > off, because it can be off without our DFLT rule after a session or > with LAG. > > When the driver is removed during a session, the session ends in > ice_remove(), and the sync queued there needs "ice: stop the service > task before the PF is unloaded". > > This does not restore the uplink VLAN filters that > ice_eswitch_setup_env() removes, a separate problem that now also shows > when promisc is cleared after a promiscuous session. It does not change > the unicast filter that ice_eswitch_release_env() adds back either, > which is for the permanent MAC address even if the PF uses another one. > > Found by AI code review, starting with the Sashiko review of v4, and > reproduced on an E810-C (FW 8.1.1, ICE COMMS package 1.3.55.0) without > kernel changes: > > ip link set $PF promisc on > devlink dev eswitch set pci/$BDF mode switchdev > echo 1 > /sys/class/net/$PF/device/sriov_numvfs > echo 0 > /sys/class/net/$PF/device/sriov_numvfs > > after which unknown unicast no longer reaches the PF, and with this > patch it does again. Also tested on that E810-C with promisc changed > before, during and after sessions, allmulti across a session, and PF > resets and driver removal during sessions. LAG and switchdev setup > errors were not tested. No kernel selftests cover this. > > Fixes: 1a1c40df2e80 ("ice: set and release switchdev environment") > Fixes: 2571a3fa6251 ("ice: Prohibit rx mode change in switchdev mode") > Fixes: 5c07be96d8b3 ("ice: Avoid setting default Rx VSI twice in switchdev setup") > Fixes: 776fe19953b0 ("ice: block default rule setting on LAG interface") > Signed-off-by: Petr Oros Reviewed-by: Ivan Vecera