are not enough queues.
Signed-off-by: Xuan Zhuo
Reviewed-by: Dust Li
---
drivers/net/virtio_net.c | 47 +++
1 file changed, 35 insertions(+), 12 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index ba8e637..7a3b2a7
10241500
copy1916747 1775988 1600203 1440054
page1974058 1953655 1945463 1904478
percent 3.0%10.0% 21.58% 32.3%
Signed-off-by: Xuan Zhuo
Reviewed-by: Dust Li
---
drivers/net/virtio_net.c| 2 +-
include/linux/netdev_features.h | 5 +-
net/ethtool/
SGSIZE
100% 713274 64
100% 701024 512
100% 695832 1456
Xuan Zhuo (7):
xsk: support get page for drv
virtio-net, xsk: distinguish XDP_TX and XSK XMIT ctx
xsk, virtio-net: prepare for support xsk zerocopy xmit
virtio-net, xsk: support xsk enable/disable
virtio-net, xs
-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 51
1 file changed, 51 insertions(+)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 42aa9ad..e552c2d 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
hen adding xsk support.
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 95 ++--
1 file changed, 52 insertions(+), 43 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index e707c31..9013328 100644
--- a/drivers/net/vi
. Because the virtio
interface does not use the dma address.
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 200 ++-
1 file changed, 197 insertions(+), 3 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index a62d456
virtnet_xdp_type.offset is used to record
the offset between "true ctx" and virtnet_xdp_type.
The newly added virtnet_xsk_hdr will be used for xsk.
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 75 ++--
1 file changed, 60 inserti
idered that the device is busy.
* xsk_num_max: the xsk.hdr max num
* xsk_num_percent: the max hdr num be the percent of the virtio ring
size. The real xsk hdr num will the min of xsk_num_max and the percent
of the num of virtio ring
* xsk_budget: the budget for xsk run
Signed-off-by: Xua
to get the page based on
addr in drv.
Signed-off-by: Xuan Zhuo
---
include/linux/netdevice.h | 1 +
include/net/xdp_sock_drv.h | 10 ++
include/net/xsk_buff_pool.h | 1 +
net/xdp/xsk_buff_pool.c | 10 +-
4 files changed, 21 insertions(+), 1 deletion(-)
diff --git a
When recycling packets that have been sent, call xsk_tx_completed to
inform xsk which packets have been sent.
If necessary, start napi to process the packets in the xsk queue.
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 49
1 file
supports this feature.
Signed-off-by: Xuan Zhuo
Suggested-by: Alexander Lobakin
---
include/linux/netdevice.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 02dcef4..54501eb 100644
--- a/include/linux/netdevice.h
+++ b/include
1945463 1904478
percent 3.0%10.0% 21.58% 32.3%
Signed-off-by: Xuan Zhuo
Reviewed-by: Dust Li
---
net/xdp/xsk.c | 112 --
1 file changed, 94 insertions(+), 18 deletions(-)
diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c
index 8037b04..8c291f8
Test cmd:
```
xdpsock -i eth0 -t -S -s
```
Test result data:
size64 512 10241500
copy1916747 1775988 1600203 1440054
page1974058 1953655 1945463 1904478
percent 3.0%10.0% 21.58% 32.3%
Xuan Zhuo (3):
net: add priv_flags for allow tx skb without linear
virtio-net:
Virtio net supports the case where the skb linear space is empty, so add
priv_flags.
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index ba8e637..80d637f 100644
Virtio net supports the case where the skb linear space is empty, so add
priv_flags.
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index ba8e637..f2ff6c3 100644
1945463 1904478
percent 3.0%10.0% 21.58% 32.3%
Signed-off-by: Xuan Zhuo
Reviewed-by: Dust Li
---
net/xdp/xsk.c | 104 --
1 file changed, 86 insertions(+), 18 deletions(-)
diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c
index 8037b04..817a3a5
1945463 1904478
percent 3.0%10.0% 21.58% 32.3%
Signed-off-by: Xuan Zhuo
Reviewed-by: Dust Li
---
net/xdp/xsk.c | 104 --
1 file changed, 86 insertions(+), 18 deletions(-)
diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c
index 8037b04..40bac11
iyun ECS server.
Test cmd:
```
xdpsock -i eth0 -t -S -s
```
Test result data:
size64 512 10241500
copy1916747 1775988 1600203 1440054
page1974058 1953655 1945463 1904478
percent 3.0%10.0% 21.58% 32.3%
Xuan Zhuo (3):
net: add priv_flags for allow tx skb withou
supports this feature.
Signed-off-by: Xuan Zhuo
Suggested-by: Alexander Lobakin
---
include/linux/netdevice.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index ef51725..135db8f 100644
--- a/include/linux/netdevice.h
+++ b/include
Virtio net supports the case where the skb linear space is empty, so add
priv_flags.
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index ba8e637..f2ff6c3 100644
1945463 1904478
percent 3.0%10.0% 21.58% 32.3%
Signed-off-by: Xuan Zhuo
Reviewed-by: Dust Li
---
net/xdp/xsk.c | 104 --
1 file changed, 86 insertions(+), 18 deletions(-)
diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c
index 4a83117..38af7f1
xskq_prod_reserve has been updated.
Signed-off-by: Xuan Zhuo
---
include/net/xdp_sock.h | 3 +++
net/xdp/xsk.c | 36 +++-
2 files changed, 30 insertions(+), 9 deletions(-)
diff --git a/include/net/xdp_sock.h b/include/net/xdp_sock.h
index 4f4e93b..fead0c9
This patch is used to construct skb based on page to save memory copy
overhead.
Taking into account the problem of addr unaligned, and the
possibility of frame size greater than page in the future.
Signed-off-by: Xuan Zhuo
---
net/xdp/xsk.c | 68
.
Signed-off-by: Xuan Zhuo
Acked-by: Magnus Karlsson
---
net/xdp/xsk.c | 16 +---
net/xdp/xsk_queue.h | 6 ++
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c
index 9bbfd8a..6250447 100644
--- a/net/xdp/xsk.c
+++ b/net/xdp/xsk.c
datagram_poll will judge the current socket status (EPOLLIN, EPOLLOUT)
based on the traditional socket information (eg: sk_wmem_alloc), but
this does not apply to xsk. So this patch uses sock_poll_wait instead of
datagram_poll, and the mask is calculated by xsk_poll.
Signed-off-by: Xuan Zhuo
V2:
#2 patch made some changes following magnus' opinions.
V3:
Regarding the function xskq_cons_present_entries, I think daniel are right,
I have modified it.
Xuan Zhuo (2):
xsk: replace datagram_poll by sock_poll_wait
xsk: change the tx writeable condition
net/xdp/
not cause packet loss because it cannot
receive the packets uploaded by the network card at one time.
Of course, the 1024 here is only an estimated value, and the number of
packets sent by each network card at a time may be different.
Signed-off-by: Xuan Zhuo
---
include/uapi/linux/if_xdp.h | 2
.
Signed-off-by: Xuan Zhuo
---
net/xdp/xsk.c | 20 +---
net/xdp/xsk_queue.h | 6 ++
2 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c
index 7f0353e..bc3d4ece 100644
--- a/net/xdp/xsk.c
+++ b/net/xdp/xsk.c
@@ -211,6 +211,17
in the cq queue from nic.
In this way, as long as the tx configured by the user is larger, we won't have
the situation that tx is already in the writeable state but cannot get the item
from cq.
Xuan Zhuo (3):
xsk: replace datagram_poll by sock_poll_wait
xsk: change the tx writeable condi
datagram_poll will judge the current socket status (EPOLLIN, EPOLLOUT)
based on the traditional socket information (eg: sk_wmem_alloc), but
this does not apply to xsk. So this patch uses sock_poll_wait instead of
datagram_poll, and the mask is calculated by xsk_poll.
Signed-off-by: Xuan Zhuo
.
Signed-off-by: Xuan Zhuo
---
net/xdp/xsk.c | 16 +---
net/xdp/xsk_queue.h | 6 ++
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c
index 0df8651..22e35e9 100644
--- a/net/xdp/xsk.c
+++ b/net/xdp/xsk.c
@@ -211,6 +211,14 @@ static
Thanks for magnus very much.
V2:
#2 patch made some changes following magnus' opinions.
Xuan Zhuo (2):
xsk: replace datagram_poll by sock_poll_wait
xsk: change the tx writeable condition
net/xdp/xsk.c | 20
net/xdp/xsk_queue.h | 6 ++
2 files change
datagram_poll will judge the current socket status (EPOLLIN, EPOLLOUT)
based on the traditional socket information (eg: sk_wmem_alloc), but
this does not apply to xsk. So this patch uses sock_poll_wait instead of
datagram_poll, and the mask is calculated by xsk_poll.
Signed-off-by: Xuan Zhuo
ription of this event,
I think it can also be 'readable', although it is indeed different from
the 'readable' of the new data. But the overhead of xsk checking whether
cq or rx is readable is small.
Signed-off-by: Xuan Zhuo
---
include/net/xdp_sock.h | 1 +
include/uapi/
result data:
size64 512 10241500
copy1916747 1775988 1600203 1440054
page1974058 1953655 1945463 1904478
percent 3.0%10.0% 21.58% 32.3%
Signed-off-by: Xuan Zhuo
---
net/xdp/xsk.c | 68 ---
1 file changed, 51
hi
In the process of developing xdp socket, we tried to directly use page to
construct skb directly, to avoid data copy. And the MAC information is also in
the page, which caused the linear space of skb to be empty. In this case, I
encountered a problem :
mlx5_core :3b:00.1 eth1: Error cqe on
The number of queues implemented by many virtio backends is limited,
especially some machines have a large number of CPUs. In this case, it
is often impossible to allocate a separate queue for XDP_TX.
This patch allows XDP_TX to run by lock when not enough queue.
Signed-off-by: Xuan Zhuo
virtio-net supporting xsk's zero copy rx, I am also
developing it, but I found that the modification may be relatively large, so I
consider this patch set to be separated from the code related to xsk zero copy
rx.
Xuan Zhuo (5):
xsk: support get page for drv
virtio-net: support XDP_TX when not
hen adding xsk support.
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 95 ++--
1 file changed, 52 insertions(+), 43 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index df38a9f..e744dce 100644
--- a/drivers/net/vi
to get the page based on
addr in drv.
Signed-off-by: Xuan Zhuo
---
include/linux/netdevice.h | 1 +
include/net/xdp_sock_drv.h | 10 ++
include/net/xsk_buff_pool.h | 1 +
net/xdp/xsk_buff_pool.c | 10 +-
4 files changed, 21 insertions(+), 1 deletion(-)
diff --git a
virtnet_xdp_type.offset is used to record
the offset between "true ctx" and virtnet_xdp_type.
The newly added virtnet_xsk_hdr will be used for xsk.
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 77 ++--
1 file changed, 62 inserti
ax and the percent
of the num of virtio ring
* xsk_budget: the budget for xsk run
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 437 ++-
1 file changed, 434 insertions(+), 3 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_n
through netlink. In this way, when the app
closes fd or the process exits, the release callback of fd can trigger
to off xdp.
Signed-off-by: Xuan Zhuo
---
include/uapi/linux/if_link.h | 1 +
include/uapi/linux/rtnetlink.h | 1 +
net/core/rtnetlink.c | 71
On Tue, 7 Nov 2023 10:01:48 -0800, Jakub Kicinski wrote:
> On Tue, 7 Nov 2023 11:12:06 +0800 Xuan Zhuo wrote:
> > Please review.
>
> ## Form letter - net-next-closed
>
> The merge window for v6.7 has begun and we have already posted our pull
> request. Therefore ne
On Thu, 9 Nov 2023 03:19:04 -0500, "Michael S. Tsirkin" wrote:
> On Tue, Nov 07, 2023 at 11:12:06AM +0800, Xuan Zhuo wrote:
> > ## AF_XDP
> >
> > XDP socket(AF_XDP) is an excellent bypass kernel network framework. The zero
> > copy feature of xsk (XDP socket
On Thu, 9 Nov 2023 14:37:38 +0800, Jason Wang wrote:
> On Tue, Nov 7, 2023 at 11:12 AM Xuan Zhuo wrote:
> >
> > If the xsk is enabling, the xsk tx will share the send queue.
> > But the xsk requires that the send queue use the premapped mode.
> > So the send queue
On Thu, 9 Nov 2023 03:09:00 -0500, "Michael S. Tsirkin" wrote:
> On Tue, Nov 07, 2023 at 11:12:18AM +0800, Xuan Zhuo wrote:
> > The driver's tx napi is very important for XSK. It is responsible for
> > obtaining data from the XSK queue and sending it out.
> &
On Thu, 9 Nov 2023 03:15:03 -0500, "Michael S. Tsirkin" wrote:
> On Tue, Nov 07, 2023 at 11:12:23AM +0800, Xuan Zhuo wrote:
> > When rq is bound with AF_XDP, the buffer dma is managed
> > by the AF_XDP APIs. So the buffer got from the virtio core should
> &g
On Thu, 9 Nov 2023 03:12:27 -0500, "Michael S. Tsirkin" wrote:
> On Tue, Nov 07, 2023 at 11:12:22AM +0800, Xuan Zhuo wrote:
> > Implement the logic of filling rq with XSK buffers.
> >
> > Signed-off-by: Xuan Zhuo
> > ---
> > drivers/net/virtio/ma
On Thu, 9 Nov 2023 06:11:49 -0500, "Michael S. Tsirkin" wrote:
> On Tue, Nov 07, 2023 at 11:12:20AM +0800, Xuan Zhuo wrote:
> > virtnet_free_old_xmit distinguishes three type ptr(skb, xdp frame, xsk
> > buffer) by the last bits of the pointer.
> &g
On Thu, 9 Nov 2023 06:59:48 -0500, "Michael S. Tsirkin" wrote:
> On Thu, Nov 09, 2023 at 07:16:08PM +0800, Xuan Zhuo wrote:
> > On Thu, 9 Nov 2023 06:11:49 -0500, "Michael S. Tsirkin"
> > wrote:
> > > On Tue, Nov 07, 2023 at 11:12:20AM +0800, Xu
On Thu, 9 Nov 2023 07:00:51 -0500, "Michael S. Tsirkin" wrote:
> On Thu, Nov 09, 2023 at 07:10:02PM +0800, Xuan Zhuo wrote:
> > On Thu, 9 Nov 2023 03:15:03 -0500, "Michael S. Tsirkin"
> > wrote:
> > > On Tue, Nov 07, 2023 at 11:12:23AM +0800, Xu
On Thu, 9 Nov 2023 06:58:48 -0500, "Michael S. Tsirkin" wrote:
> On Thu, Nov 09, 2023 at 07:06:23PM +0800, Xuan Zhuo wrote:
> > On Thu, 9 Nov 2023 03:09:00 -0500, "Michael S. Tsirkin"
> > wrote:
> > > On Tue, Nov 07, 2023 at 11:12:18AM +0800, Xuan
On Thu, 9 Nov 2023 07:06:16 -0500, "Michael S. Tsirkin" wrote:
> On Mon, Nov 06, 2023 at 04:18:32PM +0800, Xuan Zhuo wrote:
> > For rq, we have three cases getting buffers from virtio core:
> >
> > 1. virtqueue_get_buf{,_ctx}
> > 2. virtqueue_detach_unused_buf
On Thu, 9 Nov 2023 17:26:33 +0100, Maciej Fijalkowski
wrote:
> On Thu, Nov 09, 2023 at 07:11:46PM +0800, Xuan Zhuo wrote:
> > On Thu, 9 Nov 2023 03:12:27 -0500, "Michael S. Tsirkin"
> > wrote:
> > > On Tue, Nov 07, 2023 at 11:12:22AM +0800, Xuan Zhuo wro
On Thu, 9 Nov 2023 03:12:27 -0500, "Michael S. Tsirkin" wrote:
> On Tue, Nov 07, 2023 at 11:12:22AM +0800, Xuan Zhuo wrote:
> > Implement the logic of filling rq with XSK buffers.
> >
> > Signed-off-by: Xuan Zhuo
> > ---
> > drivers/net/virtio/ma
On Fri, 10 Nov 2023 00:37:32 -0500, "Michael S. Tsirkin"
wrote:
> On Fri, Nov 10, 2023 at 09:58:45AM +0800, Xuan Zhuo wrote:
> > On Thu, 9 Nov 2023 07:06:16 -0500, "Michael S. Tsirkin"
> > wrote:
> > > On Mon, Nov 06, 2023 at 04:18:32PM +0800, Xu
On Fri, 10 Nov 2023 00:32:50 -0500, "Michael S. Tsirkin"
wrote:
> On Fri, Nov 10, 2023 at 09:44:32AM +0800, Xuan Zhuo wrote:
> > On Thu, 9 Nov 2023 06:59:48 -0500, "Michael S. Tsirkin"
> > wrote:
> > > On Thu, Nov 09, 2023 at 07:16:08PM +0800, Xuan
On Fri, 10 Nov 2023 00:33:27 -0500, "Michael S. Tsirkin"
wrote:
> On Fri, Nov 10, 2023 at 09:47:16AM +0800, Xuan Zhuo wrote:
> > On Thu, 9 Nov 2023 07:00:51 -0500, "Michael S. Tsirkin"
> > wrote:
> > > On Thu, Nov 09, 2023 at 07:10:02PM +0800, Xuan
On Mon, 13 Nov 2023 17:00:50 +0100, Maciej Fijalkowski
wrote:
> On Fri, Nov 10, 2023 at 10:38:04AM +0800, Xuan Zhuo wrote:
> > On Thu, 9 Nov 2023 17:26:33 +0100, Maciej Fijalkowski
> > wrote:
> > > On Thu, Nov 09, 2023 at 07:11:46PM +0800, Xuan Zhuo wrote:
> > &
On Tue, 14 Nov 2023 11:26:42 +0800, Jason Wang wrote:
> On Thu, Nov 9, 2023 at 7:06 PM Xuan Zhuo wrote:
> >
> > On Thu, 9 Nov 2023 14:37:38 +0800, Jason Wang wrote:
> > > On Tue, Nov 7, 2023 at 11:12 AM Xuan Zhuo
> > > wrote:
> > > >
> > &g
On Mon, 13 Nov 2023 17:11:04 +0100, Maciej Fijalkowski
wrote:
> On Tue, Nov 07, 2023 at 11:12:24AM +0800, Xuan Zhuo wrote:
> > The virtnet_xdp_handler() is re-used. But
> >
> > 1. We need to copy data to create skb for XDP_PASS.
> > 2. We need to call xsk_buff_free() t
On Tue, 14 Nov 2023 11:55:52 +0800, Jason Wang wrote:
> On Tue, Nov 14, 2023 at 11:42 AM Xuan Zhuo wrote:
> >
> > On Tue, 14 Nov 2023 11:26:42 +0800, Jason Wang wrote:
> > > On Thu, Nov 9, 2023 at 7:06 PM Xuan Zhuo
> > > wrote:
> > > >
> >
On Tue, 14 Nov 2023 12:27:20 +0800, Jason Wang wrote:
> On Tue, Nov 14, 2023 at 11:59 AM Xuan Zhuo wrote:
> >
> > On Tue, 14 Nov 2023 11:55:52 +0800, Jason Wang wrote:
> > > On Tue, Nov 14, 2023 at 11:42 AM Xuan Zhuo
> > > wrote:
> > > >
> >
On Fri, 20 Oct 2023 14:57:06 +0800, Jason Wang wrote:
> On Mon, Oct 16, 2023 at 8:01 PM Xuan Zhuo wrote:
> >
> > Implementing the logic of xsk rx. If this packet is not for XSK
> > determined in XDP, then we need to copy once to generate a SKB.
> > If it is for XS
On Thu, 30 Nov 2023 05:10:42 -0500, "Michael S. Tsirkin"
wrote:
> On Thu, Nov 30, 2023 at 05:49:38PM +0800, Xuan Zhuo wrote:
> > On Thu, 30 Nov 2023 04:45:58 -0500, "Michael S. Tsirkin"
> > wrote:
> > > On Thu, Aug 10, 2023 at 08:30:56PM +0800,
quot;virtio_net: merge dma operations when filling mergeable
buffers")
Signed-off-by: Xuan Zhuo
---
v1: rename to virtnet_rq_free_buf_check_dma()
drivers/net/virtio_net.c | 60
1 file changed, 30 insertions(+), 30 deletions(-)
diff --git a/driver
The virtio-net device stats spec:
https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82
This commit introduces the relative feature and structures.
Signed-off-by: Xuan Zhuo
---
include/uapi/linux/virtio_net.h | 137
1 file
As the spec
https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82
The virtnet cvq supports to get result from the device.
This commit implement this.
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 47 +++-
1 file
As the spec:
https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82
The virtio net supports to get device stats.
Please review.
Thanks.
Xuan Zhuo (6):
virtio_net: introduce device stats feature and structures
virtio_net: virtnet_send_command supports
Now, we just show the stats of every queue.
But for the user, the total values of every stat may are valuable.
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 72 ++--
1 file changed, 61 insertions(+), 11 deletions(-)
diff --git a/drivers/net
As the spec
https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82
Virtio-net supports to get the stats from the device by ethtool -S .
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 354 ++-
1 file changed, 350
In the last commit, we use the stats map to manage the device stats.
For the consistency, we let the stats map includes the driver stats.
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 194 ---
1 file changed, 102 insertions(+), 92 deletions
Now, we have this:
tx_queue_0_tx_timeouts
This is used to record the tx schedule timeout.
But this has two "tx". I think the below is enough.
tx_queue_0_timeouts
So I rename this field.
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 8
1 file changed, 4
On Tue, 12 Dec 2023 03:26:41 -0500, "Michael S. Tsirkin"
wrote:
> On Tue, Dec 12, 2023 at 04:11:41PM +0800, Xuan Zhuo wrote:
> > For rq, we have three cases getting buffers from virtio core:
> >
> > 1. virtqueue_get_buf{,_ctx}
> > 2. virtqueue_
On Mon, 25 Dec 2023 16:01:39 +0800, Zhu Yanjun wrote:
> 在 2023/12/22 11:30, Xuan Zhuo 写道:
> > The virtio-net device stats spec:
> >
> > https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82
> >
> > This commit introduces th
The virtio-net device stats spec:
https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82
This commit introduces the relative feature and structures.
Signed-off-by: Xuan Zhuo
---
include/uapi/linux/virtio_net.h | 137
1 file
As the spec:
https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82
The virtio net supports to get device stats.
Please review.
Thanks.
v1:
1. fix some definitions of the marco and the struct
Xuan Zhuo (6):
virtio_net: introduce device stats feature
Now, we just show the stats of every queue.
But for the user, the total values of every stat may are valuable.
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 72 ++--
1 file changed, 61 insertions(+), 11 deletions(-)
diff --git a/drivers/net
As the spec
https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82
The virtnet cvq supports to get result from the device.
This commit implement this.
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 47 +++-
1 file
Now, we have this:
tx_queue_0_tx_timeouts
This is used to record the tx schedule timeout.
But this has two "tx". I think the below is enough.
tx_queue_0_timeouts
So I rename this field.
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 8
1 file changed, 4
In the last commit, we use the stats map to manage the device stats.
For the consistency, we let the stats map includes the driver stats.
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 194 ---
1 file changed, 102 insertions(+), 92 deletions
As the spec
https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82
Virtio-net supports to get the stats from the device by ethtool -S .
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 354 ++-
1 file changed, 350
On Tue, 26 Dec 2023 03:57:27 -0500, "Michael S. Tsirkin"
wrote:
> On Tue, Dec 26, 2023 at 01:57:09PM +0800, Xuan Zhuo wrote:
> > On Tue, 12 Dec 2023 03:26:41 -0500, "Michael S. Tsirkin"
> > wrote:
> > > On Tue, Dec 12, 2023 at 04:11:41PM +0800, Xu
On Tue, 26 Dec 2023 03:58:37 -0500, "Michael S. Tsirkin"
wrote:
> On Tue, Dec 26, 2023 at 02:17:43PM +0800, Xuan Zhuo wrote:
> > On Mon, 25 Dec 2023 16:01:39 +0800, Zhu Yanjun wrote:
> > > 在 2023/12/22 11:30, Xuan Zhuo 写道:
> > > > The virtio-net
On Tue, 26 Dec 2023 04:08:01 -0500, "Michael S. Tsirkin"
wrote:
> On Tue, Dec 26, 2023 at 05:00:25PM +0800, Xuan Zhuo wrote:
> > On Tue, 26 Dec 2023 03:58:37 -0500, "Michael S. Tsirkin"
> > wrote:
> > > On Tue, Dec 26, 2023 at 02:17:43PM +0800, Xua
On Tue, 26 Dec 2023 04:19:26 -0500, "Michael S. Tsirkin"
wrote:
> On Tue, Dec 26, 2023 at 05:09:21PM +0800, Xuan Zhuo wrote:
> > On Tue, 26 Dec 2023 04:08:01 -0500, "Michael S. Tsirkin"
> > wrote:
> > > On Tue, Dec 26, 2023 at 05:00:25PM +0800, Xua
quot;virtio_net: merge dma operations when filling mergeable
buffers")
Signed-off-by: Xuan Zhuo
---
v2: rename to virtnet_rq_unmap_free_buf()
drivers/net/virtio_net.c | 60
1 file changed, 30 insertions(+), 30 deletions(-)
diff --git a/drivers/net/vi
; drivers/net/virtio_net.c:4552:17: note: ‘sprintf’ output between 9 and
> 19 bytes into a destination of size 16
> 4552 | sprintf(vi->sq[i].name, "output.%d", i);
>
> "
>
> Please review.
Please put this to the git msg.
Reviewed-by: Xuan Z
sprintf’ output between 9 and 19
> > bytes into a destination of size 16
> > 4552 | sprintf(vi->sq[i].name, "output.%d", i);
> >
> > "
>
> Hi, all
>
> V1->V2: Add commit logs. Format string is changed.
>
> Best Re
On Wed, 27 Dec 2023 16:08:47 -0500, "Michael S. Tsirkin"
wrote:
> On Tue, Dec 26, 2023 at 03:31:00PM +0800, Xuan Zhuo wrote:
> > As the spec
> > https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82
> >
> > Virtio-net supp
On Wed, 27 Dec 2023 16:05:25 -0500, "Michael S. Tsirkin"
wrote:
> On Tue, Dec 26, 2023 at 03:30:58PM +0800, Xuan Zhuo wrote:
> > The virtio-net device stats spec:
> >
> > https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82
>
Since free_old_xmit_skbs not only deals with skb, but also xdp frame and
subsequent added xsk, so change the name of this function to
free_old_xmit.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/virtio_net.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff
We move some structures to the header file, but these structures do not
prefixed with virtnet. This patch adds virtnet for these.
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio/main.c | 100
drivers/net/virtio/virtio_net.h | 12 ++--
2 files changed, 56
quot; to xsk: support
tx
3. fix some warnings
Xuan Zhuo (27):
virtio_net: rename free_old_xmit_skbs to free_old_xmit
virtio_net: unify the code for recycling the xmit ptr
virtio_net: independent directory
virtio_net: move core structures to virtio_net.h
virtio_net: add pref
Introduce helper virtqueue_get_dma_premapped(), then the driver
can know whether dma unmap is needed.
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio/main.c | 22 +-
drivers/net/virtio/virtio_net.h | 3 ---
drivers/virtio/virtio_ring.c| 22
Create a separate directory for virtio-net. AF_XDP support will be added
later, then a separate xsk.c file will be added, so we should create a
directory for virtio-net.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
MAINTAINERS | 2 +-
drivers/net/Kconfig
There are two completely similar and independent implementations. This
is inconvenient for the subsequent addition of new types. So extract a
function from this piece of code and call this function uniformly to
recover old xmit ptr.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net
This patch separates two sub-functions from virtnet_rx_resize():
* virtnet_rx_pause
* virtnet_rx_resume
Then the subsequent reset rx for xsk can share these two functions.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/virtio/main.c | 29
Move some core structures (send_queue, receive_queue, virtnet_info)
definitions and the relative structures definitions into the
virtio_net.h file.
That will be used by the other c code files.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/virtio/main.c | 189
1 - 100 of 682 matches
Mail list logo