Subject: Re: [PATCH net-next v25 07/23] ovpn: implement basic TX path (UDP)

From: Jakub Kicinski <[email-masked]>
Date: Thu, 10 Apr 2025 20:07:33 -0700

On Mon, 07 Apr 2025 21:46:15 +0200 Antonio Quartulli wrote:
> diff --git a/drivers/net/ovpn/socket.c b/drivers/net/ovpn/socket.c
> index 97f6a249b09fe26cc6d078d80abc955f8d35e821..200036757fcd0a7f2ae554a1e3a3c03915c0e32f 100644
> --- a/drivers/net/ovpn/socket.c
> +++ b/drivers/net/ovpn/socket.c
> @@ -185,9 +185,8 @@ struct ovpn_socket *ovpn_socket_new(struct socket *sock, struct ovpn_peer *peer)
>  		goto sock_release;
>  	}
>  
> -	ovpn_sock->ovpn = peer->ovpn;
> -	ovpn_sock->sock = sock;
>  	kref_init(&ovpn_sock->refcount);
> +	ovpn_sock->sock = sock;

> @@ -31,7 +262,7 @@ int ovpn_udp_socket_attach(struct ovpn_socket *ovpn_sock,
>  {
>  	struct socket *sock = ovpn_sock->sock;
>  	struct ovpn_socket *old_data;
> -	int ret = 0;
> +	int ret;
>  
>  	/* make sure no pre-existing encapsulation handler exists */
>  	rcu_read_lock();

Some unrelated-looking chunks here

> +			dev_core_stats_tx_dropped_inc(ovpn->dev);

Since you're already using TSTATS could you switch to DSTATS 
to count drops, and leave the core stats for the core ?