From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (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 3F661606A681 for ; Thu, 3 Dec 2026 10:57:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=v/A3y9fF; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=DFnk3Uff Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 155D7616A6; Thu, 3 Dec 2026 10:57:14 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id ub2qtQoNbpza; Thu, 3 Dec 2026 10:57:13 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp3.osuosl.org 67B31616B0 Authentication-Results: smtp3.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 ARC-Seal: i=1; d=osuosl.org; s=arc; a=rsa-sha256; cv=none; t=1796295433; b=IAH3fbCVBjgeKUl8pzqG/4NhFavo2myV+SrfpgGVGqrtvqm6rHY2eKGZS59N++KhK3DG MRuc3L1MLSa9wE9uB7P1HGC7zUTeFzGcNomWqLOkzcTwdNDU0C/DG2oh1wJAWKSPcZDC3 4+ukbQDAlwsdvpj2Mru8gkF0ca+GnKcfATTpG5oScmegA7hCkt5TbT1dMHoIG47WkA+hi jfSNyLcGmJdcc96kwAVVCgpAR6V47EcyO/8zURjQ0y3SAs8Wtmcdlgo20T+cqal/Hmf+0 2vWxjnpbzusz69QF09kXw4r1NMr2HymMXJ/hMWNGd1x91xHbrllACztJ1/NQEbKeDsA== ARC-Message-Signature: i=1; d=osuosl.org; s=arc; a=rsa-sha256; c=relaxed/relaxed; t=1796295433; h=X-Comment:DKIM-Signature:X-Original-To:Delivered-To:Received: Received:X-Virus-Scanned:X-Spam-Flag:X-Spam-Score:X-Spam-Level: X-Spam-Status:Received:ARC-Filter:Received-SPF:Received: DKIM-Signature:X-MC-Rep:Received:X-MC-Unique:X-Mimecast-MFC-AGG-ID: Received:Received:Message-ID:Date:MIME-Version:User-Agent:Subject:To: Cc:References:From:In-Reply-To:X-Scanned-By:X-Mimecast-MFC-PROC-ID: X-Mimecast-Originator:Content-Language:Content-Type: Content-Transfer-Encoding:X-BeenThere:X-Mailman-Version:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help: List-Subscribe:Errors-To; bh=+chvTWOddx7snZi0UNNdkvmOuCN29zBRbMCrEBQzHEI=; b=AWWdxKOd6YgLQyvnt3hCCiIvAR6rvAD8GmYqH8UR4kN96NkuCx461DR+NuEVO0pRbQkY qfzNxIUfUhKX7XmCxzWqrQDjCMNu5h2FjQUCA+GrCpT+QBLbAgaU0IGgbjog0+947Ke9a 2tWItNbK9FuhlXXQoPwu2IivXIsoY5ipTifvHHSdMjHtjwdG0AYplum9r04DJOEW/Glq6 Ljs3Mbff8MFNm7y63nr5BTVNdQTMKR2Hz50xG5osa7jfZxABDWEmIM5b+LgCUjDLnpWhj akuZH3tiL/Woa6JGaM7S9jxfm1/mujRV8DP10iGBOtjQ4cHDTEjpxAM8VVTBbA3LytQ== ARC-Authentication-Results: i=1; smtp3.osuosl.org; dmarc=pass header.from=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=140.211.166.142 X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1796295433; bh=+chvTWOddx7snZi0UNNdkvmOuCN29zBRbMCrEBQzHEI=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=v/A3y9fFQecEh4qMzOQwzFnnr2M6TluMAC2ewu8Cu8OffKd53S6FNvVFmDknTG+zf q+6WIf5anytdiD3sXYiaV39A8CgJvrJnjNilS/tvE7tnm0YGAomqpYR0AJ1DiFFXre t2kl/i8X/IlLW0CY2/xQx+/TjzLL6h+XTP/OccnbG0ZPoHmm9Kq6O5P/5Z8B59R99c l8T/Lvp4PeLdquWbVWuoxQQF9TnuDNZFTL3I0feifh0K2ivsqG94wvfhfFS6/k8UOQ 7/t+cp2y7kSSf6eY+peby3Q4xojdyn6oOSZFZNtr5JqQySsp/pd6ujUIuP++4nc+RZ Hs1wEssPTKTIA== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id 67B31616B0; Thu, 3 Dec 2026 10:57:13 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists1.osuosl.org (Postfix) with ESMTP id 541733DB for ; Thu, 3 Dec 2026 10:57:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 3A134616B4 for ; Thu, 3 Dec 2026 10:57:11 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 9LQ23wXeHfuj for ; Thu, 3 Dec 2026 10:57:10 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp3.osuosl.org 42A3A61698 Authentication-Results: smtp3.osuosl.org; arc=none smtp.remote-ip=170.10.133.124 Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.133.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=ivecera@redhat.com; receiver= Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp3.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=DFnk3Uff Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp3.osuosl.org (Postfix) with ESMTPS id 42A3A61698 for ; Thu, 3 Dec 2026 10:57:10 +0000 (UTC) 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= X-MC-Rep: binary re single 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-Archived-By: 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> From: Ivan Vecera In-Reply-To: <20261202071642.2527605-4-poros@redhat.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-MFC-PROC-ID: BXnuq_-zhgJU3uUpV98H9azB9uQK91XAOHiJCo72OyE_1796295422 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-12.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_PASS,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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