[PATCH net-next v2 3/3] tun: AF_XDP Tx zero-copy support

2024-02-28 Thread Yunjian Wang
| | 64 | 2.5 | 4.0 | 60% | | 512 | 2.1 | 3.6 | 71% | | 1024 | 1.9 | 3.3 | 73% | +--+-+-+-+ Signed-off-by: Yunjian Wang --- drivers/net/tun.c | 177 +++-- drivers/vhost/net.c| 4 + inc

[PATCH net-next v2 2/3] vhost_net: Call peek_len when using xdp

2024-02-28 Thread Yunjian Wang
If TUN supports AF_XDP TX zero-copy, the XDP program will enqueue packets to the XDP ring and wake up the vhost worker. This requires the vhost worker to call peek_len(), which can be used to consume XDP descriptors. Signed-off-by: Yunjian Wang --- drivers/vhost/net.c | 17 - 1

[PATCH net-next v2 1/3] xsk: Remove non-zero 'dma_page' check in xp_assign_dev

2024-02-28 Thread Yunjian Wang
Now dma mappings are used by the physical NICs. However the vNIC maybe do not need them. So remove non-zero 'dma_page' check in xp_assign_dev. Signed-off-by: Yunjian Wang --- net/xdp/xsk_buff_pool.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/net/xdp/xsk_buff_pool.c b/net/xdp

[PATCH net-next v2 0/3] tun: AF_XDP Tx zero-copy support

2024-02-28 Thread Yunjian Wang
). +--+-+-+-+ | | copy |zero-copy| speedup | +--+-+-+-+ | UDP | Mpps | Mpps |%| | 64 | 2.5 | 4.0 | 60% | | 512 | 2.1 | 3.6 | 71% | | 1024 | 1.9 | 3.3 | 73% | +--+-+-+-+ Yunjian Wang

[PATCH net-next 2/2] tun: AF_XDP Rx zero-copy support

2024-01-24 Thread Yunjian Wang
length. - When the tun support AF_XDP Rx zero-copy, the vq's array maybe empty. So add a check for empty vq's array in vhost_net_buf_produce(). - add XDP_SETUP_XSK_POOL and ndo_xsk_wakeup callback support - add tun_put_user_desc function to copy the Rx data to VM Signed-off-by: Yunjian Wang --- drive

[PATCH net-next 1/2] xsk: Remove non-zero 'dma_page' check in xp_assign_dev

2024-01-24 Thread Yunjian Wang
Now dma mappings are used by the physical NICs. However the vNIC maybe do not need them. So remove non-zero 'dma_page' check in xp_assign_dev. Signed-off-by: Yunjian Wang --- net/xdp/xsk_buff_pool.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/net/xdp/xsk_buff_pool.c b/net/xdp

[PATCH net-next 0/2] tun: AF_XDP Rx zero-copy support

2024-01-24 Thread Yunjian Wang
age for OVS' PMD has decreased from 59.8% to 8.8% while forwarding 70pps. Yunjian Wang (2): xsk: Remove non-zero 'dma_page' check in xp_assign_dev tun: AF_XDP Rx zero-copy support drivers/net/tun.c | 165 +++- drivers/vhost/net.c | 18 +++--

[PATCH net] vhost_net: don't continue to call the recvmsg when meet errors

2016-11-30 Thread Yunjian Wang
When we meet an error(err=-EBADFD) recvmsg, the error handling in vhost handle_rx() will continue. This will cause a soft CPU lockup in vhost thread. Signed-off-by: Yunjian Wang <wangyunj...@huawei.com> --- drivers/vhost/net.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers

[PATCH net] vhost_net: don't continue to call the recvmsg when meet errors

2016-11-30 Thread Yunjian Wang
When we meet an error(err=-EBADFD) recvmsg, the error handling in vhost handle_rx() will continue. This will cause a soft CPU lockup in vhost thread. Signed-off-by: Yunjian Wang --- drivers/vhost/net.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/vhost/net.c b/drivers/vhost