Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nvme: do not scan topology when mmaping registers #2251

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

igaw
Copy link
Collaborator

@igaw igaw commented Mar 19, 2024

For accessing the registers we don't need to scan the topology. With the
device name we already know where to lookup the resource0 file in sysfs.

We also don't need to do the fallback lookup via the namespaces because
Linux kernel v4.0 has introduced the link in /sys/class/nvme/nvme%d. And
nvme-cli 2.x depends on Linux kernel >= 4.15, so it's safe to drop the
fallback.

This avoids all the topology scanning which is excessive and also might
issue an 'id command' via the nuse sysfs entry. So let's not do it.

Signed-off-by: Daniel Wagner [email protected]

Fixes: #2246 #2048

For accessing the registers we don't need to scan the topology. With the
device name we already know where to lookup the resource0 file in sysfs.

We also don't need to do the fallback lookup via the namespaces because
Linux kernel v4.0 has introduced the link in /sys/class/nvme/nvme%d. And
nvme-cli 2.x depends on Linux kernel >= 4.15, so it's safe to drop the
fallback.

This avoids all the topology scanning which is excessive and also might
issue an 'id command' via the nuse sysfs entry. So let's not do it.

Signed-off-by: Daniel Wagner <[email protected]>
Copy link
Collaborator

@hreinecke hreinecke left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@igaw igaw merged commit a31081a into linux-nvme:master Mar 19, 2024
16 checks passed
@igaw igaw deleted the show-regs-deps branch March 19, 2024 14:06
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