Re: [PATCH v6 8/8] eni_vdpa: add vDPA driver for Alibaba ENI

2021-10-26 Thread Jason Wang
On Wed, Oct 27, 2021 at 10:47 AM Wu Zongyong wrote: > > On Mon, Oct 25, 2021 at 12:40:41PM +0800, Jason Wang wrote: > > > > 在 2021/10/25 上午11:21, Wu Zongyong 写道: > > > On Mon, Oct 25, 2021 at 10:27:31AM +0800, Jason Wang wrote: > > > > On Fri, Oct 22, 2021 at 10:44 AM Wu Zongyong > > > > wrote:

Re: [PATCH V3 11/11] vhost: allow userspace to create workers

2021-10-26 Thread Jason Wang
On Tue, Oct 26, 2021 at 11:45 PM Stefan Hajnoczi wrote: > > On Tue, Oct 26, 2021 at 01:37:14PM +0800, Jason Wang wrote: > > > > 在 2021/10/22 下午1:19, Mike Christie 写道: > > > This patch allows userspace to create workers and bind them to vqs. You > > > can have N workers per dev and also share N

Re: [PATCH net-next] net: virtio: use eth_hw_addr_set()

2021-10-26 Thread Jason Wang
On Wed, Oct 27, 2021 at 1:56 AM Jakub Kicinski wrote: > > Commit 406f42fa0d3c ("net-next: When a bond have a massive amount > of VLANs...") introduced a rbtree for faster Ethernet address look > up. To maintain netdev->dev_addr in this tree we need to make all > the writes to it go through

Re: [PATCH -next] virtio-pci: fix error return code in vp_legacy_probe()

2021-10-26 Thread Jason Wang
On Tue, Oct 26, 2021 at 9:39 PM Yang Yingliang wrote: > > Return error code if pci_iomap() fails in vp_legacy_probe() > > Reported-by: Hulk Robot > Fixes: c3ca8a3eeb54 ("virtio-pci: introduce legacy device module") > Signed-off-by: Yang Yingliang > --- Acked-by: Jason Wang >

Re: [PATCH] virtio-ring: fix DMA metadata flags

2021-10-26 Thread Jason Wang
On Tue, Oct 26, 2021 at 9:31 PM Vincent Whitchurch wrote: > > The flags are currently overwritten, leading to the wrong direction > being passed to the DMA unmap functions. > > Fixes: 72b5e8958738aaa4 ("virtio-ring: store DMA metadata in desc_extra for > split virtqueue") > Signed-off-by:

[PATCH V5 4/4] virtio-scsi: don't let virtio core to validate used buffer length

2021-10-26 Thread Jason Wang
We never tries to use used length, so the patch prevents the virtio core from validating used length. Signed-off-by: Jason Wang --- drivers/scsi/virtio_scsi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index

[PATCH V5 3/4] virtio-blk: don't let virtio core to validate used length

2021-10-26 Thread Jason Wang
We never tries to use used length, so the patch prevents the virtio core from validating used length. Signed-off-by: Jason Wang --- drivers/block/virtio_blk.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index

[PATCH V5 2/4] virtio-net: don't let virtio core to validate used length

2021-10-26 Thread Jason Wang
For RX virtuqueue, the used length is validated in all the three paths (big, small and mergeable). For control vq, we never tries to use used length. So this patch forbids the core to validate the used length. Signed-off-by: Jason Wang --- drivers/net/virtio_net.c | 1 + 1 file changed, 1

[PATCH V5 1/4] virtio_ring: validate used buffer length

2021-10-26 Thread Jason Wang
This patch validate the used buffer length provided by the device before trying to use it. This is done by record the in buffer length in a new field in desc_state structure during virtqueue_add(), then we can fail the virtqueue_get_buf() when we find the device is trying to give us a used buffer

[PATCH V5 0/4] Validate used buffer length

2021-10-26 Thread Jason Wang
Hi All: This patch tries to validate the used buffer length in the virtio core. This help to eliminate the unexpected result caused by buggy or mailicous devices. For the drivers that can do the validation itself, they can ask the virtio core to suppress the check. Changes since V4: - Fix the

[PATCH linux-next v7 8/8] vdpa/mlx5: Forward only packets with allowed MAC address

2021-10-26 Thread Parav Pandit via Virtualization
From: Eli Cohen Add rules to forward packets to the net device's TIR only if the destination MAC is equal to the configured MAC. This is required to prevent the netdevice from receiving traffic not destined to its configured MAC. Signed-off-by: Eli Cohen Reviewed-by: Parav Pandit ---

[PATCH linux-next v7 7/8] vdpa/mlx5: Support configuration of MAC

2021-10-26 Thread Parav Pandit via Virtualization
From: Eli Cohen Add code to accept MAC configuration through vdpa tool. The MAC is written into the config struct and later can be retrieved through get_config(). Examples: 1. Configure MAC while adding a device: $ vdpa dev add mgmtdev pci/:06:00.2 name vdpa0 mac 00:11:22:33:44:55 2. Show

[PATCH linux-next v7 6/8] vdpa/mlx5: Fix clearing of VIRTIO_NET_F_MAC feature bit

2021-10-26 Thread Parav Pandit via Virtualization
Cited patch in the fixes tag clears the features bit during reset. mlx5 vdpa device feature bits are static decided by device capabilities. These feature bits (including VIRTIO_NET_F_MAC) are initialized during device addition time. Clearing features bit in reset callback cleared the

[PATCH linux-next v7 5/8] vdpa_sim_net: Enable user to set mac address and mtu

2021-10-26 Thread Parav Pandit via Virtualization
Enable user to set the mac address and mtu so that each vdpa device can have its own user specified mac address and mtu. Now that user is enabled to set the mac address, remove the module parameter for same. And example of setting mac addr and mtu and view the configuration: $ vdpa mgmtdev show

[PATCH linux-next v7 4/8] vdpa: Enable user to set mac and mtu of vdpa device

2021-10-26 Thread Parav Pandit via Virtualization
$ vdpa dev add name bar mgmtdev vdpasim_net mac 00:11:22:33:44:55 mtu 9000 $ vdpa dev config show bar: mac 00:11:22:33:44:55 link up link_announce false mtu 9000 $ vdpa dev config show -jp { "config": { "bar": { "mac": "00:11:22:33:44:55", "link ": "up",

[PATCH linux-next v7 3/8] vdpa: Use kernel coding style for structure comments

2021-10-26 Thread Parav Pandit via Virtualization
As subsequent patch adds new structure field with comment, move the structure comment to follow kernel coding style. Signed-off-by: Parav Pandit Reviewed-by: Eli Cohen Acked-by: Jason Wang Reviewed-by: Stefano Garzarella --- include/linux/vdpa.h | 9 - 1 file changed, 8

[PATCH linux-next v7 2/8] vdpa: Introduce query of device config layout

2021-10-26 Thread Parav Pandit via Virtualization
Introduce a command to query a device config layout. An example query of network vdpa device: $ vdpa dev add name bar mgmtdev vdpasim_net $ vdpa dev config show bar: mac 00:35:09:19:48:05 link up link_announce false mtu 1500 $ vdpa dev config show -jp { "config": { "bar": {

[PATCH linux-next v7 1/8] vdpa: Introduce and use vdpa device get, set config helpers

2021-10-26 Thread Parav Pandit via Virtualization
Subsequent patches enable get and set configuration either via management device or via vdpa device' config ops. This requires synchronization between multiple callers to get and set config callbacks. Features setting also influence the layout of the configuration fields endianness. To avoid

[PATCH linux-next v7 0/8] vdpa: enable user to set mac, mtu

2021-10-26 Thread Parav Pandit via Virtualization
Currently user cannot view the vdpa device config space. Also user cannot set the mac address and mtu of the vdpa device. This patchset enables users to set the mac address and mtu of the vdpa device once the device is created. If a vendor driver supports such configuration user can set it

Re: [PATCH V3 11/11] vhost: allow userspace to create workers

2021-10-26 Thread michael . christie
On 10/26/21 12:37 AM, Jason Wang wrote: > > 在 2021/10/22 下午1:19, Mike Christie 写道: >> This patch allows userspace to create workers and bind them to vqs. You >> can have N workers per dev and also share N workers with M vqs. >> >> Signed-off-by: Mike Christie > > > A question, who is the best

Re: [PATCH V3 11/11] vhost: allow userspace to create workers

2021-10-26 Thread Stefan Hajnoczi
On Tue, Oct 26, 2021 at 09:09:52AM -0400, Michael S. Tsirkin wrote: > On Tue, Oct 26, 2021 at 01:37:14PM +0800, Jason Wang wrote: > > > > 在 2021/10/22 下午1:19, Mike Christie 写道: > > > This patch allows userspace to create workers and bind them to vqs. You > > > can have N workers per dev and also

Re: [PATCH V3 11/11] vhost: allow userspace to create workers

2021-10-26 Thread Stefan Hajnoczi
On Tue, Oct 26, 2021 at 01:37:14PM +0800, Jason Wang wrote: > > 在 2021/10/22 下午1:19, Mike Christie 写道: > > This patch allows userspace to create workers and bind them to vqs. You > > can have N workers per dev and also share N workers with M vqs. > > > > Signed-off-by: Mike Christie > > > A

Re: [PATCH V3 11/11] vhost: allow userspace to create workers

2021-10-26 Thread Stefan Hajnoczi
On Fri, Oct 22, 2021 at 12:19:11AM -0500, Mike Christie wrote: > diff --git a/include/uapi/linux/vhost.h b/include/uapi/linux/vhost.h > index c998860d7bbc..e5c0669430e5 100644 > --- a/include/uapi/linux/vhost.h > +++ b/include/uapi/linux/vhost.h > @@ -70,6 +70,17 @@ > #define

Re: [PATCH V3 11/11] vhost: allow userspace to create workers

2021-10-26 Thread Stefan Hajnoczi
On Fri, Oct 22, 2021 at 12:19:11AM -0500, Mike Christie wrote: > +/* Caller must have device mutex */ > +static int vhost_vq_setup_worker(struct vhost_virtqueue *vq, > + struct vhost_vring_worker *info) It's clearer if the function name matches the ioctl name

[PATCH] virtio-ring: fix DMA metadata flags

2021-10-26 Thread Vincent Whitchurch
The flags are currently overwritten, leading to the wrong direction being passed to the DMA unmap functions. Fixes: 72b5e8958738aaa4 ("virtio-ring: store DMA metadata in desc_extra for split virtqueue") Signed-off-by: Vincent Whitchurch --- drivers/virtio/virtio_ring.c | 2 +- 1 file changed,

Re: [PATCH linux-next v6 4/8] vdpa: Enable user to set mac and mtu of vdpa device

2021-10-26 Thread Stefano Garzarella
On Tue, Oct 26, 2021 at 01:11:51PM +, Parav Pandit wrote: From: Michael S. Tsirkin Sent: Tuesday, October 26, 2021 6:38 PM On Tue, Oct 26, 2021 at 01:03:41PM +, Parav Pandit wrote: > > > > From: Stefano Garzarella > > Sent: Tuesday, October 26, 2021 6:31 PM > > > > On Tue, Oct 26,

Re: [PATCH linux-next v6 5/8] vdpa_sim_net: Enable user to set mac address and mtu

2021-10-26 Thread Stefano Garzarella
On Tue, Oct 26, 2021 at 07:02:40AM +0300, Parav Pandit via Virtualization wrote: Enable user to set the mac address and mtu so that each vdpa device can have its own user specified mac address and mtu. Now that user is enabled to set the mac address, remove the module parameter for same. And

RE: [PATCH linux-next v6 4/8] vdpa: Enable user to set mac and mtu of vdpa device

2021-10-26 Thread Parav Pandit via Virtualization
> From: Michael S. Tsirkin > Sent: Tuesday, October 26, 2021 6:38 PM > > On Tue, Oct 26, 2021 at 01:03:41PM +, Parav Pandit wrote: > > > > > > > From: Stefano Garzarella > > > Sent: Tuesday, October 26, 2021 6:31 PM > > > > > > On Tue, Oct 26, 2021 at 07:02:39AM +0300, Parav Pandit via >

Re: [PATCH V3 11/11] vhost: allow userspace to create workers

2021-10-26 Thread Michael S. Tsirkin
On Tue, Oct 26, 2021 at 01:37:14PM +0800, Jason Wang wrote: > > 在 2021/10/22 下午1:19, Mike Christie 写道: > > This patch allows userspace to create workers and bind them to vqs. You > > can have N workers per dev and also share N workers with M vqs. > > > > Signed-off-by: Mike Christie > > > A

Re: [PATCH linux-next v6 4/8] vdpa: Enable user to set mac and mtu of vdpa device

2021-10-26 Thread Michael S. Tsirkin
On Tue, Oct 26, 2021 at 01:03:41PM +, Parav Pandit wrote: > > > > From: Stefano Garzarella > > Sent: Tuesday, October 26, 2021 6:31 PM > > > > On Tue, Oct 26, 2021 at 07:02:39AM +0300, Parav Pandit via Virtualization > > wrote: > > >$ vdpa dev add name bar mgmtdev vdpasim_net mac

RE: [PATCH linux-next v6 4/8] vdpa: Enable user to set mac and mtu of vdpa device

2021-10-26 Thread Parav Pandit via Virtualization
> From: Stefano Garzarella > Sent: Tuesday, October 26, 2021 6:31 PM > > On Tue, Oct 26, 2021 at 07:02:39AM +0300, Parav Pandit via Virtualization > wrote: > >$ vdpa dev add name bar mgmtdev vdpasim_net mac 00:11:22:33:44:55 mtu > >9000 > > > >$ vdpa dev config show > >bar: mac

Re: [PATCH linux-next v6 4/8] vdpa: Enable user to set mac and mtu of vdpa device

2021-10-26 Thread Stefano Garzarella
On Tue, Oct 26, 2021 at 07:02:39AM +0300, Parav Pandit via Virtualization wrote: $ vdpa dev add name bar mgmtdev vdpasim_net mac 00:11:22:33:44:55 mtu 9000 $ vdpa dev config show bar: mac 00:11:22:33:44:55 link up link_announce false mtu 9000 $ vdpa dev config show -jp { "config": {

Re: [PATCH linux-next v6 3/8] vdpa: Use kernel coding style for structure comments

2021-10-26 Thread Stefano Garzarella
On Tue, Oct 26, 2021 at 07:02:38AM +0300, Parav Pandit via Virtualization wrote: As subsequent patch adds new structure field with comment, move the structure comment to follow kernel coding style. Signed-off-by: Parav Pandit Reviewed-by: Eli Cohen Acked-by: Jason Wang ---

Re: [PATCH linux-next v6 1/8] vdpa: Introduce and use vdpa device get, set config helpers

2021-10-26 Thread Stefano Garzarella
On Tue, Oct 26, 2021 at 07:02:36AM +0300, Parav Pandit via Virtualization wrote: Subsequent patches enable get and set configuration either via management device or via vdpa device' config ops. This requires synchronization between multiple callers to get and set config callbacks. Features

Re: [PATCH] i2c: virtio: Add support for zero-length requests

2021-10-26 Thread Viresh Kumar
On 21-10-21, 15:17, Viresh Kumar wrote: > The virtio specification received a new mandatory feature > (VIRTIO_I2C_F_ZERO_LENGTH_REQUEST) for zero length requests. Fail if the > feature isn't offered by the device. > > For each read-request, set the VIRTIO_I2C_FLAGS_M_RD flag, as required > by the

Re: [PATCH V4 1/4] virtio_ring: validate used buffer length

2021-10-26 Thread Michael S. Tsirkin
On Tue, Oct 26, 2021 at 06:21:46PM +0800, Jason Wang wrote: > On Tue, Oct 26, 2021 at 5:44 PM Michael S. Tsirkin wrote: > > > > On Tue, Oct 26, 2021 at 03:19:57PM +0800, Jason Wang wrote: > > > This patch validate the used buffer length provided by the device > > > before trying to use it. This

Re: [PATCH V4 1/4] virtio_ring: validate used buffer length

2021-10-26 Thread Jason Wang
On Tue, Oct 26, 2021 at 5:44 PM Michael S. Tsirkin wrote: > > On Tue, Oct 26, 2021 at 03:19:57PM +0800, Jason Wang wrote: > > This patch validate the used buffer length provided by the device > > before trying to use it. This is done by record the in buffer length > > in a new field in desc_state

Re: [PATCH] eni_vdpa: alibaba: fix Kconfig typo

2021-10-26 Thread Stefano Garzarella
On Tue, Oct 26, 2021 at 10:31:59AM +0200, Arnd Bergmann wrote: From: Arnd Bergmann The Kconfig symbol was misspelled, which leads to randconfig link failures: ld.lld: error: undefined symbol: vp_legacy_probe referenced by eni_vdpa.c vdpa/alibaba/eni_vdpa.o:(eni_vdpa_probe) in

Re: [PATCH V4 1/4] virtio_ring: validate used buffer length

2021-10-26 Thread Michael S. Tsirkin
On Tue, Oct 26, 2021 at 03:19:57PM +0800, Jason Wang wrote: > This patch validate the used buffer length provided by the device > before trying to use it. This is done by record the in buffer length > in a new field in desc_state structure during virtqueue_add(), then we > can fail the

[PATCH V4 3/4] virtio-blk: don't let virtio core to validate used length

2021-10-26 Thread Jason Wang
We never tries to use used length, so the patch prevents the virtio core from validating used length. Signed-off-by: Jason Wang --- drivers/block/virtio_blk.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index

[PATCH V4 4/4] virtio-scsi: don't let virtio core to validate used buffer length

2021-10-26 Thread Jason Wang
We never tries to use used length, so the patch prevents the virtio core from validating used length. Signed-off-by: Jason Wang --- drivers/scsi/virtio_scsi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index

[PATCH V4 2/4] virtio-net: don't let virtio core to validate used length

2021-10-26 Thread Jason Wang
For RX virtuqueue, the used length is validated in all the three paths (big, small and mergeable). For control vq, we never tries to use used length. So this patch forbids the core to validate the used length. Signed-off-by: Jason Wang --- drivers/net/virtio_net.c | 1 + 1 file changed, 1

[PATCH V4 1/4] virtio_ring: validate used buffer length

2021-10-26 Thread Jason Wang
This patch validate the used buffer length provided by the device before trying to use it. This is done by record the in buffer length in a new field in desc_state structure during virtqueue_add(), then we can fail the virtqueue_get_buf() when we find the device is trying to give us a used buffer

[PATCH V4 0/4] Validate used buffer length

2021-10-26 Thread Jason Wang
Hi All: This patch tries to validate the used buffer length in the virtio core. This help to eliminate the unexpected result caused by buggy or mailicous devices. For the drivers that can do the validation itself, they can ask the virtio core to suppress the check. Changes since V3: -

Re: [PATCH v11 2/3] tty: hvc: pass DMA capable memory to put_chars()

2021-10-26 Thread Greg KH
On Tue, Oct 26, 2021 at 02:11:51PM +0800, Xianting Tian wrote: > > 在 2021/10/26 下午2:10, Greg KH 写道: > > On Tue, Oct 26, 2021 at 02:02:21PM +0800, Xianting Tian wrote: > > > 在 2021/10/26 下午1:10, Jiri Slaby 写道: > > > > On 15. 10. 21, 4:46, Xianting Tian wrote: > > > > > @@ -151,9 +142,11 @@ static

Re: [PATCH v11 2/3] tty: hvc: pass DMA capable memory to put_chars()

2021-10-26 Thread Greg KH
On Tue, Oct 26, 2021 at 02:02:21PM +0800, Xianting Tian wrote: > 在 2021/10/26 下午1:10, Jiri Slaby 写道: > > On 15. 10. 21, 4:46, Xianting Tian wrote: > > > @@ -151,9 +142,11 @@ static uint32_t vtermnos[MAX_NR_HVC_CONSOLES] = > > >   static void hvc_console_print(struct console *co, const char *b, > >