1. 24 7月, 2020 5 次提交
    • J
      ice: split ice_discover_caps into two functions · 81aed647
      Jacob Keller 提交于
      Using the new ice_aq_list_caps and ice_parse_(dev|func)_caps functions,
      replace ice_discover_caps with two functions that each take a pointer to
      the dev_caps and func_caps structures respectively.
      
      This makes the side effect of updating the hw->dev_caps and
      hw->func_caps obvious from reading the implementation of the function.
      Additionally, it opens the way for enabling reading of device
      capabilities outside of the initialization flow. By passing in
      a pointer, another caller will be able to read the capabilities without
      modifying the HW capabilities structures.
      
      As there are no other callers, it is safe to now remove
      ice_aq_discover_caps and ice_parse_caps.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      81aed647
    • J
      ice: split ice_parse_caps into separate functions · 595b13e2
      Jacob Keller 提交于
      The ice_parse_caps function is used to convert the capability block data
      coming from firmware into a structured format used by other parts of the
      code.
      
      The current implementation directly updates the hw->func_caps and
      hw->dev_caps structures. It is directly called from within
      ice_aq_discover_caps. This causes the discover_caps function to have the
      side effect of modifying the HW capability structures, which is not
      intuitive.
      
      Split this function into ice_parse_dev_caps and ice_parse_func_caps.
      These functions will take a pointer to the dev_caps and func_caps
      respectively. Also create an ice_parse_common_caps for sharing the
      capability logic that is common to device and function.
      
      Doing so enables a future refactor to allow reading and parsing
      capabilities into a local caps structure instead of modifying the
      members of the HW structure directly.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      595b13e2
    • J
      ice: refactor ice_discover_caps to avoid need to retry · 1082b360
      Jacob Keller 提交于
      The ice_discover_caps function is used to read the device and function
      capabilities, updating the hardware capabilities structures with
      relevant data.
      
      The exact number of capabilities returned by the hardware is unknown
      ahead of time. The AdminQ command will report the total number of
      capabilities in the return buffer.
      
      The current implementation involves requesting capabilities once,
      reading this returned size, and then re-requested with that size.
      
      This isn't really necessary. The firmware interface has a maximum size
      of ICE_AQ_MAX_BUF_LEN. Firmware can never return more than
      ICE_AQ_MAX_BUF_LEN / sizeof(struct ice_aqc_list_caps_elem) capabilities.
      
      Avoid the retry loop by simply allocating a buffer of size
      ICE_AQ_MAX_BUF_LEN. This is significantly simpler than retrying. The
      extra allocation isn't a big deal, as it will be released after we
      finish parsing the capabilities.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      1082b360
    • M
      cxgb4: use eth_zero_addr() to clear mac address · 8bf9d8ea
      Miaohe Lin 提交于
      Use eth_zero_addr() to clear mac address insetad of memset().
      Signed-off-by: NMiaohe Lin <linmiaohe@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8bf9d8ea
    • J
      sfc: convert to new udp_tunnel infrastructure · 205a55f4
      Jakub Kicinski 提交于
      Check MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_TRUSTED, before setting
      the info, which will hopefully protect us from -EPERM errors
      the previous code was gracefully ignoring. Ed reports this
      is not the 100% correct bit, but it's the best approximation
      we have. Shared code reports the port information back to user
      space, so we really want to know what was added and what failed.
      Ignoring -EPERM is not an option.
      
      The driver does not call udp_tunnel_get_rx_info(), so its own
      management of table state is not really all that problematic,
      we can leave it be. This allows the driver to continue with its
      copious table syncing, and matching the ports to TX frames,
      which it will reportedly do one day.
      
      Leave the feature checking in the callbacks, as the device may
      remove the capabilities on reset.
      
      Inline the loop from __efx_ef10_udp_tnl_lookup_port() into
      efx_ef10_udp_tnl_has_port(), since it's the only caller now.
      
      With new infra this driver gains port replace - when space frees
      up in a full table a new port will be selected for offload.
      Plus efx will no longer sleep in an atomic context.
      
      v2:
       - amend the commit message about TRUSTED not being 100%
       - add TUNNEL_ENCAP_UDP_PORT_ENTRY_INVALID to mark unsed
         entries
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      Acked-By: NEdward Cree <ecree@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      205a55f4
  2. 23 7月, 2020 20 次提交
  3. 22 7月, 2020 15 次提交