1. 23 3月, 2021 12 次提交
  2. 18 3月, 2021 1 次提交
  3. 16 3月, 2021 1 次提交
  4. 23 2月, 2021 5 次提交
  5. 13 2月, 2021 5 次提交
  6. 09 2月, 2021 11 次提交
  7. 06 2月, 2021 5 次提交
    • B
      ice: remove dead code · 12aae8f1
      Bruce Allan 提交于
      The check for a NULL pf pointer is moot since the earlier declaration and
      assignment of struct device *dev already de-referenced the pointer.  Also,
      the only caller of ice_set_dflt_mib() already ensures pf is not NULL.
      
      Cc: Dave Ertman <david.m.ertman@intel.com>
      Reported-by: Nkernel test robot <lkp@intel.com>
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NBruce Allan <bruce.w.allan@intel.com>
      Tested-by: NTony Brelinski <tonyx.brelinski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      12aae8f1
    • B
      ice: use flex_array_size where possible · 11404310
      Bruce Allan 提交于
      Use the flex_array_size() helper with the recently added flexible array
      members in structures.
      Signed-off-by: NBruce Allan <bruce.w.allan@intel.com>
      Tested-by: NTony Brelinski <tonyx.brelinski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      11404310
    • G
      ice: Replace one-element array with flexible-array member · e94c0df9
      Gustavo A. R. Silva 提交于
      There is a regular need in the kernel to provide a way to declare having
      a dynamically sized set of trailing elements in a structure. Kernel code
      should always use “flexible array members”[1] for these cases. The older
      style of one-element or zero-length arrays should no longer be used[2].
      
      Refactor the code according to the use of a flexible-array member in
      struct ice_res_tracker, instead of a one-element array and use the
      struct_size() helper to calculate the size for the allocations.
      
      Also, notice that the code below suggests that, currently, two too many
      bytes are being allocated with devm_kzalloc(), as the total number of
      entries (pf->irq_tracker->num_entries) for pf->irq_tracker->list[] is
      _vectors_ and sizeof(*pf->irq_tracker) also includes the size of the
      one-element array _list_ in struct ice_res_tracker.
      
      drivers/net/ethernet/intel/ice/ice_main.c:3511:
      3511         /* populate SW interrupts pool with number of OS granted IRQs. */
      3512         pf->num_avail_sw_msix = (u16)vectors;
      3513         pf->irq_tracker->num_entries = (u16)vectors;
      3514         pf->irq_tracker->end = pf->irq_tracker->num_entries;
      
      With this change, the right amount of dynamic memory is now allocated
      because, contrary to one-element arrays which occupy at least as much
      space as a single object of the type, flexible-array members don't
      occupy such space in the containing structure.
      
      [1] https://en.wikipedia.org/wiki/Flexible_array_member
      [2] https://www.kernel.org/doc/html/v5.9-rc1/process/deprecated.html#zero-length-and-one-element-arraysBuilt-tested-by: Nkernel test robot <lkp@intel.com>
      Signed-off-by: NGustavo A. R. Silva <gustavoars@kernel.org>
      Tested-by: NTony Brelinski <tonyx.brelinski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      e94c0df9
    • J
      ice: display stored UNDI firmware version via devlink info · e67fbcfb
      Jacob Keller 提交于
      Just as we recently added support for other stored firmware flash
      versions, support display of the stored UNDI Option ROM version via
      devlink info.
      
      To do this, we need to introduce a new ice_get_inactive_orom_ver
      function. This is a little trickier than with other flash versions. The
      Option ROM version data was being read from a special "Boot
      Configuration" block of the NVM Preserved Field Area. This block only
      contains the *active* Option ROM version data. It is populated when the
      device firmware finishes updating the Option ROM.
      
      This method is ineffective at reading the stored Option ROM version
      data. Instead of reading from this section of the flash, replace this
      version extraction with one which locates the Combo Version information
      from within the Option ROM binary.
      
      This data is stored within the Option ROM at a 512 byte offset, in
      a simple structured format. The structure uses a simple modulo 256
      checksum for integrity verification. Scan through the Option ROM to
      locate the CIVD data section, and extract the Combo Version.
      
      Refactor ice_get_orom_ver_info so that it takes the bank select
      enumeration parameter. Use this to implement ice_get_inactive_orom_ver.
      
      Although all ice devices have a Boot Configuration block in the NVM PFA,
      not all devices have a valid Option ROM. In this case, the old
      ice_get_orom_ver_info would "succeed" but report a version of all
      zeros. The new implementation would fail to locate the $CIV section in
      the Option ROM and report an error. Thus, we must ensure that
      ice_init_nvm does not fail if ice_get_orom_ver_info fails.
      
      Use the new ice_get_inactive_orom_ver to allow reporting the Option ROM
      versions for a pending update via devlink info.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NTony Brelinski <tonyx.brelinski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      e67fbcfb
    • J
      ice: display stored netlist versions via devlink info · e120a9ab
      Jacob Keller 提交于
      Add a function to read the inactive netlist bank for version
      information. To support this, refactor how we read the netlist version
      data. Instead of using the firmware AQ interface with a module ID, read
      from the flash as a flat NVM, using ice_read_flash_module.
      
      This change requires a slight adjustment to the offset values used, as
      reading from the flat NVM includes the type field (which was stripped by
      firmware previously). Cleanup the macro names and move them to
      ice_type.h. For clarity in how we calculate the offsets and so that
      programmers can easily map the offset value to the data sheet, use
      a wrapper macro to account for the offset adjustments.
      
      Use the newly added ice_get_inactive_netlist_ver function to extract the
      version data from the pending netlist module update. Add the stored
      variants of "fw.netlist", and "fw.netlist.build" to the info version map
      array.
      
      With this change, we now report the "fw.netlist" and "fw.netlist.build"
      versions into the stored section of the devlink info report. As with the
      main NVM module versions, if there is no pending update, we report the
      currently active values as stored.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NTony Brelinski <tonyx.brelinski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      e120a9ab