1. 02 Aug, 2017 19 commits
  2. 01 Aug, 2017 21 commits
    • Willem de Bruijn's avatar
      net: add skb_frag_foreach_page and use with kmap_atomic · c613c209
      Willem de Bruijn authored
      Skb frags may contain compound pages. Various operations map frags
      temporarily using kmap_atomic, but this function works on single
      pages, not whole compound pages. The distinction is only relevant
      for high mem pages that require temporary mappings.
      
      Introduce a looping mechanism that for compound highmem pages maps
      one page at a time, does not change behavior on other pages.
      Use the loop in the kmap_atomic callers in net/core/skbuff.c.
      
      Verified by triggering skb_copy_bits with
      
          tcpdump -n -c 100 -i ${DEV} -w /dev/null &
          netperf -t TCP_STREAM -H ${HOST}
      
        and by triggering __skb_checksum with
      
          ethtool -K ${DEV} tx off
      
        repeated the tests with looping on a non-highmem platform
        (x86_64) by making skb_frag_must_loop always return true.
      Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c613c209
    • David S. Miller's avatar
      Merge branch 'mediatek-next' · 1ae39d65
      David S. Miller authored
      Sean Wang says:
      
      ====================
      net-next: mediatek: add support for ethernet on MT7622 SoC
      
      Changes since v2:
      - update John's mail
      
      Changes since v1:
      - add refinement for ethernet clock management
      - take out the code block for ESW, add it until ESW driver is actually introduced
      
      The series adds the driver for ethernet controller found on MT7622 SoC.
      There are additions against with previous MT7623 SoC such as shared SGMII
      given for the dual GMACs and built-in 5-ports 10/100 embedded switch support
      (ESW). Thus more clocks consumers and SGMII hardware setup for the extra
      features are all introduced here and as for the support for ESW that would be
      planned to add in the separate patch integrating with DSA infrastructure
      in the future.
      
      Currently testing successfully is done with those patches for the conditions
      such as GMAC2 with IP1001 PHY via RGMII and GMAC1/2 with RTL8211F PHY via SGMII.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1ae39d65
    • Sean Wang's avatar
      MAINTAINERS: add Sean/Nelson as MediaTek ethernet maintainers · 0857d6f8
      Sean Wang authored
      Sean and Nelson work for MediaTek on maintaining the MediaTek ethernet
      driver for the existing SoCs and adding support for the following SoCs.
      In the past, Sean has been active at making most of the qualifications
      , stress test and submitting a lot of patches for the driver while
      Nelson was looking into the aspects more on hardware additions and details
      such as introducing PDMA with Hardware LRO to the driver. Also update
      John's up-to-date mail address in the patch.
      
      Cc: John Crispin <john@phrozen.org>
      Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
      Signed-off-by: default avatarNelson Chang <nelson.chang@mediatek.com>
      Acked-by: default avatarJohn Crispin <john@phrozen.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0857d6f8
    • Sean Wang's avatar
      net-next: mediatek: add support for MediaTek MT7622 SoC · 42c03844
      Sean Wang authored
      This patch adds the driver for ethernet controller on MT7622 SoC. It has
      the similar handling logic as the previously MT7623 does, but there are
      additions against with MT7623 SoC, the shared SGMII given for the dual
      GMACs and including 5-ports 10/100 embedded switch support (ESW) as the
      GMAC1 option, thus more clocks consumers for the extra feature are
      introduced here. So for ease portability and maintenance, those
      differences all are being kept inside the platform data as other drivers
      usually do. Currently testing successfully is done with those patches for
      the conditions such as GMAC2 with IP1001 PHY via RGMII and GMAC1/2 with
      RTL8211F PHY via SGMII.
      Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      42c03844
    • Sean Wang's avatar
      net-next: mediatek: add platform data to adapt into various hardware · 2ec50f57
      Sean Wang authored
      This patch is the preparation patch in order to adapt into various
      hardware through adding platform data which holds specific characteristics
      among MediaTek SoCs and introducing the unified clock handler for those
      distinct clock requirements depending on different features such as
      TRGMII and SGMII getting support on the target SoC. And finally, add
      enhancement with given the generic description for Kconfig and remove the
      unnecessary machine type dependency in Makefile.
      Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2ec50f57
    • Sean Wang's avatar
      dt-bindings: net: mediatek: add support for MediaTek MT7623 and MT7622 SoC · da779b40
      Sean Wang authored
      The patch adds the supplements in the dt-binding document for MediaTek
      MT7622 SoC with extra SGMII system controller and relevant clock consumers
      listed as the requirements for those SoCs equipped with the SGMII circuit.
      Also, add the missing binding information for MT7623 SoC here which relies
      on the fallback binding of MT2701.
      Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      da779b40
    • David S. Miller's avatar
      Merge branch 'kzproxy-next' · 2e674381
      David S. Miller authored
      Tom Herbert says:
      
      ====================
      net: Infrastructure changes for [kz]proxy
      
      This patch set contains some general infrastructure enhancements that
      will be used by kernel proxy and zero proxy.
      
      The changes are:
        - proto_ops: Add locked versions of sendmsg and sendpage
        - skb_send_sock: Allow sending and skb on a socket within the
          kernel
        - Generalize strparser. Allow it to be used in other contexts than
          just in the read_sock path. This will be used in the transmit
          path of zero proxy.
      
      Some nice future work (which I've been discussing with John Fastabend)
      will be to make some of the related functions to allow gifting of skbs
      We should be able to do that with skb_send_sock and strp_process. I'd
      also like this feature in the read_sock callbeck.
      
      Tested: Ran modified kernel without incident. Tested new functionality
      using zero proxy (in development).
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2e674381
    • Tom Herbert's avatar
      strparser: Generalize strparser · bbb03029
      Tom Herbert authored
      Generalize strparser from more than just being used in conjunction
      with read_sock. strparser will also be used in the send path with
      zero proxy. The primary change is to create strp_process function
      that performs the critical processing on skbs. The documentation
      is also updated to reflect the new uses.
      Signed-off-by: default avatarTom Herbert <tom@quantonium.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bbb03029
    • Tom Herbert's avatar
      skbuff: Function to send an skbuf on a socket · 20bf50de
      Tom Herbert authored
      Add skb_send_sock to send an skbuff on a socket within the kernel.
      Arguments include an offset so that an skbuf might be sent in mulitple
      calls (e.g. send buffer limit is hit).
      Signed-off-by: default avatarTom Herbert <tom@quantonium.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      20bf50de
    • Tom Herbert's avatar
      proto_ops: Add locked held versions of sendmsg and sendpage · 306b13eb
      Tom Herbert authored
      Add new proto_ops sendmsg_locked and sendpage_locked that can be
      called when the socket lock is already held. Correspondingly, add
      kernel_sendmsg_locked and kernel_sendpage_locked as front end
      functions.
      
      These functions will be used in zero proxy so that we can take
      the socket lock in a ULP sendmsg/sendpage and then directly call the
      backend transport proto_ops functions.
      Signed-off-by: default avatarTom Herbert <tom@quantonium.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      306b13eb
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 29fda25a
      David S. Miller authored
      Two minor conflicts in virtio_net driver (bug fix overlapping addition
      of a helper) and MAINTAINERS (new driver edit overlapping revamp of
      PHY entry).
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      29fda25a
    • David S. Miller's avatar
      Merge branch 'revert-ipv6-const' · bb1182bc
      David S. Miller authored
      Julia Lawall says:
      
      ====================
      Revert "ipv6: constify inet6_protocol structures"
      
      inet6_add_protocol and inet6_del_protocol include casts that remove the
      effect of the const annotation on their parameter, leading to possible
      runtime crashes.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bb1182bc
    • Julia Lawall's avatar
      Revert "l2tp: constify inet6_protocol structures" · e6eeb287
      Julia Lawall authored
      This reverts commit d04916a4.
      
      inet6_add_protocol and inet6_del_protocol include casts that remove the
      effect of the const annotation on their parameter, leading to possible
      runtime crashes.
      Reported-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e6eeb287
    • Julia Lawall's avatar
      Revert "ipv6: constify inet6_protocol structures" · 39294c3d
      Julia Lawall authored
      This reverts commit 3a3a4e30.
      
      inet6_add_protocol and inet6_del_protocol include casts that remove the
      effect of the const annotation on their parameter, leading to possible
      runtime crashes.
      Reported-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      39294c3d
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · bc78d646
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Handle notifier registry failures properly in tun/tap driver, from
          Tonghao Zhang.
      
       2) Fix bpf verifier handling of subtraction bounds and add a testcase
          for this, from Edward Cree.
      
       3) Increase reset timeout in ftgmac100 driver, from Ben Herrenschmidt.
      
       4) Fix use after free in prd_retire_rx_blk_timer_exired() in AF_PACKET,
          from Cong Wang.
      
       5) Fix SElinux regression due to recent UDP optimizations, from Paolo
          Abeni.
      
       6) We accidently increment IPSTATS_MIB_FRAGFAILS in the ipv6 code
          paths, fix from Stefano Brivio.
      
       7) Fix some mem leaks in dccp, from Xin Long.
      
       8) Adjust MDIO_BUS kconfig deps to avoid build errors, from Arnd
          Bergmann.
      
       9) Mac address length check and buffer size fixes from Cong Wang.
      
      10) Don't leak sockets in ipv6 udp early demux, from Paolo Abeni.
      
      11) Fix return value when copy_from_user() fails in
          bpf_prog_get_info_by_fd(), from Daniel Borkmann.
      
      12) Handle PHY_HALTED properly in phy library state machine, from
          Florian Fainelli.
      
      13) Fix OOPS in fib_sync_down_dev(), from Ido Schimmel.
      
      14) Fix truesize calculation in virtio_net which led to performance
          regressions, from Michael S Tsirkin.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (76 commits)
        samples/bpf: fix bpf tunnel cleanup
        udp6: fix jumbogram reception
        ppp: Fix a scheduling-while-atomic bug in del_chan
        Revert "net: bcmgenet: Remove init parameter from bcmgenet_mii_config"
        virtio_net: fix truesize for mergeable buffers
        mv643xx_eth: fix of_irq_to_resource() error check
        MAINTAINERS: Add more files to the PHY LIBRARY section
        ipv4: fib: Fix NULL pointer deref during fib_sync_down_dev()
        net: phy: Correctly process PHY_HALTED in phy_stop_machine()
        sunhme: fix up GREG_STAT and GREG_IMASK register offsets
        bpf: fix bpf_prog_get_info_by_fd to dump correct xlated_prog_len
        tcp: avoid bogus gcc-7 array-bounds warning
        net: tc35815: fix spelling mistake: "Intterrupt" -> "Interrupt"
        bpf: don't indicate success when copy_from_user fails
        udp6: fix socket leak on early demux
        net: thunderx: Fix BGX transmit stall due to underflow
        Revert "vhost: cache used event for better performance"
        team: use a larger struct for mac address
        net: check dev->addr_len for dev_set_mac_address()
        phy: bcm-ns-usb3: fix MDIO_BUS dependency
        ...
      bc78d646
    • Brian Norris's avatar
      Bluetooth: btusb: add ID for LiteOn 04ca:3016 · d829b9e2
      Brian Norris authored
      Contains a QCA6174A-5 chipset, with USB BT. Let's support loading
      firmware on it.
      
      From usb-devices:
      T:  Bus=02 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=  3 Spd=12  MxCh= 0
      D:  Ver= 2.01 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=04ca ProdID=3016 Rev=00.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
      I:  If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      Signed-off-by: default avatarBrian Norris <briannorris@chromium.org>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      d829b9e2
    • William Tu's avatar
      samples/bpf: fix bpf tunnel cleanup · cc75f851
      William Tu authored
      test_tunnel_bpf.sh fails to remove the vxlan11 tunnel device, causing the
      next geneve tunnelling test case fails.  In addition, the geneve reserved bit
      in tcbpf2_kern.c should be zero, according to the RFC.
      Signed-off-by: default avatarWilliam Tu <u9012063@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cc75f851
    • Paolo Abeni's avatar
      udp6: fix jumbogram reception · cb891fa6
      Paolo Abeni authored
      Since commit 67a51780 ("ipv6: udp: leverage scratch area
      helpers") udp6_recvmsg() read the skb len from the scratch area,
      to avoid a cache miss.
      But the UDP6 rx path support RFC 2675 UDPv6 jumbograms, and their
      length exceeds the 16 bits available in the scratch area. As a side
      effect the length returned by recvmsg() is:
      <ingress datagram len> % (1<<16)
      
      This commit addresses the issue allocating one more bit in the
      IP6CB flags field and setting it for incoming jumbograms.
      Such field is still in the first cacheline, so at recvmsg()
      time we can check it and fallback to access skb->len if
      required, without a measurable overhead.
      
      Fixes: 67a51780 ("ipv6: udp: leverage scratch area helpers")
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cb891fa6
    • Gao Feng's avatar
      ppp: Fix a scheduling-while-atomic bug in del_chan · ddab8282
      Gao Feng authored
      The PPTP set the pptp_sock_destruct as the sock's sk_destruct, it would
      trigger this bug when __sk_free is invoked in atomic context, because of
      the call path pptp_sock_destruct->del_chan->synchronize_rcu.
      
      Now move the synchronize_rcu to pptp_release from del_chan. This is the
      only one case which would free the sock and need the synchronize_rcu.
      
      The following is the panic I met with kernel 3.3.8, but this issue should
      exist in current kernel too according to the codes.
      
      BUG: scheduling while atomic
      __schedule_bug+0x5e/0x64
      __schedule+0x55/0x580
      ? ppp_unregister_channel+0x1cd5/0x1de0 [ppp_generic]
      ? dev_hard_start_xmit+0x423/0x530
      ? sch_direct_xmit+0x73/0x170
      __cond_resched+0x16/0x30
      _cond_resched+0x22/0x30
      wait_for_common+0x18/0x110
      ? call_rcu_bh+0x10/0x10
      wait_for_completion+0x12/0x20
      wait_rcu_gp+0x34/0x40
      ? wait_rcu_gp+0x40/0x40
      synchronize_sched+0x1e/0x20
      0xf8417298
      0xf8417484
      ? sock_queue_rcv_skb+0x109/0x130
      __sk_free+0x16/0x110
      ? udp_queue_rcv_skb+0x1f2/0x290
      sk_free+0x16/0x20
      __udp4_lib_rcv+0x3b8/0x650
      Signed-off-by: default avatarGao Feng <gfree.wind@vip.163.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ddab8282
    • Florian Fainelli's avatar
      Revert "net: bcmgenet: Remove init parameter from bcmgenet_mii_config" · 00d51094
      Florian Fainelli authored
      This reverts commit 28b45910 ("net: bcmgenet: Remove init parameter
      from bcmgenet_mii_config") because in the process of moving from
      dev_info() to dev_info_once() we essentially lost the helpful printed
      messages once the second instance of the driver is loaded.
      dev_info_once() does not actually print the message once per device
      instance, but once period.
      
      Fixes: 28b45910 ("net: bcmgenet: Remove init parameter from bcmgenet_mii_config")
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: default avatarDoug Berger <opendmb@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      00d51094
    • Michael S. Tsirkin's avatar
      virtio_net: fix truesize for mergeable buffers · 1daa8790
      Michael S. Tsirkin authored
      Seth Forshee noticed a performance degradation with some workloads.
      This turns out to be due to packet drops.  Euan Kemp noticed that this
      is because we drop all packets where length exceeds the truesize, but
      for some packets we add in extra memory without updating the truesize.
      This in turn was kept around unchanged from ab7db917 ("virtio-net:
      auto-tune mergeable rx buffer size for improved performance").  That
      commit had an internal reason not to account for the extra space: not
      enough bits to do it.  No longer true so let's account for the allocated
      length exactly.
      
      Many thanks to Seth Forshee for the report and bisecting and Euan Kemp
      for debugging the issue.
      
      Fixes: 680557cf ("virtio_net: rework mergeable buffer handling")
      Reported-by: default avatarEuan Kemp <euan.kemp@coreos.com>
      Tested-by: default avatarEuan Kemp <euan.kemp@coreos.com>
      Reported-by: default avatarSeth Forshee <seth.forshee@canonical.com>
      Tested-by: default avatarSeth Forshee <seth.forshee@canonical.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1daa8790