* [PATCH net-next] xen-netfront: fix queue name setting
@ 2018-07-20 16:33 Vitaly Kuznetsov
2018-07-20 16:49 ` Ross Lagerwall
2018-07-22 17:27 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Vitaly Kuznetsov @ 2018-07-20 16:33 UTC (permalink / raw)
To: netdev
Cc: xen-devel, linux-kernel, Boris Ostrovsky, Juergen Gross, Ross Lagerwall
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")
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
drivers/net/xen-netfront.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index a57daecf1d57..1b40b648ed5c 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -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;
--
2.14.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] xen-netfront: fix queue name setting
2018-07-20 16:33 [PATCH net-next] xen-netfront: fix queue name setting Vitaly Kuznetsov
@ 2018-07-20 16:49 ` Ross Lagerwall
2018-07-22 17:27 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Ross Lagerwall @ 2018-07-20 16:49 UTC (permalink / raw)
To: Vitaly Kuznetsov, netdev
Cc: xen-devel, linux-kernel, Boris Ostrovsky, Juergen Gross
On 07/20/2018 05:33 PM, Vitaly Kuznetsov wrote:
> 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")
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
> ---
Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] xen-netfront: fix queue name setting
2018-07-20 16:33 [PATCH net-next] xen-netfront: fix queue name setting Vitaly Kuznetsov
2018-07-20 16:49 ` Ross Lagerwall
@ 2018-07-22 17:27 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-07-22 17:27 UTC (permalink / raw)
To: vkuznets
Cc: netdev, xen-devel, linux-kernel, boris.ostrovsky, jgross, ross.lagerwall
From: Vitaly Kuznetsov <vkuznets@redhat.com>
Date: Fri, 20 Jul 2018 18:33:59 +0200
> 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")
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Patch applied, thank you.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-07-22 17:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-20 16:33 [PATCH net-next] xen-netfront: fix queue name setting Vitaly Kuznetsov
2018-07-20 16:49 ` Ross Lagerwall
2018-07-22 17:27 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).