From: Jason Wang
Date: Wed, 16 Jan 2019 16:54:42 +0800
> Vhost dirty page logging API is designed to sync through GPA. But we
> try to log GIOVA when device IOTLB is enabled. This is wrong and may
> lead to missing data after migration.
>
> To solve this issue, when logging with device IOTLB ena
Commit 4e09ff536284 ("virtio-net: disable NAPI only when enabled during
XDP set") tried to fix inappropriate NAPI enabling/disabling when
!netif_running(), but was not complete.
On error path virtio_net could enable NAPI even when !netif_running().
This can cause enabling NAPI twice on virtnet_ope
While I'm looking into how to account standard tx counters on XDP tx
processing, I found several bugs around XDP tx and napi_tx.
Patch1: Fix oops on error path. Patch2 depends on this.
Patch2: Fix memory corruption on freeing xdp_frames with napi_tx enabled.
Patch3: Minor fix patch5 depends on.
Pa
On Wed, Jan 16, 2019 at 07:10:18PM +0100, Sam Ravnborg wrote:
> Hi Daniel.
>
> > v5: Actually try to sort them, and while at it, sort all the ones I
> > touch.
>
> Applied this variant on top of drm-misc and did a build test.
> Looked good for ia64, x86 and alpha.
>
> Took a closer look at the c
On Thu, Jan 17, 2019 at 05:45:41PM +0100, Daniel Vetter wrote:
> On Wed, Jan 16, 2019 at 07:10:18PM +0100, Sam Ravnborg wrote:
> > Hi Daniel.
> >
> > > v5: Actually try to sort them, and while at it, sort all the ones I
> > > touch.
> >
> > Applied this variant on top of drm-misc and did a build
On Thu, Jan 17, 2019 at 08:20:38PM +0900, Toshiaki Makita wrote:
> While I'm looking into how to account standard tx counters on XDP tx
> processing, I found several bugs around XDP tx and napi_tx.
>
> Patch1: Fix oops on error path. Patch2 depends on this.
> Patch2: Fix memory corruption on freei
On Thu, 17 Jan 2019 20:56:39 +0800
Jason Wang wrote:
> On 2019/1/17 下午7:20, Toshiaki Makita wrote:
> > put_page() can work as a fallback for freeing xdp_frames, but the
> > appropriate way is to use xdp_return_frame().
> >
> > Fixes: cac320c850ef ("virtio_net: convert to use generic xdp_frame and
On Wed, Jan 16, 2019 at 03:31:58PM -0800, David Miller wrote:
> From: "Michael S. Tsirkin"
> Date: Mon, 14 Jan 2019 20:34:26 -0500
>
> > Use napi_consume_skb() to get bulk free. Note that napi_consume_skb is
> > safe to call in a non-napi context as long as the napi_budget flag is
> > correct.
>
On 2019/1/2 下午9:54, Michael S. Tsirkin wrote:
On Wed, Jan 02, 2019 at 11:30:11AM +0800, Jason Wang wrote:
On 2018/12/31 上午2:48, Michael S. Tsirkin wrote:
On Thu, Dec 27, 2018 at 06:04:53PM +0800, Jason Wang wrote:
On 2018/12/26 下午11:22, Michael S. Tsirkin wrote:
On Thu, Dec 06, 2018 at 04:17
On 2019/1/17 下午8:53, Jason Wang wrote:
On 2019/1/17 下午7:20, Toshiaki Makita wrote:
Commit 8dcc5b0ab0ec ("virtio_net: fix ndo_xdp_xmit crash towards dev not
ready for XDP") tried to avoid access to unexpected sq while XDP is
disabled, but was not complete.
There was a small window which causes
On 2019/1/17 7:20, Toshiaki Makita wrote:
We do not reset or free up unused buffers when enabling/disabling XDP,
so it can happen that xdp_frames are freed after disabling XDP or
sk_buffs are freed after enabling XDP on xdp tx queues.
Thus we need to handle both forms (xdp_frames and sk_buffs)
On 2019/1/17 下午7:20, Toshiaki Makita wrote:
put_page() can work as a fallback for freeing xdp_frames, but the
appropriate way is to use xdp_return_frame().
Fixes: cac320c850ef ("virtio_net: convert to use generic xdp_frame and
xdp_return_frame API")
Signed-off-by: Toshiaki Makita
---
driver
On 2019/1/17 下午7:20, Toshiaki Makita wrote:
Commit 8dcc5b0ab0ec ("virtio_net: fix ndo_xdp_xmit crash towards dev not
ready for XDP") tried to avoid access to unexpected sq while XDP is
disabled, but was not complete.
There was a small window which causes out of bounds sq access in
virtnet_xdp_x
On 2019/1/17 下午7:20, Toshiaki Makita wrote:
When XDP is disabled, curr_queue_pairs + smp_processor_id() can be
larger than max_queue_pairs.
There is no guarantee that we have enough XDP send queues dedicated for
each cpu when XDP is disabled, so do not count drops on sq in that case.
Fixes: 5b8
On 2019/1/17 下午7:20, Toshiaki Makita wrote:
When _virtnet_set_queues() failed we did not restore real_num_rx_queues.
Fix this by placing the change of real_num_rx_queues after
_virtnet_set_queues().
This order is also in line with virtnet_set_channels().
Fixes: 4941d472bf95 ("virtio-net: do not
On 2019/1/17 下午7:20, Toshiaki Makita wrote:
When napi_tx is enabled, virtnet_poll_cleantx() called
free_old_xmit_skbs() even for xdp send queue.
This is bogus since the queue has xdp_frames, not sk_buffs, thus mangled
device tx bytes counters because skb->len is meaningless value, and even
trigg
On 2019/1/17 下午7:20, Toshiaki Makita wrote:
Commit 4e09ff536284 ("virtio-net: disable NAPI only when enabled during
XDP set") tried to fix inappropriate NAPI enabling/disabling when
!netif_running(), but was not complete.
On error path virtio_net could enable NAPI even when !netif_running().
Th
We do not reset or free up unused buffers when enabling/disabling XDP,
so it can happen that xdp_frames are freed after disabling XDP or
sk_buffs are freed after enabling XDP on xdp tx queues.
Thus we need to handle both forms (xdp_frames and sk_buffs) regardless
of XDP setting.
One way to trigger
put_page() can work as a fallback for freeing xdp_frames, but the
appropriate way is to use xdp_return_frame().
Fixes: cac320c850ef ("virtio_net: convert to use generic xdp_frame and
xdp_return_frame API")
Signed-off-by: Toshiaki Makita
---
drivers/net/virtio_net.c | 2 +-
1 file changed, 1 ins
Commit 8dcc5b0ab0ec ("virtio_net: fix ndo_xdp_xmit crash towards dev not
ready for XDP") tried to avoid access to unexpected sq while XDP is
disabled, but was not complete.
There was a small window which causes out of bounds sq access in
virtnet_xdp_xmit() while disabling XDP.
An example case of
When XDP is disabled, curr_queue_pairs + smp_processor_id() can be
larger than max_queue_pairs.
There is no guarantee that we have enough XDP send queues dedicated for
each cpu when XDP is disabled, so do not count drops on sq in that case.
Fixes: 5b8f3c8d30a6 ("virtio_net: Add XDP related stats")
When _virtnet_set_queues() failed we did not restore real_num_rx_queues.
Fix this by placing the change of real_num_rx_queues after
_virtnet_set_queues().
This order is also in line with virtnet_set_channels().
Fixes: 4941d472bf95 ("virtio-net: do not reset during XDP set")
Signed-off-by: Toshiaki
When napi_tx is enabled, virtnet_poll_cleantx() called
free_old_xmit_skbs() even for xdp send queue.
This is bogus since the queue has xdp_frames, not sk_buffs, thus mangled
device tx bytes counters because skb->len is meaningless value, and even
triggered oops due to general protection fault on fr
23 matches
Mail list logo