From nobody Thu Apr 9 07:18:07 2026 Received: from mail-yw1-f227.google.com (mail-yw1-f227.google.com [209.85.128.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E6572FB969 for ; Tue, 10 Mar 2026 14:42:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.227 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773153727; cv=none; b=HowYsMFy3RrluZZBDBwEuVxmeU15yPOtYnQXYTibcmKBCYJ11cS+/+Dkpd5mLoLwvv8y1fsPAbKERkLBugCQJqa8TWYTyy+U2LhNLYc3qLK8ubCExF9uDremzwBQRXhQ2TfunSRq6m7WOIPASjE+pFp7IuNHbTlW08NOdpvKkAY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773153727; c=relaxed/simple; bh=YPb9n5EavagjMOwiIS/HfhVaJCMP/jsQfRaYV0mtAE4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lPv8docuBpzFCastCLs1KKulUiJvnLzCyKnuG2NMrVtWKW2V4ZGPD8dL5SyoWBYhbC4ysc7WUdsKfzy7Kl/A62R9OuNe3aILFJf/kQy8jLHlVVSgJem1twOMZU8uyuLZ9JZNMeMXqAGwN+XCmO1Fi5cQYaIhdh/l+0q/rr9rmTQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=avp4sTnQ; arc=none smtp.client-ip=209.85.128.227 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="avp4sTnQ" Received: by mail-yw1-f227.google.com with SMTP id 00721157ae682-7927261a3acso116795057b3.0 for ; Tue, 10 Mar 2026 07:42:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773153725; x=1773758525; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DdXbCzdkZX2AwIvcDJuSfRSk/9LbJo93uf1Mskb42JA=; b=aoEk1VJfqidjdh2m5/XzQ1i2YLNvoiTTT+bmbLXBI22a8EP0rufWKaNyCIcc/AS6L6 jU7JLYL9tsr+1JBYs9B1EnGmMM0o+YYWkLQF6oTtHFkRwgF7VnWaScT2HMbPZWUjwS7F x/6pA/aaPdQ0PWTfjLZGhqpcsjwqXGcemQEL5PxL1olIAJNWfyl+avynPJt4JzrUe7Zd JeHeAGvkNQ9W3/eKBB5XZzrvASRHGOY5G8e5OcJPczlWPiErwPoYGndcxMdnH1B7YkM7 URm64/LrPKzD6perW80X3of176I/M0TZJs0tPqWfAWasVd/uVjFA/P11l3mORxfwPrUU LMzQ== X-Forwarded-Encrypted: i=1; AJvYcCXwgofzEdAIxofLpdBqlTSRHGCAsZCUtdRPUkXfC2GfLJ2dY/D6pV6j0yiDhXc82zOvk7Jd01pnJbw4VR8=@vger.kernel.org X-Gm-Message-State: AOJu0Yz+sB9g+e2/My2rm2519ng2TG0xAAdyhJkYR+e8+pz07wPqMqU6 EpjGGmqGS8JVhksz76KvPU2Lb25PuSHBpt9xUhI5erC47sFr8FNmzhYZ+EZydekZ8W0MPkqUZv8 ADgMrdOWsfKCQT1Cf75naADL7AUv4PJJUi6BMOLzxHJWuj5LqUUGITmaDt+TZ5qXyoYkFad8uE7 8bE6hWocwgI2fxt18be7FpdHNPhAC5/0P6wFgynpOFjLXi/ytf4lQxeOBnGL2Y+BL7X519RO+EY J2Qhy4dqHCvDzFqb7AIAAcQLA== X-Gm-Gg: ATEYQzzmNQAdaLeiLxgY15rSGuK6LRjZ7YAFlf4HabZHqL5AtME09Q/MIUrpVa/FQsN E0/qn5/pHVCo9dRu5BLftlm/+0DW69VXGzFuqSAwE8OP4K2oPZmTrZwDikvaFxcpO9RnOuAiokf fVZ8QxbAZeVo2NUo5egvVqz5LmtA6tCZn1gN6pKb4yLK5E672cnuz7LKNyukV8IlcGtw4BQQVDe 06rdoJ9Wp6+vxpt3xSqn6f+Vry1ZgdFq2omLciyG5Ipa2bTEpvgYPhDc3vR893xvtejwSxxkTJc Wi9Pe32ylK9kj8BObCpfS8TEfxFxuVwATTdiE1ICKeell/BgtgazS40fNjFnjcKTMH33fsfYigU 3Sb2feM/8F6qZR5vPdShU1npHr2QQwmhcMMoPjRWTO18/u3SspcNiwz8cwfpsS5tHkEHqCPDR6B JArZ+b0+7LBTfYROScnBhwi9qvPeHMYZmKMwKOPeG8MN2ZeMwSH9drAbZrfPt6NVs1NQ== X-Received: by 2002:a05:690c:c52e:b0:794:cf56:5bc4 with SMTP id 00721157ae682-798dd7967acmr133807257b3.43.1773153725312; Tue, 10 Mar 2026 07:42:05 -0700 (PDT) Received: from smtp-us-east1-p01-i01-si01.dlp.protect.broadcom.com (address-144-49-247-102.dlp.protect.broadcom.com. [144.49.247.102]) by smtp-relay.gmail.com with ESMTPS id 00721157ae682-7990a674545sm2521217b3.25.2026.03.10.07.42.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Mar 2026 07:42:05 -0700 (PDT) X-Relaying-Domain: broadcom.com X-CFilter-Loop: Reflected Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2ae4a6bb316so96608075ad.1 for ; Tue, 10 Mar 2026 07:42:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1773153724; x=1773758524; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DdXbCzdkZX2AwIvcDJuSfRSk/9LbJo93uf1Mskb42JA=; b=avp4sTnQG+ff5X3C5wdwzvnTadc87nAuT7qrUJq0lMWuNWggzIF1zz4AiGnwM7S9H3 OtkkdEgv25Z4qZTgEsPNeap1uTpqvnuJQv/fSFXpwyRsXmKin13TBMar75qLHr2z8Ogx IsgJAT/m8JeTeNs5kW3XuikBXbUfNyHxLwI48= X-Forwarded-Encrypted: i=1; AJvYcCVhRstOoUKmY4EJxxQ4QPlN2sf+mePFaMZEtrHxcVu0lxOxL1HGrvbn+Tecju9j5oNXix7DQ/N9MdVLzDU=@vger.kernel.org X-Received: by 2002:a17:902:d48b:b0:2ae:3d7d:d903 with SMTP id d9443c01a7336-2ae824465e5mr155695495ad.18.1773153723947; Tue, 10 Mar 2026 07:42:03 -0700 (PDT) X-Received: by 2002:a17:902:d48b:b0:2ae:3d7d:d903 with SMTP id d9443c01a7336-2ae824465e5mr155695135ad.18.1773153723437; Tue, 10 Mar 2026 07:42:03 -0700 (PDT) Received: from localhost.localdomain ([192.19.203.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ae83f783cfsm157096515ad.56.2026.03.10.07.41.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Mar 2026 07:42:02 -0700 (PDT) From: Bhargava Marreddy To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, andrew+netdev@lunn.ch, horms@kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, michael.chan@broadcom.com, pavan.chebbi@broadcom.com, vsrama-krishna.nemani@broadcom.com, vikas.gupta@broadcom.com, Bhargava Marreddy Subject: [PATCH net-next v6 04/10] bng_en: implement ethtool pauseparam operations Date: Tue, 10 Mar 2026 20:10:38 +0530 Message-ID: <20260310144044.21672-5-bhargava.marreddy@broadcom.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260310144044.21672-1-bhargava.marreddy@broadcom.com> References: <20260310144044.21672-1-bhargava.marreddy@broadcom.com> 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-DetectorID-Processed: b00c1d49-9d2e-4205-b15f-d015386d3d5e Content-Type: text/plain; charset="utf-8" Implement .get_pauseparam and .set_pauseparam to support flow control configuration. This allows reporting and setting of autoneg, RX pause, and TX pause states. Signed-off-by: Bhargava Marreddy Reviewed-by: Vikas Gupta --- .../net/ethernet/broadcom/bnge/bnge_ethtool.c | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_ethtool.c b/drivers/ne= t/ethernet/broadcom/bnge/bnge_ethtool.c index e4d3041db0af..01382ad784e3 100644 --- a/drivers/net/ethernet/broadcom/bnge/bnge_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnge/bnge_ethtool.c @@ -42,6 +42,62 @@ static void bnge_get_drvinfo(struct net_device *dev, strscpy(info->bus_info, pci_name(bd->pdev), sizeof(info->bus_info)); } =20 +static void bnge_get_pauseparam(struct net_device *dev, + struct ethtool_pauseparam *epause) +{ + struct bnge_net *bn =3D netdev_priv(dev); + struct bnge_dev *bd =3D bn->bd; + + if (bd->phy_flags & BNGE_PHY_FL_NO_PAUSE) { + epause->autoneg =3D 0; + epause->rx_pause =3D 0; + epause->tx_pause =3D 0; + return; + } + + epause->autoneg =3D !!(bn->eth_link_info.autoneg & + BNGE_AUTONEG_FLOW_CTRL); + epause->rx_pause =3D !!(bn->eth_link_info.req_flow_ctrl & + BNGE_LINK_PAUSE_RX); + epause->tx_pause =3D !!(bn->eth_link_info.req_flow_ctrl & + BNGE_LINK_PAUSE_TX); +} + +static int bnge_set_pauseparam(struct net_device *dev, + struct ethtool_pauseparam *epause) +{ + struct bnge_ethtool_link_info *elink_info; + struct bnge_net *bn =3D netdev_priv(dev); + struct bnge_dev *bd =3D bn->bd; + + if (!BNGE_PHY_CFG_ABLE(bd) || (bd->phy_flags & BNGE_PHY_FL_NO_PAUSE)) + return -EOPNOTSUPP; + + elink_info =3D &bn->eth_link_info; + + if (epause->autoneg) { + if (!(elink_info->autoneg & BNGE_AUTONEG_SPEED)) + return -EINVAL; + + elink_info->autoneg |=3D BNGE_AUTONEG_FLOW_CTRL; + } else { + if (elink_info->autoneg & BNGE_AUTONEG_FLOW_CTRL) + elink_info->force_link_chng =3D true; + elink_info->autoneg &=3D ~BNGE_AUTONEG_FLOW_CTRL; + } + + elink_info->req_flow_ctrl =3D 0; + if (epause->rx_pause) + elink_info->req_flow_ctrl |=3D BNGE_LINK_PAUSE_RX; + if (epause->tx_pause) + elink_info->req_flow_ctrl |=3D BNGE_LINK_PAUSE_TX; + + if (netif_running(dev)) + return bnge_hwrm_set_pause(bn); + + return 0; +} + static const struct ethtool_ops bnge_ethtool_ops =3D { .cap_link_lanes_supported =3D 1, .get_link_ksettings =3D bnge_get_link_ksettings, @@ -49,6 +105,8 @@ static const struct ethtool_ops bnge_ethtool_ops =3D { .get_drvinfo =3D bnge_get_drvinfo, .get_link =3D bnge_get_link, .nway_reset =3D bnge_nway_reset, + .get_pauseparam =3D bnge_get_pauseparam, + .set_pauseparam =3D bnge_set_pauseparam, }; =20 void bnge_set_ethtool_ops(struct net_device *dev) --=20 2.47.3