1. Mar 13, 2021
  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
    • Hoang Huu Le's avatar
      tipc: clean up warnings detected by sparse · 97bc84bb
      Hoang Huu Le authored
      
      
      This patch fixes the following warning from sparse:
      
      net/tipc/monitor.c:263:35: warning: incorrect type in assignment (different base types)
      net/tipc/monitor.c:263:35:    expected unsigned int
      net/tipc/monitor.c:263:35:    got restricted __be32 [usertype]
      [...]
      net/tipc/node.c:374:13: warning: context imbalance in 'tipc_node_read_lock' - wrong count at exit
      net/tipc/node.c:379:13: warning: context imbalance in 'tipc_node_read_unlock' - unexpected unlock
      net/tipc/node.c:384:13: warning: context imbalance in 'tipc_node_write_lock' - wrong count at exit
      net/tipc/node.c:389:13: warning: context imbalance in 'tipc_node_write_unlock_fast' - unexpected unlock
      net/tipc/node.c:404:17: warning: context imbalance in 'tipc_node_write_unlock' - unexpected unlock
      [...]
      net/tipc/crypto.c:1201:9: warning: incorrect type in initializer (different address spaces)
      net/tipc/crypto.c:1201:9:    expected struct tipc_aead [noderef] __rcu *__tmp
      net/tipc/crypto.c:1201:9:    got struct tipc_aead *
      [...]
      
      Acked-by: default avatarJon Maloy <jmaloy@redhat.com>
      Signed-off-by: default avatarHoang Huu Le <hoang.h.le@dektech.com.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      97bc84bb
    • Hoang Le's avatar
      tipc: convert dest node's address to network order · 1980d375
      Hoang Le authored
      
      
      (struct tipc_link_info)->dest is in network order (__be32), so we must
      convert the value to network order before assigning. The problem detected
      by sparse:
      
      net/tipc/netlink_compat.c:699:24: warning: incorrect type in assignment (different base types)
      net/tipc/netlink_compat.c:699:24:    expected restricted __be32 [usertype] dest
      net/tipc/netlink_compat.c:699:24:    got int
      
      Acked-by: default avatarJon Maloy <jmaloy@redhat.com>
      Signed-off-by: default avatarHoang Le <hoang.h.le@dektech.com.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1980d375
    • David S. Miller's avatar
      Merge branch 'mlxsw-Implement-sampling-using-mirroring' · 1520929e
      David S. Miller authored
      
      
      Ido Schimmel says:
      
      ====================
      mlxsw: Implement sampling using mirroring
      
      So far, sampling was implemented using a dedicated sampling mechanism
      that is available on all Spectrum ASICs. Spectrum-2 and later ASICs
      support sampling by mirroring packets to the CPU port with probability.
      This method has a couple of advantages compared to the legacy method:
      
      * Extra metadata per-packet: Egress port, egress traffic class, traffic
        class occupancy and end-to-end latency
      * Ability to sample packets on egress / per-flow as opposed to only
        ingress
      
      This series should not result in any user-visible changes and its aim is
      to convert Spectrum-2 and later ASICs to perform sampling by mirroring
      to the CPU port with probability. Future submissions will expose the
      additional metadata and enable sampling using more triggers (e.g.,
      egress).
      
      Series overview:
      
      Patches #1-#3 extend the SPAN (mirroring) module to accept new
      parameters required for sampling. See individual commit messages for
      detailed explanation.
      
      Patch #4-#5 split sampling support between Spectrum-1 and later ASIC while
      still using the legacy method for all ASIC generations.
      
      Patch #6 converts Spectrum-2 and later ASICs to perform sampling by
      mirroring to the CPU port with probability.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1520929e
    • Ido Schimmel's avatar
      mlxsw: spectrum_matchall: Implement sampling using mirroring · cf31190a
      Ido Schimmel authored
      
      
      Spectrum-2 and later ASICs support sampling of packets by mirroring to
      the CPU with probability. There are several advantages compared to the
      legacy dedicated sampling mechanism:
      
      * Extra metadata per-packet: Egress port, egress traffic class, traffic
        class occupancy and end-to-end latency
      * Ability to sample packets on egress / per-flow
      
      Convert Spectrum-2 and later ASICs to perform sampling by mirroring to
      the CPU with probability.
      
      Subsequent patches will add support for egress / per-flow sampling and
      expose the extra metadata.
      
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cf31190a
    • Ido Schimmel's avatar
      mlxsw: spectrum_trap: Split sampling traps between ASICs · 34a27721
      Ido Schimmel authored
      
      
      Sampling of ingress packets is supported using a dedicated sampling
      mechanism on all Spectrum ASICs. However, Spectrum-2 and later ASICs
      support more sophisticated sampling by mirroring packets to the CPU.
      
      As a preparation for more advanced sampling configurations, split the trap
      configuration used for sampled packets between Spectrum-1 and later ASICs.
      
      This is needed since packets that are mirrored to the CPU are trapped
      via a different trap identifier compared to packets that are sampled
      using the dedicated sampling mechanism.
      
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      34a27721
    • Ido Schimmel's avatar
      mlxsw: spectrum_matchall: Split sampling support between ASICs · 20afb9bc
      Ido Schimmel authored
      
      
      Sampling of ingress packets is supported using a dedicated sampling
      mechanism on all Spectrum ASICs. However, Spectrum-2 and later ASICs
      support more sophisticated sampling by mirroring packets to the CPU.
      
      As a preparation for more advanced sampling configurations, split the
      sampling operations between Spectrum-1 and later ASICs.
      
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      20afb9bc
    • Ido Schimmel's avatar
      mlxsw: spectrum_span: Add SPAN probability rate support · 2dcbd920
      Ido Schimmel authored
      
      
      Currently, every packet that matches a mirroring trigger (e.g., received
      packets, buffer dropped packets) is mirrored. Spectrum-2 and later ASICs
      support mirroring with probability, where every 1 in N matched packets
      is mirrored.
      
      Extend the API that creates the binding between the trigger and the SPAN
      agent with a probability rate parameter, which is an attribute of the
      trigger. Set it to '1' to maintain existing behavior.
      
      Subsequent patches will use it to perform more sophisticated sampling,
      by mirroring packets to the CPU with probability.
      
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2dcbd920
    • Ido Schimmel's avatar
      mlxsw: reg: Extend mirroring registers with probability rate field · fa3faeb7
      Ido Schimmel authored
      
      
      The MPAR and MPAGR registers are used to configure the binding between
      the mirroring trigger (e.g., received packet) and the SPAN agent. Add
      probability rate field, which will allow us to support sampling by
      mirroring to the CPU.
      
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fa3faeb7