Thread (26 messages) 26 messages, 5 authors, 2025-01-21

Re: [PATCH net v3 5/9] tun: Decouple vnet handling

From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: 2025-01-17 09:18:16
Also in: kvm, linux-doc, linux-kselftest, lkml, virtualization

Akihiko Odaki wrote:
quoted hunk ↗ jump to hunk
Decouple the vnet handling code so that we can reuse it for tap.

Signed-off-by: Akihiko Odaki <redacted>
---
 drivers/net/tun.c | 229 +++++++++++++++++++++++++++++++-----------------------
 1 file changed, 133 insertions(+), 96 deletions(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index add09dfdada5..1f4a066ad2f0 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -351,6 +351,122 @@ static inline __virtio16 cpu_to_tun16(unsigned int flags, u16 val)
 	return __cpu_to_virtio16(tun_is_little_endian(flags), val);
 }
 
+static long tun_vnet_ioctl(int *sz, unsigned int *flags,
+			   unsigned int cmd, int __user *sp)
+{
please use vnet_hdr_len_sz instead of sz. It's a bit too cryptic for
a casual reader to understand the meaning.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help