1. 28 Sep, 2022 13 commits
    • Alex Elder's avatar
      net: ipa: define CLKON_CFG and ROUTE IPA register fields · 479deb32
      Alex Elder authored
      Create the ipa_reg_clkon_cfg_field_id enumerated type, which
      identifies the fields for the CLKON_CFG IPA register.  Add "CLKON_"
      to a few short names to try to avoid name conflicts.  Create the
      ipa_reg_route_field_id enumerated type, which identifies the fields
      for the ROUTE IPA register.
      
      Use IPA_REG_FIELDS() to specify the field mask values defined for
      these registers, for each supported version of IPA.
      
      Use ipa_reg_bit() and ipa_reg_encode() to build up the values to be
      written to these registers rather than using the *_FMASK
      preprocessor symbols.
      
      Remove the definition of the now unused *_FMASK symbols.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      479deb32
    • Alex Elder's avatar
      net: ipa: define COMP_CFG IPA register fields · 12c7ea7d
      Alex Elder authored
      Create the ipa_reg_comp_cfg_field_id enumerated type, which
      identifies the fields for the COMP_CFG IPA register.
      
      Use IPA_REG_FIELDS() to specify the field mask values defined for
      this register, for each supported version of IPA.
      
      Use ipa_reg_bit() to build up the value to be written to this
      register rather than using the *_FMASK preprocessor symbols.
      
      Remove the definition of the *_FMASK symbols, along with the inline
      functions that were used to encode certain fields whose position
      and/or width within the register was dependent on IPA version.
      
      Take this opportunity to represent all one-bit fields using BIT(x)
      rather than GENMASK(x, x).
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      12c7ea7d
    • Alex Elder's avatar
      net: ipa: introduce ipa_reg field masks · a5ad8956
      Alex Elder authored
      Add register field descriptors to the ipa_reg structure.  A field in
      a register is defined by a field mask, which is a 32-bit mask having
      a single contiguous range of bits set.
      
      For each register that has at least one field defined, an enumerated
      type will identify the register's fields.  The ipa_reg structure for
      that register will include an array fmask[] of field masks, indexed
      by that enumerated type.  Each field mask defines the position and
      bit width of a field.  An additional "fcount" records how many
      fields (masks) are defined for a given register.
      
      Introduce two macros to be used to define registers that have at
      least one field.
      
      Introduce a few new functions related to field masks.  The first
      simply returns a field mask, given an IPA register pointer and field
      mask ID.  A variant of that is meant to be used for the special case
      of single-bit field masks.
      
      Next, ipa_reg_encode(), identifies a field with an IPA register
      pointer and a field ID, and takes a value to represent in that
      field.  The result encodes the value in the appropriate place to be
      stored in the register.  This is roughly modeled after the bitmask
      operations (like u32_encode_bits()).
      
      Another function (ipa_reg_decode()) similarly identifies a register
      field, but the value supplied to it represents a full register
      value.  The value encoded in the field is extracted from the value
      and returned.  This is also roughly modeled after bitmask operations
      (such as u32_get_bits()).
      
      Finally, ipa_reg_field_max() returns the maximum value representable
      by a field.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a5ad8956
    • Alex Elder's avatar
      net: ipa: introduce ipa_reg() · 6a244b75
      Alex Elder authored
      Create a new function that returns a register descriptor given its
      ID.  Change ipa_reg_offset() and ipa_reg_n_offset() so they take a
      register descriptor argument rather than an IPA pointer and register
      ID.  Have them accept null pointers (and return an invalid 0 offset),
      to avoid the need for excessive error checking.  (A warning is issued
      whenever ipa_reg() returns 0).
      
      Call ipa_reg() or ipa_reg_n() to look up information about the
      register before calls to ipa_reg_offset() and ipa_reg_n_offset().
      Delay looking up offsets until they're needed to read or write
      registers.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      6a244b75
    • Alex Elder's avatar
      net: ipa: use ipa_reg[] array for register offsets · 82a06807
      Alex Elder authored
      Use the array of register descriptors assigned at initialization
      time to determine the offset (and where used, stride) for IPA
      registers.  Issue a warning if an offset is requested for a register
      that's not valid for the current system.
      
      Remove all IPE_REG_*_OFFSET macros, as well as inline static
      functions that returned register offsets.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      82a06807
    • Alex Elder's avatar
      net: ipa: add per-version IPA register definition files · 07f120bc
      Alex Elder authored
      Create a new subdirectory "reg", which contains a register
      definition file for each supported version of IPA.  Each register
      definition contains the register's offset, and for parameterized
      registers, the stride (distance between consecutive instances of the
      register).  Finally, it includes an all-caps printable register name.
      
      In these files, each IPA version defines an array of IPA register
      definition pointers, with unsupported registers defined with a null
      pointer.  The array is indexed by the ipa_reg_id enumerated type.
      
      At initialization time, the appropriate register definition array to
      use is selected based on the IPA version, and assigned to a new
      "regs" field in the IPA structure.
      
      Extend ipa_reg_valid() so it fails if a valid register is not
      defined.
      
      This patch simply puts this infrastructure in place; the next will
      use it.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      07f120bc
    • Alex Elder's avatar
      net: ipa: use IPA register IDs to determine offsets · 6bfb7538
      Alex Elder authored
      Expose two inline functions that return the offset for a register
      whose ID is provided; one of them takes an additional argument
      that's used for registers that are parameterized.  These both use
      a common helper function __ipa_reg_offset(), which just uses the
      offset symbols already defined.
      
      Replace all references to the offset macros defined for IPA
      registers with calls to ipa_reg_offset() or ipa_reg_n_offset().
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      6bfb7538
    • Alex Elder's avatar
      net: ipa: introduce IPA register IDs · 98e2dd71
      Alex Elder authored
      Create a new ipa_reg_id enumerated type, which identifies each IPA
      register with a symbolic identifier.  Use short names, but in some
      cases (such as "BCR") add "IPA_" to the name to help avoid name
      conflicts.
      
      Create two functions that indicate register validity.  The first
      concisely indicates whether a register is valid for a given version
      of IPA, and if so, whether it is defined.  The second indicates
      whether a register is valid for TX or RX endpoints.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      98e2dd71
    • Kees Cook's avatar
      s390/qeth: Split memcpy() of struct qeth_ipacmd_addr_change flexible array · 8f1e1658
      Kees Cook authored
      To work around a misbehavior of the compiler's ability to see into
      composite flexible array structs (as detailed in the coming memcpy()
      hardening series[1]), split the memcpy() of the header and the payload
      so no false positive run-time overflow warning will be generated.
      
      [1] https://lore.kernel.org/linux-hardening/20220901065914.1417829-2-keescook@chromium.org/
      
      Cc: Wenjia Zhang <wenjia@linux.ibm.com>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Alexander Gordeev <agordeev@linux.ibm.com>
      Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
      Cc: Sven Schnelle <svens@linux.ibm.com>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Reviewed-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
      Reviewed-by: default avatarAlexandra Winter <wintera@linux.ibm.com>
      Link: https://lore.kernel.org/r/20220927003953.1942442-1-keescook@chromium.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      8f1e1658
    • Donald Hunter's avatar
      Add skb drop reasons to IPv6 UDP receive path · 0d92efde
      Donald Hunter authored
      Enumerate the skb drop reasons in the receive path for IPv6 UDP packets.
      Signed-off-by: default avatarDonald Hunter <donald.hunter@redhat.com>
      Link: https://lore.kernel.org/r/20220926120350.14928-1-donald.hunter@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      0d92efde
    • Bo Liu's avatar
      ptp: Remove usage of the deprecated ida_simple_xxx API · ab7ea1e7
      Bo Liu authored
      Use ida_alloc_xxx()/ida_free() instead of
      ida_simple_get()/ida_simple_remove().
      The latter is deprecated and more verbose.
      Signed-off-by: default avatarBo Liu <liubo03@inspur.com>
      Link: https://lore.kernel.org/r/20220926012744.3363-1-liubo03@inspur.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      ab7ea1e7
    • Taehee Yoo's avatar
      net: tls: Add ARIA-GCM algorithm · 62e56ef5
      Taehee Yoo authored
      RFC 6209 describes ARIA for TLS 1.2.
      ARIA-128-GCM and ARIA-256-GCM are defined in RFC 6209.
      
      This patch would offer performance increment and an opportunity for
      hardware offload.
      
      Benchmark results:
      iperf-ssl are used.
      CPU: intel i3-12100.
      
        TLS(openssl-3.0-dev)
      [  3]  0.0- 1.0 sec   185 MBytes  1.55 Gbits/sec
      [  3]  1.0- 2.0 sec   186 MBytes  1.56 Gbits/sec
      [  3]  2.0- 3.0 sec   186 MBytes  1.56 Gbits/sec
      [  3]  3.0- 4.0 sec   186 MBytes  1.56 Gbits/sec
      [  3]  4.0- 5.0 sec   186 MBytes  1.56 Gbits/sec
      [  3]  0.0- 5.0 sec   927 MBytes  1.56 Gbits/sec
        kTLS(aria-generic)
      [  3]  0.0- 1.0 sec   198 MBytes  1.66 Gbits/sec
      [  3]  1.0- 2.0 sec   194 MBytes  1.62 Gbits/sec
      [  3]  2.0- 3.0 sec   194 MBytes  1.63 Gbits/sec
      [  3]  3.0- 4.0 sec   194 MBytes  1.63 Gbits/sec
      [  3]  4.0- 5.0 sec   194 MBytes  1.62 Gbits/sec
      [  3]  0.0- 5.0 sec   974 MBytes  1.63 Gbits/sec
        kTLS(aria-avx wirh GFNI)
      [  3]  0.0- 1.0 sec   632 MBytes  5.30 Gbits/sec
      [  3]  1.0- 2.0 sec   657 MBytes  5.51 Gbits/sec
      [  3]  2.0- 3.0 sec   657 MBytes  5.51 Gbits/sec
      [  3]  3.0- 4.0 sec   656 MBytes  5.50 Gbits/sec
      [  3]  4.0- 5.0 sec   656 MBytes  5.50 Gbits/sec
      [  3]  0.0- 5.0 sec  3.18 GBytes  5.47 Gbits/sec
      Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
      Reviewed-by: default avatarVadim Fedorenko <vfedorenko@novek.ru>
      Link: https://lore.kernel.org/r/20220925150033.24615-1-ap420073@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      62e56ef5
    • Bhupesh Sharma's avatar
      net: stmmac: Minor spell fix related to 'stmmac_clk_csr_set()' · c64655f3
      Bhupesh Sharma authored
      Minor spell fix related to 'stmmac_clk_csr_set()' inside a
      comment used in the 'stmmac_probe_config_dt()' function.
      
      Cc: Biao Huang <biao.huang@mediatek.com>
      Signed-off-by: default avatarBhupesh Sharma <bhupesh.sharma@linaro.org>
      Link: https://lore.kernel.org/r/20220924104514.1666947-1-bhupesh.sharma@linaro.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      c64655f3
  2. 27 Sep, 2022 27 commits