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