From nobody Tue Apr 7 18:51:35 2026 Received: from mail-yw1-f225.google.com (mail-yw1-f225.google.com [209.85.128.225]) (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 34E353A4F34 for ; Thu, 26 Feb 2026 18:22:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.225 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772130157; cv=none; b=DdEc1c/N3Pw2xHhYF084y6e6mo79c7fVmXPSQLztQDKQuscBuP/sXC0fnAmueJv99BzSEa6BZSyQSdcbNFH8Rxj1LiLaGAyUNGYdzCkWdK5O3kAr8vKkTUgmaHP/ijheCtHeedrYtqQstHQ8sawFFG3B5plMdUiE6bE+k9dhveM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772130157; c=relaxed/simple; bh=RI2O/lNGf1FHG8lBBdNR6Rg/0jZYOOT3Qiqv5EhsqVw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NBZyXfdPFkT+7efMfejQX7jKwHZm42QNI5UeqFPNJLvKlj028hh/k1AmLBnxLz+yRCr7vWhjcOM5ObVnsIUyCLEtKoTAIw9EXXypzJcBu4U/X/N8SMcGR7HNr+djFK6A3GAVRxfuLxG4yvwZKUEsUU6hwcOaVc6n05bGU843Z/8= 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=Uz8RFV+v; arc=none smtp.client-ip=209.85.128.225 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="Uz8RFV+v" Received: by mail-yw1-f225.google.com with SMTP id 00721157ae682-7986e0553bdso10862067b3.2 for ; Thu, 26 Feb 2026 10:22:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772130155; x=1772734955; 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=dBT6MFXOtTSgU5rguyWXBbF7aVNVj3aF2y1eOVL320U=; b=ruTFSIeV90iY9uSWKfCJf49xmawyB8K5hAK1JswMUrmTNFUMipQllqYpgIO3K3VKS0 DFZJgrE43DkROcKL97mKKtcFFPPmqZn6FAVpk36wgBKxZ4IYuQ7f8qWirMwf9t+3zT8I hxYkapOcTEe3wamTTZSoBca1KVe3eKv12GGixvQzxG8WHlgW2Ux6IKXBoywJIrKo3FOW c2paOaHszvGzLRj8WjgKH2aD+AZ+XdUwxBQcgGMNtX5c8sEtp+BasMWI57SETKqToYIs FWvz7v0JXVMBWCzXesiWI3OYfl5hc2WA5ELTdDdg+iofv/jh0jQhfebdEtY2MRl0ZSBC 08BQ== X-Forwarded-Encrypted: i=1; AJvYcCXII3d17rdX6LtMOSfGbkWXCdoPVLwQ2wjAfAY4Lx8o0snfVNwpOzdL3u5sTqNpJgbz1+UwjrqygaI8XPc=@vger.kernel.org X-Gm-Message-State: AOJu0YyO+GHNewEMVFF8D9A+HazzKgW2785pMfnY8yx2950LkRQeOHkM ljmWg02xu2j2wEre4KPcp1a8AHnk248izEAERor9fkqfLqAVTku1cweWQytqLfPxWm7vO9wE9j0 oSsTPEGC4nCqNSYQCqahBp/MNBal599vsvCi8Yt3KjkNrzNPAUBRsb3jRlhgoUhHdd2nU+f06T6 JHoW398FagfZny93pdURb2wvvsZmaZk3+DuRN3MnnPAbyOVkGFEik31fllo+8EizsPaxCGZ7R6x fG2WqGyd1ajqn0Ov7nmr8iFTQ== X-Gm-Gg: ATEYQzyzXGVAAIAxh08pxWAQh7Ve4X4g1q40lsbiziAsK6TYuskXa5k+zdpcExbwPFw DAVzlbKYJVMxShM2dorgZ4JWQR68Dl4sZ8p4VJQZ4f11BkAQRHFTyQwJGnFwle4lV33+05KZX62 YAO0NCH4CehUemDAaeJzDghp4LNseTdt5Au9TQsXlCj8COrK8Hp/ey7AoVQ0DLr2IcKDT60hrcD oSlRAnKCk+figl5qxccSudlY49Dc4LuY9iIDXLazNcXfyYjfiX/7q9OVRq4VZ+pZjmW5CW12mx4 Wco7vaCVBjVQTbqXUdxNkodkuDKs75WF0iDsmtys0kbklhQQS/fk8l6tEJUqyKNxENQ3wy755En AhaCHxu0Rqe4t8HyYt9oqvN8kTtAb9kE8UW1NoRDxjZC52/2W1tP+XRsXj3LnM23n4WK51fL/p/ SgmSW+gAbtmOI3olGwRPgg0wnvpAsNA0pk+QZZlUezPkwCpzbBYwQVgWYdDa0uMgQ= X-Received: by 2002:a05:690c:45c3:b0:795:1e5b:f72 with SMTP id 00721157ae682-7988564955bmr1377127b3.63.1772130155032; Thu, 26 Feb 2026 10:22:35 -0800 (PST) Received: from smtp-us-east1-p01-i01-si01.dlp.protect.broadcom.com (address-144-49-247-27.dlp.protect.broadcom.com. [144.49.247.27]) by smtp-relay.gmail.com with ESMTPS id 00721157ae682-79876c9e167sm2952827b3.30.2026.02.26.10.22.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Feb 2026 10:22:35 -0800 (PST) X-Relaying-Domain: broadcom.com X-CFilter-Loop: Reflected Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2adba04421eso59444895ad.3 for ; Thu, 26 Feb 2026 10:22:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1772130154; x=1772734954; 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=dBT6MFXOtTSgU5rguyWXBbF7aVNVj3aF2y1eOVL320U=; b=Uz8RFV+vneg0RGA4o8gmT8bAq0475v5E7eDZ+Y031SvE4PH7Zny9ljfmtIRGvrnale 44eT91PVhTdQFla18tvi4bXvaprSfY9WRhmQ/0CKIa00aOu7uN9cUoSmVy8fDPIIxukj lSnf2op1G6K+k85395wx3FCl5L0+HFOO1Yom8= X-Forwarded-Encrypted: i=1; AJvYcCVFImE+7WZUj7BOBTkxBK5DsVVPAIgE1hQxYZHfjeJN+TsqyYlE2ZBzFX6blPMHdsIH12iKDNJozXrggSM=@vger.kernel.org X-Received: by 2002:a17:902:ea0a:b0:2ad:ad60:73e3 with SMTP id d9443c01a7336-2ae035cb3ecmr36010455ad.53.1772130153607; Thu, 26 Feb 2026 10:22:33 -0800 (PST) X-Received: by 2002:a17:902:ea0a:b0:2ad:ad60:73e3 with SMTP id d9443c01a7336-2ae035cb3ecmr36010185ad.53.1772130153142; Thu, 26 Feb 2026 10:22:33 -0800 (PST) Received: from localhost.localdomain ([192.19.203.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2adfb69ef1csm35941565ad.53.2026.02.26.10.22.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Feb 2026 10:22:32 -0800 (PST) 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 v2 4/8] bng_en: implement ethtool pauseparam operations Date: Thu, 26 Feb 2026 23:51:29 +0530 Message-ID: <20260226182133.1566714-5-bhargava.marreddy@broadcom.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260226182133.1566714-1-bhargava.marreddy@broadcom.com> References: <20260226182133.1566714-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 e4d3041db0a..01382ad784e 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