Subject: Re: [PATCH net-next v2 07/22] ovpn: introduce the ovpn_socket object

From: Simon Horman <[email-masked]>
Date: Tue, 5 Mar 2024 14:59:11 +0000

On Mon, Mar 04, 2024 at 04:08:58PM +0100, Antonio Quartulli wrote:

...

> diff --git a/drivers/net/ovpn/socket.h b/drivers/net/ovpn/socket.h
> new file mode 100644
> index 000000000000..92c50f795f7c
> --- /dev/null
> +++ b/drivers/net/ovpn/socket.h
> @@ -0,0 +1,47 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*  OpenVPN data channel offload
> + *
> + *  Copyright (C) 2020-2024 OpenVPN, Inc.
> + *
> + *  Author:	James Yonan <[email-masked]>
> + *		Antonio Quartulli <[email-masked]>
> + */
> +
> +#ifndef _NET_OVPN_SOCK_H_
> +#define _NET_OVPN_SOCK_H_
> +
> +#include <linux/net.h>
> +#include <linux/kref.h>
> +#include <linux/ptr_ring.h>
> +#include <net/sock.h>
> +
> +
> +struct ovpn_struct;
> +struct ovpn_peer;
> +
> +/**
> + * struct ovpn_socket - a kernel socket referenced in the ovpn code
> + */

nit: ./scripts/kernel-doc -none
     complains that the fields of this structure are not
     covered by it's Kernel doc.

> +struct ovpn_socket {
> +	/* the VPN session object owning this socket (UDP only) */
> +	struct ovpn_struct *ovpn;
> +	/* the kernel socket */
> +	struct socket *sock;
> +	/* amount of contexts currently referencing this object */
> +	struct kref refcount;
> +	/* member used to schedule RCU destructor callback */
> +	struct rcu_head rcu;
> +};

...