Skip to content

Conversation

@mythi
Copy link
Contributor

@mythi mythi commented Jan 5, 2026

Fixes: #524

TODO:

  • run test/e2e
  • add pkg/vfio/plugin_test.go

@mythi mythi force-pushed the PR-2026-001 branch 2 times, most recently from cbafc6c to 37e8041 Compare January 5, 2026 11:16
@eero-t
Copy link
Contributor

eero-t commented Jan 5, 2026

Last commit touches also other things besides DSA, and looks like it could be its own PR?

@mythi
Copy link
Contributor Author

mythi commented Jan 7, 2026

Last commit touches also other things besides DSA, and looks like it could be its own PR?

#2198

@mythi mythi force-pushed the PR-2026-001 branch 2 times, most recently from 2257a01 to a76849b Compare January 8, 2026 08:21
@mythi mythi marked this pull request as ready for review January 14, 2026 09:25
@mythi mythi requested review from bart0sh, kad and tkatila as code owners January 14, 2026 09:25
@mythi
Copy link
Contributor Author

mythi commented Jan 14, 2026

ready for review

mythi added 3 commits January 14, 2026 14:53
Signed-off-by: Mikko Ylinen <[email protected]>
Signed-off-by: Mikko Ylinen <[email protected]>
Copy link
Contributor

@eero-t eero-t left a comment

Choose a reason for hiding this comment

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

Skipped e2e (somebody else can check that), but the rest looks OK (on somewhat cursory review).

Copy link
Contributor

@tkatila tkatila left a comment

Choose a reason for hiding this comment

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

Overall looks good. Had some general observations and one nitpick.

ProvisioningConfig string `json:"provisioningConfig,omitempty"`

// Driver name used for the DSA devices.
// +kubebuilder:validation:Enum=idxd;vfio-pci
Copy link
Contributor

Choose a reason for hiding this comment

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

You could also have // +kubebuilder:default=idxd but it's not generally used in our CRDs.

DEV="${DEVICE_TYPE:-dsa}"
DSA_DRIVER=${DSA_DRIVER:-idxd}
NODE_NAME="${NODE_NAME:-}"
DSA_PCI_IDS=${DSA_PCI_IDS:-0b25 11fb 1212}
Copy link
Contributor

Choose a reason for hiding this comment

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

This cannot be set via the operator. But QAT's device id listing is similar so it can be left as a future improvement idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In fact, with QAT this is configurable (based on what user sets as the kernelvfdrivers).

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is (only) done through the operator:

Name: "ENABLED_QAT_PF_PCIIDS",
Value: strings.Join(enablingPfPciIDs, " "),

Comment on lines +80 to +87
func readFile(fpath string) (string, error) {
data, err := os.ReadFile(fpath)
if err != nil {
return "", errors.WithStack(err)
}

return strings.TrimSpace(string(data)), nil
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this is a duplicate from the idxd side. Would be nice to have one in a common/util location. But since it's a small function, it's fine as it is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, dpdkdrv.go has also one for something very similar: getDeviceID()

"0x11fb": {},
"0x1212": {},
}
plugin = vfio.NewDevicePlugin(pciDevicesDir, dsaDeviceIDs)
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: as sharedDevNum is not supported with vfio-pci mode, plugin should warn/error if it's set. Maybe the same could be added to the validation webhook also.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add vfio based devices to DSA

3 participants