Displaying 20 results from an estimated 142 matches for "ring_size".
Did you mean:
vring_size
2016 Jan 21
1
[PATCH] tools/virtio: add ringtest utilities
...();
+/* host side */
+void disable_kick();
+bool enable_kick();
+bool use_buf(unsigned *, void **);
+void call_used();
+void poll_avail();
+
+/* implemented by main */
+extern bool do_sleep;
+void kick(void);
+void wait_for_kick(void);
+void call(void);
+void wait_for_call(void);
+
+extern unsigned ring_size;
+
+/* Compiler barrier - similar to what Linux uses */
+#define barrier() asm volatile("" ::: "memory")
+
+/* Is there a portable way to do this? */
+#if defined(__x86_64__) || defined(__i386__)
+#define cpu_relax() asm ("rep; nop" ::: "memory")
+#else
+#def...
2016 Jan 21
1
[PATCH] tools/virtio: add ringtest utilities
...();
+/* host side */
+void disable_kick();
+bool enable_kick();
+bool use_buf(unsigned *, void **);
+void call_used();
+void poll_avail();
+
+/* implemented by main */
+extern bool do_sleep;
+void kick(void);
+void wait_for_kick(void);
+void call(void);
+void wait_for_call(void);
+
+extern unsigned ring_size;
+
+/* Compiler barrier - similar to what Linux uses */
+#define barrier() asm volatile("" ::: "memory")
+
+/* Is there a portable way to do this? */
+#if defined(__x86_64__) || defined(__i386__)
+#define cpu_relax() asm ("rep; nop" ::: "memory")
+#else
+#def...
2016 May 15
0
[PATCH] tools/virtio: add inorder option
...+#endif
unsigned char reserved[HOST_GUEST_PADDING - 10];
} guest;
@@ -66,8 +78,10 @@ void alloc_ring(void)
guest.avail_idx = 0;
guest.kicked_avail_idx = -1;
guest.last_used_idx = 0;
+#ifndef INORDER
/* Put everything in free lists. */
guest.free_head = 0;
+#endif
for (i = 0; i < ring_size - 1; i++)
ring.desc[i].next = i + 1;
host.used_idx = 0;
@@ -84,13 +98,20 @@ void alloc_ring(void)
/* guest side */
int add_inbuf(unsigned len, void *buf, void *datap)
{
- unsigned head, avail;
+ unsigned head;
+#ifndef INORDER
+ unsigned avail;
+#endif
struct vring_desc *desc;
if (!gu...
2016 May 15
0
[PATCH] tools/virtio: add inorder option
...+#endif
unsigned char reserved[HOST_GUEST_PADDING - 10];
} guest;
@@ -66,8 +78,10 @@ void alloc_ring(void)
guest.avail_idx = 0;
guest.kicked_avail_idx = -1;
guest.last_used_idx = 0;
+#ifndef INORDER
/* Put everything in free lists. */
guest.free_head = 0;
+#endif
for (i = 0; i < ring_size - 1; i++)
ring.desc[i].next = i + 1;
host.used_idx = 0;
@@ -84,13 +98,20 @@ void alloc_ring(void)
/* guest side */
int add_inbuf(unsigned len, void *buf, void *datap)
{
- unsigned head, avail;
+ unsigned head;
+#ifndef INORDER
+ unsigned avail;
+#endif
struct vring_desc *desc;
if (!gu...
2023 Apr 30
1
[RFC PATCH net 0/3] virtio-net: allow usage of small vrings
> > This patchset follows a discussion in the mailing list [1].
> >
> > This fixes only part of the bug, rings with less than 4 entries won't
> > work.
>
> Why the difference?
>
Because the RING_SIZE < 4 case requires much more adjustments.
* We may need to squeeze the virtio header into the headroom.
* We may need to squeeze the GSO header into the headroom, or block the features.
* At the moment, without NETIF_F_SG, we can receive a skb with 2 segments, we may need to reduce it to 1.
* We...
2020 Apr 06
0
[PATCH v4 09/12] tools/virtio: switch to virtio_legacy_init/size
...est/virtio_ring_0_9.c b/tools/virtio/ringtest/virtio_ring_0_9.c
index 13a035a390e9..e2ab6ac53966 100644
--- a/tools/virtio/ringtest/virtio_ring_0_9.c
+++ b/tools/virtio/ringtest/virtio_ring_0_9.c
@@ -67,13 +67,13 @@ void alloc_ring(void)
int i;
void *p;
- ret = posix_memalign(&p, 0x1000, vring_size(ring_size, 0x1000));
+ ret = posix_memalign(&p, 0x1000, vring_legacy_size(ring_size, 0x1000));
if (ret) {
perror("Unable to allocate ring buffer.\n");
exit(3);
}
- memset(p, 0, vring_size(ring_size, 0x1000));
- vring_init(&ring, ring_size, p, 0x1000);
+ memset(p, 0, vrin...
2020 Apr 06
0
[PATCH v4 09/12] tools/virtio: switch to virtio_legacy_init/size
...est/virtio_ring_0_9.c b/tools/virtio/ringtest/virtio_ring_0_9.c
index 13a035a390e9..e2ab6ac53966 100644
--- a/tools/virtio/ringtest/virtio_ring_0_9.c
+++ b/tools/virtio/ringtest/virtio_ring_0_9.c
@@ -67,13 +67,13 @@ void alloc_ring(void)
int i;
void *p;
- ret = posix_memalign(&p, 0x1000, vring_size(ring_size, 0x1000));
+ ret = posix_memalign(&p, 0x1000, vring_legacy_size(ring_size, 0x1000));
if (ret) {
perror("Unable to allocate ring buffer.\n");
exit(3);
}
- memset(p, 0, vring_size(ring_size, 0x1000));
- vring_init(&ring, ring_size, p, 0x1000);
+ memset(p, 0, vrin...
2020 Apr 06
0
[PATCH v5 09/12] tools/virtio: switch to virtio_legacy_init/size
...est/virtio_ring_0_9.c b/tools/virtio/ringtest/virtio_ring_0_9.c
index 13a035a390e9..e2ab6ac53966 100644
--- a/tools/virtio/ringtest/virtio_ring_0_9.c
+++ b/tools/virtio/ringtest/virtio_ring_0_9.c
@@ -67,13 +67,13 @@ void alloc_ring(void)
int i;
void *p;
- ret = posix_memalign(&p, 0x1000, vring_size(ring_size, 0x1000));
+ ret = posix_memalign(&p, 0x1000, vring_legacy_size(ring_size, 0x1000));
if (ret) {
perror("Unable to allocate ring buffer.\n");
exit(3);
}
- memset(p, 0, vring_size(ring_size, 0x1000));
- vring_init(&ring, ring_size, p, 0x1000);
+ memset(p, 0, vrin...
2020 Apr 06
0
[PATCH v6 09/12] tools/virtio: switch to virtio_legacy_init/size
...est/virtio_ring_0_9.c b/tools/virtio/ringtest/virtio_ring_0_9.c
index 13a035a390e9..e2ab6ac53966 100644
--- a/tools/virtio/ringtest/virtio_ring_0_9.c
+++ b/tools/virtio/ringtest/virtio_ring_0_9.c
@@ -67,13 +67,13 @@ void alloc_ring(void)
int i;
void *p;
- ret = posix_memalign(&p, 0x1000, vring_size(ring_size, 0x1000));
+ ret = posix_memalign(&p, 0x1000, vring_legacy_size(ring_size, 0x1000));
if (ret) {
perror("Unable to allocate ring buffer.\n");
exit(3);
}
- memset(p, 0, vring_size(ring_size, 0x1000));
- vring_init(&ring, ring_size, p, 0x1000);
+ memset(p, 0, vrin...
2020 Apr 07
0
[PATCH v7 13/19] tools/virtio: switch to virtio_legacy_init/size
...est/virtio_ring_0_9.c b/tools/virtio/ringtest/virtio_ring_0_9.c
index 13a035a390e9..e2ab6ac53966 100644
--- a/tools/virtio/ringtest/virtio_ring_0_9.c
+++ b/tools/virtio/ringtest/virtio_ring_0_9.c
@@ -67,13 +67,13 @@ void alloc_ring(void)
int i;
void *p;
- ret = posix_memalign(&p, 0x1000, vring_size(ring_size, 0x1000));
+ ret = posix_memalign(&p, 0x1000, vring_legacy_size(ring_size, 0x1000));
if (ret) {
perror("Unable to allocate ring buffer.\n");
exit(3);
}
- memset(p, 0, vring_size(ring_size, 0x1000));
- vring_init(&ring, ring_size, p, 0x1000);
+ memset(p, 0, vrin...
2020 Apr 07
0
[PATCH v8 13/19] tools/virtio: switch to virtio_legacy_init/size
...est/virtio_ring_0_9.c b/tools/virtio/ringtest/virtio_ring_0_9.c
index 13a035a390e9..e2ab6ac53966 100644
--- a/tools/virtio/ringtest/virtio_ring_0_9.c
+++ b/tools/virtio/ringtest/virtio_ring_0_9.c
@@ -67,13 +67,13 @@ void alloc_ring(void)
int i;
void *p;
- ret = posix_memalign(&p, 0x1000, vring_size(ring_size, 0x1000));
+ ret = posix_memalign(&p, 0x1000, vring_legacy_size(ring_size, 0x1000));
if (ret) {
perror("Unable to allocate ring buffer.\n");
exit(3);
}
- memset(p, 0, vring_size(ring_size, 0x1000));
- vring_init(&ring, ring_size, p, 0x1000);
+ memset(p, 0, vrin...
2014 Aug 04
2
[PATCH 09/19] drm/radeon: handle lockup in delayed work, v2
Am 04.08.2014 um 17:09 schrieb Maarten Lankhorst:
> op 04-08-14 17:04, Christian K?nig schreef:
>> Am 04.08.2014 um 16:58 schrieb Maarten Lankhorst:
>>> op 04-08-14 16:45, Christian K?nig schreef:
>>>> Am 04.08.2014 um 16:40 schrieb Maarten Lankhorst:
>>>>> op 04-08-14 16:37, Christian K?nig schreef:
>>>>>>> It'a pain to deal
2023 May 01
1
[RFC PATCH net 0/3] virtio-net: allow usage of small vrings
...lvaro Karsz wrote:
>
> > > This patchset follows a discussion in the mailing list [1].
> > >
> > > This fixes only part of the bug, rings with less than 4 entries won't
> > > work.
> >
> > Why the difference?
> >
>
> Because the RING_SIZE < 4 case requires much more adjustments.
>
> * We may need to squeeze the virtio header into the headroom.
> * We may need to squeeze the GSO header into the headroom, or block the features.
We alread do this though no?
I think we'll need to tweak hard_header_len to guarantee it...
2023 Apr 30
1
[RFC PATCH net 0/3] virtio-net: allow usage of small vrings
...tio net features are not supported with
> small rings.
>
> This patchset follows a discussion in the mailing list [1].
>
> This fixes only part of the bug, rings with less than 4 entries won't
> work.
Why the difference?
> My intention is to split the effort and fix the RING_SIZE < 4 case in a
> follow up patchset.
>
> Maybe we should fail probe if RING_SIZE < 4 until the follow up patchset?
I'd keep current behaviour.
> I tested the patchset with SNET DPU (drivers/vdpa/solidrun), with packed
> and split VQs, with rings down to 4 entries, with an...
2017 Feb 01
0
[PATCH 05/14] netvsc: remove no longer needed receive staging buffers
...3 files changed, 11 insertions(+), 88 deletions(-)
diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
index 3958adade7eb..cce70ceba6d5 100644
--- a/drivers/net/hyperv/hyperv_net.h
+++ b/drivers/net/hyperv/hyperv_net.h
@@ -748,11 +748,6 @@ struct netvsc_device {
int ring_size;
- /* The primary channel callback buffer */
- unsigned char *cb_buffer;
- /* The sub channel callback buffer */
- unsigned char *sub_cb_buf;
-
struct multi_send_data msd[VRSS_CHANNEL_MAX];
u32 max_pkt; /* max number of pkt in one send, e.g. 8 */
u32 pkt_align; /* alignment bytes, e.g. 8 */...
2017 Feb 05
2
[PATCH 05/14] netvsc: remove no longer needed receive staging buffers
...ions(-)
>
> diff --git a/drivers/net/hyperv/hyperv_net.h
> b/drivers/net/hyperv/hyperv_net.h
> index 3958adade7eb..cce70ceba6d5 100644
> --- a/drivers/net/hyperv/hyperv_net.h
> +++ b/drivers/net/hyperv/hyperv_net.h
> @@ -748,11 +748,6 @@ struct netvsc_device {
>
> int ring_size;
>
> - /* The primary channel callback buffer */
> - unsigned char *cb_buffer;
> - /* The sub channel callback buffer */
> - unsigned char *sub_cb_buf;
> -
> struct multi_send_data msd[VRSS_CHANNEL_MAX];
> u32 max_pkt; /* max number of pkt in one send, e.g. 8 */
>...
2017 Feb 05
2
[PATCH 05/14] netvsc: remove no longer needed receive staging buffers
...ions(-)
>
> diff --git a/drivers/net/hyperv/hyperv_net.h
> b/drivers/net/hyperv/hyperv_net.h
> index 3958adade7eb..cce70ceba6d5 100644
> --- a/drivers/net/hyperv/hyperv_net.h
> +++ b/drivers/net/hyperv/hyperv_net.h
> @@ -748,11 +748,6 @@ struct netvsc_device {
>
> int ring_size;
>
> - /* The primary channel callback buffer */
> - unsigned char *cb_buffer;
> - /* The sub channel callback buffer */
> - unsigned char *sub_cb_buf;
> -
> struct multi_send_data msd[VRSS_CHANNEL_MAX];
> u32 max_pkt; /* max number of pkt in one send, e.g. 8 */
>...
2020 Apr 06
1
[PATCH v3 1/2] virtio: stop using legacy struct vring in kernel
...e builds.
+ */
+struct vring {
+ unsigned int num;
+
+ struct vring_desc *desc;
+
+ struct vring_avail *avail;
+
+ struct vring_used *used;
+};
+
static inline void vring_init(struct vring *vr, unsigned int num, void *p,
unsigned long align)
{
@@ -180,6 +185,7 @@ static inline unsigned vring_size(unsigned int num, unsigned long align)
+ align - 1) & ~(align - 1))
+ sizeof(__virtio16) * 3 + sizeof(struct vring_used_elem) * num;
}
+#endif
/* The following is used with USED_EVENT_IDX and AVAIL_EVENT_IDX */
/* Assuming a given event_idx value from the other side, if
diff --git a...
2011 Mar 07
0
[PATCH 10/16] Staging: hv: Eliminate netvsc_driver_context
...staging/hv/netvsc_drv.c
@@ -48,9 +48,6 @@ struct net_device_context {
unsigned long avail;
};
-struct netvsc_driver_context {
- struct netvsc_driver drv_obj;
-};
#define PACKET_PAGES_LOWATER 8
/* Need this many pages to handle worst case fragmented packet */
@@ -61,7 +58,7 @@ module_param(ring_size, int, S_IRUGO);
MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)");
/* The one and only one */
-static struct netvsc_driver_context g_netvsc_drv;
+static struct netvsc_driver g_netvsc_drv;
/* no-op so the netdev core doesn't return -EINVAL when modifying the the
*...
2011 Mar 07
0
[PATCH 10/16] Staging: hv: Eliminate netvsc_driver_context
...staging/hv/netvsc_drv.c
@@ -48,9 +48,6 @@ struct net_device_context {
unsigned long avail;
};
-struct netvsc_driver_context {
- struct netvsc_driver drv_obj;
-};
#define PACKET_PAGES_LOWATER 8
/* Need this many pages to handle worst case fragmented packet */
@@ -61,7 +58,7 @@ module_param(ring_size, int, S_IRUGO);
MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)");
/* The one and only one */
-static struct netvsc_driver_context g_netvsc_drv;
+static struct netvsc_driver g_netvsc_drv;
/* no-op so the netdev core doesn't return -EINVAL when modifying the the
*...