* [BUG] libxenstore and xentop confused by renamed VIF interfaces
@ 2014-05-21 7:52 Jacek Konieczny
2014-05-21 8:15 ` [BUG] libxenstat " Jacek Konieczny
2014-05-21 10:29 ` [BUG] libxenstore " Ian Campbell
0 siblings, 2 replies; 8+ messages in thread
From: Jacek Konieczny @ 2014-05-21 7:52 UTC (permalink / raw)
To: xen-devel; +Cc: Mariusz Mazur
Hi,
I have noticed a strange behaviour on 'xl top' – it would show no
network statistics for some of my domU. It turned out that 'xl top'
shows no network ('NETS', 'NETTX(k)', 'NETRX(k)' all '0') when the
domU VIF has been renamed by using the 'vifname' option in its xl.cfg
file.
The 'vifname' option is very useful to have predictable interface names
for firewall configuration or network monitoring. The problem is
libxenstore under Linux parses /proc/net/dev to extract 'vif.${domid}.*'
interfaces, which won't be there, when the interfaces have been renamed.
I think the solution would be to look-up the actual interface name or
index in sysfs, e.g. under /sys/devices/vif-${domind}-*.
Greets,
Jacek
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [BUG] libxenstat and xentop confused by renamed VIF interfaces
2014-05-21 7:52 [BUG] libxenstore and xentop confused by renamed VIF interfaces Jacek Konieczny
@ 2014-05-21 8:15 ` Jacek Konieczny
2014-05-21 10:29 ` [BUG] libxenstore " Ian Campbell
1 sibling, 0 replies; 8+ messages in thread
From: Jacek Konieczny @ 2014-05-21 8:15 UTC (permalink / raw)
To: xen-devel
On 05/21/14 09:52, Jacek Konieczny wrote:
> The 'vifname' option is very useful to have predictable interface names
> for firewall configuration or network monitoring. The problem is
> libxenstore under Linux parses /proc/net/dev to extract 'vif.${domid}.*'
I mean _libxenstat_, of course.
Xen 4.4.0.
Greets,
Jacek
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [BUG] libxenstore and xentop confused by renamed VIF interfaces
2014-05-21 7:52 [BUG] libxenstore and xentop confused by renamed VIF interfaces Jacek Konieczny
2014-05-21 8:15 ` [BUG] libxenstat " Jacek Konieczny
@ 2014-05-21 10:29 ` Ian Campbell
2014-05-21 10:48 ` [BUG] libxenstat " Jacek Konieczny
2014-05-21 11:35 ` Jacek Konieczny
1 sibling, 2 replies; 8+ messages in thread
From: Ian Campbell @ 2014-05-21 10:29 UTC (permalink / raw)
To: Jacek Konieczny; +Cc: Mariusz Mazur, xen-devel
On Wed, 2014-05-21 at 09:52 +0200, Jacek Konieczny wrote:
> Hi,
>
> I have noticed a strange behaviour on 'xl top' – it would show no
> network statistics for some of my domU. It turned out that 'xl top'
> shows no network ('NETS', 'NETTX(k)', 'NETRX(k)' all '0') when the
> domU VIF has been renamed by using the 'vifname' option in its xl.cfg
> file.
>
> The 'vifname' option is very useful to have predictable interface names
> for firewall configuration or network monitoring. The problem is
> libxenstore under Linux parses /proc/net/dev to extract 'vif.${domid}.*'
> interfaces, which won't be there, when the interfaces have been renamed.
I suppose it is trying to exclude non-vif network devices (xenbr0, eth0
etc).
> I think the solution would be to look-up the actual interface name or
> index in sysfs, e.g. under /sys/devices/vif-${domind}-*.
Sounds plausible.
Or perhaps check that /sys/class/net/${dev}/device/devtype contains
"vif"? Might want to handle tap devices too. Perhaps parse the content
of /sys/class/net/vif1.0/device/nodename to get the domid and devid?
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [BUG] libxenstat and xentop confused by renamed VIF interfaces
2014-05-21 10:29 ` [BUG] libxenstore " Ian Campbell
@ 2014-05-21 10:48 ` Jacek Konieczny
2014-05-21 10:53 ` Ian Campbell
2014-05-21 11:35 ` Jacek Konieczny
1 sibling, 1 reply; 8+ messages in thread
From: Jacek Konieczny @ 2014-05-21 10:48 UTC (permalink / raw)
To: Ian Campbell; +Cc: Mariusz Mazur, xen-devel
On 05/21/14 12:29, Ian Campbell wrote:
> On Wed, 2014-05-21 at 09:52 +0200, Jacek Konieczny wrote:
> libxenstore under Linux parses /proc/net/dev to extract 'vif.${domid}.*'
> interfaces, which won't be there, when the interfaces have been renamed.
> I suppose it is trying to exclude non-vif network devices (xenbr0, eth0
> etc).
That is one reason. The more important reason is to match interface with
a domid. Also, the /proc/net/dev file is the source of the interface
usage statistics collected by libxenstat.
>> I think the solution would be to look-up the actual interface name or
>> index in sysfs, e.g. under /sys/devices/vif-${domind}-*.
>
> Sounds plausible.
>
> Or perhaps check that /sys/class/net/${dev}/device/devtype contains
> "vif"? Might want to handle tap devices too. Perhaps parse the content
> of /sys/class/net/vif1.0/device/nodename to get the domid and devid?
Yes, that could work and would probably require less changes in the
code – this can be done while iterating /proc/net/dev.
Another approach would be to use the data from the xenstore, but I guess
that would be more expensive.
Greets,
Jacek
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [BUG] libxenstat and xentop confused by renamed VIF interfaces
2014-05-21 10:48 ` [BUG] libxenstat " Jacek Konieczny
@ 2014-05-21 10:53 ` Ian Campbell
0 siblings, 0 replies; 8+ messages in thread
From: Ian Campbell @ 2014-05-21 10:53 UTC (permalink / raw)
To: Jacek Konieczny; +Cc: Mariusz Mazur, xen-devel
On Wed, 2014-05-21 at 12:48 +0200, Jacek Konieczny wrote:
> On 05/21/14 12:29, Ian Campbell wrote:
> > On Wed, 2014-05-21 at 09:52 +0200, Jacek Konieczny wrote:
> > libxenstore under Linux parses /proc/net/dev to extract 'vif.${domid}.*'
> > interfaces, which won't be there, when the interfaces have been renamed.
> > I suppose it is trying to exclude non-vif network devices (xenbr0, eth0
> > etc).
>
> That is one reason. The more important reason is to match interface with
> a domid.
Yes, I figured that out later ;-)
> Also, the /proc/net/dev file is the source of the interface
> usage statistics collected by libxenstat.
>
> >> I think the solution would be to look-up the actual interface name or
> >> index in sysfs, e.g. under /sys/devices/vif-${domind}-*.
> >
> > Sounds plausible.
> >
> > Or perhaps check that /sys/class/net/${dev}/device/devtype contains
> > "vif"? Might want to handle tap devices too. Perhaps parse the content
> > of /sys/class/net/vif1.0/device/nodename to get the domid and devid?
>
> Yes, that could work and would probably require less changes in the
> code – this can be done while iterating /proc/net/dev.
>
> Another approach would be to use the data from the xenstore, but I guess
> that would be more expensive.
Yes, and I don't think all the stats are in xenstore anyway.
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [BUG] libxenstat and xentop confused by renamed VIF interfaces
2014-05-21 10:29 ` [BUG] libxenstore " Ian Campbell
2014-05-21 10:48 ` [BUG] libxenstat " Jacek Konieczny
@ 2014-05-21 11:35 ` Jacek Konieczny
2014-05-21 11:52 ` Ian Campbell
1 sibling, 1 reply; 8+ messages in thread
From: Jacek Konieczny @ 2014-05-21 11:35 UTC (permalink / raw)
To: Ian Campbell; +Cc: Mariusz Mazur, xen-devel
On 05/21/14 12:29, Ian Campbell wrote:
> On Wed, 2014-05-21 at 09:52 +0200, Jacek Konieczny wrote:
>> I think the solution would be to look-up the actual interface name or
>> index in sysfs, e.g. under /sys/devices/vif-${domind}-*.
>
> Sounds plausible.
>
> Or perhaps check that /sys/class/net/${dev}/device/devtype contains
> "vif"? Might want to handle tap devices too.
I am not sure we could easily map a renamed tap (can they be renamed?)
device to a domid.
> Perhaps parse the content of /sys/class/net/vif1.0/device/nodename to
> get the domid and devid?
I think I could prepare the patch.
One question: can I assume /sys is always mounted and the
'/sys/.../device/nodename', contains 'backend/vif/$domid/*' or should
there be a fall-back to the old behaviour?
BTW, when 'device/nodename' exists and contains 'backend/vif/*' we don't
need to check 'device/devtype' – one file access less.
Jacek
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [BUG] libxenstat and xentop confused by renamed VIF interfaces
2014-05-21 11:35 ` Jacek Konieczny
@ 2014-05-21 11:52 ` Ian Campbell
2014-05-21 14:01 ` Jan Beulich
0 siblings, 1 reply; 8+ messages in thread
From: Ian Campbell @ 2014-05-21 11:52 UTC (permalink / raw)
To: Jacek Konieczny, Jan Beulich; +Cc: Ian Jackson, Mariusz Mazur, xen-devel
On Wed, 2014-05-21 at 13:35 +0200, Jacek Konieczny wrote:
> On 05/21/14 12:29, Ian Campbell wrote:
> > On Wed, 2014-05-21 at 09:52 +0200, Jacek Konieczny wrote:
> >> I think the solution would be to look-up the actual interface name or
> >> index in sysfs, e.g. under /sys/devices/vif-${domind}-*.
> >
> > Sounds plausible.
> >
> > Or perhaps check that /sys/class/net/${dev}/device/devtype contains
> > "vif"? Might want to handle tap devices too.
>
> I am not sure we could easily map a renamed tap (can they be renamed?)
I think so, to ${vifname}-emu IIRC.
> device to a domid.
True.
> > Perhaps parse the content of /sys/class/net/vif1.0/device/nodename to
> > get the domid and devid?
>
> I think I could prepare the patch.
Thank you!
> One question: can I assume /sys is always mounted and the
> '/sys/.../device/nodename', contains 'backend/vif/$domid/*' or should
> there be a fall-back to the old behaviour?
I think on Linux we can assume these days that /sys must exist. I'm less
sure about the content of nodename, in particular WRT the behaviour of
the classic-Xen forward ports. (Jan, CCd, might know).
I'd be inclined to keep the existing code as a fallback for now, I
think.
> BTW, when 'device/nodename' exists and contains 'backend/vif/*' we don't
> need to check 'device/devtype' – one file access less.
Ack.
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [BUG] libxenstat and xentop confused by renamed VIF interfaces
2014-05-21 11:52 ` Ian Campbell
@ 2014-05-21 14:01 ` Jan Beulich
0 siblings, 0 replies; 8+ messages in thread
From: Jan Beulich @ 2014-05-21 14:01 UTC (permalink / raw)
To: Ian Campbell, Jacek Konieczny; +Cc: IanJackson, Mariusz Mazur, xen-devel
>>> On 21.05.14 at 13:52, <Ian.Campbell@citrix.com> wrote:
> On Wed, 2014-05-21 at 13:35 +0200, Jacek Konieczny wrote:
>> One question: can I assume /sys is always mounted and the
>> '/sys/.../device/nodename', contains 'backend/vif/$domid/*' or should
>> there be a fall-back to the old behaviour?
>
> I think on Linux we can assume these days that /sys must exist. I'm less
> sure about the content of nodename, in particular WRT the behaviour of
> the classic-Xen forward ports. (Jan, CCd, might know).
>
> I'd be inclined to keep the existing code as a fallback for now, I
> think.
I agree - an eventual change in sysfs layout would need hunting
down between 2.6.18 and 3.15; not something I would do without
a very good reason. And I can't tell without doing so...
Jan
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-05-21 14:01 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-21 7:52 [BUG] libxenstore and xentop confused by renamed VIF interfaces Jacek Konieczny
2014-05-21 8:15 ` [BUG] libxenstat " Jacek Konieczny
2014-05-21 10:29 ` [BUG] libxenstore " Ian Campbell
2014-05-21 10:48 ` [BUG] libxenstat " Jacek Konieczny
2014-05-21 10:53 ` Ian Campbell
2014-05-21 11:35 ` Jacek Konieczny
2014-05-21 11:52 ` Ian Campbell
2014-05-21 14:01 ` Jan Beulich
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).