1. 26 Dec, 2017 6 commits
    • Lukas Wunner's avatar
      Bluetooth: Avoid WARN splat due to missing GPIOLIB · 27378f4c
      Lukas Wunner authored
      Loading hci_bcm with CONFIG_GPIOLIB=n results in the following splat
      when calling gpiod_to_irq() from bcm_get_resources():
      
          WARNING: CPU: 0 PID: 1006 at ./include/linux/gpio/consumer.h:450 bcm_get_resources+0x50/0x80
          CPU: 0 PID: 1006 Comm: kworker/u8:4 Tainted: G       A         4.15.0-rc4custom+ #4
          Hardware name: Apple Inc. MacBook8,1/Mac-BE0E8AC46FE800CC, BIOS MB81.88Z.0168.B00.1708080033 08/08/2017
          Call Trace:
          bcm_serdev_probe+0x8b/0xc0
          driver_probe_device+0x202/0x310
          __driver_attach+0x85/0x90
          ? driver_probe_device+0x310/0x310
          bus_for_each_dev+0x57/0x80
          async_run_entry_fn+0x2c/0xd0
          process_one_work+0x1d2/0x3d0
          worker_thread+0x26/0x3c0
          ? process_one_work+0x3d0/0x3d0
          kthread+0x10c/0x130
          ? kthread_create_on_node+0x40/0x40
          ret_from_fork+0x1f/0x30
      
      We could call gpiod_to_irq() only if IS_ENABLED(CONFIG_GPIOLIB) but
      without GPIOLIB, the driver's power saving features can't be used,
      so selecting GPIOLIB seems more appropriate.
      
      The same issue is present in hci_intel.c and hci_nokia.c, fix those up
      as well.
      Reported-by: default avatarMax Shavrick <mxms@me.com>
      Signed-off-by: default avatarLukas Wunner <lukas@wunner.de>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      27378f4c
    • Ioan Moldovan's avatar
      Bluetooth: Add a new 04ca:3015 QCA_ROME device · 0a03f98b
      Ioan Moldovan authored
      This patch adds the 04ca:3015 (from a QCA9377 board) Bluetooth device
      to the btusb blacklist and makes the kernel use the btqca module
      instead of btusb. The patch is necessary because, without it the
      04ca:3015 device defaults to using the btusb driver, which makes the
      WIFI side of the QCA9377 board unusable (obtains 0 MBps in speedtest,
      when the 04ca:3015 bluetooth is used with an audio headset).
      
      /sys/kernel/debug/usb/devices:
      
          T:  Bus=01 Lev=01 Prnt=01 Port=04 Cnt=01 Dev#=  2 Spd=12   MxCh= 0
          D:  Ver= 2.01 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
          P:  Vendor=04ca ProdID=3015 Rev= 0.01
          C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
          I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
          E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
          E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
          E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
          I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
          E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
          E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
          I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
          E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
          E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
          I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
          E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
          E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
          I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
          E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
          E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
          I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
          E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
          E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
          I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
          E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
          E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      Signed-off-by: default avatarIoan Moldovan <ioan.moldovan1999@gmail.com>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      0a03f98b
    • Govindarajulu Varadarajan's avatar
      enic: add wq clean up budget · 18feb871
      Govindarajulu Varadarajan authored
      In case of tx clean up, we set '-1' as budget. This means clean up until
      wq is empty or till (1 << 32) pkts are cleaned. Under heavy load this
      will run for long time and cause
      "watchdog: BUG: soft lockup - CPU#25 stuck for 21s!" warning.
      
      This patch sets wq clean up budget to 256.
      Signed-off-by: default avatarGovindarajulu Varadarajan <gvaradar@cisco.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      18feb871
    • Leon Romanovsky's avatar
      rtnetlink: Replace implementation of ASSERT_RTNL() macro with WARN_ONCE() · 66364bdf
      Leon Romanovsky authored
      ASSERT_RTNL() macro is actual open-coded variant of WARN_ONCE() with
      two exceptions. First, it prints stack for multiple hits and not only
      once as WARN_ONCE() does. Second, the user can disable prints of
      WARN_ONCE by setting CONFIG_BUG to N.
      
      The multiple prints of dump stack are actually not needed, because calls
      without rtnl lock are programming errors and user can't do anything
      about them except to complain to the mailing list after first occurrence
      of such failure.
      
      The user who disabled BUG/WARN prints did it explicitly because by default
      in upstream kernel and distributions this option is enabled. It means
      that user doesn't want to see prints about missing locks too.
      
      This patch replaces open-coded variant in favor of already existing
      macro and change error prints to be once only.
      Reviewed-by: default avatarMark Bloch <markb@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      66364bdf
    • Sean Wang's avatar
      net: mediatek: remove superfluous pin setup for MT7622 SoC · 243dc5fb
      Sean Wang authored
      Remove superfluous pin setup to get out of accessing invalid I/O pin
      registers because the way for pin configuring tends to be different from
      various SoCs and thus it should be better being managed and controlled by
      the pinctrl driver which MT7622 already can support.
      Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      243dc5fb
    • Sean Wang's avatar
      dt-bindings: net: mediatek: add condition to property mediatek, pctl · 0ca30e87
      Sean Wang authored
      The property "mediatek,pctl" is only required for SoCs such as MT2701 and
      MT7623, so adding a few words for stating the condition.
      Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
      Reviewed-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0ca30e87
  2. 22 Dec, 2017 1 commit
  3. 21 Dec, 2017 33 commits
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · ead68f21
      Linus Torvalds authored
      Pull networking fixes from David Miller"
       "What's a holiday weekend without some networking bug fixes? [1]
      
         1) Fix some eBPF JIT bugs wrt. SKB pointers across helper function
            calls, from Daniel Borkmann.
      
         2) Fix regression from errata limiting change to marvell PHY driver,
            from Zhao Qiang.
      
         3) Fix u16 overflow in SCTP, from Xin Long.
      
         4) Fix potential memory leak during bridge newlink, from Nikolay
            Aleksandrov.
      
         5) Fix BPF selftest build on s390, from Hendrik Brueckner.
      
         6) Don't append to cfg80211 automatically generated certs file,
            always write new ones from scratch. From Thierry Reding.
      
         7) Fix sleep in atomic in mac80211 hwsim, from Jia-Ju Bai.
      
         8) Fix hang on tg3 MTU change with certain chips, from Brian King.
      
         9) Add stall detection to arc emac driver and reset chip when this
            happens, from Alexander Kochetkov.
      
        10) Fix MTU limitng in GRE tunnel drivers, from Xin Long.
      
        11) Fix stmmac timestamping bug due to mis-shifting of field. From
            Fredrik Hallenberg.
      
        12) Fix metrics match when deleting an ipv4 route. The kernel sets
            some internal metrics bits which the user isn't going to set when
            it makes the delete request. From Phil Sutter.
      
        13) mvneta driver loop over RX queues limits on "txq_number" :-) Fix
            from Yelena Krivosheev.
      
        14) Fix double free and memory corruption in get_net_ns_by_id, from
            Eric W. Biederman.
      
        15) Flush ipv4 FIB tables in the reverse order. Some tables can share
            their actual backing data, in particular this happens for the MAIN
            and LOCAL tables. We have to kill the LOCAL table first, because
            it uses MAIN's backing memory. Fix from Ido Schimmel.
      
        16) Several eBPF verifier value tracking fixes, from Edward Cree, Jann
            Horn, and Alexei Starovoitov.
      
        17) Make changes to ipv6 autoflowlabel sysctl really propagate to
            sockets, unless the socket has set the per-socket value
            explicitly. From Shaohua Li.
      
        18) Fix leaks and double callback invocations of zerocopy SKBs, from
            Willem de Bruijn"
      
      [1] Is this a trick question? "Relaxing"? "Quiet"? "Fine"? - Linus.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (77 commits)
        skbuff: skb_copy_ubufs must release uarg even without user frags
        skbuff: orphan frags before zerocopy clone
        net: reevalulate autoflowlabel setting after sysctl setting
        openvswitch: Fix pop_vlan action for double tagged frames
        ipv6: Honor specified parameters in fibmatch lookup
        bpf: do not allow root to mangle valid pointers
        selftests/bpf: add tests for recent bugfixes
        bpf: fix integer overflows
        bpf: don't prune branches when a scalar is replaced with a pointer
        bpf: force strict alignment checks for stack pointers
        bpf: fix missing error return in check_stack_boundary()
        bpf: fix 32-bit ALU op verification
        bpf: fix incorrect tracking of register size truncation
        bpf: fix incorrect sign extension in check_alu_op()
        bpf/verifier: fix bounds calculation on BPF_RSH
        ipv4: Fix use-after-free when flushing FIB tables
        s390/qeth: fix error handling in checksum cmd callback
        tipc: remove joining group member from congested list
        selftests: net: Adding config fragment CONFIG_NUMA=y
        nfp: bpf: keep track of the offloaded program
        ...
      ead68f21
    • David S. Miller's avatar
      Merge branch 'flow_dissector-Provide-basic-batman-adv-unicast-handling' · 0a80f0c2
      David S. Miller authored
      Sven Eckelmann says:
      
      ====================
      flow_dissector: Provide basic batman-adv unicast handling
      
      we are currently starting to use batman-adv as mesh protocol on multicore
      embedded devices. These usually don't have a lot of CPU power per core but
      are reasonable fast when using multiple cores.
      
      It was noticed that sending was working very well but receiving was
      basically only using on CPU core per neighbor. The reason for that is
      format of the (normal) incoming packet:
      
        +--------------------+
        | ip(v6)hdr          |
        +--------------------+
        | inner ethhdr       |
        +--------------------+
        | batadv unicast hdr |
        +--------------------+
        | outer ethhdr       |
        +--------------------+
      
      The flow dissector will therefore stop after parsing the outer ethernet
      header and will not parse the actual ipv(4|6)/... header of the packet. Our
      assumption was now that it would help us to add minimal support to the flow
      dissector to jump over the batman-adv unicast and inner ethernet header
      (like in gre ETH_P_TEB). The patch was implemented in a slightly hacky
      way [1] and the results looked quite promising.
      
      I didn't get any feedback how the files should actually be named. So I am
      now just using the names from RFC v3
      
      The discussion of the RFC v3 can be found in the related patches of
      https://patchwork.ozlabs.org/cover/849345/
      
      The discussion of the RFC v2 can be found in the related patches of
      https://patchwork.ozlabs.org/cover/844783/
      
      Changes in v4:
      ==============
      
      * added  patch to change the u8/u16 to __u8/__u16 in
        include/uapi/linux/batadv_packet.h
        - requested by Willem de Bruijn <willemdebruijn.kernel@gmail.com>
      
      Changes in v3:
      ==============
      
      * removed change of uapi/linux/batman_adv.h to uapi/linux/batadv_genl.h
        - requested by Willem de Bruijn <willemdebruijn.kernel@gmail.com>
      * removed naming fixes for enums/defines in uapi/linux/batadv_genl.h
        - requested by Willem de Bruijn <willemdebruijn.kernel@gmail.com>
      * renamed uapi/linux/batadv.h to uapi/linux/batadv_packet.h
      * moved batadv dissector functionality in own function
        - requested by Tom Herbert <tom@herbertland.com>
      * added support for flags FLOW_DISSECTOR_F_STOP_AT_ENCAP and
        FLOW_DIS_ENCAPSULATION
        - requested by Willem de Bruijn <willemdebruijn.kernel@gmail.com>
      
      Changes in v2:
      ==============
      
      * removed the batman-adv unicast packet header definition from flow_dissector.c
      * moved the batman-adv packet.h/uapi headers around to provide the correct
        definitions to flow_dissector.c
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0a80f0c2
    • Sven Eckelmann's avatar
      flow_dissector: Parse batman-adv unicast headers · 5b0890a9
      Sven Eckelmann authored
      The batman-adv unicast packets contain a full layer 2 frame in encapsulated
      form. The flow dissector must therefore be able to parse the batman-adv
      unicast header to reach the layer 2+3 information.
      
        +--------------------+
        | ip(v6)hdr          |
        +--------------------+
        | inner ethhdr       |
        +--------------------+
        | batadv unicast hdr |
        +--------------------+
        | outer ethhdr       |
        +--------------------+
      
      The obtained information from the upper layer can then be used by RPS to
      schedule the processing on separate cores. This allows better distribution
      of multiple flows from the same neighbor to different cores.
      Signed-off-by: default avatarSven Eckelmann <sven.eckelmann@openmesh.com>
      Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
      Acked-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5b0890a9
    • Sven Eckelmann's avatar
      batman-adv: Convert packet.h to uapi header · fec149f5
      Sven Eckelmann authored
      The header file is used by different userspace programs to inject packets
      or to decode sniffed packets. It should therefore be available to them as
      userspace header.
      
      Also other components in the kernel (like the flow dissector) require
      access to the packet definitions to be able to decode ETH_P_BATMAN ethernet
      packets.
      Signed-off-by: default avatarSven Eckelmann <sven.eckelmann@openmesh.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fec149f5
    • Sven Eckelmann's avatar
      batman-adv: Remove kernel fixed width types in packet.h · adbf9b73
      Sven Eckelmann authored
      The uapi headers use the __u8/__u16/... version of the fixed width types
      instead of u8/u16/... The use of the latter must be avoided before
      packet.h is copied to include/uapi/linux/.
      Signed-off-by: default avatarSven Eckelmann <sven.eckelmann@openmesh.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      adbf9b73
    • Sven Eckelmann's avatar
      batman-adv: Remove usage of BIT(x) in packet.h · a6cb82b5
      Sven Eckelmann authored
      The BIT(x) macro is no longer available for uapi headers because it is
      defined outside of it (linux/bitops.h). The use of it must therefore be
      avoided and replaced by an appropriate other representation.
      Signed-off-by: default avatarSven Eckelmann <sven.eckelmann@openmesh.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a6cb82b5
    • Sven Eckelmann's avatar
      batman-adv: Let packet.h include its headers directly · 4e58452b
      Sven Eckelmann authored
      The headers used by packet.h should also be included by it directly. main.h
      is currently dealing with it in batman-adv, but this will no longer work
      when this header is moved to include/uapi/linux/.
      Signed-off-by: default avatarSven Eckelmann <sven.eckelmann@openmesh.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4e58452b
    • David S. Miller's avatar
      Merge branch 'sfc-Medford2' · a0e2e75a
      David S. Miller authored
      Bert Kenward says:
      
      ====================
      sfc: support extra stats on Medford2
      
      X2000-series NICs add port stats for two new features: FEC (Forward Error
       Correction, used on 25G links) and CTPIO (cut-through programmed I/O).
      This patch series adds support for reporting both of these sets of stats
      
      v2: add additional Signed-off-by
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a0e2e75a
    • Bert Kenward's avatar
      sfc: expose CTPIO stats on NICs that support them · 2c0b6ee8
      Bert Kenward authored
      While the Linux driver doesn't use CTPIO ('cut-through programmed I/O'),
       other drivers on the same port might, so if we're responsible for
       reporting per-port stats we need to include the CTPIO stats.
      Signed-off-by: default avatarBert Kenward <bkenward@solarflare.com>
      Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2c0b6ee8
    • Edward Cree's avatar
      sfc: expose FEC stats on Medford2 · f411b54d
      Edward Cree authored
      There's no explicit capability bit, so we just condition them on having
       efx->num_mac_stats >= MC_CMD_MAC_NSTATS_V2.
      Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
      Signed-off-by: default avatarBert Kenward <bkenward@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f411b54d
    • Edward Cree's avatar
      sfc: support variable number of MAC stats · c1be4821
      Edward Cree authored
      Medford2 NICs support more than MC_CMD_MAC_NSTATS stats, and report the new
       count in a field of MC_CMD_GET_CAPABILITIES_V4.  This also means that the
       end generation count moves (it is, as before, the last 64 bits of the DMA
       buffer, but that is no longer MC_CMD_MAC_GENERATION_END).
      So read num_mac_stats from the GET_CAPABILITIES response, if present;
       otherwise assume MC_CMD_MAC_NSTATS; and always use num_mac_stats - 1 rather
       than MC_CMD_MAC_GENERATION_END.
      Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
      Signed-off-by: default avatarBert Kenward <bkenward@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c1be4821
    • Edward Cree's avatar
      d31a5966
    • Ganesh Goudar's avatar
      cxgb4: add new T5 and T6 device id's · 6baa13df
      Ganesh Goudar authored
      Add device id's 0x50ac, 0x6087 for T5 and T6 cards
      respectively.
      Signed-off-by: default avatarGanesh Goudar <ganeshgr@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6baa13df
    • Jie Deng's avatar
      net: dwc-xlgmac: Get rid of custom hex_dump_to_buffer() · 42afa0f8
      Jie Deng authored
      Get rid of custom hex_dump_to_buffer().
      
      The output is slightly changed, i.e. each byte followed by white space.
      
      Note, we don't use print_hex_dump() here since the original code uses
      nedev_dbg().
      Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: default avatarJie Deng <jiedeng@synopsys.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      42afa0f8
    • Russell King's avatar
      phylink: avoid attaching more than one PHY · fe1c3ef2
      Russell King authored
      Attaching more than one PHY to phylink is bad news, as we store a
      pointer to the PHY in a single location. Error out if more than one
      PHY is attempted to be attached.
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fe1c3ef2
    • David S. Miller's avatar
      Merge branch 'net-zerocopy-fixes' · c50b7c47
      David S. Miller authored
      Saeed Mahameed says:
      
      ===================
      Mellanox, mlx5 fixes 2017-12-19
      
      The follwoing series includes some fixes for mlx5 core and etherent
      driver.
      
      Please pull and let me know if there is any problem.
      
      This series doesn't introduce any conflict with the ongoing mlx5 for-next
      submission.
      
      For -stable:
      
      kernels >= v4.7.y
          ("net/mlx5e: Fix possible deadlock of VXLAN lock")
          ("net/mlx5e: Add refcount to VXLAN structure")
          ("net/mlx5e: Prevent possible races in VXLAN control flow")
          ("net/mlx5e: Fix features check of IPv6 traffic")
      
      kernels >= v4.9.y
          ("net/mlx5: Fix error flow in CREATE_QP command")
          ("net/mlx5: Fix rate limit packet pacing naming and struct")
      
      kernels >= v4.13.y
          ("net/mlx5: FPGA, return -EINVAL if size is zero")
      
      kernels >= v4.14.y
          ("Revert "mlx5: move affinity hints assignments to generic code")
      
      All above patches apply and compile with no issues on corresponding -stable.
      ===================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c50b7c47
    • Willem de Bruijn's avatar
      skbuff: skb_copy_ubufs must release uarg even without user frags · b90ddd56
      Willem de Bruijn authored
      skb_copy_ubufs creates a private copy of frags[] to release its hold
      on user frags, then calls uarg->callback to notify the owner.
      
      Call uarg->callback even when no frags exist. This edge case can
      happen when zerocopy_sg_from_iter finds enough room in skb_headlen
      to copy all the data.
      
      Fixes: 3ece7826 ("sock: skb_copy_ubufs support for compound pages")
      Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b90ddd56
    • Willem de Bruijn's avatar
      skbuff: orphan frags before zerocopy clone · 268b7906
      Willem de Bruijn authored
      Call skb_zerocopy_clone after skb_orphan_frags, to avoid duplicate
      calls to skb_uarg(skb)->callback for the same data.
      
      skb_zerocopy_clone associates skb_shinfo(skb)->uarg from frag_skb
      with each segment. This is only safe for uargs that do refcounting,
      which is those that pass skb_orphan_frags without dropping their
      shared frags. For others, skb_orphan_frags drops the user frags and
      sets the uarg to NULL, after which sock_zerocopy_clone has no effect.
      
      Qemu hangs were reported due to duplicate vhost_net_zerocopy_callback
      calls for the same data causing the vhost_net_ubuf_ref_>refcount to
      drop below zero.
      
      Link: http://lkml.kernel.org/r/<CAF=yD-LWyCD4Y0aJ9O0e_CHLR+3JOeKicRRTEVCPxgw4XOcqGQ@mail.gmail.com>
      Fixes: 1f8b977a ("sock: enable MSG_ZEROCOPY")
      Reported-by: default avatarAndreas Hartmann <andihartmann@01019freenet.de>
      Reported-by: default avatarDavid Hill <dhill@redhat.com>
      Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      268b7906
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.dk/linux-block · 9035a896
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "It's been a few weeks, so here's a small collection of fixes that
        should go into the current series.
      
        This contains:
      
         - NVMe pull request from Christoph, with a few important fixes.
      
         - kyber hang fix from Omar.
      
         - A blk-throttl fix from Shaohua, fixing a case where we double
           charge a bio.
      
         - Two call_single_data alignment fixes from me, fixing up some
           unfortunate changes that went into 4.14 without being properly
           reviewed on the block side (since nobody was CC'ed on the
           patch...).
      
         - A bounce buffer fix in two parts, one from me and one from Ming.
      
         - Revert bdi debug error handling patch. It's causing boot issues for
           some folks, and a week down the line, we're still no closer to a
           fix. Revert this patch for now until it's figured out, then we can
           retry for 4.16"
      
      * 'for-linus' of git://git.kernel.dk/linux-block:
        Revert "bdi: add error handle for bdi_debug_register"
        null_blk: unalign call_single_data
        block: unalign call_single_data in struct request
        block-throttle: avoid double charge
        block: fix blk_rq_append_bio
        block: don't let passthrough IO go into .make_request_fn()
        nvme: setup streams after initializing namespace head
        nvme: check hw sectors before setting chunk sectors
        nvme: call blk_integrity_unregister after queue is cleaned up
        nvme-fc: remove double put reference if admin connect fails
        nvme: set discard_alignment to zero
        kyber: fix another domain token wait queue hang
      9035a896
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 409232a4
      Linus Torvalds authored
      Pull KVM fixes from Paolo Bonzini:
       "ARM fixes:
         - A bug in handling of SPE state for non-vhe systems
         - A fix for a crash on system shutdown
         - Three timer fixes, introduced by the timer optimizations for v4.15
      
        x86 fixes:
         - fix for a WARN that was introduced in 4.15
         - fix for SMM when guest uses PCID
         - fixes for several bugs found by syzkaller
      
        ... and a dozen papercut fixes for the kvm_stat tool"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (22 commits)
        tools/kvm_stat: sort '-f help' output
        kvm: x86: fix RSM when PCID is non-zero
        KVM: Fix stack-out-of-bounds read in write_mmio
        KVM: arm/arm64: Fix timer enable flow
        KVM: arm/arm64: Properly handle arch-timer IRQs after vtimer_save_state
        KVM: arm/arm64: timer: Don't set irq as forwarded if no usable GIC
        KVM: arm/arm64: Fix HYP unmapping going off limits
        arm64: kvm: Prevent restoring stale PMSCR_EL1 for vcpu
        KVM/x86: Check input paging mode when cs.l is set
        tools/kvm_stat: add line for totals
        tools/kvm_stat: stop ignoring unhandled arguments
        tools/kvm_stat: suppress usage information on command line errors
        tools/kvm_stat: handle invalid regular expressions
        tools/kvm_stat: add hint on '-f help' to man page
        tools/kvm_stat: fix child trace events accounting
        tools/kvm_stat: fix extra handling of 'help' with fields filter
        tools/kvm_stat: fix missing field update after filter change
        tools/kvm_stat: fix drilldown in events-by-guests mode
        tools/kvm_stat: fix command line option '-g'
        kvm: x86: fix WARN due to uninitialized guest FPU state
        ...
      409232a4
    • Christian Lamparter's avatar
      net: ibm: emac: support RGMII-[RX|TX]ID phymode · 29635762
      Christian Lamparter authored
      The RGMII spec allows compliance for devices that implement an internal
      delay on TXC and/or RXC inside the transmitter. This patch adds the
      necessary RGMII_[RX|TX]ID mode code to handle such PHYs with the
      emac driver.
      Signed-off-by: default avatarChristian Lamparter <chunkeey@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      29635762
    • Christian Lamparter's avatar
      net: ibm: emac: replace custom PHY_MODE_* macros · 78b69921
      Christian Lamparter authored
      The ibm_emac driver predates the PHY_INTERFACE_MODE_*
      enums by a few years.
      
      And while the driver has been retrofitted to use the PHYLIB,
      the old definitions have stuck around to this day.
      
      This patch replaces all occurences of PHY_MODE_* with
      the respective equivalent PHY_INTERFACE_MODE_* enum.
      And finally, it purges the old macros for good.
      Signed-off-by: default avatarChristian Lamparter <chunkeey@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      78b69921
    • Christian Lamparter's avatar
      net: ibm: emac: replace custom rgmii_mode_name with phy_modes · 49dd19bf
      Christian Lamparter authored
      phy_modes() in the common phy.h already defines the same phy mode
      names in lower case. The deleted rgmii_mode_name() is used only
      in one place and for a "notice-level" printk. Hence, it will not
      be missed.
      Signed-off-by: default avatarChristian Lamparter <chunkeey@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      49dd19bf
    • Shaohua Li's avatar
      net: reevalulate autoflowlabel setting after sysctl setting · 513674b5
      Shaohua Li authored
      sysctl.ip6.auto_flowlabels is default 1. In our hosts, we set it to 2.
      If sockopt doesn't set autoflowlabel, outcome packets from the hosts are
      supposed to not include flowlabel. This is true for normal packet, but
      not for reset packet.
      
      The reason is ipv6_pinfo.autoflowlabel is set in sock creation. Later if
      we change sysctl.ip6.auto_flowlabels, the ipv6_pinfo.autoflowlabel isn't
      changed, so the sock will keep the old behavior in terms of auto
      flowlabel. Reset packet is suffering from this problem, because reset
      packet is sent from a special control socket, which is created at boot
      time. Since sysctl.ipv6.auto_flowlabels is 1 by default, the control
      socket will always have its ipv6_pinfo.autoflowlabel set, even after
      user set sysctl.ipv6.auto_flowlabels to 1, so reset packset will always
      have flowlabel. Normal sock created before sysctl setting suffers from
      the same issue. We can't even turn off autoflowlabel unless we kill all
      socks in the hosts.
      
      To fix this, if IPV6_AUTOFLOWLABEL sockopt is used, we use the
      autoflowlabel setting from user, otherwise we always call
      ip6_default_np_autolabel() which has the new settings of sysctl.
      
      Note, this changes behavior a little bit. Before commit 42240901
      (ipv6: Implement different admin modes for automatic flow labels), the
      autoflowlabel behavior of a sock isn't sticky, eg, if sysctl changes,
      existing connection will change autoflowlabel behavior. After that
      commit, autoflowlabel behavior is sticky in the whole life of the sock.
      With this patch, the behavior isn't sticky again.
      
      Cc: Martin KaFai Lau <kafai@fb.com>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: Tom Herbert <tom@quantonium.net>
      Signed-off-by: default avatarShaohua Li <shli@fb.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      513674b5
    • Eric Garver's avatar
      openvswitch: Fix pop_vlan action for double tagged frames · c48e7473
      Eric Garver authored
      skb_vlan_pop() expects skb->protocol to be a valid TPID for double
      tagged frames. So set skb->protocol to the TPID and let skb_vlan_pop()
      shift the true ethertype into position for us.
      
      Fixes: 5108bbad ("openvswitch: add processing of L3 packets")
      Signed-off-by: default avatarEric Garver <e@erig.me>
      Reviewed-by: default avatarJiri Benc <jbenc@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c48e7473
    • David S. Miller's avatar
      Merge branch 'net-sched-extack' · 90bbec0f
      David S. Miller authored
      Alexander Aring says:
      
      ====================
      net: sched: sch: introduce extack support
      
      this patch series basically add support for extack in common qdisc handling.
      Additional it adds extack pointer to common qdisc callback handling this
      offers per qdisc implementation to setting the extack message for each
      failure over netlink.
      
      The extack message will be set deeper in qdisc functions but going not
      deeper as net core api. For qdisc module callback handling, the extack
      will not be set. This will be part of per qdisc extack handling.
      
      I also want to prepare patches to handle extack per qdisc module...
      so there will come a lot of more patches, just cut them down to make
      it reviewable.
      
      There are some above 80-chars width warnings, which I ignore because
      it looks more ugly otherwise.
      
      This patch-series based on patches by David Ahern which gave me some
      hints how to deal with extack support.
      
      Cc: David Ahern <dsahern@gmail.com>
      
      changes since v4:
       - rebase on current net-next/master
       - fix several typos (also David Ahren to Ahern, I am sorry)
       - Add acked by Jamal
      
      changes since v3:
       - remove patch 2/2 lib: nlattr: set extack msg if validate_nla fails since
         David Ahern has a better solution
       - Remove check on net admin permission since -EPERM indicates it already
       - Change rtab to "rate table" - this is what it's stands for
       - Fix cbs *not* support messages
       - Fix tcf block error message for allocation, allocation will be still there
         because there are multiple places which returns -ENOMEM
       - Finnally also took care about sch_atm, sorry somehow I forgot this one and
         I hope I didn't forgot any sch implementation to add new callback parameters
      
      changes since v2:
       - add fix coding style patch to catch all checkpatch warnings
       - add patch for setting netlink extack msg if validate_nla fails
       - changes in handle generic qdisc errors
         - remove NL_SET_ERR_MSG from memory allocation errors
         - remove NL_SET_ERR_MSG from device not found
         - change STAB to table size
       - add various new patches to add extack support for common
         TC functions like qdisc_get_rtab, tcf_block_get, qdisc_alloc
         and qdisc_create_dflt - users which are interessted in the
         detailed error messages can assign extack, otherwise NULL.
       - Add sch_cbq as example for qdisc_ops callback: init,
         qdisc_class_ops callbacks: change and graft
       - Add sch_cbs as example for qdisc_ops callback: change
       - Add sch_drr as example for qdisc_class ops callbacks: tcf_block
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      90bbec0f
    • Alexander Aring's avatar
      net: sch: sch_drr: add extack support · a7c31693
      Alexander Aring authored
      This patch adds extack support for the drr qdisc implementation by
      adding NL_SET_ERR_MSG in validation of user input.
      Also it serves to illustrate a use case of how the infrastructure ops
      api changes are to be used by individual qdiscs.
      
      Cc: David Ahern <dsahern@gmail.com>
      Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: default avatarAlexander Aring <aring@mojatatu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a7c31693
    • Alexander Aring's avatar
      net: sch: sch_cbs: add extack support · 710fb396
      Alexander Aring authored
      This patch adds extack support for the cbs qdisc implementation by
      adding NL_SET_ERR_MSG in validation of user input.
      Also it serves to illustrate a use case of how the infrastructure ops
      api changes are to be used by individual qdiscs.
      
      Cc: David Ahern <dsahern@gmail.com>
      Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: default avatarAlexander Aring <aring@mojatatu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      710fb396
    • Alexander Aring's avatar
      net: sch: sch_cbq: add extack support · 62a6de62
      Alexander Aring authored
      This patch adds extack support for the cbq qdisc implementation by
      adding NL_SET_ERR_MSG in validation of user input.
      Also it serves to illustrate a use case of how the infrastructure ops
      api changes are to be used by individual qdiscs.
      
      Cc: David Ahern <dsahern@gmail.com>
      Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: default avatarAlexander Aring <aring@mojatatu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      62a6de62
    • Alexander Aring's avatar
      net: sch: api: add extack support in qdisc_create_dflt · a38a9882
      Alexander Aring authored
      This patch adds extack support for the function qdisc_create_dflt which is
      a common used function in the tc subsystem. Callers which are interested
      in the receiving error can assign extack to get a more detailed
      information why qdisc_create_dflt failed. The function qdisc_create_dflt
      will also call an init callback which can fail by any per-qdisc specific
      handling.
      
      Cc: David Ahern <dsahern@gmail.com>
      Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: default avatarAlexander Aring <aring@mojatatu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a38a9882
    • Alexander Aring's avatar
      net: sch: api: add extack support in qdisc_alloc · d0bd684d
      Alexander Aring authored
      This patch adds extack support for the function qdisc_alloc which is
      a common used function in the tc subsystem. Callers which are interested
      in the receiving error can assign extack to get a more detailed
      information why qdisc_alloc failed.
      
      Cc: David Ahern <dsahern@gmail.com>
      Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: default avatarAlexander Aring <aring@mojatatu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d0bd684d
    • Alexander Aring's avatar
      net: sch: api: add extack support in tcf_block_get · 8d1a77f9
      Alexander Aring authored
      This patch adds extack support for the function tcf_block_get which is
      a common used function in the tc subsystem. Callers which are interested
      in the receiving error can assign extack to get a more detailed
      information why tcf_block_get failed.
      
      Cc: David Ahern <dsahern@gmail.com>
      Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: default avatarAlexander Aring <aring@mojatatu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8d1a77f9
    • Alexander Aring's avatar
      net: sch: api: add extack support in qdisc_get_rtab · e9bc3fa2
      Alexander Aring authored
      This patch adds extack support for the function qdisc_get_rtab which is
      a common used function in the tc subsystem. Callers which are interested
      in the receiving error can assign extack to get a more detailed
      information why qdisc_get_rtab failed.
      
      Cc: David Ahern <dsahern@gmail.com>
      Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: default avatarAlexander Aring <aring@mojatatu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e9bc3fa2