Skip to content

Commit 61d8c33

Browse files
author
Paolo Abeni
committed
net: geneve: Leverage core stats allocator
JIRA: https://issues.redhat.com/browse/RHEL-93467 Tested: stress test in scale lab Upstream commit: commit f5f07d0 Author: Breno Leitao <leitao@debian.org> Date: Tue Mar 5 09:29:09 2024 -0800 net: geneve: Leverage core stats allocator With commit 34d21de ("net: Move {l,t,d}stats allocation to core and convert veth & vrf"), stats allocation could be done on net core instead of in this driver. With this new approach, the driver doesn't have to bother with error handling (allocation failure checking, making sure free happens in the right spot, etc). This is core responsibility now. Remove the allocation in the geneve driver and leverage the network core allocation instead. Signed-off-by: Breno Leitao <leitao@debian.org> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://lore.kernel.org/r/20240305172911.502058-1-leitao@debian.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent eff31cc commit 61d8c33

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

drivers/net/geneve.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -328,19 +328,12 @@ static int geneve_init(struct net_device *dev)
328328
struct geneve_dev *geneve = netdev_priv(dev);
329329
int err;
330330

331-
dev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats);
332-
if (!dev->tstats)
333-
return -ENOMEM;
334-
335331
err = gro_cells_init(&geneve->gro_cells, dev);
336-
if (err) {
337-
free_percpu(dev->tstats);
332+
if (err)
338333
return err;
339-
}
340334

341335
err = dst_cache_init(&geneve->cfg.info.dst_cache, GFP_KERNEL);
342336
if (err) {
343-
free_percpu(dev->tstats);
344337
gro_cells_destroy(&geneve->gro_cells);
345338
return err;
346339
}
@@ -354,7 +347,6 @@ static void geneve_uninit(struct net_device *dev)
354347

355348
dst_cache_destroy(&geneve->cfg.info.dst_cache);
356349
gro_cells_destroy(&geneve->gro_cells);
357-
free_percpu(dev->tstats);
358350
}
359351

360352
/* Callback from net/ipv4/udp.c to receive packets */
@@ -1190,6 +1182,7 @@ static void geneve_setup(struct net_device *dev)
11901182
dev->hw_features |= NETIF_F_RXCSUM;
11911183
dev->hw_features |= NETIF_F_GSO_SOFTWARE;
11921184

1185+
dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS;
11931186
/* MTU range: 68 - (something less than 65535) */
11941187
dev->min_mtu = ETH_MIN_MTU;
11951188
/* The max_mtu calculation does not take account of GENEVE

0 commit comments

Comments
 (0)