Skip to content
  1. Nov 28, 2020
    • Martin Schiller's avatar
      net/lapb: support netdev events · a4989fa9
      Martin Schiller authored
      
      
      This patch allows layer2 (LAPB) to react to netdev events itself and
      avoids the detour via layer3 (X.25).
      
      1. Establish layer2 on NETDEV_UP events, if the carrier is already up.
      
      2. Call lapb_disconnect_request() on NETDEV_GOING_DOWN events to signal
         the peer that the connection will go down.
         (Only when the carrier is up.)
      
      3. When a NETDEV_DOWN event occur, clear all queues, enter state
         LAPB_STATE_0 and stop all timers.
      
      4. The NETDEV_CHANGE event makes it possible to handle carrier loss and
         detection.
      
         In case of Carrier Loss, clear all queues, enter state LAPB_STATE_0
         and stop all timers.
      
         In case of Carrier Detection, we start timer t1 on a DCE interface,
         and on a DTE interface we change to state LAPB_STATE_1 and start
         sending SABM(E).
      
      Signed-off-by: default avatarMartin Schiller <ms@dev.tdt.de>
      Acked-by: default avatarXie He <xie.he.0141@gmail.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a4989fa9
    • Martin Schiller's avatar
      net/x25: handle additional netdev events · 7eed751b
      Martin Schiller authored
      
      
      1. Add / remove x25_link_device by NETDEV_REGISTER/UNREGISTER and also
         by NETDEV_POST_TYPE_CHANGE/NETDEV_PRE_TYPE_CHANGE.
      
         This change is needed so that the x25_neigh struct for an interface
         is already created when it shows up and is kept independently if the
         interface goes UP or DOWN.
      
         This is used in an upcomming commit, where x25 params of an neighbour
         will get configurable through ioctls.
      
      2. NETDEV_CHANGE event makes it possible to handle carrier loss and
         detection. If carrier is lost, clean up everything related to this
         neighbour by calling x25_link_terminated().
      
      3. Also call x25_link_terminated() for NETDEV_DOWN events and remove the
         call to x25_clear_forward_by_dev() in x25_route_device_down(), as
         this is already called by x25_kill_by_neigh() which gets called by
         x25_link_terminated().
      
      4. Do nothing for NETDEV_UP and NETDEV_GOING_DOWN events, as these will
         be handled in layer 2 (LAPB) and layer3 (X.25) will be informed by
         layer2 when layer2 link is established and layer3 link should be
         initiated.
      
      Signed-off-by: default avatarMartin Schiller <ms@dev.tdt.de>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      7eed751b
    • Jakub Kicinski's avatar
      Merge branch 'mlxsw-update-adjacency-index-more-efficiently' · f5d709ff
      Jakub Kicinski authored
      
      
      Ido Schimmel says:
      
      ====================
      mlxsw: Update adjacency index more efficiently
      
      The device supports an operation that allows the driver to issue one
      request to update the adjacency index for all the routes in a given
      virtual router (VR) from old index and size to new ones. This is useful
      in case the configuration of a certain nexthop group is updated and its
      adjacency index changes.
      
      Currently, the driver does not use this operation in an efficient
      manner. It iterates over all the routes using the nexthop group and
      issues an update request for the VR if it is not the same as the
      previous VR.
      
      Instead, this patch set tracks the VRs in which the nexthop group is
      used and issues one request for each VR.
      
      Example:
      
      8k IPv6 routes were added in an alternating manner to two VRFs. All the
      routes are using the same nexthop object ('nhid 1').
      
      Before:
      
       Performance counter stats for 'ip nexthop replace id 1 via 2001:db8:1::2 dev swp3':
      
                  16,385      devlink:devlink_hwmsg
      
             4.255933213 seconds time elapsed
      
             0.000000000 seconds user
             0.666923000 seconds sys
      
      Number of EMAD transactions corresponds to number of routes using the
      nexthop group.
      
      After:
      
       Performance counter stats for 'ip nexthop replace id 1 via 2001:db8:1::2 dev swp3':
      
                       3      devlink:devlink_hwmsg
      
             0.077655094 seconds time elapsed
      
             0.000000000 seconds user
             0.076698000 seconds sys
      
      Number of EMAD transactions corresponds to number of VRFs / VRs.
      
      Patch set overview:
      
      Patch #1 is a fix for a bug introduced in previous submission. Detected
      by Coverity.
      
      Patches #2 and #3 are preparations.
      
      Patch #4 tracks the VRs a nexthop group is member of.
      
      Patch #5 uses the membership tracking from the previous patch to issue
      one update request per each VR.
      ====================
      
      Link: https://lore.kernel.org/r/20201125193505.1052466-1-idosch@idosch.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      f5d709ff
    • Ido Schimmel's avatar
      mlxsw: spectrum_router: Update adjacency index more efficiently · ff47fa13
      Ido Schimmel authored
      
      
      The device supports an operation that allows the driver to issue one
      request to update the adjacency index for all the routes in a given
      virtual router (VR) from old index and size to new ones. This is useful
      in case the configuration of a certain nexthop group is updated and its
      adjacency index changes.
      
      Currently, the driver does not use this operation in an efficient
      manner. It iterates over all the routes using the nexthop group and
      issues an update request for the VR if it is not the same as the
      previous VR.
      
      Instead, use the VR tracking added in the previous patch to update the
      adjacency index once for each VR currently using the nexthop group.
      
      Example:
      
      8k IPv6 routes were added in an alternating manner to two VRFs. All the
      routes are using the same nexthop object ('nhid 1').
      
      Before:
      
      # perf stat -e devlink:devlink_hwmsg --filter='incoming==0' -- ip nexthop replace id 1 via 2001:db8:1::2 dev swp3
      
       Performance counter stats for 'ip nexthop replace id 1 via 2001:db8:1::2 dev swp3':
      
                  16,385      devlink:devlink_hwmsg
      
             4.255933213 seconds time elapsed
      
             0.000000000 seconds user
             0.666923000 seconds sys
      
      Number of EMAD transactions corresponds to number of routes using the
      nexthop group.
      
      After:
      
      # perf stat -e devlink:devlink_hwmsg --filter='incoming==0' -- ip nexthop replace id 1 via 2001:db8:1::2 dev swp3
      
       Performance counter stats for 'ip nexthop replace id 1 via 2001:db8:1::2 dev swp3':
      
                       3      devlink:devlink_hwmsg
      
             0.077655094 seconds time elapsed
      
             0.000000000 seconds user
             0.076698000 seconds sys
      
      Number of EMAD transactions corresponds to number of VRFs / VRs.
      
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      ff47fa13
    • Ido Schimmel's avatar
      mlxsw: spectrum_router: Track nexthop group virtual router membership · d2141a42
      Ido Schimmel authored
      
      
      For each nexthop group, track in which virtual routers (VRs) the group is
      used. This is going to be used by the next patch to perform a more
      efficient adjacency index update whenever the group's adjacency index
      changes.
      
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      d2141a42
    • Ido Schimmel's avatar
      mlxsw: spectrum_router: Rollback virtual router adjacency pointer update · 9a4ab10c
      Ido Schimmel authored
      
      
      In the rare case where the adjacency pointer cannot be updated for a
      given virtual router, rollback the operation so that virtual routers
      that are already using the new index will use the old one again.
      
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      9a4ab10c
    • Ido Schimmel's avatar
      mlxsw: spectrum_router: Pass virtual router parameters directly instead of pointer · 40e4413d
      Ido Schimmel authored
      
      
      mlxsw_sp_adj_index_mass_update_vr() only needs the virtual router's
      identifier and protocol, so pass them directly. In a subsequent patch
      the caller will not have access to the pointer.
      
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      40e4413d
    • Ido Schimmel's avatar
      mlxsw: spectrum_router: Fix error handling issue · 1c2c5eb6
      Ido Schimmel authored
      Return error to the caller instead of suppressing it.
      
      Fixes: e3ddfb45
      
       ("mlxsw: spectrum_router: Allow returning errors from mlxsw_sp_nexthop_group_refresh()")
      Addresses-Coverity: ("Error handling issues  (CHECKED_RETURN)")
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      1c2c5eb6
    • Jakub Kicinski's avatar
      Merge branch 'net-sched-fix-over-mtu-packet-of-defrag-in' · 4be074e6
      Jakub Kicinski authored
      
      
      wenxu says:
      
      ====================
      net/sched: fix over mtu packet of defrag in
      
      Currently kernel tc subsystem can do conntrack in act_ct. But when several
      fragment packets go through the act_ct, function tcf_ct_handle_fragments
      will defrag the packets to a big one. But the last action will redirect
      mirred to a device which maybe lead the reassembly big packet over the mtu
      of target device.
      
      The first patch fix miss init the qdisc_skb_cb->mru
      The send one refactor the hanle of xmit in act_mirred and prepare for the
      third one
      The last one add implict packet fragment support to fix the over mtu for
      defrag in act_ct.
      ====================
      
      Link: https://lore.kernel.org/r/1606276883-6825-1-git-send-email-wenxu@ucloud.cn
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      4be074e6
    • wenxu's avatar
      net/sched: sch_frag: add generic packet fragment support. · c129412f
      wenxu authored
      
      
      Currently kernel tc subsystem can do conntrack in cat_ct. But when several
      fragment packets go through the act_ct, function tcf_ct_handle_fragments
      will defrag the packets to a big one. But the last action will redirect
      mirred to a device which maybe lead the reassembly big packet over the mtu
      of target device.
      
      This patch add support for a xmit hook to mirred, that gets executed before
      xmiting the packet. Then, when act_ct gets loaded, it configs that hook.
      The frag xmit hook maybe reused by other modules.
      
      Signed-off-by: default avatarwenxu <wenxu@ucloud.cn>
      Acked-by: default avatarCong Wang <cong.wang@bytedance.com>
      Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      c129412f
    • wenxu's avatar
      net/sched: act_mirred: refactor the handle of xmit · fa6d6399
      wenxu authored
      
      
      This one is prepare for the next patch.
      
      Signed-off-by: default avatarwenxu <wenxu@ucloud.cn>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      fa6d6399
    • wenxu's avatar
      net/sched: fix miss init the mru in qdisc_skb_cb · aadaca9e
      wenxu authored
      The mru in the qdisc_skb_cb should be init as 0. Only defrag packets in the
      act_ct will set the value.
      
      Fixes: 038ebb1a
      
       ("net/sched: act_ct: fix miss set mru for ovs after defrag in act_ct")
      Signed-off-by: default avatarwenxu <wenxu@ucloud.cn>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      aadaca9e
    • Jakub Kicinski's avatar
      Merge branch 'add-chacha20-poly1305-cipher-to-kernel-tls' · fb3158ea
      Jakub Kicinski authored
      
      
      Vadim Fedorenko says:
      
      ====================
      Add CHACHA20-POLY1305 cipher to Kernel TLS
      
      RFC 7905 defines usage of ChaCha20-Poly1305 in TLS connections. This
      cipher is widely used nowadays and it's good to have a support for it
      in TLS connections in kernel.
      ====================
      
      Link: https://lore.kernel.org/r/1606231490-653-1-git-send-email-vfedorenko@novek.ru
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      fb3158ea
    • Vadim Fedorenko's avatar
      selftests/tls: add CHACHA20-POLY1305 to tls selftests · 4f336e88
      Vadim Fedorenko authored
      
      
      Add new cipher as a variant of standard tls selftests
      
      Signed-off-by: default avatarVadim Fedorenko <vfedorenko@novek.ru>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      4f336e88
    • Vadim Fedorenko's avatar
      net/tls: add CHACHA20-POLY1305 configuration · 74ea6106
      Vadim Fedorenko authored
      
      
      Add ChaCha-Poly specific configuration code.
      
      Signed-off-by: default avatarVadim Fedorenko <vfedorenko@novek.ru>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      74ea6106
    • Vadim Fedorenko's avatar
      net/tls: add CHACHA20-POLY1305 specific behavior · a6acbe62
      Vadim Fedorenko authored
      
      
      RFC 7905 defines special behavior for ChaCha-Poly TLS sessions.
      The differences are in the calculation of nonce and the absence
      of explicit IV. This behavior is like TLSv1.3 partly.
      
      Signed-off-by: default avatarVadim Fedorenko <vfedorenko@novek.ru>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a6acbe62
    • Vadim Fedorenko's avatar
      net/tls: add CHACHA20-POLY1305 specific defines and structures · 923c40c4
      Vadim Fedorenko authored
      
      
      To provide support for ChaCha-Poly cipher we need to define
      specific constants and structures.
      
      Signed-off-by: default avatarVadim Fedorenko <vfedorenko@novek.ru>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      923c40c4
    • Vadim Fedorenko's avatar
      net/tls: make inline helpers protocol-aware · 6942a284
      Vadim Fedorenko authored
      
      
      Inline functions defined in tls.h have a lot of AES-specific
      constants. Remove these constants and change argument to struct
      tls_prot_info to have an access to cipher type in later patches
      
      Signed-off-by: default avatarVadim Fedorenko <vfedorenko@novek.ru>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      6942a284
  2. Nov 26, 2020