Skip to content
  1. Aug 23, 2021
  2. Aug 22, 2021
  3. Aug 21, 2021
    • Jakub Kicinski's avatar
      Merge tag 'mac80211-next-for-net-next-2021-08-20' of... · 4af14dba
      Jakub Kicinski authored
      
      Merge tag 'mac80211-next-for-net-next-2021-08-20' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
      
      Johannes Berg says:
      
      ====================
      Minor updates:
       * BSS coloring support
       * MEI commands for Intel platforms
       * various fixes/cleanups
      
      * tag 'mac80211-next-for-net-next-2021-08-20' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next:
        cfg80211: fix BSS color notify trace enum confusion
        mac80211: Fix insufficient headroom issue for AMSDU
        mac80211: add support for BSS color change
        nl80211: add support for BSS coloring
        mac80211: Use flex-array for radiotap header bitmap
        mac80211: radiotap: Use BIT() instead of shifts
        mac80211: Remove unnecessary variable and label
        mac80211: include <linux/rbtree.h>
        mac80211: Fix monitor MTU limit so that A-MSDUs get through
        mac80211: remove unnecessary NULL check in ieee80211_register_hw()
        mac80211: Reject zero MAC address in sta_info_insert_check()
        nl80211: vendor-cmd: add Intel vendor commands for iwlmei usage
      ====================
      
      Link: https://lore.kernel.org/r/20210820105329.48674-1-johannes@sipsolutions.net
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      4af14dba
  4. Aug 20, 2021
    • David S. Miller's avatar
      Merge branch 'bridge-vlan' · 0ba218e2
      David S. Miller authored
      
      
      Nikolay Aleksandrov says:
      
      ====================
      net: bridge: mcast: add support for port/vlan router control
      
      This small set adds control over port/vlan mcast router config.
      Initially I had added host vlan entry router control via vlan's global
      options but that is really unnecessary and we can use a single per-vlan
      option to control it both for port/vlan and host/vlan entries. Since
      it's all still in net-next we can convert BRIDGE_VLANDB_GOPTS_MCAST_ROUTER
      to BRIDGE_VLANDB_ENTRY_MCAST_ROUTER and use it for both. That makes much
      more sense and is easier for user-space. Patch 01 prepares the port
      router function to be used with port mcast context instead of port and
      then patch 02 converts the global vlan mcast router option to per-vlan
      mcast router option which directly gives us both host/vlan and port/vlan
      mcast router control without any additional changes.
      
      This way we get the following coherent syntax:
       [ port/vlan mcast router]
       $ bridge vlan set vid 100 dev ens20 mcast_router 2
      
       [ bridge/vlan mcast router ]
       $ bridge vlan set vid 100 dev bridge mcast_router 2
      instead of:
       $ bridge vlan set vid 100 dev bridge mcast_router 1 global
      
      The mcast_router should not be regarded as a global option, it controls
      the port/vlan and bridge/vlan mcast router behaviour.
      
      This is the last set needed for the initial per-vlan mcast support.
      Next patch-sets:
       - iproute2 support
       - selftests
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0ba218e2
    • Nikolay Aleksandrov's avatar
      net: bridge: vlan: convert mcast router global option to per-vlan entry · 2796d846
      Nikolay Aleksandrov authored
      
      
      The per-vlan router option controls the port/vlan and host vlan entries'
      mcast router config. The global option controlled only the host vlan
      config, but that is unnecessary and incosistent as it's not really a
      global vlan option, but rather bridge option to control host router
      config, so convert BRIDGE_VLANDB_GOPTS_MCAST_ROUTER to
      BRIDGE_VLANDB_ENTRY_MCAST_ROUTER which can be used to control both host
      vlan and port vlan mcast router config.
      
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2796d846
    • Nikolay Aleksandrov's avatar
      net: bridge: mcast: br_multicast_set_port_router takes multicast context as argument · a53581d5
      Nikolay Aleksandrov authored
      
      
      Change br_multicast_set_port_router to take port multicast context as
      its first argument so we can later use it to control port/vlan mcast
      router option.
      
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a53581d5
    • Sunil Goutham's avatar
      octeontx2-pf: Add check for non zero mcam flows · a515e5b5
      Sunil Goutham authored
      
      
      This patch ensures that mcam flows are allocated
      before adding or destroying the flows.
      
      Signed-off-by: default avatarSunil Goutham <sgoutham@marvell.com>
      Signed-off-by: default avatarSubbaraya Sundeep <sbhatta@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a515e5b5
    • jing yangyang's avatar
      tools/net: Use bitwise instead of arithmetic operator for flags · fa16ee77
      jing yangyang authored
      
      
      This silences the following coccinelle warning:
      
      "WARNING: sum of probable bitmasks, consider |"
      
      Reported-by: default avatarZeal Robot <zealci@zte.com.cn>
      Signed-off-by: default avatarjing yangyang <jing.yangyang@zte.com.cn>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fa16ee77
    • David S. Miller's avatar
      Merge branch 'ipa-kill-off-ipa_clock_get' · c1125062
      David S. Miller authored
      
      
      Alex Elder says:
      
      ====================
      net: ipa: kill off ipa_clock_get()
      
      This series replaces the remaining uses of ipa_clock_get() with
      calls to pm_runtime_get_sync() instead.  It replaces all calls to
      ipa_clock_put() with calls to pm_runtime_put().
      
      This completes the preparation for enabling automated suspend under
      the control of the power management core code.  The next patch (in
      an upcoming series) enables that.  Then the "ipa_clock" files and
      symbols will switch to using an "ipa_power" naming convention instead.
      
      Additional info
      
      It is possible for pm_runtime_get_sync() to return an error.  There
      are really three cases, identified by return value:
        - 1, meaning power was already active
        - 0, meaning power was not previously active, but is now
        - EACCES, meaning runtime PM is disabled
      One additional case is EINVAL, meaning a previous suspend or resume
      (or idle) call returned an error.  But we have always assumed this
      won't happen (we previously didn't even check for an error).
      
      But because we use pm_runtime_force_suspend() to implement system
      suspend, there's a chance we'd get an EACCES error (the first thing
      that function does is disable runtime suspend).  Individual patches
      explain what happens in that case, but generally we just accept that
      it could be an unlikely problem (occurring only at startup time).
      
      Similarly, pm_runtime_put() could return an error.  There too, we
      ignore EINVAL, assuming the IPA suspend and resume operations won't
      produce an error.  EBUSY and EPERM are not applicable, EAGAIN is not
      expected (and harmless).  We should never get EACCES (runtime
      suspend disabled), because pm_runtime_put() calls match prior
      pm_runtime_get_sync() calls, and a system suspend will not be
      started while a runtime suspend or resume is underway.  In summary,
      the value returned from pm_runtime_put() is not meaningful, so we
      explicitly ignore it.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c1125062
    • Alex Elder's avatar
      net: ipa: kill ipa_clock_get() · c3f115aa
      Alex Elder authored
      
      
      The only remaining user of the ipa_clock_{get,put}() interface is
      ipa_isr_thread().  Replace calls to ipa_clock_get() there calling
      pm_runtime_get_sync() instead.  And call pm_runtime_put() there
      rather than ipa_clock_put().  Warn if we ever get an error.
      
      With that, we can get rid of ipa_clock_get() and ipa_clock_put().
      
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c3f115aa
    • Alex Elder's avatar
      net: ipa: don't use ipa_clock_get() in "ipa_modem.c" · 724c2d74
      Alex Elder authored
      
      
      When we open or close the modem network device we need to ensure the
      hardware is powered.  Replace the callers of ipa_clock_get() found
      in ipa_open() and ipa_stop() with calls to pm_runtime_get_sync().
      If an error is returned, simply return that error to the caller
      (without any error or warning message).  This could conceivably
      occur if the function was called while the system was suspended,
      but that really shouldn't happen.  Replace corresponding calls to
      ipa_clock_put() with pm_runtime_put() also.
      
      If the modem crashes we also need to ensure the hardware is powered
      to recover.  If getting power returns an error there's not much we
      can do, but at least report the error.  (Ideally the remoteproc SSR
      code would ensure the AP was not suspended when it sends the
      notification, but that is not (yet) the case.)
      
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      724c2d74
    • Alex Elder's avatar
      net: ipa: don't use ipa_clock_get() in "ipa_uc.c" · 799c5c24
      Alex Elder authored
      
      
      Replace the ipa_clock_get() call in ipa_uc_clock() when taking the
      "proxy" clock reference for the microcontroller with a call to
      pm_runtime_get_sync().  Replace calls of ipa_clock_put() for the
      microcontroller with pm_runtime_put() calls instead.
      
      There is a chance we get an error when taking the microcontroller
      power reference.  This is an unlikely scenario, where system suspend
      is initiated just before we learn the modem is booting.  For now
      we'll just accept that this could occur, and report it if it does.
      
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      799c5c24
    • Alex Elder's avatar
      net: ipa: don't use ipa_clock_get() in "ipa_smp2p.c" · c43adc75
      Alex Elder authored
      
      
      If the "modem-init" Device Tree property is present for a platform,
      the modem performs early IPA hardware initialization, and signals
      this is complete with an "ipa-setup-ready" SMP2P interrupt.  This
      triggers a call to ipa_setup(), which requires the hardware to be
      powered.
      
      Replace the call to ipa_clock_get() in this case with a call to
      pm_runtime_get_sync().  And replace the corresponding calls to
      ipa_clock_put() with calls to pm_runtime_put() instead.
      
      There is a chance we get an error when taking this power reference.
      This is an unlikely scenario, where system suspend is initiated just
      before the modem signals it has finished initializing the IPA
      hardware.  For now we'll just accept that this could occur, and
      report it if it does.
      
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c43adc75
    • Alex Elder's avatar
      net: ipa: don't use ipa_clock_get() in "ipa_main.c" · 4c6a4da8
      Alex Elder authored
      
      
      We need the hardware to be powered starting at the config stage of
      initialization when the IPA driver probes.  And we need it powered
      when the driver is removed, at least until the deconfig stage has
      completed.
      
      Replace callers of ipa_clock_get() in ipa_probe() and ipa_exit(),
      calling pm_runtime_get_sync() instead.  Replace the corresponding
      callers of ipa_clock_put(), calling pm_runtime_put() instead.
      
      The only error we expect when getting power would occur when the
      system is suspended.  The ->probe and ->remove driver callbacks
      won't be called when suspended, so issue a WARN() call if an error
      is seen getting power.
      
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4c6a4da8
    • Alex Elder's avatar
      net: ipa: fix TX queue race · b8e36e13
      Alex Elder authored
      Jakub Kicinski pointed out a race condition in ipa_start_xmit() in a
      recently-accepted series of patches:
        https://lore.kernel.org/netdev/20210812195035.2816276-1-elder@linaro.org/
      We are stopping the modem TX queue in that function if the power
      state is not active.  We restart the TX queue again once hardware
      resume is complete.
      
        TX path                       Power Management
        -------                       ----------------
        pm_runtime_get(); no power    Start resume
        Stop TX queue                      ...
        pm_runtime_put()              Resume complete
        return NETDEV_TX_BUSY         Start TX queue
      
        pm_runtime_get()
        Power present, transmit
        pm_runtime_put()              (auto-suspend)
      
      The issue is that the power management (resume) activity and the
      network transmit activity can occur concurrently, and there's a
      chance the queue will be stopped *after* it has been started again.
      
        TX path                       Power Management
        -------                       ----------------
                                      Resume underway
        pm_runtime_get(); no power         ...
                                      Resume complete
                                      Start TX queue
        Stop TX queue       <-- No more transmits after this
        pm_runtime_put()
        return NETDEV_TX_BUSY
      
      We address this using a STARTED flag to indicate when the TX queue
      has been started from the resume path, and a spinlock to make the
      flag and queue updates happen atomically.
      
        TX path                       Power Management
        -------                       ----------------
                                      Resume underway
        pm_runtime_get(); no power    Resume complete
                                      start TX queue     \
        If STARTED flag is *not* set:                     > atomic
            Stop TX queue             set STARTED flag   /
        pm_runtime_put()
        return NETDEV_TX_BUSY
      
      A second flag is used to address a different race that involves
      another path requesting power.
      
        TX path            Other path              Power Management
        -------            ----------              ----------------
                           pm_runtime_get_sync()   Resume
                                                   Start TX queue   \ atomic
                                                   Set STARTED flag /
                           (do its thing)
                           pm_runtime_put()
                                                   (auto-suspend)
        pm_runtime_get()                           Mark delayed resume
        STARTED *is* set, so
          do *not* stop TX queue  <-- Queue should be stopped here
        pm_runtime_put()
        return NETDEV_TX_BUSY                      Suspend done, resume
                                                   Resume complete
        pm_runtime_get()
        Stop TX queue
          (STARTED is *not* set)                   Start TX queue   \ atomic
        pm_runtime_put()                           Set STARTED flag /
        return NETDEV_TX_BUSY
      
      So a STOPPED flag is set in the transmit path when it has stopped
      the TX queue, and this pair of operations is also protected by the
      spinlock.  The resume path only restarts the TX queue if the STOPPED
      flag is set.  This case isn't a major problem, but it avoids the
      "non-trivial amount of useless work" done by the networking stack
      when NETDEV_TX_BUSY is returned.
      
      Fixes: 6b51f802
      
       ("net: ipa: ensure hardware has power in ipa_start_xmit()")
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b8e36e13