Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:Update
biosdevname.8439
biosdevname_avoid_duplicates.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File biosdevname_avoid_duplicates.patch of Package biosdevname.8439
From: sujithpshankar <sujithpandel@gmail.com> Subject: Prevent reading of VPD-DCM strings for SRIOV-vfs. References: bsc#1042185 Patch-Mainline: Git-commit: 02811d5165c2eeecf8797fe9b5088d6e78bd25db Git-repo: https://github.com/dell/biosdevname Reading DCM strings of SRIOV-vfs results in a confusion that leads to interface being assumed as a NIC partition rather than a SRIOV-vf. This patch prevents the reading and setting of VPD data to SRIOV-vf interfaces. Signed-off-by: Thomas Renninger <trenn@suse.com> diff --git a/src/pci.c b/src/pci.c index 1724394..74ed9e6 100644 --- a/src/pci.c +++ b/src/pci.c @@ -119,6 +119,10 @@ static void parse_dcm(struct libbiosdevname_state *state, struct pci_device *pde struct vpd_tag *dcm; const char *fmt; + if (pdev->is_sriov_virtual_function) { + return ; + } + fmt = "%1x%1x%2x"; step = 10; dcm = pci_vpd_findtag(vpd, len, "DCM"); @@ -139,7 +143,7 @@ static void parse_dcm(struct libbiosdevname_state *state, struct pci_device *pde vf = find_pci_dev_by_pci_addr(state, pdev->pci_dev->domain, pdev->pci_dev->bus, devfn >> 3, devfn & 7); - if (vf != NULL) { + if (vf != NULL && !vf->is_sriov_virtual_function) { add_port(vf, port, pfi); if (vf->vpd_port == INT_MAX) { vf->vpd_port = port; @@ -157,7 +161,7 @@ static int read_pci_vpd(struct libbiosdevname_state *state, struct pci_device *p int fd, len; unsigned char *vpd; - if (!is_pci_network(pdev)) + if (!is_pci_network(pdev) || pdev->is_sriov_virtual_function) return 1; unparse_pci_name(pci_name, sizeof(pci_name), pdev->pci_dev); snprintf(path, sizeof(path), "/sys/bus/pci/devices/%s/physfn/vpd", pci_name); @@ -214,12 +218,15 @@ static void set_pci_vpd_instance(struct libbiosdevname_state *state) /* Ignore already parsed devices */ continue; } + if (dev->is_sriov_virtual_function) { + continue; + } read_pci_vpd(state, dev); } /* Now match VPD master device */ list_for_each_entry(dev, &state->pci_devices, node) { - if (dev->vpd_port == INT_MAX) + if (dev->vpd_port == INT_MAX || dev->is_sriov_virtual_function) continue; list_for_each_entry(dev2, &state->pci_devices, node) { if (dev2->pci_dev->domain == dev->pci_dev->domain &&
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor