Displaying 20 results from an estimated 59 matches for "rxq2vq".
2017 Apr 25
0
[vhost:vhost 6/19] drivers/net/virtio_net.c:2089:19: error: assignment of read-only location '*(ctx + (sizetype)rxq2vq(i))'
...ca2ff1bcf81b1b92a207f71a326742 builds fine.
It only hurts bisectibility.
All errors (new ones prefixed by >>):
drivers/net/virtio_net.c: In function 'virtnet_find_vqs':
>> drivers/net/virtio_net.c:2089:19: error: assignment of read-only location '*(ctx + (sizetype)rxq2vq(i))'
ctx[rxq2vq(i)] = true;
^
vim +2089 drivers/net/virtio_net.c
2083 callbacks[txq2vq(i)] = skb_xmit_done;
2084 sprintf(vi->rq[i].name, "input.%d", i);
2085 sprintf(vi->sq[i].name, "output.%d", i);
2086 names[rxq2vq(i)] =...
2017 Apr 25
0
[vhost:vhost 6/19] drivers/net/virtio_net.c:2089:19: error: assignment of read-only location '*(ctx + (sizetype)rxq2vq(i))'
...ca2ff1bcf81b1b92a207f71a326742 builds fine.
It only hurts bisectibility.
All errors (new ones prefixed by >>):
drivers/net/virtio_net.c: In function 'virtnet_find_vqs':
>> drivers/net/virtio_net.c:2089:19: error: assignment of read-only location '*(ctx + (sizetype)rxq2vq(i))'
ctx[rxq2vq(i)] = true;
^
vim +2089 drivers/net/virtio_net.c
2083 callbacks[txq2vq(i)] = skb_xmit_done;
2084 sprintf(vi->rq[i].name, "input.%d", i);
2085 sprintf(vi->sq[i].name, "output.%d", i);
2086 names[rxq2vq(i)] =...
2017 Mar 29
2
[PATCH 4/6] virtio_net: allow specifying context for rx
...f(*ctx), GFP_KERNEL);
+ if (!ctx)
+ goto err_ctx;
+ } else {
+ ctx = NULL;
+ }
/* Parameters for control virtqueue, if any */
if (vi->has_cvq) {
@@ -2077,9 +2085,12 @@ static int virtnet_find_vqs(struct virtnet_info *vi)
sprintf(vi->sq[i].name, "output.%d", i);
names[rxq2vq(i)] = vi->rq[i].name;
names[txq2vq(i)] = vi->sq[i].name;
+ if (ctx)
+ ctx[rxq2vq(i)] = true;
}
- ret = virtio_find_vqs(vi->vdev, total_vqs, vqs, callbacks, names, NULL);
+ ret = vi->vdev->config->find_vqs(vi->vdev, total_vqs, vqs, callbacks,
+ names, ctx, NULL);...
2017 Mar 29
2
[PATCH 4/6] virtio_net: allow specifying context for rx
...f(*ctx), GFP_KERNEL);
+ if (!ctx)
+ goto err_ctx;
+ } else {
+ ctx = NULL;
+ }
/* Parameters for control virtqueue, if any */
if (vi->has_cvq) {
@@ -2077,9 +2085,12 @@ static int virtnet_find_vqs(struct virtnet_info *vi)
sprintf(vi->sq[i].name, "output.%d", i);
names[rxq2vq(i)] = vi->rq[i].name;
names[txq2vq(i)] = vi->sq[i].name;
+ if (ctx)
+ ctx[rxq2vq(i)] = true;
}
- ret = virtio_find_vqs(vi->vdev, total_vqs, vqs, callbacks, names, NULL);
+ ret = vi->vdev->config->find_vqs(vi->vdev, total_vqs, vqs, callbacks,
+ names, ctx, NULL);...
2017 Mar 30
1
[PATCH 4/6] virtio_net: allow specifying context for rx
...= NULL;
> > + }
> >
> > /* Parameters for control virtqueue, if any */
> > if (vi->has_cvq) {
> > @@ -2077,9 +2085,12 @@ static int virtnet_find_vqs(struct virtnet_info *vi)
> > sprintf(vi->sq[i].name, "output.%d", i);
> > names[rxq2vq(i)] = vi->rq[i].name;
> > names[txq2vq(i)] = vi->sq[i].name;
> > + if (ctx)
> > + ctx[rxq2vq(i)] = true;
> > }
> >
> > - ret = virtio_find_vqs(vi->vdev, total_vqs, vqs, callbacks, names, NULL);
> > + ret = vi->vdev->config->find_...
2017 Mar 30
1
[PATCH 4/6] virtio_net: allow specifying context for rx
...= NULL;
> > + }
> >
> > /* Parameters for control virtqueue, if any */
> > if (vi->has_cvq) {
> > @@ -2077,9 +2085,12 @@ static int virtnet_find_vqs(struct virtnet_info *vi)
> > sprintf(vi->sq[i].name, "output.%d", i);
> > names[rxq2vq(i)] = vi->rq[i].name;
> > names[txq2vq(i)] = vi->sq[i].name;
> > + if (ctx)
> > + ctx[rxq2vq(i)] = true;
> > }
> >
> > - ret = virtio_find_vqs(vi->vdev, total_vqs, vqs, callbacks, names, NULL);
> > + ret = vi->vdev->config->find_...
2017 Mar 30
0
[PATCH 4/6] virtio_net: allow specifying context for rx
...rr_ctx;
> + } else {
> + ctx = NULL;
> + }
>
> /* Parameters for control virtqueue, if any */
> if (vi->has_cvq) {
> @@ -2077,9 +2085,12 @@ static int virtnet_find_vqs(struct virtnet_info *vi)
> sprintf(vi->sq[i].name, "output.%d", i);
> names[rxq2vq(i)] = vi->rq[i].name;
> names[txq2vq(i)] = vi->sq[i].name;
> + if (ctx)
> + ctx[rxq2vq(i)] = true;
> }
>
> - ret = virtio_find_vqs(vi->vdev, total_vqs, vqs, callbacks, names, NULL);
> + ret = vi->vdev->config->find_vqs(vi->vdev, total_vqs, vqs, ca...
2014 Dec 26
0
[RFC PATCH 3/3] virtio-net: using single MSIX irq for each TX/RX queue pair
...total_vqs, sizeof(*channels), GFP_KERNEL);
+ if (!channels)
+ goto err_channels;
/* Parameters for control virtqueue, if any */
if (vi->has_cvq) {
@@ -1555,10 +1568,15 @@ static int virtnet_find_vqs(struct virtnet_info *vi)
sprintf(vi->sq[i].name, "output.%d", i);
names[rxq2vq(i)] = vi->rq[i].name;
names[txq2vq(i)] = vi->sq[i].name;
+ sprintf(vi->sq[i].channel_name, "txrx.%d", i);
+ channel_names[i] = vi->sq[i].channel_name;
+ channels[rxq2vq(i)] = i;
+ channels[txq2vq(i)] = i;
}
ret = vi->vdev->config->find_vqs(vi->vdev, to...
2014 Dec 26
0
[RFC PATCH 3/3] virtio-net: using single MSIX irq for each TX/RX queue pair
...total_vqs, sizeof(*channels), GFP_KERNEL);
+ if (!channels)
+ goto err_channels;
/* Parameters for control virtqueue, if any */
if (vi->has_cvq) {
@@ -1555,10 +1568,15 @@ static int virtnet_find_vqs(struct virtnet_info *vi)
sprintf(vi->sq[i].name, "output.%d", i);
names[rxq2vq(i)] = vi->rq[i].name;
names[txq2vq(i)] = vi->sq[i].name;
+ sprintf(vi->sq[i].channel_name, "txrx.%d", i);
+ channel_names[i] = vi->sq[i].channel_name;
+ channels[rxq2vq(i)] = i;
+ channels[txq2vq(i)] = i;
}
ret = vi->vdev->config->find_vqs(vi->vdev, to...
2017 Mar 29
1
[PATCH] virtio_net: fix support for small rings
...f_len, rq_size);
+
+ return max(min_buf_len, hdr_len);
+}
+
static int virtnet_find_vqs(struct virtnet_info *vi)
{
vq_callback_t **callbacks;
@@ -2151,6 +2170,7 @@ static int virtnet_find_vqs(struct virtnet_info *vi)
for (i = 0; i < vi->max_queue_pairs; i++) {
vi->rq[i].vq = vqs[rxq2vq(i)];
+ vi->rq[i].min_buf_len = mergeable_min_buf_len(vi, vi->rq[i].vq);
vi->sq[i].vq = vqs[txq2vq(i)];
}
@@ -2237,7 +2257,8 @@ static ssize_t mergeable_rx_buffer_size_show(struct netdev_rx_queue *queue,
BUG_ON(queue_index >= vi->max_queue_pairs);
avg = &vi->rq[qu...
2017 Mar 29
1
[PATCH] virtio_net: fix support for small rings
...f_len, rq_size);
+
+ return max(min_buf_len, hdr_len);
+}
+
static int virtnet_find_vqs(struct virtnet_info *vi)
{
vq_callback_t **callbacks;
@@ -2151,6 +2170,7 @@ static int virtnet_find_vqs(struct virtnet_info *vi)
for (i = 0; i < vi->max_queue_pairs; i++) {
vi->rq[i].vq = vqs[rxq2vq(i)];
+ vi->rq[i].min_buf_len = mergeable_min_buf_len(vi, vi->rq[i].vq);
vi->sq[i].vq = vqs[txq2vq(i)];
}
@@ -2237,7 +2257,8 @@ static ssize_t mergeable_rx_buffer_size_show(struct netdev_rx_queue *queue,
BUG_ON(queue_index >= vi->max_queue_pairs);
avg = &vi->rq[qu...
2017 Mar 29
1
[PATCH v2] virtio_net: fix support for small rings
...f_len, rq_size);
+
+ return max(min_buf_len, hdr_len);
+}
+
static int virtnet_find_vqs(struct virtnet_info *vi)
{
vq_callback_t **callbacks;
@@ -2151,6 +2171,7 @@ static int virtnet_find_vqs(struct virtnet_info *vi)
for (i = 0; i < vi->max_queue_pairs; i++) {
vi->rq[i].vq = vqs[rxq2vq(i)];
+ vi->rq[i].min_buf_len = mergeable_min_buf_len(vi, vi->rq[i].vq);
vi->sq[i].vq = vqs[txq2vq(i)];
}
@@ -2237,7 +2258,8 @@ static ssize_t mergeable_rx_buffer_size_show(struct netdev_rx_queue *queue,
BUG_ON(queue_index >= vi->max_queue_pairs);
avg = &vi->rq[qu...
2017 Mar 29
1
[PATCH v2] virtio_net: fix support for small rings
...f_len, rq_size);
+
+ return max(min_buf_len, hdr_len);
+}
+
static int virtnet_find_vqs(struct virtnet_info *vi)
{
vq_callback_t **callbacks;
@@ -2151,6 +2171,7 @@ static int virtnet_find_vqs(struct virtnet_info *vi)
for (i = 0; i < vi->max_queue_pairs; i++) {
vi->rq[i].vq = vqs[rxq2vq(i)];
+ vi->rq[i].min_buf_len = mergeable_min_buf_len(vi, vi->rq[i].vq);
vi->sq[i].vq = vqs[txq2vq(i)];
}
@@ -2237,7 +2258,8 @@ static ssize_t mergeable_rx_buffer_size_show(struct netdev_rx_queue *queue,
BUG_ON(queue_index >= vi->max_queue_pairs);
avg = &vi->rq[qu...
2023 Aug 21
3
[PATCH net-next v3] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting
...tio_net_hdr hdr;
+ struct virtio_net_hdr_mrg_rxbuf mrg_hdr;
+ struct virtio_net_hdr_v1_hash hash_v1_hdr;
+ };
+};
+
static void virtnet_rq_free_unused_buf(struct virtqueue *vq, void *buf);
static void virtnet_sq_free_unused_buf(struct virtqueue *vq, void *buf);
@@ -344,9 +352,10 @@ static int rxq2vq(int rxq)
return rxq * 2;
}
-static inline struct virtio_net_hdr_mrg_rxbuf *skb_vnet_hdr(struct sk_buff *skb)
+static inline struct virtio_net_common_hdr *
+skb_vnet_common_hdr(struct sk_buff *skb)
{
- return (struct virtio_net_hdr_mrg_rxbuf *)skb->cb;
+ return (struct virtio_net_common_hdr...
2023 Aug 17
1
[PATCH net-next v2] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting
..._hdr {
+ union {
+ struct virtio_net_hdr_mrg_rxbuf mrg_hdr;
+ struct virtio_net_hdr_v1_hash hash_v1_hdr;
+ };
+};
+
static void virtnet_rq_free_unused_buf(struct virtqueue *vq, void *buf);
static void virtnet_sq_free_unused_buf(struct virtqueue *vq, void *buf);
@@ -344,9 +351,10 @@ static int rxq2vq(int rxq)
return rxq * 2;
}
-static inline struct virtio_net_hdr_mrg_rxbuf *skb_vnet_hdr(struct sk_buff *skb)
+static inline struct virtio_net_common_hdr *
+skb_vnet_common_hdr(struct sk_buff *skb)
{
- return (struct virtio_net_hdr_mrg_rxbuf *)skb->cb;
+ return (struct virtio_net_common_hdr...
2023 Aug 17
1
[PATCH net-next v2] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting
..._net_hdr. As that is the original of
the three structs, and all the initial fields overlap.
> +
> static void virtnet_rq_free_unused_buf(struct virtqueue *vq, void *buf);
> static void virtnet_sq_free_unused_buf(struct virtqueue *vq, void *buf);
>
> @@ -344,9 +351,10 @@ static int rxq2vq(int rxq)
> return rxq * 2;
> }
>
> -static inline struct virtio_net_hdr_mrg_rxbuf *skb_vnet_hdr(struct sk_buff *skb)
> +static inline struct virtio_net_common_hdr *
> +skb_vnet_common_hdr(struct sk_buff *skb)
> {
> - return (struct virtio_net_hdr_mrg_rxbuf *)...
2017 May 31
1
remove function pointer casts and constify function tables
.../drivers/net/virtio_net.c
index 9320d96a1632..b10014f7b480 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -2212,6 +2212,10 @@ static int virtnet_find_vqs(struct virtnet_info *vi)
for (i = 0; i < vi->max_queue_pairs; i++) {
vi->rq[i].vq = vqs[rxq2vq(i)];
vi->rq[i].min_buf_len = mergeable_min_buf_len(vi, vi->rq[i].vq);
+ printk(KERN_ERR, "min buf = 0x%x expected 0x%x size 0x%x big %d\n",
+ vi->rq[i].min_buf_len, GOOD_PACKET_LEN,
+ virtqu...
2017 May 31
1
remove function pointer casts and constify function tables
.../drivers/net/virtio_net.c
index 9320d96a1632..b10014f7b480 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -2212,6 +2212,10 @@ static int virtnet_find_vqs(struct virtnet_info *vi)
for (i = 0; i < vi->max_queue_pairs; i++) {
vi->rq[i].vq = vqs[rxq2vq(i)];
vi->rq[i].min_buf_len = mergeable_min_buf_len(vi, vi->rq[i].vq);
+ printk(KERN_ERR, "min buf = 0x%x expected 0x%x size 0x%x big %d\n",
+ vi->rq[i].min_buf_len, GOOD_PACKET_LEN,
+ virtqu...
2017 Apr 15
0
[PATCH RFC (resend) net-next 3/6] virtio_net: Add basic skeleton for handling vnet header extensions.
...@@ -174,6 +178,11 @@ struct virtnet_info {
u32 speed;
};
+struct virtio_net_hdr_max {
+ struct virtio_net_hdr_mrg_rxbuf hdr;
+ struct virtio_net_ext_hdr ext_hdr;
+};
+
static inline u8 padded_vnet_hdr(struct virtnet_info *vi)
{
u8 hdr_len = vi->hdr_len;
@@ -214,6 +223,7 @@ static int rxq2vq(int rxq)
static inline struct virtio_net_hdr_mrg_rxbuf *skb_vnet_hdr(struct sk_buff *skb)
{
+ BUILD_BUG_ON(sizeof(struct virtio_net_hdr_max) > sizeof(skb->cb));
return (struct virtio_net_hdr_mrg_rxbuf *)skb->cb;
}
@@ -767,6 +777,12 @@ static int receive_buf(struct virtnet_info *vi...
2017 May 26
3
remove function pointer casts and constify function tables
Looks like the culprit is very likely d85b758f72b0 "virtio_net: fix
support for small rings".
After that patch, my NFS server VM stops responding to packets after a
few minutes of testing. Before that patch, my server keeps working.
--b.