1. 13 Dec, 2018 7 commits
    • Wright Feng's avatar
      brcmfmac: enable frameburst mode in default firmware setting · a3bdc6de
      Wright Feng authored
      The frameburst feature can enable per-packet framebursting in firmware
      side and get higher TX throughput in High Throughput(HT) mode. To enhance
      TX throughput, we enable frameburst mode in default firmware setting.
      Signed-off-by: default avatarWright Feng <wright.feng@cypress.com>
      Acked-by: default avatarArend van Spriel <arend.vanspriel@broadcom.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      a3bdc6de
    • Wright Feng's avatar
      brcmfmac: add credit numbers updating support · 153e22c0
      Wright Feng authored
      The credit numbers are static and tunable per chip in firmware side.
      However the credit number may be changed that is based on packet pool
      length and will send BRCMF_E_FIFO_CREDIT_MAP event to notify host driver
      updates the credit numbers during interface up.
      The purpose of this patch is making host driver has ability of updating
      the credit numbers when receiving the BRCMF_E_FIFO_CREDIT_MAP event.
      Signed-off-by: default avatarWright Feng <wright.feng@cypress.com>
      Acked-by: default avatarArend van Spriel <arend.vanspriel@broadcom.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      153e22c0
    • Brian Norris's avatar
      mwifiex: add NL80211_STA_INFO_RX_BITRATE support · ed0b2b06
      Brian Norris authored
      Comparing the existing TX_BITRATE parsing code (in
      mwifiex_parse_htinfo()) with the RX bitrate histograms in debugfs.c, it
      appears that the rxpd_rate and rxpd_htinfo fields have the same format.
      At least, they give reasonable results when I parse them this way.
      
      So this patch adds support for RX_BITRATE to our station info dump.
      
      Along the way, I add legacy bitrate parsing into the same function,
      using the debugfs code (mwifiex_histogram_read() and
      mwifiex_adjust_data_rate()) as reference.
      
      Additionally, to satisfy the requirements of
      NL80211_STA_INFO_RX_BITRATE, I skip logging the bitrate of multicast
      packets. This shouldn't add a lot of overhead to the RX path, as there
      are already several similar 802.3 header checks in this same codepath.
      We can also bias the branch behavior to favor unicast, as that's the
      common performance-sensitive case.
      
      I'd consider this support somewhat experimental, as I have zero
      documentation from Marvell. But the existing driver code gives me good
      reason to think this is correct.
      
      I've tested this on a few different 802.11{a,b,g,n,ac} networks, and the
      reported bitrates look good to me.
      Signed-off-by: default avatarBrian Norris <briannorris@chromium.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      ed0b2b06
    • Brian Norris's avatar
      mwifiex: refactor mwifiex_parse_htinfo() for reuse · a256707f
      Brian Norris authored
      This function converts some firmware-specific parameters into cfg80211
      'rate_info' structures. It currently assumes it's dealing only with TX
      bitrate, but the RX bitrate looks to be the same, so refactor this
      function to be reusable.
      Signed-off-by: default avatarBrian Norris <briannorris@chromium.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      a256707f
    • Brian Norris's avatar
      mwifiex: debugfs: correct histogram spacing, formatting · 4cb777c6
      Brian Norris authored
      Currently, snippets of this file look like:
      
      rx rates (in Mbps): 0=1M   1=2M2=5.5M  3=11M   4=6M   5=9M  6=12M
      7=18M  8=24M  9=36M  10=48M  11=54M12-27=MCS0-15(BW20) 28-43=MCS0-15(BW40)
      44-53=MCS0-9(VHT:BW20)54-63=MCS0-9(VHT:BW40)64-73=MCS0-9(VHT:BW80)
      ...
      noise_flr[--96dBm] = 22
      noise_flr[--95dBm] = 149
      noise_flr[--94dBm] = 9
      noise_flr[--93dBm] = 2
      
      We're missing some spaces, and we're adding a minus sign ('-') on values
      that are already negative signed integers.
      Signed-off-by: default avatarBrian Norris <briannorris@chromium.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      4cb777c6
    • Pan Bian's avatar
      mwifiex: fix potential NULL dereference and use after free · 1dcd9429
      Pan Bian authored
      There are two defects: (1) passing a NULL bss to
      mwifiex_save_hidden_ssid_channels will result in NULL dereference,
      (2) using bss after dropping the reference to it via cfg80211_put_bss.
      To fix them, the patch moves the buggy code to the branch that bss is
      not NULL and puts it before cfg80211_put_bss.
      Signed-off-by: default avatarPan Bian <bianpan2016@163.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      1dcd9429
    • Kalle Valo's avatar
      Merge tag 'mt76-for-kvalo-2018-11-30' of https://github.com/nbd168/wireless · 074b145a
      Kalle Valo authored
      first batch of mt76 patches for 4.21
      
      * use the same firmware for mt76x2e and mt76x2u
      * mt76x2 fixes
      * mt76x0 fixes
      * mt76x0e survey support
      * more unification between mt76x2 and mt76x0
      * mt76x0e AP mode support
      * mt76x0e DFS support
      * rework and fix tx status handling for mt76x0 and mt76x2
      
      kvalo: fixed a conflict in drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c
      and a build problem in drivers/net/wireless/mediatek/mt76/mt76x02_util.c
      074b145a
  2. 04 Dec, 2018 23 commits
  3. 03 Dec, 2018 10 commits
    • David S. Miller's avatar
      Merge branch 'udp-msg_zerocopy' · 6e360f73
      David S. Miller authored
      Willem de Bruijn says:
      
      ====================
      udp msg_zerocopy
      
      Enable MSG_ZEROCOPY for udp sockets
      
      Patch 1/3 is the main patch, a rework of RFC patch
        http://patchwork.ozlabs.org/patch/899630/
        more details in the patch commit message
      
      Patch 2/3 is an optimization to remove a branch from the UDP hot path
        and refcount_inc/refcount_dec_and_test pair when zerocopy is used.
        This used to be included in the first patch in v2.
      
      Patch 3/3 runs the already existing udp zerocopy tests
        as part of kselftest
      
      See also recent Linux Plumbers presentation
        https://linuxplumbersconf.org/event/2/contributions/106/attachments/104/128/willemdebruijn-lpc2018-udpgso-presentation-20181113.pdf
      
      Changes:
        v1 -> v2
          - Fixup reverse christmas tree violation
        v2 -> v3
          - Split refcount avoidance optimization into separate patch
            - Fix refcount leak on error in fragmented case
              (thanks to Paolo Abeni for pointing this one out!)
            - Fix refcount inc on zero
        v3 -> v4
          - Move skb_zcopy_set below the only kfree_skb that might cause
            a premature uarg destroy before skb_zerocopy_put_abort
            - Move the entire skb_shinfo assignment block, to keep that
      	cacheline access in one place
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6e360f73
    • Willem de Bruijn's avatar
      selftests: extend zerocopy tests to udp · db63e489
      Willem de Bruijn authored
      Both msg_zerocopy and udpgso_bench have udp zerocopy variants.
      Exercise these as part of the standard kselftest run.
      
      With udp, msg_zerocopy has no control channel. Ensure that the
      receiver exits after the sender by accounting for the initial
      delay in starting them (in msg_zerocopy.sh).
      Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      db63e489
    • Willem de Bruijn's avatar
      udp: elide zerocopy operation in hot path · 52900d22
      Willem de Bruijn authored
      With MSG_ZEROCOPY, each skb holds a reference to a struct ubuf_info.
      Release of its last reference triggers a completion notification.
      
      The TCP stack in tcp_sendmsg_locked holds an extra ref independent of
      the skbs, because it can build, send and free skbs within its loop,
      possibly reaching refcount zero and freeing the ubuf_info too soon.
      
      The UDP stack currently also takes this extra ref, but does not need
      it as all skbs are sent after return from __ip(6)_append_data.
      
      Avoid the extra refcount_inc and refcount_dec_and_test, and generally
      the sock_zerocopy_put in the common path, by passing the initial
      reference to the first skb.
      
      This approach is taken instead of initializing the refcount to 0, as
      that would generate error "refcount_t: increment on 0" on the
      next skb_zcopy_set.
      
      Changes
        v3 -> v4
          - Move skb_zcopy_set below the only kfree_skb that might cause
            a premature uarg destroy before skb_zerocopy_put_abort
            - Move the entire skb_shinfo assignment block, to keep that
              cacheline access in one place
      Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
      Acked-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      52900d22
    • Willem de Bruijn's avatar
      udp: msg_zerocopy · b5947e5d
      Willem de Bruijn authored
      Extend zerocopy to udp sockets. Allow setting sockopt SO_ZEROCOPY and
      interpret flag MSG_ZEROCOPY.
      
      This patch was previously part of the zerocopy RFC patchsets. Zerocopy
      is not effective at small MTU. With segmentation offload building
      larger datagrams, the benefit of page flipping outweights the cost of
      generating a completion notification.
      
      tools/testing/selftests/net/msg_zerocopy.sh after applying follow-on
      test patch and making skb_orphan_frags_rx same as skb_orphan_frags:
      
          ipv4 udp -t 1
          tx=191312 (11938 MB) txc=0 zc=n
          rx=191312 (11938 MB)
          ipv4 udp -z -t 1
          tx=304507 (19002 MB) txc=304507 zc=y
          rx=304507 (19002 MB)
          ok
          ipv6 udp -t 1
          tx=174485 (10888 MB) txc=0 zc=n
          rx=174485 (10888 MB)
          ipv6 udp -z -t 1
          tx=294801 (18396 MB) txc=294801 zc=y
          rx=294801 (18396 MB)
          ok
      
      Changes
        v1 -> v2
          - Fixup reverse christmas tree violation
        v2 -> v3
          - Split refcount avoidance optimization into separate patch
            - Fix refcount leak on error in fragmented case
              (thanks to Paolo Abeni for pointing this one out!)
            - Fix refcount inc on zero
            - Test sock_flag SOCK_ZEROCOPY directly in __ip_append_data.
              This is needed since commit 5cf4a853 ("tcp: really ignore
      	MSG_ZEROCOPY if no SO_ZEROCOPY") did the same for tcp.
      Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
      Acked-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b5947e5d
    • David S. Miller's avatar
      Merge tag 'wireless-drivers-next-for-davem-2018-11-30' of... · ce01a56b
      David S. Miller authored
      Merge tag 'wireless-drivers-next-for-davem-2018-11-30' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next
      
      Kalle Valo says:
      
      ====================
      wireless-drivers-next patches for 4.21
      
      First set of patches for 4.21. Most notable here is support for
      Quantenna's QSR1000/QSR2000 chipsets and more flexible ways to provide
      nvram files for brcmfmac.
      
      Major changes:
      
      brcmfmac
      
      * add support for first trying to get a board specific nvram file
      
      * add support for getting nvram contents from EFI variables
      
      qtnfmac
      
      * use single PCIe driver for all platforms and rename
        Kconfig option CONFIG_QTNFMAC_PEARL_PCIE to CONFIG_QTNFMAC_PCIE
      
      * add support for QSR1000/QSR2000 (Topaz) family of chipsets
      
      ath10k
      
      * add support for WCN3990 firmware crash recovery
      
      * add firmware memory dump support for QCA4019
      
      wil6210
      
      * add firmware error recovery while in AP mode
      
      ath9k
      
      * remove experimental notice from dynack feature
      
      iwlwifi
      
      * PCI IDs for some new 9000-series cards
      
      * improve antenna usage on connection problems
      
      * new firmware debugging infrastructure
      
      * some more work on 802.11ax
      
      * improve support for multiple RF modules with 22000 devices
      
      cordic
      
      * move cordic macros and defines to a public header file
      
      * convert brcmsmac and b43 to fully use cordic library
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ce01a56b
    • David S. Miller's avatar
      Merge branch 'davinci_emac-read-the-MAC-address-from-nvmem' · 37a0bc39
      David S. Miller authored
      Bartosz Golaszewski says:
      
      ====================
      davinci_emac: read the MAC address from nvmem
      
      This series is part of a bigger series that aims at removing the platform
      data structure from the at24 EEPROM driver[1].
      
      We provide a generalized version of of_get_nvmem_mac_address(), switch the
      only user of the of_ variant to using it, remove the previous
      implementation and use the new routine in the davinci_emac driver.
      
      [1] https://lkml.org/lkml/2018/11/13/884
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      37a0bc39
    • Bartosz Golaszewski's avatar
      net: davinci_emac: use nvmem_get_mac_address() · 18dbfc81
      Bartosz Golaszewski authored
      All DaVinci boards still supported in board files now define nvmem
      cells containing the MAC address. We want to stop using the setup
      callback from at24 so the MAC address for those users will no longer
      be provided over platform data. If we didn't get a valid MAC in pdata,
      try nvmem before resorting to a random MAC.
      Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      18dbfc81
    • Bartosz Golaszewski's avatar
      of: net: kill of_get_nvmem_mac_address() · afa64a72
      Bartosz Golaszewski authored
      We've switched all users to nvmem_get_mac_address(). Remove the now
      dead code.
      Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
      Reviewed-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      afa64a72
    • Bartosz Golaszewski's avatar
      net: cadence: switch to using nvmem_get_mac_address() · cce41b8f
      Bartosz Golaszewski authored
      We now have a generalized helper routine to read the MAC address from
      nvmem which takes struct device as argument. The nvmem subsystem will
      then try device tree first before all other potential providers.
      Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
      Acked-by: default avatarNicolas Ferre <nicolas.ferre@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cce41b8f
    • Bartosz Golaszewski's avatar
      net: ethernet: provide nvmem_get_mac_address() · 0e839df9
      Bartosz Golaszewski authored
      We already have of_get_nvmem_mac_address() but some non-DT systems want
      to read the MAC address from NVMEM too. Implement a generalized routine
      that takes struct device as argument.
      Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0e839df9