From nobody Mon Apr 6 17:41:32 2026 Received: from mail-pj1-f97.google.com (mail-pj1-f97.google.com [209.85.216.97]) (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 1A95A314D0B for ; Thu, 19 Mar 2026 05:52:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.97 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773899563; cv=none; b=eBfyRm7ffXW/OlklHjrf+HiVCyo0cT3fhFuoMEV/0qMQgXDGjsQVz/Sg23Y0b3o5lIGYBDk1OQhsumZG/47pXSRI0V3LOxla8otRZ9a+QvLk54HfsFJBc6iglD4BDu8IqkSndrF85KyaB4pX3/nAe/iZdD2GIvWqAlKnuTUsM2Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773899563; c=relaxed/simple; bh=cwbyj1ooo9Qz7huYKrO/pQhap2OaZVcpI54mpWxp6Qk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RDSeJdyvOH+ktJ8vjk2zu+dGhrUDMI5o294NOIE2WdWGnaE6XTgLDPOUMkmAgmgF0myUJJnepiqBA809uz9vT3GdLOsXSTRGqoY6xbHjg4Ax/hqlW/bs0gfR6qGNum8+LvZNIptHUk0KzDI+ASVCasrwTgWf1P1HydqBmrn8K9c= 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=D5jl+Hpn; arc=none smtp.client-ip=209.85.216.97 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="D5jl+Hpn" Received: by mail-pj1-f97.google.com with SMTP id 98e67ed59e1d1-35b95e21ccaso783423a91.0 for ; Wed, 18 Mar 2026 22:52:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773899561; x=1774504361; 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=aN4rJh4Zci2AFuVsQwX5cXgl6r8zy06083cabZMtsqc=; b=UXYyW0eZpplCOM1ckQAJFSQhZi8HgO29Lw49f23hI+y5xrE/cy+FsWvbuOBqcI3p1a 9998DkL6BA4fumEhW6Ug9c2gEe9r5gkRg7frV+p01pfl6HWbommCvXFWyiJEddnkOM91 dpsC+8wJcDygAPUtKhVdmVc0/rQ94Ljvp2MdSymjhl9aRPZ8UYPhm+Q8pM1jjiORho99 yQXlivfw/4WwLAZQWNyIOMFbxuEbRXXUQV1i9nlIW4IJqB+OXzVvr528CwlWCMcuQqe0 8rEbx/UKzaetLmAEBYZ2YVKxbtzlC6VwP+yFy+4liW5qkzEszyU04RoIl8+elZzxLeLF 2BKA== X-Forwarded-Encrypted: i=1; AJvYcCU46eGmBsPyjesovssC2IXwWryn4k0O1W+mNcCUdE4a0C/VUbPaAONPah6xZUxoctno7Eg0f5ldwtbJeac=@vger.kernel.org X-Gm-Message-State: AOJu0Yye2+PqQ/LvyDNBDNiu9UYo18UY8fXDiky5g8PRgico8s9qgy3p sAZgpbENnPSvo4YKEmeswu0VqVXZZL0yXYrXo8AAqx3IlTo2uiJWl//9kMAriaLxLoEcnQ37mRp 2iGLYVuqe9LCxgG6nB3wFhyDEwYuger4W1cqDcvQhfq+SusREfSVA8OxGTKfOJzyIZJYzpRyBaE y9KJzVREb8UVEnOfydJfDWQp0dE+7VE5hG7CxF0rPfClF7l57PMB97kr042xgjDrQ24FjhGhW+Q En+Z6e20mkg+xxNmw== X-Gm-Gg: ATEYQzy3wIZPLU8Wbhvwf8nGSO1XRCuGTYTMzcvRkgUTfF4JJq1G1ZTU+ZKOAwObJVR q0wzjUEULX7AJWAOksFK9lLveS3hytmBUdPCXpV3yPCn0CckEYAj8oh+P5O7k8vrREqK5KAWHUL HfYXK+CBk6ULBdg1yKApPtyTlpu0+04odt2j34nTUkI6src2i0WkfKQhsgSUBGWBzCjKxZ36GTx 1ZyrjtEY373phiBQTPzarZLRtz+/Wfb/A+OP9v/PXuTZtgt9KFpTh0vinoebBZxQGPmdlZhqGWt Gr8JhylGol58LEadHI5k4ce0mrJk2DS0hO2vmKDudN8R45EAWroCxulSG8NZieG1tbPJl+7CjA3 VX949FUapQj8yFLG2R50kRmQm3kIZ3CR1xLc4bSuhJ0Ax3cI45HXNxpUod+QEDyXdyFOfM4d3QF o9Z/RmFxnMgQtejqx9KPf/Ncw3CD7jA+pXcPn1fuv9suEb4BBTEpPzGk5Y6Q== X-Received: by 2002:a17:90a:d410:b0:35b:aa38:42a1 with SMTP id 98e67ed59e1d1-35bc5ff4f92mr1616960a91.5.1773899561230; Wed, 18 Mar 2026 22:52:41 -0700 (PDT) Received: from smtp-us-east1-p01-i01-si01.dlp.protect.broadcom.com (address-144-49-247-117.dlp.protect.broadcom.com. [144.49.247.117]) by smtp-relay.gmail.com with ESMTPS id 98e67ed59e1d1-35bc630b7e9sm199312a91.6.2026.03.18.22.52.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Mar 2026 22:52:41 -0700 (PDT) X-Relaying-Domain: broadcom.com X-CFilter-Loop: Reflected Received: by mail-yx1-f69.google.com with SMTP id 956f58d0204a3-64ca2fce827so2404240d50.0 for ; Wed, 18 Mar 2026 22:52:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1773899560; x=1774504360; 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=aN4rJh4Zci2AFuVsQwX5cXgl6r8zy06083cabZMtsqc=; b=D5jl+HpnHW83Dk4G4xK/uuosGVPRlzgLsWlyonsE9Z9sAqJHWNscmdrjiHm7AljF0k 58rKI5u0aMPS6qcrDSjTvfOwoEj8OXV0QtOvPuVAtpYPy4xNeQquC7ChU1szAKS5XW1P 76XrJlcgfLDkt/Htz0rGhJ6UEps+UIBARewxw= X-Forwarded-Encrypted: i=1; AJvYcCVPZMKt4OwQoWBj1s95+jXM0j7AzNNPVZK/8FSnzGv/HbUUSw1+W36q3N7xe64D6XDsb9h0F4Xs1/y9K1s=@vger.kernel.org X-Received: by 2002:a53:d8ce:0:b0:64c:9a6c:8326 with SMTP id 956f58d0204a3-64e9cce665emr1660345d50.19.1773899559932; Wed, 18 Mar 2026 22:52:39 -0700 (PDT) X-Received: by 2002:a53:d8ce:0:b0:64c:9a6c:8326 with SMTP id 956f58d0204a3-64e9cce665emr1660336d50.19.1773899559487; Wed, 18 Mar 2026 22:52:39 -0700 (PDT) Received: from localhost.localdomain ([192.19.203.250]) by smtp.gmail.com with ESMTPSA id 956f58d0204a3-64e91a1cd32sm2918980d50.2.2026.03.18.22.52.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Mar 2026 22:52:39 -0700 (PDT) From: Vikas Gupta 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, rajashekar.hudumula@broadcom.com, ajit.khaparde@broadcom.com, Bhargava Marreddy , Vikas Gupta Subject: [PATCH net-next v8 04/10] bng_en: implement ethtool pauseparam operations Date: Thu, 19 Mar 2026 11:21:18 +0530 Message-ID: <20260319055124.1350670-5-vikas.gupta@broadcom.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20260319055124.1350670-1-vikas.gupta@broadcom.com> References: <20260319055124.1350670-1-vikas.gupta@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" From: Bhargava Marreddy 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.1