From nobody Sat Apr 18 01:56:57 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 064482C08BD for ; Thu, 12 Feb 2026 07:53:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770882815; cv=none; b=FX7JvlJebWmQN3NQLMcWQAJSo+cdQgsJsrSL9Mu5YskS13X57eDCGWPainaRVGnbSr73RO5BKAsl0unG2F5Pnud1xnN0ueg4G+RnT3OMO6f9PvnjSbQAXuzmOw/K2yBKLdEidjkH8J/u8tEi63NCakjrrenh9LfRBu6+dqDjPLg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770882815; c=relaxed/simple; bh=GvQnxXNeWahoRp5JUqw3arKlLbqhbzq091ctHZRucIE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZVbCALdJ/HDmBvj3NUHHE94Pxo2as1a9CfaRPz2iJRqOlHowthQcErRoV6YMELGeoLgw+Zo/yLkOpCbQujNvrkrvCJPrxmvfIl9yK2ahM2uBHdsQ83cHhAzHO7uV9d5EbIUbBOqjcFDyYsE9xS4pkZVGskMV21P9aUCYv1DjDnU= 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=bSxNhXi+; arc=none smtp.client-ip=170.10.133.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="bSxNhXi+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770882813; 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=Ut8Fsw1R4tT50gfU2dQi99Xi0AipmBKvrl6DGwx0NTU=; b=bSxNhXi+BvaNGi5onFFARkY8UUZyafY0oOYazFBzOqDrQ4Keei3xkeVKB/DKRqyqo+uA94 3Z4jCYfYbmt5AI0BZg8SmSiZciUYlGsNXA5oj9cKUix4/fNLmFo6wlOcarbAZJ9rMpLaig lcTnKClKFp9mx4XOW0KHLsmAAwOC2T8= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-54-g6NO0SaEPuKom6REr-TJUA-1; Thu, 12 Feb 2026 02:53:27 -0500 X-MC-Unique: g6NO0SaEPuKom6REr-TJUA-1 X-Mimecast-MFC-AGG-ID: g6NO0SaEPuKom6REr-TJUA_1770882805 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C2DE118003F5; Thu, 12 Feb 2026 07:53:24 +0000 (UTC) Received: from ShadowPeak.redhat.com (unknown [10.44.32.184]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2B34A1956095; Thu, 12 Feb 2026 07:53:19 +0000 (UTC) From: Petr Oros To: netdev@vger.kernel.org Cc: Petr Oros , Tony Nguyen , Przemek Kitszel , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Michal Swiatkowski , Wojciech Drewek , Simon Horman , intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH iwl-net 1/2] ice: fix inverted ready check for VF representors Date: Thu, 12 Feb 2026 08:53:10 +0100 Message-ID: In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Content-Type: text/plain; charset="utf-8" Commit 0f00a897c9fcbd ("ice: check if SF is ready in ethtool ops") refactored the VF readiness check into a generic repr->ops.ready() callback but implemented ice_repr_ready_vf() with inverted logic: return !ice_check_vf_ready_for_cfg(repr->vf); ice_check_vf_ready_for_cfg() returns 0 on success, so the negation makes ready() return non-zero when the VF is ready. All callers treat non-zero as "not ready, skip", causing ndo_get_stats64, get_drvinfo, get_strings and get_ethtool_stats to always bail out in switchdev mode. Remove the erroneous negation. The SF variant ice_repr_ready_sf() is already correct (returns !active, i.e. non-zero when not active). Fixes: 0f00a897c9fcbd ("ice: check if SF is ready in ethtool ops") Signed-off-by: Petr Oros Reviewed-by: Aleksandr Loktionov Reviewed-by: Michal Swiatkowski Tested-by: Patryk Holda Tested-by: Patryk Holda =C2=A0 --- drivers/net/ethernet/intel/ice/ice_repr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ice/ice_repr.c b/drivers/net/ethern= et/intel/ice/ice_repr.c index cb08746556a670..2a84f656405828 100644 --- a/drivers/net/ethernet/intel/ice/ice_repr.c +++ b/drivers/net/ethernet/intel/ice/ice_repr.c @@ -315,7 +315,7 @@ ice_repr_reg_netdev(struct net_device *netdev, const st= ruct net_device_ops *ops) =20 static int ice_repr_ready_vf(struct ice_repr *repr) { - return !ice_check_vf_ready_for_cfg(repr->vf); + return ice_check_vf_ready_for_cfg(repr->vf); } =20 static int ice_repr_ready_sf(struct ice_repr *repr) --=20 2.52.0 From nobody Sat Apr 18 01:56:57 2026 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 30EF842A96 for ; Thu, 12 Feb 2026 07:53:35 +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=1770882816; cv=none; b=dIJXsLZLvQsnYfzwA09dxr7X72Ap4azstnCvvRO0xojHIfcEvtLBzhKbuQez4GS+bUEwxbl+2fsvOizROgD7LPiii3kXMKbz2u+WiFaGWyqZ0sKhkNoqjZyAe724/ZrDG5U4E67AYwiDW3xwaxhgOajbOQHO40i+OawJk5EAZ/Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770882816; c=relaxed/simple; bh=Y0+9O89z6yBpdhk15qq5LuW59rliI45UHtzB7ykcmng=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XJwtNocJix2zbgXT07r8iMvi/aXXcNrWXjFTAuvYUj0Q68DDKdbyyHyGIE75eIKbUSO1ZsMvXstkRztPw+SCTrtHDdYRJwl9H7hbGaO4FYv2NIZGafho2Qj+pEYNLQSvUfcjYBqZrHNi9SgnQropYf0eELktmSqbKMpJN2eViKc= 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=QU7SuoMB; 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="QU7SuoMB" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770882814; 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=zhLQvNUouK3UgiizfA4paeEoukfLjS3QOlBKKH84PkY=; b=QU7SuoMBXCUn1az8dQfCRUOtw4EL53ClKfrTpbxDgBu4HNYtjD1zr0OnXhxKR9uWPMz3cU c+QsLs/UPStIQoHusE33Hec77ajqtlyyOxslO7ExzAFzVdU1TAFXZWIRlzDtIT/BolT4uU vKxyq23cZ4s86A4iVkZdenKh7cLmHK8= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-283-IZa6iHvwMAmhpUru4AhRoA-1; Thu, 12 Feb 2026 02:53:30 -0500 X-MC-Unique: IZa6iHvwMAmhpUru4AhRoA-1 X-Mimecast-MFC-AGG-ID: IZa6iHvwMAmhpUru4AhRoA_1770882808 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BB41E180047F; Thu, 12 Feb 2026 07:53:28 +0000 (UTC) Received: from ShadowPeak.redhat.com (unknown [10.44.32.184]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1C4B11956095; Thu, 12 Feb 2026 07:53:24 +0000 (UTC) From: Petr Oros To: netdev@vger.kernel.org Cc: Petr Oros , Tony Nguyen , Przemek Kitszel , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Michal Swiatkowski , Wojciech Drewek , Simon Horman , intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH iwl-net 2/2] ice: use ice_update_eth_stats() for representor stats Date: Thu, 12 Feb 2026 08:53:11 +0100 Message-ID: <27c3027a6cc22b565e2a741bbf5ee7d3382e80d7.1770882260.git.poros@redhat.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 ice_repr_get_stats64() and __ice_get_ethtool_stats() call ice_update_vsi_stats() on the VF's src_vsi. This always returns early because ICE_VSI_DOWN is permanently set for VF VSIs =E2=80=94 ice_up() is n= ever called on them since queues are managed by iavf through virtchnl. In __ice_get_ethtool_stats() the original code called ice_update_vsi_stats() for all VSIs including representors, iterated over ice_gstrings_vsi_stats[] to populate the data, and then bailed out with an early return before the per-queue ring stats section. That early return was necessary because representor VSIs have no rings on the PF side =E2=80=94 the rings belong to the VF driver (iavf), so accessing per-q= ueue stats would be invalid. Move the representor handling to the top of __ice_get_ethtool_stats() and call ice_update_eth_stats() directly to read the hardware GLV_* counters. This matches ice_get_vf_stats() which already uses ice_update_eth_stats() for the same VF VSI in legacy mode. Apply the same fix to ice_repr_get_stats64(). Note that ice_gstrings_vsi_stats[] contains five software ring counters (rx_buf_failed, rx_page_failed, tx_linearize, tx_busy, tx_restart) that are always zero for representors since the PF never processes packets on VF rings. This is pre-existing behavior unchanged by this patch. Fixes: 7aae80cef7ba ("ice: add port representor ethtool ops and stats") Signed-off-by: Petr Oros Reviewed-by: Aleksandr Loktionov Tested-by: Patryk Holda Tested-by: Patryk Holda =C2=A0 --- drivers/net/ethernet/intel/ice/ice_ethtool.c | 14 +++++++++++--- drivers/net/ethernet/intel/ice/ice_repr.c | 3 ++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/eth= ernet/intel/ice/ice_ethtool.c index 3565a5d96c6d18..0b8775621f1567 100644 --- a/drivers/net/ethernet/intel/ice/ice_ethtool.c +++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c @@ -1926,6 +1926,17 @@ __ice_get_ethtool_stats(struct net_device *netdev, int i =3D 0; char *p; =20 + if (ice_is_port_repr_netdev(netdev)) { + ice_update_eth_stats(vsi); + + for (j =3D 0; j < ICE_VSI_STATS_LEN; j++) { + p =3D (char *)vsi + ice_gstrings_vsi_stats[j].stat_offset; + data[i++] =3D (ice_gstrings_vsi_stats[j].sizeof_stat =3D=3D + sizeof(u64)) ? *(u64 *)p : *(u32 *)p; + } + return; + } + ice_update_pf_stats(pf); ice_update_vsi_stats(vsi); =20 @@ -1935,9 +1946,6 @@ __ice_get_ethtool_stats(struct net_device *netdev, sizeof(u64)) ? *(u64 *)p : *(u32 *)p; } =20 - if (ice_is_port_repr_netdev(netdev)) - return; - /* populate per queue stats */ rcu_read_lock(); =20 diff --git a/drivers/net/ethernet/intel/ice/ice_repr.c b/drivers/net/ethern= et/intel/ice/ice_repr.c index 2a84f656405828..f1e82ba155cff2 100644 --- a/drivers/net/ethernet/intel/ice/ice_repr.c +++ b/drivers/net/ethernet/intel/ice/ice_repr.c @@ -2,6 +2,7 @@ /* Copyright (C) 2019-2021, Intel Corporation. */ =20 #include "ice.h" +#include "ice_lib.h" #include "ice_eswitch.h" #include "devlink/devlink.h" #include "devlink/port.h" @@ -67,7 +68,7 @@ ice_repr_get_stats64(struct net_device *netdev, struct rt= nl_link_stats64 *stats) return; vsi =3D repr->src_vsi; =20 - ice_update_vsi_stats(vsi); + ice_update_eth_stats(vsi); eth_stats =3D &vsi->eth_stats; =20 stats->tx_packets =3D eth_stats->tx_unicast + eth_stats->tx_broadcast + --=20 2.52.0