search for: xdp_packet_headroom

Displaying 10 results from an estimated 10 matches for "xdp_packet_headroom".

2018 Sep 06
1
[PATCH net-next 02/11] tuntap: switch to use XDP_PACKET_HEADROOM
..._PAD (NET_IP_ALIGN + NET_SKB_PAD) > > /* TUN device flags */ > @@ -1654,7 +1653,7 @@ static struct sk_buff *tun_build_skb(struct tun_struct *tun, > rcu_read_lock(); > xdp_prog = rcu_dereference(tun->xdp_prog); > if (xdp_prog) > - pad += TUN_HEADROOM; > + pad += XDP_PACKET_HEADROOM; > buflen += SKB_DATA_ALIGN(len + pad); > rcu_read_unlock(); > > -- > 2.17.1
2018 Sep 06
0
[PATCH net-next 02/11] tuntap: switch to use XDP_PACKET_HEADROOM
...#define TUN_HEADROOM 256 #define TUN_RX_PAD (NET_IP_ALIGN + NET_SKB_PAD) /* TUN device flags */ @@ -1654,7 +1653,7 @@ static struct sk_buff *tun_build_skb(struct tun_struct *tun, rcu_read_lock(); xdp_prog = rcu_dereference(tun->xdp_prog); if (xdp_prog) - pad += TUN_HEADROOM; + pad += XDP_PACKET_HEADROOM; buflen += SKB_DATA_ALIGN(len + pad); rcu_read_unlock(); -- 2.17.1
2018 Sep 06
2
[PATCH net-next 11/11] vhost_net: batch submitting XDP buffers to underlayer sockets
...struct socket *sock = vq->private_data; > + struct page_frag *alloc_frag = &current->task_frag; > + struct virtio_net_hdr *gso; > + struct xdp_buff *xdp = &nvq->xdp[nvq->batched_xdp]; > + size_t len = iov_iter_count(from); > + int headroom = vhost_sock_xdp(sock) ? XDP_PACKET_HEADROOM : 0; > + int buflen = SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); > + int pad = SKB_DATA_ALIGN(VHOST_NET_RX_PAD + headroom + nvq->sock_hlen); > + int sock_hlen = nvq->sock_hlen; > + void *buf; > + int copied; > + > + if (unlikely(len < nvq->sock_hlen)) > + r...
2018 Sep 06
2
[PATCH net-next 11/11] vhost_net: batch submitting XDP buffers to underlayer sockets
...struct socket *sock = vq->private_data; > + struct page_frag *alloc_frag = &current->task_frag; > + struct virtio_net_hdr *gso; > + struct xdp_buff *xdp = &nvq->xdp[nvq->batched_xdp]; > + size_t len = iov_iter_count(from); > + int headroom = vhost_sock_xdp(sock) ? XDP_PACKET_HEADROOM : 0; > + int buflen = SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); > + int pad = SKB_DATA_ALIGN(VHOST_NET_RX_PAD + headroom + nvq->sock_hlen); > + int sock_hlen = nvq->sock_hlen; > + void *buf; > + int copied; > + > + if (unlikely(len < nvq->sock_hlen)) > + r...
2018 Sep 12
14
[PATCH net-next V2 00/11] vhost_net TX batching
...e for reporting errors instead of a pointer to integer - introduce a num field in tun_msg_ctl - introduce a new structure for storing metadata in the head of XDP packet - do not store batche XDP inside vhoet_net_virtqueue Jason Wang (11): net: sock: introduce SOCK_XDP tuntap: switch to use XDP_PACKET_HEADROOM tuntap: enable bh early during processing XDP tuntap: simplify error handling in tun_build_skb() tuntap: tweak on the path of skb XDP case in tun_build_skb() tuntap: split out XDP logic tuntap: move XDP flushing out of tun_do_xdp() tun: switch to new type of msg_control tuntap: accept...
2018 Sep 12
14
[PATCH net-next V2 00/11] vhost_net TX batching
...e for reporting errors instead of a pointer to integer - introduce a num field in tun_msg_ctl - introduce a new structure for storing metadata in the head of XDP packet - do not store batche XDP inside vhoet_net_virtqueue Jason Wang (11): net: sock: introduce SOCK_XDP tuntap: switch to use XDP_PACKET_HEADROOM tuntap: enable bh early during processing XDP tuntap: simplify error handling in tun_build_skb() tuntap: tweak on the path of skb XDP case in tun_build_skb() tuntap: split out XDP logic tuntap: move XDP flushing out of tun_do_xdp() tun: switch to new type of msg_control tuntap: accept...
2018 Sep 06
22
[PATCH net-next 00/11] Vhost_net TX batching
...2/ 0%/ +2% 16384/ 4/ 0%/ -3% 16384/ 8/ 0%/ +4% 65535/ 1/ 0%/ +10% 65535/ 2/ 0%/ +8% 65535/ 4/ 0%/ +1% 65535/ 8/ 0%/ +3% Please review. Thanks Jason Wang (11): net: sock: introduce SOCK_XDP tuntap: switch to use XDP_PACKET_HEADROOM tuntap: enable bh early during processing XDP tuntap: simplify error handling in tun_build_skb() tuntap: tweak on the path of non-xdp case in tun_build_skb() tuntap: split out XDP logic tuntap: move XDP flushing out of tun_do_xdp() tun: switch to new type of msg_control tuntap: accept...
2018 Sep 06
0
[PATCH net-next 11/11] vhost_net: batch submitting XDP buffers to underlayer sockets
...*vq = &nvq->vq; + struct socket *sock = vq->private_data; + struct page_frag *alloc_frag = &current->task_frag; + struct virtio_net_hdr *gso; + struct xdp_buff *xdp = &nvq->xdp[nvq->batched_xdp]; + size_t len = iov_iter_count(from); + int headroom = vhost_sock_xdp(sock) ? XDP_PACKET_HEADROOM : 0; + int buflen = SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); + int pad = SKB_DATA_ALIGN(VHOST_NET_RX_PAD + headroom + nvq->sock_hlen); + int sock_hlen = nvq->sock_hlen; + void *buf; + int copied; + + if (unlikely(len < nvq->sock_hlen)) + return -EFAULT; + + if (SKB_DATA_ALIGN(le...
2018 Sep 12
0
[PATCH net-next V2 11/11] vhost_net: batch submitting XDP buffers to underlayer sockets
...ruct socket *sock = vq->private_data; + struct page_frag *alloc_frag = &current->task_frag; + struct virtio_net_hdr *gso; + struct xdp_buff *xdp = &nvq->xdp[nvq->batched_xdp]; + struct tun_xdp_hdr *hdr; + size_t len = iov_iter_count(from); + int headroom = vhost_sock_xdp(sock) ? XDP_PACKET_HEADROOM : 0; + int buflen = SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); + int pad = SKB_DATA_ALIGN(VHOST_NET_RX_PAD + headroom + nvq->sock_hlen); + int sock_hlen = nvq->sock_hlen; + void *buf; + int copied; + + if (unlikely(len < nvq->sock_hlen)) + return -EFAULT; + + if (SKB_DATA_ALIGN(le...
2018 Sep 07
0
[PATCH net-next 11/11] vhost_net: batch submitting XDP buffers to underlayer sockets
...= vq->private_data; >> + struct page_frag *alloc_frag = &current->task_frag; >> + struct virtio_net_hdr *gso; >> + struct xdp_buff *xdp = &nvq->xdp[nvq->batched_xdp]; >> + size_t len = iov_iter_count(from); >> + int headroom = vhost_sock_xdp(sock) ? XDP_PACKET_HEADROOM : 0; >> + int buflen = SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); >> + int pad = SKB_DATA_ALIGN(VHOST_NET_RX_PAD + headroom + nvq->sock_hlen); >> + int sock_hlen = nvq->sock_hlen; >> + void *buf; >> + int copied; >> + >> + if (unlikely(len < n...