Skip to content

Formalizing the kernel module ABI#83

Draft
JOOpdenhoevel wants to merge 11 commits into
devfrom
docs/ioctl_protocol
Draft

Formalizing the kernel module ABI#83
JOOpdenhoevel wants to merge 11 commits into
devfrom
docs/ioctl_protocol

Conversation

@JOOpdenhoevel
Copy link
Copy Markdown
Collaborator

This PR introduces a formalization of the kernel module ABI. Currently, this covers a specification guide in the reference section of the documentation, but I would also like to include an extended testing suite, covering the formalized understanding of the interface between kernel space and user space.

Signed-off-by: Jan-Oliver Opdenhövel <jopdenho@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <jopdenho@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <jopdenho@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <jopdenho@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <jopdenho@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <jopdenho@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <jopdenho@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <jopdenho@amd.com>
Comment thread docs/reference/kernel-abi/index.rst Outdated
never freed. This stability guarantee means ``/dev/slash_ctl0`` always refers to the same physical
card across remove+rescan cycles. However, suffixes for one card are not guaranteed to be identical
for ``/dev/slash_ctl<N>`` and ``/dev/slash_qdma_ctl<N>`` since they represent separate physical
functions and thus BDFs.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think this should be documented. Consumers should just use BDFs and not rely on this behaviors.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think, the stability of the BDF-to-number mapping should be documented. If it's not and you're playing by the book, you would need to re-check the BDF of the device you've opened every single time you're re-opening it. I'm with you that users should not rely on any assumptions how the mapping is created, but I think they should be able to rely on the fact that once mappings exist, they are permanent. Or would you just prefer the statement that mappings may not be stable across remove+rescan cycles?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Software should always use BDF for identity across resets. The only reason I implemented number stability was to avoid /dev/slash_ctl400, which looks silly.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Okay, that's sensible. I've adapted the documentation accordingly.

Comment thread docs/reference/kernel-abi/index.rst
Comment thread docs/reference/kernel-abi/index.rst Outdated
Signed-off-by: Jan-Oliver Opdenhövel <jopdenho@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <jopdenho@amd.com>
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.

2 participants