Skip to content
  1. Mar 09, 2020
  2. Mar 06, 2020
    • Jacob Keller's avatar
      nfp: Use pci_get_dsn() · 61600112
      Jacob Keller authored
      
      
      Use the newly added pci_get_dsn() function for obtaining the 64-bit
      Device Serial Number in the nfp6000_read_serial and
      nfp_6000_get_interface functions.
      
      pci_get_dsn() reports the Device Serial number as a u64 value created by
      combining two pci_read_config_dword functions. The lower 16 bits
      represent the device interface value, and the next 48 bits represent the
      serial value. Use put_unaligned_be32 and put_unaligned_be16 to convert
      the serial value portion into a Big Endian formatted serial u8 array.
      
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      61600112
    • Jacob Keller's avatar
      ixgbe: Use pci_get_dsn() · f998958d
      Jacob Keller authored
      
      
      Replace the open-coded implementation for reading the PCIe DSN with
      pci_get_dsn().
      
      The original code used a simple for-loop to read the bytes in order into
      a buffer one byte at a time.
      
      The pci_get_dsn() function returns the DSN as a u64, correctly ordering
      the upper and lower 32 bit dwords. Simplify the display code by using
      %016llX to display the u64 DSN.
      
      This should have equivalent behavior on both Little and Big Endian
      systems. The bus will have correctly ordered the dwords in the CPU
      endian format, while pci_get_dsn() will correctly order the lower and
      higher dwords into a u64.
      
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f998958d
    • Jacob Keller's avatar
      ice: Use pci_get_dsn() · ceb2f007
      Jacob Keller authored
      
      
      Replace the open-coded implementation for reading the PCIe DSN with
      pci_get_dsn().
      
      The pci_get_dsn() function will perform two pci_read_config_dword calls
      to read the lower and upper config dwords. It bitwise ORs them into
      a u64 value. Instead of using put_unaligned_le32 to convert the value to
      LE32 format, just use the %016llX printf specifier. This will print the
      u64 correct, putting the most significant byte of the value first. Since
      pci_get_dsn() correctly orders the two dwords into a u64, this should
      produce equivalent results in less code.
      
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ceb2f007
    • Jacob Keller's avatar
      bnxt_en: Use pci_get_dsn() · 8d85b75b
      Jacob Keller authored
      
      
      Replace the open-coded implementation for reading the PCIe DSN with
      pci_get_dsn().
      
      Use of put_unaligned_le64 should be correct. pci_get_dsn() will perform
      two pci_read_config_dword calls. The first dword will be placed in the
      first 32 bits of the u64, while the second dword will be placed in the
      upper 32 bits of the u64.
      
      On Little Endian systems, the least significant byte comes first, which
      will be the least significant byte of the first dword, followed by the
      least significant byte of the second dword. Since the _le32 variations
      do not perform byte swapping, we will correctly copy the dwords into the
      dsn[] array in the same order as before.
      
      On Big Endian systems, the most significant byte of the second dword
      will come first. put_unaligned_le64 will perform a CPU_TO_LE64, which
      will swap things correctly before copying. This should also end up with
      the correct bytes in the dsn[] array.
      
      While at it, fix a small typo in the netdev_info error message when the
      DSN cannot be read.
      
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Cc: Michael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8d85b75b
    • Matthew Wilcox (Oracle)'s avatar
      ibmveth: Remove unused page_offset macro · 367ab29e
      Matthew Wilcox (Oracle) authored
      
      
      We already have a function called page_offset(), and this macro
      is unused, so just delete it.
      
      Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      367ab29e
  3. Mar 05, 2020
Loading