summaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_interface_core.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2024-03-08 11:56:05 +0100
committerDavid S. Miller <davem@davemloft.net>2024-03-08 11:56:05 +0100
commit3dbf6d67f2d81f1a80cee9fdb391c1ff3ee7cd8d (patch)
tree52cbccaca1f12475bbbd6c748dcd8715ff3a7276 /net/xfrm/xfrm_interface_core.c
parentMerge branch 'nexthop-group-stats' (diff)
parentxfrm: Do not allocate stats in the driver (diff)
downloadlinux-3dbf6d67f2d81f1a80cee9fdb391c1ff3ee7cd8d.tar.xz
linux-3dbf6d67f2d81f1a80cee9fdb391c1ff3ee7cd8d.zip
Merge tag 'ipsec-next-2024-03-06' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next
Steffen Klassert says: ==================== 1) Introduce forwarding of ICMP Error messages. That is specified in RFC 4301 but was never implemented. From Antony Antony. 2) Use KMEM_CACHE instead of kmem_cache_create in xfrm6_tunnel_init() and xfrm_policy_init(). From Kunwu Chan. 3) Do not allocate stats in the xfrm interface driver, this can be done on net core now. From Breno Leitao. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm/xfrm_interface_core.c')
-rw-r--r--net/xfrm/xfrm_interface_core.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/net/xfrm/xfrm_interface_core.c b/net/xfrm/xfrm_interface_core.c
index 717855b9acf1..4df5c06e3ece 100644
--- a/net/xfrm/xfrm_interface_core.c
+++ b/net/xfrm/xfrm_interface_core.c
@@ -240,7 +240,6 @@ static void xfrmi_dev_free(struct net_device *dev)
struct xfrm_if *xi = netdev_priv(dev);
gro_cells_destroy(&xi->gro_cells);
- free_percpu(dev->tstats);
}
static int xfrmi_create(struct net_device *dev)
@@ -749,6 +748,7 @@ static void xfrmi_dev_setup(struct net_device *dev)
dev->flags = IFF_NOARP;
dev->needs_free_netdev = true;
dev->priv_destructor = xfrmi_dev_free;
+ dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS;
netif_keep_dst(dev);
eth_broadcast_addr(dev->broadcast);
@@ -765,15 +765,9 @@ static int xfrmi_dev_init(struct net_device *dev)
struct net_device *phydev = __dev_get_by_index(xi->net, xi->p.link);
int err;
- dev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats);
- if (!dev->tstats)
- return -ENOMEM;
-
err = gro_cells_init(&xi->gro_cells, dev);
- if (err) {
- free_percpu(dev->tstats);
+ if (err)
return err;
- }
dev->features |= NETIF_F_LLTX;
dev->features |= XFRMI_FEATURES;