* [PATCH net-next 0/2] net: bcmasp: add support for GRO software
@ 2025-06-10 17:38 Florian Fainelli
2025-06-10 17:38 ` [PATCH net-next 1/2] net: bcmasp: Utilize napi_complete_done() return value Florian Fainelli
2025-06-10 17:38 ` [PATCH net-next 2/2] net: bcmasp: enable GRO software interrupt coalescing by default Florian Fainelli
0 siblings, 2 replies; 6+ messages in thread
From: Florian Fainelli @ 2025-06-10 17:38 UTC (permalink / raw)
To: netdev
Cc: Florian Fainelli, Justin Chen, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni,
open list:BROADCOM ASP 2.0 ETHERNET DRIVER, open list
These two patches add support for GRO software interrupt coalescing,
kudos to Zak for doing this on bcmgenet first.
before:
00:03:31 CPU %usr %nice %sys %iowait %irq %soft %steal
%guest %idle
00:03:32 all 0.00 0.00 1.51 0.00 0.50 7.29 0.00 0.00 90.70
after:
00:02:35 CPU %usr %nice %sys %iowait %irq %soft %steal
%guest %idle
00:02:36 all 0.25 0.00 1.26 0.00 0.50 7.29 0.00 0.00 90.70
Florian Fainelli (2):
net: bcmasp: Utilize napi_complete_done() return value
net: bcmasp: enable GRO software interrupt coalescing by default
drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net-next 1/2] net: bcmasp: Utilize napi_complete_done() return value
2025-06-10 17:38 [PATCH net-next 0/2] net: bcmasp: add support for GRO software Florian Fainelli
@ 2025-06-10 17:38 ` Florian Fainelli
2025-06-10 22:03 ` Justin Chen
2025-06-10 17:38 ` [PATCH net-next 2/2] net: bcmasp: enable GRO software interrupt coalescing by default Florian Fainelli
1 sibling, 1 reply; 6+ messages in thread
From: Florian Fainelli @ 2025-06-10 17:38 UTC (permalink / raw)
To: netdev
Cc: Florian Fainelli, Justin Chen, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni,
open list:BROADCOM ASP 2.0 ETHERNET DRIVER, open list
Make use of the return value from napi_complete_done(). This allows
users to use the gro_flush_timeout and napi_defer_hard_irqs sysfs
attributes for configuring software interrupt coalescing.
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c b/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c
index 0d61b8580d72..7dc28166d337 100644
--- a/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c
+++ b/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c
@@ -605,10 +605,8 @@ static int bcmasp_rx_poll(struct napi_struct *napi, int budget)
bcmasp_intf_rx_desc_write(intf, intf->rx_edpkt_dma_read);
- if (processed < budget) {
- napi_complete_done(&intf->rx_napi, processed);
+ if (processed < budget && napi_complete_done(&intf->rx_napi, processed))
bcmasp_enable_rx_irq(intf, 1);
- }
return processed;
}
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net-next 2/2] net: bcmasp: enable GRO software interrupt coalescing by default
2025-06-10 17:38 [PATCH net-next 0/2] net: bcmasp: add support for GRO software Florian Fainelli
2025-06-10 17:38 ` [PATCH net-next 1/2] net: bcmasp: Utilize napi_complete_done() return value Florian Fainelli
@ 2025-06-10 17:38 ` Florian Fainelli
2025-06-10 22:03 ` Justin Chen
2025-06-11 20:56 ` kernel test robot
1 sibling, 2 replies; 6+ messages in thread
From: Florian Fainelli @ 2025-06-10 17:38 UTC (permalink / raw)
To: netdev
Cc: Florian Fainelli, Justin Chen, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni,
open list:BROADCOM ASP 2.0 ETHERNET DRIVER, open list
Utilize netdev_sw_irq_coalesce_default_on() to provide conservative
default settings for GRO software interrupt coalescing.
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c b/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c
index 7dc28166d337..d7d0ce379495 100644
--- a/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c
+++ b/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c
@@ -1279,6 +1279,8 @@ struct bcmasp_intf *bcmasp_interface_create(struct bcmasp_priv *priv,
ndev->hw_features |= ndev->features;
ndev->needed_headroom += sizeof(struct bcmasp_pkt_offload);
+ netdev_sw_irq_coalesce_default_on(dev);
+
return intf;
err_free_netdev:
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next 1/2] net: bcmasp: Utilize napi_complete_done() return value
2025-06-10 17:38 ` [PATCH net-next 1/2] net: bcmasp: Utilize napi_complete_done() return value Florian Fainelli
@ 2025-06-10 22:03 ` Justin Chen
0 siblings, 0 replies; 6+ messages in thread
From: Justin Chen @ 2025-06-10 22:03 UTC (permalink / raw)
To: Florian Fainelli, netdev
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, open list:BROADCOM ASP 2.0 ETHERNET DRIVER,
open list
On 6/10/25 10:38 AM, Florian Fainelli wrote:
> Make use of the return value from napi_complete_done(). This allows
> users to use the gro_flush_timeout and napi_defer_hard_irqs sysfs
> attributes for configuring software interrupt coalescing.
>
> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Justin Chen <justin.chen@broadcom.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next 2/2] net: bcmasp: enable GRO software interrupt coalescing by default
2025-06-10 17:38 ` [PATCH net-next 2/2] net: bcmasp: enable GRO software interrupt coalescing by default Florian Fainelli
@ 2025-06-10 22:03 ` Justin Chen
2025-06-11 20:56 ` kernel test robot
1 sibling, 0 replies; 6+ messages in thread
From: Justin Chen @ 2025-06-10 22:03 UTC (permalink / raw)
To: Florian Fainelli, netdev
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, open list:BROADCOM ASP 2.0 ETHERNET DRIVER,
open list
On 6/10/25 10:38 AM, Florian Fainelli wrote:
> Utilize netdev_sw_irq_coalesce_default_on() to provide conservative
> default settings for GRO software interrupt coalescing.
>
> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Justin Chen <justin.chen@broadcom.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next 2/2] net: bcmasp: enable GRO software interrupt coalescing by default
2025-06-10 17:38 ` [PATCH net-next 2/2] net: bcmasp: enable GRO software interrupt coalescing by default Florian Fainelli
2025-06-10 22:03 ` Justin Chen
@ 2025-06-11 20:56 ` kernel test robot
1 sibling, 0 replies; 6+ messages in thread
From: kernel test robot @ 2025-06-11 20:56 UTC (permalink / raw)
To: Florian Fainelli, netdev
Cc: oe-kbuild-all, Florian Fainelli, Justin Chen, Andrew Lunn,
Eric Dumazet, Jakub Kicinski, Paolo Abeni,
bcm-kernel-feedback-list, linux-kernel
Hi Florian,
kernel test robot noticed the following build errors:
[auto build test ERROR on net-next/main]
url: https://github.com/intel-lab-lkp/linux/commits/Florian-Fainelli/net-bcmasp-Utilize-napi_complete_done-return-value/20250611-140255
base: net-next/main
patch link: https://lore.kernel.org/r/20250610173835.2244404-3-florian.fainelli%40broadcom.com
patch subject: [PATCH net-next 2/2] net: bcmasp: enable GRO software interrupt coalescing by default
config: parisc-randconfig-002-20250612 (https://download.01.org/0day-ci/archive/20250612/202506120428.xh54jIu7-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 10.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250612/202506120428.xh54jIu7-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202506120428.xh54jIu7-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c: In function 'bcmasp_interface_create':
>> drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c:1282:36: error: passing argument 1 of 'netdev_sw_irq_coalesce_default_on' from incompatible pointer type [-Werror=incompatible-pointer-types]
1282 | netdev_sw_irq_coalesce_default_on(dev);
| ^~~
| |
| struct device *
In file included from include/linux/etherdevice.h:21,
from drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c:8:
include/linux/netdevice.h:93:59: note: expected 'struct net_device *' but argument is of type 'struct device *'
93 | void netdev_sw_irq_coalesce_default_on(struct net_device *dev);
| ~~~~~~~~~~~~~~~~~~~^~~
cc1: some warnings being treated as errors
vim +/netdev_sw_irq_coalesce_default_on +1282 drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c
1198
1199 struct bcmasp_intf *bcmasp_interface_create(struct bcmasp_priv *priv,
1200 struct device_node *ndev_dn, int i)
1201 {
1202 struct device *dev = &priv->pdev->dev;
1203 struct bcmasp_intf *intf;
1204 struct net_device *ndev;
1205 int ch, port, ret;
1206
1207 if (of_property_read_u32(ndev_dn, "reg", &port)) {
1208 dev_warn(dev, "%s: invalid port number\n", ndev_dn->name);
1209 goto err;
1210 }
1211
1212 if (of_property_read_u32(ndev_dn, "brcm,channel", &ch)) {
1213 dev_warn(dev, "%s: invalid ch number\n", ndev_dn->name);
1214 goto err;
1215 }
1216
1217 ndev = alloc_etherdev(sizeof(struct bcmasp_intf));
1218 if (!ndev) {
1219 dev_warn(dev, "%s: unable to alloc ndev\n", ndev_dn->name);
1220 goto err;
1221 }
1222 intf = netdev_priv(ndev);
1223
1224 intf->parent = priv;
1225 intf->ndev = ndev;
1226 intf->channel = ch;
1227 intf->port = port;
1228 intf->ndev_dn = ndev_dn;
1229 intf->index = i;
1230
1231 ret = of_get_phy_mode(ndev_dn, &intf->phy_interface);
1232 if (ret < 0) {
1233 dev_err(dev, "invalid PHY mode property\n");
1234 goto err_free_netdev;
1235 }
1236
1237 if (intf->phy_interface == PHY_INTERFACE_MODE_INTERNAL)
1238 intf->internal_phy = true;
1239
1240 intf->phy_dn = of_parse_phandle(ndev_dn, "phy-handle", 0);
1241 if (!intf->phy_dn && of_phy_is_fixed_link(ndev_dn)) {
1242 ret = of_phy_register_fixed_link(ndev_dn);
1243 if (ret) {
1244 dev_warn(dev, "%s: failed to register fixed PHY\n",
1245 ndev_dn->name);
1246 goto err_free_netdev;
1247 }
1248 intf->phy_dn = ndev_dn;
1249 }
1250
1251 /* Map resource */
1252 bcmasp_map_res(priv, intf);
1253
1254 if ((!phy_interface_mode_is_rgmii(intf->phy_interface) &&
1255 intf->phy_interface != PHY_INTERFACE_MODE_MII &&
1256 intf->phy_interface != PHY_INTERFACE_MODE_INTERNAL) ||
1257 (intf->port != 1 && intf->internal_phy)) {
1258 netdev_err(intf->ndev, "invalid PHY mode: %s for port %d\n",
1259 phy_modes(intf->phy_interface), intf->port);
1260 ret = -EINVAL;
1261 goto err_free_netdev;
1262 }
1263
1264 ret = of_get_ethdev_address(ndev_dn, ndev);
1265 if (ret) {
1266 netdev_warn(ndev, "using random Ethernet MAC\n");
1267 eth_hw_addr_random(ndev);
1268 }
1269
1270 SET_NETDEV_DEV(ndev, dev);
1271 intf->ops = &bcmasp_intf_ops;
1272 ndev->netdev_ops = &bcmasp_netdev_ops;
1273 ndev->ethtool_ops = &bcmasp_ethtool_ops;
1274 intf->msg_enable = netif_msg_init(-1, NETIF_MSG_DRV |
1275 NETIF_MSG_PROBE |
1276 NETIF_MSG_LINK);
1277 ndev->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | NETIF_F_SG |
1278 NETIF_F_RXCSUM;
1279 ndev->hw_features |= ndev->features;
1280 ndev->needed_headroom += sizeof(struct bcmasp_pkt_offload);
1281
> 1282 netdev_sw_irq_coalesce_default_on(dev);
1283
1284 return intf;
1285
1286 err_free_netdev:
1287 free_netdev(ndev);
1288 err:
1289 return NULL;
1290 }
1291
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-06-11 20:57 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-10 17:38 [PATCH net-next 0/2] net: bcmasp: add support for GRO software Florian Fainelli
2025-06-10 17:38 ` [PATCH net-next 1/2] net: bcmasp: Utilize napi_complete_done() return value Florian Fainelli
2025-06-10 22:03 ` Justin Chen
2025-06-10 17:38 ` [PATCH net-next 2/2] net: bcmasp: enable GRO software interrupt coalescing by default Florian Fainelli
2025-06-10 22:03 ` Justin Chen
2025-06-11 20:56 ` kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®