Skip to content

dra: attributes: compatibility with dra-driver-sriov#65

Closed
ffromani wants to merge 1 commit intokubernetes-sigs:mainfrom
ffromani:dra-sriov-compat
Closed

dra: attributes: compatibility with dra-driver-sriov#65
ffromani wants to merge 1 commit intokubernetes-sigs:mainfrom
ffromani:dra-sriov-compat

Conversation

@ffromani
Copy link
Copy Markdown
Contributor

Add compatibility with dra-driver-sriov to enable NUMA alignment. Reviewing https://github.com/k8snetworkplumbingwg/dra-driver-sriov/blob/main/pkg/consts/consts.go this seems the only attribute which makes sense to expose.

Add compatibility with dra-driver-sriov to enable NUMA alignment.
Reviewing https://github.com/k8snetworkplumbingwg/dra-driver-sriov/blob/main/pkg/consts/consts.go
this seems the only attribute which makes sense to expose.

Signed-off-by: Francesco Romani <fromani@redhat.com>
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ffromani

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 19, 2026
@ffromani
Copy link
Copy Markdown
Contributor Author

/cc @pravk03

not urgent but this is a one-liner (actually a two-liner!) that I think we should add in 0.1.0.

@k8s-ci-robot k8s-ci-robot requested a review from pravk03 February 19, 2026 14:08
@ffromani
Copy link
Copy Markdown
Contributor Author

more discussion about the attribute compatibility situation is in #66 (this PR does NOT depend on #66 but if we merge this #66 would need a trivial update)

@pravk03
Copy link
Copy Markdown
Contributor

pravk03 commented Feb 20, 2026

Thanks. The change looks good, but this previous discussion highlighted some concerns with exposing NUMA as a standard attribute. An alternative would be to use list attributes and align based on PCIE root complex after kubernetes/enhancements#5491 is implemented, but that might take some time.

Given that the SRIOV driver already exposes this attribute, it seems reasonable to include the same attribute here as a temporary solution (similar to the DRANet attribute). Maybe we should also re-initiate the discussion on standardizing NUMA and socket attributes for the long term?

/lgtm
/hold
(Please feel free to remove the /hold whenever you think it is reasonable, since you are also working on #66 )

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 20, 2026
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 20, 2026
@ffromani
Copy link
Copy Markdown
Contributor Author

Thanks. The change looks good, but this previous discussion highlighted some concerns with exposing NUMA as a standard attribute. An alternative would be to use list attributes and align based on PCIE root complex after kubernetes/enhancements#5491 is implemented, but that might take some time.

Given that the SRIOV driver already exposes this attribute, it seems reasonable to include the same attribute here as a temporary solution (similar to the DRANet attribute). Maybe we should also re-initiate the discussion on standardizing NUMA and socket attributes for the long term?

/lgtm /hold (Please feel free to remove the /hold whenever you think it is reasonable, since you are also working on #66 )

I share your concerns. And I raised the point about attributes in the last wg-device-management meeting.
I'm not sure we will converge sooner with the numa/socket conversation, but I'm more than happy to partecipate to the conversation.
The simplicity of this PR is a double edged sword. Yes, it's a one liner, but adding this temporary attribute is misleading because it uses the standard device attribute prefix, but this attribute is not standard (or even uncontroversial) by any mean.
The risk is to increment the momentum on something the community has not figured out yet. Once we have enough users, reverting the change will be harder. We're not there yet, but we are pretty clearly trending that direction.

I think is worth exploring if and how we can expose the pcieRoot attribute instead. It's worth exploring if we can somehow bind core groups to this physical property in a safe manner, and I think it's worth sketching out this approach before to move forward with this PR,.

@ffromani
Copy link
Copy Markdown
Contributor Author

Exploring sysfs a bit, I think there could be a good way to group cpu cores by pcieRoot affinity. This will call for a new groupBy mode, and this will allow us to expose the standard pcieRoot attribute avoiding the complexity entirely. I'll explore this option next week and hopefully push a PR.
I don't think we need to include this in 0.1.0, worst case we can cut a 0.1.1 with only this addition. Let's see how it goes.

Comment thread pkg/driver/dra_hooks.go
// TODO(pravk03): Remove. Hack to align with NIC (DRANet). We need some standard attribute to align other resources with CPU.
"dra.net/numaNode": {IntValue: &numaID},
// dra-driver-sriov (https://github.com/k8snetworkplumbingwg/dra-driver-sriov) compatibility
deviceattribute.StandardDeviceAttributePrefix + "numaNode": {IntValue: &numaID},
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A big 👎 on this. A driver should never use the reserved namespace for attributes that haven't been defined by Kubernetes.

At this point, numaNode is something that has to live inside a driver's own namespace.

@ffromani
Copy link
Copy Markdown
Contributor Author

thanks @pohly , the feedback is clear. Compatibility needs to be achieved using a different mean, and (ab)using the kubernetes namespace for extra attributes is a bad practice we should try to rectify rather than follow. I think there's a promising avenue to reach compatibility for the CPU (and memory) using the pcieRoot attribute, we will pursue in a upcoming PR.

@ffromani ffromani closed this Feb 23, 2026
@ffromani ffromani deleted the dra-sriov-compat branch February 23, 2026 06:57
SchSeba added a commit to SchSeba/dra-driver-sriov that referenced this pull request Feb 23, 2026
Drivers should not use the reserved Kubernetes namespace
(resource.kubernetes.io/) for attributes that have not been
officially defined by Kubernetes. The numaNode attribute was
never standardized and using it under the standard prefix is
a bad practice that could create compatibility issues as more
drivers adopt it without upstream consensus.

This commit removes the numaNode attribute entirely from:
- Device attributes exposed on SR-IOV VFs
- SriovResourceFilter CRD (numaNodes filter field)
- Resource filter controller logic
- Host interface (GetNumaNode)
- All examples and documentation

Users who need topology-aware resource alignment should use
the standard pcieRoot attribute (resource.kubernetes.io/pcieRoot)
instead, which is officially defined by Kubernetes and already
exposed by this driver. The pcieRoot attribute provides
PCIe Root Complex affinity which achieves similar locality
constraints without abusing the reserved attribute namespace.

Example migration for DeviceConstraints:
  Before: matchAttribute: "resource.kubernetes.io/numaNode"
  After:  matchAttribute: "resource.kubernetes.io/pcieRoot"

Ref: kubernetes-sigs/dra-driver-cpu#65 (comment)

Signed-off-by: Sebastian Sch <sebassch@gmail.com>
SchSeba added a commit to SchSeba/dra-driver-sriov that referenced this pull request Feb 23, 2026
Drivers should not use the reserved Kubernetes namespace
(resource.kubernetes.io/) for attributes that have not been
officially defined by Kubernetes. The numaNode attribute was
never standardized and using it under the standard prefix is
a bad practice that could create compatibility issues as more
drivers adopt it without upstream consensus.

This commit removes the numaNode attribute entirely from:
- Device attributes exposed on SR-IOV VFs
- SriovResourceFilter CRD (numaNodes filter field)
- Resource filter controller logic
- Host interface (GetNumaNode)
- All examples and documentation

Users who need topology-aware resource alignment should use
the standard pcieRoot attribute (resource.kubernetes.io/pcieRoot)
instead, which is officially defined by Kubernetes and already
exposed by this driver. The pcieRoot attribute provides
PCIe Root Complex affinity which achieves similar locality
constraints without abusing the reserved attribute namespace.

Example migration for DeviceConstraints:
  Before: matchAttribute: "resource.kubernetes.io/numaNode"
  After:  matchAttribute: "resource.kubernetes.io/pcieRoot"

Ref: kubernetes-sigs/dra-driver-cpu#65 (comment)

Signed-off-by: Sebastian Sch <sebassch@gmail.com>
SchSeba added a commit to SchSeba/dra-driver-sriov that referenced this pull request Feb 24, 2026
Drivers should not use the reserved Kubernetes namespace
(resource.kubernetes.io/) for attributes that have not been
officially defined by Kubernetes. The numaNode attribute was
never standardized and using it under the standard prefix is
a bad practice that could create compatibility issues as more
drivers adopt it without upstream consensus.

This commit removes the numaNode attribute entirely from:
- Device attributes exposed on SR-IOV VFs
- SriovResourceFilter CRD (numaNodes filter field)
- Resource filter controller logic
- Host interface (GetNumaNode)
- All examples and documentation

Users who need topology-aware resource alignment should use
the standard pcieRoot attribute (resource.kubernetes.io/pcieRoot)
instead, which is officially defined by Kubernetes and already
exposed by this driver. The pcieRoot attribute provides
PCIe Root Complex affinity which achieves similar locality
constraints without abusing the reserved attribute namespace.

Example migration for DeviceConstraints:
  Before: matchAttribute: "resource.kubernetes.io/numaNode"
  After:  matchAttribute: "resource.kubernetes.io/pcieRoot"

Ref: kubernetes-sigs/dra-driver-cpu#65 (comment)

Signed-off-by: Sebastian Sch <sebassch@gmail.com>
ffromani added a commit to ffromani/dra-driver-memory that referenced this pull request Feb 24, 2026
DRA drivers should not use the resource.kubernetes.io
namespace for non-official attributes. They should
use their own namespace.

xref: kubernetes-sigs/dra-driver-cpu#65 (comment)

Signed-off-by: Francesco Romani <fromani@redhat.com>
SchSeba added a commit to SchSeba/dra-driver-sriov that referenced this pull request Feb 25, 2026
Drivers should not use the reserved Kubernetes namespace
(resource.kubernetes.io/) for attributes that have not been
officially defined by Kubernetes. The numaNode attribute was
never standardized and using it under the standard prefix is
a bad practice that could create compatibility issues as more
drivers adopt it without upstream consensus.

This commit removes the numaNode attribute entirely from:
- Device attributes exposed on SR-IOV VFs
- SriovResourceFilter CRD (numaNodes filter field)
- Resource filter controller logic
- Host interface (GetNumaNode)
- All examples and documentation

Users who need topology-aware resource alignment should use
the standard pcieRoot attribute (resource.kubernetes.io/pcieRoot)
instead, which is officially defined by Kubernetes and already
exposed by this driver. The pcieRoot attribute provides
PCIe Root Complex affinity which achieves similar locality
constraints without abusing the reserved attribute namespace.

Example migration for DeviceConstraints:
  Before: matchAttribute: "resource.kubernetes.io/numaNode"
  After:  matchAttribute: "resource.kubernetes.io/pcieRoot"

Ref: kubernetes-sigs/dra-driver-cpu#65 (comment)

Signed-off-by: Sebastian Sch <sebassch@gmail.com>
@SchSeba
Copy link
Copy Markdown

SchSeba commented Feb 25, 2026

we merged this one k8snetworkplumbingwg/dra-driver-sriov#70 so we are not using this anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants