1. 07 12月, 2017 1 次提交
  2. 05 12月, 2017 15 次提交
    • L
      bpf: Add access to snd_cwnd and others in sock_ops · f19397a5
      Lawrence Brakmo 提交于
      Adds read access to snd_cwnd and srtt_us fields of tcp_sock. Since these
      fields are only valid if the socket associated with the sock_ops program
      call is a full socket, the field is_fullsock is also added to the
      bpf_sock_ops struct. If the socket is not a full socket, reading these
      fields returns 0.
      
      Note that in most cases it will not be necessary to check is_fullsock to
      know if there is a full socket. The context of the call, as specified by
      the 'op' field, can sometimes determine whether there is a full socket.
      
      The struct bpf_sock_ops has the following fields added:
      
        __u32 is_fullsock;      /* Some TCP fields are only valid if
                                 * there is a full socket. If not, the
                                 * fields read as zero.
      			   */
        __u32 snd_cwnd;
        __u32 srtt_us;          /* Averaged RTT << 3 in usecs */
      
      There is a new macro, SOCK_OPS_GET_TCP32(NAME), to make it easier to add
      read access to more 32 bit tcp_sock fields.
      Signed-off-by: NLawrence Brakmo <brakmo@fb.com>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      f19397a5
    • W
      bpf: move bpf csum flag check · 792f3dd6
      William Tu 提交于
      trivial move the BPF_F_ZERO_CSUM_TX check right below the
      'flags & BPF_F_DONT_FRAGMENT', so common tun_flags handling
      is logically together.
      Signed-off-by: NWilliam Tu <u9012063@gmail.com>
      Acked-by: NDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      792f3dd6
    • F
      rtnetlink: ipv6: convert remaining users to rtnl_register_module · a3fde2ad
      Florian Westphal 提交于
      convert remaining users of rtnl_register to rtnl_register_module
      and un-export rtnl_register.
      Requested-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a3fde2ad
    • D
      Merge tag 'linux-can-next-for-4.16-20171201' of... · 112d59c7
      David S. Miller 提交于
      Merge tag 'linux-can-next-for-4.16-20171201' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next
      
      Marc Kleine-Budde says:
      
      ====================
      pull-request: can-next 2017-12-01
      
      this is a pull request of 10 patches for net-next/master.
      
      The first two patches are by Arnd Bergmann, they convert the peak_usb
      from using "struct timeval" to "ktime_t". The error handling in the
      vxcan driver is clean up by Markus Elfring's patch. Bhumika Goyal
      contributes a patch for the c_can_pci driver to make the pci data const.
      The six patches by Pankaj Bansal for the flexcan driver add LS1021A
      support by making the endianness of the driver configurable by the
      device tree.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      112d59c7
    • D
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next · d671965b
      David S. Miller 提交于
      Daniel Borkmann says:
      
      ====================
      pull-request: bpf-next 2017-12-03
      
      The following pull-request contains BPF updates for your *net-next* tree.
      
      The main changes are:
      
      1) Addition of a software model for BPF offloads in order to ease
         testing code changes in that area and make semantics more clear.
         This is implemented in a new driver called netdevsim, which can
         later also be extended for other offloads. SR-IOV support is added
         as well to netdevsim. BPF kernel selftests for offloading are
         added so we can track basic functionality as well as exercising
         all corner cases around BPF offloading, from Jakub.
      
      2) Today drivers have to drop the reference on BPF progs they hold
         due to XDP on device teardown themselves. Change this in order
         to make XDP handling inside the drivers less error prone, and
         move disabling XDP to the core instead, also from Jakub.
      
      3) Misc set of BPF verifier improvements and cleanups as preparatory
         work for upcoming BPF-to-BPF calls. Among others, this set also
         improves liveness marking such that pruning can be slightly more
         effective. Register and stack liveness information is now included
         in the verifier log as well, from Alexei.
      
      4) nfp JIT improvements in order to identify load/store sequences in
         the BPF prog e.g. coming from memcpy lowering and optimizing them
         through the NPU's command push pull (CPP) instruction, from Jiong.
      
      5) Cleanups to test_cgrp2_attach2.c BPF sample code in oder to remove
         bpf_prog_attach() magic values and replacing them with actual proper
         attach flag instead, from David.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d671965b
    • D
      Merge branch 'rtnetlink-rework-handler-registration' · f4d4c49b
      David S. Miller 提交于
      Florian Westphal says:
      
      ====================
      rtnetlink: rework handler (un)registering
      
      Peter Zijlstra reported (referring to commit 019a3169,
      "rtnetlink: add reference counting to prevent module unload while dump is in progress"):
      
       1) it not in fact a refcount, so using refcount_t is silly
       2) there is a distinct lack of memory barriers, so we can easily
          observe the decrement while the msg_handler is still in progress.
       3) waiting with a schedule()/yield() loop is complete crap and subject
          life-locks, imagine doing that rtnl_unregister_all() from a RT task.
      
      In ancient times rtnetlink exposed a statically-sized table with
      preset doit/dumpit handlers to be called for a protocol/type pair.
      
      Later the rtnl_register interface was added and the table was allocated
      on demand.  Eventually these were also used by modules.
      
      Problem is that nothing prevents module unload while a netlink dump
      is in progress.  netlink dumps can be span multiple recv calls and
      netlink core saves the to-be-repeated dumper address for later invocation.
      
      To prevent rmmod the netlink core expects callers to pass in the owning
      module so a reference can be taken.
      
      So far rtnetlink wasn't doing this, add new interface to pass THIS_MODULE.
      Moreover, when converting parts of the rtnetlink handling to rcu this code
      gained way too many READ_ONCE spots, remove them and the extra refcounting.
      
      Take a module reference when running dumpit and doit callbacks
      and never alter content of rtnl_link structures after they have been
      published via rcu_assign_pointer.
      
      Based partially on earlier patch from Peter.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f4d4c49b
    • F
      rtnetlink: remove __rtnl_register · 16feebcf
      Florian Westphal 提交于
      This removes __rtnl_register and switches callers to either
      rtnl_register or rtnl_register_module.
      
      Also, rtnl_register() will now print an error if memory allocation
      failed rather than panic the kernel.
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      16feebcf
    • F
      net: use rtnl_register_module where needed · c1c502b5
      Florian Westphal 提交于
      all of these can be compiled as a module, so use new
      _module version to make sure module can no longer be removed
      while callback/dump is in use.
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c1c502b5
    • F
      rtnetlink: get reference on module before invoking handlers · e4202511
      Florian Westphal 提交于
      Add yet another rtnl_register function.  It will be used by modules
      that can be removed.
      
      The passed module struct is used to prevent module unload while
      a netlink dump is in progress or when a DOIT_UNLOCKED doit callback
      is called.
      
      Cc: Peter Zijlstra <peterz@infradead.org>
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e4202511
    • F
      net: rtnetlink: use rcu to free rtnl message handlers · addf9b90
      Florian Westphal 提交于
      rtnetlink is littered with READ_ONCE() because we can have read accesses
      while another cpu can write to the structure we're reading by
      (un)registering doit or dumpit handlers.
      
      This patch changes this so that (un)registering cpu allocates a new
      structure and then publishes it via rcu_assign_pointer, i.e. once
      another cpu can see such pointer no modifications will occur anymore.
      
      based on initial patch from Peter Zijlstra.
      
      Cc: Peter Zijlstra <peterz@infradead.org>
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      addf9b90
    • H
      net: phy: broadcom: re-add mistakenly removed config settings · 9753c21f
      Heiner Kallweit 提交于
      Previous patch mistakenly removed three chip-specific config settings.
      Add them again.
      
      Fixes: 80274aba "net: phy: remove generic settings for callbacks config_aneg and read_status from drivers"
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9753c21f
    • D
      Merge branch 'ipv6-gre-collect_md' · 90ffa72f
      David S. Miller 提交于
      William Tu says:
      
      ====================
      add ip6 gre and gretap collect_md mode
      
      Similar to gre, vxlan, geneve, ipip tunnels, allow ip6gretap tunnels to
      operate in collect metadata mode.  The first patch adds the support to
      ip6_gre.c. The second patch enables unsetting the csum for ipv6 tunnel,
      when using bpf_skb_[gs]et_tunnel_key() helpers.  Finally, the last patch
      adds the ip6 gre and gretap tunnel test cases to BPF sample code.
      
      The corresponding iproute2 patch:
      https://marc.info/?l=linux-netdev&m=151216943128087&w=2
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      90ffa72f
    • W
      samples/bpf: extend test_tunnel_bpf.sh with ip6gre · 56ddd302
      William Tu 提交于
      Extend existing tests for vxlan, gre, geneve, ipip, erspan,
      to include ip6 gre and gretap tunnel.
      Signed-off-by: NWilliam Tu <u9012063@gmail.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      56ddd302
    • W
      bpf: allow disabling tunnel csum for ipv6 · b8da518c
      William Tu 提交于
      Before the patch, BPF_F_ZERO_CSUM_TX can be used only for ipv4 tunnel.
      With introduction of ip6gretap collect_md mode, the flag should be also
      supported for ipv6.
      Signed-off-by: NWilliam Tu <u9012063@gmail.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Acked-by: NDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b8da518c
    • W
      ip6_gre: add ip6 gre and gretap collect_md mode · 6712abc1
      William Tu 提交于
      Similar to gre, vxlan, geneve, ipip tunnels, allow ip6 gre and gretap
      tunnels to operate in collect metadata mode.  bpf_skb_[gs]et_tunnel_key()
      helpers can make use of it right away.  OVS can use it as well in the
      future.
      Signed-off-by: NWilliam Tu <u9012063@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6712abc1
  3. 04 12月, 2017 2 次提交
  4. 03 12月, 2017 22 次提交