#427 igb-5.2.9.2 cosmetic netdev_info() for MAC

closed
Todd Fujinaka
None
standalone_driver
1
2015-02-12
2014-07-29
Lonnie Abelbeck
No

Hi,

Using Linux Kernel 2.6.35, with the new igb-5.2.9.2, I'm seeing a cosmetic issue with displaying the MAC address

==== igb-5.2.5/src/igb_main.c vs. igb-5.2.9.2/src/igb_main.c
    for (i = 0; i < 6; i++)
-       printk("%2.2x%c", netdev->dev_addr[i], i == 5 ? '\n' : ':');
+       netdev_info(netdev, "%2.2x%c", netdev->dev_addr[i], i ==
+               5 ? '\n' : ':');
====

The 5.2.9.2 output now is:

igb 0000:00:14.0: PCI INT A -> GSI 20 (level, low) -> IRQ 20
igb 0000:00:14.0: setting latency timer to 64
igb 0000:00:14.0: irq 46 for MSI/MSI-X
igb 0000:00:14.0: irq 47 for MSI/MSI-X
igb 0000:00:14.0: Intel(R) Gigabit Ethernet Network Connection
igb 0000:00:14.0: eth0: (PCIe:integrated:integrated) 
igb 0000:00:14.0: eth0: MAC: 
igb 0000:00:14.0: eth0: 00:
igb 0000:00:14.0: eth0: 90:
igb 0000:00:14.0: eth0: 0b:
igb 0000:00:14.0: eth0: 99:
igb 0000:00:14.0: eth0: 98:
igb 0000:00:14.0: eth0: 97
igb 0000:00:14.0: eth0: PBA No: 001800-000
igb 0000:00:14.0: LRO is disabled
igb 0000:00:14.0: Using MSI-X interrupts. 1 rx queue(s), 1 tx queue(s)

It seems netdev_info() must be called once with a complete MAC string.

Discussion

  • Todd Fujinaka
    Todd Fujinaka
    2014-07-29

    Whoops. I'll fix that right away but it probably won't be out until the next release.

    Thanks.

     
  • Todd Fujinaka
    Todd Fujinaka
    2014-07-29

    • assigned_to: Todd Fujinaka
    • Group: in-kernel_driver --> standalone_driver
     
  • Thanks Todd,

    This patch fixes the problem for me.

    --- igb-5.2.9.2/src/igb_main.c.orig 2014-07-29 17:53:55.000000000 -0500
    +++ igb-5.2.9.2/src/igb_main.c  2014-07-29 17:55:09.000000000 -0500
    @@ -2543,7 +2543,7 @@
        u8 pba_str[E1000_PBANUM_LENGTH];
        s32 ret_val;
        static int global_quad_port_a; /* global quad port a indication */
    -   int i, err, pci_using_dac;
    +   int err, pci_using_dac;
        static int cards_found;
    
        err = pci_enable_device_mem(pdev);
    @@ -2929,10 +2929,9 @@
              (hw->bus.width == e1000_bus_width_pcie_x2) ? "Width x2" :
              (hw->bus.width == e1000_bus_width_pcie_x1) ? "Width x1" :
              (hw->mac.type == e1000_i354) ? "integrated" : "unknown"));
    -   dev_info(pci_dev_to_dev(pdev), "%s: MAC: ", netdev->name);
    -   for (i = 0; i < 6; i++)
    -       netdev_info(netdev, "%2.2x%c", netdev->dev_addr[i], i ==
    -               5 ? '\n' : ':');
    +   netdev_info(netdev, "MAC: %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n",
    +       netdev->dev_addr[0], netdev->dev_addr[1], netdev->dev_addr[2],
    +       netdev->dev_addr[3], netdev->dev_addr[4], netdev->dev_addr[5]);
    
        ret_val = e1000_read_pba_string(hw, pba_str, E1000_PBANUM_LENGTH);
        if (ret_val)
    
     
  • Todd Fujinaka
    Todd Fujinaka
    2014-07-30

    Here's our actual patch:

    --- a/src/CORE/igb_main.c
    +++ b/src/CORE/igb_main.c
    @@ -2874,7 +2874,7 @@ static int igb_probe(struct pci_dev *pdev,
        u8 pba_str[E1000_PBANUM_LENGTH];
        s32 ret_val;
        static int global_quad_port_a; /* global quad port a indication */
    -   int i, err, pci_using_dac;
    +   int err, pci_using_dac;
        static int cards_found;
    
        err = pci_enable_device_mem(pdev);
    @@ -3338,10 +3338,7 @@ static int igb_probe(struct pci_dev *pdev,
              (hw->bus.width == e1000_bus_width_pcie_x1) ? "Width x1" :
              "unknown"));
    -   dev_info(pci_dev_to_dev(pdev), "%s: MAC: ", netdev->name);
    -   for (i = 0; i < 6; i++)
    -       netdev_info(netdev, "%2.2x%c", netdev->dev_addr[i], i ==
    -               5 ? '\n' : ':');
    +   netdev_info(netdev, "MAC: %pM\n", netdev->dev_addr);
    
        ret_val = e1000_read_pba_string(hw, pba_str, E1000_PBANUM_LENGTH);
        if (ret_val)
    
     
  • Todd Fujinaka
    Todd Fujinaka
    2014-07-30

    Fixed in igb-5.2.9.3

     
  • Todd Fujinaka
    Todd Fujinaka
    2014-07-30

    • status: open --> closed
     
  • Todd, Thanks for the quick official fix. Much appreciated.