IB/hfi1: Expand reported serial number
authorIra Weiny <ira.weiny@intel.com>
Thu, 28 Jul 2016 01:09:40 +0000 (21:09 -0400)
committerDoug Ledford <dledford@redhat.com>
Wed, 3 Aug 2016 02:46:21 +0000 (22:46 -0400)
Expand the serial number space by using more bits
from the GUID.

Reviewed-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hfi1/chip.c

index becc7b11e31ea9b84a851664db89bafcdd1caca6..c9368349661472e9cc6c5a9779e88033cde69acf 100644 (file)
@@ -14601,8 +14601,14 @@ struct hfi1_devdata *hfi1_init_dd(struct pci_dev *pdev,
        /* set up LCB access - must be after set_up_interrupts() */
        init_lcb_access(dd);
 
+       /*
+        * Serial number is created from the base guid:
+        * [27:24] = base guid [38:35]
+        * [23: 0] = base guid [23: 0]
+        */
        snprintf(dd->serial, SERIAL_MAX, "0x%08llx\n",
-                dd->base_guid & 0xFFFFFF);
+                (dd->base_guid & 0xFFFFFF) |
+                    ((dd->base_guid >> 11) & 0xF000000));
 
        dd->oui1 = dd->base_guid >> 56 & 0xFF;
        dd->oui2 = dd->base_guid >> 48 & 0xFF;