Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

drivers: Correct isPCIeDevice logic#2898

Merged
amshinde merged 1 commit into
kata-containers:stable-1.11from
dgibson:fix-pcie-1.11
Sep 23, 2020
Merged

drivers: Correct isPCIeDevice logic#2898
amshinde merged 1 commit into
kata-containers:stable-1.11from
dgibson:fix-pcie-1.11

Conversation

@dgibson
Copy link
Copy Markdown
Contributor

@dgibson dgibson commented Aug 25, 2020

Currently, isPCIeDevice() attempts to determine if a (host) device is
PCI-Express capable by looking up its link speed via the PCI slots
information in sysfs. This is a) complicated and b) wrong. PCI-e devices
don't have to have slots information, so this frequently fails.

Instead determine if devices are PCI-e by checking for the presence of
PCIe extended configuration space by looking at the size of the "config"
file in sysfs.

Fixes: #2678

Signed-off-by: David Gibson david@gibson.dropbear.id.au
(cherry picked from commit 6bf93b2)

Currently, isPCIeDevice() attempts to determine if a (host) device is
PCI-Express capable by looking up its link speed via the PCI slots
information in sysfs.  This is a) complicated and b) wrong.  PCI-e devices
don't have to have slots information, so this frequently fails.

Instead determine if devices are PCI-e by checking for the presence of
PCIe extended configuration space by looking at the size of the "config"
file in sysfs.

Fixes: #2678

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
(cherry picked from commit 6bf93b2)
@dgibson
Copy link
Copy Markdown
Contributor Author

dgibson commented Aug 25, 2020

stable-1.11 backport of #2889

@fidencio
Copy link
Copy Markdown
Member

/test

Copy link
Copy Markdown
Member

@fidencio fidencio left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 25, 2020

Codecov Report

Merging #2898 into stable-1.11 will decrease coverage by 0.04%.
The diff coverage is 13.23%.

@@               Coverage Diff               @@
##           stable-1.11    #2898      +/-   ##
===============================================
- Coverage        50.43%   50.38%   -0.05%     
===============================================
  Files              118      118              
  Lines            17114    17139      +25     
===============================================
+ Hits              8631     8636       +5     
- Misses            7425     7445      +20     
  Partials          1058     1058              

Copy link
Copy Markdown

@devimc devimc left a comment

Choose a reason for hiding this comment

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

thanks @dgibson

@amshinde amshinde merged commit 9d82056 into kata-containers:stable-1.11 Sep 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants