Skip to contentSkip to conversation

Feature control on PV devices

DISCUSSION Joao Martins 4 participants 11 messages Sep 7, 2017 – Sep 19, 2017

lore
Share & tools
lore
#0 lore raw

Hey!

We wanted to brought up this small proposal regarding the lack of parameterization on PV devices on Xen.

Currently users don't have a way for enforce and control what features/queues/etc the backend provides. So far there's only global parameters on backends, and specs do not mention anything in this regard.

The most obvious example is netback/blkback max_queues module parameter where it sets the limit the maximum queues for all devices which is not that flexible. Other examples include controlling offloads visible by the NIC (e.g. disabling checksum offload, disabling scather-gather), others more about I/O path (e.g. disable blkif indirect descriptors, limit number of pages for the ring), or less grant usage by minimizing number of queues/descriptors.

Of course there could be more examples, as this seems to be ortoghonal to the kinds of PV backends we have. And seems like all features appear to be published on the same xenbus state?

The idea to address this would be very simple:

- Toolstack when initializing device paths, writes additional entries in the form of 'request-<feature-name>' = <feature-value>. These entries are only visible by the backend and toolstack;

- Backend reads this entries and uses <feature-value> as the value of <feature-name>, which will then be visible on the frontend.

[ Removal of the 'request-*' xenstore entries could represent a feedback look
that the backend indeed read and used the value. Or else it could simply be ignored. ]

And that's it.

In pratice user would do: E.g.

domain.cfg:
...
name = "guest"
kernel = "bzImage"
vif = ["bridge=br0,queues=2"]
disk = [ "format=raw,vdev=hda,access=rw,backendtype=phy,target=/dev/HostVG/XenGuest2,queues=1,max-ring-page-order=0" ]
...

Toolstack writes:

/local/domain/0/backend/vif/8/0/request-multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/request-multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/request-max-ring-page-order = 0

Backends reads and seeds with (and assuming it passes backend validation ofc):

/local/domain/0/backend/vif/8/0/multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/max-ring-page-order = 0

The XL configuration entry for controlling these tunable are just examples it's not clear the general preference for this. An alternative could be:

vif = ["bridge=br0,features=queues:2\\;max-ring-page-order:0"]

Which lets us have more generic feature control, without sticking to particular features names.

Naturally libvirt could be a consumer of this (as it already has the 'queues' and host 'tso4', 'tso6', etc in their XML schemas)

Thoughts? Do folks think the correct way of handling this?

Cheers,
Joao

[0] https://github.com/qemu/qemu/blob/master/hw/net/virtio-net.c#L2102

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

#1 lore raw

[Forgot two important details regarding Xenbus states]

Quoted 20 lines · Joao Martins

Hey!

We wanted to brought up this small proposal regarding the lack of parameterization on PV devices on Xen.

Currently users don't have a way for enforce and control what features/queues/etc the backend provides. So far there's only global parameters on backends, and specs do not mention anything in this regard.

The most obvious example is netback/blkback max_queues module parameter where it sets the limit the maximum queues for all devices which is not that flexible. Other examples include controlling offloads visible by the NIC (e.g. disabling checksum offload, disabling scather-gather), others more about I/O path (e.g. disable blkif indirect descriptors, limit number of pages for the ring), or less grant usage by minimizing number of queues/descriptors.

Of course there could be more examples, as this seems to be ortoghonal to the kinds of PV backends we have. And seems like all features appear to be published on the same xenbus state?

Quoted 6 lines

The idea to address this would be very simple:

- Toolstack when initializing device paths, writes additional entries in the form of 'request-<feature-name>' = <feature-value>. These entries are only visible by the backend and toolstack;

And after that we switch the device state to XenbusStateInitialising as usual.

Quoted 4 lines

- Backend reads this entries and uses <feature-value> as the value of <feature-name>, which will then be visible on the frontend.

And after that we switch state to XenbusStateInitWait as usual. No changes are involved in xenbus state changes other than reading what the toolstack had written in "request-*" and seed accordingly. Backends without support would simply ignore these new entries.

Quoted 18 lines

[ Removal of the 'request-*' xenstore entries could represent a feedback look
that the backend indeed read and used the value. Or else it could simply be ignored. ]

And that's it.

In pratice user would do: E.g.

domain.cfg:
...
name = "guest"
kernel = "bzImage"
vif = ["bridge=br0,queues=2"]
disk = [ "format=raw,vdev=hda,access=rw,backendtype=phy,target=/dev/HostVG/XenGuest2,queues=1,max-ring-page-order=0" ]
...

Quoted 5 lines

Toolstack writes:

/local/domain/0/backend/vif/8/0/request-multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/request-multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/request-max-ring-page-order = 0

/local/domain/0/backend/vbd/8/51713/state = 1 (XenbusStateInitialising)

Quoted 7 lines

Backends reads and seeds with (and assuming it passes backend validation ofc):

/local/domain/0/backend/vif/8/0/multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/max-ring-page-order = 0

/local/domain/0/backend/vbd/8/51713/state = 2 (XenbusStateInitWait)

Quoted 11 lines

The XL configuration entry for controlling these tunable are just examples it's not clear the general preference for this. An alternative could be:

vif = ["bridge=br0,features=queues:2\\;max-ring-page-order:0"]

Which lets us have more generic feature control, without sticking to particular features names.

Naturally libvirt could be a consumer of this (as it already has the 'queues' and host 'tso4', 'tso6', etc in their XML schemas)

Quoted 7 lines

Thoughts? Do folks think the correct way of handling this?

Cheers,
Joao

[0] https://github.com/qemu/qemu/blob/master/hw/net/virtio-net.c#L2102

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

#2 lore raw

[ Realized that I didn't CC the maintainers,
so doing that now, +Linux folks +PV interfaces czar Sorry for the noise! ]

Quoted 66 lines · Joao Martins

[Forgot two important details regarding Xenbus states]

Quoted 20 lines · Joao Martins

Hey!

We wanted to brought up this small proposal regarding the lack of parameterization on PV devices on Xen.

Currently users don't have a way for enforce and control what features/queues/etc the backend provides. So far there's only global parameters on backends, and specs do not mention anything in this regard.

The most obvious example is netback/blkback max_queues module parameter where it sets the limit the maximum queues for all devices which is not that flexible. Other examples include controlling offloads visible by the NIC (e.g. disabling checksum offload, disabling scather-gather), others more about I/O path (e.g. disable blkif indirect descriptors, limit number of pages for the ring), or less grant usage by minimizing number of queues/descriptors.

Of course there could be more examples, as this seems to be ortoghonal to the kinds of PV backends we have. And seems like all features appear to be published on the same xenbus state?

Quoted 6 lines

The idea to address this would be very simple:

- Toolstack when initializing device paths, writes additional entries in the form of 'request-<feature-name>' = <feature-value>. These entries are only visible by the backend and toolstack;

And after that we switch the device state to XenbusStateInitialising as usual.

Quoted 4 lines

- Backend reads this entries and uses <feature-value> as the value of <feature-name>, which will then be visible on the frontend.

And after that we switch state to XenbusStateInitWait as usual. No changes are involved in xenbus state changes other than reading what the toolstack had written in "request-*" and seed accordingly. Backends without support would simply ignore these new entries.

Quoted 18 lines

[ Removal of the 'request-*' xenstore entries could represent a feedback look
that the backend indeed read and used the value. Or else it could simply be ignored. ]

And that's it.

In pratice user would do: E.g.

domain.cfg:
...
name = "guest"
kernel = "bzImage"
vif = ["bridge=br0,queues=2"]
disk = [ "format=raw,vdev=hda,access=rw,backendtype=phy,target=/dev/HostVG/XenGuest2,queues=1,max-ring-page-order=0" ]
...

Quoted 5 lines

Toolstack writes:

/local/domain/0/backend/vif/8/0/request-multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/request-multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/request-max-ring-page-order = 0

/local/domain/0/backend/vbd/8/51713/state = 1 (XenbusStateInitialising)

Quoted 1 line
Quoted 26 lines
Quoted 6 lines

Backends reads and seeds with (and assuming it passes backend validation ofc):

/local/domain/0/backend/vif/8/0/multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/max-ring-page-order = 0

/local/domain/0/backend/vbd/8/51713/state = 2 (XenbusStateInitWait)

Quoted 18 lines

The XL configuration entry for controlling these tunable are just examples it's not clear the general preference for this. An alternative could be:

vif = ["bridge=br0,features=queues:2\\;max-ring-page-order:0"]

Which lets us have more generic feature control, without sticking to particular features names.

Naturally libvirt could be a consumer of this (as it already has the 'queues' and host 'tso4', 'tso6', etc in their XML schemas)

Thoughts? Do folks think the correct way of handling this?

Cheers,
Joao

[0] https://github.com/qemu/qemu/blob/master/hw/net/virtio-net.c#L2102

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

#3 lore raw
Quoted 4 lines · Joao Martins

[ Realized that I didn't CC the maintainers,
so doing that now, +Linux folks +PV interfaces czar Sorry for the noise! ]

Quoted 11 lines
Quoted 10 lines · Joao Martins

[Forgot two important details regarding Xenbus states]

Quoted 8 lines · Joao Martins

Hey!

We wanted to brought up this small proposal regarding the lack of parameterization on PV devices on Xen.

Currently users don't have a way for enforce and control what features/queues/etc the backend provides. So far there's only global parameters on backends, and specs do not mention anything in this regard.

How would this scale with say FreeBSD backends? And I am assuming you are also thinking about device driver backends - where you can't easily get access to the backend and change the SysFS parameters (if they have it all)?

Quoted 75 lines
Quoted 75 lines
Quoted 12 lines

The most obvious example is netback/blkback max_queues module parameter where it sets the limit the maximum queues for all devices which is not that flexible. Other examples include controlling offloads visible by the NIC (e.g. disabling checksum offload, disabling scather-gather), others more about I/O path (e.g. disable blkif indirect descriptors, limit number of pages for the ring), or less grant usage by minimizing number of queues/descriptors.

Of course there could be more examples, as this seems to be ortoghonal to the kinds of PV backends we have. And seems like all features appear to be published on the same xenbus state?

Quoted 6 lines

The idea to address this would be very simple:

- Toolstack when initializing device paths, writes additional entries in the form of 'request-<feature-name>' = <feature-value>. These entries are only visible by the backend and toolstack;

And after that we switch the device state to XenbusStateInitialising as usual.

Quoted 4 lines

- Backend reads this entries and uses <feature-value> as the value of <feature-name>, which will then be visible on the frontend.

And after that we switch state to XenbusStateInitWait as usual. No changes are involved in xenbus state changes other than reading what the toolstack had written in "request-*" and seed accordingly. Backends without support would simply ignore these new entries.

Quoted 18 lines

[ Removal of the 'request-*' xenstore entries could represent a feedback look
that the backend indeed read and used the value. Or else it could simply be ignored. ]

And that's it.

In pratice user would do: E.g.

domain.cfg:
...
name = "guest"
kernel = "bzImage"
vif = ["bridge=br0,queues=2"]
disk = [ "format=raw,vdev=hda,access=rw,backendtype=phy,target=/dev/HostVG/XenGuest2,queues=1,max-ring-page-order=0" ]
...

Quoted 5 lines

Toolstack writes:

/local/domain/0/backend/vif/8/0/request-multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/request-multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/request-max-ring-page-order = 0

/local/domain/0/backend/vbd/8/51713/state = 1 (XenbusStateInitialising)

Quoted 7 lines

Backends reads and seeds with (and assuming it passes backend validation ofc):

/local/domain/0/backend/vif/8/0/multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/max-ring-page-order = 0

/local/domain/0/backend/vbd/8/51713/state = 2 (XenbusStateInitWait)

Quoted 11 lines

The XL configuration entry for controlling these tunable are just examples it's not clear the general preference for this. An alternative could be:

vif = ["bridge=br0,features=queues:2\\;max-ring-page-order:0"]

Which lets us have more generic feature control, without sticking to particular features names.

Naturally libvirt could be a consumer of this (as it already has the 'queues' and host 'tso4', 'tso6', etc in their XML schemas)

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Thoughts? Do folks think the correct way of handling this?

Cheers,
Joao

[0] https://github.com/qemu/qemu/blob/master/hw/net/virtio-net.c#L2102

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

#4 lore raw
Quoted 10 lines · Konrad Rzeszutek Wilk
Quoted 9 lines · Joao Martins

[ Realized that I didn't CC the maintainers,
so doing that now, +Linux folks +PV interfaces czar Sorry for the noise! ]

Quoted 4 lines · Joao Martins

[Forgot two important details regarding Xenbus states]

Quoted 2 lines · Joao Martins

Hey!

Quoted 9 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

We wanted to brought up this small proposal regarding the lack of parameterization on PV devices on Xen.

Currently users don't have a way for enforce and control what features/queues/etc the backend provides. So far there's only global parameters on backends, and specs do not mention anything in this regard.

How would this scale with say FreeBSD backends?

This is per-device parameter configuration support, based on xenstore entries. All backend needs to understand is that the request/XXX xenstore entries and superseed whatever global defaults were defined by backend (after validation). So what I am proposing here makes no OS assumptions and should work for FreeBSD or any other.

Quoted 5 lines

And I am assuming you are
also thinking about device driver backends - where you can't easily get access to the backend and change the SysFS parameters (if they have it all)?

Yeah - Provided that the xenstore entries will be created with permissions for toolstack domain and the backend domain then backends other than Dom0 should work too. Note that this is device setup (e.g. domain create time), i.e. the configuration of what the frontend is allowed to see/use.

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

#5 lore raw
In reply to Joao Martins
Quoted 37 lines · Joao Martins

Hey!

We wanted to brought up this small proposal regarding the lack of parameterization on PV devices on Xen.

Currently users don't have a way for enforce and control what features/queues/etc the backend provides. So far there's only global parameters on backends, and specs do not mention anything in this regard.

The most obvious example is netback/blkback max_queues module parameter where it sets the limit the maximum queues for all devices which is not that flexible. Other examples include controlling offloads visible by the NIC (e.g. disabling checksum offload, disabling scather-gather), others more about I/O path (e.g. disable blkif indirect descriptors, limit number of pages for the ring), or less grant usage by minimizing number of queues/descriptors.

Of course there could be more examples, as this seems to be ortoghonal to the kinds of PV backends we have. And seems like all features appear to be published on the same xenbus state?

The idea to address this would be very simple:

- Toolstack when initializing device paths, writes additional entries in the form of 'request-<feature-name>' = <feature-value>. These entries are only visible by the backend and toolstack;

- Backend reads this entries and uses <feature-value> as the value of <feature-name>, which will then be visible on the frontend.

[ Removal of the 'request-*' xenstore entries could represent a feedback look
that the backend indeed read and used the value. Or else it could simply be ignored. ]

And that's it.

In pratice user would do: E.g.

Quoted 7 lines

domain.cfg:
...
name = "guest"
kernel = "bzImage"
vif = ["bridge=br0,queues=2"]
disk = [ "format=raw,vdev=hda,access=rw,backendtype=phy,target=/dev/HostVG/XenGuest2,queues=1,max-ring-page-order=0"

There needs to be a way to distinguish parameters consumed by toolstack vs the ones passed on to backends. The parameters passed to backends should start with a predefined prefix.

Quoted 20 lines

]
...

Toolstack writes:

/local/domain/0/backend/vif/8/0/request-multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/request-multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/request-max-ring-page-order = 0

Backends reads and seeds with (and assuming it passes backend validation ofc):

/local/domain/0/backend/vif/8/0/multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/max-ring-page-order = 0

The XL configuration entry for controlling these tunable are just examples it's not clear the general preference for this. An alternative could be:

vif = ["bridge=br0,features=queues:2\\;max-ring-page-order:0"]

Quoted 8 lines

Which lets us have more generic feature control, without sticking to particular features names.

Naturally libvirt could be a consumer of this (as it already has the 'queues' and host 'tso4', 'tso6', etc in their XML schemas)

Thoughts? Do folks think the correct way of handling this?

I think having a way to control backend features in xl/libxl is a good thing.

Quoted 9 lines

Cheers,
Joao

[0] https://github.com/qemu/qemu/blob/master/hw/net/virtio-net.c#L2102

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

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

#6 lore raw
Quoted 46 lines · Wei Liu
Quoted 37 lines · Joao Martins

Hey!

We wanted to brought up this small proposal regarding the lack of parameterization on PV devices on Xen.

Currently users don't have a way for enforce and control what features/queues/etc the backend provides. So far there's only global parameters on backends, and specs do not mention anything in this regard.

The most obvious example is netback/blkback max_queues module parameter where it sets the limit the maximum queues for all devices which is not that flexible. Other examples include controlling offloads visible by the NIC (e.g. disabling checksum offload, disabling scather-gather), others more about I/O path (e.g. disable blkif indirect descriptors, limit number of pages for the ring), or less grant usage by minimizing number of queues/descriptors.

Of course there could be more examples, as this seems to be ortoghonal to the kinds of PV backends we have. And seems like all features appear to be published on the same xenbus state?

The idea to address this would be very simple:

- Toolstack when initializing device paths, writes additional entries in the form of 'request-<feature-name>' = <feature-value>. These entries are only visible by the backend and toolstack;

- Backend reads this entries and uses <feature-value> as the value of <feature-name>, which will then be visible on the frontend.

[ Removal of the 'request-*' xenstore entries could represent a feedback look
that the backend indeed read and used the value. Or else it could simply be ignored. ]

And that's it.

In pratice user would do: E.g.

Quoted 7 lines

domain.cfg:
...
name = "guest"
kernel = "bzImage"
vif = ["bridge=br0,queues=2"]
disk = [ "format=raw,vdev=hda,access=rw,backendtype=phy,target=/dev/HostVG/XenGuest2,queues=1,max-ring-page-order=0"

Quoted 4 lines

There needs to be a way to distinguish parameters consumed by toolstack vs the ones passed on to backends. The parameters passed to backends should start with a predefined prefix.

Hmm, which seems to be inline with the "request" prefix when controlling certain features enabled/disabled? Oh wait, perhaps you mean wrt to the UI/config-format rather than xenstore entries and such? If it's the latter, see below,

Quoted 15 lines
Quoted 15 lines

]
...

Toolstack writes:

/local/domain/0/backend/vif/8/0/request-multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/request-multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/request-max-ring-page-order = 0

Backends reads and seeds with (and assuming it passes backend validation ofc):

/local/domain/0/backend/vif/8/0/multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/max-ring-page-order = 0

Quoted 8 lines
Quoted 8 lines

The XL configuration entry for controlling these tunable are just examples it's not clear the general preference for this. An alternative could be:

vif = ["bridge=br0,features=queues:2\\;max-ring-page-order:0"]

Which lets us have more generic feature control, without sticking to particular features names.

In case the above was about config format, this one suggested above sounds more general, and easy to reuse across backends. Maybe instead of "features", could be "backend_features" since, most PV backends declare a "backend" and a "backend_id" as per libxl IDL.

Quoted 8 lines
Quoted 5 lines

Naturally libvirt could be a consumer of this (as it already has the 'queues' and host 'tso4', 'tso6', etc in their XML schemas)

Thoughts? Do folks think the correct way of handling this?

I think having a way to control backend features in xl/libxl is a good thing.

Thanks!

Quoted 5 lines
Quoted 5 lines

Cheers,
Joao

[0] https://github.com/qemu/qemu/blob/master/hw/net/virtio-net.c#L2102

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

#7 lore raw
Quoted 47 lines · Joao Martins
Quoted 46 lines · Wei Liu
Quoted 44 lines · Joao Martins

Hey!

We wanted to brought up this small proposal regarding the lack of parameterization on PV devices on Xen.

Currently users don't have a way for enforce and control what features/queues/etc the backend provides. So far there's only global parameters on backends, and specs do not mention anything in this regard.

The most obvious example is netback/blkback max_queues module parameter where it sets the limit the maximum queues for all devices which is not that flexible. Other examples include controlling offloads visible by the NIC (e.g. disabling checksum offload, disabling scather-gather), others more about I/O path (e.g. disable blkif indirect descriptors, limit number of pages for the ring), or less grant usage by minimizing number of queues/descriptors.

Of course there could be more examples, as this seems to be ortoghonal to the kinds of PV backends we have. And seems like all features appear to be published on the same xenbus state?

The idea to address this would be very simple:

- Toolstack when initializing device paths, writes additional entries in the form of 'request-<feature-name>' = <feature-value>. These entries are only visible by the backend and toolstack;

- Backend reads this entries and uses <feature-value> as the value of <feature-name>, which will then be visible on the frontend.

[ Removal of the 'request-*' xenstore entries could represent a feedback look
that the backend indeed read and used the value. Or else it could simply be ignored. ]

And that's it.

In pratice user would do: E.g.

domain.cfg:
...
name = "guest"
kernel = "bzImage"
vif = ["bridge=br0,queues=2"]
disk = [ "format=raw,vdev=hda,access=rw,backendtype=phy,target=/dev/HostVG/XenGuest2,queues=1,max-ring-page-order=0"

Quoted 7 lines
Quoted 4 lines

There needs to be a way to distinguish parameters consumed by toolstack vs the ones passed on to backends. The parameters passed to backends should start with a predefined prefix.

Hmm, which seems to be inline with the "request" prefix when controlling certain features enabled/disabled? Oh wait, perhaps you mean wrt to the UI/config-format rather than xenstore entries and such? If it's the latter, see below,

I was thinking about xl config syntax.

Quoted 21 lines
Quoted 21 lines
Quoted 21 lines

]
...

Toolstack writes:

/local/domain/0/backend/vif/8/0/request-multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/request-multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/request-max-ring-page-order = 0

Backends reads and seeds with (and assuming it passes backend validation ofc):

/local/domain/0/backend/vif/8/0/multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/max-ring-page-order = 0

The XL configuration entry for controlling these tunable are just examples it's not clear the general preference for this. An alternative could be:

vif = ["bridge=br0,features=queues:2\\;max-ring-page-order:0"]

Quoted 9 lines
Quoted 3 lines
Quoted 3 lines

Which lets us have more generic feature control, without sticking to particular features names.

In case the above was about config format, this one suggested above sounds more general, and easy to reuse across backends. Maybe instead of "features", could be "backend_features" since, most PV backends declare a "backend" and a "backend_id" as per libxl IDL.

The proposed syntax looks a bit difficult to parse.

What's wrong with request-XXX=YYY syntax? We can have many of those as we like. Xl just picks those and concatenate them into backend_features.

Assuming we just dump things into backend_features, once the syntax is determined, we can only extend it but not change it because we need to maintain backward-compatibility in both xl and libxl.

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

#8 lore raw
Quoted 52 lines · Wei Liu
Quoted 51 lines · Joao Martins
Quoted 50 lines · Wei Liu
Quoted 37 lines · Joao Martins

Hey!

We wanted to brought up this small proposal regarding the lack of parameterization on PV devices on Xen.

Currently users don't have a way for enforce and control what features/queues/etc the backend provides. So far there's only global parameters on backends, and specs do not mention anything in this regard.

The most obvious example is netback/blkback max_queues module parameter where it sets the limit the maximum queues for all devices which is not that flexible. Other examples include controlling offloads visible by the NIC (e.g. disabling checksum offload, disabling scather-gather), others more about I/O path (e.g. disable blkif indirect descriptors, limit number of pages for the ring), or less grant usage by minimizing number of queues/descriptors.

Of course there could be more examples, as this seems to be ortoghonal to the kinds of PV backends we have. And seems like all features appear to be published on the same xenbus state?

The idea to address this would be very simple:

- Toolstack when initializing device paths, writes additional entries in the form of 'request-<feature-name>' = <feature-value>. These entries are only visible by the backend and toolstack;

- Backend reads this entries and uses <feature-value> as the value of <feature-name>, which will then be visible on the frontend.

[ Removal of the 'request-*' xenstore entries could represent a feedback look
that the backend indeed read and used the value. Or else it could simply be ignored. ]

And that's it.

In pratice user would do: E.g.

Quoted 7 lines

domain.cfg:
...
name = "guest"
kernel = "bzImage"
vif = ["bridge=br0,queues=2"]
disk = [ "format=raw,vdev=hda,access=rw,backendtype=phy,target=/dev/HostVG/XenGuest2,queues=1,max-ring-page-order=0"

There needs to be a way to distinguish parameters consumed by toolstack vs the ones passed on to backends. The parameters passed to backends should start with a predefined prefix.

Quoted 15 lines
Quoted 3 lines

Hmm, which seems to be inline with the "request" prefix when controlling certain features enabled/disabled? Oh wait, perhaps you mean wrt to the UI/config-format rather than xenstore entries and such? If it's the latter, see below,

I was thinking about xl config syntax.

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

]
...

Toolstack writes:

/local/domain/0/backend/vif/8/0/request-multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/request-multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/request-max-ring-page-order = 0

I'd rather use a specific directory, e.g.:

/local/domain/0/backend/vif/8/0/request/multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/request/multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/request/max-ring-page-order = 0

This will enable the backend to just look for all entries in .../request/ instead of having to try all possible features.

Quoted 22 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines

Backends reads and seeds with (and assuming it passes backend validation ofc):

/local/domain/0/backend/vif/8/0/multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/max-ring-page-order = 0

The XL configuration entry for controlling these tunable are just examples it's not clear the general preference for this. An alternative could be:

vif = ["bridge=br0,features=queues:2\\;max-ring-page-order:0"]

Quoted 9 lines
Quoted 3 lines
Quoted 3 lines

Which lets us have more generic feature control, without sticking to particular features names.

In case the above was about config format, this one suggested above sounds more general, and easy to reuse across backends. Maybe instead of "features", could be "backend_features" since, most PV backends declare a "backend" and a "backend_id" as per libxl IDL.

Quoted 4 lines

The proposed syntax looks a bit difficult to parse.

What's wrong with request-XXX=YYY syntax? We can have many of those as we like. Xl just picks those and concatenate them into backend_features.

Is it possible to parse those without having to know about individual XXX values? Otherwise we'd be able to support only features known by xl instead of those known by the various backends.

Juergen

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

#9 lore raw
Quoted 22 lines · Juergen Gross
Quoted 22 lines
Quoted 21 lines
Quoted 7 lines
Quoted 7 lines

Backends reads and seeds with (and assuming it passes backend validation ofc):

/local/domain/0/backend/vif/8/0/multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/max-ring-page-order = 0

Quoted 8 lines
Quoted 8 lines

The XL configuration entry for controlling these tunable are just examples it's not clear the general preference for this. An alternative could be:

vif = ["bridge=br0,features=queues:2\\;max-ring-page-order:0"]

Which lets us have more generic feature control, without sticking to particular features names.

In case the above was about config format, this one suggested above sounds more general, and easy to reuse across backends. Maybe instead of "features", could be "backend_features" since, most PV backends declare a "backend" and a "backend_id" as per libxl IDL.

Quoted 9 lines
Quoted 4 lines

The proposed syntax looks a bit difficult to parse.

What's wrong with request-XXX=YYY syntax? We can have many of those as we like. Xl just picks those and concatenate them into backend_features.

Is it possible to parse those without having to know about individual XXX values? Otherwise we'd be able to support only features known by xl instead of those known by the various backends.

Xl sees a list of key-value pairs. If the key of a pair starts with the predefined prefix, xl (eventually) passes the pair on to backend. I don't think knowing individual XXX value is needed or desired.

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

#10 lore raw
In reply to Juergen Gross
Quoted 69 lines · Juergen Gross
Quoted 52 lines · Wei Liu
Quoted 51 lines · Joao Martins
Quoted 50 lines · Wei Liu
Quoted 37 lines · Joao Martins

Hey!

We wanted to brought up this small proposal regarding the lack of parameterization on PV devices on Xen.

Currently users don't have a way for enforce and control what features/queues/etc the backend provides. So far there's only global parameters on backends, and specs do not mention anything in this regard.

The most obvious example is netback/blkback max_queues module parameter where it sets the limit the maximum queues for all devices which is not that flexible. Other examples include controlling offloads visible by the NIC (e.g. disabling checksum offload, disabling scather-gather), others more about I/O path (e.g. disable blkif indirect descriptors, limit number of pages for the ring), or less grant usage by minimizing number of queues/descriptors.

Of course there could be more examples, as this seems to be ortoghonal to the kinds of PV backends we have. And seems like all features appear to be published on the same xenbus state?

The idea to address this would be very simple:

- Toolstack when initializing device paths, writes additional entries in the form of 'request-<feature-name>' = <feature-value>. These entries are only visible by the backend and toolstack;

- Backend reads this entries and uses <feature-value> as the value of <feature-name>, which will then be visible on the frontend.

[ Removal of the 'request-*' xenstore entries could represent a feedback look
that the backend indeed read and used the value. Or else it could simply be ignored. ]

And that's it.

In pratice user would do: E.g.

Quoted 7 lines

domain.cfg:
...
name = "guest"
kernel = "bzImage"
vif = ["bridge=br0,queues=2"]
disk = [ "format=raw,vdev=hda,access=rw,backendtype=phy,target=/dev/HostVG/XenGuest2,queues=1,max-ring-page-order=0"

There needs to be a way to distinguish parameters consumed by toolstack vs the ones passed on to backends. The parameters passed to backends should start with a predefined prefix.

Quoted 15 lines
Quoted 3 lines

Hmm, which seems to be inline with the "request" prefix when controlling certain features enabled/disabled? Oh wait, perhaps you mean wrt to the UI/config-format rather than xenstore entries and such? If it's the latter, see below,

I was thinking about xl config syntax.

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

]
...

Toolstack writes:

/local/domain/0/backend/vif/8/0/request-multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/request-multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/request-max-ring-page-order = 0

Quoted 9 lines

I'd rather use a specific directory, e.g.:

/local/domain/0/backend/vif/8/0/request/multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/request/multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/request/max-ring-page-order = 0

This will enable the backend to just look for all entries in .../request/ instead of having to try all possible features.

Yeap, sounds better and cleaner indeed.

And backend can simply remove the whole directory when it's done consuming the parameters as a signal to the toolstack? Or maybe it might be enough to simply detect that request/XXX and XXX xenstores entries have the same value.

Quoted 21 lines
Quoted 21 lines
Quoted 20 lines
Quoted 6 lines
Quoted 6 lines

Backends reads and seeds with (and assuming it passes backend validation ofc):

/local/domain/0/backend/vif/8/0/multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/multi-queue-max-queues = 2 /local/domain/0/backend/vbd/8/51713/max-ring-page-order = 0

Quoted 8 lines
Quoted 8 lines

The XL configuration entry for controlling these tunable are just examples it's not clear the general preference for this. An alternative could be:

vif = ["bridge=br0,features=queues:2\\;max-ring-page-order:0"]

Which lets us have more generic feature control, without sticking to particular features names.

In case the above was about config format, this one suggested above sounds more general, and easy to reuse across backends. Maybe instead of "features", could be "backend_features" since, most PV backends declare a "backend" and a "backend_id" as per libxl IDL.

Quoted 5 lines
Quoted 4 lines

The proposed syntax looks a bit difficult to parse.

What's wrong with request-XXX=YYY syntax? We can have many of those as we like. Xl just picks those and concatenate them into backend_features.

No problem at all assuming the backend_features on IDL is a list of XXX=YYY - I suggested the above syntax simply as a start given how 'target' is put together for disks with backendtype=qemu (e.g. rbd parameters). But yours it's much better from user perspective.

Thinking if there was a problem with emulated NICs, but I suppose the same request-XXX=YYY could be used to toggle the emulated device offloadings (e.g. for virtio we would use require-guest_ecn=0). But it's probably a bit early to worry about that. libxl "backend_features" is generic enough to accomodate this.

Quoted 3 lines

Is it possible to parse those without having to know about individual XXX values? Otherwise we'd be able to support only features known by xl instead of those known by the various backends.

/nods

I too would keep this stateless from toolstack perspective.

Joao

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