1. 12 Feb, 2021 26 commits
    • David S. Miller's avatar
      Merge tag 'mlx5-fixes-2021-02-11' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux · 308daa19
      David S. Miller authored
      mlx5-fixes-2021-02-11
      
      Saeed Mahameed says:
      
      ====================
      mlx5 fixes 2021-02-11
      
      This series introduces some fixes to mlx5 driver.
      Please pull and let me know if there is any problem.
      
      For -stable v5.4
       ('net/mlx5e: E-switch, Fix rate calculation for overflow')i
      
      For -stable v5.10
       ('net/mlx5: Disallow RoCE on multi port slave device')
       ('net/mlx5: Disable devlink reload for multi port slave device')
       ('net/mlx5e: Don't change interrupt moderation params when DIM is enabled')
       ('net/mlx5e: Replace synchronize_rcu with synchronize_net')
       ('net/mlx5e: Enable XDP for Connect-X IPsec capable devices')
       ('net/mlx5e: kTLS, Use refcounts to free kTLS RX priv context')
       ('net/mlx5e: Check tunnel offload is required before setting SWP')
       ('net/mlx5: Fix health error state handling')
       ('net/mlx5: Disable devlink reload for lag devices')
       ('net/mlx5e: CT: manage the lifetime of the ct entry object')
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      308daa19
    • Moshe Shemesh's avatar
      net/mlx5e: Check tunnel offload is required before setting SWP · e1c3940c
      Moshe Shemesh authored
      Check that tunnel offload is required before setting Software Parser
      offsets to get Geneve HW offload. In case of Geneve packet we check HW
      offload support of SWP in mlx5e_tunnel_features_check() and set features
      accordingly, this should be reflected in skb offload requested by the
      kernel and we should add the Software Parser offsets only if requested.
      Otherwise, in case HW doesn't support SWP for Geneve, data path will
      mistakenly try to offload Geneve SKBs with skb->encapsulation set,
      regardless of whether offload was requested or not on this specific SKB.
      
      Fixes: e3cfc7e6 ("net/mlx5e: TX, Add geneve tunnel stateless offload support")
      Signed-off-by: default avatarMoshe Shemesh <moshe@nvidia.com>
      Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      e1c3940c
    • Oz Shlomo's avatar
      net/mlx5e: CT: manage the lifetime of the ct entry object · a2173131
      Oz Shlomo authored
      The ct entry object is accessed by the ct add, del, stats and restore
      methods. In addition, it is referenced from several hash tables.
      
      The lifetime of the ct entry object was not managed which triggered race
      conditions as in the following kasan dump:
      [ 3374.973945] ==================================================================
      [ 3374.988552] BUG: KASAN: use-after-free in memcmp+0x4c/0x98
      [ 3374.999590] Read of size 1 at addr ffff00036129ea55 by task ksoftirqd/1/15
      [ 3375.016415] CPU: 1 PID: 15 Comm: ksoftirqd/1 Tainted: G           O      5.4.31+ #1
      [ 3375.055301] Call trace:
      [ 3375.060214]  dump_backtrace+0x0/0x238
      [ 3375.067580]  show_stack+0x24/0x30
      [ 3375.074244]  dump_stack+0xe0/0x118
      [ 3375.081085]  print_address_description.isra.9+0x74/0x3d0
      [ 3375.091771]  __kasan_report+0x198/0x1e8
      [ 3375.099486]  kasan_report+0xc/0x18
      [ 3375.106324]  __asan_load1+0x60/0x68
      [ 3375.113338]  memcmp+0x4c/0x98
      [ 3375.119409]  mlx5e_tc_ct_restore_flow+0x3a4/0x6f8 [mlx5_core]
      [ 3375.131073]  mlx5e_rep_tc_update_skb+0x1d4/0x2f0 [mlx5_core]
      [ 3375.142553]  mlx5e_handle_rx_cqe_rep+0x198/0x308 [mlx5_core]
      [ 3375.154034]  mlx5e_poll_rx_cq+0x2a0/0x1060 [mlx5_core]
      [ 3375.164459]  mlx5e_napi_poll+0x1d4/0xa78 [mlx5_core]
      [ 3375.174453]  net_rx_action+0x28c/0x7a8
      [ 3375.182004]  __do_softirq+0x1b4/0x5d0
      
      Manage the lifetime of the ct entry object by using synchornization
      mechanisms for concurrent access.
      
      Fixes: ac991b48 ("net/mlx5e: CT: Offload established flows")
      Signed-off-by: default avatarRoi Dayan <roid@nvidia.com>
      Signed-off-by: default avatarOz Shlomo <ozsh@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      a2173131
    • Shay Drory's avatar
      net/mlx5: Disable devlink reload for lag devices · edac23c2
      Shay Drory authored
      Devlink reload can't be allowed on lag devices since reloading one lag
      device will cause traffic on the bond to get stucked.
      Users who wish to reload a lag device, need to remove the device from
      the bond, and only then reload it.
      
      Fixes: 4383cfcc ("net/mlx5: Add devlink reload")
      Signed-off-by: default avatarShay Drory <shayd@nvidia.com>
      Reviewed-by: default avatarMoshe Shemesh <moshe@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      edac23c2
    • Shay Drory's avatar
      net/mlx5: Disallow RoCE on lag device · 7ab91f2b
      Shay Drory authored
      In lag mode, setting roce enabled/disable of lag device have no effect.
      e.g.: bond device (roce/vf_lag) roce status remain unchanged.
      Therefore disable it and add an error message.
      
      Fixes: cc9defcb ("net/mlx5: Handle "enable_roce" devlink param")
      Signed-off-by: default avatarShay Drory <shayd@nvidia.com>
      Reviewed-by: default avatarMoshe Shemesh <moshe@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      7ab91f2b
    • Shay Drory's avatar
      net/mlx5: Disallow RoCE on multi port slave device · c70f8597
      Shay Drory authored
      In dual port mode, setting roce enabled/disable for the slave device
      have no effect. e.g.: the slave device roce status remain unchanged.
      Therefore disable it and add an error message.
      Enable or disable roce of the master device affect both master and slave
      devices.
      
      Fixes: cc9defcb ("net/mlx5: Handle "enable_roce" devlink param")
      Signed-off-by: default avatarShay Drory <shayd@nvidia.com>
      Reviewed-by: default avatarMoshe Shemesh <moshe@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      c70f8597
    • Shay Drory's avatar
      net/mlx5: Disable devlink reload for multi port slave device · d89ddaae
      Shay Drory authored
      Devlink reload can't be allowed on a multi port slave device, because
      reload of slave device doesn't take effect.
      
      The right flow is to disable devlink reload for multi port slave
      device. Hence, disabling it in mlx5_core probing.
      
      Fixes: 4383cfcc ("net/mlx5: Add devlink reload")
      Signed-off-by: default avatarShay Drory <shayd@nvidia.com>
      Reviewed-by: default avatarMoshe Shemesh <moshe@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      d89ddaae
    • Maxim Mikityanskiy's avatar
      net/mlx5e: kTLS, Use refcounts to free kTLS RX priv context · b850bbff
      Maxim Mikityanskiy authored
      wait_for_resync is unreliable - if it timeouts, priv_rx will be freed
      anyway. However, mlx5e_ktls_handle_get_psv_completion will be called
      sooner or later, leading to use-after-free. For example, it can happen
      if a CQ error happened, and ICOSQ stopped, but later on the queues are
      destroyed, and ICOSQ is flushed with mlx5e_free_icosq_descs.
      
      This patch converts the lifecycle of priv_rx to fully refcount-based, so
      that the struct won't be freed before the refcount goes to zero.
      
      Fixes: 0419d8c9 ("net/mlx5e: kTLS, Add kTLS RX resync support")
      Signed-off-by: default avatarMaxim Mikityanskiy <maximmi@mellanox.com>
      Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      b850bbff
    • Maxim Mikityanskiy's avatar
      net/mlx5e: Fix CQ params of ICOSQ and async ICOSQ · ebf79b6b
      Maxim Mikityanskiy authored
      The commit mentioned below has split the parameters of ICOSQ and async
      ICOSQ, but it contained a typo: the CQ parameters were swapped for ICOSQ
      and async ICOSQ. Async ICOSQ is longer than the normal ICOSQ, and the CQ
      size must be the same as the size of the corresponding SQ, but due to
      this bug, the CQ of async ICOSQ was much shorter than async ICOSQ
      itself. It led to overflows of the CQ with such messages in dmesg, in
      particular, when running multiple kTLS-offloaded streams:
      
      mlx5_core 0000:08:00.0: cq_err_event_notifier:529:(pid 9422): CQ error
      on CQN 0x406, syndrome 0x1
      mlx5_core 0000:08:00.0 eth2: mlx5e_cq_error_event: cqn=0x000406
      event=0x04
      
      This commit fixes the issue by using the corresponding parameters for
      ICOSQ and async ICOSQ.
      
      Fixes: c293ac92 ("net/mlx5e: Refactor build channel params")
      Signed-off-by: default avatarMaxim Mikityanskiy <maximmi@mellanox.com>
      Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      ebf79b6b
    • Maxim Mikityanskiy's avatar
      net/mlx5e: Replace synchronize_rcu with synchronize_net · 4d6e6b0c
      Maxim Mikityanskiy authored
      The commit cited below switched from using napi_synchronize to
      synchronize_rcu to have a guarantee that it will finish in finite time.
      However, on average, synchronize_rcu takes more time than
      napi_synchronize. Given that it's called multiple times per channel on
      deactivation, it accumulates to a significant amount, which causes
      timeouts in some applications (for example, when using bonding with
      NetworkManager).
      
      This commit replaces synchronize_rcu with synchronize_net, which is
      faster when called under rtnl_lock, allowing to speed up the described
      flow.
      
      Fixes: 9c25a22d ("net/mlx5e: Use synchronize_rcu to sync with NAPI")
      Signed-off-by: default avatarMaxim Mikityanskiy <maximmi@mellanox.com>
      Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      4d6e6b0c
    • Shay Drory's avatar
      net/mlx5: Fix health error state handling · 51d138c2
      Shay Drory authored
      Currently, when we discover a fatal error, we are queueing a work that
      will wait for a lock in order to enter the device to error state.
      Meanwhile, FW commands are still being processed, and gets timeouts.
      This can block the driver for few minutes before the work will manage
      to get the lock and enter to error state.
      
      Setting the device to error state before queueing health work, in order
      to avoid FW commands being processed while the work is waiting for the
      lock.
      
      Fixes: c1d4d2e9 ("net/mlx5: Avoid calling sleeping function by the health poll thread")
      Signed-off-by: default avatarShay Drory <shayd@nvidia.com>
      Reviewed-by: default avatarMoshe Shemesh <moshe@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      51d138c2
    • Maxim Mikityanskiy's avatar
      net/mlx5e: Change interrupt moderation channel params also when channels are closed · 65ba8594
      Maxim Mikityanskiy authored
      struct mlx5e_params contains fields ({rx,tx}_cq_moderation) that depend
      on two things: whether DIM is enabled and the state of a private flag
      (MLX5E_PFLAG_{RX,TX}_CQE_BASED_MODER). Whenever the DIM state changes,
      mlx5e_reset_{rx,tx}_moderation is called to update the fields, however,
      only if the channels are open. The flow where the channels are closed
      misses the required update of the fields. This commit moves the calls of
      mlx5e_reset_{rx,tx}_moderation, so that they run in both flows.
      
      Fixes: ebeaf084 ("net/mlx5e: Properly set default values when disabling adaptive moderation")
      Signed-off-by: default avatarMaxim Mikityanskiy <maximmi@mellanox.com>
      Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      65ba8594
    • Maxim Mikityanskiy's avatar
      net/mlx5e: Don't change interrupt moderation params when DIM is enabled · 019f93bc
      Maxim Mikityanskiy authored
      When mlx5e_ethtool_set_coalesce doesn't change DIM state
      (enabled/disabled), it calls mlx5e_set_priv_channels_coalesce
      unconditionally, which in turn invokes a firmware command to set
      interrupt moderation parameters. It shouldn't happen while DIM manages
      those parameters dynamically (it might even be happening at the same
      time).
      
      This patch fixes it by splitting mlx5e_set_priv_channels_coalesce into
      two functions (for RX and TX) and calling them only when DIM is disabled
      (for RX and TX respectively).
      
      Fixes: cb3c7fd4 ("net/mlx5e: Support adaptive RX coalescing")
      Signed-off-by: default avatarMaxim Mikityanskiy <maximmi@mellanox.com>
      Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      019f93bc
    • Raed Salem's avatar
      net/mlx5e: Enable XDP for Connect-X IPsec capable devices · e33f9f5f
      Raed Salem authored
      This limitation was inherited by previous Innova (FPGA) IPsec
      implementation, it uses its private set of RQ handlers which
      does not support XDP, for Connect-X this is no longer true.
      
      Fix by keeping this limitation only for Innova IPsec supporting devices,
      as otherwise this limitation effectively wrongly blocks XDP for all
      future Connect-X devices for all flows even if IPsec offload is not
      used.
      
      Fixes: 2d64663c ("net/mlx5: IPsec: Add HW crypto offload support")
      Signed-off-by: default avatarRaed Salem <raeds@nvidia.com>
      Reviewed-by: default avatarAlaa Hleihel <alaa@nvidia.com>
      Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      e33f9f5f
    • Raed Salem's avatar
      net/mlx5e: Enable striding RQ for Connect-X IPsec capable devices · e4484d9d
      Raed Salem authored
      This limitation was inherited by previous Innova (FPGA) IPsec
      implementation, it uses its private set of RQ handlers which does
      not support striding rq, for Connect-X this is no longer true.
      
      Fix by keeping this limitation only for Innova IPsec supporting devices,
      as otherwise this limitation effectively wrongly blocks striding RQs for
      all future Connect-X devices for all flows even if IPsec offload is not
      used.
      
      Fixes: 2d64663c ("net/mlx5: IPsec: Add HW crypto offload support")
      Signed-off-by: default avatarRaed Salem <raeds@nvidia.com>
      Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      e4484d9d
    • Parav Pandit's avatar
      net/mlx5e: E-switch, Fix rate calculation for overflow · 0e22bfb7
      Parav Pandit authored
      rate_bytes_ps is a 64-bit field. It passed as 32-bit field to
      apply_police_params(). Due to this when police rate is higher
      than 4Gbps, 32-bit calculation ignores the carry. This results
      in incorrect rate configurationn the device.
      
      Fix it by performing 64-bit calculation.
      
      Fixes: fcb64c0f ("net/mlx5: E-Switch, add ingress rate support")
      Signed-off-by: default avatarParav Pandit <parav@nvidia.com>
      Reviewed-by: default avatarEli Cohen <elic@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      0e22bfb7
    • David S. Miller's avatar
      Merge branch 'mptcp-Miscellaneous-fixes' · 9c899aa6
      David S. Miller authored
      Mat Martineau says:
      
      ====================
      mptcp: Miscellaneous fixes
      
      Here are some MPTCP fixes for the -net tree, addressing various issues
      we have seen thanks to syzkaller and other testing:
      
      Patch 1 correctly propagates errors at connection time and for TCP
      fallback connections.
      
      Patch 2 sets the expected poll() events on SEND_SHUTDOWN.
      
      Patch 3 fixes a retranmit crash and unneeded retransmissions.
      
      Patch 4 fixes possible uninitialized data on the error path during
      socket creation.
      
      Patch 5 addresses a problem with MPTCP window updates.
      
      Patch 6 fixes a case where MPTCP retransmission can get stuck.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9c899aa6
    • Paolo Abeni's avatar
      mptcp: add a missing retransmission timer scheduling · d09d818e
      Paolo Abeni authored
      Currently we do not schedule the MPTCP retransmission
      timer after pushing the data when such action happens
      in the subflow context.
      
      This may cause hang-up on active-backup scenarios, or
      even when only single subflow msks are involved, if we lost
      some peer's ack.
      
      Fixes: 6e628cd3 ("mptcp: use mptcp release_cb for delayed tasks")
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d09d818e
    • Paolo Abeni's avatar
      mptcp: better msk receive window updates · e3859603
      Paolo Abeni authored
      Move mptcp_cleanup_rbuf() related checks inside the mentioned
      helper and extend them to mirror TCP checks more closely.
      
      Additionally drop the 'rmem_pending' hack, since commit 87952603
      ("mptcp: protect the rx path with the msk socket spinlock") we
      can use instead 'rmem_released'.
      
      Fixes: ea4ca586 ("mptcp: refine MPTCP-level ack scheduling")
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e3859603
    • Paolo Abeni's avatar
      mptcp: init mptcp request socket earlier · d8b59efa
      Paolo Abeni authored
      The mptcp subflow route_req() callback performs the subflow
      req initialization after the route_req() check. If the latter
      fails, mptcp-specific bits of the current request sockets
      are left uninitialized.
      
      The above causes bad things at req socket disposal time, when
      the mptcp resources are cleared.
      
      This change addresses the issue by splitting subflow_init_req()
      into the actual initialization and the mptcp-specific checks.
      The initialization is moved before any possibly failing check.
      Reported-by: default avatarChristoph Paasch <cpaasch@apple.com>
      Fixes: 7ea851d1 ("tcp: merge 'init_req' and 'route_req' functions")
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d8b59efa
    • Paolo Abeni's avatar
      mptcp: fix spurious retransmissions · 64b9cea7
      Paolo Abeni authored
      Syzkaller was able to trigger the following splat again:
      
      WARNING: CPU: 1 PID: 12512 at net/mptcp/protocol.c:761 mptcp_reset_timer+0x12a/0x160 net/mptcp/protocol.c:761
      Modules linked in:
      CPU: 1 PID: 12512 Comm: kworker/1:6 Not tainted 5.10.0-rc6 #52
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
      Workqueue: events mptcp_worker
      RIP: 0010:mptcp_reset_timer+0x12a/0x160 net/mptcp/protocol.c:761
      Code: e8 4b 0c ad ff e8 56 21 88 fe 48 b8 00 00 00 00 00 fc ff df 48 c7 04 03 00 00 00 00 48 83 c4 40 5b 5d 41 5c c3 e8 36 21 88 fe <0f> 0b 41 bc c8 00 00 00 eb 98 e8 e7 b1 af fe e9 30 ff ff ff 48 c7
      RSP: 0018:ffffc900018c7c68 EFLAGS: 00010293
      RAX: ffff888108cb1c80 RBX: 1ffff92000318f8d RCX: ffffffff82ad0307
      RDX: 0000000000000000 RSI: ffffffff82ad036a RDI: 0000000000000007
      RBP: ffff888113e2d000 R08: ffff888108cb1c80 R09: ffffed10227c5ab7
      R10: ffff888113e2d5b7 R11: ffffed10227c5ab6 R12: 0000000000000000
      R13: ffff88801f100000 R14: ffff888113e2d5b0 R15: 0000000000000001
      FS:  0000000000000000(0000) GS:ffff88811b500000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00007fd76a874ef8 CR3: 000000001689c005 CR4: 0000000000170ee0
      Call Trace:
       mptcp_worker+0xaa4/0x1560 net/mptcp/protocol.c:2334
       process_one_work+0x8d3/0x1200 kernel/workqueue.c:2272
       worker_thread+0x9c/0x1090 kernel/workqueue.c:2418
       kthread+0x303/0x410 kernel/kthread.c:292
       ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:296
      
      The mptcp_worker tries to update the MPTCP retransmission timer
      even if such timer is not currently scheduled.
      
      The mptcp_rtx_head() return value is bogus: we can have enqueued
      data not yet transmitted. The above may additionally cause spurious,
      unneeded MPTCP-level retransmissions.
      
      Fix the issue adding an explicit clearing of the rtx queue before
      trying to retransmit and checking for unacked data.
      Additionally drop an unneeded timer stop call and the unused
      mptcp_rtx_tail() helper.
      Reported-by: default avatarChristoph Paasch <cpaasch@apple.com>
      Fixes: 6e628cd3 ("mptcp: use mptcp release_cb for delayed tasks")
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      64b9cea7
    • Paolo Abeni's avatar
      mptcp: fix poll after shutdown · dd913410
      Paolo Abeni authored
      The current mptcp_poll() implementation gives unexpected
      results after shutdown(SEND_SHUTDOWN) and when the msk
      status is TCP_CLOSE.
      
      Set the correct mask.
      
      Fixes: 8edf0864 ("mptcp: rework poll+nospace handling")
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dd913410
    • Paolo Abeni's avatar
      mptcp: deliver ssk errors to msk · 15cc1045
      Paolo Abeni authored
      Currently all errors received on msk subflows are ignored.
      We need to catch at least the errors on connect() and
      on fallback sockets.
      
      Use a custom sk_error_report callback at subflow level,
      and do the real action under the msk socket lock - via
      the usual sock_owned_by_user()/release_callback() schema.
      
      Fixes: 6e628cd3 ("mptcp: use mptcp release_cb for delayed tasks")
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      15cc1045
    • Heiner Kallweit's avatar
      net: phy: consider that suspend2ram may cut off PHY power · 4c0d2e96
      Heiner Kallweit authored
      Claudiu reported that on his system S2R cuts off power to the PHY and
      after resuming certain PHY settings are lost. The PM folks confirmed
      that cutting off power to selected components in S2R is a valid case.
      Therefore resuming from S2R, same as from hibernation, has to assume
      that the PHY has power-on defaults. As a consequence use the restore
      callback also as resume callback.
      In addition make sure that the interrupt configuration is restored.
      Let's do this in phy_init_hw() and ensure that after this call
      actual interrupt configuration is in sync with phydev->interrupts.
      Currently, if interrupt was enabled before hibernation, we would
      resume with interrupt disabled because that's the power-on default.
      
      This fix applies cleanly only after the commit marked as fixed.
      
      I don't have an affected system, therefore change is compile-tested
      only.
      
      [0] https://lore.kernel.org/netdev/1610120754-14331-1-git-send-email-claudiu.beznea@microchip.com/
      
      Fixes: 611d779a ("net: phy: fix MDIO bus PM PHY resuming")
      Reported-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4c0d2e96
    • Ioana Ciornei's avatar
      dpaa2-eth: fix memory leak in XDP_REDIRECT · e12be913
      Ioana Ciornei authored
      If xdp_do_redirect() fails, the calling driver should handle recycling
      or freeing of the page associated with the frame. The dpaa2-eth driver
      didn't do either of them and just incremented a counter.
      Fix this by trying to DMA map back the page and recycle it or, if the
      mapping fails, just free it.
      
      Fixes: d678be1d ("dpaa2-eth: add XDP_REDIRECT support")
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e12be913
    • Tong Zhang's avatar
      enetc: auto select PHYLIB and MDIO_DEVRES · e185ea30
      Tong Zhang authored
      FSL_ENETC_MDIO use symbols from PHYLIB (MDIO_BUS) and MDIO_DEVRES,
      however there are no dependency specified in Kconfig
      
      ERROR: modpost: "__mdiobus_register" [drivers/net/ethernet/freescale/enetc/fsl-enetc-mdio.ko] undefined!
      ERROR: modpost: "mdiobus_unregister" [drivers/net/ethernet/freescale/enetc/fsl-enetc-mdio.ko] undefined!
      ERROR: modpost: "devm_mdiobus_alloc_size" [drivers/net/ethernet/freescale/enetc/fsl-enetc-mdio.ko] undefined!
      
      add depends on MDIO_DEVRES && MDIO_BUS
      Signed-off-by: default avatarTong Zhang <ztong0001@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e185ea30
  2. 11 Feb, 2021 7 commits
  3. 10 Feb, 2021 7 commits
    • wenxu's avatar
      net/sched: cls_flower: Reject invalid ct_state flags rules · 1bcc51ac
      wenxu authored
      Reject the unsupported and invalid ct_state flags of cls flower rules.
      
      Fixes: e0ace68a ("net/sched: cls_flower: Add matching on conntrack info")
      Signed-off-by: default avatarwenxu <wenxu@ucloud.cn>
      Reviewed-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1bcc51ac
    • Linus Torvalds's avatar
      Merge tag 'pm-5.11-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 291009f6
      Linus Torvalds authored
      Pull power management fixes from Rafael Wysocki:
       "Address a performance regression related to scale-invariance on x86
        that may prevent turbo CPU frequencies from being used in certain
        workloads on systems using acpi-cpufreq as the CPU performance scaling
        driver and schedutil as the scaling governor"
      
      * tag 'pm-5.11-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        cpufreq: ACPI: Update arch scale-invariance max perf ratio if CPPC is not there
        cpufreq: ACPI: Extend frequency tables to cover boost frequencies
      291009f6
    • Linus Torvalds's avatar
      Merge tag 'acpi-5.11-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · a3961497
      Linus Torvalds authored
      Pull ACPI fix from Rafael Wysocki:
       "Revert a problematic ACPICA commit that changed the code to attempt to
        update memory regions which may be read-only on some systems (Ard
        Biesheuvel)"
      
      * tag 'acpi-5.11-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        Revert "ACPICA: Interpreter: fix memory leak by using existing buffer"
      a3961497
    • Linus Torvalds's avatar
      Merge tag 'dmaengine-fix2-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine · 708c2e41
      Linus Torvalds authored
      Pull dmaengine fixes from Vinod Koul:
       "Some late fixes for dmaengine:
      
        Core:
         - fix channel device_node deletion
      
        Driver fixes:
         - dw: revert of runtime pm enabling
         - idxd: device state fix, interrupt completion and list corruption
         - ti: resource leak
      
      * tag 'dmaengine-fix2-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine:
        dmaengine dw: Revert "dmaengine: dw: Enable runtime PM"
        dmaengine: idxd: check device state before issue command
        dmaengine: ti: k3-udma: Fix a resource leak in an error handling path
        dmaengine: move channel device_node deletion to driver
        dmaengine: idxd: fix misc interrupt completion
        dmaengine: idxd: Fix list corruption in description completion
      708c2e41
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 6016bf19
      Linus Torvalds authored
      Pull networking fixes from David Miller:
       "Another pile of networing fixes:
      
         1) ath9k build error fix from Arnd Bergmann
      
         2) dma memory leak fix in mediatec driver from Lorenzo Bianconi.
      
         3) bpf int3 kprobe fix from Alexei Starovoitov.
      
         4) bpf stackmap integer overflow fix from Bui Quang Minh.
      
         5) Add usb device ids for Cinterion MV31 to qmi_qwwan driver, from
            Christoph Schemmel.
      
         6) Don't update deleted entry in xt_recent netfilter module, from
            Jazsef Kadlecsik.
      
         7) Use after free in nftables, fix from Pablo Neira Ayuso.
      
         8) Header checksum fix in flowtable from Sven Auhagen.
      
         9) Validate user controlled length in qrtr code, from Sabyrzhan
            Tasbolatov.
      
        10) Fix race in xen/netback, from Juergen Gross,
      
        11) New device ID in cxgb4, from Raju Rangoju.
      
        12) Fix ring locking in rxrpc release call, from David Howells.
      
        13) Don't return LAPB error codes from x25_open(), from Xie He.
      
        14) Missing error returns in gsi_channel_setup() from Alex Elder.
      
        15) Get skb_copy_and_csum_datagram working properly with odd segment
            sizes, from Willem de Bruijn.
      
        16) Missing RFS/RSS table init in enetc driver, from Vladimir Oltean.
      
        17) Do teardown on probe failure in DSA, from Vladimir Oltean.
      
        18) Fix compilation failures of txtimestamp selftest, from Vadim
            Fedorenko.
      
        19) Limit rx per-napi gro queue size to fix latency regression, from
            Eric Dumazet.
      
        20) dpaa_eth xdp fixes from Camelia Groza.
      
        21) Missing txq mode update when switching CBS off, in stmmac driver,
            from Mohammad Athari Bin Ismail.
      
        22) Failover pending logic fix in ibmvnic driver, from Sukadev
            Bhattiprolu.
      
        23) Null deref fix in vmw_vsock, from Norbert Slusarek.
      
        24) Missing verdict update in xdp paths of ena driver, from Shay
            Agroskin.
      
        25) seq_file iteration fix in sctp from Neil Brown.
      
        26) bpf 32-bit src register truncation fix on div/mod, from Daniel
            Borkmann.
      
        27) Fix jmp32 pruning in bpf verifier, from Daniel Borkmann.
      
        28) Fix locking in vsock_shutdown(), from Stefano Garzarella.
      
        29) Various missing index bound checks in hns3 driver, from Yufeng Mo.
      
        30) Flush ports on .phylink_mac_link_down() in dsa felix driver, from
            Vladimir Oltean.
      
        31) Don't mix up stp and mrp port states in bridge layer, from Horatiu
            Vultur.
      
        32) Fix locking during netif_tx_disable(), from Edwin Peer"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (45 commits)
        bpf: Fix 32 bit src register truncation on div/mod
        bpf: Fix verifier jmp32 pruning decision logic
        bpf: Fix verifier jsgt branch analysis on max bound
        vsock: fix locking in vsock_shutdown()
        net: hns3: add a check for index in hclge_get_rss_key()
        net: hns3: add a check for tqp_index in hclge_get_ring_chain_from_mbx()
        net: hns3: add a check for queue_id in hclge_reset_vf_queue()
        net: dsa: felix: implement port flushing on .phylink_mac_link_down
        switchdev: mrp: Remove SWITCHDEV_ATTR_ID_MRP_PORT_STAT
        bridge: mrp: Fix the usage of br_mrp_port_switchdev_set_state
        net: watchdog: hold device global xmit lock during tx disable
        netfilter: nftables: relax check for stateful expressions in set definition
        netfilter: conntrack: skip identical origin tuple in same zone only
        vsock/virtio: update credit only if socket is not closed
        net: fix iteration for sctp transport seq_files
        net: ena: Update XDP verdict upon failure
        net/vmw_vsock: improve locking in vsock_connect_timeout()
        net/vmw_vsock: fix NULL pointer dereference
        ibmvnic: Clear failover_pending if unable to schedule
        net: stmmac: set TxQ mode back to DCB after disabling CBS
        ...
      6016bf19
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 4b16b656
      Linus Torvalds authored
      Merge misc fixes from Andrew Morton:
       "14 patches.
      
        Subsystems affected by this patch series: mm (kasan, mremap, tmpfs,
        selftests, memcg, and slub), MAINTAINERS, squashfs, nilfs2, and
        firmware"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        nilfs2: make splice write available again
        mm, slub: better heuristic for number of cpus when calculating slab order
        Revert "mm: memcontrol: avoid workload stalls when lowering memory.high"
        MAINTAINERS: update Andrey Ryabinin's email address
        selftests/vm: rename file run_vmtests to run_vmtests.sh
        tmpfs: disallow CONFIG_TMPFS_INODE64 on alpha
        tmpfs: disallow CONFIG_TMPFS_INODE64 on s390
        mm/mremap: fix BUILD_BUG_ON() error in get_extent
        firmware_loader: align .builtin_fw to 8
        kasan: fix stack traces dependency for HW_TAGS
        squashfs: add more sanity checks in xattr id lookup
        squashfs: add more sanity checks in inode lookup
        squashfs: add more sanity checks in id lookup
        squashfs: avoid out of bounds writes in decompressors
      4b16b656
    • Joachim Henke's avatar
      nilfs2: make splice write available again · a35d8f01
      Joachim Henke authored
      Since 5.10, splice() or sendfile() to NILFS2 return EINVAL.  This was
      caused by commit 36e2c742 ("fs: don't allow splice read/write
      without explicit ops").
      
      This patch initializes the splice_write field in file_operations, like
      most file systems do, to restore the functionality.
      
      Link: https://lkml.kernel.org/r/1612784101-14353-1-git-send-email-konishi.ryusuke@gmail.comSigned-off-by: default avatarJoachim Henke <joachim.henke@t-systems.com>
      Signed-off-by: default avatarRyusuke Konishi <konishi.ryusuke@gmail.com>
      Tested-by: default avatarRyusuke Konishi <konishi.ryusuke@gmail.com>
      Cc: <stable@vger.kernel.org>	[5.10+]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a35d8f01