search for: virtio_store_mb

Displaying 20 results from an estimated 108 matches for "virtio_store_mb".

2020 Jul 10
1
[PATCH] virtio_ring: sparse warning fixup
virtio_store_mb was built with split ring in mind so it accepts __virtio16 arguments. Packed ring uses __le16 values, so sparse complains. It's just a store with some barriers so let's convert it to a macro, we don't loose too much type safety by doing that. Signed-off-by: Michael S. Tsirkin <mst...
2015 Dec 17
4
[PATCH] virtio_ring: use smp_store_mb
...rtions(+), 6 deletions(-) diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index 0135c16..8912189 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h @@ -47,6 +47,20 @@ static inline void virtio_wmb(bool weak_barriers) wmb(); } +static inline void virtio_store_mb(bool weak_barriers, + __virtio16 *p, __virtio16 v) +{ +#ifdef CONFIG_SMP + if (weak_barriers) + smp_store_mb(*p, v); + else +#endif + { + WRITE_ONCE(*p, v); + mb(); + } +} + static inline __virtio16 virtio_load_acquire(bool weak_barriers, __virtio16 *p) { if (!weak_barriers) { diff --g...
2015 Dec 17
4
[PATCH] virtio_ring: use smp_store_mb
...rtions(+), 6 deletions(-) diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index 0135c16..8912189 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h @@ -47,6 +47,20 @@ static inline void virtio_wmb(bool weak_barriers) wmb(); } +static inline void virtio_store_mb(bool weak_barriers, + __virtio16 *p, __virtio16 v) +{ +#ifdef CONFIG_SMP + if (weak_barriers) + smp_store_mb(*p, v); + else +#endif + { + WRITE_ONCE(*p, v); + mb(); + } +} + static inline __virtio16 virtio_load_acquire(bool weak_barriers, __virtio16 *p) { if (!weak_barriers) { diff --g...
2018 Apr 19
4
[PATCH] virtio_ring: switch to dma_XX barriers for rpmsg
...l weak_barriers) if (weak_barriers) virt_rmb(); else - rmb(); + dma_rmb(); } static inline void virtio_wmb(bool weak_barriers) @@ -43,7 +43,7 @@ static inline void virtio_wmb(bool weak_barriers) if (weak_barriers) virt_wmb(); else - wmb(); + dma_wmb(); } static inline void virtio_store_mb(bool weak_barriers, -- MST
2018 Apr 19
4
[PATCH] virtio_ring: switch to dma_XX barriers for rpmsg
...l weak_barriers) if (weak_barriers) virt_rmb(); else - rmb(); + dma_rmb(); } static inline void virtio_wmb(bool weak_barriers) @@ -43,7 +43,7 @@ static inline void virtio_wmb(bool weak_barriers) if (weak_barriers) virt_wmb(); else - wmb(); + dma_wmb(); } static inline void virtio_store_mb(bool weak_barriers, -- MST
2015 Dec 31
0
[PATCH v2 32/32] virtio_ring: use virt_store_mb
...rtions(+), 6 deletions(-) diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index f3fa55b..3a74d91 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h @@ -45,6 +45,18 @@ static inline void virtio_wmb(bool weak_barriers) wmb(); } +static inline void virtio_store_mb(bool weak_barriers, + __virtio16 *p, __virtio16 v) +{ + if (weak_barriers) + virt_store_mb(*p, v); + else + { + WRITE_ONCE(*p, v); + mb(); + } +} + struct virtio_device; struct virtqueue; diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index ee663c4..e12e385 10...
2020 Aug 03
0
[PATCH v2 02/24] virtio_ring: sparse warning fixup
virtio_store_mb was built with split ring in mind so it accepts __virtio16 arguments. Packed ring uses __le16 values, so sparse complains. It's just a store with some barriers so let's convert it to a macro, we don't loose too much type safety by doing that. Signed-off-by: Michael S. Tsirkin <mst...
2020 Aug 05
0
[PATCH v3 02/38] virtio_ring: sparse warning fixup
virtio_store_mb was built with split ring in mind so it accepts __virtio16 arguments. Packed ring uses __le16 values, so sparse complains. It's just a store with some barriers so let's convert it to a macro, we don't loose too much type safety by doing that. Signed-off-by: Michael S. Tsirkin <mst...
2023 Mar 28
2
9p regression (Was: [PATCH v2] virtio_ring: don't update event idx on get_buf)
...lush out the write before > * the read in the next get_buf call. */ > - if (!(vq->split.avail_flags_shadow & VRING_AVAIL_F_NO_INTERRUPT)) > + if (unlikely(!(vq->split.avail_flags_shadow & VRING_AVAIL_F_NO_INTERRUPT) && > + !vq->event_triggered)) > virtio_store_mb(vq->weak_barriers, > &vring_used_event(&vq->split.vring), > cpu_to_virtio16(_vq->vdev, vq->last_used_idx)); > @@ -1744,7 +1745,8 @@ static void *virtqueue_get_buf_ctx_packed(struct virtqueue *_vq, > * by writing event index and flush out the write before...
2023 Mar 24
1
[External] Re: [PATCH] virtio_ring: Suppress tx interrupt when napi_tx disable
...of event_triggered, here, > virtqueue_get_buf_ctx_split cannot be recognized > that the interrupt has been turned off. > > if we want another interrupt for the next entry, We should probably > call virtqueue_enable_cb? > > Thanks > > > > > > virtio_store_mb(vq->weak_barriers, > > > &vring_used_event(&vq->split.vring), > > > cpu_to_virtio16(_vq->vdev, vq->last_used_idx)); > > > @@ -1529,7 +1530,8 @@ static void *virtqueue_get_buf_ctx_packed(st...
2015 Dec 17
2
[PATCH] virtio_ring: use smp_store_mb
On Thu, Dec 17, 2015 at 11:52:38AM +0100, Peter Zijlstra wrote: > On Thu, Dec 17, 2015 at 12:32:53PM +0200, Michael S. Tsirkin wrote: > > +static inline void virtio_store_mb(bool weak_barriers, > > + __virtio16 *p, __virtio16 v) > > +{ > > +#ifdef CONFIG_SMP > > + if (weak_barriers) > > + smp_store_mb(*p, v); > > + else > > +#endif > > + { > > + WRITE_ONCE(*p, v); > > + mb(); > > + } > > +...
2015 Dec 17
2
[PATCH] virtio_ring: use smp_store_mb
On Thu, Dec 17, 2015 at 11:52:38AM +0100, Peter Zijlstra wrote: > On Thu, Dec 17, 2015 at 12:32:53PM +0200, Michael S. Tsirkin wrote: > > +static inline void virtio_store_mb(bool weak_barriers, > > + __virtio16 *p, __virtio16 v) > > +{ > > +#ifdef CONFIG_SMP > > + if (weak_barriers) > > + smp_store_mb(*p, v); > > + else > > +#endif > > + { > > + WRITE_ONCE(*p, v); > > + mb(); > > + } > > +...
2016 Jan 01
1
[PATCH v2 32/32] virtio_ring: use virt_store_mb
...include/linux/virtio_ring.h b/include/linux/virtio_ring.h > index f3fa55b..3a74d91 100644 > --- a/include/linux/virtio_ring.h > +++ b/include/linux/virtio_ring.h > @@ -45,6 +45,18 @@ static inline void virtio_wmb(bool weak_barriers) > wmb(); > } > > +static inline void virtio_store_mb(bool weak_barriers, > + __virtio16 *p, __virtio16 v) > +{ > + if (weak_barriers) > + virt_store_mb(*p, v); > + else > + { The kernel coding style dictates: if (weak_barriers) { virt_store_mb(*p, v); } else { > + WRITE_ONCE(*p, v); > + mb(); > + } >...
2016 Jan 01
1
[PATCH v2 32/32] virtio_ring: use virt_store_mb
...include/linux/virtio_ring.h b/include/linux/virtio_ring.h > index f3fa55b..3a74d91 100644 > --- a/include/linux/virtio_ring.h > +++ b/include/linux/virtio_ring.h > @@ -45,6 +45,18 @@ static inline void virtio_wmb(bool weak_barriers) > wmb(); > } > > +static inline void virtio_store_mb(bool weak_barriers, > + __virtio16 *p, __virtio16 v) > +{ > + if (weak_barriers) > + virt_store_mb(*p, v); > + else > + { The kernel coding style dictates: if (weak_barriers) { virt_store_mb(*p, v); } else { > + WRITE_ONCE(*p, v); > + mb(); > + } >...
2023 Mar 27
0
[PATCH v2] virtio_ring: don't update event idx on get_buf
...lush out the write before > * the read in the next get_buf call. */ > - if (!(vq->split.avail_flags_shadow & VRING_AVAIL_F_NO_INTERRUPT)) > + if (unlikely(!(vq->split.avail_flags_shadow & VRING_AVAIL_F_NO_INTERRUPT) && > + !vq->event_triggered)) > virtio_store_mb(vq->weak_barriers, > &vring_used_event(&vq->split.vring), > cpu_to_virtio16(_vq->vdev, vq->last_used_idx)); > @@ -1744,7 +1745,8 @@ static void *virtqueue_get_buf_ctx_packed(struct virtqueue *_vq, > * by writing event index and flush out the write before...
2023 Mar 22
0
[PATCH] virtio_ring: Suppress tx interrupt when napi_tx disable
...;& (vq->event_triggered == false)) I'm not sure this can work, when event_triggered is true it means we've got an interrupt, in this case if we want another interrupt for the next entry, we should update used_event otherwise we will lose that interrupt? Thanks > virtio_store_mb(vq->weak_barriers, > &vring_used_event(&vq->split.vring), > cpu_to_virtio16(_vq->vdev, vq->last_used_idx)); > @@ -1529,7 +1530,8 @@ static void *virtqueue_get_buf_ctx_packed(struct virtqueue *_vq, >...
2023 Mar 24
1
[External] Re: [PATCH] virtio_ring: Suppress tx interrupt when napi_tx disable
...nother interrupt for the next entry, We should probably > > > > > > call virtqueue_enable_cb? > > > > > > > > > > > > Thanks > > > > > > > > > > > > > > > > > > > > > virtio_store_mb(vq->weak_barriers, > > > > > > > > &vring_used_event(&vq->split.vring), > > > > > > > > cpu_to_virtio16(_vq->vdev, vq->last_used_idx)); > > > > > > &...
2018 Apr 10
0
[RFC v2] virtio: support packed ring
...i, ctx); > + vq->last_used_idx++; > + /* If we expect an interrupt for the next entry, tell host > + * by writing event index and flush out the write before > + * the read in the next get_buf call. */ > + if (!(vq->avail_flags_shadow & VRING_AVAIL_F_NO_INTERRUPT)) > + virtio_store_mb(vq->weak_barriers, > + &vring_used_event(&vq->vring), > + cpu_to_virtio16(_vq->vdev, vq->last_used_idx)); > + > +#ifdef DEBUG > + vq->last_add_time_valid = false; > +#endif > + > + END_USE(vq); > + return ret; > +} > + > +void *virtqu...
2018 May 02
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...>last_used_idx -= vq->vring_packed.num; > > + /* If we expect an interrupt for the next entry, tell host > + * by writing event index and flush out the write before > + * the read in the next get_buf call. */ > + if (vq->event_flags_shadow == VRING_EVENT_F_DESC) > + virtio_store_mb(vq->weak_barriers, > + &vq->vring_packed.driver->off_wrap, > + cpu_to_virtio16(_vq->vdev, vq->last_used_idx | > + (vq->wrap_counter << 15))); > + > #ifdef DEBUG > vq->last_add_time_valid = false; > #endif > @@ -1143,10 +1160,1...
2018 May 02
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...>last_used_idx -= vq->vring_packed.num; > > + /* If we expect an interrupt for the next entry, tell host > + * by writing event index and flush out the write before > + * the read in the next get_buf call. */ > + if (vq->event_flags_shadow == VRING_EVENT_F_DESC) > + virtio_store_mb(vq->weak_barriers, > + &vq->vring_packed.driver->off_wrap, > + cpu_to_virtio16(_vq->vdev, vq->last_used_idx | > + (vq->wrap_counter << 15))); > + > #ifdef DEBUG > vq->last_add_time_valid = false; > #endif > @@ -1143,10 +1160,1...