Skip to contentSkip to conversation

xen-netfront: fix queue name setting

PATCH In review Vitaly Kuznetsov 3 participants 5 messages Jul 20, 2018 – Jul 22, 2018

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

PATCH 1/1 xen-netfront: fix queue name setting

Commit f599c64fdf7d ("xen-netfront: Fix race between device setup and open") changed the initialization order: xennet_create_queues() now happens before we do register_netdev() so using netdev->name in xennet_init_queue() is incorrect, we end up with the following in /proc/interrupts:

 60:        139          0   xen-dyn    -event     eth%d-q0-tx
 61:        265          0   xen-dyn    -event     eth%d-q0-rx
 62:        234          0   xen-dyn    -event     eth%d-q1-tx
 63:          1          0   xen-dyn    -event     eth%d-q1-rx

and this looks ugly. Actually, using early netdev name (even when it's already set) is also not ideal: nowadays we tend to rename eth devices and queue name may end up not corresponding to the netdev name.

Use nodename from xenbus device for queue naming: this can't change in VM's lifetime. Now /proc/interrupts looks like

 62:        202          0   xen-dyn    -event     device/vif/0-q0-tx
 63:        317          0   xen-dyn    -event     device/vif/0-q0-rx
 64:        262          0   xen-dyn    -event     device/vif/0-q1-tx
 65:         17          0   xen-dyn    -event     device/vif/0-q1-rx
Fixes f599c64fdf7d ("xen-netfront: Fix race between device setup and open")
---
 drivers/net/xen-netfront.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/xen-netfront.c +1 -1
index a57daecf1d57..1b40b648ed5c 100644
@@ -1604,7 +1604,7 @@ static int xennet_init_queue(struct netfront_queue *queue)
 	timer_setup(&queue->rx_refill_timer, rx_refill_timeout, 0);
 
 	snprintf(queue->name, sizeof(queue->name), "%s-q%u",
-		 queue->info->netdev->name, queue->id);
+		 queue->info->xbdev->nodename, queue->id);
 
 	/* Initialise tx_skbs as a free chain containing every entry. */
 	queue->tx_skb_freelist = 0;
Signature · 1 line
2.14.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Vitaly Kuznetsov

Commit f599c64fdf7d ("xen-netfront: Fix race between device setup and open") changed the initialization order: xennet_create_queues() now happens before we do register_netdev() so using netdev->name in xennet_init_queue() is incorrect, we end up with the following in /proc/interrupts:

  60:        139          0   xen-dyn    -event     eth%d-q0-tx
  61:        265          0   xen-dyn    -event     eth%d-q0-rx
  62:        234          0   xen-dyn    -event     eth%d-q1-tx
  63:          1          0   xen-dyn    -event     eth%d-q1-rx

and this looks ugly. Actually, using early netdev name (even when it's already set) is also not ideal: nowadays we tend to rename eth devices and queue name may end up not corresponding to the netdev name.

Use nodename from xenbus device for queue naming: this can't change in VM's lifetime. Now /proc/interrupts looks like

Quoted 8 lines
  62:        202          0   xen-dyn    -event     device/vif/0-q0-tx
  63:        317          0   xen-dyn    -event     device/vif/0-q0-rx
  64:        262          0   xen-dyn    -event     device/vif/0-q1-tx
  65:         17          0   xen-dyn    -event     device/vif/0-q1-rx
Fixes f599c64fdf7d ("xen-netfront: Fix race between device setup and open")

---

Reviewed-by on v1 1/1
#2 lore raw
In reply to Vitaly Kuznetsov
Quoted 18 lines · Vitaly Kuznetsov

Commit f599c64fdf7d ("xen-netfront: Fix race between device setup and open") changed the initialization order: xennet_create_queues() now happens before we do register_netdev() so using netdev->name in xennet_init_queue() is incorrect, we end up with the following in /proc/interrupts:

  60:        139          0   xen-dyn    -event     eth%d-q0-tx
  61:        265          0   xen-dyn    -event     eth%d-q0-rx
  62:        234          0   xen-dyn    -event     eth%d-q1-tx
  63:          1          0   xen-dyn    -event     eth%d-q1-rx

and this looks ugly. Actually, using early netdev name (even when it's already set) is also not ideal: nowadays we tend to rename eth devices and queue name may end up not corresponding to the netdev name.

Use nodename from xenbus device for queue naming: this can't change in VM's lifetime. Now /proc/interrupts looks like

Quoted 8 lines
  62:        202          0   xen-dyn    -event     device/vif/0-q0-tx
  63:        317          0   xen-dyn    -event     device/vif/0-q0-rx
  64:        262          0   xen-dyn    -event     device/vif/0-q1-tx
  65:         17          0   xen-dyn    -event     device/vif/0-q1-rx
Fixes f599c64fdf7d ("xen-netfront: Fix race between device setup and open")

---

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

maintainer
#3 lore raw
In reply to Vitaly Kuznetsov

From: Vitaly Kuznetsov <[email protected]>
Date: Fri, 20 Jul 2018 18:33:59 +0200

Quoted 18 lines

Commit f599c64fdf7d ("xen-netfront: Fix race between device setup and open") changed the initialization order: xennet_create_queues() now happens before we do register_netdev() so using netdev->name in xennet_init_queue() is incorrect, we end up with the following in /proc/interrupts:

 60:        139          0   xen-dyn    -event     eth%d-q0-tx
 61:        265          0   xen-dyn    -event     eth%d-q0-rx
 62:        234          0   xen-dyn    -event     eth%d-q1-tx
 63:          1          0   xen-dyn    -event     eth%d-q1-rx

and this looks ugly. Actually, using early netdev name (even when it's already set) is also not ideal: nowadays we tend to rename eth devices and queue name may end up not corresponding to the netdev name.

Use nodename from xenbus device for queue naming: this can't change in VM's lifetime. Now /proc/interrupts looks like

Quoted 7 lines
 62:        202          0   xen-dyn    -event     device/vif/0-q0-tx
 63:        317          0   xen-dyn    -event     device/vif/0-q0-rx
 64:        262          0   xen-dyn    -event     device/vif/0-q1-tx
 65:         17          0   xen-dyn    -event     device/vif/0-q1-rx
Fixes f599c64fdf7d ("xen-netfront: Fix race between device setup and open")

Patch applied, thank you.

maintainer
#4 lore raw
In reply to Vitaly Kuznetsov

From: Vitaly Kuznetsov <[email protected]>
Date: Fri, 20 Jul 2018 18:33:59 +0200

Quoted 18 lines

Commit f599c64fdf7d ("xen-netfront: Fix race between device setup and open") changed the initialization order: xennet_create_queues() now happens before we do register_netdev() so using netdev->name in xennet_init_queue() is incorrect, we end up with the following in /proc/interrupts:

 60:        139          0   xen-dyn    -event     eth%d-q0-tx
 61:        265          0   xen-dyn    -event     eth%d-q0-rx
 62:        234          0   xen-dyn    -event     eth%d-q1-tx
 63:          1          0   xen-dyn    -event     eth%d-q1-rx

and this looks ugly. Actually, using early netdev name (even when it's already set) is also not ideal: nowadays we tend to rename eth devices and queue name may end up not corresponding to the netdev name.

Use nodename from xenbus device for queue naming: this can't change in VM's lifetime. Now /proc/interrupts looks like

Quoted 7 lines
 62:        202          0   xen-dyn    -event     device/vif/0-q0-tx
 63:        317          0   xen-dyn    -event     device/vif/0-q0-rx
 64:        262          0   xen-dyn    -event     device/vif/0-q1-tx
 65:         17          0   xen-dyn    -event     device/vif/0-q1-rx
Fixes f599c64fdf7d ("xen-netfront: Fix race between device setup and open")

Patch applied, thank you.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel