search for: tun_struct

Displaying 20 results from an estimated 182 matches for "tun_struct".

Did you mean: tty_struct
2018 Sep 06
2
[PATCH net-next 06/11] tuntap: split out XDP logic
...------------- > 1 file changed, 51 insertions(+), 33 deletions(-) > > diff --git a/drivers/net/tun.c b/drivers/net/tun.c > index 389aa0727cc6..21b125020b3b 100644 > --- a/drivers/net/tun.c > +++ b/drivers/net/tun.c > @@ -1635,6 +1635,44 @@ static bool tun_can_build_skb(struct tun_struct *tun, struct tun_file *tfile, > return true; > } > > +static u32 tun_do_xdp(struct tun_struct *tun, > + struct tun_file *tfile, > + struct bpf_prog *xdp_prog, > + struct xdp_buff *xdp, > + int *err) > +{ > + u32 act = bpf_prog_run_xdp(x...
2018 Sep 06
2
[PATCH net-next 06/11] tuntap: split out XDP logic
...------------- > 1 file changed, 51 insertions(+), 33 deletions(-) > > diff --git a/drivers/net/tun.c b/drivers/net/tun.c > index 389aa0727cc6..21b125020b3b 100644 > --- a/drivers/net/tun.c > +++ b/drivers/net/tun.c > @@ -1635,6 +1635,44 @@ static bool tun_can_build_skb(struct tun_struct *tun, struct tun_file *tfile, > return true; > } > > +static u32 tun_do_xdp(struct tun_struct *tun, > + struct tun_file *tfile, > + struct bpf_prog *xdp_prog, > + struct xdp_buff *xdp, > + int *err) > +{ > + u32 act = bpf_prog_run_xdp(x...
2009 Nov 04
0
[PATCHv8 1/3] tun: export underlying socket
...++++++++++++++++++++--------- include/linux/if_tun.h | 14 +++++++ 2 files changed, 96 insertions(+), 19 deletions(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 4fdfa2a..18f8876 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -144,6 +144,7 @@ static int tun_attach(struct tun_struct *tun, struct file *file) err = 0; tfile->tun = tun; tun->tfile = tfile; + tun->socket.file = file; dev_hold(tun->dev); sock_hold(tun->socket.sk); atomic_inc(&tfile->count); @@ -158,6 +159,7 @@ static void __tun_detach(struct tun_struct *tun) /* Detach from net de...
2009 Nov 04
0
[PATCHv8 1/3] tun: export underlying socket
...++++++++++++++++++++--------- include/linux/if_tun.h | 14 +++++++ 2 files changed, 96 insertions(+), 19 deletions(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 4fdfa2a..18f8876 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -144,6 +144,7 @@ static int tun_attach(struct tun_struct *tun, struct file *file) err = 0; tfile->tun = tun; tun->tfile = tfile; + tun->socket.file = file; dev_hold(tun->dev); sock_hold(tun->socket.sk); atomic_inc(&tfile->count); @@ -158,6 +159,7 @@ static void __tun_detach(struct tun_struct *tun) /* Detach from net de...
2009 Nov 03
1
[PATCHv7 1/3] tun: export underlying socket
...++++++++++++++++++++--------- include/linux/if_tun.h | 14 +++++++ 2 files changed, 96 insertions(+), 19 deletions(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 4fdfa2a..18f8876 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -144,6 +144,7 @@ static int tun_attach(struct tun_struct *tun, struct file *file) err = 0; tfile->tun = tun; tun->tfile = tfile; + tun->socket.file = file; dev_hold(tun->dev); sock_hold(tun->socket.sk); atomic_inc(&tfile->count); @@ -158,6 +159,7 @@ static void __tun_detach(struct tun_struct *tun) /* Detach from net de...
2009 Nov 03
1
[PATCHv7 1/3] tun: export underlying socket
...++++++++++++++++++++--------- include/linux/if_tun.h | 14 +++++++ 2 files changed, 96 insertions(+), 19 deletions(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 4fdfa2a..18f8876 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -144,6 +144,7 @@ static int tun_attach(struct tun_struct *tun, struct file *file) err = 0; tfile->tun = tun; tun->tfile = tfile; + tun->socket.file = file; dev_hold(tun->dev); sock_hold(tun->socket.sk); atomic_inc(&tfile->count); @@ -158,6 +159,7 @@ static void __tun_detach(struct tun_struct *tun) /* Detach from net de...
2014 Oct 23
0
[PATCH RFC] tun: fix sparse warnings for virtio headers
...drivers/net/tun.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 186ce54..ee27ecb 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -1043,10 +1043,10 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile, return -EFAULT; if ((gso.flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) && - gso.csum_start + gso.csum_offset + 2 > gso.hdr_len) - gso.hdr_len = gso.csum_start + gso.csum_offset + 2; + __virtio16_to_cpu(false, gso.csum_start) + __virtio16_to_c...
2014 Oct 23
0
[PATCH RFC] tun: fix sparse warnings for virtio headers
...drivers/net/tun.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 186ce54..ee27ecb 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -1043,10 +1043,10 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile, return -EFAULT; if ((gso.flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) && - gso.csum_start + gso.csum_offset + 2 > gso.hdr_len) - gso.hdr_len = gso.csum_start + gso.csum_offset + 2; + __virtio16_to_cpu(false, gso.csum_start) + __virtio16_to_c...
2015 Apr 21
2
[PATCH v4 8/8] macvtap/tun: add VNET_BE flag
...FASYNC IFF_ATTACH_QUEUE > /* High bits in flags field are unused. */ > #define TUN_VNET_LE 0x80000000 > +#define TUN_VNET_BE 0x40000000 > > #define TUN_FEATURES (IFF_NO_PI | IFF_ONE_QUEUE | IFF_VNET_HDR | \ > IFF_MULTI_QUEUE) > @@ -206,11 +207,25 @@ struct tun_struct { > u32 flow_count; > }; > > +#ifdef CONFIG_TUN_VNET_BE > +static inline bool tun_legacy_is_little_endian(struct tun_struct *tun) > +{ > + if (tun->flags & TUN_VNET_BE) > + return false; > + return virtio_legacy_is_little_endian(); > +} > +#else > +s...
2015 Apr 21
2
[PATCH v4 8/8] macvtap/tun: add VNET_BE flag
...FASYNC IFF_ATTACH_QUEUE > /* High bits in flags field are unused. */ > #define TUN_VNET_LE 0x80000000 > +#define TUN_VNET_BE 0x40000000 > > #define TUN_FEATURES (IFF_NO_PI | IFF_ONE_QUEUE | IFF_VNET_HDR | \ > IFF_MULTI_QUEUE) > @@ -206,11 +207,25 @@ struct tun_struct { > u32 flow_count; > }; > > +#ifdef CONFIG_TUN_VNET_BE > +static inline bool tun_legacy_is_little_endian(struct tun_struct *tun) > +{ > + if (tun->flags & TUN_VNET_BE) > + return false; > + return virtio_legacy_is_little_endian(); > +} > +#else > +s...
2017 Jan 06
2
[PATCH V4 net-next 3/3] tun: rx batching
...6 ++++++++++++++++++++++++++++++++++++++++++++++++++----- > 1 file changed, 70 insertions(+), 6 deletions(-) > > diff --git a/drivers/net/tun.c b/drivers/net/tun.c > index cd8e02c..6c93926 100644 > --- a/drivers/net/tun.c > +++ b/drivers/net/tun.c > @@ -218,6 +218,7 @@ struct tun_struct { > struct list_head disabled; > void *security; > u32 flow_count; > + u32 rx_batched; > struct tun_pcpu_stats __percpu *pcpu_stats; > }; > > @@ -522,6 +523,7 @@ static void tun_queue_purge(struct tun_file *tfile) > while ((skb = skb_array_consume(&tfile-...
2017 Jan 06
2
[PATCH V4 net-next 3/3] tun: rx batching
...6 ++++++++++++++++++++++++++++++++++++++++++++++++++----- > 1 file changed, 70 insertions(+), 6 deletions(-) > > diff --git a/drivers/net/tun.c b/drivers/net/tun.c > index cd8e02c..6c93926 100644 > --- a/drivers/net/tun.c > +++ b/drivers/net/tun.c > @@ -218,6 +218,7 @@ struct tun_struct { > struct list_head disabled; > void *security; > u32 flow_count; > + u32 rx_batched; > struct tun_pcpu_stats __percpu *pcpu_stats; > }; > > @@ -522,6 +523,7 @@ static void tun_queue_purge(struct tun_file *tfile) > while ((skb = skb_array_consume(&tfile-...
2009 Nov 02
1
[PATCHv6 1/3] tun: export underlying socket
...++++++++++++++++++++--------- include/linux/if_tun.h | 14 +++++++ 2 files changed, 96 insertions(+), 19 deletions(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 4fdfa2a..18f8876 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -144,6 +144,7 @@ static int tun_attach(struct tun_struct *tun, struct file *file) err = 0; tfile->tun = tun; tun->tfile = tfile; + tun->socket.file = file; dev_hold(tun->dev); sock_hold(tun->socket.sk); atomic_inc(&tfile->count); @@ -158,6 +159,7 @@ static void __tun_detach(struct tun_struct *tun) /* Detach from net de...
2009 Nov 02
1
[PATCHv6 1/3] tun: export underlying socket
...++++++++++++++++++++--------- include/linux/if_tun.h | 14 +++++++ 2 files changed, 96 insertions(+), 19 deletions(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 4fdfa2a..18f8876 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -144,6 +144,7 @@ static int tun_attach(struct tun_struct *tun, struct file *file) err = 0; tfile->tun = tun; tun->tfile = tfile; + tun->socket.file = file; dev_hold(tun->dev); sock_hold(tun->socket.sk); atomic_inc(&tfile->count); @@ -158,6 +159,7 @@ static void __tun_detach(struct tun_struct *tun) /* Detach from net de...
2015 Apr 10
0
[PATCH v4 8/8] macvtap/tun: add VNET_BE flag
...11,7 @@ do { \ #define TUN_FASYNC IFF_ATTACH_QUEUE /* High bits in flags field are unused. */ #define TUN_VNET_LE 0x80000000 +#define TUN_VNET_BE 0x40000000 #define TUN_FEATURES (IFF_NO_PI | IFF_ONE_QUEUE | IFF_VNET_HDR | \ IFF_MULTI_QUEUE) @@ -206,11 +207,25 @@ struct tun_struct { u32 flow_count; }; +#ifdef CONFIG_TUN_VNET_BE +static inline bool tun_legacy_is_little_endian(struct tun_struct *tun) +{ + if (tun->flags & TUN_VNET_BE) + return false; + return virtio_legacy_is_little_endian(); +} +#else +static inline bool tun_legacy_is_little_endian(struct tun_str...
2015 Apr 24
0
[PATCH v6 8/8] macvtap/tun: cross-endian support for little-endian hosts
...11,7 @@ do { \ #define TUN_FASYNC IFF_ATTACH_QUEUE /* High bits in flags field are unused. */ #define TUN_VNET_LE 0x80000000 +#define TUN_VNET_BE 0x40000000 #define TUN_FEATURES (IFF_NO_PI | IFF_ONE_QUEUE | IFF_VNET_HDR | \ IFF_MULTI_QUEUE) @@ -206,10 +207,58 @@ struct tun_struct { u32 flow_count; }; +#ifdef CONFIG_TUN_VNET_CROSS_LE +static inline bool tun_legacy_is_little_endian(struct tun_struct *tun) +{ + return tun->flags & TUN_VNET_BE ? false : + virtio_legacy_is_little_endian(); +} + +static long tun_get_vnet_be(struct tun_struct *tun, int __user *argp) +...
2018 Sep 06
0
[PATCH net-next 06/11] tuntap: split out XDP logic
...++++++++++++++++++++++++++++------------------- 1 file changed, 51 insertions(+), 33 deletions(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 389aa0727cc6..21b125020b3b 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -1635,6 +1635,44 @@ static bool tun_can_build_skb(struct tun_struct *tun, struct tun_file *tfile, return true; } +static u32 tun_do_xdp(struct tun_struct *tun, + struct tun_file *tfile, + struct bpf_prog *xdp_prog, + struct xdp_buff *xdp, + int *err) +{ + u32 act = bpf_prog_run_xdp(xdp_prog, xdp); + + switch (act) { + case XDP_REDIR...
2014 Dec 18
2
[PATCH 08/10] tun: Re-uanble UFO support.
...> drivers/net/tun.c | 26 ++++++++++++++------------ > 1 file changed, 14 insertions(+), 12 deletions(-) > > diff --git a/drivers/net/tun.c b/drivers/net/tun.c > index 9dd3746..8c32fca 100644 > --- a/drivers/net/tun.c > +++ b/drivers/net/tun.c > @@ -175,7 +175,7 @@ struct tun_struct { > struct net_device *dev; > netdev_features_t set_features; > #define TUN_USER_FEATURES (NETIF_F_HW_CSUM|NETIF_F_TSO_ECN|NETIF_F_TSO| \ > - NETIF_F_TSO6) > + NETIF_F_TSO6|NETIF_F_UFO) > > int vnet_hdr_sz; > int sndbuf; > @@ -1152,20 +1152,15 @@ st...
2015 Apr 21
0
[PATCH v4 8/8] macvtap/tun: add VNET_BE flag
.../* High bits in flags field are unused. */ > > #define TUN_VNET_LE 0x80000000 > > +#define TUN_VNET_BE 0x40000000 > > > > #define TUN_FEATURES (IFF_NO_PI | IFF_ONE_QUEUE | IFF_VNET_HDR | \ > > IFF_MULTI_QUEUE) > > @@ -206,11 +207,25 @@ struct tun_struct { > > u32 flow_count; > > }; > > > > +#ifdef CONFIG_TUN_VNET_BE > > +static inline bool tun_legacy_is_little_endian(struct tun_struct *tun) > > +{ > > + if (tun->flags & TUN_VNET_BE) > > + return false; > > + return virtio_legacy_is...
2014 Dec 18
2
[PATCH 08/10] tun: Re-uanble UFO support.
...> drivers/net/tun.c | 26 ++++++++++++++------------ > 1 file changed, 14 insertions(+), 12 deletions(-) > > diff --git a/drivers/net/tun.c b/drivers/net/tun.c > index 9dd3746..8c32fca 100644 > --- a/drivers/net/tun.c > +++ b/drivers/net/tun.c > @@ -175,7 +175,7 @@ struct tun_struct { > struct net_device *dev; > netdev_features_t set_features; > #define TUN_USER_FEATURES (NETIF_F_HW_CSUM|NETIF_F_TSO_ECN|NETIF_F_TSO| \ > - NETIF_F_TSO6) > + NETIF_F_TSO6|NETIF_F_UFO) > > int vnet_hdr_sz; > int sndbuf; > @@ -1152,20 +1152,15 @@ st...