Skip to contentSkip to conversation

Do not name control queue for virtio-net

PATCH In review [email protected] 3 participants 6 messages Sep 17, 2022 – Sep 22, 2022 1 message not in the archive

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Do not name control queue for virtio-net

From: Junbo <[email protected]>

In virtio drivers, the control queue always named <virtioX>-config.

---
 drivers/net/virtio_net.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/virtio_net.c +2 -1
index 9cce7dec7366..0b3e74cfe201 100644
@@ -3469,7 +3469,8 @@ static int virtnet_find_vqs(struct virtnet_info *vi)
 	/* Parameters for control virtqueue, if any */
 	if (vi->has_cvq) {
 		callbacks[total_vqs - 1] = NULL;
-		names[total_vqs - 1] = "control";
+		/* control virtqueue always named <virtioX>-config */
+		names[total_vqs - 1] = "";
 	}
 
 	/* Allocate/initialize parameters for send/receive virtqueues */
Signature · 1 line
2.31.1
#1 lore raw
Quoted 5 lines · On Sat, Sep 17, 2022 at 09:28:57AM +0000, [email protected] wrote:

From: Junbo <[email protected]>

In virtio drivers, the control queue always named <virtioX>-config.

I don't think that's right. config is the config interrupt.

Quoted 20 lines
---
 drivers/net/virtio_net.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/virtio_net.c +2 -1
index 9cce7dec7366..0b3e74cfe201 100644
@@ -3469,7 +3469,8 @@ static int virtnet_find_vqs(struct virtnet_info *vi)
 	/* Parameters for control virtqueue, if any */
 	if (vi->has_cvq) {
 		callbacks[total_vqs - 1] = NULL;
-		names[total_vqs - 1] = "control";
+		/* control virtqueue always named <virtioX>-config */
+		names[total_vqs - 1] = "";
 	}
 
 	/* Allocate/initialize parameters for send/receive virtqueues */
Signature · 1 line
2.31.1

A message that is not in the archive (sent off-list or not yet received): CACvn-oGUj0mDxBO2yV1mwvz4PzhN3rDnVpUh12NA5jLKTqRT3A@mail.gmail.com

#3 lore raw
Quoted 10 lines · Junbo

hi Michael

in virtio-net.c
    /* Parameters for control virtqueue, if any */ if (vi->has_cvq) {
        callbacks[total_vqs - 1] = NULL; names[total_vqs - 1] = "control"; }

I think the Author who write the code

wait, that was not you?

Quoted 55 lines

maybe want to name the control queue to
'virtioX-control', but it never worked, we can see the name still be 'virtioX-config' in /proc/interrupts, for example
 43:          0          0          0          0          0          0 0          0   PCI-MSI-edge      virtio0-config
 44:         64          0          0          0          0          0 1845          0   PCI-MSI-edge      virtio0-input.0
 45:          1          0          0          0          0          0 0          0   PCI-MSI-edge      virtio0-output.0

Because in function vp_request_msix_vectors, it just allocate 'xxxx-config' to every virtio devices, even the virtio device do not need it. in /proc/ interrupts, we can see that each virtio device's first interrupt always named 'virtioX-config'.

So I think it's better to not explicitly give the "control" here, it's useless...

Michael S. Tsirkin <[email protected]> 于2022年9月18日周日 14:56写道:

    On Sat, Sep 17, 2022 at 09:28:57AM +0000, [email protected] wrote:
    > From: Junbo <[email protected]>
    >
    > In virtio drivers, the control queue always named <virtioX>-config.
    >
    > Signed-off-by: Junbo <[email protected]>

    I don't think that's right. config is the config interrupt.



    > ---
    >  drivers/net/virtio_net.c | 3 ++-
    >  1 file changed, 2 insertions(+), 1 deletion(-)
    >
    > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
    > index 9cce7dec7366..0b3e74cfe201 100644
    > --- a/drivers/net/virtio_net.c
    > +++ b/drivers/net/virtio_net.c
    > @@ -3469,7 +3469,8 @@ static int virtnet_find_vqs(struct virtnet_info
    *vi)
    >       /* Parameters for control virtqueue, if any */
    >       if (vi->has_cvq) {
    >               callbacks[total_vqs - 1] = NULL;
    > -             names[total_vqs - 1] = "control";
    > +             /* control virtqueue always named <virtioX>-config */
    > +             names[total_vqs - 1] = "";
    >       }
    > 
    >       /* Allocate/initialize parameters for send/receive virtqueues */
    > --
    > 2.31.1
maintainer
#4 lore raw
Quoted 10 lines · Michael S. Tsirkin
Quoted 9 lines · Junbo

hi Michael

in virtio-net.c
    /* Parameters for control virtqueue, if any */ if (vi->has_cvq) {
        callbacks[total_vqs - 1] = NULL; names[total_vqs - 1] = "control"; }

Quoted 3 lines
Quoted 1 line

I think the Author who write the code

wait, that was not you?

I believe 'the Author' refers to the author of the current code, not to the author of the patch.

@Junbo: the control queue is created only if the VIRTIO_NET_F_CTRL_VQ feature is set, please check that in your setup.

Thanks

Paolo

#5 lore raw
Quoted 11 lines · Paolo Abeni
Quoted 10 lines · Michael S. Tsirkin
Quoted 9 lines · Junbo

hi Michael

in virtio-net.c
    /* Parameters for control virtqueue, if any */ if (vi->has_cvq) {
        callbacks[total_vqs - 1] = NULL; names[total_vqs - 1] = "control"; }

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

I think the Author who write the code

wait, that was not you?

I believe 'the Author' refers to the author of the current code, not to the author of the patch.

Oh I see. Responded.

Quoted 6 lines

@Junbo: the control queue is created only if the VIRTIO_NET_F_CTRL_VQ feature is set, please check that in your setup.

Thanks

Paolo

Signature · 1 line
MST
#6 lore raw
In reply to a message not in the archive
Quoted 11 lines · Junbo

hi Michael

in virtio-net.c
    /* Parameters for control virtqueue, if any */ if (vi->has_cvq) {
        callbacks[total_vqs - 1] = NULL; names[total_vqs - 1] = "control"; }

I think the Author who write the code maybe want to name the control queue to 'virtioX-control',

That would be me I suspect ;)

Quoted 2 lines

but it never worked, we can see the name still be
'virtioX-config' in /proc/interrupts,

Nope, what you see in /proc/interrupts are the interrupts, not the queue name.

Quoted 10 lines

for example
 43:          0          0          0          0          0          0 0          0   PCI-MSI-edge      virtio0-config
 44:         64          0          0          0          0          0 1845          0   PCI-MSI-edge      virtio0-input.0
 45:          1          0          0          0          0          0 0          0   PCI-MSI-edge      virtio0-output.0

Because in function vp_request_msix_vectors, it just allocate 'xxxx-config' to every virtio devices, even the virtio device do not need it.

Oh yes, we can fix that. The result will be this line disappearing for devices without a config interrupt. Not for net though, that generally uses a config interrupt for things like link state detection.

Quoted 6 lines

in /proc/
interrupts, we can see that each virtio device's first interrupt always named 'virtioX-config'.

So I think it's better to not explicitly give the "control" here, it's useless...

it's used for debugging.