From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 23C7533F38E for ; Tue, 14 Apr 2026 11:00:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776164445; cv=none; b=tqRXDHKacoasCYlAaZ8CQ3CqucOzXoo2nws9A6ZkNoZPzW2zD5X6B7Mk4We2dSBN9At68saU66S2ZJY2swPvasBQJSrHsWmdDthsij/i/DWI2CcviJ6nrrq/CwkknTzQzMNwVkEQ26uVtdGhrwq8ExbTEt017fB/q8RP+5uip4Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776164445; c=relaxed/simple; bh=AY/WxWXgf8T8fn0+ZoZsWObrf7iBvOMN0P1T4yOQyqY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hdA8ojh6LM6iqRYqOhsXQ+4/qJDaTivDkJtQQXMaPDO4biMk+uWxqpFCeyGbR2BoS069y4EzuNcnw8iib2mqkrNqbYmCHzAeEuoJubLc661RrziB1FNWQDEYa/t7ovowKCA9OcI8zJHpHcI2WA/6M5hBfEC0VVPBLF8mhVrXLq4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=iqGyidIu; arc=none smtp.client-ip=170.10.129.124 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.b="iqGyidIu" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1776164443; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VAmbrQbBI4SBbRZx1DWmHOcKHdFiGv6B3VCsYo5YKNM=; b=iqGyidIuQYi+REucs8wl/G3wtTH5FyPhQsrWjEftJak9j8wHvxMKkIJbmVgc20OouKpzL7 WxgPn2GYJDWbIMifI08kUUd2vs0oqDANpzqnww7FAG3jyRTmcYq9GMIrbkZ41e56EVaeBo PDoX339bEwZP+ePM5BXlOZgkdgcuJPI= Received: from mx-prod-mc-01.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-173-LDUkDDjlMG2Z7qpSdvqFag-1; Tue, 14 Apr 2026 07:00:38 -0400 X-MC-Unique: LDUkDDjlMG2Z7qpSdvqFag-1 X-Mimecast-MFC-AGG-ID: LDUkDDjlMG2Z7qpSdvqFag_1776164437 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4BF2819560A3; Tue, 14 Apr 2026 11:00:37 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.44.48.43]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EACFA3000C21; Tue, 14 Apr 2026 11:00:33 +0000 (UTC) From: Jose Ignacio Tornos Martinez To: netdev@vger.kernel.org Cc: intel-wired-lan@lists.osuosl.org, jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, Jose Ignacio Tornos Martinez Subject: [PATCH net v3 4/5] ice: skip unnecessary VF reset when setting trust Date: Tue, 14 Apr 2026 13:00:05 +0200 Message-ID: <20260414110006.124286-5-jtornosm@redhat.com> In-Reply-To: <20260414110006.124286-1-jtornosm@redhat.com> References: <20260414110006.124286-1-jtornosm@redhat.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Similar to the i40e fix, ice_set_vf_trust() unconditionally calls ice_reset_vf() when the trust setting changes. The ice driver already has logic to clean up MAC LLDP filters when removing trust, which is the only operation that requires filter synchronization. After this cleanup, the VF reset is only necessary if there were actually filters to remove. For all other trust state changes (setting trust, or removing trust when no filters exist), the reset is unnecessary as filter synchronization happens naturally through normal VF operations. Fix by only triggering the VF reset when removing trust AND filters were actually cleaned up (num_mac_lldp was non-zero). This saves some time and eliminates unnecessary service disruption when changing VF trust settings if not necessary. Signed-off-by: Jose Ignacio Tornos Martinez --- drivers/net/ethernet/intel/ice/ice_sriov.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_sriov.c b/drivers/net/ethernet/intel/ice/ice_sriov.c index 7e00e091756d..23f692b1e86c 100644 --- a/drivers/net/ethernet/intel/ice/ice_sriov.c +++ b/drivers/net/ethernet/intel/ice/ice_sriov.c @@ -1399,14 +1399,19 @@ int ice_set_vf_trust(struct net_device *netdev, int vf_id, bool trusted) mutex_lock(&vf->cfg_lock); - while (!trusted && vf->num_mac_lldp) - ice_vf_update_mac_lldp_num(vf, ice_get_vf_vsi(vf), false); - vf->trusted = trusted; - ice_reset_vf(vf, ICE_VF_RESET_NOTIFY); dev_info(ice_pf_to_dev(pf), "VF %u is now %strusted\n", vf_id, trusted ? "" : "un"); + /* Only reset VF if removing trust and there are MAC LLDP filters + * to clean up. Reset is needed to ensure filter removal completes. + */ + if (!trusted && vf->num_mac_lldp) { + while (vf->num_mac_lldp) + ice_vf_update_mac_lldp_num(vf, ice_get_vf_vsi(vf), false); + ice_reset_vf(vf, ICE_VF_RESET_NOTIFY); + } + mutex_unlock(&vf->cfg_lock); out_put_vf: -- 2.53.0