1. 15 11月, 2019 1 次提交
  2. 25 10月, 2019 1 次提交
  3. 06 9月, 2019 5 次提交
  4. 31 7月, 2019 4 次提交
    • E
      iwlwifi: mvm: fix frame drop from the reordering buffer · ecd09ddc
      Emmanuel Grumbach 提交于
      An earlier patch made sure that the queues are not lagging
      too far behind. This means that iwl_mvm_release_frames
      should not be called with a head_sn too far behind NSSN.
      
      Don't take the risk to change completely the entry
      condition to iwl_mvm_release_frames, but don't update
      the head_sn is the NSSN is more than 2048 packets ahead
      of us. Since this just cannot be right. This means that
      the scenario described here happened. We are queue 0.
      
      	Q:0				Q:1
      	head_sn: 0    -> 2047
      					head_sn: 2048
      
      	Lots of packets arrive:
      	head_sn: 2047 -> 2150
      
      					send NSSN_SYNC notification
      
      	Handle notification
      	from the firmware and
      	do NOT move the head_sn
      	back to 2048
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      ecd09ddc
    • E
      iwlwifi: mvm: add a loose synchronization of the NSSN across Rx queues · 3c514bf8
      Emmanuel Grumbach 提交于
      In order to support MSI-X efficiently, we want to avoid
      communication across Rx queues. Each Rx queue should have
      all the data it needs to process a packet.
      
      The reordering buffer is a challenge in the MSI-X world
      since we can have a single BA session whose packets are
      directed to different queues. This is why each queue has
      its own reordering buffer. The hardware is able to hint
      the driver whether we have a hole or not, which allows
      the driver to know whether it can release a packet or not.
      This indication is called NSSN. Roughly, if the packet's
      SN is lower than the NSSN, we can release the packet to
      the stack. The NSSN is the SN of the newest packet received
      without any holes + 1.
      
      This is working as long as we don't have packets that we
      release because of a timeout. When that happens, we could
      have taken the decision to release a packet after we have
      been waiting for its predecessor for too long. If this
      predecessor comes later, we have to drop it because we
      can't release packets out of order. In that case, the
      hardware will give us an indication that we can we release
      the packet (SN < NSSN), but the packet still needs to be
      dropped.
      This is why we sometimes need to ignore the NSSN and we
      track the head_sn in software.
      Here is a specific example of this:
      
      1) Rx queue 1 got packets: 480, 482, 483
      2) We release 480 to to the stack and wait for 481
      3) NSSN is now 481
      4) The timeout expires
      5) We release 482 and 483, NSSN is still 480
      6) 481 arrives its NSSN is 484.
      
      We need to drop 481 even if 481 < 484. This is why we'll
      update the head_sn to 484 at step 2. The flow now is:
      
      1) Rx queue 1 got packets: 480, 482, 483
      2) We release 480 to to the stack and wait for 481
      3) NSSN is now 481 / head_sn is 481
      4) The timeout expires
      5) We release 482 and 483, NSSN is still 480 but head_sn is 484.
      6) 481 arrives its NSSN is 484, but head_sn is 484 and we drop it.
      
      This code introduces another problem in case all the traffic
      goes well (no hole, no timeout):
      
      Rx queue 1: 0   -> 483   (head_sn = 484)
      Rx queue 2: 501 -> 4095  (head_sn = 0)
      Rx queue 2: 0   -> 480   (head_sn = 481)
      Rx queue 1: 481 but head_sn = 484 and we drop it.
      
      At this point, the SN of queue 1 is far behind: more than
      4040 packets behind. Queue 1 will consider 481 "old"
      because 481 is in [501-64:501] whereas it is a very new
      packet.
      
      In order to fix that, send an Rx notification from time to
      time (twice across the full set of 4096 packets) to make
      sure no Rx queue is lagging too far behind.
      
      What will happen then is:
      
      Rx queue 1: 0    -> 483       (head_sn = 484)
      Rx queue 2: 501  -> 2047      (head_sn = 2048)
      Rx queue 1: Sync nofication   (head_sn = 2048)
      Rx queue 2: 2048 -> 4095      (head_sn = 0)
      Rx queue 1: Sync notification (head_sn = 0)
      Rx queue 2: 1    -> 481       (head_sn = 482)
      Rx queue 1: 481 and head_sn = 0.
      
      In queue 1's data, head_sn is now 0, the packet coming in
      is 481, it'll understand that the new packet is new and it
      won't be dropped.
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      3c514bf8
    • E
      iwlwiif: mvm: refactor iwl_mvm_notify_rx_queue · 521dc6c7
      Emmanuel Grumbach 提交于
      Instead of allocating memory for which we have an upper
      limit, use a small buffer on stack.
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      521dc6c7
    • E
      iwlwifi: mvm: add a new RSS sync notification for NSSN sync · c61b655a
      Emmanuel Grumbach 提交于
      We will soon be using a new notification that will be
      initiated by the driver, sent to the firmware and sent
      back to all the RSS queues by the firmware. This new
      notification will be useful to synchronize the NSSN across
      all the queues.
      
      For now, don't send the notification, just add the code to
      handle it. Later patch will add the code to actually send
      it.
      
      While at it, validate the baid coming from the firmware to
      avoid accessing an array with a bad index in the driver.
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      c61b655a
  5. 22 6月, 2019 1 次提交
  6. 28 4月, 2019 1 次提交
    • L
      iwlwifi: mvm: check for length correctness in iwl_mvm_create_skb() · de1887c0
      Luca Coelho 提交于
      We don't check for the validity of the lengths in the packet received
      from the firmware.  If the MPDU length received in the rx descriptor
      is too short to contain the header length and the crypt length
      together, we may end up trying to copy a negative number of bytes
      (headlen - hdrlen < 0) which will underflow and cause us to try to
      copy a huge amount of data.  This causes oopses such as this one:
      
      BUG: unable to handle kernel paging request at ffff896be2970000
      PGD 5e201067 P4D 5e201067 PUD 5e205067 PMD 16110d063 PTE 8000000162970161
      Oops: 0003 [#1] PREEMPT SMP NOPTI
      CPU: 2 PID: 1824 Comm: irq/134-iwlwifi Not tainted 4.19.33-04308-geea41cf4930f #1
      Hardware name: [...]
      RIP: 0010:memcpy_erms+0x6/0x10
      Code: 90 90 90 90 eb 1e 0f 1f 00 48 89 f8 48 89 d1 48 c1 e9 03 83 e2 07 f3 48 a5 89 d1 f3 a4 c3 66 0f 1f 44 00 00 48 89 f8 48 89 d1 <f3> a4 c3
       0f 1f 80 00 00 00 00 48 89 f8 48 83 fa 20 72 7e 40 38 fe
      RSP: 0018:ffffa4630196fc60 EFLAGS: 00010287
      RAX: ffff896be2924618 RBX: ffff896bc8ecc600 RCX: 00000000fffb4610
      RDX: 00000000fffffff8 RSI: ffff896a835e2a38 RDI: ffff896be2970000
      RBP: ffffa4630196fd30 R08: ffff896bc8ecc600 R09: ffff896a83597000
      R10: ffff896bd6998400 R11: 000000000200407f R12: ffff896a83597050
      R13: 00000000fffffff8 R14: 0000000000000010 R15: ffff896a83597038
      FS:  0000000000000000(0000) GS:ffff896be8280000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: ffff896be2970000 CR3: 000000005dc12002 CR4: 00000000003606e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Call Trace:
       iwl_mvm_rx_mpdu_mq+0xb51/0x121b [iwlmvm]
       iwl_pcie_rx_handle+0x58c/0xa89 [iwlwifi]
       iwl_pcie_irq_rx_msix_handler+0xd9/0x12a [iwlwifi]
       irq_thread_fn+0x24/0x49
       irq_thread+0xb0/0x122
       kthread+0x138/0x140
       ret_from_fork+0x1f/0x40
      
      Fix that by checking the lengths for correctness and trigger a warning
      to show that we have received wrong data.
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      de1887c0
  7. 22 3月, 2019 1 次提交
  8. 14 2月, 2019 3 次提交
  9. 04 2月, 2019 3 次提交
  10. 31 1月, 2019 1 次提交
    • L
      iwlwifi: mvm: fix merge damage in iwl_mvm_rx_mpdu_mq() · 3864be55
      Luca Coelho 提交于
      A call to iwl_mvm_add_rtap_sniffer_config() was missing due to a merge
      damage when I submitted the patch mentioned below.  And this causes
      the following compilation warning:
      
      drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c:195:13: warning: 'iwl_mvm_add_rtap_sniffer_config' defined but not used [-Wunused-function]
       static void iwl_mvm_add_rtap_sniffer_config(struct iwl_mvm *mvm,
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      Fix it by adding the if block that calls this function.
      
      Fixes: 9bf13bee ("iwlwifi: mvm: include configured sniffer AID in radiotap")
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      3864be55
  11. 29 1月, 2019 7 次提交
  12. 20 12月, 2018 1 次提交
  13. 14 12月, 2018 3 次提交
  14. 11 11月, 2018 1 次提交
  15. 06 10月, 2018 7 次提交