1. 25 Feb, 2019 16 commits
  2. 24 Feb, 2019 24 commits
    • David S. Miller's avatar
      Merge branch 'net-protodown-support-for-macvlan-and-vxlan' · fad4271b
      David S. Miller authored
      Andy Roulin says:
      
      ====================
      net: protodown support for macvlan and vxlan
      
      This patch series adds dev_change_proto_down_generic, a generic
      implementation of ndo_change_proto_down, which sets the netdev carrier
      state according to the new proto_down value.
      
      This handler adds the ability to set protodown on macvlan and vxlan
      interfaces in a generic way for use by control protocols like VRRPD.
      
      Patch (1) introduces the handler in net/code/dev.c. Patch (2) and (3) add
      support for change_proto_down in macvlan and vxlan drivers, respectively,
      using the new function.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fad4271b
    • Andy Roulin's avatar
      vxlan: add ndo_change_proto_down support · 8f1af75d
      Andy Roulin authored
      Add ndo_change_proto_down support through dev_change_proto_down_generic
      for use by control protocols like VRRPD.
      Signed-off-by: default avatarAndy Roulin <aroulin@cumulusnetworks.com>
      Acked-by: default avatarRoopa Prabhu <roopa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8f1af75d
    • Andy Roulin's avatar
      macvlan: add ndo_change_proto_down support · 2e8b4ba6
      Andy Roulin authored
      Add ndo_change_proto_down support through dev_change_proto_down_generic
      for use by control protocols like VRRPD.
      Signed-off-by: default avatarAndy Roulin <aroulin@cumulusnetworks.com>
      Acked-by: default avatarRoopa Prabhu <roopa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2e8b4ba6
    • Andy Roulin's avatar
      net: dev: add generic protodown handler · b5899679
      Andy Roulin authored
      Introduce dev_change_proto_down_generic, a generic ndo_change_proto_down
      implementation, which sets the netdev carrier state according to proto_down.
      
      This adds the ability to set protodown on vxlan and macvlan devices in a
      generic way for use by control protocols like VRRPD.
      Signed-off-by: default avatarAndy Roulin <aroulin@cumulusnetworks.com>
      Acked-by: default avatarRoopa Prabhu <roopa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b5899679
    • David S. Miller's avatar
      Merge branch 'Add-tests-for-unlocked-flower-classifier-implementation' · 45c0e7b2
      David S. Miller authored
      Vlad Buslov says:
      
      ====================
      Add tests for unlocked flower classifier implementation
      
      Implement tests for tdc testsuite to verify concurrent rules update with
      rtnl-unlocked flower classifier implementation. The goal of these tests
      is to verify general flower classifier correctness by updating filters
      on same classifier instance in parallel and to verify its atomicity by
      concurrently updating filters in same handle range. All three filter
      update operations (add, replace, delete) are tested.
      
      Existing script tdc_batch.py is re-used for batch file generation. It is
      extended with several optional CLI arguments that are needed for
      concurrency tests. Thin wrapper tdc_multibatch.py is implemented on top
      of tdc_batch.py to simplify its usage when generating multiple batch
      files for several test configurations.
      
      Parallelism in tests is implemented by running multiple instances of tc
      in batch mode with xargs tool. Xargs is chosen for its ease of use and
      because it is available by default on most modern Linux distributions.
      ====================
      Acked-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      45c0e7b2
    • Vlad Buslov's avatar
      selftests: concurrency: add test to verify parallel replace/delete · 5ce46451
      Vlad Buslov authored
      Implement test that runs 5 instances of tc replace filter in parallel with
      5 instances of tc del filter from same tp instance. Each instance uses its
      own filter handle and key range.
      Signed-off-by: default avatarVlad Buslov <vladbu@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5ce46451
    • Vlad Buslov's avatar
      selftests: concurrency: add test to verify parallel add/delete · be6b294d
      Vlad Buslov authored
      Implement test that runs 5 instances of tc add filter in parallel with 5
      instances of tc del filter from same tp instance. Each instance uses its
      own filter handle and key range.
      
      Extend tdc_multibatch.py with additional options required to implement the
      test: common prefix for all generated batch files, first value of filter
      handle range, MAC address prefix modifier. These are necessary to allow
      creating batch files with unique keys and handle ranges with multiple
      invocation of tdc_multibatch.py helper script.
      Signed-off-by: default avatarVlad Buslov <vladbu@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      be6b294d
    • Vlad Buslov's avatar
      selftests: concurrency: add test to verify concurrent delete · a788b302
      Vlad Buslov authored
      Implement test that verifies concurrent deletion of rules by executing 10
      tc instances that delete flower filters in same handle range. In this case
      only one tc instance succeeds in deleting a filter with particular handle.
      To mitigate expected failures of all other instances, run tc with 'force'
      option to continue processing batch file in case of errors and expect xargs
      to return code '123' that indicates that invocation of command(s) exited
      with error in range 1-125.
      Signed-off-by: default avatarVlad Buslov <vladbu@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a788b302
    • Vlad Buslov's avatar
      selftests: concurrency: add test to verify concurrent replace · 424c5bd4
      Vlad Buslov authored
      Implement test that verifies concurrent replacement of rules by executing
      10 tc instances that replace flower filters in same handle range.
      
      Extend tdc_multibatch.py script with new optional CLI argument that is used
      to generate all batch files with same filter handle range.
      Signed-off-by: default avatarVlad Buslov <vladbu@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      424c5bd4
    • Vlad Buslov's avatar
      selftests: concurrency: add test to verify parallel rules replace · 4ba21de2
      Vlad Buslov authored
      Implement test that verifies parallel rules replacement by adding 1 million
      flower filters and then replacing them with 10 concurrent tc instances.
      Signed-off-by: default avatarVlad Buslov <vladbu@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4ba21de2
    • Vlad Buslov's avatar
      selftests: concurrency: add test to verify parallel rules deletion · 596952fc
      Vlad Buslov authored
      Implement test that verifies parallel rules deletion by adding 1 million
      flower filters and then deleting them with 10 concurrent tc instances.
      Signed-off-by: default avatarVlad Buslov <vladbu@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      596952fc
    • Vlad Buslov's avatar
      selftests: concurrency: add test to verify parallel rules insertion · 450ef620
      Vlad Buslov authored
      Implement test that verifies parallel rules insertion by adding 1 million
      flower filters with 10 concurrent tc instances. Put it to standalone
      'concurrency' category.
      
      Implement tdc_multibatch.py helper script that is used to generate multiple
      batch files for concurrent tc execution. Extend config with new 'BATCH_DIR'
      variable to specify temporary output directory that is used to store batch
      files generated by tdc_multibatch.py.
      Signed-off-by: default avatarVlad Buslov <vladbu@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      450ef620
    • Vlad Buslov's avatar
      selftests: tdc_batch.py: add options needed for concurrency tests · 3b07270d
      Vlad Buslov authored
      Extend tdc_batch.py with several optional CLI arguments that are used for
      implementation of concurrency tests in following patches in this set:
      
      - Add optional argument to specify range of filter handles used in batch
        file [fitler_handle, filter_handle+number). This is needed for testing
        filter deletion where it is necessary to know exact handles of configured
        filters.
      
      - Add optional argument to specify filter operation type (possible values
        are ['add', 'del', 'replace']) instead of hardcoded "add" value. This
        allows generation of batches for filter addition, deletion and
        replacement.
      
      - Add optional argument to allow user to change mac address prefix that is
        used for all filters in batch. This is necessary to allow generating
        multiple batches with unique flower classifier keys.
      Signed-off-by: default avatarVlad Buslov <vladbu@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3b07270d
    • Maxim Mikityanskiy's avatar
      net: Skip GSO length estimation if transport header is not set · a0dce875
      Maxim Mikityanskiy authored
      qdisc_pkt_len_init expects transport_header to be set for GSO packets.
      Patch [1] skips transport_header validation for GSO packets that don't
      have network_header set at the moment of calling virtio_net_hdr_to_skb,
      and allows them to pass into the stack. After patch [2] no placeholder
      value is assigned to transport_header if dissection fails, so this patch
      adds a check to the place where the value of transport_header is used.
      
      [1] https://patchwork.ozlabs.org/patch/1044429/
      [2] https://patchwork.ozlabs.org/patch/1046122/Signed-off-by: default avatarMaxim Mikityanskiy <maximmi@mellanox.com>
      Acked-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a0dce875
    • Russell King's avatar
      doc: add phylink documentation to the networking book · 0a6c33e8
      Russell King authored
      Add some phylink documentation to the networking book detailing how
      to convert network drivers from phylib to phylink.
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0a6c33e8
    • Russell King's avatar
      net: phylink: update mac_config() documentation · 0e29ae03
      Russell King authored
      A detail for mac_config() had been missed in the documentation for the
      method - it is expected that the method will update the MAC to the
      settings, rather than completely reprogram the MAC on each call.
      Update the documentation for this method for this detail.
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0e29ae03
    • Li RongQing's avatar
      net: Use RCU_INIT_POINTER() to set sk_wq · c2f26e8f
      Li RongQing authored
      This pointer is RCU protected, so proper primitives should be used.
      Signed-off-by: default avatarZhang Yu <zhangyu31@baidu.com>
      Signed-off-by: default avatarLi RongQing <lirongqing@baidu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c2f26e8f
    • Heiner Kallweit's avatar
      net: phy: let genphy_c45_read_abilities also check aneg capability · b6a4119d
      Heiner Kallweit authored
      When using genphy_c45_read_abilities() as get_features callback we
      also have to set the autoneg capability in phydev->supported.
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Reviewed-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b6a4119d
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 70f35226
      David S. Miller authored
      Three conflicts, one of which, for marvell10g.c is non-trivial and
      requires some follow-up from Heiner or someone else.
      
      The issue is that Heiner converted the marvell10g driver over to
      use the generic c45 code as much as possible.
      
      However, in 'net' a bug fix appeared which makes sure that a new
      local mask (MDIO_AN_10GBT_CTRL_ADV_NBT_MASK) with value 0x01e0
      is cleared.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      70f35226
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · c3619a48
      Linus Torvalds authored
      Pull KVM fixes from Paolo Bonzini:
       "Bug fixes"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
        KVM: MMU: record maximum physical address width in kvm_mmu_extended_role
        kvm: x86: Return LA57 feature based on hardware capability
        x86/kvm/mmu: fix switch between root and guest MMUs
        s390: vsie: Use effective CRYCBD.31 to check CRYCBD validity
      c3619a48
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · c4eb1e18
      Linus Torvalds authored
      Pull networking fixes from David Miller:
       "Hopefully the last pull request for this release. Fingers crossed:
      
         1) Only refcount ESP stats on full sockets, from Martin Willi.
      
         2) Missing barriers in AF_UNIX, from Al Viro.
      
         3) RCU protection fixes in ipv6 route code, from Paolo Abeni.
      
         4) Avoid false positives in untrusted GSO validation, from Willem de
            Bruijn.
      
         5) Forwarded mesh packets in mac80211 need more tailroom allocated,
            from Felix Fietkau.
      
         6) Use operstate consistently for linkup in team driver, from George
            Wilkie.
      
         7) ThunderX bug fixes from Vadim Lomovtsev. Mostly races between VF
            and PF code paths.
      
         8) Purge ipv6 exceptions during netdevice removal, from Paolo Abeni.
      
         9) nfp eBPF code gen fixes from Jiong Wang.
      
        10) bnxt_en firmware timeout fix from Michael Chan.
      
        11) Use after free in udp/udpv6 error handlers, from Paolo Abeni.
      
        12) Fix a race in x25_bind triggerable by syzbot, from Eric Dumazet"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (65 commits)
        net: phy: realtek: Dummy IRQ calls for RTL8366RB
        tcp: repaired skbs must init their tso_segs
        net/x25: fix a race in x25_bind()
        net: dsa: Remove documentation for port_fdb_prepare
        Revert "bridge: do not add port to router list when receives query with source 0.0.0.0"
        selftests: fib_tests: sleep after changing carrier. again.
        net: set static variable an initial value in atl2_probe()
        net: phy: marvell10g: Fix Multi-G advertisement to only advertise 10G
        bpf, doc: add bpf list as secondary entry to maintainers file
        udp: fix possible user after free in error handler
        udpv6: fix possible user after free in error handler
        fou6: fix proto error handler argument type
        udpv6: add the required annotation to mib type
        mdio_bus: Fix use-after-free on device_register fails
        net: Set rtm_table to RT_TABLE_COMPAT for ipv6 for tables > 255
        bnxt_en: Wait longer for the firmware message response to complete.
        bnxt_en: Fix typo in firmware message timeout logic.
        nfp: bpf: fix ALU32 high bits clearance bug
        nfp: bpf: fix code-gen bug on BPF_ALU | BPF_XOR | BPF_K
        Documentation: networking: switchdev: Update port parent ID section
        ...
      c4eb1e18
    • Roopa Prabhu's avatar
      trace: events: neigh_update: print new state in string format · a75d1d01
      Roopa Prabhu authored
      Also, extend neigh_state_str to include neigh dummy states
      noarp and permanent
      
      Fixes: 9c03b282 ("trace: events: add a few neigh tracepoints")
      Signed-off-by: default avatarRoopa Prabhu <roopa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a75d1d01
    • Linus Walleij's avatar
      net: phy: realtek: Dummy IRQ calls for RTL8366RB · 4c8e0459
      Linus Walleij authored
      This fixes a regression introduced by
      commit 0d2e778e
      "net: phy: replace PHY_HAS_INTERRUPT with a check for
      config_intr and ack_interrupt".
      
      This assumes that a PHY cannot trigger interrupt unless
      it has .config_intr() or .ack_interrupt() implemented.
      A later patch makes the code assume both need to be
      implemented for interrupts to be present.
      
      But this PHY (which is inside a DSA) will happily
      fire interrupts without either callback.
      
      Implement dummy callbacks for .config_intr() and
      .ack_interrupt() in the phy header to fix this.
      
      Tested on the RTL8366RB on D-Link DIR-685.
      
      Fixes: 0d2e778e ("net: phy: replace PHY_HAS_INTERRUPT with a check for config_intr and ack_interrupt")
      Cc: Heiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4c8e0459
    • Eric Dumazet's avatar
      tcp: repaired skbs must init their tso_segs · bf50b606
      Eric Dumazet authored
      syzbot reported a WARN_ON(!tcp_skb_pcount(skb))
      in tcp_send_loss_probe() [1]
      
      This was caused by TCP_REPAIR sent skbs that inadvertenly
      were missing a call to tcp_init_tso_segs()
      
      [1]
      WARNING: CPU: 1 PID: 0 at net/ipv4/tcp_output.c:2534 tcp_send_loss_probe+0x771/0x8a0 net/ipv4/tcp_output.c:2534
      Kernel panic - not syncing: panic_on_warn set ...
      CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.0.0-rc7+ #77
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      Call Trace:
       <IRQ>
       __dump_stack lib/dump_stack.c:77 [inline]
       dump_stack+0x172/0x1f0 lib/dump_stack.c:113
       panic+0x2cb/0x65c kernel/panic.c:214
       __warn.cold+0x20/0x45 kernel/panic.c:571
       report_bug+0x263/0x2b0 lib/bug.c:186
       fixup_bug arch/x86/kernel/traps.c:178 [inline]
       fixup_bug arch/x86/kernel/traps.c:173 [inline]
       do_error_trap+0x11b/0x200 arch/x86/kernel/traps.c:271
       do_invalid_op+0x37/0x50 arch/x86/kernel/traps.c:290
       invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:973
      RIP: 0010:tcp_send_loss_probe+0x771/0x8a0 net/ipv4/tcp_output.c:2534
      Code: 88 fc ff ff 4c 89 ef e8 ed 75 c8 fb e9 c8 fc ff ff e8 43 76 c8 fb e9 63 fd ff ff e8 d9 75 c8 fb e9 94 f9 ff ff e8 bf 03 91 fb <0f> 0b e9 7d fa ff ff e8 b3 03 91 fb 0f b6 1d 37 43 7a 03 31 ff 89
      RSP: 0018:ffff8880ae907c60 EFLAGS: 00010206
      RAX: ffff8880a989c340 RBX: 0000000000000000 RCX: ffffffff85dedbdb
      RDX: 0000000000000100 RSI: ffffffff85dee0b1 RDI: 0000000000000005
      RBP: ffff8880ae907c90 R08: ffff8880a989c340 R09: ffffed10147d1ae1
      R10: ffffed10147d1ae0 R11: ffff8880a3e8d703 R12: ffff888091b90040
      R13: ffff8880a3e8d540 R14: 0000000000008000 R15: ffff888091b90860
       tcp_write_timer_handler+0x5c0/0x8a0 net/ipv4/tcp_timer.c:583
       tcp_write_timer+0x10e/0x1d0 net/ipv4/tcp_timer.c:607
       call_timer_fn+0x190/0x720 kernel/time/timer.c:1325
       expire_timers kernel/time/timer.c:1362 [inline]
       __run_timers kernel/time/timer.c:1681 [inline]
       __run_timers kernel/time/timer.c:1649 [inline]
       run_timer_softirq+0x652/0x1700 kernel/time/timer.c:1694
       __do_softirq+0x266/0x95a kernel/softirq.c:292
       invoke_softirq kernel/softirq.c:373 [inline]
       irq_exit+0x180/0x1d0 kernel/softirq.c:413
       exiting_irq arch/x86/include/asm/apic.h:536 [inline]
       smp_apic_timer_interrupt+0x14a/0x570 arch/x86/kernel/apic/apic.c:1062
       apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:807
       </IRQ>
      RIP: 0010:native_safe_halt+0x2/0x10 arch/x86/include/asm/irqflags.h:58
      Code: ff ff ff 48 89 c7 48 89 45 d8 e8 59 0c a1 fa 48 8b 45 d8 e9 ce fe ff ff 48 89 df e8 48 0c a1 fa eb 82 90 90 90 90 90 90 fb f4 <c3> 0f 1f 00 66 2e 0f 1f 84 00 00 00 00 00 f4 c3 90 90 90 90 90 90
      RSP: 0018:ffff8880a98afd78 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff13
      RAX: 1ffffffff1125061 RBX: ffff8880a989c340 RCX: 0000000000000000
      RDX: dffffc0000000000 RSI: 0000000000000001 RDI: ffff8880a989cbbc
      RBP: ffff8880a98afda8 R08: ffff8880a989c340 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000001
      R13: ffffffff889282f8 R14: 0000000000000001 R15: 0000000000000000
       arch_cpu_idle+0x10/0x20 arch/x86/kernel/process.c:555
       default_idle_call+0x36/0x90 kernel/sched/idle.c:93
       cpuidle_idle_call kernel/sched/idle.c:153 [inline]
       do_idle+0x386/0x570 kernel/sched/idle.c:262
       cpu_startup_entry+0x1b/0x20 kernel/sched/idle.c:353
       start_secondary+0x404/0x5c0 arch/x86/kernel/smpboot.c:271
       secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:243
      Kernel Offset: disabled
      Rebooting in 86400 seconds..
      
      Fixes: 79861919 ("tcp: fix TCP_REPAIR xmit queue setup")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Cc: Andrey Vagin <avagin@openvz.org>
      Cc: Soheil Hassas Yeganeh <soheil@google.com>
      Cc: Neal Cardwell <ncardwell@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>
      bf50b606