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=1796295431; b=GK/vHBUALOgWH3ZM1GM/K56RI5ykKU0VuQyNQY8yt3ZNKGaKDmghxgTlNXGKwM0N1hMR L/hR/EF8+kin6igEF6E4Qi4qRINqqlkKyHkjtnrJNlgD6Z36G7o5AUKL7xT1XVb9z876z suBMdwEdiRcQ+aYMverGOCaiuqjDbJu8gIg2B6FG2FtuAZoMVWbmsPuhiPJbrpXaZ9jDj mbSt2W50ohenV0Q5OqchkD3sPMDso9JdLv9QcY9+S+WaQmN0blMyV5ktpvwZVSzgkSC3h xxST3MGTx+4NLg33UbJeIGMmx+zp5ldPDz8KjC9YJdwmR0r/ttONG1JNnsDKxaO0Tug== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796295431; 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=mwBEUGR8DPszmUOsbEwtSPgCUtDCCvoQzxSF+mbLN+bCRnzFtwOSPq5TIn2dg1PNc0xO tHojKvYVdZ+lrQ9K3i87+0Qs0S7U/bXDRBi3UIf/pT99/psDiEkn9k+nrJ6Q1/FjmxTHB P6dTWspNRX6+e1ymWKMmcRHGgmNHYdR7YUnDkio9QTFn1guAr/98SrgZSE4klN4oI6MDg 9Fodu08ZutORGuZTUyUuQBX2941C7f/aLquk/NRGn44EKRgNhx/cP5vhWrYISq5V0u6b+ Es0CxxkUU9+YGPzswM/4RF0vTkk7ZiUHkEJ9GKEn8vFfeNtRNNTEFvhmTm9ZJcYV8nw== 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=ICj50EYn; 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 2479C606A339 for ; Thu, 3 Dec 2026 10:57:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2479C606A339 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=ICj50EYn DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796295430; 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=ICj50EYnf9J24n3b+Mj1NYyWlHJFoJLLL5ssiWF/s3gffmyYr0QDfxQ2KXPK8hTnhyE7B/ 2nXDYKp1Os+Pa00II+jsYSV/HUSsGY4bKzldybKCBcBrGfkD1kgn45Ymn8EwPN8pj8aH/K RFUTsM0cahHcwp0kQRRtG4U3AQZSdPo= 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: linux-kernel@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