1. 09 Mar, 2020 22 commits
    • David S. Miller's avatar
      Merge branch 'bareudp-several-code-cleanup-for-bareudp-module' · 1033a215
      David S. Miller authored
      Taehee Yoo says:
      
      ====================
      bareudp: several code cleanup for bareudp module
      
      This patchset is to cleanup bareudp module code.
      
      1. The first patch is to add module alias
      In the current bareudp code, there is no module alias.
      So, RTNL couldn't load bareudp module automatically.
      
      2. The second patch is to add extack message.
      The extack error message is useful for noticing specific errors
      when command is failed.
      
      3. The third patch is to remove unnecessary udp_encap_enable().
      In the bareudp_socket_create(), udp_encap_enable() is called.
      But, the it's already called in the setup_udp_tunnel_sock().
      So, it could be removed.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1033a215
    • Taehee Yoo's avatar
      bareudp: remove unnecessary udp_encap_enable() in bareudp_socket_create() · 2baecda3
      Taehee Yoo authored
      In the current code, udp_encap_enable() is called in
      bareudp_socket_create().
      But, setup_udp_tunnel_sock() internally calls udp_encap_enable().
      So, udp_encap_enable() is unnecessary.
      Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2baecda3
    • Taehee Yoo's avatar
      bareudp: print error message when command fails · c46a49a4
      Taehee Yoo authored
      When bareudp netlink command fails, it doesn't print any error message.
      So, users couldn't know the exact reason.
      In order to tell the exact reason to the user, the extack error message
      is used in this patch.
      Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c46a49a4
    • Taehee Yoo's avatar
      bareudp: add module alias · eea45da4
      Taehee Yoo authored
      In the current bareudp code, there is no module alias.
      So, RTNL couldn't load bareudp module automatically.
      Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      eea45da4
    • David S. Miller's avatar
      Merge branch 'cxgb4-chcr-ktls-tx-ofld-support-on-T6-adapter' · 31de3f56
      David S. Miller authored
      Rohit Maheshwari says:
      
      ====================
      cxgb4/chcr: ktls tx ofld support on T6 adapter
      
      This series of patches add support for kernel tls offload in Tx direction,
      over Chelsio T6 NICs. SKBs marked as decrypted will be treated as tls plain
      text packets and then offloaded to encrypt using network device (chelsio T6
      adapter).
      
      This series is broken down as follows:
      
      Patch 1 defines a new macro and registers tls_dev_add and tls_dev_del
      callbacks. When tls_dev_add gets called we send a connection request to
      our hardware and to make HW understand about tls offload. Its a partial
      connection setup and only ipv4 part is done.
      
      Patch 2 handles the HW response of the connection request and then we
      request to update TCB and handle it's HW response as well. Also we save
      crypto key locally. Only supporting TLS_CIPHER_AES_GCM_128_KEY_SIZE.
      
      Patch 3 handles tls marked skbs (decrypted bit set) and sends it to ULD for
      crypto handling. This code has a minimal portion of tx handler, to handle
      only one complete record per skb.
      
      Patch 4 hanldes partial end part of records. Also added logic to handle
      multiple records in one single skb. It also adds support to send out tcp
      option(/s) if exists in skb. If a record is partial but has end part of a
      record, we'll fetch complete record and then only send it to HW to generate
      HASH on complete record.
      
      Patch 5 handles partial first or middle part of record, it uses AES_CTR to
      encrypt the partial record. If we are trying to send middle record, it's
      start should be 16 byte aligned, so we'll fetch few earlier bytes from the
      record and then send it to HW for encryption.
      
      Patch 6 enables ipv6 support and also includes ktls startistics.
      
      v1->v2:
      - mark tcb state to close in tls_dev_del.
      - u_ctx is now picked from adapter structure.
      - clear atid in case of failure.
      - corrected ULP_CRYPTO_KTLS_INLINE value.
      - optimized tcb update using control queue.
      - state machine handling when earlier states received.
      - chcr_write_cpl_set_tcb_ulp  function is shifted to patch3.
      - un-necessary updating left variable.
      
      v2->v3:
      - add empty line after variable declaration.
      - local variable declaration in reverse christmas tree ordering.
      
      v3->v4:
      - replaced kfree_skb with dev_kfree_skb_any.
      - corrected error message reported by kbuild test robot <lkp@intel.com>
      - mss calculation logic.
      - correct place for Alloc skb check.
      - Replaced atomic_t with atomic64_t
      - added few more statistics counters.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      31de3f56
    • Rohit Maheshwari's avatar
      cxgb4/chcr: Add ipv6 support and statistics · 62370a4f
      Rohit Maheshwari authored
      Adding ipv6 support and ktls related statistics.
      
      v1->v2:
      - added blank lines at 2 places.
      
      v3->v4:
      - Replaced atomic_t with atomic64_t
      - added few necessary stat counters.
      Signed-off-by: default avatarRohit Maheshwari <rohitm@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      62370a4f
    • Rohit Maheshwari's avatar
      chcr: Handle first or middle part of record · dc05f3df
      Rohit Maheshwari authored
      This patch contains handling of first part or middle part of the record.
      When we get a middle record, we will fetch few already sent bytes to
      make packet start 16 byte aligned.
      And if the packet has only the header part, we don't need to send it for
      packet encryption, send that packet as a plaintext.
      
      v1->v2:
      - un-necessary updating left variable.
      
      v3->v4:
      - replaced kfree_skb with dev_kfree_skb_any.
      Signed-off-by: default avatarRohit Maheshwari <rohitm@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dc05f3df
    • Rohit Maheshwari's avatar
      chcr: handle partial end part of a record · 429765a1
      Rohit Maheshwari authored
      TCP segment can chop a record in any order. Record can either be
      complete or it can be partial (first part which contains header,
      middle part which doesn't have header or TAG, and the end part
      which contains TAG. This patch handles partial end part of a tx
      record. In case of partial end part's, driver will send complete
      record to HW, so that HW will calculate GHASH (TAG) of complete
      packet.
      Also added support to handle multiple records in a segment.
      
      v1->v2:
      - miner change in calling chcr_write_cpl_set_tcb_ulp.
      - no need of checking return value of chcr_ktls_write_tcp_options.
      
      v3->v4:
      - replaced kfree_skb with dev_kfree_skb_any.
      Signed-off-by: default avatarRohit Maheshwari <rohitm@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      429765a1
    • Rohit Maheshwari's avatar
      cxgb4/chcr: complete record tx handling · 5a4b9fe7
      Rohit Maheshwari authored
      Added tx handling in this patch. This includes handling of segments
      contain single complete record.
      
      v1->v2:
      - chcr_write_cpl_set_tcb_ulp is added in this patch.
      
      v3->v4:
      - mss calculation logic.
      - replaced kfree_skb with dev_kfree_skb_any.
      - corrected error message reported by kbuild test robot <lkp@intel.com>
      Signed-off-by: default avatarRohit Maheshwari <rohitm@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5a4b9fe7
    • Rohit Maheshwari's avatar
      cxgb4/chcr: Save tx keys and handle HW response · 8a30923e
      Rohit Maheshwari authored
      As part of this patch generated and saved crypto keys, handled HW
      response of act_open_req and set_tcb_req. Defined connection state
      update.
      
      v1->v2:
      - optimized tcb update using control queue.
      - state machine handling when earlier states received.
      
      v2->v3:
      - Added one empty line after function declaration.
      Signed-off-by: default avatarRohit Maheshwari <rohitm@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8a30923e
    • Rohit Maheshwari's avatar
      cxgb4/chcr : Register to tls add and del callback · 34aba2c4
      Rohit Maheshwari authored
      A new macro is defined to enable ktls tx offload support on Chelsio
      T6 adapter. And if this macro is enabled, cxgb4 will send mailbox to
      enable or disable ktls settings on HW.
      In chcr, enabled tx offload flag in netdev and registered tls_dev_add
      and tls_dev_del.
      
      v1->v2:
      - mark tcb state to close in tls_dev_del.
      - u_ctx is now picked from adapter structure.
      - clear atid in case of failure.
      - corrected ULP_CRYPTO_KTLS_INLINE value.
      
      v2->v3:
      - add empty line after variable declaration.
      - local variable declaration in reverse christmas tree ordering.
      Signed-off-by: default avatarRohit Maheshwari <rohitm@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      34aba2c4
    • David S. Miller's avatar
      Merge branch 'net-allow-user-specify-TC-action-HW-stats-type' · 9d2e4e16
      David S. Miller authored
      Jiri Pirko says:
      
      ====================
      net: allow user specify TC action HW stats type
      
      Currently, when user adds a TC action and the action gets offloaded,
      the user expects the HW stats to be counted and included in stats dump.
      However, since drivers may implement different types of counting, there
      is no way to specify which one the user is interested in.
      
      For example for mlx5, only delayed counters are available as the driver
      periodically polls for updated stats.
      
      In case of mlxsw, the counters are queried on dump time. However, the
      HW resources for this type of counters is quite limited (couple of
      thousands). This limits the amount of supported offloaded filters
      significantly. Without counter assigned, the HW is capable to carry
      millions of those.
      
      On top of that, mlxsw HW is able to support delayed counters as well in
      greater numbers. That is going to be added in a follow-up patch.
      
      This patchset allows user to specify one of the following types of HW
      stats for added action:
      immediate - queried during dump time
      delayed - polled from HW periodically or sent by HW in async manner
      disabled - no stats needed
      
      Note that if "hw_stats" option is not passed, user does not care about
      the type, just expects any type of stats.
      
      Examples:
      $ tc filter add dev enp0s16np28 ingress proto ip handle 1 pref 1 flower skip_sw dst_ip 192.168.1.1 action drop hw_stats disabled
      $ tc -s filter show dev enp0s16np28 ingress
      filter protocol ip pref 1 flower chain 0
      filter protocol ip pref 1 flower chain 0 handle 0x1
        eth_type ipv4
        dst_ip 192.168.1.1
        skip_sw
        in_hw in_hw_count 2
              action order 1: gact action drop
               random type none pass val 0
               index 1 ref 1 bind 1 installed 7 sec used 2 sec
              Action statistics:
              Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
              backlog 0b 0p requeues 0
              hw_stats disabled
      
      $ tc filter add dev enp0s16np28 ingress proto ip handle 1 pref 1 flower skip_sw dst_ip 192.168.1.1 action drop hw_stats immediate
      $ tc -s filter show dev enp0s16np28 ingress
      filter protocol ip pref 1 flower chain 0
      filter protocol ip pref 1 flower chain 0 handle 0x1
        eth_type ipv4
        dst_ip 192.168.1.1
        skip_sw
        in_hw in_hw_count 2
              action order 1: gact action drop
               random type none pass val 0
               index 1 ref 1 bind 1 installed 11 sec used 4 sec
              Action statistics:
              Sent 102 bytes 1 pkt (dropped 1, overlimits 0 requeues 0)
              Sent software 0 bytes 0 pkt
              Sent hardware 102 bytes 1 pkt
              backlog 0b 0p requeues 0
              hw_stats immediate
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9d2e4e16
    • Jiri Pirko's avatar
      sched: act: allow user to specify type of HW stats for a filter · 44f86580
      Jiri Pirko authored
      Currently, user who is adding an action expects HW to report stats,
      however it does not have exact expectations about the stats types.
      That is aligned with TCA_ACT_HW_STATS_TYPE_ANY.
      
      Allow user to specify the type of HW stats for an action and require it.
      
      Pass the information down to flow_offload layer.
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      44f86580
    • Jiri Pirko's avatar
      flow_offload: introduce "disabled" HW stats type and allow it in mlxsw · d7cb1e3b
      Jiri Pirko authored
      Introduce new type for disabled HW stats and allow the value in
      mlxsw offload.
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d7cb1e3b
    • Jiri Pirko's avatar
      mlxsw: spectrum_acl: Ask device for rule stats only if counter was created · f16e7f64
      Jiri Pirko authored
      Set a flag in case rule counter was created. Only query the device for
      stats of a rule, which has the valid counter assigned.
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f16e7f64
    • Jiri Pirko's avatar
      flow_offload: introduce "delayed" HW stats type and allow it in mlx5 · 48855479
      Jiri Pirko authored
      Introduce new type for delayed HW stats and allow the value in
      mlx5 offload.
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      48855479
    • Jiri Pirko's avatar
      flow_offload: introduce "immediate" HW stats type and allow it in mlxsw · d60d7ed4
      Jiri Pirko authored
      Introduce new type for immediate HW stats and allow the value in
      mlxsw offload.
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d60d7ed4
    • Jiri Pirko's avatar
      mlxsw: restrict supported HW stats type to "any" · c4afd0c8
      Jiri Pirko authored
      Currently don't allow actions with any other type to be inserted.
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c4afd0c8
    • Jiri Pirko's avatar
      mlxsw: spectrum_flower: Do not allow mixing HW stats types for actions · 3632f6d3
      Jiri Pirko authored
      As there is one set of counters for the whole action chain, forbid to
      mix the HW stats types.
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3632f6d3
    • Jiri Pirko's avatar
      flow_offload: check for basic action hw stats type · 319a1d19
      Jiri Pirko authored
      Introduce flow_action_basic_hw_stats_types_check() helper and use it
      in drivers. That sanitizes the drivers which do not have support
      for action HW stats types.
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      319a1d19
    • Jiri Pirko's avatar
      ocelot_flower: use flow_offload_has_one_action() helper · 1ee47330
      Jiri Pirko authored
      Instead of directly checking number of action entries, use
      flow_offload_has_one_action() helper.
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Acked-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1ee47330
    • Jiri Pirko's avatar
      flow_offload: Introduce offload of HW stats type · 2514921e
      Jiri Pirko authored
      Initially, pass "ANY" (struct is zeroed) to the drivers as that is the
      current implicit value coming down to flow_offload. Add a bool
      indicating that entries have mixed HW stats type.
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2514921e
  2. 07 Mar, 2020 10 commits
  3. 06 Mar, 2020 8 commits