1. Mar 13, 2021
    • Ido Schimmel's avatar
      selftests: fib_nexthops: Test resilient nexthop groups · 557205f4
      Ido Schimmel authored
      
      
      Add test cases for resilient nexthop groups. Exhaustive forwarding tests
      are added separately under net/forwarding/.
      
      Examples:
      
       # ./fib_nexthops.sh -t basic_res
      
      Basic resilient nexthop group functional tests
      ----------------------------------------------
      TEST: Add a nexthop group with default parameters                   [ OK ]
      TEST: Get a nexthop group with default parameters                   [ OK ]
      TEST: Get a nexthop group with non-default parameters               [ OK ]
      TEST: Add a nexthop group with 0 buckets                            [ OK ]
      TEST: Replace nexthop group parameters                              [ OK ]
      TEST: Get a nexthop group after replacing parameters                [ OK ]
      TEST: Replace idle timer                                            [ OK ]
      TEST: Get a nexthop group after replacing idle timer                [ OK ]
      TEST: Replace unbalanced timer                                      [ OK ]
      TEST: Get a nexthop group after replacing unbalanced timer          [ OK ]
      TEST: Replace with no parameters                                    [ OK ]
      TEST: Get a nexthop group after replacing no parameters             [ OK ]
      TEST: Replace nexthop group type - implicit                         [ OK ]
      TEST: Replace nexthop group type - explicit                         [ OK ]
      TEST: Replace number of nexthop buckets                             [ OK ]
      TEST: Get a nexthop group after replacing with invalid parameters   [ OK ]
      TEST: Dump all nexthop buckets                                      [ OK ]
      TEST: Dump all nexthop buckets in a group                           [ OK ]
      TEST: Dump all nexthop buckets with a specific nexthop device       [ OK ]
      TEST: Dump all nexthop buckets with a specific nexthop identifier   [ OK ]
      TEST: Dump all nexthop buckets in a non-existent group              [ OK ]
      TEST: Dump all nexthop buckets in a non-resilient group             [ OK ]
      TEST: Dump all nexthop buckets using a non-existent device          [ OK ]
      TEST: Dump all nexthop buckets with invalid 'groups' keyword        [ OK ]
      TEST: Dump all nexthop buckets with invalid 'fdb' keyword           [ OK ]
      TEST: Get a valid nexthop bucket                                    [ OK ]
      TEST: Get a nexthop bucket with valid group, but invalid index      [ OK ]
      TEST: Get a nexthop bucket from a non-resilient group               [ OK ]
      TEST: Get a nexthop bucket from a non-existent group                [ OK ]
      
      Tests passed:  29
      Tests failed:   0
      
       # ./fib_nexthops.sh -t ipv4_large_res_grp
      
      IPv4 large resilient group (128k buckets)
      -----------------------------------------
      TEST: Dump large (x131072) nexthop buckets                          [ OK ]
      
      Tests passed:   1
      Tests failed:   0
      
       # ./fib_nexthops.sh -t ipv6_large_res_grp
      
      IPv6 large resilient group (128k buckets)
      -----------------------------------------
      TEST: Dump large (x131072) nexthop buckets                          [ OK ]
      
      Tests passed:   1
      Tests failed:   0
      
       # ./fib_nexthops.sh -t ipv4_res_torture
      
      IPv4 runtime resilient nexthop group torture
      --------------------------------------------
      TEST: IPv4 resilient nexthop group torture test                     [ OK ]
      
      Tests passed:   1
      Tests failed:   0
      
       # ./fib_nexthops.sh -t ipv6_res_torture
      
      IPv6 runtime resilient nexthop group torture
      --------------------------------------------
      TEST: IPv6 resilient nexthop group torture test                     [ OK ]
      
      Tests passed:   1
      Tests failed:   0
      
       # ./fib_nexthops.sh -t ipv4_res_grp_fcnal
      
      IPv4 resilient groups functional
      --------------------------------
      TEST: Nexthop group updated when entry is deleted                   [ OK ]
      TEST: Nexthop buckets updated when entry is deleted                 [ OK ]
      TEST: Nexthop group updated after replace                           [ OK ]
      TEST: Nexthop buckets updated after replace                         [ OK ]
      TEST: Nexthop group updated when entry is deleted - nECMP           [ OK ]
      TEST: Nexthop buckets updated when entry is deleted - nECMP         [ OK ]
      TEST: Nexthop group updated after replace - nECMP                   [ OK ]
      TEST: Nexthop buckets updated after replace - nECMP                 [ OK ]
      
      Tests passed:   8
      Tests failed:   0
      
       # ./fib_nexthops.sh -t ipv6_res_grp_fcnal
      
      IPv6 resilient groups functional
      --------------------------------
      TEST: Nexthop group updated when entry is deleted                   [ OK ]
      TEST: Nexthop buckets updated when entry is deleted                 [ OK ]
      TEST: Nexthop group updated after replace                           [ OK ]
      TEST: Nexthop buckets updated after replace                         [ OK ]
      TEST: Nexthop group updated when entry is deleted - nECMP           [ OK ]
      TEST: Nexthop buckets updated when entry is deleted - nECMP         [ OK ]
      TEST: Nexthop group updated after replace - nECMP                   [ OK ]
      TEST: Nexthop buckets updated after replace - nECMP                 [ OK ]
      
      Tests passed:   8
      Tests failed:   0
      
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Co-developed-by: default avatarPetr Machata <petrm@nvidia.com>
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      557205f4
    • Ido Schimmel's avatar
      selftests: fib_nexthops: List each test case in a different line · a8f9952d
      Ido Schimmel authored
      
      
      The lines with the IPv4 and IPv6 test cases are already very long and
      more test cases will be added in subsequent patches.
      
      List each test case in a different line to make it easier to extend the
      test with more test cases.
      
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a8f9952d
    • Ido Schimmel's avatar
      selftests: fib_nexthops: Declutter test output · 8e815284
      Ido Schimmel authored
      
      
      Before:
      
       # ./fib_nexthops.sh -t ipv4_torture
      
      IPv4 runtime torture
      --------------------
      TEST: IPv4 torture test                                             [ OK ]
      ./fib_nexthops.sh: line 213: 19376 Killed                  ipv4_del_add_loop1
      ./fib_nexthops.sh: line 213: 19377 Killed                  ipv4_grp_replace_loop
      ./fib_nexthops.sh: line 213: 19378 Killed                  ip netns exec me ping -f 172.16.101.1 > /dev/null 2>&1
      ./fib_nexthops.sh: line 213: 19380 Killed                  ip netns exec me ping -f 172.16.101.2 > /dev/null 2>&1
      ./fib_nexthops.sh: line 213: 19381 Killed                  ip netns exec me mausezahn veth1 -B 172.16.101.2 -A 172.16.1.1 -c 0 -t tcp "dp=1-1023, flags=syn" > /dev/null 2>&1
      
      Tests passed:   1
      Tests failed:   0
      
       # ./fib_nexthops.sh -t ipv6_torture
      
      IPv6 runtime torture
      --------------------
      TEST: IPv6 torture test                                             [ OK ]
      ./fib_nexthops.sh: line 213: 24453 Killed                  ipv6_del_add_loop1
      ./fib_nexthops.sh: line 213: 24454 Killed                  ipv6_grp_replace_loop
      ./fib_nexthops.sh: line 213: 24456 Killed                  ip netns exec me ping -f 2001:db8:101::1 > /dev/null 2>&1
      ./fib_nexthops.sh: line 213: 24457 Killed                  ip netns exec me ping -f 2001:db8:101::2 > /dev/null 2>&1
      ./fib_nexthops.sh: line 213: 24458 Killed                  ip netns exec me mausezahn -6 veth1 -B 2001:db8:101::2 -A 2001:db8:91::1 -c 0 -t tcp "dp=1-1023, flags=syn" > /dev/null 2>&1
      
      Tests passed:   1
      Tests failed:   0
      
      After:
      
       # ./fib_nexthops.sh -t ipv4_torture
      
      IPv4 runtime torture
      --------------------
      TEST: IPv4 torture test                                             [ OK ]
      
      Tests passed:   1
      Tests failed:   0
      
       # ./fib_nexthops.sh -t ipv6_torture
      
      IPv6 runtime torture
      --------------------
      TEST: IPv6 torture test                                             [ OK ]
      
      Tests passed:   1
      Tests failed:   0
      
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8e815284
    • Ido Schimmel's avatar
      netdevsim: Allow reporting activity on nexthop buckets · c6385c0b
      Ido Schimmel authored
      
      
      A key component of the resilient hashing algorithm is the hash buckets'
      activity. If a bucket is active, it will not be populated with a new
      nexthop in order not to break existing flows. Therefore, in order to
      easily and thoroughly test the algorithm, we need to be in full control
      over the reported activity.
      
      Add a debugfs interface that allows user space to have netdevsim report
      a nexthop bucket within a resilient nexthop group as active. For
      example:
      
       # echo 10 23 > /sys/kernel/debug/netdevsim/netdevsim10/fib/nexthop_bucket_activity
      
      Will mark bucket 23 in nexthop group 10 as active.
      
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c6385c0b
    • Ido Schimmel's avatar
      netdevsim: Add support for resilient nexthop groups · d8eaa4fa
      Ido Schimmel authored
      
      
      Allow resilient nexthop groups to be programmed and account their
      occupancy according to their number of buckets. The nexthop group itself
      as well as its buckets are marked with hardware flags (i.e.,
      'RTNH_F_TRAP').
      
      Replacement of a single nexthop bucket can fail using the following
      debugfs knob:
      
       # cat /sys/kernel/debug/netdevsim/netdevsim10/fib/fail_nexthop_bucket_replace
       N
       # echo 1 > /sys/kernel/debug/netdevsim/netdevsim10/fib/fail_nexthop_bucket_replace
       # cat /sys/kernel/debug/netdevsim/netdevsim10/fib/fail_nexthop_bucket_replace
       Y
      
      Replacement of a resilient nexthop group can fail using the following
      debugfs knob:
      
       # cat /sys/kernel/debug/netdevsim/netdevsim10/fib/fail_res_nexthop_group_replace
       N
       # echo 1 > /sys/kernel/debug/netdevsim/netdevsim10/fib/fail_res_nexthop_group_replace
       # cat /sys/kernel/debug/netdevsim/netdevsim10/fib/fail_res_nexthop_group_replace
       Y
      
      This enables testing of various error paths.
      
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d8eaa4fa
    • Ido Schimmel's avatar
      netdevsim: Create a helper for setting nexthop hardware flags · 40ff8371
      Ido Schimmel authored
      
      
      Instead of calling nexthop_set_hw_flags(), call a helper. It will be
      used to also set nexthop bucket flags in a subsequent patch.
      
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      40ff8371
    • Petr Machata's avatar
      netdevsim: fib: Introduce a lock to guard nexthop hashtable · 86927c9c
      Petr Machata authored
      
      
      Currently netdevsim relies on RTNL to maintain exclusivity in accessing the
      nexthop hash table. However, bucket notification may be called without RTNL
      having been held. Instead, introduce a custom lock to guard the table.
      
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Reviewed-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      86927c9c
    • David S. Miller's avatar
      Merge branch 'ptp-warnings' · b202923d
      David S. Miller authored
      
      
      Lee Jones says:
      
      ====================
      Rid W=1 warnings from PTP
      
      This set is part of a larger effort attempting to clean-up W=1
      kernel builds, which are currently overwhelmingly riddled with
      niggly little warnings.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b202923d
    • Lee Jones's avatar
      ptp: ptp_p: Demote non-conformant kernel-doc headers and supply a param description · 287f93de
      Lee Jones authored
      
      
      Fixes the following W=1 kernel build warning(s):
      
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'control' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'event' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'addend' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'accum' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'test' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'ts_compare' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'rsystime_lo' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'rsystime_hi' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'systime_lo' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'systime_hi' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'trgt_lo' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'trgt_hi' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'asms_lo' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'asms_hi' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'amms_lo' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'amms_hi' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'ch_control' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'ch_event' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'tx_snap_lo' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'tx_snap_hi' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'rx_snap_lo' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'rx_snap_hi' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'src_uuid_lo' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'src_uuid_hi' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'can_status' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'can_snap_lo' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'can_snap_hi' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'ts_sel' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'ts_st' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'reserve1' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'stl_max_set_en' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'stl_max_set' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'reserve2' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:78: warning: Function parameter or member 'srst' not described in 'pch_ts_regs'
       drivers/ptp/ptp_pch.c:121: warning: Function parameter or member 'regs' not described in 'pch_dev'
       drivers/ptp/ptp_pch.c:121: warning: Function parameter or member 'ptp_clock' not described in 'pch_dev'
       drivers/ptp/ptp_pch.c:121: warning: Function parameter or member 'caps' not described in 'pch_dev'
       drivers/ptp/ptp_pch.c:121: warning: Function parameter or member 'exts0_enabled' not described in 'pch_dev'
       drivers/ptp/ptp_pch.c:121: warning: Function parameter or member 'exts1_enabled' not described in 'pch_dev'
       drivers/ptp/ptp_pch.c:121: warning: Function parameter or member 'mem_base' not described in 'pch_dev'
       drivers/ptp/ptp_pch.c:121: warning: Function parameter or member 'mem_size' not described in 'pch_dev'
       drivers/ptp/ptp_pch.c:121: warning: Function parameter or member 'irq' not described in 'pch_dev'
       drivers/ptp/ptp_pch.c:121: warning: Function parameter or member 'pdev' not described in 'pch_dev'
       drivers/ptp/ptp_pch.c:121: warning: Function parameter or member 'register_lock' not described in 'pch_dev'
       drivers/ptp/ptp_pch.c:128: warning: Function parameter or member 'station' not described in 'pch_params'
       drivers/ptp/ptp_pch.c:291: warning: Function parameter or member 'pdev' not described in 'pch_set_station_address'
      
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: LAPIS SEMICONDUCTOR <tshimizu818@gmail.com>
      Cc: netdev@vger.kernel.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      287f93de
    • Lee Jones's avatar
      ptp: ptp_clockmatrix: Demote non-kernel-doc header to standard comment · 9ec04c71
      Lee Jones authored
      
      
      Fixes the following W=1 kernel build warning(s):
      
       drivers/ptp/ptp_clockmatrix.c:1408: warning: Cannot understand  * @brief Maximum absolute value for write phase offset in picoseconds
       drivers/ptp/ptp_clockmatrix.c:1408: warning: Cannot understand  * @brief Maximum absolute value for write phase offset in picoseconds
       drivers/ptp/ptp_clockmatrix.c:1408: warning: Cannot understand  * @brief Maximum absolute value for write phase offset in picoseconds
       drivers/ptp/ptp_clockmatrix.c:1408: warning: Cannot understand  * @brief Maximum absolute value for write phase offset in picoseconds
       drivers/ptp/ptp_clockmatrix.c:1408: warning: Cannot understand  * @brief Maximum absolute value for write phase offset in picoseconds
      
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: IDT-support-1588@lm.renesas.com
      Cc: netdev@vger.kernel.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9ec04c71
    • Lee Jones's avatar
      ptp_pch: Move 'pch_*()' prototypes to shared header · f90fc37f
      Lee Jones authored
      
      
      Fixes the following W=1 kernel build warning(s):
      
       drivers/ptp/ptp_pch.c:193:6: warning: no previous prototype for ‘pch_ch_control_write’ [-Wmissing-prototypes]
       drivers/ptp/ptp_pch.c:201:5: warning: no previous prototype for ‘pch_ch_event_read’ [-Wmissing-prototypes]
       drivers/ptp/ptp_pch.c:212:6: warning: no previous prototype for ‘pch_ch_event_write’ [-Wmissing-prototypes]
       drivers/ptp/ptp_pch.c:220:5: warning: no previous prototype for ‘pch_src_uuid_lo_read’ [-Wmissing-prototypes]
       drivers/ptp/ptp_pch.c:231:5: warning: no previous prototype for ‘pch_src_uuid_hi_read’ [-Wmissing-prototypes]
       drivers/ptp/ptp_pch.c:242:5: warning: no previous prototype for ‘pch_rx_snap_read’ [-Wmissing-prototypes]
       drivers/ptp/ptp_pch.c:259:5: warning: no previous prototype for ‘pch_tx_snap_read’ [-Wmissing-prototypes]
       drivers/ptp/ptp_pch.c:300:5: warning: no previous prototype for ‘pch_set_station_address’ [-Wmissing-prototypes]
      
      Cc: Richard Cochran <richardcochran@gmail.com> (maintainer:PTP HARDWARE CLOCK SUPPORT)
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: Flavio Suligoi <f.suligoi@asem.it>
      Cc: netdev@vger.kernel.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f90fc37f
    • Lee Jones's avatar
      ptp_pch: Remove unused function 'pch_ch_control_read()' · 257382c5
      Lee Jones authored
      
      
      Fixes the following W=1 kernel build warning(s):
      
       drivers/ptp/ptp_pch.c:182:5: warning: no previous prototype for ‘pch_ch_control_read’ [-Wmissing-prototypes]
      
      Cc: Richard Cochran <richardcochran@gmail.com> (maintainer:PTP HARDWARE CLOCK SUPPORT)
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: Flavio Suligoi <f.suligoi@asem.it>
      Cc: netdev@vger.kernel.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      257382c5
    • Rafał Miłecki's avatar
      net: dsa: bcm_sf2: setup BCM4908 internal crossbar · a9349f08
      Rafał Miłecki authored
      
      
      On some SoCs (e.g. BCM4908, BCM631[345]8) SF2 has an integrated
      crossbar. It allows connecting its selected external ports to internal
      ports. It's used by vendors to handle custom Ethernet setups.
      
      BCM4908 has following 3x2 crossbar. On Asus GT-AC5300 rgmii is used for
      connecting external BCM53134S switch. GPHY4 is usually used for WAN
      port. More fancy devices use SerDes for 2.5 Gbps Ethernet.
      
                    ┌──────────┐
      SerDes ─── 0 ─┤          │
                    │   3x2    ├─ 0 ─── switch port 7
       GPHY4 ─── 1 ─┤          │
                    │ crossbar ├─ 1 ─── runner (accelerator)
       rgmii ─── 2 ─┤          │
                    └──────────┘
      
      Use setup data based on DT info to configure BCM4908's switch port 7.
      Right now only GPHY and rgmii variants are supported. Handling SerDes
      can be implemented later.
      
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a9349f08
    • Rafał Miłecki's avatar
      net: dsa: bcm_sf2: store PHY interface/mode in port structure · 01488a0c
      Rafał Miłecki authored
      
      
      It's needed later for proper switch / crossbar setup.
      
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      01488a0c
    • Shubhankar Kuranagatti's avatar
      net: ipv4: route.c: Fix indentation of multi line comment. · 6ad08600
      Shubhankar Kuranagatti authored
      
      
      All comment lines inside the comment block have been aligned.
      Every line of comment starts with a * (uniformity in code).
      
      Signed-off-by: default avatarShubhankar Kuranagatti <shubhankarvk@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6ad08600
    • Rafał Miłecki's avatar
      net: broadcom: bcm4908_enet: support TX interrupt · 12bb508b
      Rafał Miłecki authored
      
      
      It appears that each DMA channel has its own interrupt and both rings
      can be configured (the same way) to handle interrupts.
      
      1. Make ring interrupts code generic (make it operate on given ring)
      2. Move napi to ring (so each has its own)
      3. Make IRQ handler generic (match ring against received IRQ number)
      4. Add (optional) support for TX interrupt
      
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      12bb508b
    • Rafał Miłecki's avatar
      dt-bindings: net: bcm4908-enet: add optional TX interrupt · ab4dda7a
      Rafał Miłecki authored
      
      
      I discovered that hardware actually supports two interrupts, one per DMA
      channel (RX and TX).
      
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ab4dda7a
    • David S. Miller's avatar
      Merge branch 'macb-fixed-link-fixes' · 26d2e042
      David S. Miller authored
      
      
      Robert Hancock says:
      
      ====================
      macb SGMII fixed-link fixes
      
      Some fixes to the macb driver for use in SGMII mode with a fixed-link (such as
      for chip-to-chip connectivity).
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      26d2e042
    • Robert Hancock's avatar
      net: macb: Disable PCS auto-negotiation for SGMII fixed-link mode · e276e5e4
      Robert Hancock authored
      
      
      When using a fixed-link configuration in SGMII mode, it's not really
      sensible to have auto-negotiation enabled since the link settings are
      fixed by definition. In other configurations, such as an SGMII
      connection to a PHY, it should generally be enabled.
      
      Signed-off-by: default avatarRobert Hancock <robert.hancock@calian.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e276e5e4
    • Robert Hancock's avatar
      net: macb: poll for fixed link state in SGMII mode · 8fab174b
      Robert Hancock authored
      
      
      When using a fixed-link configuration with GEM in SGMII mode, such as
      for a chip-to-chip interconnect, the link state was always showing as
      established regardless of the actual connectivity state. We can monitor
      the pcs_link_state bit in the Network Status register to determine
      whether the PCS link state is actually up.
      
      Signed-off-by: default avatarRobert Hancock <robert.hancock@calian.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8fab174b
    • David S. Miller's avatar
      Merge tag 'mlx5-updates-2021-03-12' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux · c232f81b
      David S. Miller authored
      
      
      Saeed Mahameed says:
      
      ====================
      mlx5-updates-2021-03-12
      
      1) TC support for ICMP parameters
      2) TC connection tracking with mirroring
      3) A round of trivial fixups and cleanups
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c232f81b
    • Maor Dickman's avatar
      net/mlx5e: Allow to match on ICMP parameters · a3222a2d
      Maor Dickman authored
      
      
      Support matching on ICMPv4/6 type and code parameters using misc3
      section of match parameters.
      
      Signed-off-by: default avatarMaor Dickman <maord@nvidia.com>
      Reviewed-by: default avatarRoi Dayan <roid@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      a3222a2d
    • Paul Blakey's avatar
      net/mlx5: CT: Add support for mirroring · 69e2916e
      Paul Blakey authored
      
      
      Add support for mirroring before the CT action by spliting the pre ct rule.
      Mirror outputs are done first on the tc chain,prio table rule (the fwd
      rule), which will then forward to a per port fwd table.
      On this fwd table, we insert the original pre ct rule that forwards to
      ct/ct nat table.
      
      Signed-off-by: default avatarPaul Blakey <paulb@mellanox.com>
      Signed-off-by: default avatarMaor Dickman <maord@nvidia.com>
      Reviewed-by: default avatarRoi Dayan <roid@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      69e2916e
    • Alaa Hleihel's avatar
      net/mlx5: Display the command index in command mailbox dump · 287e0df0
      Alaa Hleihel authored
      
      
      Multiple commands can be printed at the same time which can
      lead to wrong order of their lines in dmesg output.
      As a result, it's hard to match data dumps to the correct command
      or which command was fully dumped at some point.
      
      Fix this by displaying the corresponding command index, and also
      indicate when a command was fully dumped.
      
      Signed-off-by: default avatarAlaa Hleihel <alaa@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      287e0df0
    • Arnd Bergmann's avatar
      net/mlx5e: allocate 'indirection_rqt' buffer dynamically · 2119bda6
      Arnd Bergmann authored
      
      
      Increasing the size of the indirection_rqt array from 128 to 256 bytes
      pushed the stack usage of the mlx5e_hairpin_fill_rqt_rqns() function
      over the warning limit when building with clang and CONFIG_KASAN:
      
      drivers/net/ethernet/mellanox/mlx5/core/en_tc.c:970:1: error: stack frame size of 1180 bytes in function 'mlx5e_tc_add_nic_flow' [-Werror,-Wframe-larger-than=]
      
      Using dynamic allocation here is safe because the caller does the
      same, and it reduces the stack usage of the function to just a few
      bytes.
      
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      2119bda6
    • Tariq Toukan's avatar
      net/mlx5e: Dump ICOSQ WQE descriptor on CQE with error events · e16cf9d7
      Tariq Toukan authored
      
      
      Dump the ICOSQ's WQE descriptor when a completion with error is received.
      
      Signed-off-by: default avatarTariq Toukan <tariqt@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      e16cf9d7
    • Maxim Mikityanskiy's avatar
      net/mlx5e: Use net_prefetchw instead of prefetchw in MPWQE TX datapath · 991b2654
      Maxim Mikityanskiy authored
      Commit e20f0dbf ("net/mlx5e: RX, Add a prefetch command for small
      L1_CACHE_BYTES") switched to using net_prefetchw at all places in mlx5e.
      In the same time frame, commit 5af75c74
      
       ("net/mlx5e: Enhanced TX
      MPWQE for SKBs") added one more usage of prefetchw. When these two
      changes were merged, this new occurrence of prefetchw wasn't replaced
      with net_prefetchw.
      
      This commit fixes this last occurrence of prefetchw in
      mlx5e_tx_mpwqe_session_start, making the same change that was done in
      mlx5e_xdp_mpwqe_session_start.
      
      Signed-off-by: default avatarMaxim Mikityanskiy <maximmi@mellanox.com>
      Reviewed-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      991b2654
    • Roi Dayan's avatar
      net/mlx5e: Remove redundant newline in NL_SET_ERR_MSG_MOD · bca08a91
      Roi Dayan authored
      
      
      Fix the following coccicheck warnings:
      
      drivers/net/ethernet/mellanox/mlx5/core/devlink.c:145:29-66: WARNING
      avoid newline at end of message in NL_SET_ERR_MSG_MOD
      drivers/net/ethernet/mellanox/mlx5/core/devlink.c:140:29-77: WARNING
      avoid newline at end of message in NL_SET_ERR_MSG_MOD
      
      Signed-off-by: default avatarRoi Dayan <roid@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      bca08a91
    • Mark Zhang's avatar
      net/mlx5: Read congestion counters from all ports when lag is active · 093bd764
      Mark Zhang authored
      
      
      Read congestion counters from all ports in any lag mode rather than
      only in RoCE lag mode (e.g., VF lag).
      
      Signed-off-by: default avatarMark Zhang <markzhang@nvidia.com>
      Reviewed-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      Reviewed-by: default avatarMaor Gottlieb <maorg@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      093bd764
    • Jiapeng Chong's avatar
      net/mlx5: remove unneeded semicolon · 79760922
      Jiapeng Chong authored
      
      
      Fix the following coccicheck warnings:
      
      ./drivers/net/ethernet/mellanox/mlx5/core/sf/devlink.c:495:2-3: Unneeded
      semicolon.
      
      Reported-by: default avatarAbaci Robot <abaci@linux.alibaba.com>
      Signed-off-by: default avatarJiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Reviewed-by: default avatarParav Pandit <parav@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      79760922
    • Junlin Yang's avatar
      net/mlx5: use kvfree() for memory allocated with kvzalloc() · ad2c99ca
      Junlin Yang authored
      
      
      It is allocated with kvzalloc(), the corresponding release function
      should not be kfree(), use kvfree() instead.
      
      Generated by: scripts/coccinelle/api/kfree_mismatch.cocci
      
      Signed-off-by: default avatarJunlin Yang <yangjunlin@yulong.com>
      Reviewed-by: default avatarRoi Dayan <roid@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      ad2c99ca
    • Yevgeny Kliteynik's avatar
      net/mlx5: DR, Add missing vhca_id consume from STEv1 · cc82a2e6
      Yevgeny Kliteynik authored
      The field source_eswitch_owner_vhca_id was not consumed
      in the same way as in STEv0. Added the missing set.
      
      Fixes: 10b69418
      
       ("net/mlx5: DR, Add HW STEv1 match logic")
      Signed-off-by: default avatarAlex Vesker <valex@mellanox.com>
      Signed-off-by: default avatarYevgeny Kliteynik <kliteyn@nvidia.com>
      Reviewed-by: default avatarAlex Vesker <valex@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      cc82a2e6
    • Yevgeny Kliteynik's avatar
      net/mlx5: DR, Remove unneeded rx_decap_l3 function for STEv1 · 14124778
      Yevgeny Kliteynik authored
      
      
      Remove the dr_ste_v1_set_rx_decap_l3 function that was
      replaced by another function - fixing a rebase error.
      
      Signed-off-by: default avatarYevgeny Kliteynik <kliteyn@nvidia.com>
      Reviewed-by: default avatarAlex Vesker <valex@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      14124778
    • Yevgeny Kliteynik's avatar
      net/mlx5: DR, Fixed typo in STE v0 · 0142f097
      Yevgeny Kliteynik authored
      
      
      "reforamt" -> "reformat"
      
      Signed-off-by: default avatarYevgeny Kliteynik <kliteyn@nvidia.com>
      Reviewed-by: default avatarAlex Vesker <valex@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      0142f097
    • Jonathan Neuschäfer's avatar
      docs: networking: phy: Improve placement of parenthesis · bfdfe7fc
      Jonathan Neuschäfer authored
      
      
      "either" is outside the parentheses, so the matching "or" should be too.
      
      Signed-off-by: default avatarJonathan Neuschäfer <j.neuschaefer@gmx.net>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bfdfe7fc
  2. Mar 12, 2021
    • David S. Miller's avatar
      Merge branch 'tcp-delayed-completions' · 5215206d
      David S. Miller authored
      
      
      Eric Dumazet says:
      
      ====================
      tcp: better deal with delayed TX completions
      
      Jakub and Neil reported an increase of RTO timers whenever
      TX completions are delayed a bit more (by increasing
      NIC TX coalescing parameters)
      
      While problems have been there forever, second patch might
      introduce some regressions so I prefer not backport
      them to stable releases before things settle.
      
      Many thanks to FB team for their help and tests.
      
      Few packetdrill tests need to be changed to reflect
      the improvements brought by this series.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5215206d
    • Eric Dumazet's avatar
      tcp: remove obsolete check in __tcp_retransmit_skb() · ac3959fd
      Eric Dumazet authored
      
      
      TSQ provides a nice way to avoid bufferbloat on individual socket,
      including retransmit packets. We can get rid of the old
      heuristic:
      
      	/* Do not sent more than we queued. 1/4 is reserved for possible
      	 * copying overhead: fragmentation, tunneling, mangling etc.
      	 */
      	if (refcount_read(&sk->sk_wmem_alloc) >
      	    min_t(u32, sk->sk_wmem_queued + (sk->sk_wmem_queued >> 2),
      		  sk->sk_sndbuf))
      		return -EAGAIN;
      
      This heuristic was giving false positives according to Jakub,
      whenever TX completions are delayed above RTT. (Ack packets
      are processed by TCP stack before clones are orphaned/freed)
      
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarJakub Kicinski <kuba@kernel.org>
      Cc: Neal Cardwell <ncardwell@google.com>
      Cc: Yuchung Cheng <ycheng@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ac3959fd
    • Eric Dumazet's avatar
      tcp: consider using standard rtx logic in tcp_rcv_fastopen_synack() · a7abf3cd
      Eric Dumazet authored
      
      
      Jakub reported Data included in a Fastopen SYN that had to be
      retransmit would have to wait for an RTO if TX completions are slow,
      even with prior fix.
      
      This is because tcp_rcv_fastopen_synack() does not use standard
      rtx logic, meaning TSQ handler exits early in tcp_tsq_write()
      because tp->lost_out == tp->retrans_out
      
      Lets make tcp_rcv_fastopen_synack() use standard rtx logic,
      by using tcp_mark_skb_lost() on the skb thats needs to be
      sent again.
      
      Not this raised a warning in tcp_fastretrans_alert() during my tests
      since we consider the data not being aknowledged
      by the receiver does not mean packet was lost on the network.
      
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarJakub Kicinski <kuba@kernel.org>
      Cc: Neal Cardwell <ncardwell@google.com>
      Cc: Yuchung Cheng <ycheng@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a7abf3cd
    • Eric Dumazet's avatar
      tcp: plug skb_still_in_host_queue() to TSQ · f4dae54e
      Eric Dumazet authored
      Jakub and Neil reported an increase of RTO timers whenever
      TX completions are delayed a bit more (by increasing
      NIC TX coalescing parameters)
      
      Main issue is that TCP stack has a logic preventing a packet
      being retransmit if the prior clone has not yet been
      orphaned or freed.
      
      This logic came with commit 1f3279ae
      
       ("tcp: avoid
      retransmits of TCP packets hanging in host queues")
      
      Thankfully, in the case skb_still_in_host_queue() detects
      the initial clone is still in flight, it can use TSQ logic
      that will eventually retry later, at the moment the clone
      is freed or orphaned.
      
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarNeil Spring <ntspring@fb.com>
      Reported-by: default avatarJakub Kicinski <kuba@kernel.org>
      Cc: Neal Cardwell <ncardwell@google.com>
      Cc: Yuchung Cheng <ycheng@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f4dae54e
    • Tong Zhang's avatar
      isdn: remove extra spaces in the header file · 8176f8c0
      Tong Zhang authored
      
      
      fix some coding style issues in the isdn header
      
      Signed-off-by: default avatarTong Zhang <ztong0001@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8176f8c0