[PATCH][Cosmic][SRU Bionic] hinic: Link the logical network device to the pci device in sysfs

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH][Cosmic][SRU Bionic] hinic: Link the logical network device to the pci device in sysfs

dann frazier-4
BugLink: https://bugs.launchpad.net/bugs/1783138

Otherwise interfaces get exposed under /sys/devices/virtual, which
doesn't give udev the context it needs for PCI-based predictable
interface names.

Signed-off-by: dann frazier <[hidden email]>
Signed-off-by: David S. Miller <[hidden email]>
(cherry picked from commit 7856e8616273098dc6c09a6e084afd98a283ff0d)
Signed-off-by: dann frazier <[hidden email]>
---
 drivers/net/ethernet/huawei/hinic/hinic_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/huawei/hinic/hinic_main.c b/drivers/net/ethernet/huawei/hinic/hinic_main.c
index 5b122728dcb47..09e9da10b7865 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_main.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_main.c
@@ -983,6 +983,7 @@ static int nic_dev_init(struct pci_dev *pdev)
  hinic_hwdev_cb_register(nic_dev->hwdev, HINIC_MGMT_MSG_CMD_LINK_STATUS,
  nic_dev, link_status_event_handler);
 
+ SET_NETDEV_DEV(netdev, &pdev->dev);
  err = register_netdev(netdev);
  if (err) {
  dev_err(&pdev->dev, "Failed to register netdev\n");
--
2.18.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK/APPLIED[C/Unstable]: [PATCH][Cosmic][SRU Bionic] hinic: Link the logical network device to the pci device in sysfs

Seth Forshee
On Tue, Jul 31, 2018 at 01:41:55PM -0600, dann frazier wrote:

> BugLink: https://bugs.launchpad.net/bugs/1783138
>
> Otherwise interfaces get exposed under /sys/devices/virtual, which
> doesn't give udev the context it needs for PCI-based predictable
> interface names.
>
> Signed-off-by: dann frazier <[hidden email]>
> Signed-off-by: David S. Miller <[hidden email]>
> (cherry picked from commit 7856e8616273098dc6c09a6e084afd98a283ff0d)
> Signed-off-by: dann frazier <[hidden email]>

Simple change, clean cherry pick, positive testing.

Acked-by: Seth Forshee <[hidden email]>

Applied to cosmic/master-next and unstable/master, thanks!

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [PATCH][Cosmic][SRU Bionic] hinic: Link the logical network device to the pci device in sysfs

Kleber Souza
In reply to this post by dann frazier-4
On 07/31/18 21:41, dann frazier wrote:

> BugLink: https://bugs.launchpad.net/bugs/1783138
>
> Otherwise interfaces get exposed under /sys/devices/virtual, which
> doesn't give udev the context it needs for PCI-based predictable
> interface names.
>
> Signed-off-by: dann frazier <[hidden email]>
> Signed-off-by: David S. Miller <[hidden email]>
> (cherry picked from commit 7856e8616273098dc6c09a6e084afd98a283ff0d)
> Signed-off-by: dann frazier <[hidden email]>
> ---
>  drivers/net/ethernet/huawei/hinic/hinic_main.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/huawei/hinic/hinic_main.c b/drivers/net/ethernet/huawei/hinic/hinic_main.c
> index 5b122728dcb47..09e9da10b7865 100644
> --- a/drivers/net/ethernet/huawei/hinic/hinic_main.c
> +++ b/drivers/net/ethernet/huawei/hinic/hinic_main.c
> @@ -983,6 +983,7 @@ static int nic_dev_init(struct pci_dev *pdev)
>   hinic_hwdev_cb_register(nic_dev->hwdev, HINIC_MGMT_MSG_CMD_LINK_STATUS,
>   nic_dev, link_status_event_handler);
>  
> + SET_NETDEV_DEV(netdev, &pdev->dev);
>   err = register_netdev(netdev);
>   if (err) {
>   dev_err(&pdev->dev, "Failed to register netdev\n");
>

As stated on the bug report, it can break some users in some
configurations but creating predictable interface names is the right
thing to do.

Acked-by: Kleber Sacilotto de Souza <[hidden email]>

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team