Re: [PATCH net-next v3 3/3] virtio-net: synchronize operstate with admin state on up/down

2024-07-18 Thread Michael S. Tsirkin
On Fri, Jul 19, 2024 at 09:02:29AM +0800, Jason Wang wrote: > On Wed, Jul 17, 2024 at 2:53 PM Jason Wang wrote: > > > > On Wed, Jul 17, 2024 at 2:00 PM Michael S. Tsirkin wrote: > > > > > > On Wed, Jul 17, 2024 at 09:19:02AM +0800, Jason Wang wrote: > > >

Re: [PATCH V2 5/7] vhost-vdpa: VHOST_IOTLB_REMAP

2024-07-18 Thread Michael S. Tsirkin
On Thu, Jul 18, 2024 at 08:45:31AM +0800, Jason Wang wrote: > > > For example: > > > > > > 1) old owner pass fd to new owner which is another process > > > 2) the new owner do VHOST_NEW_OWNER > > > 3) new owner doesn't do remap correctly > > > > > > There's no way for the old owner to remove/unpin

Re: [GIT PULL] virtio: features, fixes, cleanups

2024-07-18 Thread Michael S. Tsirkin
On Wed, Jul 17, 2024 at 05:30:34AM -0400, Michael S. Tsirkin wrote: > This is relatively small. > I had to drop a buggy commit in the middle so some hashes > changed from what was in linux-next. > Deferred admin vq scalability fix to after rc2 as a minor issue was > found w

Re: [GIT PULL] virtio: features, fixes, cleanups

2024-07-18 Thread Michael S. Tsirkin
On Thu, Jul 18, 2024 at 08:52:28AM +0800, Jason Wang wrote: > On Wed, Jul 17, 2024 at 5:30 PM Michael S. Tsirkin wrote: > > > > This is relatively small. > > I had to drop a buggy commit in the middle so some hashes > > changed from what was in linux-next. > >

[GIT PULL] virtio: features, fixes, cleanups

2024-07-17 Thread Michael S. Tsirkin
-by: Michael S. Tsirkin Denis Arefev (1): net: missing check virtio Dragos Tatulea (24): vdpa/mlx5: Clarify meaning thorough function rename vdpa/mlx5: Make setup/teardown_vq_resources() symmetrical vdpa/mlx5: Drop

Re: [PATCH net-next v3 3/3] virtio-net: synchronize operstate with admin state on up/down

2024-07-17 Thread Michael S. Tsirkin
On Wed, Jul 17, 2024 at 09:19:02AM +0800, Jason Wang wrote: > On Wed, Jul 10, 2024 at 11:03 AM Jason Wang wrote: > > > > On Tue, Jul 9, 2024 at 9:28 PM Michael S. Tsirkin wrote: > > > > > > On Tue, Jul 09, 2024 at 04:02:14PM +0800, Jason Wang wrote: > &g

Re: [PATCH V2 3/7] vhost-vdpa: VHOST_NEW_OWNER

2024-07-15 Thread Michael S. Tsirkin
On Mon, Jul 15, 2024 at 10:29:26AM -0400, Steven Sistare wrote: > On 7/15/2024 5:07 AM, Michael S. Tsirkin wrote: > > On Fri, Jul 12, 2024 at 06:18:49AM -0700, Steve Sistare wrote: > > > Add an ioctl to transfer file descriptor ownership and pinned memory > > >

Re: [PATCH V2 3/7] vhost-vdpa: VHOST_NEW_OWNER

2024-07-15 Thread Michael S. Tsirkin
On Fri, Jul 12, 2024 at 06:18:49AM -0700, Steve Sistare wrote: > Add an ioctl to transfer file descriptor ownership and pinned memory > accounting from one process to another. > > This is more efficient than VHOST_RESET_OWNER followed by VHOST_SET_OWNER, > as that would unpin all physical pages,

Re: [PATCH V2 3/7] vhost-vdpa: VHOST_NEW_OWNER

2024-07-15 Thread Michael S. Tsirkin
On Mon, Jul 15, 2024 at 10:26:13AM +0800, Jason Wang wrote: > On Fri, Jul 12, 2024 at 9:19 PM Steve Sistare > wrote: > > > > Add an ioctl to transfer file descriptor ownership and pinned memory > > accounting from one process to another. > > > > This is more efficient than VHOST_RESET_OWNER

Re: [PATCH net-next] virtio_net: Fix napi_skb_cache_put warning

2024-07-14 Thread Michael S. Tsirkin
when it's not, such as in the netpoll case. > > To resolve this, modify virtnet_poll_tx() to only set NAPI when budget > is available. Same for virtnet_poll_cleantx(), which always assumed that > it was in a NAPI context. > > Fixes: df133f3f9625 ("virtio_net: bulk fr

Re: [PATCH] virtio: add missing MODULE_DESCRIPTION() macro

2024-07-11 Thread Michael S. Tsirkin
On Thu, Jul 11, 2024 at 11:43:18AM -0700, Jeff Johnson wrote: > On 6/23/24 10:36, Jeff Johnson wrote: > > On 6/2/2024 1:25 PM, Jeff Johnson wrote: > > > make allmodconfig && make W=1 C=1 reports: > > > WARNING: modpost: missing MODULE_DESCRIPTION() in > > > drivers/virtio/virtio_dma_buf.o > > >

Re: [PATCH v2 2/2] virtio: fix vq # for balloon

2024-07-10 Thread Michael S. Tsirkin
On Wed, Jul 10, 2024 at 03:54:22PM -0700, Daniel Verkamp wrote: > On Wed, Jul 10, 2024 at 1:39 PM Michael S. Tsirkin wrote: > > > > On Wed, Jul 10, 2024 at 12:58:11PM -0700, Daniel Verkamp wrote: > > > On Wed, Jul 10, 2024 at 11:39 AM Michael S. Tsirkin > > > w

Re: [PATCH v2 2/2] virtio: fix vq # for balloon

2024-07-10 Thread Michael S. Tsirkin
On Wed, Jul 10, 2024 at 12:58:11PM -0700, Daniel Verkamp wrote: > On Wed, Jul 10, 2024 at 11:39 AM Michael S. Tsirkin wrote: > > > > On Wed, Jul 10, 2024 at 11:12:34AM -0700, Daniel Verkamp wrote: > > > On Wed, Jul 10, 2024 at 4:43 AM Michael S. Tsirkin > > &

Re: [PATCH v2 2/2] virtio: fix vq # for balloon

2024-07-10 Thread Michael S. Tsirkin
On Wed, Jul 10, 2024 at 11:12:34AM -0700, Daniel Verkamp wrote: > On Wed, Jul 10, 2024 at 4:43 AM Michael S. Tsirkin wrote: > > > > virtio balloon communicates to the core that in some > > configurations vq #s are non-contiguous by setting name > > pointer to NULL.

Re: [PATCH v2 2/2] virtio: fix vq # for balloon

2024-07-10 Thread Michael S. Tsirkin
On Wed, Jul 10, 2024 at 11:12:34AM -0700, Daniel Verkamp wrote: > On Wed, Jul 10, 2024 at 4:43 AM Michael S. Tsirkin wrote: > > > > virtio balloon communicates to the core that in some > > configurations vq #s are non-contiguous by setting name > > pointer to NULL.

[PATCH v2 2/2] virtio: fix vq # for balloon

2024-07-10 Thread Michael S. Tsirkin
place. Compatibility with buggy hypervisors is handled inside virtio-balloon, which is the only driver making use of this facility, so far. Message-ID: Fixes: b0c504f15471 ("virtio-balloon: add support for providing free page reports to host") Cc: "Alexander Duyck" Signed-off-by

[PATCH v2 1/2] virtio_balloon: add work around for out of spec QEMU

2024-07-10 Thread Michael S. Tsirkin
Message-ID: Fixes: b0c504f15471 ("virtio-balloon: add support for providing free page reports to host") Cc: "Alexander Duyck" Signed-off-by: Michael S. Tsirkin --- drivers/virtio/virtio_balloon.c | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-)

Re: [PATCH 1/2] virtio_balloon: add work around for out of spec QEMU

2024-07-10 Thread Michael S. Tsirkin
On Wed, Jul 10, 2024 at 03:37:49PM +0800, Jason Wang wrote: > On Wed, Jul 10, 2024 at 2:16 PM Michael S. Tsirkin wrote: > > > > On Wed, Jul 10, 2024 at 11:23:20AM +0800, Jason Wang wrote: > > > On Fri, Jul 5, 2024 at 6:09 PM Michael S. Tsirkin wrote: > >

Re: [PATCH 1/2] virtio_balloon: add work around for out of spec QEMU

2024-07-10 Thread Michael S. Tsirkin
On Wed, Jul 10, 2024 at 11:23:20AM +0800, Jason Wang wrote: > On Fri, Jul 5, 2024 at 6:09 PM Michael S. Tsirkin wrote: > > > > QEMU implemented the configuration > > VIRTIO_BALLOON_F_REPORTING && ! VIRTIO_BALLOON_F_FREE_PAGE_HINT > > incorrectly: it the

Re: [PATCH v3 0/2] vdpa: support set mac address from vdpa tool

2024-07-10 Thread Michael S. Tsirkin
On Wed, Jul 10, 2024 at 11:05:48AM +0800, Jason Wang wrote: > On Tue, Jul 9, 2024 at 8:42 PM Michael S. Tsirkin wrote: > > > > On Tue, Jul 09, 2024 at 02:19:19PM +0800, Cindy Lu wrote: > > > On Tue, 9 Jul 2024 at 11:59, Parav Pandit wrote: > > > > > > &

Re: [PATCH net-next v3 3/3] virtio-net: synchronize operstate with admin state on up/down

2024-07-09 Thread Michael S. Tsirkin
On Tue, Jul 09, 2024 at 04:02:14PM +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

Re: [PATCH v3 0/2] vdpa: support set mac address from vdpa tool

2024-07-09 Thread Michael S. Tsirkin
On Tue, Jul 09, 2024 at 02:19:19PM +0800, Cindy Lu wrote: > On Tue, 9 Jul 2024 at 11:59, Parav Pandit wrote: > > > > Hi Cindy, > > > > > From: Cindy Lu > > > Sent: Monday, July 8, 2024 12:17 PM > > > > > > Add support for setting the MAC address using the VDPA tool. > > > This feature will allow

Re: [PATCH] vdpa/mlx5: Add the support of set mac address

2024-07-08 Thread Michael S. Tsirkin
On Mon, Jul 08, 2024 at 02:55:49PM +0800, Cindy Lu wrote: > Add the function to support setting the MAC address. > For vdpa/mlx5, the function will use mlx5_mpfs_add_mac > to set the mac address > > Tested in ConnectX-6 Dx device > > Signed-off-by: Cindy Lu Is this on top of your other

Re: [PATCH vhost 20/23] vdpa/mlx5: Pre-create hardware VQs at vdpa .dev_add time

2024-07-08 Thread Michael S. Tsirkin
On Mon, Jul 08, 2024 at 11:17:06AM +, Dragos Tatulea wrote: > On Mon, 2024-07-08 at 07:11 -0400, Michael S. Tsirkin wrote: > > On Mon, Jul 08, 2024 at 11:01:39AM +, Dragos Tatulea wrote: > > > On Wed, 2024-07-03 at 18:01 +0200, Eugenio Perez Martin wrote: > > > &

Re: [PATCH vhost 20/23] vdpa/mlx5: Pre-create hardware VQs at vdpa .dev_add time

2024-07-08 Thread Michael S. Tsirkin
On Mon, Jul 08, 2024 at 11:01:39AM +, Dragos Tatulea wrote: > On Wed, 2024-07-03 at 18:01 +0200, Eugenio Perez Martin wrote: > > On Wed, Jun 26, 2024 at 11:27 AM Dragos Tatulea wrote: > > > > > > On Wed, 2024-06-19 at 17:54 +0200, Eugenio Perez Martin wrote: > > > > On Mon, Jun 17, 2024 at

Re: [PATCH] vdpa_sim_blk: add `capacity` module parameter

2024-07-05 Thread Michael S. Tsirkin
On Fri, Jul 05, 2024 at 01:28:21PM +0200, Stefano Garzarella wrote: > The vDPA block simulator always allocated a 128 MiB ram-disk, but some > filesystems (e.g. XFS) may require larger minimum sizes (see > https://issues.redhat.com/browse/RHEL-45951). > > So to allow us to test these filesystems,

[PATCH 2/2] virtio: fix vq # when vq skipped

2024-07-05 Thread Michael S. Tsirkin
place. Compatibility with buggy hypervisors is handled inside virtio-balloon, which is the only driver making use of this facility, so far. Signed-off-by: Michael S. Tsirkin --- arch/um/drivers/virtio_uml.c | 4 ++-- drivers/remoteproc/remoteproc_virtio.c | 4 ++-- drivers/s390/virtio

[PATCH 1/2] virtio_balloon: add work around for out of spec QEMU

2024-07-05 Thread Michael S. Tsirkin
Signed-off-by: Michael S. Tsirkin --- drivers/virtio/virtio_balloon.c | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 9a61febbd2f7..7dc3fcd56238 100644 --- a/drivers/virtio/virtio_b

Re: [PATCH v2] net: missing check virtio

2024-07-03 Thread Michael S. Tsirkin
common.c:51 [inline] > do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82 > entry_SYSCALL_64_after_hwframe+0x63/0x6b > > Found by Linux Verification Center (linuxtesting.org) with Syzkaller > > Signed-off-by: Denis Arefev I suspect it's this one: Fixes: 0f6925b3e8da ("v

Re: [PATCH] virtio: add missing MODULE_DESCRIPTION() macros

2024-07-02 Thread Michael S. Tsirkin
On Tue, Jul 02, 2024 at 01:10:18PM -0700, Jeff Johnson wrote: > With ARCH=sh, make allmodconfig && make W=1 C=1 reports: > WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/virtio/virtio.o > WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/virtio/virtio_ring.o > > Add the missing

Re: [PATCH V2 3/3] virtio-net: synchronize operstate with admin state on up/down

2024-06-26 Thread Michael S. Tsirkin
On Wed, Jun 26, 2024 at 09:58:32AM +0800, Jason Wang wrote: > On Tue, Jun 25, 2024 at 4:32 PM Michael S. Tsirkin wrote: > > > > On Tue, Jun 25, 2024 at 04:11:05PM +0800, Jason Wang wrote: > > > On Tue, Jun 25, 2024 at 3:57 PM Michael S. Tsirkin > > > wrote: >

Re: [PATCH] virtio-pci: PCI extended capabilities for virtio

2024-06-25 Thread Michael S. Tsirkin
On Tue, Jun 25, 2024 at 02:39:37PM -0400, sahanlb wrote: > PCI legacy configuration space does not have sufficient space for a device > that supports all kinds of virtio structures via PCI capabilities. This is > especially true if one were to use virtio drivers with physical devices. > Link:

Re: [PATCH V2 3/3] virtio-net: synchronize operstate with admin state on up/down

2024-06-25 Thread Michael S. Tsirkin
On Tue, Jun 25, 2024 at 04:11:05PM +0800, Jason Wang wrote: > On Tue, Jun 25, 2024 at 3:57 PM Michael S. Tsirkin wrote: > > > > On Tue, Jun 25, 2024 at 03:46:44PM +0800, Jason Wang wrote: > > > Workqueue is used to serialize those so we won't lose any change. > > &

Re: [PATCH V2 1/3] virtio: allow nested disabling of the configure interrupt

2024-06-25 Thread Michael S. Tsirkin
On Tue, Jun 25, 2024 at 04:18:00PM +0800, Jason Wang wrote: > > > > > > > > > > > > > > > > But in conclusion ;) if you don't like my suggestion do something else > > > > but make the APIs make sense, > > > > > > I don't say I don't like it:) > > > > > > Limiting it to virtio-net seems to be the

Re: [PATCH V2 1/3] virtio: allow nested disabling of the configure interrupt

2024-06-25 Thread Michael S. Tsirkin
On Tue, Jun 25, 2024 at 03:50:30PM +0800, Jason Wang wrote: > On Tue, Jun 25, 2024 at 3:11 PM Michael S. Tsirkin wrote: > > > > On Tue, Jun 25, 2024 at 09:27:04AM +0800, Jason Wang wrote: > > > On Mon, Jun 24, 2024 at 5:59 PM Michael S. Tsirkin > > > wrote: >

Re: [PATCH V2 3/3] virtio-net: synchronize operstate with admin state on up/down

2024-06-25 Thread Michael S. Tsirkin
On Tue, Jun 25, 2024 at 03:46:44PM +0800, Jason Wang wrote: > Workqueue is used to serialize those so we won't lose any change. So we don't need to re-read then?

Re: [PATCH V2 3/3] virtio-net: synchronize operstate with admin state on up/down

2024-06-25 Thread Michael S. Tsirkin
On Tue, Jun 25, 2024 at 09:27:38AM +0800, Jason Wang wrote: > On Mon, Jun 24, 2024 at 6:07 PM Michael S. Tsirkin wrote: > > > > On Mon, Jun 24, 2024 at 10:45:23AM +0800, Jason Wang wrote: > > > This patch synchronize operstate with admin state per RFC2863. > >

Re: [PATCH V2 1/3] virtio: allow nested disabling of the configure interrupt

2024-06-25 Thread Michael S. Tsirkin
On Tue, Jun 25, 2024 at 09:27:04AM +0800, Jason Wang wrote: > On Mon, Jun 24, 2024 at 5:59 PM Michael S. Tsirkin wrote: > > > > On Mon, Jun 24, 2024 at 10:45:21AM +0800, Jason Wang wrote: > > > Somtime driver may want to enable or disable the config callback. This > >

Re: [PATCH V2 3/3] virtio-net: synchronize operstate with admin state on up/down

2024-06-24 Thread Michael S. Tsirkin
On Mon, Jun 24, 2024 at 10:45:23AM +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

Re: [PATCH V2 1/3] virtio: allow nested disabling of the configure interrupt

2024-06-24 Thread Michael S. Tsirkin
On Mon, Jun 24, 2024 at 10:45:21AM +0800, Jason Wang wrote: > Somtime driver may want to enable or disable the config callback. This > requires a synchronization with the core. So this patch change the > config_enabled to be a integer counter. This allows the toggling of > the config_enable to be

[PATCH net-next] net: virtio: unify code to init stats

2024-06-20 Thread Michael S. Tsirkin
Moving initialization of stats structure into __free_old_xmit reduces the code size slightly. It also makes it clearer that this function shouldn't be called multiple times on the same stats struct. Signed-off-by: Michael S. Tsirkin --- Especially important now that Jiri's patch for BQL has

Re: [PATCH net-next V2] virtio-net: synchronize operstate with admin state on up/down

2024-06-19 Thread Michael S. Tsirkin
On Thu, Jun 06, 2024 at 08:22:13AM +0800, Jason Wang wrote: > On Fri, May 31, 2024 at 8:18 AM Jason Wang wrote: > > > > On Thu, May 30, 2024 at 9:09 PM Michael S. Tsirkin wrote: > > > > > > On Thu, May 30, 2024 at 06:29:51PM +0800, Jason Wang wrote: > &

Re: [PATCH v2] net: missing check virtio

2024-06-19 Thread Michael S. Tsirkin
On Thu, Jun 13, 2024 at 12:54:48PM +0300, Denis Arefev wrote: > Two missing check in virtio_net_hdr_to_skb() allowed syzbot > to crash kernels again > > 1. After the skb_segment function the buffer may become non-linear > (nr_frags != 0), but since the SKBTX_SHARED_FRAG flag is not set anywhere >

Re: [PATCH 1/2] vdpa: support set mac address from vdpa tool

2024-06-18 Thread Michael S. Tsirkin
On Mon, Jun 17, 2024 at 09:44:21AM -0700, Jakub Kicinski wrote: > On Mon, 17 Jun 2024 12:20:19 -0400 Michael S. Tsirkin wrote: > > > But the virtio spec doesn't allow setting the MAC... > > > I'm probably just lost in the conversation but there's hypervisor side > >

Re: [PATCH 1/2] vdpa: support set mac address from vdpa tool

2024-06-17 Thread Michael S. Tsirkin
On Mon, Jun 17, 2024 at 08:20:02AM -0700, Jakub Kicinski wrote: > On Mon, 17 Jun 2024 09:47:21 -0400 Michael S. Tsirkin wrote: > > I don't know what this discussion is about, at this point. > > For better or worse, vdpa gained interfaces for provisioning > > new devices. Y

Re: [PATCH 1/2] vdpa: support set mac address from vdpa tool

2024-06-17 Thread Michael S. Tsirkin
On Mon, Jun 17, 2024 at 03:02:43PM +0200, Jiri Pirko wrote: > Mon, Jun 17, 2024 at 01:48:02PM CEST, pa...@nvidia.com wrote: > > > >> From: Jiri Pirko > >> Sent: Monday, June 17, 2024 5:10 PM > >> > >> Mon, Jun 17, 2024 at 11:44:53AM CEST, pa...@nvidia.com wrote: > >> > > >> >> From: Jiri Pirko

Re: [PATCH] vringh: add MODULE_DESCRIPTION()

2024-06-17 Thread Michael S. Tsirkin
On Sat, Jun 15, 2024 at 02:50:11PM -0700, Jeff Johnson wrote: > On 5/16/2024 6:57 PM, Jeff Johnson wrote: > > Fix the allmodconfig 'make w=1' issue: > > > > WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/vhost/vringh.o > > > > Signed-off-by: Jeff Johnson > > --- > >

Re: [PATCH] virtio_net: Eliminate OOO packets during switching

2024-06-17 Thread Michael S. Tsirkin
On Fri, Jun 14, 2024 at 10:04:22PM +, Abhinav Jain wrote: > Disable the network device & turn off carrier before modifying the > number of queue pairs. > Process all the in-flight packets and then turn on carrier, followed > by waking up all the queues on the network device. Did you test that

Re: [PATCH 1/2] vdpa: support set mac address from vdpa tool

2024-06-13 Thread Michael S. Tsirkin
On Thu, Jun 13, 2024 at 09:21:07AM +0200, Jiri Pirko wrote: > Thu, Jun 13, 2024 at 08:49:25AM CEST, m...@redhat.com wrote: > >On Wed, Jun 12, 2024 at 09:22:32AM +0200, Jiri Pirko wrote: > >> Wed, Jun 12, 2024 at 09:15:44AM CEST, m...@redhat.com wrote: > >> >On Wed, Jun 12, 2024 at 08:29:53AM

Re: [PATCH 1/2] vdpa: support set mac address from vdpa tool

2024-06-13 Thread Michael S. Tsirkin
On Tue, Jun 11, 2024 at 01:32:32PM +0800, Cindy Lu wrote: > Add new UAPI to support the mac address from vdpa tool > Function vdpa_nl_cmd_dev_config_set_doit() will get the > MAC address from the vdpa tool and then set it to the device. > > The usage is: vdpa dev set name vdpa_name mac

Re: [PATCH 1/2] vdpa: support set mac address from vdpa tool

2024-06-13 Thread Michael S. Tsirkin
On Wed, Jun 12, 2024 at 09:22:32AM +0200, Jiri Pirko wrote: > Wed, Jun 12, 2024 at 09:15:44AM CEST, m...@redhat.com wrote: > >On Wed, Jun 12, 2024 at 08:29:53AM +0200, Jiri Pirko wrote: > >> Wed, Jun 12, 2024 at 03:58:10AM CEST, k...@kernel.org wrote: > >> >On Tue, 11 Jun 2024 13:32:32 +0800 Cindy

Re: [PATCH 1/2] vdpa: support set mac address from vdpa tool

2024-06-12 Thread Michael S. Tsirkin
On Wed, Jun 12, 2024 at 08:29:53AM +0200, Jiri Pirko wrote: > Wed, Jun 12, 2024 at 03:58:10AM CEST, k...@kernel.org wrote: > >On Tue, 11 Jun 2024 13:32:32 +0800 Cindy Lu wrote: > >> Add new UAPI to support the mac address from vdpa tool > >> Function vdpa_nl_cmd_dev_config_set_doit() will get the

Re: [PATCH 1/2] vdpa: support set mac address from vdpa tool

2024-06-12 Thread Michael S. Tsirkin
On Tue, Jun 11, 2024 at 01:32:32PM +0800, Cindy Lu wrote: > Add new UAPI to support the mac address from vdpa tool The patch does not do what commit log says. Instead there's an internal API to set mac and a UAPI to write into config space. > Function vdpa_nl_cmd_dev_config_set_doit() will get

Re: [PATCH] tools/virtio: Use the __GFP_ZERO flag of kmalloc to complete the memory initialization.

2024-06-06 Thread Michael S. Tsirkin
On Wed, Jun 05, 2024 at 09:52:45PM +0800, cuitao wrote: > Use the __GFP_ZERO flag of kmalloc to initialize memory while allocating it, > without the need for an additional memset call. > > Signed-off-by: cuitao > --- > tools/virtio/linux/kernel.h | 5 + > 1 file changed, 1 insertion(+), 4

Re: [PATCH net-next V2] virtio-net: synchronize operstate with admin state on up/down

2024-05-30 Thread Michael S. Tsirkin
On Thu, May 30, 2024 at 06:29:51PM +0800, Jason Wang wrote: > On Thu, May 30, 2024 at 2:10 PM Michael S. Tsirkin wrote: > > > > On Thu, May 30, 2024 at 11:20:55AM +0800, Jason Wang wrote: > > > This patch synchronize operstate with admin state per RFC2863. > >

Re: [PATCH net-next V2] virtio-net: synchronize operstate with admin state on up/down

2024-05-30 Thread Michael S. Tsirkin
; 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

Re: [PATCH] tools/virtio: pipe assertion in vring_test.c

2024-05-27 Thread Michael S. Tsirkin
On Mon, May 27, 2024 at 04:13:31PM +0900, ysk...@gmail.com wrote: > From: Yunseong Kim > > The virtio_device need to fail checking when create the geust/host pipe. typo > > Signed-off-by: Yunseong Kim I guess ... > --- > tools/virtio/vringh_test.c | 4 ++-- > 1 file changed, 2

Re: [RFC PATCH 0/5] vsock/virtio: Add support for multi-devices

2024-05-23 Thread Michael S. Tsirkin
On Fri, May 17, 2024 at 10:46:02PM +0800, Xuewei Niu wrote: > include/linux/virtio_vsock.h| 2 +- > include/net/af_vsock.h | 25 ++- > include/uapi/linux/virtio_vsock.h | 1 + > include/uapi/linux/vm_sockets.h | 14 ++ > net/vmw_vsock/af_vsock.c

[GIT PULL v2] virtio: features, fixes, cleanups

2024-05-23 Thread Michael S. Tsirkin
with suspend is improved - vhost-scsi now handles signals better/faster. Fixes, cleanups all over the place. Signed-off-by: Michael S. Tsirkin Christophe JAILLET (1): vhost-vdpa: Remove usage of the deprecated ida_simple_xx

Re: [GIT PULL] virtio: features, fixes, cleanups

2024-05-22 Thread Michael S. Tsirkin
On Wed, May 22, 2024 at 06:03:08AM -0400, Michael S. Tsirkin wrote: > Things to note here: Sorry Linus, author of one of the patchsets I merged wants to drop it now. I could revert but it seems cleaner to do that, re-test and re-post. Will drop a duplicate as long as I do it. > - t

Re: [GIT PULL] virtio: features, fixes, cleanups

2024-05-22 Thread Michael S. Tsirkin
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: > > > > - the new Marvell OCTEON DPU driver is not here: latest v4 keeps causing > > build failures on

[GIT PULL] virtio: features, fixes, cleanups

2024-05-22 Thread Michael S. Tsirkin
. - virtio-net now supports premapped mode by default, opening the door for all kind of zero copy tricks. Fixes, cleanups all over the place. Signed-off-by: Michael S. Tsirkin Christophe JAILLET (1): vhost-vdpa: Remove usage

Re: [PATCH] vhost: use pr_err for vq_err

2024-05-16 Thread Michael S. Tsirkin
On Thu, May 16, 2024 at 03:46:29PM +0800, Peng Fan (OSS) wrote: > From: Peng Fan > > Use pr_err to print out error message without enabling DEBUG. This could > make people catch error easier. > > Signed-off-by: Peng Fan This isn't appropriate: pr_err must not be triggerable by userspace. If

Re: [PATCH net-next] virtio_net: Fix error code in __virtnet_get_hw_stats()

2024-05-15 Thread Michael S. Tsirkin
On Wed, May 15, 2024 at 04:50:48PM +0200, Dan Carpenter wrote: > On Sun, May 12, 2024 at 12:01:55PM -0400, Michael S. Tsirkin wrote: > > On Fri, May 10, 2024 at 03:50:45PM +0300, Dan Carpenter wrote: > > > The virtnet_send_command_reply() function returns true on success or >

[PATCH] vhost/vsock: always initialize seqpacket_allow

2024-05-15 Thread Michael S. Tsirkin
...@syzkaller.appspotmail.com Reported-by: Jeongjun Park Fixes: ced7b713711f ("vhost/vsock: support SEQPACKET for transport"). Cc: Arseny Krasnov Cc: David S. Miller Cc: Stefan Hajnoczi Signed-off-by: Michael S. Tsirkin Acked-by: Arseniy Krasnov Tested-by: Arseniy Krasnov --- Reposting now it's been tested.

Re: [PATCH net-next] virtio_net: Fix error code in __virtnet_get_hw_stats()

2024-05-12 Thread Michael S. Tsirkin
On Fri, May 10, 2024 at 03:50:45PM +0300, Dan Carpenter wrote: > The virtnet_send_command_reply() function returns true on success or > false on failure. The "ok" variable is true/false depending on whether > it succeeds or not. It's up to the caller to translate the true/false > into -EINVAL on

Re: [PATCH next] vhost_task: after freeing vhost_task it should not be accessed in vhost_task_fn

2024-05-01 Thread Michael S. Tsirkin
On Wed, May 01, 2024 at 10:57:38AM -0500, Mike Christie wrote: > On 5/1/24 2:50 AM, Hillf Danton wrote: > > On Wed, 1 May 2024 02:01:20 -0400 Michael S. Tsirkin > >> > >> and then it failed testing. > >> > > So did my patch [1] but then the r

Re: [syzbot] [net?] [virt?] [kvm?] KASAN: slab-use-after-free Read in vhost_task_fn

2024-05-01 Thread Michael S. Tsirkin
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git f138e94c1f0dbeae721917694fb2203446a68ea9

Re: [PATCH next] vhost_task: after freeing vhost_task it should not be accessed in vhost_task_fn

2024-05-01 Thread Michael S. Tsirkin
On Wed, May 01, 2024 at 10:57:38AM -0500, Mike Christie wrote: > On 5/1/24 2:50 AM, Hillf Danton wrote: > > On Wed, 1 May 2024 02:01:20 -0400 Michael S. Tsirkin > >> > >> and then it failed testing. > >> > > So did my patch [1] but then the r

Re: EEVDF/vhost regression (bisected to 86bfbb7ce4f6 sched/fair: Add lag based placement)

2024-05-01 Thread Michael S. Tsirkin
On Wed, May 01, 2024 at 12:51:51PM +0200, Peter Zijlstra wrote: > On Tue, Apr 30, 2024 at 12:50:05PM +0200, Tobias Huschle wrote: > > It took me a while, but I was able to figure out why EEVDF behaves > > different then CFS does. I'm still waiting for some official confirmation > > of my

Re: [PATCH next] vhost_task: after freeing vhost_task it should not be accessed in vhost_task_fn

2024-05-01 Thread Michael S. Tsirkin
On Wed, May 01, 2024 at 08:15:44AM +0800, Hillf Danton wrote: > On Tue, Apr 30, 2024 at 11:23:04AM -0500, Mike Christie wrote: > > On 4/30/24 8:05 AM, Edward Adam Davis wrote: > > > static int vhost_task_fn(void *data) > > > { > > > struct vhost_task *vtsk = data; > > > @@ -51,7 +51,7 @@

Re: [PATCH next] vhost_task: after freeing vhost_task it should not be accessed in vhost_task_fn

2024-04-30 Thread Michael S. Tsirkin
On Tue, Apr 30, 2024 at 08:01:11PM -0500, Mike Christie wrote: > On 4/30/24 7:15 PM, Hillf Danton wrote: > > On Tue, Apr 30, 2024 at 11:23:04AM -0500, Mike Christie wrote: > >> On 4/30/24 8:05 AM, Edward Adam Davis wrote: > >>> static int vhost_task_fn(void *data) > >>> { > >>> struct

Re: [PATCH] virtio_net: Warn if insufficient queue length for transmitting

2024-04-30 Thread Michael S. Tsirkin
On Tue, Apr 30, 2024 at 03:35:09PM -0400, Darius Rad wrote: > The transmit queue is stopped when the number of free queue entries is less > than 2+MAX_SKB_FRAGS, in start_xmit(). If the queue length (QUEUE_NUM_MAX) > is less than then this, transmission will immediately trigger a netdev >

Re: [PATCH next] vhost_task: after freeing vhost_task it should not be accessed in vhost_task_fn

2024-04-30 Thread Michael S. Tsirkin
On Tue, Apr 30, 2024 at 11:23:04AM -0500, Mike Christie wrote: > On 4/30/24 8:05 AM, Edward Adam Davis wrote: > > static int vhost_task_fn(void *data) > > { > > struct vhost_task *vtsk = data; > > @@ -51,7 +51,7 @@ static int vhost_task_fn(void *data) > > schedule(); > >

Re: [PATCH v2 0/4] vhost: Cleanup

2024-04-29 Thread Michael S. Tsirkin
On Mon, Apr 29, 2024 at 08:13:56PM +1000, Gavin Shan wrote: > This is suggested by Michael S. Tsirkin according to [1] and the goal > is to apply smp_rmb() inside vhost_get_avail_idx() if needed. With it, > the caller of the function needn't to worry about memory barriers. Since >

Re: [PATCH v2 4/4] vhost: Reformat vhost_{get, put}_user()

2024-04-29 Thread Michael S. Tsirkin
On Mon, Apr 29, 2024 at 08:14:00PM +1000, Gavin Shan wrote: > Reformat the macros to use tab as the terminator for each line so > that it looks clean. > > No functional change intended. > > Signed-off-by: Gavin Shan Just messes up history for no real gain. > --- > drivers/vhost/vhost.c | 60

Re: [PATCH v2 3/4] vhost: Improve vhost_get_avail_head()

2024-04-29 Thread Michael S. Tsirkin
On Mon, Apr 29, 2024 at 08:13:59PM +1000, Gavin Shan wrote: > Improve vhost_get_avail_head() so that the head or errno is returned. > With it, the relevant sanity checks are squeezed to vhost_get_avail_head() > and vhost_get_vq_desc() is further simplified. > > No functional change intended. > >

Re: [PATCH v2 2/4] vhost: Drop variable last_avail_idx in vhost_get_vq_desc()

2024-04-29 Thread Michael S. Tsirkin
On Mon, Apr 29, 2024 at 08:13:58PM +1000, Gavin Shan wrote: > The local variable @last_avail_idx is equivalent to vq->last_avail_idx. > So the code can be simplified a bit by dropping the local variable > @last_avail_idx. > > No functional change intended. > > Signed-off-by: Gavin Shan > --- >

Re: [PATCH v2 1/4] vhost: Improve vhost_get_avail_idx() with smp_rmb()

2024-04-29 Thread Michael S. Tsirkin
On Mon, Apr 29, 2024 at 08:13:57PM +1000, Gavin Shan wrote: > From: "Michael S. Tsirkin" > > All the callers of vhost_get_avail_idx() are concerned to the memory *with* the memory barrier > barrier, imposed by smp_rmb() to ensure the order of the available > ring entr

Re: [PATCH 0/4] vhost: Cleanup

2024-04-29 Thread Michael S. Tsirkin
On Tue, Apr 23, 2024 at 01:24:03PM +1000, Gavin Shan wrote: > This is suggested by Michael S. Tsirkin according to [1] and the goal > is to apply smp_rmb() inside vhost_get_avail_idx() if needed. With it, > the caller of the function needn't to worry about memory barriers. Since >

Re: 回复: [PATCH v5] vp_vdpa: don't allocate unused msix vectors

2024-04-25 Thread Michael S. Tsirkin
On Tue, Apr 23, 2024 at 08:42:57AM +, Angus Chen wrote: > Hi mst. > > > -Original Message- > > From: Michael S. Tsirkin > > Sent: Tuesday, April 23, 2024 4:35 PM > > To: Gavin Liu > > Cc: jasow...@redhat.com; Angus Chen ; >

[GIT PULL] virtio: bugfix

2024-04-25 Thread Michael S. Tsirkin
to 98a821546b3919a10a58faa12ebe5e9a55cd638e: vDPA: code clean for vhost_vdpa uapi (2024-04-22 17:07:13 -0400) virtio: bugfix enum renames for vdpa uapi - we better do this now before the names have been in any releases. Signed-off-by: Michael S. Tsirkin

Re: [PATCH v5 3/5] vduse: Add function to get/free the pages for reconnection

2024-04-25 Thread Michael S. Tsirkin
On Thu, Apr 25, 2024 at 09:35:58AM +0800, Jason Wang wrote: > On Wed, Apr 24, 2024 at 5:51 PM Michael S. Tsirkin wrote: > > > > On Wed, Apr 24, 2024 at 08:44:10AM +0800, Jason Wang wrote: > > > On Tue, Apr 23, 2024 at 4:42 PM Michael S. Tsirkin > > > wrote: >

Re: [PATCH v5 3/5] vduse: Add function to get/free the pages for reconnection

2024-04-24 Thread Michael S. Tsirkin
On Wed, Apr 24, 2024 at 08:44:10AM +0800, Jason Wang wrote: > On Tue, Apr 23, 2024 at 4:42 PM Michael S. Tsirkin wrote: > > > > On Tue, Apr 23, 2024 at 11:09:59AM +0800, Jason Wang wrote: > > > On Tue, Apr 23, 2024 at 4:05 AM Michael S. Tsirkin > > > wrote: >

Re: [PATCH v3 2/4] virtio_balloon: introduce oom-kill invocations

2024-04-23 Thread Michael S. Tsirkin
On Tue, Apr 23, 2024 at 11:41:07AM +0800, zhenwei pi wrote: > When the guest OS runs under critical memory pressure, the guest > starts to kill processes. A guest monitor agent may scan 'oom_kill' > from /proc/vmstat, and reports the OOM KILL event. However, the agent > may be killed and we will

Re: [PATCH v5 3/5] vduse: Add function to get/free the pages for reconnection

2024-04-23 Thread Michael S. Tsirkin
On Tue, Apr 23, 2024 at 11:09:59AM +0800, Jason Wang wrote: > On Tue, Apr 23, 2024 at 4:05 AM Michael S. Tsirkin wrote: > > > > On Thu, Apr 18, 2024 at 08:57:51AM +0800, Jason Wang wrote: > > > On Wed, Apr 17, 2024 at 5:29 PM Michael S. Tsirkin > > > wrote: >

Re: 回复: [PATCH v5] vp_vdpa: don't allocate unused msix vectors

2024-04-23 Thread Michael S. Tsirkin
why would it trigger? virtio PMD in poll mode presumably suppresses interrupts after all. > > > - Original Message - > From: Michael S. Tsirkin m...@redhat.com > Sent: April 22, 2024 20:09 > To: Gavin Liu gavin@jaguarmicro.com > Cc: jasow...@redhat.com; Angus Chen

Re: [PATCH 0/3] Improve memory statistics for virtio balloon

2024-04-22 Thread Michael S. Tsirkin
On Thu, Apr 18, 2024 at 02:25:59PM +0800, zhenwei pi wrote: > RFC -> v1: > - several text changes: oom-kill -> oom-kills, SCAN_ASYNC -> ASYN_SCAN. > - move vm events codes into '#ifdef CONFIG_VM_EVENT_COUNTERS' > > RFC version: > Link: >

Re: [PATCH v3 3/3] vhost: Improve vhost_get_avail_idx() with smp_rmb()

2024-04-22 Thread Michael S. Tsirkin
On Mon, Apr 08, 2024 at 02:15:24PM +1000, Gavin Shan wrote: > Hi Michael, > > On 3/30/24 19:02, Gavin Shan wrote: > > On 3/28/24 19:31, Michael S. Tsirkin wrote: > > > On Thu, Mar 28, 2024 at 10:21:49AM +1000, Gavin Shan wrote: > > > > All the callers of

Re: [PATCH v2 0/6] virtiofs: fix the warning for ITER_KVEC dio

2024-04-22 Thread Michael S. Tsirkin
On Tue, Apr 09, 2024 at 09:48:08AM +0800, Hou Tao wrote: > Hi, > > On 4/8/2024 3:45 PM, Michael S. Tsirkin wrote: > > On Wed, Feb 28, 2024 at 10:41:20PM +0800, Hou Tao wrote: > >> From: Hou Tao > >> > >> Hi, > >> > >> The p

Re: [PATCH v5 3/5] vduse: Add function to get/free the pages for reconnection

2024-04-22 Thread Michael S. Tsirkin
On Thu, Apr 18, 2024 at 08:57:51AM +0800, Jason Wang wrote: > On Wed, Apr 17, 2024 at 5:29 PM Michael S. Tsirkin wrote: > > > > On Fri, Apr 12, 2024 at 09:28:23PM +0800, Cindy Lu wrote: > > > Add the function vduse_alloc_reconnnect_info_mem > > > an

Re: [PATCH virt] virt: fix uninit-value in vhost_vsock_dev_open

2024-04-22 Thread Michael S. Tsirkin
will leak old VIRTIO_VSOCK_F_SEQPACKET bit value. And I am pretty sure the Fixes tag is wrong. So I wrote this, but I actually don't have a set for seqpacket to test this. Arseny could you help test maybe? Thanks! commit bcc17a060d93b198d8a17a9b87b593f41337ee28 Author: Michael S. Tsirkin Date:

Re: [syzbot] [virt?] [net?] KMSAN: uninit-value in vsock_assign_transport (2)

2024-04-22 Thread Michael S. Tsirkin
On Fri, Apr 19, 2024 at 02:39:20AM -0700, syzbot wrote: > Hello, > > syzbot found the following issue on: > > HEAD commit:8cd26fd90c1a Merge tag 'for-6.9-rc4-tag' of git://git.kern.. > git tree: upstream > console+strace: https://syzkaller.appspot.com/x/log.txt?x=102d27cd18 >

Re: [PATCH v5] vp_vdpa: don't allocate unused msix vectors

2024-04-22 Thread Michael S. Tsirkin
On Wed, Apr 10, 2024 at 11:30:20AM +0800, lyx634449800 wrote: > From: Yuxue Liu > > When there is a ctlq and it doesn't require interrupt > callbacks,the original method of calculating vectors > wastes hardware msi or msix resources as well as system > IRQ resources. > > When conducting

Re: [PATCH v2 1/4] virtio_balloon: separate vm events into a function

2024-04-22 Thread Michael S. Tsirkin
On Mon, Apr 22, 2024 at 03:42:51PM +0800, zhenwei pi wrote: > All the VM events related statistics have dependence on > 'CONFIG_VM_EVENT_COUNTERS', once any stack variable is required by any > VM events in future, we would have codes like: > #ifdef CONFIG_VM_EVENT_COUNTERS > unsigned long

Re: [PATCH virt] virt: fix uninit-value in vhost_vsock_dev_open

2024-04-20 Thread Michael S. Tsirkin
On Sat, Apr 20, 2024 at 05:57:50PM +0900, Jeongjun Park wrote: > Change vhost_vsock_dev_open() to use kvzalloc() instead of kvmalloc() > to avoid uninit state. > > Reported-by: syzbot+6c21aeb59d0e82eb2...@syzkaller.appspotmail.com > Fixes: dcda9b04713c ("mm, tree wide: replace __GFP_REPEAT by >

Re: [PATCH 1/1] virtio: Add support for the virtio suspend feature

2024-04-18 Thread Michael S. Tsirkin
On Thu, Apr 18, 2024 at 03:14:37PM +0800, Zhu, Lingshan wrote: > > > On 4/17/2024 4:54 PM, David Stevens wrote: > > Add support for the VIRTIO_F_SUSPEND feature. When this feature is > > negotiated, power management can use it to suspend virtio devices > > instead of resorting to resetting the

Re: [PATCH v5 3/5] vduse: Add function to get/free the pages for reconnection

2024-04-17 Thread Michael S. Tsirkin
On Fri, Apr 12, 2024 at 09:28:23PM +0800, Cindy Lu wrote: > Add the function vduse_alloc_reconnnect_info_mem > and vduse_alloc_reconnnect_info_mem > These functions allow vduse to allocate and free memory for reconnection > information. The amount of memory allocated is vq_num pages. > Each VQS

Re: [PATCH] vhost-vdpa: Remove usage of the deprecated ida_simple_xx() API

2024-04-14 Thread Michael S. Tsirkin
On Sun, Apr 14, 2024 at 10:59:06AM +0200, Christophe JAILLET wrote: > Le 14/04/2024 à 10:35, Michael S. Tsirkin a écrit : > > On Mon, Jan 15, 2024 at 09:35:50PM +0100, Christophe JAILLET wrote: > > > ida_alloc() and ida_free() should be preferred to the deprecated &g

Re: [PATCH] vhost-vdpa: Remove usage of the deprecated ida_simple_xx() API

2024-04-14 Thread Michael S. Tsirkin
On Mon, Jan 15, 2024 at 09:35:50PM +0100, Christophe JAILLET wrote: > ida_alloc() and ida_free() should be preferred to the deprecated > ida_simple_get() and ida_simple_remove(). > > Note that the upper limit of ida_simple_get() is exclusive, buInputt the one > of What's buInputt? But? >

  1   2   3   4   5   6   7   8   9   10   >