1. 27 3月, 2020 1 次提交
  2. 04 2月, 2020 2 次提交
  3. 15 1月, 2020 1 次提交
  4. 24 12月, 2019 1 次提交
  5. 23 12月, 2019 2 次提交
  6. 20 11月, 2019 1 次提交
  7. 15 11月, 2019 1 次提交
  8. 25 10月, 2019 3 次提交
  9. 09 10月, 2019 1 次提交
    • N
      iwlwifi: mvm: fix race in sync rx queue notification · a2113cc4
      Naftali Goldstein 提交于
      Consider the following flow:
       1. Driver starts to sync the rx queues due to a delba.
          mvm->queue_sync_cookie=1.
          This rx-queues-sync is synchronous, so it doesn't increment the
          cookie until all rx queues handle the notification from FW.
       2. During this time, driver starts to sync rx queues due to nssn sync
          required.
          The cookie's value is still 1, but it doesn't matter since this
          rx-queue-sync is non-synchronous so in the notification handler the
          cookie is ignored.
          What _does_ matter is that this flow increments the cookie to 2
          immediately.
          Remember though that the FW won't start servicing this command until
          it's done with the previous one.
       3. FW is still handling the first command, so it sends a notification
          with internal_notif->sync=1, and internal_notif->cookie=0, which
          triggers a WARN_ONCE.
      
      The solution for this race is to only use the mvm->queue_sync_cookie in
      case of a synchronous sync-rx-queues. This way in step 2 the cookie's
      value won't change so we avoid the WARN.
      
      The commit in the "fixes" field is the first commit to introduce
      non-synchronous sending of this command to FW.
      
      Fixes: 3c514bf8 ("iwlwifi: mvm: add a loose synchronization of the NSSN across Rx queues")
      Signed-off-by: NNaftali Goldstein <naftali.goldstein@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      a2113cc4
  10. 06 9月, 2019 14 次提交
  11. 20 8月, 2019 1 次提交
    • I
      iwlwifi: mvm: Allow multicast data frames only when associated · 50f56044
      Ilan Peer 提交于
      The MAC context configuration always allowed multicast data frames
      to pass to the driver for all MAC context types, and in the
      case of station MAC context both when associated and when not
      associated.
      
      One of the outcomes of this configuration is having the FW forward
      encrypted multicast frames to the driver with Rx status indicating
      that the frame was not decrypted (as expected, since no keys were
      configured yet) which in turn results with unnecessary error
      messages.
      
      Change this behavior to allow multicast data frames only when they
      are actually expected, e.g., station MAC context is associated etc.
      Signed-off-by: NIlan Peer <ilan.peer@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      50f56044
  12. 31 7月, 2019 3 次提交
    • J
      iwlwifi: fix locking in delayed GTK setting · 6569e7d3
      Johannes Berg 提交于
      This code clearly never could have worked, since it locks
      while already locked. Add an unlocked __iwl_mvm_mac_set_key()
      variant that doesn't do locking to fix that.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      6569e7d3
    • 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
    • J
      iwlwifi: mvm: disable TX-AMSDU on older NICs · cfb21b11
      Johannes Berg 提交于
      On older NICs, we occasionally see issues with A-MSDU support,
      where the commands in the FIFO get confused and then we see an
      assert EDC because the next command in the FIFO isn't TX.
      
      We've tried to isolate this issue and understand where it comes
      from, but haven't found any errors in building the A-MSDU in
      software.
      
      At least for now, disable A-MSDU support on older hardware so
      that users can use it again without fearing the assert.
      
      This fixes https://bugzilla.kernel.org/show_bug.cgi?id=203315.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      cfb21b11
  13. 26 7月, 2019 1 次提交
  14. 29 6月, 2019 3 次提交
  15. 01 6月, 2019 1 次提交
  16. 28 4月, 2019 1 次提交
    • J
      netlink: make validation more configurable for future strictness · 8cb08174
      Johannes Berg 提交于
      We currently have two levels of strict validation:
      
       1) liberal (default)
           - undefined (type >= max) & NLA_UNSPEC attributes accepted
           - attribute length >= expected accepted
           - garbage at end of message accepted
       2) strict (opt-in)
           - NLA_UNSPEC attributes accepted
           - attribute length >= expected accepted
      
      Split out parsing strictness into four different options:
       * TRAILING     - check that there's no trailing data after parsing
                        attributes (in message or nested)
       * MAXTYPE      - reject attrs > max known type
       * UNSPEC       - reject attributes with NLA_UNSPEC policy entries
       * STRICT_ATTRS - strictly validate attribute size
      
      The default for future things should be *everything*.
      The current *_strict() is a combination of TRAILING and MAXTYPE,
      and is renamed to _deprecated_strict().
      The current regular parsing has none of this, and is renamed to
      *_parse_deprecated().
      
      Additionally it allows us to selectively set one of the new flags
      even on old policies. Notably, the UNSPEC flag could be useful in
      this case, since it can be arranged (by filling in the policy) to
      not be an incompatible userspace ABI change, but would then going
      forward prevent forgetting attribute entries. Similar can apply
      to the POLICY flag.
      
      We end up with the following renames:
       * nla_parse           -> nla_parse_deprecated
       * nla_parse_strict    -> nla_parse_deprecated_strict
       * nlmsg_parse         -> nlmsg_parse_deprecated
       * nlmsg_parse_strict  -> nlmsg_parse_deprecated_strict
       * nla_parse_nested    -> nla_parse_nested_deprecated
       * nla_validate_nested -> nla_validate_nested_deprecated
      
      Using spatch, of course:
          @@
          expression TB, MAX, HEAD, LEN, POL, EXT;
          @@
          -nla_parse(TB, MAX, HEAD, LEN, POL, EXT)
          +nla_parse_deprecated(TB, MAX, HEAD, LEN, POL, EXT)
      
          @@
          expression NLH, HDRLEN, TB, MAX, POL, EXT;
          @@
          -nlmsg_parse(NLH, HDRLEN, TB, MAX, POL, EXT)
          +nlmsg_parse_deprecated(NLH, HDRLEN, TB, MAX, POL, EXT)
      
          @@
          expression NLH, HDRLEN, TB, MAX, POL, EXT;
          @@
          -nlmsg_parse_strict(NLH, HDRLEN, TB, MAX, POL, EXT)
          +nlmsg_parse_deprecated_strict(NLH, HDRLEN, TB, MAX, POL, EXT)
      
          @@
          expression TB, MAX, NLA, POL, EXT;
          @@
          -nla_parse_nested(TB, MAX, NLA, POL, EXT)
          +nla_parse_nested_deprecated(TB, MAX, NLA, POL, EXT)
      
          @@
          expression START, MAX, POL, EXT;
          @@
          -nla_validate_nested(START, MAX, POL, EXT)
          +nla_validate_nested_deprecated(START, MAX, POL, EXT)
      
          @@
          expression NLH, HDRLEN, MAX, POL, EXT;
          @@
          -nlmsg_validate(NLH, HDRLEN, MAX, POL, EXT)
          +nlmsg_validate_deprecated(NLH, HDRLEN, MAX, POL, EXT)
      
      For this patch, don't actually add the strict, non-renamed versions
      yet so that it breaks compile if I get it wrong.
      
      Also, while at it, make nla_validate and nla_parse go down to a
      common __nla_validate_parse() function to avoid code duplication.
      
      Ultimately, this allows us to have very strict validation for every
      new caller of nla_parse()/nlmsg_parse() etc as re-introduced in the
      next patch, while existing things will continue to work as is.
      
      In effect then, this adds fully strict validation for any new command.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8cb08174
  17. 03 4月, 2019 3 次提交