search for: __u16

Displaying 20 results from an estimated 755 matches for "__u16".

2020 Aug 06
0
[vhost:vhost 32/65] drivers/virtio/virtio_input.c:247:3: warning: comparison of distinct pointer types ('typeof (_Generic((virtio_cread_v), __u8: (virtio_cread_v), __le16: (__builtin_constant_p((__u16)((__u16)(__le16)(virtio_cread_v)))
...opriate Reported-by: kernel test robot <lkp at intel.com> All warnings (new ones prefixed by >>): >> drivers/virtio/virtio_input.c:247:3: warning: comparison of distinct pointer types ('typeof (_Generic((virtio_cread_v), __u8: (virtio_cread_v), __le16: (__builtin_constant_p((__u16)((__u16)(__le16)(virtio_cread_v))) ? ((__u16)((((__u16)((__u16)(__le16)(virtio_cread_v)) & (__u16)255U) << 8) | (((__u16)((__u16)(__le16)(virtio_cread_v)) & (__u16)65280U) >> 8))) : __fswab16((__u16)(__le16)(virtio_cread_v))), __le32: (__builtin_constant_p((__u32)((__u32)(__le32...
2018 May 03
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...we do new += vq->vring_packed.num instead >>> of event_idx -= vq->vring_packed.num before calling >>> vring_need_event()? >>> >>> The problem is that, the second param (new_idx) of >>> vring_need_event() will be used for: >>> >>> (__u16)(new_idx - event_idx - 1) >>> (__u16)(new_idx - old) >>> >>> So if we change new, we will need to change old too. >> I think that since we have a branch there anyway, >> we are better off just special-casing if (wrap_counter != vq->wrap_counter). >> T...
2018 May 03
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...we do new += vq->vring_packed.num instead >>> of event_idx -= vq->vring_packed.num before calling >>> vring_need_event()? >>> >>> The problem is that, the second param (new_idx) of >>> vring_need_event() will be used for: >>> >>> (__u16)(new_idx - event_idx - 1) >>> (__u16)(new_idx - old) >>> >>> So if we change new, we will need to change old too. >> I think that since we have a branch there anyway, >> we are better off just special-casing if (wrap_counter != vq->wrap_counter). >> T...
2014 Oct 22
2
[PATCH RFC v2 01/16] virtio: memory access APIs
..._DESC_F_NEXT 1 @@ -61,32 +62,32 @@ /* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ struct vring_desc { /* Address (guest-physical). */ - __u64 addr; + __virtio64 addr; /* Length. */ - __u32 len; + __virtio32 len; /* The flags as indicated above. */ - __u16 flags; + __virtio16 flags; /* We chain unused descriptors via this, too */ - __u16 next; + __virtio16 next; }; struct vring_avail { - __u16 flags; - __u16 idx; - __u16 ring[]; + __virtio16 flags; + __virtio16 idx; + __virtio16 ring[]; }; /* u32 is used here for ids for padding reasons. */...
2014 Oct 22
2
[PATCH RFC v2 01/16] virtio: memory access APIs
..._DESC_F_NEXT 1 @@ -61,32 +62,32 @@ /* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ struct vring_desc { /* Address (guest-physical). */ - __u64 addr; + __virtio64 addr; /* Length. */ - __u32 len; + __virtio32 len; /* The flags as indicated above. */ - __u16 flags; + __virtio16 flags; /* We chain unused descriptors via this, too */ - __u16 next; + __virtio16 next; }; struct vring_avail { - __u16 flags; - __u16 idx; - __u16 ring[]; + __virtio16 flags; + __virtio16 idx; + __virtio16 ring[]; }; /* u32 is used here for ids for padding reasons. */...
2018 May 08
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...; > > > > Thanks > > > Sorry, looks like the following should work, we need add vq.num if > > > used_wrap_counter does not match: > > > > > > static bool vhost_vring_packed_need_event(struct vhost_virtqueue *vq, > > > ??? ??? ??? ??? ??? ? __u16 off_wrap, __u16 new, > > > ??? ??? ??? ??? ??? ? __u16 old) > > > { > > > ??? bool wrap = off_wrap >> 15; > > > ??? int off = off_wrap & ~(1 << 15); > > > ??? __u16 d1, d2; > > > > > > ??? if (wrap != vq->used_w...
2018 May 08
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...; > > > > Thanks > > > Sorry, looks like the following should work, we need add vq.num if > > > used_wrap_counter does not match: > > > > > > static bool vhost_vring_packed_need_event(struct vhost_virtqueue *vq, > > > ??? ??? ??? ??? ??? ? __u16 off_wrap, __u16 new, > > > ??? ??? ??? ??? ??? ? __u16 old) > > > { > > > ??? bool wrap = off_wrap >> 15; > > > ??? int off = off_wrap & ~(1 << 15); > > > ??? __u16 d1, d2; > > > > > > ??? if (wrap != vq->used_w...
2014 Oct 22
2
[PATCH RFC v3 01/16] virtio: memory access APIs
..._DESC_F_NEXT 1 @@ -61,32 +62,32 @@ /* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ struct vring_desc { /* Address (guest-physical). */ - __u64 addr; + __virtio64 addr; /* Length. */ - __u32 len; + __virtio32 len; /* The flags as indicated above. */ - __u16 flags; + __virtio16 flags; /* We chain unused descriptors via this, too */ - __u16 next; + __virtio16 next; }; struct vring_avail { - __u16 flags; - __u16 idx; - __u16 ring[]; + __virtio16 flags; + __virtio16 idx; + __virtio16 ring[]; }; /* u32 is used here for ids for padding reasons. */...
2014 Oct 22
2
[PATCH RFC v3 01/16] virtio: memory access APIs
..._DESC_F_NEXT 1 @@ -61,32 +62,32 @@ /* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ struct vring_desc { /* Address (guest-physical). */ - __u64 addr; + __virtio64 addr; /* Length. */ - __u32 len; + __virtio32 len; /* The flags as indicated above. */ - __u16 flags; + __virtio16 flags; /* We chain unused descriptors via this, too */ - __u16 next; + __virtio16 next; }; struct vring_avail { - __u16 flags; - __u16 idx; - __u16 ring[]; + __virtio16 flags; + __virtio16 idx; + __virtio16 ring[]; }; /* u32 is used here for ids for padding reasons. */...
2018 May 08
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...t; without the need to try to add vq.num here. > > > > Thanks > > Sorry, looks like the following should work, we need add vq.num if > used_wrap_counter does not match: > > static bool vhost_vring_packed_need_event(struct vhost_virtqueue *vq, > ??? ??? ??? ??? ??? ? __u16 off_wrap, __u16 new, > ??? ??? ??? ??? ??? ? __u16 old) > { > ??? bool wrap = off_wrap >> 15; > ??? int off = off_wrap & ~(1 << 15); > ??? __u16 d1, d2; > > ??? if (wrap != vq->used_wrap_counter) > ??? ??? d1 = new + vq->num - off - 1; Just to draw yo...
2018 May 08
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...t; without the need to try to add vq.num here. > > > > Thanks > > Sorry, looks like the following should work, we need add vq.num if > used_wrap_counter does not match: > > static bool vhost_vring_packed_need_event(struct vhost_virtqueue *vq, > ??? ??? ??? ??? ??? ? __u16 off_wrap, __u16 new, > ??? ??? ??? ??? ??? ? __u16 old) > { > ??? bool wrap = off_wrap >> 15; > ??? int off = off_wrap & ~(1 << 15); > ??? __u16 d1, d2; > > ??? if (wrap != vq->used_wrap_counter) > ??? ??? d1 = new + vq->num - off - 1; Just to draw yo...
2014 Oct 21
2
[PATCH RFC] virtio 1.0 vring endian-ness
...--git a/include/uapi/linux/virtio_ring.h b/include/uapi/linux/virtio_ring.h index a99f9b7..744cee1 100644 --- a/include/uapi/linux/virtio_ring.h +++ b/include/uapi/linux/virtio_ring.h @@ -33,6 +33,10 @@ * Copyright Rusty Russell IBM Corporation 2007. */ #include <linux/types.h> +typedef __u16 __bitwise __virtio16; +typedef __u32 __bitwise __virtio32; +typedef __u64 __bitwise __virtio64; + /* This marks a buffer as continuing via the next field. */ #define VRING_DESC_F_NEXT 1 /* This marks a buffer as write-only (otherwise read-only). */ @@ -61,32 +65,32 @@ /* Virtio ring descriptors...
2014 Oct 21
2
[PATCH RFC] virtio 1.0 vring endian-ness
...--git a/include/uapi/linux/virtio_ring.h b/include/uapi/linux/virtio_ring.h index a99f9b7..744cee1 100644 --- a/include/uapi/linux/virtio_ring.h +++ b/include/uapi/linux/virtio_ring.h @@ -33,6 +33,10 @@ * Copyright Rusty Russell IBM Corporation 2007. */ #include <linux/types.h> +typedef __u16 __bitwise __virtio16; +typedef __u32 __bitwise __virtio32; +typedef __u64 __bitwise __virtio64; + /* This marks a buffer as continuing via the next field. */ #define VRING_DESC_F_NEXT 1 /* This marks a buffer as write-only (otherwise read-only). */ @@ -61,32 +65,32 @@ /* Virtio ring descriptors...
2014 Nov 27
0
[PATCH v5 07/45] virtio: memory access APIs
..._DESC_F_NEXT 1 @@ -61,32 +62,32 @@ /* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ struct vring_desc { /* Address (guest-physical). */ - __u64 addr; + __virtio64 addr; /* Length. */ - __u32 len; + __virtio32 len; /* The flags as indicated above. */ - __u16 flags; + __virtio16 flags; /* We chain unused descriptors via this, too */ - __u16 next; + __virtio16 next; }; struct vring_avail { - __u16 flags; - __u16 idx; - __u16 ring[]; + __virtio16 flags; + __virtio16 idx; + __virtio16 ring[]; }; /* u32 is used here for ids for padding reasons. */...
2014 Nov 27
0
[PATCH v6 08/46] virtio: memory access APIs
..._DESC_F_NEXT 1 @@ -61,32 +62,32 @@ /* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ struct vring_desc { /* Address (guest-physical). */ - __u64 addr; + __virtio64 addr; /* Length. */ - __u32 len; + __virtio32 len; /* The flags as indicated above. */ - __u16 flags; + __virtio16 flags; /* We chain unused descriptors via this, too */ - __u16 next; + __virtio16 next; }; struct vring_avail { - __u16 flags; - __u16 idx; - __u16 ring[]; + __virtio16 flags; + __virtio16 idx; + __virtio16 ring[]; }; /* u32 is used here for ids for padding reasons. */...
2014 Nov 27
0
[PATCH v5 07/45] virtio: memory access APIs
..._DESC_F_NEXT 1 @@ -61,32 +62,32 @@ /* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ struct vring_desc { /* Address (guest-physical). */ - __u64 addr; + __virtio64 addr; /* Length. */ - __u32 len; + __virtio32 len; /* The flags as indicated above. */ - __u16 flags; + __virtio16 flags; /* We chain unused descriptors via this, too */ - __u16 next; + __virtio16 next; }; struct vring_avail { - __u16 flags; - __u16 idx; - __u16 ring[]; + __virtio16 flags; + __virtio16 idx; + __virtio16 ring[]; }; /* u32 is used here for ids for padding reasons. */...
2014 Nov 27
0
[PATCH v6 08/46] virtio: memory access APIs
..._DESC_F_NEXT 1 @@ -61,32 +62,32 @@ /* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ struct vring_desc { /* Address (guest-physical). */ - __u64 addr; + __virtio64 addr; /* Length. */ - __u32 len; + __virtio32 len; /* The flags as indicated above. */ - __u16 flags; + __virtio16 flags; /* We chain unused descriptors via this, too */ - __u16 next; + __virtio16 next; }; struct vring_avail { - __u16 flags; - __u16 idx; - __u16 ring[]; + __virtio16 flags; + __virtio16 idx; + __virtio16 ring[]; }; /* u32 is used here for ids for padding reasons. */...
2018 May 08
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...;>> of event_idx -= vq->vring_packed.num before calling >>>>> vring_need_event()? >>>>> >>>>> The problem is that, the second param (new_idx) of >>>>> vring_need_event() will be used for: >>>>> >>>>> (__u16)(new_idx - event_idx - 1) >>>>> (__u16)(new_idx - old) >>>>> >>>>> So if we change new, we will need to change old too. >>>> I think that since we have a branch there anyway, >>>> we are better off just special-casing if (wrap_cou...
2018 May 08
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...;>> of event_idx -= vq->vring_packed.num before calling >>>>> vring_need_event()? >>>>> >>>>> The problem is that, the second param (new_idx) of >>>>> vring_need_event() will be used for: >>>>> >>>>> (__u16)(new_idx - event_idx - 1) >>>>> (__u16)(new_idx - old) >>>>> >>>>> So if we change new, we will need to change old too. >>>> I think that since we have a branch there anyway, >>>> we are better off just special-casing if (wrap_cou...
2014 Oct 23
0
[PATCH RFC v4 01/17] virtio: memory access APIs
..._DESC_F_NEXT 1 @@ -61,32 +62,32 @@ /* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ struct vring_desc { /* Address (guest-physical). */ - __u64 addr; + __virtio64 addr; /* Length. */ - __u32 len; + __virtio32 len; /* The flags as indicated above. */ - __u16 flags; + __virtio16 flags; /* We chain unused descriptors via this, too */ - __u16 next; + __virtio16 next; }; struct vring_avail { - __u16 flags; - __u16 idx; - __u16 ring[]; + __virtio16 flags; + __virtio16 idx; + __virtio16 ring[]; }; /* u32 is used here for ids for padding reasons. */...