[PATCH net-next V2 11/11] vhost_net: batch submitting XDP buffers to underlayer sockets

2018-09-11 Thread Jason Wang
This patch implements XDP batching for vhost_net. The idea is first to try to do userspace copy and build XDP buff directly in vhost. Instead of submitting the packet immediately, vhost_net will batch them in an array and submit every 64 (VHOST_NET_BATCH) packets to the under layer sockets through

[PATCH net-next V2 10/11] tap: accept an array of XDP buffs through sendmsg()

2018-09-11 Thread Jason Wang
This patch implement TUN_MSG_PTR msg_control type. This type allows the caller to pass an array of XDP buffs to tuntap through ptr field of the tun_msg_control. Tap will build skb through those XDP buffers. This will avoid lots of indirect calls thus improves the icache utilization and allows to d

[PATCH net-next V2 09/11] tuntap: accept an array of XDP buffs through sendmsg()

2018-09-11 Thread Jason Wang
This patch implement TUN_MSG_PTR msg_control type. This type allows the caller to pass an array of XDP buffs to tuntap through ptr field of the tun_msg_control. If an XDP program is attached, tuntap can run XDP program directly. If not, tuntap will build skb and do a fast receiving since part of th

[PATCH net-next V2 08/11] tun: switch to new type of msg_control

2018-09-11 Thread Jason Wang
This patch introduces to a new tun/tap specific msg_control: #define TUN_MSG_UBUF 1 #define TUN_MSG_PTR 2 struct tun_msg_ctl { int type; void *ptr; }; This allows us to pass different kinds of msg_control through sendmsg(). The first supported type is ubuf (TUN_MSG_UBUF) which will

[PATCH net-next V2 07/11] tuntap: move XDP flushing out of tun_do_xdp()

2018-09-11 Thread Jason Wang
This will allow adding batch flushing on top. Signed-off-by: Jason Wang --- drivers/net/tun.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 14fe94098180..3ae539374f6b 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -16

[PATCH net-next V2 06/11] tuntap: split out XDP logic

2018-09-11 Thread Jason Wang
This patch split out XDP logic into a single function. This make it to be reused by XDP batching path in the following patch. Signed-off-by: Jason Wang --- drivers/net/tun.c | 88 +++ 1 file changed, 51 insertions(+), 37 deletions(-) diff --git a/driv

[PATCH net-next V2 05/11] tuntap: tweak on the path of skb XDP case in tun_build_skb()

2018-09-11 Thread Jason Wang
If we're sure not to go native XDP, there's no need for several things like bh and rcu stuffs. So this patch introduces a helper to build skb and hold page refcnt. When we found we will go through skb path, build skb directly. Signed-off-by: Jason Wang --- drivers/net/tun.c | 39

[PATCH net-next V2 04/11] tuntap: simplify error handling in tun_build_skb()

2018-09-11 Thread Jason Wang
There's no need to duplicate page get logic in each action. So this patch tries to get page and calculate the offset before processing XDP actions (except for XDP_DROP), and undo them when meet errors (we don't care the performance on errors). This will be used for factoring out XDP logic. Signed-

[PATCH net-next V2 03/11] tuntap: enable bh early during processing XDP

2018-09-11 Thread Jason Wang
This patch move the bh enabling a little bit earlier, this will be used for factoring out the core XDP logic of tuntap. Acked-by: Michael S. Tsirkin Signed-off-by: Jason Wang --- drivers/net/tun.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/net/tun.c b

[PATCH net-next V2 02/11] tuntap: switch to use XDP_PACKET_HEADROOM

2018-09-11 Thread Jason Wang
Acked-by: Michael S. Tsirkin Signed-off-by: Jason Wang --- drivers/net/tun.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 2c548bd20393..d3677a544b56 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -113,7 +113,6 @@ do

[PATCH net-next V2 00/11] vhost_net TX batching

2018-09-11 Thread Jason Wang
Hi all: This series tries to batch submitting packets to underlayer socket through msg_control during sendmsg(). This is done by: 1) Doing userspace copy inside vhost_net 2) Build XDP buff 3) Batch at most 64 (VHOST_NET_BATCH) XDP buffs and submit them once through msg_control during sendmsg()

[PATCH net-next V2 01/11] net: sock: introduce SOCK_XDP

2018-09-11 Thread Jason Wang
This patch introduces a new sock flag - SOCK_XDP. This will be used for notifying the upper layer that XDP program is attached on the lower socket, and requires for extra headroom. TUN will be the first user. Signed-off-by: Jason Wang --- drivers/net/tun.c | 19 +++ include/net

Re: [PATCH v2] x86/paravirt: Cleanup native_patch()

2018-09-11 Thread Juergen Gross
On 11/09/18 11:15, Borislav Petkov wrote: > When CONFIG_PARAVIRT_SPINLOCKS=n, it fires > > arch/x86/kernel/paravirt_patch_64.c: In function ‘native_patch’: > arch/x86/kernel/paravirt_patch_64.c:89:1: warning: label ‘patch_site’ > defined but not used [-Wunused-label] >patch_site: > > but

[PATCH v2] x86/paravirt: Cleanup native_patch()

2018-09-11 Thread Borislav Petkov
When CONFIG_PARAVIRT_SPINLOCKS=n, it fires arch/x86/kernel/paravirt_patch_64.c: In function ‘native_patch’: arch/x86/kernel/paravirt_patch_64.c:89:1: warning: label ‘patch_site’ defined but not used [-Wunused-label] patch_site: but those labels can simply be removed by directly calling th