1. 22 11月, 2019 32 次提交
  2. 21 11月, 2019 8 次提交
    • R
      net: sfp: soft status and control support · f3c9a666
      Russell King 提交于
      Add support for the soft status and control register, which allows
      TX_FAULT and RX_LOS to be monitored and TX_DISABLE to be set.  We
      make use of this when the board does not support GPIOs for these
      signals.
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f3c9a666
    • D
      Merge branch 'sfp-quirks' · 9ce33351
      David S. Miller 提交于
      Russell King says:
      
      ====================
      Add rudimentary SFP module quirk support
      
      The SFP module EEPROM describes the capabilities of the module, but
      doesn't describe the host interface.  We have a certain amount of
      guess-work to work out how to configure the host - which works most
      of the time.
      
      However, there are some (such as GPON) modules which are able to
      support different host interfaces, such as 1000BASE-X and 2500BASE-X.
      The module will switch between each mode until it achieves link with
      the host.
      
      There is no defined way to describe this in the SFP EEPROM, so we can
      only recognise the module and handle it appropriately.  This series
      adds the necessary recognition of the modules using a quirk system,
      and tweaks the support mask to allow them to link with the host at
      2500BASE-X, thereby allowing the user to achieve full line rate.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9ce33351
    • R
      net: sfp: add some quirks for GPON modules · b0eae33b
      Russell King 提交于
      Marc Micalizzi reports that Huawei MA5671A and Alcatel/Lucent G-010S-P
      modules are capable of 2500base-X, but incorrectly report their
      capabilities in the EEPROM.  It seems rather common that GPON modules
      mis-report.
      
      Let's fix these modules by adding some quirks.
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b0eae33b
    • R
      net: sfp: add support for module quirks · b34bb2cb
      Russell King 提交于
      Add support for applying module quirks to the list of supported
      ethtool link modes.
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b34bb2cb
    • H
      tcp: warn if offset reach the maxlen limit when using snprintf · 9bb59a21
      Hangbin Liu 提交于
      snprintf returns the number of chars that would be written, not number
      of chars that were actually written. As such, 'offs' may get larger than
      'tbl.maxlen', causing the 'tbl.maxlen - offs' being < 0, and since the
      parameter is size_t, it would overflow.
      
      Since using scnprintf may hide the limit error, while the buffer is still
      enough now, let's just add a WARN_ON_ONCE in case it reach the limit
      in future.
      
      v2: Use WARN_ON_ONCE as Jiri and Eric suggested.
      Suggested-by: NJiri Benc <jbenc@redhat.com>
      Signed-off-by: NHangbin Liu <liuhangbin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9bb59a21
    • W
      ip_gre: Make none-tun-dst gre tunnel store tunnel info as metadat_dst in recv · c0d59da7
      wenxu 提交于
      Currently collect_md gre tunnel will store the tunnel info(metadata_dst)
      to skb_dst.
      And now the non-tun-dst gre tunnel already can add tunnel header through
      lwtunnel.
      
      When received a arp_request on the non-tun-dst gre tunnel. The packet of
      arp response will send through the non-tun-dst tunnel without tunnel info
      which will lead the arp response packet to be dropped.
      
      If the non-tun-dst gre tunnel also store the tunnel info as metadata_dst,
      The arp response packet will set the releted tunnel info in the
      iptunnel_metadata_reply.
      
      The following is the test script:
      
      ip netns add cl
      ip l add dev vethc type veth peer name eth0 netns cl
      
      ifconfig vethc 172.168.0.7/24 up
      ip l add dev tun1000 type gretap key 1000
      
      ip link add user1000 type vrf table 1
      ip l set user1000 up
      ip l set dev tun1000 master user1000
      ifconfig tun1000 10.0.1.1/24 up
      
      ip netns exec cl ifconfig eth0 172.168.0.17/24 up
      ip netns exec cl ip l add dev tun type gretap local 172.168.0.17 remote 172.168.0.7 key 1000
      ip netns exec cl ifconfig tun 10.0.1.7/24 up
      ip r r 10.0.1.7 encap ip id 1000 dst 172.168.0.17 key dev tun1000 table 1
      
      With this patch
      ip netns exec cl ping 10.0.1.1 can success
      Signed-off-by: Nwenxu <wenxu@ucloud.cn>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c0d59da7
    • D
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next · ee5a489f
      David S. Miller 提交于
      Daniel Borkmann says:
      
      ====================
      pull-request: bpf-next 2019-11-20
      
      The following pull-request contains BPF updates for your *net-next* tree.
      
      We've added 81 non-merge commits during the last 17 day(s) which contain
      a total of 120 files changed, 4958 insertions(+), 1081 deletions(-).
      
      There are 3 trivial conflicts, resolve it by always taking the chunk from
      196e8ca7:
      
      <<<<<<< HEAD
      =======
      void *bpf_map_area_mmapable_alloc(u64 size, int numa_node);
      >>>>>>> 196e8ca7
      
      <<<<<<< HEAD
      void *bpf_map_area_alloc(u64 size, int numa_node)
      =======
      static void *__bpf_map_area_alloc(u64 size, int numa_node, bool mmapable)
      >>>>>>> 196e8ca7
      
      <<<<<<< HEAD
              if (size <= (PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER)) {
      =======
              /* kmalloc()'ed memory can't be mmap()'ed */
              if (!mmapable && size <= (PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER)) {
      >>>>>>> 196e8ca7
      
      The main changes are:
      
      1) Addition of BPF trampoline which works as a bridge between kernel functions,
         BPF programs and other BPF programs along with two new use cases: i) fentry/fexit
         BPF programs for tracing with practically zero overhead to call into BPF (as
         opposed to k[ret]probes) and ii) attachment of the former to networking related
         programs to see input/output of networking programs (covering xdpdump use case),
         from Alexei Starovoitov.
      
      2) BPF array map mmap support and use in libbpf for global data maps; also a big
         batch of libbpf improvements, among others, support for reading bitfields in a
         relocatable manner (via libbpf's CO-RE helper API), from Andrii Nakryiko.
      
      3) Extend s390x JIT with usage of relative long jumps and loads in order to lift
         the current 64/512k size limits on JITed BPF programs there, from Ilya Leoshkevich.
      
      4) Add BPF audit support and emit messages upon successful prog load and unload in
         order to have a timeline of events, from Daniel Borkmann and Jiri Olsa.
      
      5) Extension to libbpf and xdpsock sample programs to demo the shared umem mode
         (XDP_SHARED_UMEM) as well as RX-only and TX-only sockets, from Magnus Karlsson.
      
      6) Several follow-up bug fixes for libbpf's auto-pinning code and a new API
         call named bpf_get_link_xdp_info() for retrieving the full set of prog
         IDs attached to XDP, from Toke Høiland-Jørgensen.
      
      7) Add BTF support for array of int, array of struct and multidimensional arrays
         and enable it for skb->cb[] access in kfree_skb test, from Martin KaFai Lau.
      
      8) Fix AF_XDP by using the correct number of channels from ethtool, from Luigi Rizzo.
      
      9) Two fixes for BPF selftest to get rid of a hang in test_tc_tunnel and to avoid
         xdping to be run as standalone, from Jiri Benc.
      
      10) Various BPF selftest fixes when run with latest LLVM trunk, from Yonghong Song.
      
      11) Fix a memory leak in BPF fentry test run data, from Colin Ian King.
      
      12) Various smaller misc cleanups and improvements mostly all over BPF selftests and
          samples, from Daniel T. Lee, Andre Guedes, Anders Roxell, Mao Wenan, Yue Haibing.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ee5a489f
    • D
      bpf: Switch bpf_map_{area_alloc,area_mmapable_alloc}() to u64 size · 196e8ca7
      Daniel Borkmann 提交于
      Given we recently extended the original bpf_map_area_alloc() helper in
      commit fc970227 ("bpf: Add mmap() support for BPF_MAP_TYPE_ARRAY"),
      we need to apply the same logic as in ff1c08e1 ("bpf: Change size
      to u64 for bpf_map_{area_alloc, charge_init}()"). To avoid conflicts,
      extend it for bpf-next.
      Reported-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      196e8ca7