dd65c9
From 8ad860fa8e344c71fb3bb00a15b25d41e3c61b35 Mon Sep 17 00:00:00 2001
83b94d
From: Lukas Nykryn <lnykryn@redhat.com>
83b94d
Date: Tue, 15 Aug 2017 12:30:03 +0200
83b94d
Subject: [PATCH] Revert "udev: net_id: add support for phys_port_name
83b94d
 attribute (#4506)"
83b94d
83b94d
This reverts commit 192545bc67fed763ac54761ca067b9c2f93ecdd1.
83b94d
83b94d
This caused change of the names for sfc driver.
83b94d
83b94d
Resolves: #1477285
83b94d
---
83b94d
 src/udev/udev-builtin-net_id.c | 24 ++++++------------------
83b94d
 1 file changed, 6 insertions(+), 18 deletions(-)
83b94d
83b94d
diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c
c62b8e
index 7c154355dd..19e1f2631a 100644
83b94d
--- a/src/udev/udev-builtin-net_id.c
83b94d
+++ b/src/udev/udev-builtin-net_id.c
83b94d
@@ -38,7 +38,7 @@
83b94d
  *   o<index>[d<dev_port>]                 -- on-board device index number
83b94d
  *   s<slot>[f<function>][d<dev_port>]     -- hotplug slot index number
83b94d
  *   x<MAC>                                -- MAC address
83b94d
- *   [P<domain>]p<bus>s<slot>[f<function>][n<phys_port_name>|d<dev_id>/<dev_port>]
83b94d
+ *   [P<domain>]p<bus>s<slot>[f<function>][d<dev_id>/<dev_port>]
83b94d
  *                                         -- PCI geographical location
83b94d
  *   [P<domain>]p<bus>s<slot>[f<function>][u<port>][..][c<config>][i<interface>]
83b94d
  *                                         -- USB port number chain
83b94d
@@ -134,7 +134,7 @@ static int dev_pci_onboard(struct udev_device *dev, struct netnames *names) {
83b94d
         unsigned dev_port = 0;
83b94d
         size_t l;
83b94d
         char *s;
83b94d
-        const char *attr, *port_name;
83b94d
+        const char *attr;
83b94d
         int idx;
83b94d
 
83b94d
         /* ACPI _DSM  -- device specific method for naming a PCI or PCI Express device */
83b94d
@@ -161,15 +161,10 @@ static int dev_pci_onboard(struct udev_device *dev, struct netnames *names) {
83b94d
         if (attr)
83b94d
                 dev_port = strtol(attr, NULL, 10);
83b94d
 
83b94d
-        /* kernel provided front panel port name for multiple port PCI device */
83b94d
-        port_name = udev_device_get_sysattr_value(dev, "phys_port_name");
83b94d
-
83b94d
         s = names->pci_onboard;
83b94d
         l = sizeof(names->pci_onboard);
83b94d
         l = strpcpyf(&s, l, "o%d", idx);
83b94d
-        if (port_name)
83b94d
-                l = strpcpyf(&s, l, "n%s", port_name);
83b94d
-        else if (dev_port > 0)
83b94d
+        if (dev_port > 0)
83b94d
                 l = strpcpyf(&s, l, "d%d", dev_port);
83b94d
         if (l == 0)
83b94d
                 names->pci_onboard[0] = '\0';
83b94d
@@ -204,7 +199,7 @@ static int dev_pci_slot(struct udev_device *dev, struct netnames *names) {
83b94d
         unsigned domain, bus, slot, func, dev_id = 0;
83b94d
         size_t l;
83b94d
         char *s;
83b94d
-        const char *attr, *port_name;
83b94d
+        const char *attr;
83b94d
         struct udev_device *pci = NULL;
83b94d
         char slots[256], str[256];
83b94d
         _cleanup_closedir_ DIR *dir = NULL;
83b94d
@@ -225,9 +220,6 @@ static int dev_pci_slot(struct udev_device *dev, struct netnames *names) {
83b94d
                 }
83b94d
         }
83b94d
 
83b94d
-        /* kernel provided front panel port name for multiple port PCI device */
83b94d
-        port_name = udev_device_get_sysattr_value(dev, "phys_port_name");
83b94d
-
83b94d
         /* compose a name based on the raw kernel's PCI bus, slot numbers */
83b94d
         s = names->pci_path;
83b94d
         l = sizeof(names->pci_path);
83b94d
@@ -236,9 +228,7 @@ static int dev_pci_slot(struct udev_device *dev, struct netnames *names) {
83b94d
         l = strpcpyf(&s, l, "p%us%u", bus, slot);
83b94d
         if (func > 0 || is_pci_multifunction(names->pcidev))
83b94d
                 l = strpcpyf(&s, l, "f%d", func);
83b94d
-        if (port_name)
83b94d
-                l = strpcpyf(&s, l, "n%s", port_name);
83b94d
-        else if (dev_id > 0)
83b94d
+        if (dev_id > 0)
83b94d
                 l = strpcpyf(&s, l, "d%d", dev_id);
83b94d
         if (l == 0)
83b94d
                 names->pci_path[0] = '\0';
83b94d
@@ -288,9 +278,7 @@ static int dev_pci_slot(struct udev_device *dev, struct netnames *names) {
83b94d
                 l = strpcpyf(&s, l, "s%d", hotplug_slot);
83b94d
                 if (func > 0 || is_pci_multifunction(names->pcidev))
83b94d
                         l = strpcpyf(&s, l, "f%d", func);
83b94d
-                if (port_name)
83b94d
-                        l = strpcpyf(&s, l, "n%s", port_name);
83b94d
-                else if (dev_id > 0)
83b94d
+                if (dev_id > 0)
83b94d
                         l = strpcpyf(&s, l, "d%d", dev_id);
83b94d
                 if (l == 0)
83b94d
                         names->pci_slot[0] = '\0';