1. 02 Sep, 2016 8 commits
    • Maharaja Kennadyrajan's avatar
      ath10k: Added support for extended dbglog module id for 10.4 · afcbc82c
      Maharaja Kennadyrajan authored
      For 10.4 fw versions, dbglog module id has been extended from u32
      to u64, hence this patch fixes the same in the ath10k driver side.
      
      This patch doesn't break the older 10.4 releases. The FW change
      is already present in the older FWs.
      Signed-off-by: default avatarMaharaja Kennadyrajan <c_mkenna@qti.qualcomm.com>
      Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
      afcbc82c
    • Daniel Wagner's avatar
      ath10k: use complete() instead complete_all() · 881ed54e
      Daniel Wagner authored
      There is only one waiter for the completion, therefore there
      is no need to use complete_all(). Let's make that clear by
      using complete() instead of complete_all().
      
      The usage pattern of the completion is:
      
      waiter context                          waker context
      
      scan.started
      ------------
      
      ath10k_start_scan()
        lockdep_assert_held(conf_mutex)
        auth10k_wmi_start_scan()
        wait_for_completion_timeout(scan.started)
      
      					ath10k_wmi_event_scan_start_failed()
      					  complete(scan.started)
      
      					ath10k_wmi_event_scan_started()
      					  complete(scan.started)
      
      scan.completed
      --------------
      
      ath10k_scan_stop()
        lockdep_assert_held(conf_mutex)
        ath10k_wmi_stop_scan()
        wait_for_completion_timeout(scan.completed)
      
      					__ath10k_scan_finish()
      					  complete(scan.completed)
      
      scan.on_channel
      ---------------
      
      ath10k_remain_on_channel()
        mutex_lock(conf_mutex)
        ath10k_start_scan()
        wait_for_completion_timeout(scan.on_channel)
      
      					ath10k_wmi_event_scan_foreign_chan()
      					  complete(scan.on_channel)
      
      offchan_tx_completed
      --------------------
      
      ath10k_offchan_tx_work()
        mutex_lock(conf_mutex)
        reinit_completion(offchan_tx_completed)
        wait_for_completion_timeout(offchan_tx_completed)
      
      					ath10k_report_offchain_tx()
      					  complete(offchan_tx_completed)
      
      install_key_done
      ----------------
      ath10k_install_key()
        lockep_assert_held(conf_mutex)
        reinit_completion(install_key_done)
        wait_for_completion_timeout(install_key_done)
      
      				        ath10k_htt_t2h_msg_handler()
      					  complete(install_key_done)
      
      vdev_setup_done
      ---------------
      
      ath10k_monitor_vdev_start()
        lockdep_assert_held(conf_mutex)
         reinit_completion(vdev_setup_done)
        ath10k_vdev_setup_sync()
          wait_for_completion_timeout(vdev_setup_done)
      
      					ath10k_wmi_event_vdev_start_resp()
      					  complete(vdev_setup_done)
      
      ath10k_monitor_vdev_stop()
        lockdep_assert_held(conf_mutex)
        reinit_completion(vdev_setup_done()
        ath10k_vdev_setup_sync()
          wait_for_completion_timeout(vdev_setup_done)
      
      					ath10k_wmi_event_vdev_stopped()
      					 complete(vdev_setup_done)
      
      thermal.wmi_sync
      ----------------
      ath10k_thermal_show_temp()
        mutex_lock(conf_mutex)
        reinit_completion(thermal.wmi_sync)
        wait_for_completion_timeout(thermal.wmi_sync)
      
      					ath10k_thermal_event_temperature()
      					  complete(thermal.wmi_sync)
      
      bss_survey_done
      ---------------
      ath10k_mac_update_bss_chan_survey
        lockdep_assert_held(conf_mutex)
        reinit_completion(bss_survey_done)
        wait_for_completion_timeout(bss_survey_done)
      
      					ath10k_wmi_event_pdev_bss_chan_info()
      					  complete(bss_survey_done)
      
      All complete() calls happen while the conf_mutex is taken. That means
      at max one waiter is possible.
      Signed-off-by: default avatarDaniel Wagner <daniel.wagner@bmw-carit.de>
      Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
      881ed54e
    • Ashok Raj Nagarajan's avatar
      ath10k: fix sending frame in management path in push txq logic · e4fd726f
      Ashok Raj Nagarajan authored
      In the wake tx queue path, we are not checking if the frame to be sent
      takes management path or not. For eg. QOS null func frame coming here will
      take the management path. Since we are not incrementing the descriptor
      counter (num_pending_mgmt_tx) w.r.t tx management, on tx completion it is
      possible to see negative values.
      
      When the above counter reaches a negative value, we will not be sending a
      probe response out.
      
          if (is_presp &&
      	ar->hw_params.max_probe_resp_desc_thres < htt->num_pending_mgmt_tx)
      
      For IPQ4019, max_probe_resp_desc_thres (u32) is 24 is compared against
      num_pending_mgmt_tx (int) and the above condtions comes true if the counter
      is negative and we drop the probe response.
      
      To avoid this, check on the wake tx queue path as well for the tx path of
      the frame and increment the appropriate counters
      
      Fixes: cac08552 "ath10k: move mgmt descriptor limit handle under mgmt_tx"
      Signed-off-by: default avatarAshok Raj Nagarajan <arnagara@qti.qualcomm.com>
      Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
      e4fd726f
    • Rajkumar Manoharan's avatar
      ath10k: improve wake_tx_queue ops performance · 83e164b7
      Rajkumar Manoharan authored
      txqs_lock is interfering with wake_tx_queue submitting more frames.
      so queues don't get filled in and don't keep firmware/hardware busy
      enough. This change helps to reduce the txqs_lock contention and
      wake_tx_queue() blockage to being possible in txrx_unref().
      
      To reduce turn around time of wake_tx_queue ops and to maintain fairness
      among all txqs, the callback is updated to push first txq alone from
      pending list for every wake_tx_queue call. Remaining txqs will be
      processed later upon tx completion.
      
      Below improvements are observed in push-only mode and validated on
      IPQ4019 platform. With this change, in AP mode ~10Mbps increase is
      observed in downlink (AP -> STA) traffic and approx. 5-10% of CPU
      usage is reduced.
      
      Major improvement is observed in 1-hop Mesh mode topology in 11ACVHT80.
      Compared to Infra mode, CPU overhead is higher in Mesh mode due to path
      lookup and no fast-xmit support. So reducing spin lock contention is
      helping in Mesh.
      
                   TOT       +change
                 --------    --------
      TCP DL     545 Mbps    595 Mbps
      TCP UL     555 Mbps    585 Mbps
      Signed-off-by: default avatarRajkumar Manoharan <rmanohar@qti.qualcomm.com>
      Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
      83e164b7
    • Mohammed Shafi Shajakhan's avatar
      ath10k: suppress warnings when getting wmi WDS peer event id · 03c41cc1
      Mohammed Shafi Shajakhan authored
      'WMI_10_4_WDS_PEER_EVENTID' is not yet handled/implemented for WDS mode,
      as of now suppress the warning message "Unknown eventid: 36903"
      Signed-off-by: default avatarMohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
      Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
      03c41cc1
    • Rajkumar Manoharan's avatar
      ath10k: fix group privacy action frame decryption for qca4019 · 7d42298e
      Rajkumar Manoharan authored
      Recent commit 46f6b060 ("mac80211: Encrypt "Group addressed privacy" action
      frames") encrypts group privacy action frames. But qca99x0 family chipset
      delivers broadcast/multicast management frames as encrypted and it should be
      decrypted by mac80211. Setting RX_FLAG_DECRYPTED stats for those frames is
      breaking mesh connection establishment.
      Signed-off-by: default avatarRajkumar Manoharan <rmanohar@qti.qualcomm.com>
      Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
      7d42298e
    • Maharaja Kennadyrajan's avatar
      ath10k: hide kernel addresses from logs using %pK format specifier · 75b34800
      Maharaja Kennadyrajan authored
      With the %pK format specifier we hide the kernel addresses
      with the help of kptr_restrict sysctl.
      In this patch, %p is changed to %pK in the driver code.
      
      The sysctl is documented in Documentation/sysctl/kernel.txt.
      Signed-off-by: default avatarMaharaja Kennadyrajan <c_mkenna@qti.qualcomm.com>
      Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
      75b34800
    • Tamizh chelvam's avatar
      ath10k: Add WMI_SERVICE_PERIODIC_CHAN_STAT_SUPPORT wmi service · 64ed5771
      Tamizh chelvam authored
      WMI_SERVICE_PERIODIC_CHAN_STAT_SUPPORT service has missed in
      the commit 7e247a9e ("ath10k: add dynamic tx mode switch
      config support for qca4019"). This patch adds the service to
      avoid mismatch between host and target.
      
      Fixes: 7e247a9e ("ath10k: add dynamic tx mode switch config support for qca4019")
      Signed-off-by: default avatarTamizh chelvam <c_traja@qti.qualcomm.com>
      Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
      64ed5771
  2. 31 Aug, 2016 11 commits
  3. 19 Aug, 2016 10 commits
  4. 18 Aug, 2016 2 commits
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 60747ef4
      David S. Miller authored
      Minor overlapping changes for both merge conflicts.
      
      Resolution work done by Stephen Rothwell was used
      as a reference.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      60747ef4
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 184ca823
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Buffers powersave frame test is reversed in cfg80211, fix from Felix
          Fietkau.
      
       2) Remove bogus WARN_ON in openvswitch, from Jarno Rajahalme.
      
       3) Fix some tg3 ethtool logic bugs, and one that would cause no
          interrupts to be generated when rx-coalescing is set to 0.  From
          Satish Baddipadige and Siva Reddy Kallam.
      
       4) QLCNIC mailbox corruption and napi budget handling fix from Manish
          Chopra.
      
       5) Fix fib_trie logic when walking the trie during /proc/net/route
          output than can access a stale node pointer.  From David Forster.
      
       6) Several sctp_diag fixes from Phil Sutter.
      
       7) PAUSE frame handling fixes in mlxsw driver from Ido Schimmel.
      
       8) Checksum fixup fixes in bpf from Daniel Borkmann.
      
       9) Memork leaks in nfnetlink, from Liping Zhang.
      
      10) Use after free in rxrpc, from David Howells.
      
      11) Use after free in new skb_array code of macvtap driver, from Jason
          Wang.
      
      12) Calipso resource leak, from Colin Ian King.
      
      13) mediatek bug fixes (missing stats sync init, etc.) from Sean Wang.
      
      14) Fix bpf non-linear packet write helpers, from Daniel Borkmann.
      
      15) Fix lockdep splats in macsec, from Sabrina Dubroca.
      
      16) hv_netvsc bug fixes from Vitaly Kuznetsov, mostly to do with VF
          handling.
      
      17) Various tc-action bug fixes, from CONG Wang.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (116 commits)
        net_sched: allow flushing tc police actions
        net_sched: unify the init logic for act_police
        net_sched: convert tcf_exts from list to pointer array
        net_sched: move tc offload macros to pkt_cls.h
        net_sched: fix a typo in tc_for_each_action()
        net_sched: remove an unnecessary list_del()
        net_sched: remove the leftover cleanup_a()
        mlxsw: spectrum: Allow packets to be trapped from any PG
        mlxsw: spectrum: Unmap 802.1Q FID before destroying it
        mlxsw: spectrum: Add missing rollbacks in error path
        mlxsw: reg: Fix missing op field fill-up
        mlxsw: spectrum: Trap loop-backed packets
        mlxsw: spectrum: Add missing packet traps
        mlxsw: spectrum: Mark port as active before registering it
        mlxsw: spectrum: Create PVID vPort before registering netdevice
        mlxsw: spectrum: Remove redundant errors from the code
        mlxsw: spectrum: Don't return upon error in removal path
        i40e: check for and deal with non-contiguous TCs
        ixgbe: Re-enable ability to toggle VLAN filtering
        ixgbe: Force VLNCTRL.VFE to be set in all VMDq paths
        ...
      184ca823
  5. 17 Aug, 2016 9 commits
    • David S. Miller's avatar
      Merge branch 'strparser' · 48433419
      David S. Miller authored
      Tom Herbert says:
      
      ====================
      strp: Stream parser for messages
      
      This patch set introduces a utility for parsing application layer
      protocol messages in a TCP stream. This is a generalization of the
      mechanism implemented of Kernel Connection Multiplexor.
      
      This patch set adapts KCM to use the strparser. We expect that kTLS
      can use this mechanism also. RDS would probably be another candidate
      to use a common stream parsing mechanism.
      
      The API includes a context structure, a set of callbacks, utility
      functions, and a data ready function. The callbacks include
      a parse_msg function that is called to perform parsing (e.g.
      BPF parsing in case of KCM), and a rcv_msg function that is called
      when a full message has been completed.
      
      For strparser we specify the return codes from the parser to allow
      the backend to indicate that control of the socket should be
      transferred back to userspace to handle some exceptions in the
      stream: The return values are:
      
            >0 : indicates length of successfully parsed message
             0  : indicates more data must be received to parse the message
             -ESTRPIPE : current message should not be processed by the
                kernel, return control of the socket to userspace which
                can proceed to read the messages itself
             other < 0 : Error is parsing, give control back to userspace
                assuming that synchronization is lost and the stream
                is unrecoverable (application expected to close TCP socket)
      
      There is one issue I haven't been able to fully resolve. If parse_msg
      returns ESTRPIPE (wants control back to userspace) the parser may
      already have consumed some bytes of the message. There is no way to
      put bytes back into the TCP receive queue and tcp_read_sock does not
      allow an easy way to peek messages. In lieu of a better solution, we
      return ENODATA on the socket to indicate that the data stream is
      unrecoverable (application needs to close socket). This condition
      should only happen if an application layer message header is split
      across two skbuffs and parsing just the first skbuff wasn't sufficient
      to determine the that transfer to userspace is needed.
      
      This patch set contains:
      
        - strparser implementation
        - changes to kcm to use strparser
        - strparser.txt documentation
      
      v2:
        - Add copyright notice to C files
        - Remove GPL module license from strparser.c
        - Add report of rxpause
      
      v3:
        - Restore GPL module license
        - Use EXPORT_SYMBOL_GPL
      
      v4:
        - Removed unused function, changed another to be static as suggested
          by davem
        - Rewoked data_ready to be called from upper layer, no longer requires
          taking over socket data_ready callback as suggested by Lance Chao
      
      Tested:
        - Ran a KCM thrash test for 24 hours. No behavioral or performance
          differences observed.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      48433419
    • Tom Herbert's avatar
      strparser: Documentation · adcce4d5
      Tom Herbert authored
      Signed-off-by: default avatarTom Herbert <tom@herbertland.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      adcce4d5
    • Tom Herbert's avatar
      kcm: Use stream parser · 9b73896a
      Tom Herbert authored
      Adapt KCM to use the stream parser. This mostly involves removing
      the RX handling and setting up the strparser using the interface.
      Signed-off-by: default avatarTom Herbert <tom@herbertland.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9b73896a
    • Tom Herbert's avatar
      strparser: Stream parser for messages · 43a0c675
      Tom Herbert authored
      This patch introduces a utility for parsing application layer protocol
      messages in a TCP stream. This is a generalization of the mechanism
      implemented of Kernel Connection Multiplexor.
      
      The API includes a context structure, a set of callbacks, utility
      functions, and a data ready function.
      
      A stream parser instance is defined by a strparse structure that
      is bound to a TCP socket. The function to initialize the structure
      is:
      
      int strp_init(struct strparser *strp, struct sock *csk,
                    struct strp_callbacks *cb);
      
      csk is the TCP socket being bound to and cb are the parser callbacks.
      
      The upper layer calls strp_tcp_data_ready when data is ready on the lower
      socket for strparser to process. This should be called from a data_ready
      callback that is set on the socket:
      
      void strp_tcp_data_ready(struct strparser *strp);
      
      A parser is bound to a TCP socket by setting data_ready function to
      strp_tcp_data_ready so that all receive indications on the socket
      go through the parser. This is assumes that sk_user_data is set to
      the strparser structure.
      
      There are four callbacks.
       - parse_msg is called to parse the message (returns length or error).
       - rcv_msg is called when a complete message has been received
       - read_sock_done is called when data_ready function exits
       - abort_parser is called to abort the parser
      
      The input to parse_msg is an skbuff which contains next message under
      construction. The backend processing of parse_msg will parse the
      application layer protocol headers to determine the length of
      the message in the stream. The possible return values are:
      
         >0 : indicates length of successfully parsed message
         0  : indicates more data must be received to parse the message
         -ESTRPIPE : current message should not be processed by the
            kernel, return control of the socket to userspace which
            can proceed to read the messages itself
         other < 0 : Error is parsing, give control back to userspace
            assuming that synchronzation is lost and the stream
            is unrecoverable (application expected to close TCP socket)
      
      In the case of error return (< 0) strparse will stop the parser
      and report and error to userspace. The application must deal
      with the error. To handle the error the strparser is unbound
      from the TCP socket. If the error indicates that the stream
      TCP socket is at recoverable point (ESTRPIPE) then the application
      can read the TCP socket to process the stream. Once the application
      has dealt with the exceptions in the stream, it may again bind the
      socket to a strparser to continue data operations.
      
      Note that ENODATA may be returned to the application. In this case
      parse_msg returned -ESTRPIPE, however strparser was unable to maintain
      synchronization of the stream (i.e. some of the message in question
      was already read by the parser).
      
      strp_pause and strp_unpause are used to provide flow control. For
      instance, if rcv_msg is called but the upper layer can't immediately
      consume the message it can hold the message and pause strparser.
      Signed-off-by: default avatarTom Herbert <tom@herbertland.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      43a0c675
    • Thierry Reding's avatar
      net: ipconfig: Fix more use after free · d2d371ae
      Thierry Reding authored
      While commit 9c706a49 ("net: ipconfig: fix use after free") avoids
      the use after free, the resulting code still ends up calling both the
      ic_setup_if() and ic_setup_routes() after calling ic_close_devs(), and
      access to the device is still required.
      
      Move the call to ic_close_devs() to the very end of the function.
      Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d2d371ae
    • David S. Miller's avatar
      Merge branch 'tc_action-fixes' · b96c22c0
      David S. Miller authored
      Cong Wang says:
      
      ====================
      net_sched: tc action fixes and updates
      
      This patchset fixes a few regressions caused by the previous
      code refactor and more. Thanks to Jamal for catching them!
      
      Note, patch 3/7 and 4/7 are not strictly necessary for this patchset,
      I just want to carry them together.
      
      ---
      v4: adjust an indention for Jamal
          add two more patches
      
      v3: avoid list for fast path, suggested by Jamal
      
      v2: replace flex_array with regular dynamic array
          keep tcf_action_stats_update() in act_api.h
          fix macro typos found by Amir
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b96c22c0
    • Roman Mashak's avatar
      net_sched: allow flushing tc police actions · b5ac8518
      Roman Mashak authored
      The act_police uses its own code to walk the
      action hashtable, which leads to that we could
      not flush standalone tc police actions, so just
      switch to tcf_generic_walker() like other actions.
      
      (Joint work from Roman and Cong.)
      Signed-off-by: default avatarRoman Mashak <mrv@mojatatu.com>
      Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b5ac8518
    • WANG Cong's avatar
      net_sched: unify the init logic for act_police · 0852e455
      WANG Cong authored
      Jamal reported a crash when we create a police action
      with a specific index, this is because the init logic
      is not correct, we should always create one for this
      case. Just unify the logic with other tc actions.
      
      Fixes: a03e6fe5 ("act_police: fix a crash during removal")
      Reported-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0852e455
    • WANG Cong's avatar
      net_sched: convert tcf_exts from list to pointer array · 22dc13c8
      WANG Cong authored
      As pointed out by Jamal, an action could be shared by
      multiple filters, so we can't use list to chain them
      any more after we get rid of the original tc_action.
      Instead, we could just save pointers to these actions
      in tcf_exts, since they are refcount'ed, so convert
      the list to an array of pointers.
      
      The "ugly" part is the action API still accepts list
      as a parameter, I just introduce a helper function to
      convert the array of pointers to a list, instead of
      relying on the C99 feature to iterate the array.
      
      Fixes: a85a970a ("net_sched: move tc_action into tcf_common")
      Reported-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      22dc13c8