1. 03 6月, 2015 7 次提交
  2. 02 6月, 2015 6 次提交
  3. 01 6月, 2015 7 次提交
    • F
      net: dsa: Properly propagate errors from dsa_switch_setup_one · 24595346
      Florian Fainelli 提交于
      While shuffling some code around, dsa_switch_setup_one() was introduced,
      and it was modified to return either an error code using ERR_PTR() or a
      NULL pointer when running out of memory or failing to setup a switch.
      
      This is a problem for its caler: dsa_switch_setup() which uses IS_ERR()
      and expects to find an error code, not a NULL pointer, so we still try
      to proceed with dsa_switch_setup() and operate on invalid memory
      addresses. This can be easily reproduced by having e.g: the bcm_sf2
      driver built-in, but having no such switch, such that drv->setup will
      fail.
      
      Fix this by using PTR_ERR() consistently which is both more informative
      and avoids for the caller to use IS_ERR_OR_NULL().
      
      Fixes: df197195 ("net: dsa: split dsa_switch_setup into two functions")
      Reported-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Tested-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      24595346
    • N
      tcp: fix child sockets to use system default congestion control if not set · 9f950415
      Neal Cardwell 提交于
      Linux 3.17 and earlier are explicitly engineered so that if the app
      doesn't specifically request a CC module on a listener before the SYN
      arrives, then the child gets the system default CC when the connection
      is established. See tcp_init_congestion_control() in 3.17 or earlier,
      which says "if no choice made yet assign the current value set as
      default". The change ("net: tcp: assign tcp cong_ops when tcp sk is
      created") altered these semantics, so that children got their parent
      listener's congestion control even if the system default had changed
      after the listener was created.
      
      This commit returns to those original semantics from 3.17 and earlier,
      since they are the original semantics from 2007 in 4d4d3d1e ("[TCP]:
      Congestion control initialization."), and some Linux congestion
      control workflows depend on that.
      
      In summary, if a listener socket specifically sets TCP_CONGESTION to
      "x", or the route locks the CC module to "x", then the child gets
      "x". Otherwise the child gets current system default from
      net.ipv4.tcp_congestion_control. That's the behavior in 3.17 and
      earlier, and this commit restores that.
      
      Fixes: 55d8694f ("net: tcp: assign tcp cong_ops when tcp sk is created")
      Cc: Florian Westphal <fw@strlen.de>
      Cc: Daniel Borkmann <dborkman@redhat.com>
      Cc: Glenn Judd <glenn.judd@morganstanley.com>
      Cc: Stephen Hemminger <stephen@networkplumber.org>
      Signed-off-by: NNeal Cardwell <ncardwell@google.com>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NYuchung Cheng <ycheng@google.com>
      Acked-by: NDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9f950415
    • S
      net/rds Add getsockopt support for SO_RDS_TRANSPORT · 8ba38460
      Sowmini Varadhan 提交于
      The currently attached transport for a PF_RDS socket may be obtained
      from user space by invoking getsockopt(2) using the SO_RDS_TRANSPORT
      option at the SOL_RDS level. The integer optval returned will be one
      of the RDS_TRANS_* constants defined in linux/rds.h.
      Signed-off-by: NSowmini Varadhan <sowmini.varadhan@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8ba38460
    • S
      net/rds: Add setsockopt support for SO_RDS_TRANSPORT · d97dac54
      Sowmini Varadhan 提交于
      An application may deterministically attach the underlying transport for
      a PF_RDS socket by invoking setsockopt(2) with the SO_RDS_TRANSPORT
      option at the SOL_RDS level. The integer argument to setsockopt must be
      one of the RDS_TRANS_* transport types, e.g., RDS_TRANS_TCP. The option
      must be specified before invoking bind(2) on the socket, and may only
      be used once on the socket. An attempt to set the option on a bound
      socket, or to invoke the option after a successful SO_RDS_TRANSPORT
      attachment, will return EOPNOTSUPP.
      Signed-off-by: NSowmini Varadhan <sowmini.varadhan@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d97dac54
    • S
      net/rds: Declare SO_RDS_TRANSPORT and RDS_TRANS_* constants in uapi/linux/rds.h · a28c257c
      Sowmini Varadhan 提交于
      User space applications that desire to explicitly select the
      underlying transport for a PF_RDS socket may do so by using the
      SO_RDS_TRANSPORT socket option at the SOL_RDS level before bind().
      The integer argument provided to the socket option would be one
      of the RDS_TRANS_* values, e.g., RDS_TRANS_TCP. This commit exports
      the constant values need by such applications via <linux/rds.h>
      Signed-off-by: NSowmini Varadhan <sowmini.varadhan@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a28c257c
    • D
      ebpf: allow bpf_ktime_get_ns_proto also for networking · 17ca8cbf
      Daniel Borkmann 提交于
      As this is already exported from tracing side via commit d9847d31
      ("tracing: Allow BPF programs to call bpf_ktime_get_ns()"), we might
      as well want to move it to the core, so also networking users can make
      use of it, e.g. to measure diffs for certain flows from ingress/egress.
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Cc: Alexei Starovoitov <ast@plumgrid.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      17ca8cbf
    • E
      udp: fix behavior of wrong checksums · beb39db5
      Eric Dumazet 提交于
      We have two problems in UDP stack related to bogus checksums :
      
      1) We return -EAGAIN to application even if receive queue is not empty.
         This breaks applications using edge trigger epoll()
      
      2) Under UDP flood, we can loop forever without yielding to other
         processes, potentially hanging the host, especially on non SMP.
      
      This patch is an attempt to make things better.
      
      We might in the future add extra support for rt applications
      wanting to better control time spent doing a recv() in a hostile
      environment. For example we could validate checksums before queuing
      packets in socket receive queue.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      beb39db5
  4. 31 5月, 2015 6 次提交
  5. 29 5月, 2015 14 次提交