1. 22 May, 2018 10 commits
    • Eric Dumazet's avatar
      tcp: add max_quickacks param to tcp_incr_quickack and tcp_enter_quickack_mode · 9a9c9b51
      Eric Dumazet authored
      We want to add finer control of the number of ACK packets sent after
      ECN events.
      
      This patch is not changing current behavior, it only enables following
      change.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Acked-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
      Acked-by: default avatarNeal Cardwell <ncardwell@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9a9c9b51
    • Vlad Buslov's avatar
      net: sched: don't disable bh when accessing action idr · 290aa0ad
      Vlad Buslov authored
      Initial net_device implementation used ingress_lock spinlock to synchronize
      ingress path of device. This lock was used in both process and bh context.
      In some code paths action map lock was obtained while holding ingress_lock.
      Commit e1e992e5 ("[NET_SCHED] protect action config/dump from irqs")
      modified actions to always disable bh, while using action map lock, in
      order to prevent deadlock on ingress_lock in softirq. This lock was removed
      from net_device, so disabling bh, while accessing action map, is no longer
      necessary.
      
      Replace all action idr spinlock usage with regular calls that do not
      disable bh.
      Signed-off-by: default avatarVlad Buslov <vladbu@mellanox.com>
      Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      290aa0ad
    • David S. Miller's avatar
      Merge branch 'net-ipv6-Fix-route-append-and-replace-use-cases' · 73bf1fc5
      David S. Miller authored
      David Ahern says:
      
      ====================
      net/ipv6: Fix route append and replace use cases
      
      This patch set fixes a few append and replace uses cases for IPv6 and
      adds test cases that codifies the expectations of how append and replace
      are expected to work. In paricular it allows a multipath route to have
      a dev-only nexthop, something Thomas tried to accomplish with commit
      edd7ceb7 ("ipv6: Allow non-gateway ECMP for IPv6") which had to be
      reverted because of breakage, and to replace an existing FIB entry
      with a reject route.
      
      There are a number of inconsistent and surprising aspects to the Linux
      API for adding, deleting, replacing and changing FIB entries. For example,
      with IPv4 NLM_F_APPEND means insert the route after any existing entries
      with the same key (prefix + priority + TOS for IPv4) and NLM_F_CREATE
      without the append flag inserts the new route before any existing entries.
      
      IPv6 on the other hand attempts to guess whether a new route should be
      appended to an existing one, possibly creating a multipath route, or to
      add a new entry after any existing ones. This applies to both the 'append'
      (NLM_F_CREATE + NLM_F_APPEND) and 'prepend' (NLM_F_CREATE only) cases
      meaning for IPv6 the NLM_F_APPEND is basically ignored. This guessing
      whether the route should be added to a multipath route (gateway routes)
      or inserted after existing entries (non-gateway based routes) means a
      multipath route can not have a dev only nexthop (potentially required in
      some cases - tunnels or VRF route leaking for example) and route 'replace'
      is a bit adhoc treating gateway based routes and dev-only / reject routes
      differently.
      
      This has led to frustration with developers working on routing suites
      such as FRR where workarounds such as delete and add are used instead of
      replace.
      
      After this patch set there are 2 differences between IPv4 and IPv6:
      1. 'ip ro prepend' = NLM_F_CREATE only
          IPv4 adds the new route before any existing ones
          IPv6 adds new route after any existing ones
      
      2. 'ip ro append' = NLM_F_CREATE|NLM_F_APPEND
         IPv4 adds the new route after any existing ones
         IPv6 adds the nexthop to existing routes converting to multipath
      
      For the former, there are cases where we want same prefix routes added
      after existing ones (e.g., multicast, prefix routes for macvlan when used
      for virtual router redundancy). Requiring the APPEND flag to add a new
      route to an existing one helps here but is a slight change in behavior
      since prepend with gateway routes now create a separate entry.
      
      For the latter IPv6 behavior is preferred - appending a route for the same
      prefix and metric to make a multipath route, so really IPv4 not allowing an
      existing route to be updated is the limiter. This will be fixed when
      nexthops become separate objects - a future patch set.
      
      Thank you to Thomas and Ido for testing earlier versions of this set, and
      to Ido for providing an update to the mlxsw driver.
      
      Changes since RFC
      - cleanup wording in test script; add comments about expected failures
        and why
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      73bf1fc5
    • David Ahern's avatar
      selftests: fib_tests: Add ipv4 route add append replace tests · abb1860a
      David Ahern authored
      Add IPv4 route tests covering add, append and replace permutations.
      Assumes the ability to add a basic single path route works; this is
      required for example when adding an address to an interface.
      
      $ fib_tests.sh -t ipv4_rt
      
      IPv4 route add / append tests
          TEST: Attempt to add duplicate route - gw                           [ OK ]
          TEST: Attempt to add duplicate route - dev only                     [ OK ]
          TEST: Attempt to add duplicate route - reject route                 [ OK ]
          TEST: Add new nexthop for existing prefix                           [ OK ]
          TEST: Append nexthop to existing route - gw                         [ OK ]
          TEST: Append nexthop to existing route - dev only                   [ OK ]
          TEST: Append nexthop to existing route - reject route               [ OK ]
          TEST: Append nexthop to existing reject route - gw                  [ OK ]
          TEST: Append nexthop to existing reject route - dev only            [ OK ]
          TEST: add multipath route                                           [ OK ]
          TEST: Attempt to add duplicate multipath route                      [ OK ]
          TEST: Route add with different metrics                              [ OK ]
          TEST: Route delete with metric                                      [ OK ]
      
      IPv4 route replace tests
          TEST: Single path with single path                                  [ OK ]
          TEST: Single path with multipath                                    [ OK ]
          TEST: Single path with reject route                                 [ OK ]
          TEST: Single path with single path via multipath attribute          [ OK ]
          TEST: Invalid nexthop                                               [ OK ]
          TEST: Single path - replace of non-existent route                   [ OK ]
          TEST: Multipath with multipath                                      [ OK ]
          TEST: Multipath with single path                                    [ OK ]
          TEST: Multipath with single path via multipath attribute            [ OK ]
          TEST: Multipath with reject route                                   [ OK ]
          TEST: Multipath - invalid first nexthop                             [ OK ]
          TEST: Multipath - invalid second nexthop                            [ OK ]
          TEST: Multipath - replace of non-existent route                     [ OK ]
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      abb1860a
    • David Ahern's avatar
      selftests: fib_tests: Add ipv6 route add append replace tests · f9a5a9d8
      David Ahern authored
      Add IPv6 route tests covering add, append and replace permutations.
      Assumes the ability to add a basic single path route works; this is
      required for example when adding an address to an interface.
      
      $ fib_tests.sh -t ipv6_rt
      
      IPv6 route add / append tests
          TEST: Attempt to add duplicate route - gw                           [ OK ]
          TEST: Attempt to add duplicate route - dev only                     [ OK ]
          TEST: Attempt to add duplicate route - reject route                 [ OK ]
          TEST: Add new route for existing prefix (w/o NLM_F_EXCL)            [ OK ]
          TEST: Append nexthop to existing route - gw                         [ OK ]
          TEST: Append nexthop to existing route - dev only                   [ OK ]
          TEST: Append nexthop to existing route - reject route               [ OK ]
          TEST: Append nexthop to existing reject route - gw                  [ OK ]
          TEST: Append nexthop to existing reject route - dev only            [ OK ]
          TEST: Add multipath route                                           [ OK ]
          TEST: Attempt to add duplicate multipath route                      [ OK ]
          TEST: Route add with different metrics                              [ OK ]
          TEST: Route delete with metric                                      [ OK ]
      
      IPv6 route replace tests
          TEST: Single path with single path                                  [ OK ]
          TEST: Single path with multipath                                    [ OK ]
          TEST: Single path with reject route                                 [ OK ]
          TEST: Single path with single path via multipath attribute          [ OK ]
          TEST: Invalid nexthop                                               [ OK ]
          TEST: Single path - replace of non-existent route                   [ OK ]
          TEST: Multipath with multipath                                      [ OK ]
          TEST: Multipath with single path                                    [ OK ]
          TEST: Multipath with single path via multipath attribute            [ OK ]
          TEST: Multipath with reject route                                   [ OK ]
          TEST: Multipath - invalid first nexthop                             [ OK ]
          TEST: Multipath - invalid second nexthop                            [ OK ]
          TEST: Multipath - replace of non-existent route                     [ OK ]
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f9a5a9d8
    • David Ahern's avatar
      selftests: fib_tests: Add option to pause after each test · 7df15e6c
      David Ahern authored
      Add option to pause after each test before cleanup is done. Allows
      user to do manual inspection or more ad-hoc testing after each test
      with the setup in tact.
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7df15e6c
    • David Ahern's avatar
      selftests: fib_tests: Add command line options · 1c7447b4
      David Ahern authored
      Add command line options for controlling pause on fail, controlling
      specific tests to run and verbose mode rather than relying on environment
      variables.
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1c7447b4
    • David Ahern's avatar
      selftests: fib_tests: Add success-fail counts · 37ce42c1
      David Ahern authored
      As more tests are added, it is convenient to have a tally at the end.
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      37ce42c1
    • David Ahern's avatar
      net/ipv6: Simplify route replace and appending into multipath route · f34436a4
      David Ahern authored
      Bring consistency to ipv6 route replace and append semantics.
      
      Remove rt6_qualify_for_ecmp which is just guess work. It fails in 2 cases:
      1. can not replace a route with a reject route. Existing code appends
         a new route instead of replacing the existing one.
      
      2. can not have a multipath route where a leg uses a dev only nexthop
      
      Existing use cases affected by this change:
      1. adding a route with existing prefix and metric using NLM_F_CREATE
         without NLM_F_APPEND or NLM_F_EXCL (ie., what iproute2 calls
         'prepend'). Existing code auto-determines that the new nexthop can
         be appended to an existing route to create a multipath route. This
         change breaks that by requiring the APPEND flag for the new route
         to be added to an existing one. Instead the prepend just adds another
         route entry.
      
      2. route replace. Existing code replaces first matching multipath route
         if new route is multipath capable and fallback to first matching
         non-ECMP route (reject or dev only route) in case one isn't available.
         New behavior replaces first matching route. (Thanks to Ido for spotting
         this one)
      
      Note: Newer iproute2 is needed to display multipath routes with a dev-only
            nexthop. This is due to a bug in iproute2 and parsing nexthops.
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f34436a4
    • David Ahern's avatar
      mlxsw: spectrum_router: Add support for route append · 5a15a1b0
      David Ahern authored
      Handle append for gateway based routes. Dev-only multipath routes will
      be handled by a follow on patch.
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5a15a1b0
  2. 21 May, 2018 13 commits
    • David S. Miller's avatar
      Merge branch 'TI-Ethernet-driver-warnings-fixes' · e3bb946c
      David S. Miller authored
      Florian Fainelli says:
      
      ====================
      TI Ethernet driver warnings fixes
      
      This patch series attempts to fix properly the warnings observed with turning
      on COMPILE_TEST and TI Ethernet drivers on 64-bit hosts.
      
      Since I don't have any of this hardware, please review carefully for possible
      breakage!
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e3bb946c
    • Florian Fainelli's avatar
      ti: ethernet: davinci: Fix cast to int warnings · c79c3850
      Florian Fainelli authored
      Now that we can compile test this driver on 64-bit hosts, we get some
      warnings about how a pointer/address is written/read to/from a register
      (sw_token). Fix this by doing the appropriate conversions, we cannot
      possibly have the driver work on 64-bit hosts the way the tokens are
      managed though, since the registers being written to a 32-bit only.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c79c3850
    • Florian Fainelli's avatar
      net: ethernet: davinci_emac: Fix printing of base address · 5a04e8f8
      Florian Fainelli authored
      Use %pa which is the correct formatter to print a physical address,
      instead of %p which is just a pointer.
      
      Fixes: a6286ee6 ("net: Add TI DaVinci EMAC driver")
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5a04e8f8
    • Florian Fainelli's avatar
      net: ethernet: ti: cpsw: Fix cpsw_add_ch_strings() printk format · bf2ce3fd
      Florian Fainelli authored
      When building on a 64-bit host we will get the following warning:
      
      drivers/net/ethernet/ti/cpsw.c: In function 'cpsw_add_ch_strings':
      drivers/net/ethernet/ti/cpsw.c:1284:19: warning: format '%d' expects
      argument of type 'int', but argument 5 has type 'long unsigned int'
      [-Wformat=]
           "%s DMA chan %d: %s", rx_dir ? "Rx" : "Tx",
                        ~^
                        %ld
      
      Fix this by using an %ld format and casting to long.
      
      Fixes: e05107e6 ("net: ethernet: ti: cpsw: add multi queue support")
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bf2ce3fd
    • Florian Fainelli's avatar
      net: ethernet: ti: cpts: Fix timestamp print · ea5ec9fc
      Florian Fainelli authored
      On 64-bit hosts we will get the following warning:
      
      drivers/net/ethernet/ti/cpts.c: In function 'cpts_overflow_check':
      drivers/net/ethernet/ti/cpts.c:297:11: warning: format '%lld' expects
      argument of type 'long long int', but argument 3 has type
      '__kernel_time_t {aka long int}' [-Wformat=]
        pr_debug("cpts overflow check at %lld.%09lu\n", ts.tv_sec,
      ts.tv_nsec);
      
      Fix this by using an appropriate casting that works on all bit sizes.
      
      Fixes: a5c79c26 ("ptp: cpts: convert to the 64 bit get/set time methods.")
      Fixes: 87c0e764 ("cpts: introduce time stamping code and a PTP hardware clock.")
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ea5ec9fc
    • Florian Fainelli's avatar
      ti: ethernet: cpdma: Use correct format for genpool_* · b4eb7393
      Florian Fainelli authored
      Now that we can compile davinci_cpdma.c on 64-bit hosts, we can see that
      the format used for printing a size_t type is incorrect, use %zd
      accordingly.
      
      Fixes: aeec3021 ("net: ethernet: ti: cpdma: remove used_desc counter")
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b4eb7393
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 6f6e434a
      David S. Miller authored
      S390 bpf_jit.S is removed in net-next and had changes in 'net',
      since that code isn't used any more take the removal.
      
      TLS data structures split the TX and RX components in 'net-next',
      put the new struct members from the bug fix in 'net' into the RX
      part.
      
      The 'net-next' tree had some reworking of how the ERSPAN code works in
      the GRE tunneling code, overlapping with a one-line headroom
      calculation fix in 'net'.
      
      Overlapping changes in __sock_map_ctx_update_elem(), keep the bits
      that read the prog members via READ_ONCE() into local variables
      before using them.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6f6e434a
    • Rahul Lakkireddy's avatar
      vmcore: move get_vmcore_size out of __init · 44c752fe
      Rahul Lakkireddy authored
      Fix below build warning:
      
      WARNING: vmlinux.o(.text+0x422bb8): Section mismatch in reference from
      the function vmcore_add_device_dump() to the function
      .init.text:get_vmcore_size.constprop.5()
      
      The function vmcore_add_device_dump() references
      the function __init get_vmcore_size.constprop.5().
      This is often because vmcore_add_device_dump lacks a __init
      annotation or the annotation of get_vmcore_size.constprop.5 is wrong.
      
      Fixes: 7efe48df ("vmcore: append device dumps to vmcore as elf notes")
      Signed-off-by: default avatarRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
      Signed-off-by: default avatarGanesh Goudar <ganeshgr@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      44c752fe
    • Ganesh Goudar's avatar
      cxgb4: copy the length of cpl_tx_pkt_core to fw_wr · a6076fcd
      Ganesh Goudar authored
      immdlen field of FW_ETH_TX_PKT_WR is filled in a wrong way,
      we must copy the length of all the cpls encapsulated in fw
      work request. In the xmit path we missed adding the length
      of CPL_TX_PKT_CORE but we added the length of WR_HDR and it
      worked because WR_HDR and CPL_TX_PKT_CORE are of same length.
      Add the length of cpl_tx_pkt_core not WR_HDR's. This also
      fixes the lso cpl errors for udp tunnels
      
      Fixes: d0a1299c ("cxgb4: add support for vxlan segmentation offload")
      Signed-off-by: default avatarGanesh Goudar <ganeshgr@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a6076fcd
    • Florian Fainelli's avatar
      net: ethernet: Sort Kconfig sourcing alphabetically · 6c541b45
      Florian Fainelli authored
      A number of entries were not alphabetically sorted, remedy that.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6c541b45
    • Florian Fainelli's avatar
      net: phy: phylink: Don't release NULL GPIO · 3bcd4772
      Florian Fainelli authored
      If CONFIG_GPIOLIB is disabled, gpiod_put() becomes a stub that produces a
      warning, this helped identify that we could be attempting to release a NULL
      pl->link_gpio GPIO descriptor, so guard against that.
      
      Fixes: daab3349 ("net: phy: phylink: Release link GPIO")
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3bcd4772
    • Linus Torvalds's avatar
      Merge tag 'mips_fixes_4.17_2' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/mips · 6741c4bb
      Linus Torvalds authored
      Pull MIPS fixes from James Hogan:
      
       - fix build with DEBUG_ZBOOT and MACH_JZ4770 (4.16)
      
       - include xilfpga FDT in fitImage and stop generating dtb.o (4.15)
      
       - fix software IO coherence on CM SMP systems (4.8)
      
       - ptrace: Fix PEEKUSR/POKEUSR to o32 FGRs (3.14)
      
       - ptrace: Expose FIR register through FP regset (3.13)
      
       - fix typo in KVM debugfs file name (3.10)
      
      * tag 'mips_fixes_4.17_2' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/mips:
        MIPS: Fix ptrace(2) PTRACE_PEEKUSR and PTRACE_POKEUSR accesses to o32 FGRs
        MIPS: xilfpga: Actually include FDT in fitImage
        MIPS: xilfpga: Stop generating useless dtb.o
        KVM: Fix spelling mistake: "cop_unsuable" -> "cop_unusable"
        MIPS: ptrace: Expose FIR register through FP regset
        MIPS: Fix build with DEBUG_ZBOOT and MACH_JZ4770
        MIPS: c-r4k: Fix data corruption related to cache coherence
      6741c4bb
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 5aef268a
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Fix refcounting bug for connections in on-packet scheduling mode of
          IPVS, from Julian Anastasov.
      
       2) Set network header properly in AF_PACKET's packet_snd, from Willem
          de Bruijn.
      
       3) Fix regressions in 3c59x by converting to generic DMA API. It was
          relying upon the hack that the PCI DMA interfaces would accept NULL
          for EISA devices. From Christoph Hellwig.
      
       4) Remove RDMA devices before unregistering netdev in QEDE driver, from
          Michal Kalderon.
      
       5) Use after free in TUN driver ptr_ring usage, from Jason Wang.
      
       6) Properly check for missing netlink attributes in SMC_PNETID
          requests, from Eric Biggers.
      
       7) Set DMA mask before performaing any DMA operations in vmxnet3
          driver, from Regis Duchesne.
      
       8) Fix mlx5 build with SMP=n, from Saeed Mahameed.
      
       9) Classifier fixes in bcm_sf2 driver from Florian Fainelli.
      
      10) Tuntap use after free during release, from Jason Wang.
      
      11) Don't use stack memory in scatterlists in tls code, from Matt
          Mullins.
      
      12) Not fully initialized flow key object in ipv4 routing code, from
          David Ahern.
      
      13) Various packet headroom bug fixes in ip6_gre driver, from Petr
          Machata.
      
      14) Remove queues from XPS maps using correct index, from Amritha
          Nambiar.
      
      15) Fix use after free in sock_diag, from Eric Dumazet.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (64 commits)
        net: ip6_gre: fix tunnel metadata device sharing.
        cxgb4: fix offset in collecting TX rate limit info
        net: sched: red: avoid hashing NULL child
        sock_diag: fix use-after-free read in __sk_free
        sh_eth: Change platform check to CONFIG_ARCH_RENESAS
        net: dsa: Do not register devlink for unused ports
        net: Fix a bug in removing queues from XPS map
        bpf: fix truncated jump targets on heavy expansions
        bpf: parse and verdict prog attach may race with bpf map update
        bpf: sockmap update rollback on error can incorrectly dec prog refcnt
        net: test tailroom before appending to linear skb
        net: ip6_gre: Fix ip6erspan hlen calculation
        net: ip6_gre: Split up ip6gre_changelink()
        net: ip6_gre: Split up ip6gre_newlink()
        net: ip6_gre: Split up ip6gre_tnl_change()
        net: ip6_gre: Split up ip6gre_tnl_link_config()
        net: ip6_gre: Fix headroom request in ip6erspan_tunnel_xmit()
        net: ip6_gre: Request headroom in __gre6_xmit()
        selftests/bpf: check return value of fopen in test_verifier.c
        erspan: fix invalid erspan version.
        ...
      5aef268a
  3. 20 May, 2018 17 commits