1. 23 5月, 2020 3 次提交
  2. 22 5月, 2020 17 次提交
  3. 15 5月, 2020 2 次提交
    • J
      xdp: For Intel AF_XDP drivers add XDP frame_sz · 2a637c5b
      Jesper Dangaard Brouer 提交于
      Intel drivers implement native AF_XDP zerocopy in separate C-files,
      that have its own invocation of bpf_prog_run_xdp(). The setup of
      xdp_buff is also handled in separately from normal code path.
      
      This patch update XDP frame_sz for AF_XDP zerocopy drivers i40e, ice
      and ixgbe, as the code changes needed are very similar.  Introduce a
      helper function xsk_umem_xdp_frame_sz() for calculating frame size.
      Signed-off-by: NJesper Dangaard Brouer <brouer@redhat.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Acked-by: NBjörn Töpel <bjorn.topel@intel.com>
      Cc: intel-wired-lan@lists.osuosl.org
      Cc: Magnus Karlsson <magnus.karlsson@intel.com>
      Link: https://lore.kernel.org/bpf/158945347511.97035.8536753731329475655.stgit@firesoul
      2a637c5b
    • J
      ice: Add XDP frame size to driver · d4ecdbf7
      Jesper Dangaard Brouer 提交于
      This driver uses different memory models depending on PAGE_SIZE at
      compile time. For PAGE_SIZE 4K it uses page splitting, meaning for
      normal MTU frame size is 2048 bytes (and headroom 192 bytes). For
      larger MTUs the driver still use page splitting, by allocating
      order-1 pages (8192 bytes) for RX frames. For PAGE_SIZE larger than
      4K, driver instead advance its rx_buffer->page_offset with the frame
      size "truesize".
      
      For XDP frame size calculations, this mean that in PAGE_SIZE larger
      than 4K mode the frame_sz change on a per packet basis. For the page
      split 4K PAGE_SIZE mode, xdp.frame_sz is more constant and can be
      updated once outside the main NAPI loop.
      
      The default setting in the driver uses build_skb(), which provides
      the necessary headroom and tailroom for XDP-redirect in RX-frame
      (in both modes).
      
      There is one complication, which is legacy-rx mode (configurable via
      ethtool priv-flags). There are zero headroom in this mode, which is a
      requirement for XDP-redirect to work. The conversion to xdp_frame
      (convert_to_xdp_frame) will detect this insufficient space, and
      xdp_do_redirect() call will fail. This is deemed acceptable, as it
      allows other XDP actions to still work in legacy-mode. In
      legacy-mode + larger PAGE_SIZE due to lacking tailroom, we also
      accept that xdp_adjust_tail shrink doesn't work.
      Signed-off-by: NJesper Dangaard Brouer <brouer@redhat.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Cc: intel-wired-lan@lists.osuosl.org
      Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
      Cc: Alexander Duyck <alexander.duyck@gmail.com>
      Link: https://lore.kernel.org/bpf/158945347002.97035.328088795813704587.stgit@firesoul
      d4ecdbf7
  4. 01 5月, 2020 1 次提交
  5. 29 3月, 2020 1 次提交
  6. 27 3月, 2020 1 次提交
  7. 21 3月, 2020 8 次提交
    • J
      ice: add board identifier info to devlink .info_get · e961b679
      Jacob Keller 提交于
      Export a unique board identifier using "board.id" for devlink's
      .info_get command.
      
      Obtain this by reading the NVM for the PBA identification string.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
      Acked-by: NJakub Kicinski <kuba@kernel.org>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      e961b679
    • J
      ice: add basic handler for devlink .info_get · ff2e5c70
      Jacob Keller 提交于
      The devlink .info_get callback allows the driver to report detailed
      version information. The following devlink versions are reported with
      this initial implementation:
      
       "fw.mgmt" -> The version of the firmware that controls PHY, link, etc
       "fw.mgmt.api" -> API version of interface exposed over the AdminQ
       "fw.mgmt.build" -> Unique build id of the source for the management fw
       "fw.undi" -> Version of the Option ROM containing the UEFI driver
       "fw.psid.api" -> Version of the NVM image format.
       "fw.bundle_id" -> Unique identifier for the combined flash image.
       "fw.app.name" -> The name of the active DDP package.
       "fw.app" -> The version of the active DDP package.
      
      With this, devlink dev info can report at least as much information as
      is reported by ETHTOOL_GDRVINFO.
      
      Compare the output from ethtool vs from devlink:
      
        $ ethtool -i ens785s0
        driver: ice
        version: 0.8.1-k
        firmware-version: 0.80 0x80002ec0 1.2581.0
        expansion-rom-version:
        bus-info: 0000:3b:00.0
        supports-statistics: yes
        supports-test: yes
        supports-eeprom-access: yes
        supports-register-dump: yes
        supports-priv-flags: yes
      
        $ devlink dev info pci/0000:3b:00.0
        pci/0000:3b:00.0:
        driver ice
        serial number 00-01-ab-ff-ff-ca-05-68
        versions:
            running:
              fw.mgmt 2.1.7
              fw.mgmt.api 1.5
              fw.mgmt.build 0x305d955f
              fw.undi 1.2581.0
              fw.psid.api 0.80
              fw.bundle_id 0x80002ec0
              fw.app.name ICE OS Default Package
              fw.app 1.3.1.0
      
      More pieces of information can be displayed, each version is kept
      separate instead of munged together, and each version has an identifier
      which comes with associated documentation.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Acked-by: NJakub Kicinski <kuba@kernel.org>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      ff2e5c70
    • J
      ice: enable initial devlink support · 1adf7ead
      Jacob Keller 提交于
      Begin implementing support for the devlink interface with the ice
      driver.
      
      The pf structure is currently memory managed through devres, via
      a devm_alloc. To mimic this behavior, after allocating the devlink
      pointer, use devm_add_action to add a teardown action for releasing the
      devlink memory on exit.
      
      The ice hardware is a multi-function PCIe device. Thus, each physical
      function will get its own devlink instance. This means that each
      function will be treated independently, with its own parameters and
      configuration. This is done because the ice driver loads a separate
      instance for each function.
      
      Due to this, the implementation does not enable devlink to manage
      device-wide resources or configuration, as each physical function will
      be treated independently. This is done for simplicity, as managing
      a devlink instance across multiple driver instances would significantly
      increase the complexity for minimal gain.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      1adf7ead
    • J
      ice: implement full NVM read from ETHTOOL_GEEPROM · 84a24798
      Jesse Brandeburg 提交于
      The current implementation of .get_eeprom only enables reading from the
      Shadow RAM portion of the NVM contents. Implement support for reading
      the entire flash contents instead of only the initial portion contained
      in the Shadow RAM.
      
      A complete dump can take several seconds, but the ETHTOOL_GEEPROM ioctl
      is capable of reading only a limited portion at a time by specifying the
      offset and length to read.
      
      In order to perform the reads directly, several functions are made non
      static. Additionally, the unused ice_read_sr_buf_aq and ice_read_sr_buf
      functions are removed.
      Signed-off-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      84a24798
    • J
      ice: discover and store size of available flash · 81f07491
      Jacob Keller 提交于
      When reading from the NVM using a flat address, it is useful to know the
      upper bound on the size of the flash contents. This value is not stored
      within the NVM.
      
      We can determine the size by performing a bisection between upper and
      lower bounds. It is known that the size cannot exceed 16 MB (offset of
      0xFFFFFF).
      
      Use a while loop to bisect the upper and lower bounds by reading one
      byte at a time. On a failed read, lower the maximum bound. On
      a successful read, increase the lower bound.
      
      Save this as the flash_size in the ice_nvm_info structure that contains
      data related to the NVM.
      
      The size will be used in a future patch for implementing full NVM read
      via ethtool's GEEPROM command.
      
      The maximum possible size for the flash is bounded by the size limit for
      the NVM AdminQ commands. Add a new macro, ICE_AQC_NVM_MAX_OFFSET, which
      can be used to represent this upper bound.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      81f07491
    • J
      ice: store NVM version info in extracted format · d4e87444
      Jacob Keller 提交于
      The NVM version and Option ROM version information is stored within the
      struct ice_nvm_ver_info structure. The data for the NVM is stored as
      a 2byte value with the major and minor versions each using one byte from
      the field. The Option ROM is stored as a 4byte value that contains
      a major, build, and patch number.
      
      Modify the code to immediately extract the version values and store them
      in a new struct ice_orom_info. Remove the now unnecessary
      ice_get_nvm_version function.
      
      Update ice_ethtool.c to use the new fields directly from the structured
      data.
      
      This reduces complexity of the code that prints these versions in
      ice_ethtool.c
      
      Update the macro definitions and variable names to use the term "orom"
      instead of "oem" for the Option ROM version. This helps increase the
      clarity of the Option ROM version code.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      d4e87444
    • J
      ice: create function to read a section of the NVM and Shadow RAM · e9450990
      Jacob Keller 提交于
      The NVM contents are read via firmware by using the ice_aq_read_nvm
      function. This function has a couple of limits:
      
      1) The AdminQ commands can only take buffers sized up to 4Kb. Thus, any
         larger read must be split into multiple reads.
      2) when reading from the Shadow RAM, reads must not cross sector
         boundaries. The sectors are also 4Kb in size.
      
      Implement the ice_read_flat_nvm function to read portions of the NVM by
      flat offset. That is, to read using offsets from the start of the NVM
      rather than from a specific module.
      
      This function will be able to read both from the NVM and from the Shadow
      RAM. For simplicity NVM reads will always be broken up to not cross 4Kb
      page boundaries, even though this is not required unless reading from
      the Shadow RAM.
      
      Use this new function as the implementation of ice_read_sr_word_aq.
      
      The ice_read_sr_buf_aq function is not modified here. This is because
      a following change will remove the only caller of that function in favor
      of directly using ice_read_flat_nvm. Thus, there is little benefit to
      changing it now only to remove it momentarily. At the same time, the
      ice_read_sr_aq function will also be removed.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      e9450990
    • J
      ice: use __le16 types for explicitly Little Endian values · 2efefb56
      Jacob Keller 提交于
      The ice_read_sr_aq function returns words in the Little Endian format.
      Remove the need for __force and typecasting by using a local variable in
      the ice_read_sr_word_aq function.
      
      Additionally clarify explicitly that the ice_read_sr_aq function takes
      storage for __le16 values instead of using u16.
      
      Being explicit about the endianness of this data helps when using tools
      like sparse to catch endian-related issues.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      2efefb56
  8. 11 3月, 2020 7 次提交