Re: [PATCH] virtio_net: Remove BUG() to aviod machine dead

2021-06-01 Thread Leon Romanovsky
On Tue, May 25, 2021 at 02:19:03PM +0800, Jason Wang wrote: > > 在 2021/5/19 下午10:18, Xianting Tian 写道: > > thanks, I submit the patch as commented by Andrew > > https://lkml.org/lkml/2021/5/18/256 > > > > Actually, if xmit_skb() returns error, below code will give a warning > > with error code.

Re: [PATCH] virtio-net: fix the kzalloc/kfree mismatch problem

2021-06-01 Thread Leon Romanovsky
On Mon, May 24, 2021 at 10:37:14AM +0800, Jason Wang wrote: > > 在 2021/5/24 上午10:06, Xuan Zhuo 写道: > > On Mon, 24 May 2021 01:48:53 +, Guodeqing (A) > > wrote: > > > > > > > -Original Message- > > > > From: Max Gurtovoy [mailto:mgurto...@nvidia.com] > > > > Sent: Sunday, May 23,

[PATCH V2 RESEND 4/4] virtio/vdpa: clear the virtqueue state during probe

2021-06-01 Thread Jason Wang
From: Eli Cohen Clear the available index as part of the initialization process to clear and values that might be left from previous usage of the device. For example, if the device was previously used by vhost_vdpa and now probed by vhost_vdpa, you want to start with indices. Fixes:

[PATCH V2 RESEND 3/4] vp_vdpa: allow set vq state to initial state after reset

2021-06-01 Thread Jason Wang
We used to fail the set_vq_state() since it was not supported yet by the virtio spec. But if the bus tries to set the state which is equal to the device initial state after reset, we can let it go. This is a must for virtio_vdpa() to set vq state during probe which is required for some vDPA

[PATCH V2 RESEND 2/4] virtio-pci library: introduce vp_modern_get_driver_features()

2021-06-01 Thread Jason Wang
This patch introduce a helper to get driver/guest features from the device. Signed-off-by: Jason Wang --- drivers/virtio/virtio_pci_modern_dev.c | 21 + include/linux/virtio_pci_modern.h | 1 + 2 files changed, 22 insertions(+) diff --git

[PATCH V2 RESEND 1/4] vdpa: support packed virtqueue for set/get_vq_state()

2021-06-01 Thread Jason Wang
This patch extends the vdpa_vq_state to support packed virtqueue state which is basically the device/driver ring wrap counters and the avail and used index. This will be used for the virito-vdpa support for the packed virtqueue and the future vhost/vhost-vdpa support for the packed virtqueue.

[PATCH V2 RESEND 0/4] Packed virtqueue state support for vDPA

2021-06-01 Thread Jason Wang
Hi: This series implements the packed virtqueue state support for vDPA. This is done via extending the vdpa_vq_state to support packed virtqueue. For virtio-vDPA, an initial state required by the virtio spec is set. For vhost-vDPA, the packed virtqueue support still needs to be done at both

Re: [PATCH V2 0/4]

2021-06-01 Thread Jason Wang
在 2021/6/2 上午10:10, Jason Wang 写道: *** BLURB HERE *** Missing blurb... Will resend a new version. Thanks Eli Cohen (1): virtio/vdpa: clear the virtqueue state during probe Jason Wang (3): vdpa: support packed virtqueue for set/get_vq_state() virtio-pci library: introduce

Re: [PATCH 1/4] vdpa: support packed virtqueue for set/get_vq_state()

2021-06-01 Thread Jason Wang
在 2021/6/1 下午6:47, Eli Cohen 写道: On Tue, Jun 01, 2021 at 04:45:00PM +0800, Jason Wang wrote: This patch extends the vdpa_vq_state to support packed virtqueue state which is basically the device/driver ring wrap counters and the avail and used index. This will be used for the virito-vdpa

[PATCH V2 4/4] virtio/vdpa: clear the virtqueue state during probe

2021-06-01 Thread Jason Wang
From: Eli Cohen Clear the available index as part of the initialization process to clear and values that might be left from previous usage of the device. For example, if the device was previously used by vhost_vdpa and now probed by vhost_vdpa, you want to start with indices. Fixes:

[PATCH V2 3/4] vp_vdpa: allow set vq state to initial state after reset

2021-06-01 Thread Jason Wang
We used to fail the set_vq_state() since it was not supported yet by the virtio spec. But if the bus tries to set the state which is equal to the device initial state after reset, we can let it go. This is a must for virtio_vdpa() to set vq state during probe which is required for some vDPA

[PATCH V2 2/4] virtio-pci library: introduce vp_modern_get_driver_features()

2021-06-01 Thread Jason Wang
This patch introduce a helper to get driver/guest features from the device. Signed-off-by: Jason Wang --- drivers/virtio/virtio_pci_modern_dev.c | 21 + include/linux/virtio_pci_modern.h | 1 + 2 files changed, 22 insertions(+) diff --git

[PATCH V2 1/4] vdpa: support packed virtqueue for set/get_vq_state()

2021-06-01 Thread Jason Wang
This patch extends the vdpa_vq_state to support packed virtqueue state which is basically the device/driver ring wrap counters and the avail and used index. This will be used for the virito-vdpa support for the packed virtqueue and the future vhost/vhost-vdpa support for the packed virtqueue.

[PATCH V2 0/4]

2021-06-01 Thread Jason Wang
*** BLURB HERE *** Eli Cohen (1): virtio/vdpa: clear the virtqueue state during probe Jason Wang (3): vdpa: support packed virtqueue for set/get_vq_state() virtio-pci library: introduce vp_modern_get_driver_features() vp_vdpa: allow set vq state to initial state after reset

Re: virtio-net: kernel panic in virtio_net.c

2021-06-01 Thread Xuan Zhuo
On Tue, 1 Jun 2021 19:47:44 +0200, Eric Dumazet wrote: > On Tue, Jun 1, 2021 at 7:09 PM Corentin Noël > wrote: > > > > Le mardi 01 juin 2021 à 19:07 +0200, Greg KH a écrit : > > > On Tue, Jun 01, 2021 at 06:06:50PM +0200, Corentin Noël wrote: > > > > I've been experiencing crashes with 5.13 that

Re: [PATCH 1/4] vdpa: support packed virtqueue for set/get_vq_state()

2021-06-01 Thread kernel test robot
Hi Jason, I love your patch! Yet something to improve: [auto build test ERROR on vhost/linux-next] [also build test ERROR on linus/master v5.13-rc4 next-20210601] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base

Re: virtio-net: kernel panic in virtio_net.c

2021-06-01 Thread Greg KH
On Tue, Jun 01, 2021 at 06:06:50PM +0200, Corentin Noël wrote: > I've been experiencing crashes with 5.13 that do not occur with 5.12, > here is the crash trace: > > [ 47.713713] skbuff: skb_over_panic: text:b73a8354 len:3762 > put:3762 head:9e1e1e48e000 data:9e1e1e48e010

Re: [PATCH net v2 0/2] virtio-net: fix for build_skb()

2021-06-01 Thread Michael S. Tsirkin
On Tue, Jun 01, 2021 at 02:39:58PM +0800, Xuan Zhuo wrote: > #1 Fixed a serious error. > #2 Fixed a logical error, but this error did not cause any serious > consequences. > > The logic of this piece is really messy. Fortunately, my refactored patch can > be > completed with a small amount of

Re: [PATCH V3 2/2] vDPA/ifcvf: implement doorbell mapping for ifcvf

2021-06-01 Thread Jason Wang
在 2021/6/1 下午4:56, Zhu, Lingshan 写道: On 6/1/2021 4:50 PM, Jason Wang wrote: 在 2021/6/1 下午2:28, Zhu Lingshan 写道: This commit implements doorbell mapping feature for ifcvf. This feature maps the notify page to userspace, to eliminate vmexit when kick a vq. Signed-off-by: Zhu Lingshan ---  

Re: [PATCH net v2 2/2] virtio_net: get build_skb() buf by data ptr

2021-06-01 Thread Jason Wang
在 2021/6/1 下午2:40, Xuan Zhuo 写道: In the case of merge, the page passed into page_to_skb() may be a head page, not the page where the current data is located. So when trying to get the buf where the data is located, we should get buf based on headroom instead of offset. This patch solves this

Re: [PATCH net v2 1/2] virtio-net: fix for unable to handle page fault for address

2021-06-01 Thread Jason Wang
在 2021/6/1 下午2:39, Xuan Zhuo 写道: In merge mode, when xdp is enabled, if the headroom of buf is smaller than virtnet_get_headroom(), xdp_linearize_page() will be called but the variable of "headroom" is still 0, which leads to wrong logic after entering page_to_skb(). [ 16.600944] BUG: unable

Re: [PATCH V3 1/2] vDPA/ifcvf: record virtio notify base

2021-06-01 Thread Jason Wang
在 2021/6/1 下午2:28, Zhu Lingshan 写道: This commit records virtio notify base physical addr and calculate doorbell physical address for vqs. Signed-off-by: Zhu Lingshan Acked-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_base.c | 4 drivers/vdpa/ifcvf/ifcvf_base.h | 2 ++ 2 files

[PATCH 4/4] virtio/vdpa: clear the virtqueue state during probe

2021-06-01 Thread Jason Wang
From: Eli Cohen Clear the available index as part of the initialization process to clear and values that might be left from previous usage of the device. For example, if the device was previously used by vhost_vdpa and now probed by vhost_vdpa, you want to start with indices. Fixes:

[PATCH 3/4] vp_vdpa: allow set vq state to initial state after reset

2021-06-01 Thread Jason Wang
We used to fail the set_vq_state() since it was not supported yet by the virtio spec. But if the bus tries to set the state which is equal to the device initial state after reset, we can let it go. This is a must for virtio_vdpa() to set vq state during probe which is required for some vDPA

[PATCH 2/4] virtio-pci library: introduce vp_modern_get_driver_features()

2021-06-01 Thread Jason Wang
This patch introduce a helper to get driver/guest features from the device. Signed-off-by: Jason Wang --- drivers/virtio/virtio_pci_modern_dev.c | 21 + include/linux/virtio_pci_modern.h | 1 + 2 files changed, 22 insertions(+) diff --git

[PATCH 1/4] vdpa: support packed virtqueue for set/get_vq_state()

2021-06-01 Thread Jason Wang
This patch extends the vdpa_vq_state to support packed virtqueue state which is basically the device/driver ring wrap counters and the avail and used index. This will be used for the virito-vdpa support for the packed virtqueue and the future vhost/vhost-vdpa support for the packed virtqueue.

[PATCH 0/4] Packed virtqueue state support for vDPA

2021-06-01 Thread Jason Wang
Hi: This series implements the packed virtqueue state support for vDPA. This is done via extending the vdpa_vq_state to support packed virtqueue. For virtio-vDPA, an initial state required by the virtio spec is set. For vhost-vDPA, the packed virtqueue support still needs to be done at both

[PATCH net v2 1/2] virtio-net: fix for unable to handle page fault for address

2021-06-01 Thread Xuan Zhuo
In merge mode, when xdp is enabled, if the headroom of buf is smaller than virtnet_get_headroom(), xdp_linearize_page() will be called but the variable of "headroom" is still 0, which leads to wrong logic after entering page_to_skb(). [ 16.600944] BUG: unable to handle page fault for address:

[PATCH net v2 2/2] virtio_net: get build_skb() buf by data ptr

2021-06-01 Thread Xuan Zhuo
In the case of merge, the page passed into page_to_skb() may be a head page, not the page where the current data is located. So when trying to get the buf where the data is located, we should get buf based on headroom instead of offset. This patch solves this problem. But if you don't use this

[PATCH net v2 0/2] virtio-net: fix for build_skb()

2021-06-01 Thread Xuan Zhuo
#1 Fixed a serious error. #2 Fixed a logical error, but this error did not cause any serious consequences. The logic of this piece is really messy. Fortunately, my refactored patch can be completed with a small amount of testing. Thanks. Xuan Zhuo (2): virtio-net: fix for unable to handle

Re: [PATCH net 2/2] virtio-net: get build_skb() buf by data ptr

2021-06-01 Thread Xuan Zhuo
On Tue, 1 Jun 2021 14:17:27 +0800, Jason Wang wrote: > > 在 2021/6/1 下午1:59, Xuan Zhuo 写道: > > On Tue, 1 Jun 2021 11:27:12 +0800, Jason Wang wrote: > >> 在 2021/6/1 上午11:08, Xuan Zhuo 写道: > >>> On Tue, 1 Jun 2021 11:03:37 +0800, Jason Wang wrote: > 在 2021/5/31 下午6:58, Xuan Zhuo 写道: > >

Re: [PATCH net 2/2] virtio-net: get build_skb() buf by data ptr

2021-06-01 Thread Jason Wang
在 2021/6/1 下午1:59, Xuan Zhuo 写道: On Tue, 1 Jun 2021 11:27:12 +0800, Jason Wang wrote: 在 2021/6/1 上午11:08, Xuan Zhuo 写道: On Tue, 1 Jun 2021 11:03:37 +0800, Jason Wang wrote: 在 2021/5/31 下午6:58, Xuan Zhuo 写道: On Mon, 31 May 2021 14:10:55 +0800, Jason Wang wrote: 在 2021/5/14 下午11:16, Xuan

Re: [PATCH net 2/2] virtio-net: get build_skb() buf by data ptr

2021-06-01 Thread Xuan Zhuo
On Tue, 1 Jun 2021 11:27:12 +0800, Jason Wang wrote: > > 在 2021/6/1 上午11:08, Xuan Zhuo 写道: > > On Tue, 1 Jun 2021 11:03:37 +0800, Jason Wang wrote: > >> 在 2021/5/31 下午6:58, Xuan Zhuo 写道: > >>> On Mon, 31 May 2021 14:10:55 +0800, Jason Wang > >>> wrote: > 在 2021/5/14 下午11:16, Xuan Zhuo 写道: