1. 07 7月, 2017 1 次提交
  2. 05 7月, 2017 2 次提交
  3. 03 7月, 2017 14 次提交
  4. 02 7月, 2017 13 次提交
    • K
      locking/refcount: Remove the half-implemented refcount_sub() API · 5d6dec6f
      Kees Cook 提交于
      CONFIG_REFCOUNT_FULL=y (correctly) does not provide a refcount_sub(),
      which should not be part of proper refcount design patterns.
      
      Remove the erroneous extern and the later !CONFIG_REFCOUNT_FULL
      accidental implementation.
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Cc: Elena Reshetova <elena.reshetova@intel.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Fixes: 29dee3c0 ("locking/refcounts: Out-of-line everything")
      Link: http://lkml.kernel.org/r/20170701180129.GA17405@beastSigned-off-by: NIngo Molnar <mingo@kernel.org>
      5d6dec6f
    • L
      bpf: BPF support for sock_ops · 40304b2a
      Lawrence Brakmo 提交于
      Created a new BPF program type, BPF_PROG_TYPE_SOCK_OPS, and a corresponding
      struct that allows BPF programs of this type to access some of the
      socket's fields (such as IP addresses, ports, etc.). It uses the
      existing bpf cgroups infrastructure so the programs can be attached per
      cgroup with full inheritance support. The program will be called at
      appropriate times to set relevant connections parameters such as buffer
      sizes, SYN and SYN-ACK RTOs, etc., based on connection information such
      as IP addresses, port numbers, etc.
      
      Alghough there are already 3 mechanisms to set parameters (sysctls,
      route metrics and setsockopts), this new mechanism provides some
      distinct advantages. Unlike sysctls, it can set parameters per
      connection. In contrast to route metrics, it can also use port numbers
      and information provided by a user level program. In addition, it could
      set parameters probabilistically for evaluation purposes (i.e. do
      something different on 10% of the flows and compare results with the
      other 90% of the flows). Also, in cases where IPv6 addresses contain
      geographic information, the rules to make changes based on the distance
      (or RTT) between the hosts are much easier than route metric rules and
      can be global. Finally, unlike setsockopt, it oes not require
      application changes and it can be updated easily at any time.
      
      Although the bpf cgroup framework already contains a sock related
      program type (BPF_PROG_TYPE_CGROUP_SOCK), I created the new type
      (BPF_PROG_TYPE_SOCK_OPS) beccause the existing type expects to be called
      only once during the connections's lifetime. In contrast, the new
      program type will be called multiple times from different places in the
      network stack code.  For example, before sending SYN and SYN-ACKs to set
      an appropriate timeout, when the connection is established to set
      congestion control, etc. As a result it has "op" field to specify the
      type of operation requested.
      
      The purpose of this new program type is to simplify setting connection
      parameters, such as buffer sizes, TCP's SYN RTO, etc. For example, it is
      easy to use facebook's internal IPv6 addresses to determine if both hosts
      of a connection are in the same datacenter. Therefore, it is easy to
      write a BPF program to choose a small SYN RTO value when both hosts are
      in the same datacenter.
      
      This patch only contains the framework to support the new BPF program
      type, following patches add the functionality to set various connection
      parameters.
      
      This patch defines a new BPF program type: BPF_PROG_TYPE_SOCKET_OPS
      and a new bpf syscall command to load a new program of this type:
      BPF_PROG_LOAD_SOCKET_OPS.
      
      Two new corresponding structs (one for the kernel one for the user/BPF
      program):
      
      /* kernel version */
      struct bpf_sock_ops_kern {
              struct sock *sk;
              __u32  op;
              union {
                      __u32 reply;
                      __u32 replylong[4];
              };
      };
      
      /* user version
       * Some fields are in network byte order reflecting the sock struct
       * Use the bpf_ntohl helper macro in samples/bpf/bpf_endian.h to
       * convert them to host byte order.
       */
      struct bpf_sock_ops {
              __u32 op;
              union {
                      __u32 reply;
                      __u32 replylong[4];
              };
              __u32 family;
              __u32 remote_ip4;     /* In network byte order */
              __u32 local_ip4;      /* In network byte order */
              __u32 remote_ip6[4];  /* In network byte order */
              __u32 local_ip6[4];   /* In network byte order */
              __u32 remote_port;    /* In network byte order */
              __u32 local_port;     /* In host byte horder */
      };
      
      Currently there are two types of ops. The first type expects the BPF
      program to return a value which is then used by the caller (or a
      negative value to indicate the operation is not supported). The second
      type expects state changes to be done by the BPF program, for example
      through a setsockopt BPF helper function, and they ignore the return
      value.
      
      The reply fields of the bpf_sockt_ops struct are there in case a bpf
      program needs to return a value larger than an integer.
      Signed-off-by: NLawrence Brakmo <brakmo@fb.com>
      Acked-by: NDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      40304b2a
    • X
      sctp: remove the typedef sctp_init_chunk_t · 01a992be
      Xin Long 提交于
      This patch is to remove the typedef sctp_init_chunk_t, and replace
      with struct sctp_init_chunk in the places where it's using this
      typedef.
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      01a992be
    • X
      sctp: remove the typedef sctp_inithdr_t · 4ae70c08
      Xin Long 提交于
      This patch is to remove the typedef sctp_inithdr_t, and replace
      with struct sctp_inithdr in the places where it's using this
      typedef.
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4ae70c08
    • X
      sctp: remove the typedef sctp_data_chunk_t · 9f8d3147
      Xin Long 提交于
      This patch is to remove the typedef sctp_data_chunk_t, and replace
      with struct sctp_data_chunk in the places where it's using this
      typedef.
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9f8d3147
    • X
      sctp: remove the typedef sctp_datahdr_t · 3583df1a
      Xin Long 提交于
      This patch is to remove the typedef sctp_datahdr_t, and replace with
      struct sctp_datahdr in the places where it's using this typedef.
      
      It is also to use izeof(variable) instead of sizeof(type).
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3583df1a
    • X
      sctp: remove the typedef sctp_param_action_t · 0664ed43
      Xin Long 提交于
      Remove this typedef, there is even no places using it.
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0664ed43
    • X
      sctp: remove the typedef sctp_param_t · 34b4e29b
      Xin Long 提交于
      This patch is to remove the typedef sctp_param_t, and replace with
      struct sctp_paramhdr in the places where it's using this typedef.
      
      It is also to remove the useless declaration sctp_addip_addr_config
      and fix the lack of params for some other functions' declaration.
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      34b4e29b
    • X
      sctp: remove the typedef sctp_paramhdr_t · 3c918704
      Xin Long 提交于
      This patch is to remove the typedef sctp_paramhdr_t, and replace
      with struct sctp_paramhdr in the places where it's using this
      typedef.
      
      It is also to fix some indents and  use sizeof(variable) instead
      of sizeof(type).
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3c918704
    • X
      sctp: remove the typedef sctp_cid_action_t · ec431c2c
      Xin Long 提交于
      Remove this typedef, there is even no places using it.
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ec431c2c
    • X
      sctp: remove the typedef sctp_cid_t · 6d85e68f
      Xin Long 提交于
      This patch is to remove the typedef sctp_cid_t, and replace
      with struct sctp_cid in the places where it's using this
      typedef.
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6d85e68f
    • X
      sctp: remove the typedef sctp_chunkhdr_t · 922dbc5b
      Xin Long 提交于
      This patch is to remove the typedef sctp_chunkhdr_t, and replace
      with struct sctp_chunkhdr in the places where it's using this
      typedef.
      
      It is also to fix some indents and use sizeof(variable) instead
      of sizeof(type)., especially in sctp_new.
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      922dbc5b
    • X
      sctp: remove the typedef sctp_sctphdr_t · ae146d9b
      Xin Long 提交于
      This patch is to remove the typedef sctp_sctphdr_t, and replace
      with struct sctphdr in the places where it's using this typedef.
      
      It is also to fix some indents and use sizeof(variable) instead
      of sizeof(type).
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ae146d9b
  5. 01 7月, 2017 8 次提交
  6. 30 6月, 2017 2 次提交