.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/virtio_net.c | 21 +
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 0b4747e81464..d99898e44456 100644
--- a/drivers/net/virtio_net.c
+++ b
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_net.c | 29 +
1 file
This patch separates two sub-functions from virtnet_tx_resize():
* virtnet_tx_pause
* virtnet_tx_resume
Then the subsequent virtnet_tx_reset() can share these two functions.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/virtio_net.c | 35 +--
1
This commit separates the function receive_buf(), then we wrap the logic
of handling the skb to an independent function virtnet_receive_done().
The subsequent commit will reuse it.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/virtio_net.c | 62
me code
v1:
1. remove two virtio commits. Push this patchset to net-next
2. squash "virtio_net: virtnet_poll_tx support rescheduled" to xsk: support
tx
3. fix some warnings
Xuan Zhuo (10):
virtio_net: replace VIRTIO_XDP_HEADROOM by XDP_PACKET_HEADROOM
virtio_net: s
Implement the logic of filling rq with XSK buffers.
Signed-off-by: Xuan Zhuo
---
v8:
1. update comment
2. return err from virtnet_add_recvbuf_xsk() when encounters error
drivers/net/virtio_net.c | 70 +---
1 file changed, 66 insertions(+), 4 deletions
scattered inside merge and small (and big).
So I think it is a good choice for us to put the xsk code into an
independent function.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/virtio_net.c | 176 +--
1 file changed, 168 insertions(+), 8
This commit separates the function receive_mergeable(),
put the logic of appending frag to the skb as an independent function.
The subsequent commit will reuse it.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/virtio_net.c | 77
1 file
This patch implement the logic of bind/unbind xsk pool to rq.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/virtio_net.c | 134 +++
1 file changed, 134 insertions(+)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index
Support AF-XDP for merge mode.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/virtio_net.c | 144 +++
1 file changed, 144 insertions(+)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index c9c65948b71f..b6323346208d 100644
xsk wakeup is used to trigger the logic for xsk xmit by xsk framework or
user.
Virtio-net does not support to actively generate an interruption, so it
tries to trigger tx NAPI on the local cpu.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/virtio_net.c | 24
2837285936
But AF_XDP consumes more CPU for tx and rx napi(100% and 86%).
Please review.
Thanks.
Xuan Zhuo (13):
virtio_ring: introduce vring_need_unmap_buffer
virtio_ring: split: harden dma unmap for indirect
virtio_r
This patch implement the logic of bind/unbind xsk pool to sq and rq.
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 54
1 file changed, 54 insertions(+)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index f5edd8be4668
1. this commit hardens dma unmap for indirect
2. the subsequent commit uses the struct extra to record whether the
buffers need to be unmapped or not. So we need a struct extra for
every desc, whatever it is indirect or not.
Signed-off-by: Xuan Zhuo
---
drivers/virtio/virtio_ring.c | 57
1. this commit hardens dma unmap for indirect
2. the subsequent commit uses the struct extra to record whether the
buffers need to be unmapped or not. So we need a struct extra for
every desc, whatever it is indirect or not.
Signed-off-by: Xuan Zhuo
---
drivers/virtio/virtio_ring.c | 122
NULL, this
indicates that the driver has performed DMA mapping in advance, allowing
the Virtio core to directly utilize sg_dma_address(sg) without
conducting any internal DMA mapping. Additionally, DMA unmap operations
for this buffer will be bypassed.
Suggested-by: Jason Wang
Signed-off-by: Xuan
The driver's tx napi is very important for XSK. It is responsible for
obtaining data from the XSK queue and sending it out.
At the beginning, we need to trigger tx napi.
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 127 ++-
1 file changed
virtnet_free_old_xmit distinguishes three type ptr(skb, xdp frame, xsk
buffer) by the last bits of the pointer.
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 85
1 file changed, 59 insertions(+), 26 deletions(-)
diff --git a/drivers/net
If send queue sent some packets, we update the tx timeout
record to prevent the tx timeout.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/virtio_net.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index
virtio-net rq submits premapped buffer per buffer.
And removes the call of the virtnet_rq_set_premapped().
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 31 ---
1 file changed, 8 insertions(+), 23 deletions(-)
diff --git a/drivers/net/virtio_net.c b
Now, this API is useless. remove it.
Signed-off-by: Xuan Zhuo
---
drivers/virtio/virtio_ring.c | 48
include/linux/virtio.h | 2 --
2 files changed, 50 deletions(-)
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index
Because the af-xdp will introduce a new xmit type, so I refactor the
xmit type mechanism first.
We use the last two bits of the pointer to distinguish the xmit type,
so we can distinguish four xmit types. Now we have three types: skb,
orphan and xdp.
Signed-off-by: Xuan Zhuo
---
drivers/net
Since xsk's TX queue is consumed by TX NAPI, if sq is bound to xsk, then
we must stop tx napi from being disabled.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/virtio_net.c | 10 +-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/net/virtio_ne
To make the code readable, introduce vring_need_unmap_buffer() to
replace do_unmap.
use_dma_api premapped -> vring_need_unmap_buffer()
1. false falsefalse
2. truefalsetrue
3. truetrue false
Signed-off-by: Xuan Zhuo
Acked-by: Jason W
Now, we supported AF_XDP(xsk). Add NETDEV_XDP_ACT_XSK_ZEROCOPY to
xdp_features.
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 38af9f0b632e..79bfc5231426 100644
On Mon, 22 Jul 2024 17:42:04 -0700, Jakub Kicinski wrote:
> On Mon, 22 Jul 2024 15:27:42 +0800 Jason Wang wrote:
> > I wonder why this series is tagged as "RFC"?
>
> I guess it's because net-next is closed during merge window.
YES. As I know, we can not post "PATCH" during merge window.
So, I po
iver must not send vq notification coalescing commands if
> VIRTIO_NET_F_VQ_NOTF_COAL is not negotiated. This limitation of course
> applies to vq resize.
>
> Fixes: f61fe5f081cf ("virtio-net: fix the vq coalescing setting for vq
> resize")
> Signed-off-by: Heng Q
Hi, guys, I have a fix patch for this.
Could anybody test it?
Thanks.
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index af474cc191d0..426d68c2d01d 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -2492,13 +2492,15 @@ static unsigned int get_mergeable_bu
> and off are needed.
I will post a PATCH, let we discuss under that.
Thanks.
>
> Thanks,
> -Siwei
>
> On 8/17/2024 6:20 AM, Xuan Zhuo wrote:
> > Hi, guys, I have a fix patch for this.
> > Could anybody test it?
> >
> > Thanks.
> >
> > diff
..@oracle.com
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 12 +---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index c6af18948092..e5286a6da863 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_ne
To make the code readable, introduce vring_need_unmap_buffer() to
replace do_unmap.
use_dma_api premapped -> vring_need_unmap_buffer()
1. false falsefalse
2. truefalsetrue
3. truetrue false
Signed-off-by: Xuan Zhuo
Acked-by: Jason W
2837285936
But AF_XDP consumes more CPU for tx and rx napi(100% and 86%).
Please review.
Thanks.
Xuan Zhuo (13):
virtio_ring: introduce vring_need_unmap_buffer
virtio_ring: split: harden dma unmap for indirect
virtio_r
1. this commit hardens dma unmap for indirect
2. the subsequent commit uses the struct extra to record whether the
buffers need to be unmapped or not. So we need a struct extra for
every desc, whatever it is indirect or not.
Signed-off-by: Xuan Zhuo
---
drivers/virtio/virtio_ring.c | 122
virtio-net rq submits premapped buffer per buffer.
And removes the call of the virtnet_rq_set_premapped().
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 31 ---
1 file changed, 8 insertions(+), 23 deletions(-)
diff --git a/drivers/net/virtio_net.c b
NULL, this
indicates that the driver has performed DMA mapping in advance, allowing
the Virtio core to directly utilize sg_dma_address(sg) without
conducting any internal DMA mapping. Additionally, DMA unmap operations
for this buffer will be bypassed.
Suggested-by: Jason Wang
Signed-off-by: Xuan
Because the af-xdp will introduce a new xmit type, so I refactor the
xmit type mechanism first.
We use the last two bits of the pointer to distinguish the xmit type,
so we can distinguish four xmit types. Now we have three types: skb,
orphan and xdp.
Signed-off-by: Xuan Zhuo
---
drivers/net
Since xsk's TX queue is consumed by TX NAPI, if sq is bound to xsk, then
we must stop tx napi from being disabled.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/virtio_net.c | 10 +-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/net/virtio_ne
The driver's tx napi is very important for XSK. It is responsible for
obtaining data from the XSK queue and sending it out.
At the beginning, we need to trigger tx napi.
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 127 ++-
1 file changed
This patch implement the logic of bind/unbind xsk pool to sq and rq.
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 54
1 file changed, 54 insertions(+)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 96abee36738b
1. this commit hardens dma unmap for indirect
2. the subsequent commit uses the struct extra to record whether the
buffers need to be unmapped or not. So we need a struct extra for
every desc, whatever it is indirect or not.
Signed-off-by: Xuan Zhuo
---
drivers/virtio/virtio_ring.c | 57
Now, we supported AF_XDP(xsk). Add NETDEV_XDP_ACT_XSK_ZEROCOPY to
xdp_features.
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 28c5f9e77fa3..8e4578ec1937 100644
If send queue sent some packets, we update the tx timeout
record to prevent the tx timeout.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/virtio_net.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index
virtnet_free_old_xmit distinguishes three type ptr(skb, xdp frame, xsk
buffer) by the last bits of the pointer.
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 85
1 file changed, 59 insertions(+), 26 deletions(-)
diff --git a/drivers/net
Now, this API is useless. remove it.
Signed-off-by: Xuan Zhuo
---
drivers/virtio/virtio_ring.c | 48
include/linux/virtio.h | 2 --
2 files changed, 50 deletions(-)
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index
On Tue, 27 Aug 2024 11:38:45 +0800, Jason Wang wrote:
> On Tue, Aug 20, 2024 at 3:19 PM Xuan Zhuo wrote:
> >
> > leads to regression on VM with the sysctl value of:
> >
> > - net.core.high_order_alloc_disable=1
> >
> > which could see reliable crashes
/2024 9:47 AM, Darren Kenny wrote:
> > Hi Michael,
> >
> > On Tuesday, 2024-08-20 at 12:50:39 -04, Michael S. Tsirkin wrote:
> >> On Tue, Aug 20, 2024 at 03:19:13PM +0800, Xuan Zhuo wrote:
> >>> leads to regression on VM with the sysctl value of:
> >>>
On Thu, 29 Aug 2024 12:51:31 +0800, Jason Wang wrote:
> On Wed, Aug 28, 2024 at 7:21 PM Xuan Zhuo wrote:
> >
> > On Tue, 27 Aug 2024 11:38:45 +0800, Jason Wang wrote:
> > > On Tue, Aug 20, 2024 at 3:19 PM Xuan Zhuo
> > > wrote:
> > > >
> >
On Thu, 29 Aug 2024 12:51:31 +0800, Jason Wang wrote:
> On Wed, Aug 28, 2024 at 7:21 PM Xuan Zhuo wrote:
> >
> > On Tue, 27 Aug 2024 11:38:45 +0800, Jason Wang wrote:
> > > On Tue, Aug 20, 2024 at 3:19 PM Xuan Zhuo
> > > wrote:
> > > >
> >
On Thu, 29 Aug 2024 03:35:58 -0400, "Michael S. Tsirkin"
wrote:
> On Thu, Aug 29, 2024 at 03:26:00PM +0800, Xuan Zhuo wrote:
> > On Thu, 29 Aug 2024 12:51:31 +0800, Jason Wang wrote:
> > > On Wed, Aug 28, 2024 at 7:21 PM Xuan Zhuo
> > > wrote:
> &g
On Wed, 21 Aug 2024 17:47:06 +0100, Darren Kenny
wrote:
>
> Hi Michael,
>
> On Tuesday, 2024-08-20 at 12:50:39 -04, Michael S. Tsirkin wrote:
> > On Tue, Aug 20, 2024 at 03:19:13PM +0800, Xuan Zhuo wrote:
> >> leads to regression on
On Fri, 6 Sep 2024 04:43:29 -0400, "Michael S. Tsirkin" wrote:
> On Tue, Aug 20, 2024 at 03:19:13PM +0800, Xuan Zhuo wrote:
> > leads to regression on VM with the sysctl value of:
> >
> > - net.core.high_order_alloc_disable=1
> >
> > which could see
On Fri, 6 Sep 2024 05:08:56 -0400, "Michael S. Tsirkin" wrote:
> On Fri, Sep 06, 2024 at 04:53:38PM +0800, Xuan Zhuo wrote:
> > On Fri, 6 Sep 2024 04:43:29 -0400, "Michael S. Tsirkin"
> > wrote:
> > > On Tue, Aug 20, 2024 at 03:19:13PM +0800, Xuan Z
On Fri, 6 Sep 2024 05:44:27 -0400, "Michael S. Tsirkin" wrote:
> On Fri, Sep 06, 2024 at 05:25:36PM +0800, Xuan Zhuo wrote:
> > On Fri, 6 Sep 2024 05:08:56 -0400, "Michael S. Tsirkin"
> > wrote:
> > > On Fri, Sep 06, 2024 at 04:53:38PM +0800, Xuan Zhu
Darren can not reply in time, Michael you can try this
patch set.
Thanks.
Xuan Zhuo (3):
Revert "virtio_net: rx remove premapped failover code"
Revert "virtio_net: big mode skip the unmap check"
virtio_net: disable premapped mode by default
drivers/n
This reverts commit a377ae542d8d0a20a3173da3bbba72e045bea7a9.
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 36a7781979b7..b68e64e8c7b6 100644
--- a/drivers
a_api")
Reported-by: "Si-Wei Liu"
Closes:
http://lore.kernel.org/all/8b20cc28-45a9-4643-8e87-ba164a540...@oracle.com
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 18 --
1 file changed, 18 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/ne
This reverts commit defd28aa5acb0fd7c15adc6bc40a8ac277d04dea.
Recover the code to disable premapped mode.
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 85 +++-
1 file changed, 50 insertions(+), 35 deletions(-)
diff --git a/drivers/net
On Sun, 8 Sep 2024 15:40:32 -0400, "Michael S. Tsirkin" wrote:
> On Tue, Aug 20, 2024 at 03:19:13PM +0800, Xuan Zhuo wrote:
> > leads to regression on VM with the sysctl value of:
> >
> > - net.core.high_order_alloc_disable=1
> >
> > which could see
On Mon, 9 Sep 2024 16:38:16 +0800, Jason Wang wrote:
> On Fri, Sep 6, 2024 at 5:32 PM Xuan Zhuo wrote:
> >
> > On Fri, 6 Sep 2024 05:08:56 -0400, "Michael S. Tsirkin"
> > wrote:
> > > On Fri, Sep 06, 2024 at 04:53:38PM +0800, Xuan Zhuo wrote:
> > &
On Mon, 9 Sep 2024 16:47:02 +0800, Jason Wang wrote:
> On Mon, Sep 9, 2024 at 11:16 AM Xuan Zhuo wrote:
> >
> > On Sun, 8 Sep 2024 15:40:32 -0400, "Michael S. Tsirkin"
> > wrote:
> > > On Tue, Aug 20, 2024 at 03:19:13PM +0800, Xuan Zhuo wrote:
> >
On Tue, 10 Sep 2024 14:18:37 +0800, Jason Wang wrote:
> On Mon, Sep 9, 2024 at 4:50 PM Xuan Zhuo wrote:
> >
> > On Mon, 9 Sep 2024 16:38:16 +0800, Jason Wang wrote:
> > > On Fri, Sep 6, 2024 at 5:32 PM Xuan Zhuo
> > > wrote:
> > > >
> >
On Wed, 11 Sep 2024 12:30:49 -0700, "Si-Wei Liu" wrote:
>
>
> On 9/11/2024 7:22 AM, Michael S. Tsirkin wrote:
> > Thanks a lot!
> > Could you retest Xuan Zhuo original patch
> Which one? I thought Darren already did so?
This one[1].
Now, we revert these pa
On Wed, 11 Sep 2024 07:28:36 -0400, "Michael S. Tsirkin"
wrote:
> As gcc luckily noted:
>
> On Tue, Aug 20, 2024 at 03:33:20PM +0800, Xuan Zhuo wrote:
> > @@ -1617,23 +1617,24 @@ static void detach_buf_packed(struct
> > vring_virtqueue *vq,
> &g
On Wed, 11 Sep 2024 11:46:30 +0800, Jason Wang wrote:
> On Tue, Aug 20, 2024 at 3:33 PM Xuan Zhuo wrote:
> >
> > 1. this commit hardens dma unmap for indirect
>
> I think we need to explain why we need such hardening. For example
> indirect use stream mapping which is r
On Wed, 11 Sep 2024 11:54:25 +0800, Jason Wang wrote:
> On Tue, Aug 20, 2024 at 3:33 PM Xuan Zhuo wrote:
> >
> > The current configuration sets the virtqueue (vq) to premapped mode,
> > implying that all buffers submitted to this queue must be mapped ahead
> > of time
On Thu, 12 Sep 2024 03:38:12 -0400, "Michael S. Tsirkin"
wrote:
> On Thu, Sep 12, 2024 at 02:55:38PM +0800, Xuan Zhuo wrote:
> > On Wed, 11 Sep 2024 07:28:36 -0400, "Michael S. Tsirkin"
> > wrote:
> > > As gcc luckily noted:
> > >
> >
On Wed, 11 Sep 2024 12:04:16 +0800, Jason Wang wrote:
> On Tue, Aug 20, 2024 at 3:33 PM Xuan Zhuo wrote:
> >
> > Because the af-xdp will introduce a new xmit type, so I refactor the
> > xmit type mechanism first.
> >
> > We use the last two bits of the poi
On Wed, 11 Sep 2024 12:32:54 +0800, Jason Wang wrote:
> On Tue, Aug 20, 2024 at 3:34 PM Xuan Zhuo wrote:
> >
> > virtnet_free_old_xmit distinguishes three type ptr(skb, xdp frame, xsk
> > buffer) by the last bits of the pointer.
> >
> > Signed-off-by: Xuan Zhuo
On Wed, 11 Sep 2024 12:08:06 +0800, Jason Wang wrote:
> On Tue, Aug 20, 2024 at 3:33 PM Xuan Zhuo wrote:
> >
> > This patch implement the logic of bind/unbind xsk pool to sq and rq.
> >
> > Signed-off-by: Xuan Zhuo
> > ---
&
On Wed, 11 Sep 2024 12:31:32 +0800, Jason Wang wrote:
> On Tue, Aug 20, 2024 at 3:33 PM 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.
> >
> > At the
are not enough queues.
Signed-off-by: Xuan Zhuo
Reviewed-by: Dust Li
---
drivers/net/virtio_net.c | 48
1 file changed, 36 insertions(+), 12 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index ba8e637..c66ce4c
are not enough queues.
Signed-off-by: Xuan Zhuo
Reviewed-by: Dust Li
---
drivers/net/virtio_net.c | 45 -
1 file changed, 36 insertions(+), 9 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index ba8e637..a3116bc 100644
are not enough queues.
Signed-off-by: Xuan Zhuo
Reviewed-by: Dust Li
---
drivers/net/virtio_net.c | 53
1 file changed, 44 insertions(+), 9 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index ba8e637..55f1dd1
.
This patch allows XDP_TX/XDP_REDIRECT to run by reuse the existing SQ
with __netif_tx_lock() hold when there are not enough queues.
Signed-off-by: Xuan Zhuo
Reviewed-by: Dust Li
---
v5: change subject from 'support XDP_TX when not more queues'
v4: make sparse happy
suggested by Jaku
xsk adds an interface and returns the page corresponding to
data. virtio-net does not initialize dma, so it needs page to construct
scatterlist to pass to vring.
Signed-off-by: Xuan Zhuo
Reviewed-by: Dust Li
---
include/net/xdp_sock_drv.h | 11 +++
1 file changed, 11 insertions
: Xuan Zhuo
Reviewed-by: Dust Li
---
include/linux/netdevice.h | 1 +
net/xdp/xsk_buff_pool.c | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index f57b70fc251f..47666b5d2dff 100644
--- a/include/linux/netdevice.h
+++ b
operation is under the
protection of rtnl_lock
Signed-off-by: Xuan Zhuo
Reviewed-by: Dust Li
---
drivers/net/virtio_net.c | 66
1 file changed, 66 insertions(+)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index bb4ea9dbc16b
.
Signed-off-by: Xuan Zhuo
Reviewed-by: Dust Li
---
drivers/net/virtio_net.c | 183 +++
1 file changed, 183 insertions(+)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 4e25408a2b37..c8a317a93ef7 100644
--- a/drivers/net/virtio_net.c
1500 81.5%
Xuan Zhuo (8):
xsk: XDP_SETUP_XSK_POOL support option check_dma
xsk: support get page by addr
virtio-net: xsk zero copy xmit setup
virtio-net: xsk zero copy xmit implement wakeup and xmit
virtio-net: xsk zero copy xmit support xsk unaligned mode
virtio-net: xsk zero copy
need_wakeup is set. If __free_old_xmit is called first by start_xmit, we
can quickly wake up napi to execute xsk xmit work.
When recycling, we need to count the number of bytes sent, so put xsk
desc->len into the ptr pointer. Because ptr does not point to meaningful
objects in xsk.
Signed-off-by: X
-off-by: Xuan Zhuo
Reviewed-by: Dust Li
---
drivers/net/virtio_net.c | 23 ---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 259fafcf6028..d7e95f55478d 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers
In xsk unaligned mode, the frame pointed to by desc may span two
consecutive pages, but not more than two pages.
Signed-off-by: Xuan Zhuo
Reviewed-by: Dust Li
---
drivers/net/virtio_net.c | 30 --
1 file changed, 24 insertions(+), 6 deletions(-)
diff --git a
poll tx call virtnet_xsk_run, then the data in the xsk tx queue will be
continuously consumed by napi.
Signed-off-by: Xuan Zhuo
Reviewed-by: Dust Li
---
drivers/net/virtio_net.c | 20 +---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/drivers/net/virtio_net.c b
1:
no build_skb: 956864.00 rxpck/s
build_skb:1158465.00 rxpck/s
Signed-off-by: Xuan Zhuo
Suggested-by: Jason Wang
---
drivers/net/virtio_net.c | 51 ++--
1 file changed, 33 insertions(+), 18 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/v
aligned based on the cache line. But there is a 4-byte hole left here.
Since the fields before and after priv_flags are read mostly, I did not
adjust the order of the fields here.
Signed-off-by: Xuan Zhuo
---
include/linux/netdevice.h | 136 --
1 file changed, 71
priv_flags IFF_NOT_USE_DMA_ADDR
2. more reasonable patch split
Xuan Zhuo (10):
netdevice: priv_flags extend to 64bit
netdevice: add priv_flags IFF_NOT_USE_DMA_ADDR
virtio-net: add priv_flags IFF_NOT_USE_DMA_ADDR
xsk: support get page by addr
xsk: XDP_SETUP_XSK_POOL supp
Some driver devices, such as virtio-net, do not directly use dma addr.
For upper-level frameworks such as xdp socket, that need to be aware of
this. So add a new priv_flag IFF_NOT_USE_DMA_ADDR.
Signed-off-by: Xuan Zhuo
---
include/linux/netdevice.h | 3 +++
1 file changed, 3 insertions(+)
diff
virtio-net not use dma addr directly. So add this priv_flags
IFF_NOT_USE_DMA_ADDR.
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index bb4ea9dbc16b..52653e234a20
uniformly to
recover old xmit ptr.
Rename free_old_xmit_skbs() to free_old_xmit().
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 86 ++--
1 file changed, 38 insertions(+), 48 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.
Some devices, such as virtio-net, do not directly use dma addr. These
devices do not initialize dma after completing the xsk setup, so the dma
check is skipped here.
Signed-off-by: Xuan Zhuo
Reviewed-by: Dust Li
---
net/xdp/xsk_buff_pool.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion
the ptr pointer. Because ptr does not point to meaningful
objects in xsk.
Signed-off-by: Xuan Zhuo
Reviewed-by: Dust Li
---
drivers/net/virtio_net.c | 296 ++-
1 file changed, 292 insertions(+), 4 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/
api schedule again, and no conflicts with the logic of
napi_poll().
When work == budget, virtnet_poll_tx() will return the var 'work', and
the napi_poll() in dev.c will re-add napi to the queue.
The purpose of this patch is to support xsk xmit in virtio_poll_tx for
subsequent patch.
Signed
xsk adds an interface and returns the page corresponding to
data. virtio-net does not initialize dma, so it needs page to construct
scatterlist to pass to vring.
Signed-off-by: Xuan Zhuo
Reviewed-by: Dust Li
---
include/net/xdp_sock_drv.h | 11 +++
1 file changed, 11 insertions
cpu on the host has also
reached 100%.
Signed-off-by: Xuan Zhuo
Reviewed-by: Dust Li
---
drivers/net/virtio_net.c | 19 +--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index c441d6bf1510..4e360bfc2cf0 100644
operation is under the
protection of rtnl_lock.
If xsk is active, it will prevent ethtool from modifying tx napi.
Signed-off-by: Xuan Zhuo
Reviewed-by: Dust Li
---
drivers/net/virtio_net.c | 78 +++-
1 file changed, 77 insertions(+), 1 deletion(-)
diff --git a
1:
no build_skb: 956864.00 rxpck/s
build_skb:1158465.00 rxpck/s
Signed-off-by: Xuan Zhuo
Suggested-by: Jason Wang
---
v2: conflict resolution
drivers/net/virtio_net.c | 51 ++--
1 file changed, 33 insertions(+), 18 deletions(-)
diff --git a/drivers/n
1:
no build_skb: 956864.00 rxpck/s
build_skb:1158465.00 rxpck/s
Signed-off-by: Xuan Zhuo
Suggested-by: Jason Wang
---
v3: fix the truesize when headroom > 0
v2: conflict resolution
drivers/net/virtio_net.c | 69
1 file changed, 48 insertions(+), 2
.
This patch allows XDP_TX/XDP_REDIRECT to run by reuse the existing SQ
with __netif_tx_lock() hold when there are not enough queues.
Signed-off-by: Xuan Zhuo
Reviewed-by: Dust Li
---
v6: 1. use __netif_tx_acquire()/__netif_tx_release(). (suggested by Jason Wang)
2. add note for why not lock
.
This patch allows XDP_TX/XDP_REDIRECT to run by reuse the existing SQ
with __netif_tx_lock() hold when there are not enough queues.
Signed-off-by: Xuan Zhuo
Reviewed-by: Dust Li
---
v7: 1. use macros to implement get/put
2. remove 'flag'. (suggested by Jason Wang)
.
This patch allows XDP_TX/XDP_REDIRECT to run by reuse the existing SQ
with __netif_tx_lock() hold when there are not enough queues.
Signed-off-by: Xuan Zhuo
Reviewed-by: Dust Li
Acked-by: Jason Wang
---
v8: 1. explain why use macros not inline functions. (suggested by Michael S.
Tsirkin)
2
501 - 600 of 682 matches
Mail list logo