diff --git a/.biosdevname.metadata b/.biosdevname.metadata index 18c269f..50e5b67 100644 --- a/.biosdevname.metadata +++ b/.biosdevname.metadata @@ -1 +1 @@ -708ccec6a312869f5ebfb0dd393f3b218dd5d171 SOURCES/biosdevname-0.5.0.tar.gz +372eaee40a8501494bea783bb6552ff457cbd49a SOURCES/biosdevname-0.6.1.tar.gz diff --git a/.gitignore b/.gitignore index 73e84b8..67254e9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/biosdevname-0.5.0.tar.gz +SOURCES/biosdevname-0.6.1.tar.gz diff --git a/SOURCES/0001-Add-port-code-for-Mellanox-driver.patch b/SOURCES/0001-Add-port-code-for-Mellanox-driver.patch deleted file mode 100644 index bedaffb..0000000 --- a/SOURCES/0001-Add-port-code-for-Mellanox-driver.patch +++ /dev/null @@ -1,157 +0,0 @@ -From c140ce659a204d67e4cc61d2191443123f7dd970 Mon Sep 17 00:00:00 2001 -From: Jordan Hargrave -Date: Mon, 3 Mar 2014 11:06:44 -0600 -Subject: [PATCH] Add port code for Mellanox driver - ---- - configure.ac | 2 +- - src/bios_device.c | 47 ++++++++++++++++++++++++++++++++++------------- - src/bios_device.h | 2 ++ - src/naming_policy.c | 12 +++++++++--- - 4 files changed, 46 insertions(+), 17 deletions(-) - -diff --git a/configure.ac b/configure.ac -index e75e64a..d08d42f 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3,7 +3,7 @@ - # vim:tw=0:ts=8:sw=8:et - - AC_PREREQ(2.59) --AC_INIT([biosdevname],[0.5.0],[Jordan_Hargrave@dell.com]) -+AC_INIT([biosdevname],[0.5.1],[Jordan_Hargrave@dell.com]) - AC_LANG([C]) - AC_USE_SYSTEM_EXTENSIONS - AC_CONFIG_SRCDIR([src/read_proc.c]) -diff --git a/src/bios_device.c b/src/bios_device.c -index 132877e..ba0661f 100644 ---- a/src/bios_device.c -+++ b/src/bios_device.c -@@ -212,6 +212,16 @@ static void sort_device_list(struct libbiosdevname_state *state) - list_splice(&sorted_devices, &state->bios_devices); - } - -+/* Check for Mellanox/Chelsio drivers */ -+int ismultiport(const char *driver) -+{ -+ if (!strncmp(driver, "mlx", 3)) -+ return 1; -+ if (!strncmp(driver, "cxgb", 4)) -+ return 1; -+ return 0; -+} -+ - static void match_pci_and_eth_devs(struct libbiosdevname_state *state) - { - struct pci_device *p; -@@ -223,20 +233,30 @@ static void match_pci_and_eth_devs(struct libbiosdevname_state *state) - if (!is_pci_network(p)) - continue; - -+ /* Loop through all ether devices to find match */ - unparse_pci_name(pci_name, sizeof(pci_name), p->pci_dev); -- n = find_net_device_by_bus_info(state, pci_name); -- if (!n) -- continue; -- -- b = malloc(sizeof(*b)); -- if (!b) -- continue; -- memset(b, 0, sizeof(*b)); -- INIT_LIST_HEAD(&b->node); -- b->pcidev = p; -- b->netdev = n; -- claim_netdev(b->netdev); -- list_add(&b->node, &state->bios_devices); -+ list_for_each_entry(n, &state->network_devices, node) { -+ if (strncmp(n->drvinfo.bus_info, pci_name, sizeof(n->drvinfo.bus_info))) -+ continue; -+ b = malloc(sizeof(*b)); -+ if (!b) -+ continue; -+ memset(b, 0, sizeof(*b)); -+ INIT_LIST_HEAD(&b->node); -+ b->pcidev = p; -+ b->netdev = n; -+ b->port = NULL; -+ if (ismultiport(n->drvinfo.driver)) { -+ b->port = malloc(sizeof(struct pci_port)); -+ if (b->port != NULL) { -+ b->port->port = n->devid+1; -+ b->port->pfi = p->is_sriov_virtual_function ? -+ p->vf_index : -1; -+ } -+ } -+ claim_netdev(b->netdev); -+ list_add(&b->node, &state->bios_devices); -+ } - } - } - -@@ -258,6 +278,7 @@ static void match_unknown_eths(struct libbiosdevname_state *state) - memset(b, 0, sizeof(*b)); - INIT_LIST_HEAD(&b->node); - b->netdev = n; -+ b->port = NULL; - list_add(&b->node, &state->bios_devices); - } - } -diff --git a/src/bios_device.h b/src/bios_device.h -index 690ed6f..158a2af 100644 ---- a/src/bios_device.h -+++ b/src/bios_device.h -@@ -12,12 +12,14 @@ - #include "pci.h" - #include "naming_policy.h" - -+struct pci_port; - - struct bios_device { - struct list_head node; - struct network_device *netdev; - struct pci_device *pcidev; - char *bios_name; -+ struct pci_port *port; - int duplicate; - }; - -diff --git a/src/naming_policy.c b/src/naming_policy.c -index 4f2033c..7138a4b 100644 ---- a/src/naming_policy.c -+++ b/src/naming_policy.c -@@ -55,7 +55,9 @@ static void use_physical(const struct libbiosdevname_state *state, const char *p - vf = vf->vpd_pf; - if (vf->pf) - vf = vf->pf; -- if (vf->uses_sysfs & HAS_SYSFS_INDEX) -+ if (dev->port) -+ portnum = dev->port->port; -+ else if (vf->uses_sysfs & HAS_SYSFS_INDEX) - portnum = vf->sysfs_index; - else if (vf->uses_smbios & HAS_SMBIOS_INSTANCE && is_pci_smbios_type_ethernet(vf)) - portnum = vf->smbios_instance; -@@ -68,7 +70,9 @@ static void use_physical(const struct libbiosdevname_state *state, const char *p - } - else if (dev->pcidev->physical_slot < PHYSICAL_SLOT_UNKNOWN) { - snprintf(location, sizeof(location), "p%u", dev->pcidev->physical_slot); -- if (dev->pcidev->vpd_port < INT_MAX) -+ if (dev->port) -+ portnum = dev->port->port; -+ else if (dev->pcidev->vpd_port < INT_MAX) - portnum = dev->pcidev->vpd_port; - else if (!dev->pcidev->is_sriov_virtual_function) - portnum = dev->pcidev->index_in_slot; -@@ -78,7 +82,9 @@ static void use_physical(const struct libbiosdevname_state *state, const char *p - known=1; - } - -- if (dev->pcidev->is_sriov_virtual_function) -+ if (dev->port && dev->port->pfi != -1) -+ snprintf(interface, sizeof(interface), "_%u", dev->port->pfi); -+ else if (dev->pcidev->is_sriov_virtual_function) - snprintf(interface, sizeof(interface), "_%u", dev->pcidev->vf_index); - else if (dev->pcidev->vpd_pfi < INT_MAX) - snprintf(interface, sizeof(interface), "_%u", dev->pcidev->vpd_pfi); --- -1.8.4.2 - diff --git a/SOURCES/0001-Add-port-structure-to-PCI-device-handle-multiple-por.patch b/SOURCES/0001-Add-port-structure-to-PCI-device-handle-multiple-por.patch deleted file mode 100644 index 43522eb..0000000 --- a/SOURCES/0001-Add-port-structure-to-PCI-device-handle-multiple-por.patch +++ /dev/null @@ -1,85 +0,0 @@ -From f3e6790b7986a4f9dd4a407901717ef8de3cbbc6 Mon Sep 17 00:00:00 2001 -From: Jordan Hargrave -Date: Tue, 25 Feb 2014 16:35:40 -0600 -Subject: [PATCH] Add port structure to PCI device, handle multiple ports per - BDF (Mellanox) - ---- - src/pci.c | 21 +++++++++++++++++++++ - src/pci.h | 7 +++++++ - 2 files changed, 28 insertions(+) - -diff --git a/src/pci.c b/src/pci.c -index e85cb03..a2d8145 100644 ---- a/src/pci.c -+++ b/src/pci.c -@@ -121,6 +121,25 @@ static int pci_vpd_find_info_subkey(const u8 *buf, unsigned int off, unsigned in - return -1; - } - -+/* Add port identifier(s) to PCI device */ -+static void add_port(struct pci_device *pdev, int port, int pfi) -+{ -+ struct pci_port *p; -+ -+ list_for_each_entry(p, &pdev->ports, node) { -+ if (p->port == port && p->pfi == pfi) -+ return; -+ } -+ p = malloc(sizeof(*p)); -+ if (p == NULL) -+ return; -+ memset(p, 0, sizeof(*p)); -+ INIT_LIST_HEAD(&p->node); -+ p->port = port; -+ p->pfi = pfi; -+ list_add_tail(&p->node, &pdev->ports); -+} -+ - static int parse_vpd(struct libbiosdevname_state *state, struct pci_device *pdev, int len, unsigned char *vpd) - { - int i, j, k, isz, jsz, port, func, pfi; -@@ -155,6 +174,7 @@ static int parse_vpd(struct libbiosdevname_state *state, struct pci_device *pdev - pdev->pci_dev->bus, - pdev->pci_dev->dev, - func)) != NULL) { -+ add_port(vf, port, pfi); - if (vf->vpd_port == INT_MAX) { - vf->vpd_port = port; - vf->vpd_pfi = pfi; -@@ -597,6 +617,7 @@ static void add_pci_dev(struct libbiosdevname_state *state, - INIT_LIST_HEAD(&dev->node); - INIT_LIST_HEAD(&dev->vfnode); - INIT_LIST_HEAD(&dev->vfs); -+ INIT_LIST_HEAD(&dev->ports); - dev->pci_dev = p; - dev->physical_slot = PHYSICAL_SLOT_UNKNOWN; - dev->class = pci_read_word(p, PCI_CLASS_DEVICE); -diff --git a/src/pci.h b/src/pci.h -index 77b4746..eacb539 100644 ---- a/src/pci.h -+++ b/src/pci.h -@@ -20,6 +20,12 @@ struct slotlist - int count; - }; - -+struct pci_port { -+ struct list_head node; -+ int port; -+ int pfi; -+}; -+ - struct pci_device { - struct list_head node; - struct pci_dev *pci_dev; -@@ -44,6 +50,7 @@ struct pci_device { - struct pci_device *pf; - struct list_head vfnode; - struct list_head vfs; -+ struct list_head ports; - unsigned int is_sriov_physical_function:1; - unsigned int is_sriov_virtual_function:1; - unsigned int embedded_index_valid:1; --- -1.8.4.2 - diff --git a/SOURCES/0001-Cleanup-SRIOV-scanner-code.patch b/SOURCES/0001-Cleanup-SRIOV-scanner-code.patch deleted file mode 100644 index 0ca571e..0000000 --- a/SOURCES/0001-Cleanup-SRIOV-scanner-code.patch +++ /dev/null @@ -1,238 +0,0 @@ -From 4834d5d108506c979f0e98e50afd570140503338 Mon Sep 17 00:00:00 2001 -From: Jordan Hargrave -Date: Fri, 28 Feb 2014 14:31:53 -0600 -Subject: [PATCH 1/2] Cleanup SRIOV scanner code - ---- - src/pci.c | 166 ++++++++++++++++++++------------------------------------------ - 1 file changed, 54 insertions(+), 112 deletions(-) - -diff --git a/src/pci.c b/src/pci.c -index dabb158..9b851df 100644 ---- a/src/pci.c -+++ b/src/pci.c -@@ -351,67 +351,15 @@ static int read_pci_sysfs_physfn(char *buf, size_t bufsize, const struct pci_dev - return 0; - } - --static int virtfn_filter(const struct dirent *dent) --{ -- return (!strncmp(dent->d_name,"virtfn",6)); --} -- --static int _read_virtfn_index(unsigned int *index, const char *path, const char *basename, const char *pci_name) --{ -- char buf[PATH_MAX], *b; -- char fullpath[PATH_MAX]; -- ssize_t size; -- unsigned int u=INT_MAX; -- int scanned, rc=1; -- -- snprintf(fullpath, sizeof(fullpath), "%s/%s", path, basename); -- size = readlink(fullpath, buf, sizeof(buf)); -- if (size > 0) { -- /* form is ../0000:05:10.0 */ -- b=buf+3; /* skip ../ */ -- if (strlen(b) == strlen(pci_name) && -- !strncmp(b, pci_name, strlen(pci_name))) { -- scanned = sscanf(basename, "virtfn%u", &u); -- if (scanned == 1) { -- rc = 0; -- *index = u; -- } -- } -- } -- return rc; --} -- --static int read_virtfn_index(unsigned int *index, const struct pci_dev *pdev) --{ -- char pci_name[16]; -- char path[PATH_MAX]; -- char cpath[PATH_MAX]; -- struct dirent **namelist; -- int n, rc=1; -- -- unparse_pci_name(pci_name, sizeof(pci_name), pdev); -- snprintf(path, sizeof(path), "/sys/bus/pci/devices/%s/physfn", pci_name); -- if (realpath(path, cpath) == NULL) -- return rc; -- -- n = scandir(cpath, &namelist, virtfn_filter, versionsort); -- if (n < 0) -- return rc; -- else { -- while (n--) { -- if (rc) -- rc = _read_virtfn_index(index, cpath, namelist[n]->d_name, pci_name); -- free(namelist[n]); -- } -- free(namelist); -- } -- -- return rc; --} -- - static int parse_pci_name(const char *s, int *domain, int *bus, int *dev, int *func) - { - int err; -+ const char *r; -+ -+ /* Allow parsing pathnames */ -+ if ((r = strrchr(s, '/')) != NULL) -+ s = r+1; -+ - /* The domain part was added in 2.6 kernels. Test for that first. */ - err = sscanf(s, "%x:%2x:%2x.%x", domain, bus, dev, func); - if (err != 4) { -@@ -431,29 +379,6 @@ static struct pci_dev * find_pdev_by_pci_name(struct pci_access *pacc, const cha - return pci_get_dev(pacc, domain, bus, device, func); - } - --static struct pci_device * --find_physfn(struct libbiosdevname_state *state, struct pci_device *dev) --{ -- int rc; -- char path[PATH_MAX]; -- char *c; -- struct pci_dev *pdev; -- memset(path, 0, sizeof(path)); -- rc = read_pci_sysfs_physfn(path, sizeof(path), dev->pci_dev); -- if (rc != 0) -- return NULL; -- /* we get back a string like -- ../0000:05:0.0 -- where the last component is the parent device -- */ -- /* find the last backslash */ -- c = rindex(path, '/'); -- c++; -- pdev = find_pdev_by_pci_name(state->pacc, c); -- dev = find_dev_by_pci(state, pdev); -- return dev; --} -- - static int is_same_pci(const struct pci_dev *a, const struct pci_dev *b) - { - if (pci_domain_nr(a) == pci_domain_nr(b) && -@@ -464,25 +389,6 @@ static int is_same_pci(const struct pci_dev *a, const struct pci_dev *b) - return 0; - } - --static void try_add_vf_to_pf(struct libbiosdevname_state *state, struct pci_device *vf) --{ -- struct pci_device *pf; -- unsigned int index=0; -- int rc; -- pf = find_physfn(state, vf); -- -- if (!pf) -- return; -- list_add_tail(&vf->vfnode, &pf->vfs); -- rc = read_virtfn_index(&index, vf->pci_dev); -- if (!rc) { -- vf->vf_index = index; -- pf->is_sriov_physical_function = 1; -- } -- vf->pf = pf; -- vf->physical_slot = pf->physical_slot; --} -- - static struct pci_device * - find_parent(struct libbiosdevname_state *state, struct pci_device *dev) - { -@@ -492,12 +398,6 @@ find_parent(struct libbiosdevname_state *state, struct pci_device *dev) - struct pci_device *physfn; - struct pci_dev *pdev; - memset(path, 0, sizeof(path)); -- /* if this device has a physfn pointer, then treat _that_ as the parent */ -- physfn = find_physfn(state, dev); -- if (physfn) { -- dev->is_sriov_virtual_function=1; -- return physfn; -- } - - rc = read_pci_sysfs_path(path, sizeof(path), dev->pci_dev); - if (rc != 0) -@@ -715,15 +615,57 @@ static int set_embedded_index(struct libbiosdevname_state *state) - return 0; - } - -+static int virtfn_filter(const struct dirent *dent) -+{ -+ return (!strncmp(dent->d_name,"virtfn",6)); -+} - -- --static void set_sriov_pf_vf(struct libbiosdevname_state *state) -+/* Assign Virtual Function to Physical Function */ -+static void set_sriov(struct libbiosdevname_state *state, struct pci_device *pf, const char *virtpath) - { - struct pci_device *vf; -- list_for_each_entry(vf, &state->pci_devices, node) { -- if (!vf->is_sriov_virtual_function) -+ char pci_name[32]; -+ char path[PATH_MAX], cpath[PATH_MAX]; -+ int vf_index; -+ -+ if (sscanf(virtpath, "virtfn%u", &vf_index) != 1) -+ return; -+ unparse_pci_name(pci_name, sizeof(pci_name), pf->pci_dev); -+ snprintf(path, sizeof(path), "/sys/bus/pci/devices/%s/%s", pci_name, virtpath); -+ -+ memset(cpath, 0, sizeof(cpath)); -+ if (readlink(path, cpath, sizeof(cpath)) < 0) -+ return; -+ if ((vf = find_dev_by_pci_name(state, cpath)) != NULL) { -+ vf->is_sriov_virtual_function = 1; -+ vf->vf_index = vf_index; -+ vf->pf = pf; -+ pf->is_sriov_physical_function = 1; -+ list_add_tail(&vf->vfnode, &pf->vfs); -+ } -+} -+ -+static void scan_sriov(struct libbiosdevname_state *state) -+{ -+ struct pci_device *pf; -+ char path[PATH_MAX]; -+ char pci_name[32]; -+ struct dirent **namelist; -+ int n; -+ -+ list_for_each_entry(pf, &state->pci_devices, node) { -+ unparse_pci_name(pci_name, sizeof(pci_name), pf->pci_dev); -+ snprintf(path, sizeof(path), "/sys/bus/pci/devices/%s", pci_name); -+ -+ namelist = NULL; -+ n = scandir(path, &namelist, virtfn_filter, versionsort); -+ if (n <= 0) - continue; -- try_add_vf_to_pf(state, vf); -+ while (n--) { -+ set_sriov(state, pf, namelist[n]->d_name); -+ free(namelist[n]); -+ } -+ free(namelist); - } - } - -@@ -799,6 +741,7 @@ int get_pci_devices(struct libbiosdevname_state *state) - /* ordering here is important */ - dmidecode_main(state); /* this will fail on Xen guests, that's OK */ - sort_device_list(state); -+ scan_sriov(state); - set_pci_vpd_instance(state); - rc = set_pci_slots(state); - if(rc) -@@ -806,7 +749,6 @@ int get_pci_devices(struct libbiosdevname_state *state) - - set_embedded_index(state); - set_pci_slot_index(state); -- set_sriov_pf_vf(state); - - out: - return rc; --- -1.9.0 - diff --git a/SOURCES/0001-CoverityScan-update.patch b/SOURCES/0001-CoverityScan-update.patch deleted file mode 100644 index 8494f58..0000000 --- a/SOURCES/0001-CoverityScan-update.patch +++ /dev/null @@ -1,199 +0,0 @@ -From da98b8f43c74492c5471439d6ca20c15da5aeb45 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?V=C3=A1clav=20Pavl=C3=ADn?= -Date: Thu, 15 Nov 2012 10:24:02 +0100 -Subject: [PATCH] CoverityScan update - -Resolves: #873636 ---- - src/bios_device.c | 14 +++++++++++--- - src/eths.c | 2 +- - src/pci.c | 38 +++++++++++++++++++++++++++++--------- - 3 files changed, 41 insertions(+), 13 deletions(-) - -diff --git a/src/bios_device.c b/src/bios_device.c -index 9e319a3..a8827ec 100644 ---- a/src/bios_device.c -+++ b/src/bios_device.c -@@ -359,10 +359,11 @@ extern int addslot(struct libbiosdevname_state *state, int slot); - - /* Fix for RHBZ 816536/757743/756164/: Cards with same PCI but multiple ports - * chelsio, mellanox */ --static void check_ports(struct libbiosdevname_state *state) -+static int check_ports(struct libbiosdevname_state *state) - { - struct pci_device *dev; - struct bios_device *a; -+ int slot = 0; - - list_for_each_entry(a, &state->bios_devices, node) { - dev = a->pcidev; -@@ -370,9 +371,14 @@ static void check_ports(struct libbiosdevname_state *state) - continue; - if (dev->physical_slot != PHYSICAL_SLOT_UNKNOWN) { - a->slot_num = dev->physical_slot; -- a->port_num = addslot(state, 0x1000 + dev->physical_slot); -+ slot = addslot(state, 0x1000 + dev->physical_slot); -+ if (slot<0) -+ return slot; -+ a->port_num = slot; - } - } -+ -+ return 0; - } - - void * setup_bios_devices(int namingpolicy, const char *prefix) -@@ -390,7 +396,9 @@ void * setup_bios_devices(int namingpolicy, const char *prefix) - get_eths(state); - match_all(state); - sort_device_list(state); -- check_ports(state); -+ rc = check_ports(state); -+ if (rc) -+ goto out; - rc = assign_bios_network_names(state, namingpolicy, prefix); - if (rc) - goto out; -diff --git a/src/eths.c b/src/eths.c -index bcd02e1..04db300 100644 ---- a/src/eths.c -+++ b/src/eths.c -@@ -40,7 +40,7 @@ static int eths_get_ifindex(const char *devname, int *ifindex) - struct ifreq ifr; - - memset(&ifr, 0, sizeof(ifr)); -- strncpy(ifr.ifr_name, devname, sizeof(ifr.ifr_name)); -+ strncpy(ifr.ifr_name, devname, sizeof(ifr.ifr_name)-1); - - /* Open control socket. */ - fd = socket(AF_INET, SOCK_DGRAM, 0); -@@ -63,7 +63,7 @@ static int eths_get_hwaddr(const char *devname, unsigned char *buf, int size, in - struct ifreq ifr; - - memset(&ifr, 0, sizeof(ifr)); -- strncpy(ifr.ifr_name, devname, sizeof(ifr.ifr_name)); -+ strncpy(ifr.ifr_name, devname, sizeof(ifr.ifr_name)-1); - - /* Open control socket. */ - fd = socket(AF_INET, SOCK_DGRAM, 0); -@@ -88,7 +88,7 @@ static int eths_get_info(const char *devname, struct ethtool_drvinfo *drvinfo) - - /* Setup our control structures. */ - memset(&ifr, 0, sizeof(ifr)); -- strncpy(ifr.ifr_name, devname, sizeof(ifr.ifr_name)); -+ strncpy(ifr.ifr_name, devname, sizeof(ifr.ifr_name)-1); - - /* Open control socket. */ - fd = socket(AF_INET, SOCK_DGRAM, 0); -@@ -118,7 +118,7 @@ static int eths_get_permaddr(const char *devname, unsigned char *buf, int size) - - /* Setup our control structures. */ - memset(&ifr, 0, sizeof(ifr)); -- strncpy(ifr.ifr_name, devname, sizeof(ifr.ifr_name)); -+ strncpy(ifr.ifr_name, devname, sizeof(ifr.ifr_name)-1); - - - -diff --git a/src/pci.c b/src/pci.c -index 75cf786..9bc0535 100644 ---- a/src/pci.c -+++ b/src/pci.c -@@ -198,10 +198,14 @@ static void set_pci_vpd_instance(struct libbiosdevname_state *state) - - /* Read VPD-R on Dell systems only */ - if ((fd = open("/sys/devices/virtual/dmi/id/sys_vendor", O_RDONLY)) >= 0) { -- if (read(fd, sys_vendor, 9) != 9) -+ if (read(fd, sys_vendor, 9) != 9) { -+ close(fd); - return; -- if (strncmp(sys_vendor, "Dell Inc.", 9)) -+ } -+ if (strncmp(sys_vendor, "Dell Inc.", 9)) { -+ close(fd); - return; -+ } - } else - return; - -@@ -238,6 +242,8 @@ static void set_pci_vpd_instance(struct libbiosdevname_state *state) - dev->vpd_pf = NULL; - } - } -+ -+ close(fd); - } - - static int pci_find_capability(struct pci_dev *p, int cap) -@@ -628,6 +634,8 @@ int addslot(struct libbiosdevname_state *state, int slot) - } - } - s = malloc(sizeof(*s)); -+ if(!s) -+ return -1; - INIT_LIST_HEAD(&s->node); - s->slot = slot; - s->count = 0; -@@ -636,9 +644,10 @@ int addslot(struct libbiosdevname_state *state, int slot) - return ++s->count; - } - --static void set_pci_slots(struct libbiosdevname_state *state) -+static int set_pci_slots(struct libbiosdevname_state *state) - { - struct pci_device *dev; -+ int slot = 0; - - list_for_each_entry(dev, &state->pci_devices, node) { - dev_to_slot(state, dev); -@@ -651,11 +660,19 @@ static void set_pci_slots(struct libbiosdevname_state *state) - } - if (dev->physical_slot == 0) { - dev->embedded_index_valid = 1; -- dev->embedded_index = addslot(state, 0); -+ slot = addslot(state, 0); -+ if (slot<0) -+ return slot; -+ dev->embedded_index = slot; - } else if (dev->physical_slot != PHYSICAL_SLOT_UNKNOWN) { -- dev->index_in_slot = addslot(state, dev->physical_slot); -+ slot = addslot(state, dev->physical_slot); -+ if (slot<0) -+ return slot; -+ dev->index_in_slot = slot; - } - } -+ -+ return 0; - } - - static void set_sriov_pf_vf(struct libbiosdevname_state *state) -@@ -737,9 +754,12 @@ int get_pci_devices(struct libbiosdevname_state *state) - dmidecode_main(state); /* this will fail on Xen guests, that's OK */ - sort_device_list(state); - set_pci_vpd_instance(state); -- set_pci_slots(state); -+ rc = set_pci_slots(state); -+ if(rc) -+ goto out; - set_sriov_pf_vf(state); - -+out: - return rc; - } - -diff --git a/src/read_proc.c b/src/read_proc.c -index c89cb6d..eb988e9 100644 ---- a/src/read_proc.c -+++ b/src/read_proc.c -@@ -25,7 +25,7 @@ static struct network_device *add_interface(struct libbiosdevname_state *state, - return NULL; - memset(i, 0, sizeof(*i)); - INIT_LIST_HEAD(&i->node); -- strncpy(i->kernel_name, name, sizeof(i->kernel_name)); -+ strncpy(i->kernel_name, name, sizeof(i->kernel_name)-1); - list_add_tail(&i->node, &state->network_devices); - return i; - } --- -1.7.11.7 - diff --git a/SOURCES/0001-Fix-regression-introduced-by-the-addslot-function.patch b/SOURCES/0001-Fix-regression-introduced-by-the-addslot-function.patch deleted file mode 100644 index 33173e2..0000000 --- a/SOURCES/0001-Fix-regression-introduced-by-the-addslot-function.patch +++ /dev/null @@ -1,282 +0,0 @@ -From 783de6c93b01fec3f3cb8682156a21417567db9f Mon Sep 17 00:00:00 2001 -From: Narendra K -Date: Wed, 4 Sep 2013 20:32:14 +0530 -Subject: [PATCH] Fix regression introduced by the addslot function - -This patch reverts the following commits - -1452ea7125b5e713b80459f7b528d5562438f3d5 -0bb870f09a34b6c505fcefdbcf85cfcc1aa5ca97 - -The commits introduced addslot function to implement naming for -devices which have more than one physical port sharing the same -PCI b/d/f. But the port determination logic in 'addslot' function -could -result in more than one interface on a given PCI slot getting same -port number when renames are happening in parallel. This patch -restores the logic that existed in version 0.3.11 to determine -port number of an interface. - -Fixes Fedora bz-782145. ---- - src/bios_device.c | 59 ------------------------------------ - src/bios_device.h | 3 -- - src/naming_policy.c | 6 ++-- - src/pci.c | 86 ++++++++++++++++++++++++++++++----------------------- - 4 files changed, 50 insertions(+), 104 deletions(-) - -diff --git a/src/bios_device.c b/src/bios_device.c -index a8827ec..132877e 100644 ---- a/src/bios_device.c -+++ b/src/bios_device.c -@@ -217,32 +217,6 @@ static void match_pci_and_eth_devs(struct libbiosdevname_state *state) - struct pci_device *p; - struct bios_device *b; - struct network_device *n; -- -- list_for_each_entry(n, &state->network_devices, node) { -- p = find_dev_by_pci_name(state, n->drvinfo.bus_info); -- if (!p) -- continue; -- -- b = malloc(sizeof(*b)); -- if (!b) -- continue; -- memset(b, 0, sizeof(*b)); -- INIT_LIST_HEAD(&b->node); -- b->pcidev = p; -- b->netdev = n; -- b->slot_num = -1; -- b->port_num = -1; -- claim_netdev(b->netdev); -- list_add(&b->node, &state->bios_devices); -- } --} -- -- --static void match_eth_and_pci_devs(struct libbiosdevname_state *state) --{ -- struct pci_device *p; -- struct bios_device *b; -- struct network_device *n; - char pci_name[40]; - - list_for_each_entry(p, &state->pci_devices, node) { -@@ -261,8 +235,6 @@ static void match_eth_and_pci_devs(struct libbiosdevname_state *state) - INIT_LIST_HEAD(&b->node); - b->pcidev = p; - b->netdev = n; -- b->slot_num = -1; -- b->port_num = -1; - claim_netdev(b->netdev); - list_add(&b->node, &state->bios_devices); - } -@@ -286,8 +258,6 @@ static void match_unknown_eths(struct libbiosdevname_state *state) - memset(b, 0, sizeof(*b)); - INIT_LIST_HEAD(&b->node); - b->netdev = n; -- b->slot_num = -1; -- b->port_num = -1; - list_add(&b->node, &state->bios_devices); - } - } -@@ -355,32 +325,6 @@ static void find_duplicates(struct libbiosdevname_state *state) - } - } - --extern int addslot(struct libbiosdevname_state *state, int slot); -- --/* Fix for RHBZ 816536/757743/756164/: Cards with same PCI but multiple ports -- * chelsio, mellanox */ --static int check_ports(struct libbiosdevname_state *state) --{ -- struct pci_device *dev; -- struct bios_device *a; -- int slot = 0; -- -- list_for_each_entry(a, &state->bios_devices, node) { -- dev = a->pcidev; -- if (dev == NULL || dev->is_sriov_virtual_function || dev->vpd_port != INT_MAX) -- continue; -- if (dev->physical_slot != PHYSICAL_SLOT_UNKNOWN) { -- a->slot_num = dev->physical_slot; -- slot = addslot(state, 0x1000 + dev->physical_slot); -- if (slot<0) -- return slot; -- a->port_num = slot; -- } -- } -- -- return 0; --} -- - void * setup_bios_devices(int namingpolicy, const char *prefix) - { - int rc=1; -@@ -396,9 +340,6 @@ void * setup_bios_devices(int namingpolicy, const char *prefix) - get_eths(state); - match_all(state); - sort_device_list(state); -- rc = check_ports(state); -- if (rc) -- goto out; - rc = assign_bios_network_names(state, namingpolicy, prefix); - if (rc) - goto out; -diff --git a/src/bios_device.h b/src/bios_device.h -index d1ef911..690ed6f 100644 ---- a/src/bios_device.h -+++ b/src/bios_device.h -@@ -19,9 +19,6 @@ struct bios_device { - struct pci_device *pcidev; - char *bios_name; - int duplicate; -- -- int slot_num; -- int port_num; - }; - - static inline int is_pci(const struct bios_device *dev) -diff --git a/src/naming_policy.c b/src/naming_policy.c -index fe7b934..4f2033c 100644 ---- a/src/naming_policy.c -+++ b/src/naming_policy.c -@@ -59,8 +59,8 @@ static void use_physical(const struct libbiosdevname_state *state, const char *p - portnum = vf->sysfs_index; - else if (vf->uses_smbios & HAS_SMBIOS_INSTANCE && is_pci_smbios_type_ethernet(vf)) - portnum = vf->smbios_instance; -- else if (dev->port_num != -1) -- portnum = dev->port_num; -+ else if (vf->embedded_index_valid) -+ portnum = vf->embedded_index; - if (portnum != INT_MAX) { - snprintf(location, sizeof(location), "%s%u", prefix, portnum); - known=1; -@@ -70,8 +70,6 @@ static void use_physical(const struct libbiosdevname_state *state, const char *p - snprintf(location, sizeof(location), "p%u", dev->pcidev->physical_slot); - if (dev->pcidev->vpd_port < INT_MAX) - portnum = dev->pcidev->vpd_port; -- else if (dev->port_num != -1) -- portnum = dev->port_num; - else if (!dev->pcidev->is_sriov_virtual_function) - portnum = dev->pcidev->index_in_slot; - else -diff --git a/src/pci.c b/src/pci.c -index b64fc3f..7aa32fc 100644 ---- a/src/pci.c -+++ b/src/pci.c -@@ -637,26 +637,6 @@ void free_pci_devices(struct libbiosdevname_state *state) - } - } - --int addslot(struct libbiosdevname_state *state, int slot) --{ -- struct slotlist *s; -- -- list_for_each_entry(s, &state->slots, node) { -- if (s->slot == slot) { -- return ++s->count; -- } -- } -- s = malloc(sizeof(*s)); -- if(!s) -- return -1; -- INIT_LIST_HEAD(&s->node); -- s->slot = slot; -- s->count = 0; -- list_add(&s->node, &state->slots); -- -- return ++s->count; --} -- - static int set_pci_slots(struct libbiosdevname_state *state) - { - struct pci_device *dev; -@@ -665,29 +645,56 @@ static int set_pci_slots(struct libbiosdevname_state *state) - list_for_each_entry(dev, &state->pci_devices, node) { - dev_to_slot(state, dev); - } -+} - -- /* Get mapping for each slot */ -- list_for_each_entry(dev, &state->pci_devices, node) { -- if (dev->is_sriov_virtual_function || !is_pci_network(dev) || dev->vpd_port != INT_MAX) { -+static int set_pci_slot_index(struct libbiosdevname_state *state) -+{ -+ struct pci_device *pcidev; -+ int prevslot=-1; -+ int index=1; -+ -+ /* only iterate over the PCI devices, because the bios_device list may be incomplete due to renames happening in parallel */ -+ list_for_each_entry(pcidev, &state->pci_devices, node) { -+ if (pcidev->physical_slot == 0) /* skip embedded devices */ -+ continue; -+ if (!is_pci_network(pcidev)) /* only look at PCI network devices */ - continue; -- } -- if (dev->physical_slot == 0) { -- dev->embedded_index_valid = 1; -- slot = addslot(state, 0); -- if (slot<0) -- return slot; -- dev->embedded_index = slot; -- } else if (dev->physical_slot != PHYSICAL_SLOT_UNKNOWN) { -- slot = addslot(state, dev->physical_slot); -- if (slot<0) -- return slot; -- dev->index_in_slot = slot; -- } -- } -+ if (pcidev->is_sriov_virtual_function) /* skip sriov VFs, they're handled later */ -+ continue; -+ if (pcidev->physical_slot != prevslot) { -+ index=1; -+ prevslot = pcidev->physical_slot; -+ } -+ else -+ index++; -+ pcidev->index_in_slot = index; -+ } -+ return 0; -+} -+ -+static int set_embedded_index(struct libbiosdevname_state *state) -+{ -+ struct pci_device *pcidev; -+ int index=1; - -- return 0; -+ list_for_each_entry(pcidev, &state->pci_devices, node) { -+ if (pcidev->physical_slot != 0) /* skip non-embedded devices */ -+ continue; -+ if (!is_pci_network(pcidev)) /* only look at PCI network devices */ -+ continue; -+ if (pcidev->is_sriov_virtual_function) /* skip sriov VFs, they're handled later */ -+ continue; -+ if (pcidev->vpd_port != INT_MAX) -+ continue; -+ pcidev->embedded_index = index; -+ pcidev->embedded_index_valid = 1; -+ index++; -+ } -+ return 0; - } - -+ -+ - static void set_sriov_pf_vf(struct libbiosdevname_state *state) - { - struct pci_device *vf; -@@ -774,6 +781,9 @@ int get_pci_devices(struct libbiosdevname_state *state) - rc = set_pci_slots(state); - if(rc) - goto out; -+ -+ set_embedded_index(state); -+ set_pci_slot_index(state); - set_sriov_pf_vf(state); - - out: --- -1.8.3.1 - diff --git a/SOURCES/0001-Scan-for-devid-for-Mellanox-cards.patch b/SOURCES/0001-Scan-for-devid-for-Mellanox-cards.patch deleted file mode 100644 index 84fd9f4..0000000 --- a/SOURCES/0001-Scan-for-devid-for-Mellanox-cards.patch +++ /dev/null @@ -1,58 +0,0 @@ -From cee3f7b101fb22540e2f92067a5c49d3f817e441 Mon Sep 17 00:00:00 2001 -From: Jordan Hargrave -Date: Tue, 25 Feb 2014 15:51:50 -0600 -Subject: [PATCH] Scan for devid for Mellanox cards - ---- - src/eths.c | 15 +++++++++++++++ - src/eths.h | 1 + - 2 files changed, 16 insertions(+) - -diff --git a/src/eths.c b/src/eths.c -index bcd02e1..38bb7fe 100644 ---- a/src/eths.c -+++ b/src/eths.c -@@ -34,6 +34,20 @@ char *pr_ether(char *buf, const int size, const unsigned char *s) - return (buf); - } - -+static int eths_get_devid(const char *devname, int *devid) -+{ -+ char path[PATH_MAX]; -+ char *devidstr = NULL; -+ -+ *devid = -1; -+ snprintf(path, sizeof(path), "/sys/class/net/%s/dev_id", devname); -+ if (sysfs_read_file(path, &devidstr) == 0) { -+ sscanf(devidstr, "%i", devid); -+ free(devidstr); -+ } -+ return NULL; -+} -+ - static int eths_get_ifindex(const char *devname, int *ifindex) - { - int fd, err; -@@ -149,6 +163,7 @@ static void fill_eth_dev(struct network_device *dev) - eths_get_ifindex(dev->kernel_name, &dev->ifindex); - eths_get_hwaddr(dev->kernel_name, dev->dev_addr, sizeof(dev->dev_addr), &dev->arphrd_type); - eths_get_permaddr(dev->kernel_name, dev->perm_addr, sizeof(dev->perm_addr)); -+ eths_get_devid(dev->kernel_name, &dev->devid); - rc = eths_get_info(dev->kernel_name, &dev->drvinfo); - if (rc == 0) - dev->drvinfo_valid = 1; -diff --git a/src/eths.h b/src/eths.h -index f686136..12c278b 100644 ---- a/src/eths.h -+++ b/src/eths.h -@@ -27,6 +27,7 @@ struct network_device { - int arphrd_type; /* e.g. ARPHDR_ETHER */ - int hardware_claimed; /* true when recognized as PCI or PCMCIA and added to list of bios_devices */ - int ifindex; -+ int devid; - }; - - extern void get_eths(struct libbiosdevname_state *state); --- -1.8.4.2 - diff --git a/SOURCES/0001-Stop-reading-VPD-data-once-VPD-R-section-has-been-re.patch b/SOURCES/0001-Stop-reading-VPD-data-once-VPD-R-section-has-been-re.patch deleted file mode 100644 index 446471c..0000000 --- a/SOURCES/0001-Stop-reading-VPD-data-once-VPD-R-section-has-been-re.patch +++ /dev/null @@ -1,43 +0,0 @@ -From cf9db86987ccbc1a0eefd77e7b2f8b1c761be1a9 Mon Sep 17 00:00:00 2001 -From: Jordan Hargrave -Date: Wed, 16 Oct 2013 15:12:06 -0500 -Subject: [PATCH] Stop reading VPD data once VPD-R section has been read - Mellanox cards were taking too long to read entire VPD - ---- - src/pci.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/src/pci.c b/src/pci.c -index 7aa32fc..a2b9faa 100644 ---- a/src/pci.c -+++ b/src/pci.c -@@ -30,6 +30,7 @@ extern int is_valid_smbios; - /* Borrowed from kernel vpd code */ - #define PCI_VPD_LRDT 0x80 - #define PCI_VPD_SRDT_END 0x78 -+#define PCI_VPDR_TAG 0x90 - - #define PCI_VPD_SRDT_LEN_MASK 0x7 - #define PCI_VPD_LRDT_TAG_SIZE 3 -@@ -71,7 +72,7 @@ static int pci_vpd_size(struct pci_device *pdev, int fd) - tag = buf[0] & ~PCI_VPD_SRDT_LEN_MASK; - off += PCI_VPD_SRDT_TAG_SIZE + pci_vpd_srdt_size(buf); - } -- if (tag == 0 || tag == 0xFF || tag == PCI_VPD_SRDT_END) -+ if (tag == 0 || tag == 0xFF || tag == PCI_VPD_SRDT_END || tag == PCI_VPDR_TAG) - break; - } - return off; -@@ -125,7 +126,7 @@ static int parse_vpd(struct libbiosdevname_state *state, struct pci_device *pdev - int i, j, k, isz, jsz, port, func, pfi; - struct pci_device *vf; - -- i = pci_vpd_find_tag(vpd, 0, len, 0x90); -+ i = pci_vpd_find_tag(vpd, 0, len, PCI_VPDR_TAG); - if (i < 0) - return 1; - isz = pci_vpd_lrdt_size(&vpd[i]); --- -1.8.5.3 - diff --git a/SOURCES/0001-Update-help-and-man-to-cover-all-possible-arguments.patch b/SOURCES/0001-Update-help-and-man-to-cover-all-possible-arguments.patch deleted file mode 100644 index 08c4f67..0000000 --- a/SOURCES/0001-Update-help-and-man-to-cover-all-possible-arguments.patch +++ /dev/null @@ -1,68 +0,0 @@ -From b02989fe9544311179cd9b333f9d9e450410c6bb Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?V=C3=A1clav=20Pavl=C3=ADn?= -Date: Tue, 9 Apr 2013 14:25:14 +0200 -Subject: [PATCH] Update help and man to cover all possible arguments - ---- - biosdevname.1 | 8 ++++---- - src/bios_dev_name.c | 12 ++++++------ - 2 files changed, 10 insertions(+), 10 deletions(-) - -diff --git a/biosdevname.1 b/biosdevname.1 -index 7067a56..22a53bd 100644 ---- a/biosdevname.1 -+++ b/biosdevname.1 -@@ -31,16 +31,16 @@ Treat [args] as ethernet devs - .B \-d, \-\-debug - Enable debugging - .TP --.B \-\-policy \fI[physical|all_ethN] -+.B \-p, \-\-policy \fI[physical|all_ethN] - .TP --.B \-\-prefix \fI[string] -+.B \-P, \-\-prefix \fI[string] - string use for embedded NICs in the physical policy (default=em) - .TP --.B \-\-nopirq -+.B \-x, \-\-nopirq - Do not use $PIR table for mapping PCI device to slot. Some BIOS have - incorrect values. - .TP --.B \-\-smbios \fI[x.y] -+.B \-s, \-\-smbios \fI[x.y] - Require minimum SMBIOS version x.y - .SH POLICIES - .br -diff --git a/src/bios_dev_name.c b/src/bios_dev_name.c -index 6084d28..5001f85 100644 ---- a/src/bios_dev_name.c -+++ b/src/bios_dev_name.c -@@ -25,11 +25,11 @@ static void usage(void) - fprintf(stderr, " Options:\n"); - fprintf(stderr, " -i or --interface treat [args] as ethernet devs\n"); - fprintf(stderr, " -d or --debug enable debugging\n"); -- fprintf(stderr, " --policy [physical | all_ethN ]\n"); -- fprintf(stderr, " --prefix [string] string use for embedded NICs (default='em')\n"); -- fprintf(stderr, " --smbios [x.y] Require SMBIOS x.y or greater\n"); -- fprintf(stderr, " --nopirq Don't use $PIR table for slot numbers\n"); -- fprintf(stderr, " --version Show biosdevname version\n"); -+ fprintf(stderr, " -p or --policy [physical | all_ethN ]\n"); -+ fprintf(stderr, " -P or --prefix [string] string use for embedded NICs (default='em')\n"); -+ fprintf(stderr, " -s or --smbios [x.y] Require SMBIOS x.y or greater\n"); -+ fprintf(stderr, " -x or --nopirq Don't use $PIR table for slot numbers\n"); -+ fprintf(stderr, " -v or --version Show biosdevname version\n"); - fprintf(stderr, " Example: biosdevname -i eth0\n"); - fprintf(stderr, " returns: em1\n"); - fprintf(stderr, " when eth0 is an embedded NIC with label '1' on the chassis.\n"); -@@ -68,7 +68,7 @@ parse_opts(int argc, char **argv) - {0, 0, 0, 0} - }; - c = getopt_long(argc, argv, -- "dinp:", -+ "dip:", - long_options, &option_index); - if (c == -1) - break; --- -1.8.1.4 - diff --git a/SOURCES/biosdevname-0.5.0-rules.patch b/SOURCES/biosdevname-0.5.0-rules.patch deleted file mode 100644 index bf673b1..0000000 --- a/SOURCES/biosdevname-0.5.0-rules.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/biosdevname.rules.in b/biosdevname.rules.in -index 6379164..2e73207 100644 ---- a/biosdevname.rules.in -+++ b/biosdevname.rules.in -@@ -1,7 +1,12 @@ - SUBSYSTEM!="net", GOTO="netdevicename_end" --KERNEL!="eth*", GOTO="netdevicename_end" - ACTION!="add", GOTO="netdevicename_end" - NAME=="?*", GOTO="netdevicename_end" -+ATTR{type}!="1", GOTO="netdevicename_end" -+ENV{DEVTYPE}=="?*", GOTO="netdevicename_end" -+ -+ -+# whitelist all Dell systems -+ATTR{[dmi/id]sys_vendor}=="Dell*", ENV{UDEV_BIOSDEVNAME}="1" - - # kernel command line "biosdevname={0|1}" can turn off/on biosdevname - IMPORT{cmdline}="biosdevname" -@@ -11,13 +16,13 @@ ENV{biosdevname}=="?*", ENV{UDEV_BIOSDEVNAME}="$env{biosdevname}" - ENV{UDEV_BIOSDEVNAME}=="0", GOTO="netdevicename_end" - ENV{UDEV_BIOSDEVNAME}=="1", GOTO="netdevicename_start" - --# uncomment the next line for biosdevname to be off by default --# GOTO="netdevicename_end" -+# off by default -+GOTO="netdevicename_end" - - LABEL="netdevicename_start" - - # using NAME= instead of setting INTERFACE_NAME, so that persistent - # names aren't generated for these devices, they are "named" on each boot. --PROGRAM="/sbin/biosdevname --policy physical -i %k", NAME="%c", OPTIONS+="string_escape=replace" -+SUBSYSTEMS=="pci", PROGRAM="/usr/sbin/biosdevname --smbios 2.6 --nopirq --policy physical -i %k", NAME="%c", OPTIONS+="string_escape=replace" - - LABEL="netdevicename_end" diff --git a/SOURCES/biosdevname-0.6.1-rules.patch b/SOURCES/biosdevname-0.6.1-rules.patch new file mode 100644 index 0000000..cb45e6c --- /dev/null +++ b/SOURCES/biosdevname-0.6.1-rules.patch @@ -0,0 +1,31 @@ +diff --git a/biosdevname.rules.in b/biosdevname.rules.in +index 0a32aa5..52aaea5 100644 +--- a/biosdevname.rules.in ++++ b/biosdevname.rules.in +@@ -4,6 +4,9 @@ NAME=="?*", GOTO="netdevicename_end" + ATTR{type}!="1", GOTO="netdevicename_end" + ENV{DEVTYPE}=="?*", GOTO="netdevicename_end" + ++# whitelist all Dell systems ++ATTR{[dmi/id]sys_vendor}=="Dell*", ENV{UDEV_BIOSDEVNAME}="1" ++ + # kernel command line "biosdevname={0|1}" can turn off/on biosdevname + IMPORT{cmdline}="biosdevname" + ENV{biosdevname}=="?*", ENV{UDEV_BIOSDEVNAME}="$env{biosdevname}" +@@ -12,13 +15,13 @@ ENV{biosdevname}=="?*", ENV{UDEV_BIOSDEVNAME}="$env{biosdevname}" + ENV{UDEV_BIOSDEVNAME}=="0", GOTO="netdevicename_end" + ENV{UDEV_BIOSDEVNAME}=="1", GOTO="netdevicename_start" + +-# uncomment the next line for biosdevname to be off by default +-# GOTO="netdevicename_end" ++# off by default ++GOTO="netdevicename_end" + + LABEL="netdevicename_start" + + # using NAME= instead of setting INTERFACE_NAME, so that persistent + # names aren't generated for these devices, they are "named" on each boot. +-SUBSYSTEMS=="pci", PROGRAM="/sbin/biosdevname --policy physical -i %k", NAME="%c", OPTIONS+="string_escape=replace" ++SUBSYSTEMS=="pci", PROGRAM="/sbin/biosdevname --smbios 2.6 --nopirq --policy physical -i %k", NAME="%c" OPTIONS+="string_escape=replace" + + LABEL="netdevicename_end" diff --git a/SPECS/biosdevname.spec b/SPECS/biosdevname.spec index 4e1e9b7..045388e 100644 --- a/SPECS/biosdevname.spec +++ b/SPECS/biosdevname.spec @@ -1,6 +1,6 @@ Name: biosdevname -Version: 0.5.0 -Release: 10%{?dist} +Version: 0.6.1 +Release: 2%{?dist} Summary: Udev helper for naming devices per BIOS names Group: System Environment/Base @@ -21,16 +21,8 @@ BuildRequires: automake # for ownership of /etc/udev/rules.d Requires: udev -Patch0: 0001-Update-help-and-man-to-cover-all-possible-arguments.patch -Patch1: biosdevname-0.5.0-rules.patch -Patch2: 0001-CoverityScan-update.patch -Patch3: 0001-Fix-regression-introduced-by-the-addslot-function.patch -Patch4: 0001-Place-udev-rules-to-usr-lib.patch -Patch5: 0001-Stop-reading-VPD-data-once-VPD-R-section-has-been-re.patch -Patch6: 0001-Scan-for-devid-for-Mellanox-cards.patch -Patch7: 0001-Add-port-structure-to-PCI-device-handle-multiple-por.patch -Patch8: 0001-Cleanup-SRIOV-scanner-code.patch -Patch9: 0001-Add-port-code-for-Mellanox-driver.patch +Patch0: biosdevname-0.6.1-rules.patch +Patch1: 0001-Place-udev-rules-to-usr-lib.patch %description biosdevname in its simplest form takes a kernel device name as an @@ -43,14 +35,6 @@ name (e.g. eth0). %setup -q %patch0 -p1 %patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 -%patch9 -p1 %build @@ -76,6 +60,12 @@ make install install-data DESTDIR=%{buildroot} %changelog +* Thu Jan 08 2015 Michal Sekletar - 0.6.1-2 +- fix up incorrectly generated patch + +* Fri Dec 05 2014 Michal Sekletar - 0.6.1-1 +- rebase to 0.6.1 (#1145572) + * Tue Mar 18 2014 Michal Sekletar - 0.5.0-10 - rename Mellanox card correctly (#1067135)