On Thu, 24 Jul 2025 16:30:05 +0800, Wang Liang wrote:
> When sending a packet with virtio_net_hdr to tun device, if the gso_type
> in virtio_net_hdr is SKB_GSO_UDP and the gso_size is less than udphdr
> size, below crash may happen.
>
> [ cut here ]
> kernel BUG at net/
On Sat, 21 Jun 2025 21:49:52 +0700, Bui Quang Minh
wrote:
> This commit does not do any functional changes. It moves xdp->data
> adjustment for buffer other than first buffer to buf_to_xdp() helper so
> that the xdp_buff adjustment does not scatter over different functions.
>
> Signed-off-by: Bui
> Signed-off-by: Bui Quang Minh
Reviewed-by: Xuan Zhuo
> ---
> drivers/net/virtio_net.c | 16 ++--
> 1 file changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 1eb237cd5d0b..4e942ea1bfa3 100644
>
->hdr_len
>
> like in the current check.
>
> This commit adds an additional argument to buf_to_xdp differentiate
> between the first buffer and other ones to correctly calculate the maximum
> frame's length.
>
> Fixes: a4e7ba702701 ("virtio_net: xsk: rx:
proper parameter documentation
> following kernel-doc format.
>
> Signed-off-by: WangYuli
Reviewed-by: Xuan Zhuo
> ---
> drivers/virtio/virtio_dma_buf.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/virtio/virtio_dma_buf.c b/drivers/virtio/virtio_
On Tue, 27 May 2025 10:27:19 -0400, "Michael S. Tsirkin"
wrote:
> drivers handle ENOSPC specially since it's an error one can
> get from a working VQ. Document the semantics.
>
> Reported-by: Parav Pandit
> Signed-off-by: Michael S. Tsirkin
Reviewed-by: Xuan
XDP_PASS. As a result, the packet is passed to normal network
> stack which is an incorrect behavior. This commit instead returns
> XDP_DROP in that case.
>
> Fixes: 99c861b44eb1 ("virtio_net: xsk: rx: support recv merge mode")
> Cc: sta...@vger.kernel.org
> Signed-off-by:
On Thu, 29 May 2025 01:42:39 -0700, Alok Tiwari
wrote:
> Corrected "suceess" to "success" in the function documentation
> for clarity.
>
> Signed-off-by: Alok Tiwari
> Acked-by: Jason Wang
Reviewed-by: Xuan Zhuo
> ---
> v1 -> v2
&
On Fri, 4 Apr 2025 16:39:03 +0700, Bui Quang Minh
wrote:
> When pausing rx (e.g. set up xdp, xsk pool, rx resize), we call
> napi_disable() on the receive queue's napi. In delayed refill_work, it
> also calls napi_disable() on the receive queue's napi. This can leads to
> deadlock when napi_disa
For series:
Reviewed-by: Xuan Zhuo
Thanks.
On Mon, 24 Mar 2025 13:43:14 +0800, Jason Wang wrote:
> Hello all:
>
> This sereis tries to implement the VIRTIO_F_IN_ORDER to
> virtio_ring. This is done by introducing virtqueue ops so we can
> implement separate helpers for diff
xes a few minor bugs I found
> when writing patches.
>
> Signed-off-by: Akihiko Odaki
Reviewed-by: Xuan Zhuo
> ---
> Changes in v2:
> - Replaced kmalloc() with kzalloc() to initialize the reserved fields.
> - Link to v1:
> https://lore.kernel.org/r/20250318-virtio-v1-0-34
On Tue, 18 Mar 2025 18:56:53 +0900, Akihiko Odaki
wrote:
> The new RSS configuration structures allow easily constructing data for
> VIRTIO_NET_CTRL_MQ_RSS_CONFIG as they strictly follow the order of data
> for the command.
>
> Signed-off-by: Akihiko Odaki
> ---
> drivers/net/virtio_net.c | 117
Reviewed-by: Xuan Zhuo
On Fri, 7 Mar 2025 01:12:08 +, Joe Damato wrote:
> Greetings:
>
> Welcome to v6. Only patch updated is patch 3. See changelog below.
>
> Jakub recently commented [1] that I should not hold this series on
> virtio-net linking queues to NAPIs behi
ls/net/ynl/pyynl/cli.py \
> --spec Documentation/netlink/specs/netdev.yaml \
> --dump queue-get --json='{"ifindex": 2}'
> [{'id': 0, 'ifindex': 2, 'napi-id': 8193, 'type': 'rx'},
> {'id': 1, 'if
On Thu, 16 Jan 2025 05:52:58 +, Joe Damato wrote:
> Use netif_queue_set_napi to map NAPIs to queue IDs so that the mapping
> can be accessed by user apps.
>
> $ ethtool -i ens4 | grep driver
> driver: virtio_net
>
> $ sudo ethtool -L ens4 combined 4
>
> $ ./tools/net/ynl/pyynl/cli.py \
>
On Tue, 17 Dec 2024 11:54:32 +0800, Ma Ke wrote:
> When device_add(&dev->dev) failed, calling put_device() to explicitly
> release dev->dev. Otherwise, it could cause double free problem.
Who frees it doublely?
If device_add() failed, the put_device is called inside device_add(),
why we need to c
For the series,
Reviewed-by: Xuan Zhuo
Thanks
On Fri, 6 Dec 2024 10:10:41 +0900, Koichiro Den
wrote:
> When virtnet_close is followed by virtnet_open, some TX completions can
> possibly remain unconsumed, until they are finally processed during the
> first NAPI poll
On Wed, 27 Nov 2024 13:30:59 +0530, Naresh Kamboju
wrote:
> The following build errors were noticed for arm64, arm, x86_64 and riscv.
>
> First seen on Sasha Linus-next 441d2975754ad94f3ce2e29f672824bc2dc5120c.
> Good: 07e98e730a08081b6d0b5c3a173b0487c36ed27f
> Bad: 441d2975754ad94f3ce2e29f6
On Mon, 18 Nov 2024 20:40:56 +0800, "xiaowuding_jaguarmicro"
wrote:
> From: Xiaowu Ding
>
> The virtio_add_status function have done might_sleep(),so we can remove
> the duplicate calls.
Is there any problem here? If not, I think we can keep it.
Thanks.
>
> Signed-off-by: Xiaowu Ding
> ---
On Mon, 11 Nov 2024 10:55:38 +0800, Jason Wang wrote:
> There's no need to sync DMA for CPU on mapping errors. So this patch
> skips the CPU sync in the error handling path of DMA mapping.
>
> Signed-off-by: Jason Wang
Reviewed-by: Xuan Zhuo
> ---
> drivers/vi
Hi Jason, could you review this firstly?
Thanks.
On Mon, 4 Nov 2024 16:57:02 +0800, Philo Lu wrote:
> With this patch set, RSS updates with queue_pairs changing:
> - When virtnet_probe, init default rss and commit
> - When queue_pairs changes _without_ user rss configuration, update rss
> wit
assed to the virtio core in small
> and merge mode.
> Changes from v1: Use ctx to get xdp_headroom.
>
> Fixes: 295525e29a5b ("virtio_net: merge dma operations when filling mergeable
> buffers")
> Signed-off-by: Wenbo Li
> Signed-off-by: Jiahui Cen
> Signed-off-by:
On Thu, 19 Sep 2024 16:32:45 +0800, Xuan Zhuo
wrote:
> On Thu, 19 Sep 2024 16:13:51 +0800, Wenbo Li
> wrote:
> > Currently, the virtio-net driver will perform a pre-dma-mapping for
> > small or mergeable RX buffer. But for small packets, a mismatched address
> > wi
On Thu, 19 Sep 2024 11:52:14 +0800, Wenbo Li
wrote:
> Currently, the virtio-net driver will perform a pre-dma-mapping for
> small or mergeable RX buffer. But for small packets, a mismatched address
> without VIRTNET_RX_PAD and xdp_headroom is used for unmapping.
>
> That will result in unsynchron
On Fri, 6 Sep 2024 05:52:36 -0400, "Michael S. Tsirkin" wrote:
> This reverts commit defd28aa5acb0fd7c15adc6bc40a8ac277d04dea.
>
> leads to crashes with no ACCESS_PLATFORM when
> sysctl net.core.high_order_alloc_disable=1
>
> Cc: Xuan Zhuo
> Reported-by: Si-Wei
mon_hdr *)buf)->hdr.flags;
So I think it is time to unify the buf that passed to the virtio core into a
pointer pointed to the virtnet header.
Thanks.
>
> Thanks.
>
> On Wed, Sep 4, 2024 at 2:46 PM Xuan Zhuo wrote:
> >
> > On Wed, 4 Sep 2024 14:10:09 +0800, Wenbo Li
On Wed, 4 Sep 2024 14:10:09 +0800, Wenbo Li
wrote:
> Currently, the virtio-net driver will perform a pre-dma-mapping for
> small or mergeable RX buffer. But for small packets, a mismatched address
> without VIRTNET_RX_PAD and xdp_headroom is used for unmapping.
Will used virt_to_head_page(), so
On Wed, 24 Jul 2024 00:41:08 -0700, Zhu Jun
wrote:
> The unsigned int should use "%u" instead of "%d".
>
> Signed-off-by: Zhu Jun
Reviewed-by: Xuan Zhuo
> ---
> tools/virtio/ringtest/main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
; DEFAULT group default qlen 1000
> link/ether 00:00:05:00:00:09 brd ff:ff:ff:ff:ff:ff
> ...
> 5: macvlan0@enp0s3: mtu 1500 qdisc
> noqueue state LOWERLAYERDOWN mode DEFAULT group default qlen 1000
> link/ether b2:a9:c5:04:da:53 brd ff:ff:ff:ff:ff:ff
>
> Cc: Venkat Venkatsubra
> C
On Tue, 9 Jul 2024 16:02:14 +0800, Jason Wang wrote:
> This patch synchronize operstate with admin state per RFC2863.
>
> This is done by trying to toggle the carrier upon open/close and
> synchronize with the config change work. This allows propagate status
> correctly to stacked devices like:
>
a-Khanh Nguyen
> Signed-off-by: Jason Wang
Reviewed-by: Xuan Zhuo
> ---
> drivers/virtio/virtio.c | 39 ---
> include/linux/virtio.h | 7 +++
> 2 files changed, 43 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/vir
On Tue, 9 Jul 2024 16:02:13 +0800, Jason Wang wrote:
> Sometime, it would be useful to disable the configure change
> notification from the driver. So this patch allows this by introducing
> a variable config_change_driver_disabled and only allow the configure
> change notification callback to be
Venkatsubra
> Cc: Gia-Khanh Nguyen
> Signed-off-by: Jason Wang
Reviewed-by: Xuan Zhuo
Thanks.
> ---
> drivers/virtio/virtio.c | 22 +++---
> include/linux/virtio.h | 4 ++--
> 2 files changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/drivers
s struct.
>
> Signed-off-by: Michael S. Tsirkin
Reviewed-by: Xuan Zhuo
> ---
>
> Especially important now that Jiri's patch for BQL has been merged.
> Lightly tested.
>
> drivers/net/virtio_net.c | 6 --
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
>
On Mon, 17 Jun 2024 16:15:54 +0900, Tetsuo Handa
wrote:
> Bisection reached commit f9dac92ba908 ("virtio_ring: enable premapped mode
> whatever use_dma_api").
>
> On 2024/05/26 1:12, syzbot wrote:
> > Hello,
> >
> > syzbot found the following issue on:
> >
> > HEAD commit:56fb6f92854f Merge t
On Wed, 22 May 2024 07:38:01 -0400, "Michael S. Tsirkin"
wrote:
> On Wed, May 22, 2024 at 06:22:45PM +0800, Xuan Zhuo wrote:
> > On Wed, 22 May 2024 06:03:01 -0400, "Michael S. Tsirkin"
> > wrote:
> > > Things to note here:
> > >
> > &
t; Merge tag 'for_linus' into vhost
>
> Mike Christie (9):
> vhost-scsi: Handle vhost_vq_work_queue failures for events
> vhost-scsi: Handle vhost_vq_work_queue failures for cmds
> vhost-scsi: Use system wq to flush dev for TMFs
>
; codes.
>
> Fix the bug and clean things up so that it's clear that
> __virtnet_get_hw_stats() returns zero on success or negative error codes
> on failure.
>
> Fixes: 941168f8b40e ("virtio_net: support device stats")
> Signed-off-by: Dan Carpenter
Th
realizes that the
> vitio is broken at QEMU side.
>
> Fix it by not sending RSS commands if the feature is not available in
> the device.
>
> Fixes: c7114b1249fa ("drivers/net/virtio_net: Added basic RSS support.")
> Cc: sta...@vger.kernel.org
> Cc: qemu-de...@nongnu.org
On Wed, 27 Mar 2024 06:51:25 -0700, Breno Leitao wrote:
> Hello Xuan,
>
> On Wed, Mar 27, 2024 at 09:37:43AM +0800, Xuan Zhuo wrote:
> > On Tue, 26 Mar 2024 08:19:08 -0700, Breno Leitao wrote:
> > > Do not set virtnet_info->rss_indir_table_size if RSS is not ava
On Tue, 26 Mar 2024 08:19:08 -0700, Breno Leitao wrote:
> Do not set virtnet_info->rss_indir_table_size if RSS is not available
> for the device.
>
> Currently, rss_indir_table_size is set if either has_rss or
> has_rss_hash_report is available, but, it should only be set if has_rss
> is set.
>
>
On Mon, 25 Mar 2024 04:26:08 -0700, Breno Leitao wrote:
> Hello Xuan,
>
> On Mon, Mar 25, 2024 at 01:57:53PM +0800, Xuan Zhuo wrote:
> > On Fri, 22 Mar 2024 03:21:21 -0700, Breno Leitao wrote:
> > > Hello Xuan,
> > >
> > > On Fri, Mar 22, 2024 at 10:00:2
On Fri, 22 Mar 2024 03:21:21 -0700, Breno Leitao wrote:
> Hello Xuan,
>
> On Fri, Mar 22, 2024 at 10:00:22AM +0800, Xuan Zhuo wrote:
> > On Thu, 21 Mar 2024 09:54:30 -0700, Breno Leitao wrote:
>
> > > 4) Since the command above does not have a key, then the last
&g
On Thu, 21 Mar 2024 09:54:30 -0700, Breno Leitao wrote:
> There is a bug when setting the RSS options in virtio_net that can break
> the whole machine, getting the kernel into an infinite loop.
>
> Running the following command in any QEMU virtual machine with virtionet
> will reproduce this probl
On Fri, 09 Feb 2024 13:57:25 +0100, Paolo Abeni wrote:
> On Fri, 2024-02-09 at 18:39 +0800, Liang Chen wrote:
> > On Wed, Feb 7, 2024 at 10:27 PM Paolo Abeni wrote:
> > >
> > > On Wed, 2024-02-07 at 10:54 +0800, Liang Chen wrote:
> > > > On Tue, Feb 6, 2024 at 6:44 PM Paolo Abeni wrote:
> > > >
On Wed, 21 Feb 2024 11:37:22 +, wangyunjian wrote:
> > -Original Message-
> > From: Xuan Zhuo [mailto:xuanz...@linux.alibaba.com]
> > Sent: Wednesday, February 21, 2024 5:53 PM
> > To: wangyunjian
> > Cc: net...@vger.kernel.org; linux-kernel@vger.kernel
On Wed, 24 Jan 2024 17:37:38 +0800, Yunjian Wang wrote:
> 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.
Could you tell me which one nic can work with AF_XDP without DMA?
Thanks.
>
> Signed-off-
sing in the XDP path. Therefore, we are introducing
> > > XDP hints through kfuncs to allow XDP programs to access the RSS hash.
> > >
> > > 1.
> > > https://lore.kernel.org/all/20231015141644.260646-1-akihiko.od...@daynix.com/#r
> > >
> > > Si
_to_cpu(hdr_hash->hash_value);
> + virtnet_xdp->hash_report = __le16_to_cpu(hdr_hash->hash_report);
Could we put the __leXX_to_cpu to virtnet_xdp_rx_hash?
Other looks good to me.
Reviewed-by: Xuan Zhuo
Thanks.
> + }
> +}
> +
> static int virtnet_xdp_handler(stru
On Thu, 25 Jan 2024 11:48:18 +0800, Jason Wang wrote:
> On Wed, Jan 24, 2024 at 5:16 PM Xuan Zhuo wrote:
> >
> > On Wed, 24 Jan 2024 16:57:20 +0800, Liang Chen
> > wrote:
> > > For the XDP_PASS scenario of the XDP path, the skb constructed with
> > > xdp_
On Wed, 24 Jan 2024 16:57:20 +0800, Liang Chen
wrote:
> For the XDP_PASS scenario of the XDP path, the skb constructed with
> xdp_buff does not include the virtio header. Adding the virtio header
> information back when creating the skb.
>
> Signed-off-by: Liang Chen
> ---
> drivers/net/virtio_
On Wed, 24 Jan 2024 16:57:19 +0800, Liang Chen
wrote:
> The xdp program may overwrite the inline virtio header. To ensure the
> integrity of the virtio header, it is saved in a data structure that
> wraps both the xdp_buff and the header before running the xdp program.
>
> Signed-off-by: Liang Ch
On Wed, 24 Jan 2024 10:04:51 +0800, Liang Chen
wrote:
> On Mon, Jan 22, 2024 at 7:10 PM Heng Qi wrote:
> >
> > Hi Liang Chen,
> >
> > 在 2024/1/22 下午6:22, Liang Chen 写道:
> > > The RSS hash report is a feature that's part of the virtio specification.
> > > Currently, virtio backends like qemu, vdp
On Thu, 30 Nov 2023 13:30:40 +0800, Zhu Yanjun wrote:
>
> 在 2023/11/30 10:34, Xuan Zhuo 写道:
> > On Wed, 29 Nov 2023 23:29:10 +0800, Zhu Yanjun wrote:
> >> 在 2023/11/29 23:22, Zhu Yanjun 写道:
> >>> 在 2023/11/29 22:59, Michael S. Tsirkin 写道:
> >>>&g
On Wed, 29 Nov 2023 23:29:10 +0800, Zhu Yanjun wrote:
>
> 在 2023/11/29 23:22, Zhu Yanjun 写道:
> >
> > 在 2023/11/29 22:59, Michael S. Tsirkin 写道:
> >> On Wed, Nov 29, 2023 at 10:50:57PM +0800, Zhu Yanjun wrote:
> >>> 在 2023/5/26 13:46, Liang Chen 写道:
> >>
> >> what made you respond to a patch from M
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
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
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
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
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
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
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
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
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
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
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
.
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/
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
.
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
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 | 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
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
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
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
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/
78 matches
Mail list logo