1. 25 11月, 2020 7 次提交
    • L
      ibmvnic: fix NULL pointer dereference in ibmvic_reset_crq · 0e435bef
      Lijun Pan 提交于
      crq->msgs could be NULL if the previous reset did not complete after
      freeing crq->msgs. Check for NULL before dereferencing them.
      
      Snippet of call trace:
      ...
      ibmvnic 30000003 env3 (unregistering): Releasing sub-CRQ
      ibmvnic 30000003 env3 (unregistering): Releasing CRQ
      BUG: Kernel NULL pointer dereference on read at 0x00000000
      Faulting instruction address: 0xc0000000000c1a30
      Oops: Kernel access of bad area, sig: 11 [#1]
      LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA pSeries
      Modules linked in: ibmvnic(E-) rpadlpar_io rpaphp xt_CHECKSUM xt_MASQUERADE xt_conntrack ipt_REJECT nf_reject_ipv4 nft_compat nft_counter nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nf_tables xsk_diag tcp_diag udp_diag tun raw_diag inet_diag unix_diag bridge af_packet_diag netlink_diag stp llc rfkill sunrpc pseries_rng xts vmx_crypto uio_pdrv_genirq uio binfmt_misc ip_tables xfs libcrc32c sd_mod t10_pi sg ibmvscsi ibmveth scsi_transport_srp dm_mirror dm_region_hash dm_log dm_mod [last unloaded: ibmvnic]
      CPU: 20 PID: 8426 Comm: kworker/20:0 Tainted: G            E     5.10.0-rc1+ #12
      Workqueue: events __ibmvnic_reset [ibmvnic]
      NIP:  c0000000000c1a30 LR: c008000001b00c18 CTR: 0000000000000400
      REGS: c00000000d05b7a0 TRAP: 0380   Tainted: G            E      (5.10.0-rc1+)
      MSR:  800000000280b033 <SF,VEC,VSX,EE,FP,ME,IR,DR,RI,LE>  CR: 44002480  XER: 20040000
      CFAR: c0000000000c19ec IRQMASK: 0
      GPR00: 0000000000000400 c00000000d05ba30 c008000001b17c00 0000000000000000
      GPR04: 0000000000000000 0000000000000000 0000000000000000 00000000000001e2
      GPR08: 000000000001f400 ffffffffffffd950 0000000000000000 c008000001b0b280
      GPR12: c0000000000c19c8 c00000001ec72e00 c00000000019a778 c00000002647b440
      GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
      GPR20: 0000000000000006 0000000000000001 0000000000000003 0000000000000002
      GPR24: 0000000000001000 c008000001b0d570 0000000000000005 c00000007ab5d550
      GPR28: c00000007ab5c000 c000000032fcf848 c00000007ab5cc00 c000000032fcf800
      NIP [c0000000000c1a30] memset+0x68/0x104
      LR [c008000001b00c18] ibmvnic_reset_crq+0x70/0x110 [ibmvnic]
      Call Trace:
      [c00000000d05ba30] [0000000000000800] 0x800 (unreliable)
      [c00000000d05bab0] [c008000001b0a930] do_reset.isra.40+0x224/0x634 [ibmvnic]
      [c00000000d05bb80] [c008000001b08574] __ibmvnic_reset+0x17c/0x3c0 [ibmvnic]
      [c00000000d05bc50] [c00000000018d9ac] process_one_work+0x2cc/0x800
      [c00000000d05bd20] [c00000000018df58] worker_thread+0x78/0x520
      [c00000000d05bdb0] [c00000000019a934] kthread+0x1c4/0x1d0
      [c00000000d05be20] [c00000000000d5d0] ret_from_kernel_thread+0x5c/0x6c
      
      Fixes: 032c5e82 ("Driver for IBM System i/p VNIC protocol")
      Signed-off-by: NLijun Pan <ljp@linux.ibm.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      0e435bef
    • L
      ibmvnic: fix NULL pointer dereference in reset_sub_crq_queues · a0faaa27
      Lijun Pan 提交于
      adapter->tx_scrq and adapter->rx_scrq could be NULL if the previous reset
      did not complete after freeing sub crqs. Check for NULL before
      dereferencing them.
      
      Snippet of call trace:
      ibmvnic 30000006 env6: Releasing sub-CRQ
      ibmvnic 30000006 env6: Releasing CRQ
      ...
      ibmvnic 30000006 env6: Got Control IP offload Response
      ibmvnic 30000006 env6: Re-setting tx_scrq[0]
      BUG: Kernel NULL pointer dereference on read at 0x00000000
      Faulting instruction address: 0xc008000003dea7cc
      Oops: Kernel access of bad area, sig: 11 [#1]
      LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA pSeries
      Modules linked in: rpadlpar_io rpaphp xt_CHECKSUM xt_MASQUERADE xt_conntrack ipt_REJECT nf_reject_ipv4 nft_compat nft_counter nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nf_tables xsk_diag tcp_diag udp_diag raw_diag inet_diag unix_diag af_packet_diag netlink_diag tun bridge stp llc rfkill sunrpc pseries_rng xts vmx_crypto uio_pdrv_genirq uio binfmt_misc ip_tables xfs libcrc32c sd_mod t10_pi sg ibmvscsi ibmvnic ibmveth scsi_transport_srp dm_mirror dm_region_hash dm_log dm_mod
      CPU: 80 PID: 1856 Comm: kworker/80:2 Tainted: G        W         5.8.0+ #4
      Workqueue: events __ibmvnic_reset [ibmvnic]
      NIP:  c008000003dea7cc LR: c008000003dea7bc CTR: 0000000000000000
      REGS: c0000007ef7db860 TRAP: 0380   Tainted: G        W          (5.8.0+)
      MSR:  800000000280b033 <SF,VEC,VSX,EE,FP,ME,IR,DR,RI,LE>  CR: 28002422  XER: 0000000d
      CFAR: c000000000bd9520 IRQMASK: 0
      GPR00: c008000003dea7bc c0000007ef7dbaf0 c008000003df7400 c0000007fa26ec00
      GPR04: c0000007fcd0d008 c0000007fcd96350 0000000000000027 c0000007fcd0d010
      GPR08: 0000000000000023 0000000000000000 0000000000000000 0000000000000000
      GPR12: 0000000000002000 c00000001ec18e00 c0000000001982f8 c0000007bad6e840
      GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
      GPR20: 0000000000000000 0000000000000000 0000000000000000 fffffffffffffef7
      GPR24: 0000000000000402 c0000007fa26f3a8 0000000000000003 c00000016f8ec048
      GPR28: 0000000000000000 0000000000000000 0000000000000000 c0000007fa26ec00
      NIP [c008000003dea7cc] ibmvnic_reset_init+0x15c/0x258 [ibmvnic]
      LR [c008000003dea7bc] ibmvnic_reset_init+0x14c/0x258 [ibmvnic]
      Call Trace:
      [c0000007ef7dbaf0] [c008000003dea7bc] ibmvnic_reset_init+0x14c/0x258 [ibmvnic] (unreliable)
      [c0000007ef7dbb80] [c008000003de8860] __ibmvnic_reset+0x408/0x970 [ibmvnic]
      [c0000007ef7dbc50] [c00000000018b7cc] process_one_work+0x2cc/0x800
      [c0000007ef7dbd20] [c00000000018bd78] worker_thread+0x78/0x520
      [c0000007ef7dbdb0] [c0000000001984c4] kthread+0x1d4/0x1e0
      [c0000007ef7dbe20] [c00000000000cea8] ret_from_kernel_thread+0x5c/0x74
      
      Fixes: 57a49436 ("ibmvnic: Reset sub-crqs during driver reset")
      Signed-off-by: NLijun Pan <ljp@linux.ibm.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      a0faaa27
    • S
      net: ena: fix packet's addresses for rx_offset feature · 1396d314
      Shay Agroskin 提交于
      This patch fixes two lines in which the rx_offset received by the device
      wasn't taken into account:
      
      - prefetch function:
      	In our driver the copied data would reside in
      	rx_info->page + rx_headroom + rx_offset
      
      	so the prefetch function is changed accordingly.
      
      - setting page_offset to zero for descriptors > 1:
      	for every descriptor but the first, the rx_offset is zero. Hence
      	the page_offset value should be set to rx_headroom.
      
      	The previous implementation changed the value of rx_info after
      	the descriptor was added to the SKB (essentially providing wrong
      	page offset).
      
      Fixes: 68f236df ("net: ena: add support for the rx offset feature")
      Signed-off-by: NShay Agroskin <shayagr@amazon.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      1396d314
    • S
      net: ena: set initial DMA width to avoid intel iommu issue · 09323b3b
      Shay Agroskin 提交于
      The ENA driver uses the readless mechanism, which uses DMA, to find
      out what the DMA mask is supposed to be.
      
      If DMA is used without setting the dma_mask first, it causes the
      Intel IOMMU driver to think that ENA is a 32-bit device and therefore
      disables IOMMU passthrough permanently.
      
      This patch sets the dma_mask to be ENA_MAX_PHYS_ADDR_SIZE_BITS=48
      before readless initialization in
      ena_device_init()->ena_com_mmio_reg_read_request_init(),
      which is large enough to workaround the intel_iommu issue.
      
      DMA mask is set again to the correct value after it's received from the
      device after readless is initialized.
      
      The patch also changes the driver to use dma_set_mask_and_coherent()
      function instead of the two pci_set_dma_mask() and
      pci_set_consistent_dma_mask() ones. Both methods achieve the same
      effect.
      
      Fixes: 1738cd3e ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
      Signed-off-by: NMike Cui <mikecui@amazon.com>
      Signed-off-by: NArthur Kiyanovski <akiyano@amazon.com>
      Signed-off-by: NShay Agroskin <shayagr@amazon.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      09323b3b
    • S
      net: ena: handle bad request id in ena_netdev · 5b7022cf
      Shay Agroskin 提交于
      After request id is checked in validate_rx_req_id() its value is still
      used in the line
      	rx_ring->free_ids[next_to_clean] =
      					rx_ring->ena_bufs[i].req_id;
      even if it was found to be out-of-bound for the array free_ids.
      
      The patch moves the request id to an earlier stage in the napi routine and
      makes sure its value isn't used if it's found out-of-bounds.
      
      Fixes: 30623e1e ("net: ena: avoid memory access violation by validating req_id properly")
      Signed-off-by: NIdo Segev <idose@amazon.com>
      Signed-off-by: NShay Agroskin <shayagr@amazon.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      5b7022cf
    • E
      dpaa2-eth: Fix compile error due to missing devlink support · 078eb55c
      Ezequiel Garcia 提交于
      The dpaa2 driver depends on devlink, so it should select
      NET_DEVLINK in order to fix compile errors, such as:
      
      drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.o: in function `dpaa2_eth_rx_err':
      dpaa2-eth.c:(.text+0x3cec): undefined reference to `devlink_trap_report'
      drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-devlink.o: in function `dpaa2_eth_dl_info_get':
      dpaa2-eth-devlink.c:(.text+0x160): undefined reference to `devlink_info_driver_name_put'
      
      Fixes: ceeb03ad ("dpaa2-eth: add basic devlink support")
      Signed-off-by: NEzequiel Garcia <ezequiel@collabora.com>
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Link: https://lore.kernel.org/r/20201123163553.1666476-1-ciorneiioana@gmail.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      078eb55c
    • L
      aquantia: Remove the build_skb path · 9bd2702d
      Lincoln Ramsay 提交于
      When performing IPv6 forwarding, there is an expectation that SKBs
      will have some headroom. When forwarding a packet from the aquantia
      driver, this does not always happen, triggering a kernel warning.
      
      aq_ring.c has this code (edited slightly for brevity):
      
      if (buff->is_eop && buff->len <= AQ_CFG_RX_FRAME_MAX - AQ_SKB_ALIGN) {
          skb = build_skb(aq_buf_vaddr(&buff->rxdata), AQ_CFG_RX_FRAME_MAX);
      } else {
          skb = napi_alloc_skb(napi, AQ_CFG_RX_HDR_SIZE);
      
      There is a significant difference between the SKB produced by these
      2 code paths. When napi_alloc_skb creates an SKB, there is a certain
      amount of headroom reserved. However, this is not done in the
      build_skb codepath.
      
      As the hardware buffer that build_skb is built around does not
      handle the presence of the SKB header, this code path is being
      removed and the napi_alloc_skb path will always be used. This code
      path does have to copy the packet header into the SKB, but it adds
      the packet data as a frag.
      
      Fixes: 018423e9 ("net: ethernet: aquantia: Add ring support code")
      Signed-off-by: NLincoln Ramsay <lincoln.ramsay@opengear.com>
      Link: https://lore.kernel.org/r/MWHPR1001MB23184F3EAFA413E0D1910EC9E8FC0@MWHPR1001MB2318.namprd10.prod.outlook.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      9bd2702d
  2. 24 11月, 2020 1 次提交
  3. 22 11月, 2020 7 次提交
    • L
      ibmvnic: skip tx timeout reset while in resetting · 855a631a
      Lijun Pan 提交于
      Sometimes it takes longer than 5 seconds (watchdog timeout) to complete
      failover, migration, and other resets. In stead of scheduling another
      timeout reset, we wait for the current one to complete.
      Suggested-by: NBrian King <brking@linux.vnet.ibm.com>
      Signed-off-by: NLijun Pan <ljp@linux.ibm.com>
      Reviewed-by: NDany Madden <drt@linux.ibm.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      855a631a
    • L
      ibmvnic: notify peers when failover and migration happen · 98025bce
      Lijun Pan 提交于
      Commit 61d3e1d9 ("ibmvnic: Remove netdev notify for failover resets")
      excluded the failover case for notify call because it said
      netdev_notify_peers() can cause network traffic to stall or halt.
      Current testing does not show network traffic stall
      or halt because of the notify call for failover event.
      netdev_notify_peers may be used when a device wants to inform the
      rest of the network about some sort of a reconfiguration
      such as failover or migration.
      
      It is unnecessary to call that in other events like
      FATAL, NON_FATAL, CHANGE_PARAM, and TIMEOUT resets
      since in those scenarios the hardware does not change.
      If the driver must do a hard reset, it is necessary to notify peers.
      
      Fixes: 61d3e1d9 ("ibmvnic: Remove netdev notify for failover resets")
      Suggested-by: NBrian King <brking@linux.vnet.ibm.com>
      Suggested-by: NPradeep Satyanarayana <pradeeps@linux.vnet.ibm.com>
      Signed-off-by: NDany Madden <drt@linux.ibm.com>
      Signed-off-by: NLijun Pan <ljp@linux.ibm.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      98025bce
    • L
      ibmvnic: fix call_netdevice_notifiers in do_reset · 83935975
      Lijun Pan 提交于
      When netdev_notify_peers was substituted in
      commit 986103e7 ("net/ibmvnic: Fix RTNL deadlock during device reset"),
      call_netdevice_notifiers(NETDEV_RESEND_IGMP, dev) was missed.
      Fix it now.
      
      Fixes: 986103e7 ("net/ibmvnic: Fix RTNL deadlock during device reset")
      Signed-off-by: NLijun Pan <ljp@linux.ibm.com>
      Reviewed-by: NDany Madden <drt@linux.ibm.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      83935975
    • J
      tun: honor IOCB_NOWAIT flag · 5aac0390
      Jens Axboe 提交于
      tun only checks the file O_NONBLOCK flag, but it should also be checking
      the iocb IOCB_NOWAIT flag. Any fops using ->read/write_iter() should check
      both, otherwise it breaks users that correctly expect O_NONBLOCK semantics
      if IOCB_NOWAIT is set.
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      Link: https://lore.kernel.org/r/e9451860-96cc-c7c7-47b8-fe42cadd5f4c@kernel.dkSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      5aac0390
    • Y
      usbnet: ipheth: fix connectivity with iOS 14 · f33d9e2b
      Yves-Alexis Perez 提交于
      Starting with iOS 14 released in September 2020, connectivity using the
      personal hotspot USB tethering function of iOS devices is broken.
      
      Communication between the host and the device (for example ICMP traffic
      or DNS resolution using the DNS service running in the device itself)
      works fine, but communication to endpoints further away doesn't work.
      
      Investigation on the matter shows that no UDP and ICMP traffic from the
      tethered host is reaching the Internet at all. For TCP traffic there are
      exchanges between tethered host and server but packets are modified in
      transit leading to impossible communication.
      
      After some trials Matti Vuorela discovered that reducing the URB buffer
      size by two bytes restored the previous behavior. While a better
      solution might exist to fix the issue, since the protocol is not
      publicly documented and considering the small size of the fix, let's do
      that.
      Tested-by: NMatti Vuorela <matti.vuorela@bitfactor.fi>
      Signed-off-by: NYves-Alexis Perez <corsac@corsac.net>
      Link: https://lore.kernel.org/linux-usb/CAAn0qaXmysJ9vx3ZEMkViv_B19ju-_ExN8Yn_uSefxpjS6g4Lw@mail.gmail.com/
      Link: https://github.com/libimobiledevice/libimobiledevice/issues/1038
      Link: https://lore.kernel.org/r/20201119172439.94988-1-corsac@corsac.netSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      f33d9e2b
    • T
      cxgb4: Fix build failure when CONFIG_TLS=m · 659fbdcf
      Tom Seewald 提交于
      After commit 9d2e5e9e ("cxgb4/ch_ktls: decrypted bit is not enough")
      whenever CONFIG_TLS=m and CONFIG_CHELSIO_T4=y, the following build
      failure occurs:
      
      ld: drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.o: in function
      `cxgb_select_queue':
      cxgb4_main.c:(.text+0x2dac): undefined reference to `tls_validate_xmit_skb'
      
      Fix this by ensuring that if TLS is set to be a module, CHELSIO_T4 will
      also be compiled as a module. As otherwise the cxgb4 driver will not be
      able to access TLS' symbols.
      
      Fixes: 9d2e5e9e ("cxgb4/ch_ktls: decrypted bit is not enough")
      Signed-off-by: NTom Seewald <tseewald@gmail.com>
      Link: https://lore.kernel.org/r/20201120192528.615-1-tseewald@gmail.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      659fbdcf
    • J
      bonding: wait for sysfs kobject destruction before freeing struct slave · b9ad3e9f
      Jamie Iles 提交于
      syzkaller found that with CONFIG_DEBUG_KOBJECT_RELEASE=y, releasing a
      struct slave device could result in the following splat:
      
        kobject: 'bonding_slave' (00000000cecdd4fe): kobject_release, parent 0000000074ceb2b2 (delayed 1000)
        bond0 (unregistering): (slave bond_slave_1): Releasing backup interface
        ------------[ cut here ]------------
        ODEBUG: free active (active state 0) object type: timer_list hint: workqueue_select_cpu_near kernel/workqueue.c:1549 [inline]
        ODEBUG: free active (active state 0) object type: timer_list hint: delayed_work_timer_fn+0x0/0x98 kernel/workqueue.c:1600
        WARNING: CPU: 1 PID: 842 at lib/debugobjects.c:485 debug_print_object+0x180/0x240 lib/debugobjects.c:485
        Kernel panic - not syncing: panic_on_warn set ...
        CPU: 1 PID: 842 Comm: kworker/u4:4 Tainted: G S                5.9.0-rc8+ #96
        Hardware name: linux,dummy-virt (DT)
        Workqueue: netns cleanup_net
        Call trace:
         dump_backtrace+0x0/0x4d8 include/linux/bitmap.h:239
         show_stack+0x34/0x48 arch/arm64/kernel/traps.c:142
         __dump_stack lib/dump_stack.c:77 [inline]
         dump_stack+0x174/0x1f8 lib/dump_stack.c:118
         panic+0x360/0x7a0 kernel/panic.c:231
         __warn+0x244/0x2ec kernel/panic.c:600
         report_bug+0x240/0x398 lib/bug.c:198
         bug_handler+0x50/0xc0 arch/arm64/kernel/traps.c:974
         call_break_hook+0x160/0x1d8 arch/arm64/kernel/debug-monitors.c:322
         brk_handler+0x30/0xc0 arch/arm64/kernel/debug-monitors.c:329
         do_debug_exception+0x184/0x340 arch/arm64/mm/fault.c:864
         el1_dbg+0x48/0xb0 arch/arm64/kernel/entry-common.c:65
         el1_sync_handler+0x170/0x1c8 arch/arm64/kernel/entry-common.c:93
         el1_sync+0x80/0x100 arch/arm64/kernel/entry.S:594
         debug_print_object+0x180/0x240 lib/debugobjects.c:485
         __debug_check_no_obj_freed lib/debugobjects.c:967 [inline]
         debug_check_no_obj_freed+0x200/0x430 lib/debugobjects.c:998
         slab_free_hook mm/slub.c:1536 [inline]
         slab_free_freelist_hook+0x190/0x210 mm/slub.c:1577
         slab_free mm/slub.c:3138 [inline]
         kfree+0x13c/0x460 mm/slub.c:4119
         bond_free_slave+0x8c/0xf8 drivers/net/bonding/bond_main.c:1492
         __bond_release_one+0xe0c/0xec8 drivers/net/bonding/bond_main.c:2190
         bond_slave_netdev_event drivers/net/bonding/bond_main.c:3309 [inline]
         bond_netdev_event+0x8f0/0xa70 drivers/net/bonding/bond_main.c:3420
         notifier_call_chain+0xf0/0x200 kernel/notifier.c:83
         __raw_notifier_call_chain kernel/notifier.c:361 [inline]
         raw_notifier_call_chain+0x44/0x58 kernel/notifier.c:368
         call_netdevice_notifiers_info+0xbc/0x150 net/core/dev.c:2033
         call_netdevice_notifiers_extack net/core/dev.c:2045 [inline]
         call_netdevice_notifiers net/core/dev.c:2059 [inline]
         rollback_registered_many+0x6a4/0xec0 net/core/dev.c:9347
         unregister_netdevice_many.part.0+0x2c/0x1c0 net/core/dev.c:10509
         unregister_netdevice_many net/core/dev.c:10508 [inline]
         default_device_exit_batch+0x294/0x338 net/core/dev.c:10992
         ops_exit_list.isra.0+0xec/0x150 net/core/net_namespace.c:189
         cleanup_net+0x44c/0x888 net/core/net_namespace.c:603
         process_one_work+0x96c/0x18c0 kernel/workqueue.c:2269
         worker_thread+0x3f0/0xc30 kernel/workqueue.c:2415
         kthread+0x390/0x498 kernel/kthread.c:292
         ret_from_fork+0x10/0x18 arch/arm64/kernel/entry.S:925
      
      This is a potential use-after-free if the sysfs nodes are being accessed
      whilst removing the struct slave, so wait for the object destruction to
      complete before freeing the struct slave itself.
      
      Fixes: 07699f9a ("bonding: add sysfs /slave dir for bond slave devices.")
      Fixes: a068aab4 ("bonding: Fix reference count leak in bond_sysfs_slave_add.")
      Cc: Qiushi Wu <wu000273@umn.edu>
      Cc: Jay Vosburgh <j.vosburgh@gmail.com>
      Cc: Veaceslav Falico <vfalico@gmail.com>
      Cc: Andy Gospodarek <andy@greyhouse.net>
      Signed-off-by: NJamie Iles <jamie@nuviainc.com>
      Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Link: https://lore.kernel.org/r/20201120142827.879226-1-jamie@nuviainc.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      b9ad3e9f
  4. 21 11月, 2020 3 次提交
  5. 20 11月, 2020 2 次提交
  6. 19 11月, 2020 7 次提交
  7. 18 11月, 2020 13 次提交
    • J
      can: m_can: process interrupt only when not runtime suspended · a1f63446
      Jarkko Nikula 提交于
      Avoid processing bogus interrupt statuses when the HW is runtime suspended and
      the M_CAN_IR register read may get all bits 1's. Handler can be called if the
      interrupt request is shared with other peripherals or at the end of free_irq().
      
      Therefore check the runtime suspended status before processing.
      
      Fixes: cdf8259d ("can: m_can: Add PM Support")
      Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com>
      Link: https://lore.kernel.org/r/20200915134715.696303-1-jarkko.nikula@linux.intel.comSigned-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      a1f63446
    • M
      can: flexcan: flexcan_chip_start(): fix erroneous flexcan_transceiver_enable()... · cd9f13c5
      Marc Kleine-Budde 提交于
      can: flexcan: flexcan_chip_start(): fix erroneous flexcan_transceiver_enable() during bus-off recovery
      
      If the CAN controller goes into bus off, the do_set_mode() callback with
      CAN_MODE_START can be used to recover the controller, which then calls
      flexcan_chip_start(). If configured, this is done automatically by the
      framework or manually by the user.
      
      In flexcan_chip_start() there is an explicit call to
      flexcan_transceiver_enable(), which does a regulator_enable() on the
      transceiver regulator. This results in a net usage counter increase, as there
      is no corresponding flexcan_transceiver_disable() in the bus off code path.
      This further leads to the transceiver stuck enabled, even if the CAN interface
      is shut down.
      
      To fix this problem the
      flexcan_transceiver_enable()/flexcan_transceiver_disable() are moved out of
      flexcan_chip_start()/flexcan_chip_stop() into flexcan_open()/flexcan_close().
      
      Fixes: e955cead ("CAN: Add Flexcan CAN controller driver")
      Link: https://lore.kernel.org/r/20201118150148.2664024-1-mkl@pengutronix.deSigned-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      cd9f13c5
    • J
      can: kvaser_usb: kvaser_usb_hydra: Fix KCAN bittiming limits · d003868d
      Jimmy Assarsson 提交于
      Use correct bittiming limits for the KCAN CAN controller.
      
      Fixes: aec5fb22 ("can: kvaser_usb: Add support for Kvaser USB hydra family")
      Signed-off-by: NJimmy Assarsson <extja@kvaser.com>
      Link: https://lore.kernel.org/r/20201115163027.16851-2-jimmyassarsson@gmail.comSigned-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      d003868d
    • J
      can: kvaser_pciefd: Fix KCAN bittiming limits · 470e14c0
      Jimmy Assarsson 提交于
      Use correct bittiming limits for the KCAN CAN controller.
      
      Fixes: 26ad340e ("can: kvaser_pciefd: Add driver for Kvaser PCIEcan devices")
      Signed-off-by: NJimmy Assarsson <extja@kvaser.com>
      Link: https://lore.kernel.org/r/20201115163027.16851-1-jimmyassarsson@gmail.comSigned-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      470e14c0
    • D
      qed: fix ILT configuration of SRC block · 93be5261
      Dmitry Bogdanov 提交于
      The code refactoring of ILT configuration was not complete, the old
      unused variables were used for the SRC block. That could lead to the memory
      corruption by HW when rx filters are configured.
      This patch completes that refactoring.
      
      Fixes: 8a52bbab (qed: Debug feature: ilt and mdump)
      Signed-off-by: NIgor Russkikh <irusskikh@marvell.com>
      Signed-off-by: NAriel Elior <aelior@marvell.com>
      Signed-off-by: NDmitry Bogdanov <dbogdanov@marvell.com>
      Link: https://lore.kernel.org/r/20201116132944.2055-1-dbogdanov@marvell.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      93be5261
    • T
      netdevsim: set .owner to THIS_MODULE · a5bbcbf2
      Taehee Yoo 提交于
      If THIS_MODULE is not set, the module would be removed while debugfs is
      being used.
      It eventually makes kernel panic.
      
      Fixes: 82c93a87 ("netdevsim: implement couple of testing devlink health reporters")
      Fixes: 424be63a ("netdevsim: add UDP tunnel port offload support")
      Fixes: 4418f862 ("netdevsim: implement support for devlink region and snapshots")
      Fixes: d3cbb907 ("netdevsim: add ACL trap reporting cookie as a metadata")
      Signed-off-by: NTaehee Yoo <ap420073@gmail.com>
      Link: https://lore.kernel.org/r/20201115103041.30701-1-ap420073@gmail.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      a5bbcbf2
    • A
      enetc: Workaround for MDIO register access issue · fd5736bf
      Alex Marginean 提交于
      Due to a hardware issue, an access to MDIO registers
      that is concurrent with other ENETC register accesses
      may lead to the MDIO access being dropped or corrupted.
      The workaround introduces locking for all register accesses
      to the ENETC register space.  To reduce performance impact,
      a readers-writers locking scheme has been implemented.
      The writer in this case is the MDIO access code (irrelevant
      whether that MDIO access is a register read or write), and
      the reader is any access code to non-MDIO ENETC registers.
      Also, the datapath functions acquire the read lock fewer times
      and use _hot accessors.  All the rest of the code uses the _wa
      accessors which lock every register access.
      The commit introducing MDIO support is -
      commit ebfcb23d ("enetc: Add ENETC PF level external MDIO support")
      but due to subsequent refactoring this patch is applicable on
      top of a later commit.
      
      Fixes: 6517798d ("enetc: Make MDIO accessors more generic and export to include/linux/fsl")
      Signed-off-by: NAlex Marginean <alexandru.marginean@nxp.com>
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@nxp.com>
      Link: https://lore.kernel.org/r/20201112182608.26177-1-claudiu.manoil@nxp.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      fd5736bf
    • W
      net/mlx5: fix error return code in mlx5e_tc_nic_init() · 68ec32da
      Wang Hai 提交于
      Fix to return a negative error code from the error handling
      case instead of 0, as done elsewhere in this function.
      
      Fixes: aedd133d ("net/mlx5e: Support CT offload for tc nic flows")
      Reported-by: NHulk Robot <hulkci@huawei.com>
      Signed-off-by: NWang Hai <wanghai38@huawei.com>
      Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
      68ec32da
    • E
      net/mlx5: E-Switch, Fail mlx5_esw_modify_vport_rate if qos disabled · 5b8631c7
      Eli Cohen 提交于
      Avoid calling mlx5_esw_modify_vport_rate() if qos is not enabled and
      avoid unnecessary syndrome messages from firmware.
      
      Fixes: fcb64c0f ("net/mlx5: E-Switch, add ingress rate support")
      Signed-off-by: NEli Cohen <elic@nvidia.com>
      Reviewed-by: NRoi Dayan <roid@nvidia.com>
      Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
      5b8631c7
    • V
      net/mlx5: Disable QoS when min_rates on all VFs are zero · 470b7475
      Vladyslav Tarasiuk 提交于
      Currently when QoS is enabled for VF and any min_rate is configured,
      the driver sets bw_share value to at least 1 and doesn’t allow to set
      it to 0 to make minimal rate unlimited. It means there is always a
      minimal rate configured for every VF, even if user tries to remove it.
      
      In order to make QoS disable possible, check whether all vports have
      configured min_rate = 0. If this is true, set their bw_share to 0 to
      disable min_rate limitations.
      
      Fixes: c9497c98 ("net/mlx5: Add support for setting VF min rate")
      Signed-off-by: NVladyslav Tarasiuk <vladyslavt@nvidia.com>
      Reviewed-by: NMoshe Shemesh <moshe@nvidia.com>
      Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
      470b7475
    • V
      net/mlx5: Clear bw_share upon VF disable · 1ce5fc72
      Vladyslav Tarasiuk 提交于
      Currently, if user disables VFs with some min and max rates configured,
      they are cleared. But QoS data is not cleared and restored upon next VF
      enable placing limits on minimal rate for given VF, when user expects
      none.
      
      To match cleared vport->info struct with QoS-related min and max rates
      upon VF disable, clear vport->qos struct too.
      
      Fixes: 556b9d16 ("net/mlx5: Clear VF's configuration on disabling SRIOV")
      Signed-off-by: NVladyslav Tarasiuk <vladyslavt@nvidia.com>
      Reviewed-by: NMoshe Shemesh <moshe@nvidia.com>
      Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
      1ce5fc72
    • M
      net/mlx5: Add handling of port type in rule deletion · 8cbcc5ef
      Michael Guralnik 提交于
      Handle destruction of rules with port destination type to enable
      full destruction of flow.
      
      Without this handling of TX rules the deletion of these rules fails.
      Dmesg of flow destruction failure:
      
      [  203.714146] mlx5_core 0000:00:0b.0: mlx5_cmd_check:753:(pid 342): SET_FLOW_TABLE_ENTRY(0x936) op_mod(0x0) failed, status bad parameter(0x3), syndrome (0x144b7a)
      [  210.547387] ------------[ cut here ]------------
      [  210.548663] refcount_t: decrement hit 0; leaking memory.
      [  210.550651] WARNING: CPU: 4 PID: 342 at lib/refcount.c:31 refcount_warn_saturate+0x5c/0x110
      [  210.550654] Modules linked in: mlx5_ib mlx5_core ib_ipoib rdma_ucm rdma_cm iw_cm ib_cm ib_umad ib_uverbs ib_core
      [  210.550675] CPU: 4 PID: 342 Comm: test Not tainted 5.8.0-rc2+ #116
      [  210.550678] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014
      [  210.550680] RIP: 0010:refcount_warn_saturate+0x5c/0x110
      [  210.550685] Code: c6 d1 1b 01 00 0f 84 ad 00 00 00 5b 5d c3 80 3d b5 d1 1b 01 00 75 f4 48 c7 c7 20 d1 15 82 c6 05 a5 d1 1b 01 01 e8 a7 eb af ff <0f> 0b eb dd 80 3d 99 d1 1b 01 00 75 d4 48 c7 c7 c0 cf 15 82 c6 05
      [  210.550687] RSP: 0018:ffff8881642e77e8 EFLAGS: 00010282
      [  210.550691] RAX: 0000000000000000 RBX: 0000000000000004 RCX: 0000000000000000
      [  210.550694] RDX: 0000000000000027 RSI: 0000000000000004 RDI: ffffed102c85ceef
      [  210.550696] RBP: ffff888161720428 R08: ffffffff8124c10e R09: ffffed103243beae
      [  210.550698] R10: ffff8881921df56b R11: ffffed103243bead R12: ffff8881841b4180
      [  210.550701] R13: ffff888161720428 R14: ffff8881616d0000 R15: ffff888161720380
      [  210.550704] FS:  00007fc27f025740(0000) GS:ffff888192000000(0000) knlGS:0000000000000000
      [  210.550706] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  210.550708] CR2: 0000557e4b41a6a0 CR3: 0000000002415004 CR4: 0000000000360ea0
      [  210.550711] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [  210.550713] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [  210.550715] Call Trace:
      [  210.550717]  mlx5_del_flow_rules+0x484/0x490 [mlx5_core]
      [  210.550720]  ? mlx5_cmd_set_fte+0xa80/0xa80 [mlx5_core]
      [  210.550722]  mlx5_ib_destroy_flow+0x17f/0x280 [mlx5_ib]
      [  210.550724]  uverbs_free_flow+0x4c/0x90 [ib_uverbs]
      [  210.550726]  destroy_hw_idr_uobject+0x41/0xb0 [ib_uverbs]
      [  210.550728]  uverbs_destroy_uobject+0xaa/0x390 [ib_uverbs]
      [  210.550731]  __uverbs_cleanup_ufile+0x129/0x1b0 [ib_uverbs]
      [  210.550733]  ? uverbs_destroy_uobject+0x390/0x390 [ib_uverbs]
      [  210.550735]  uverbs_destroy_ufile_hw+0x78/0x190 [ib_uverbs]
      [  210.550737]  ib_uverbs_close+0x36/0x140 [ib_uverbs]
      [  210.550739]  __fput+0x181/0x380
      [  210.550741]  task_work_run+0x88/0xd0
      [  210.550743]  do_exit+0x5f6/0x13b0
      [  210.550745]  ? sched_clock_cpu+0x30/0x140
      [  210.550747]  ? is_current_pgrp_orphaned+0x70/0x70
      [  210.550750]  ? lock_downgrade+0x360/0x360
      [  210.550752]  ? mark_held_locks+0x1d/0x90
      [  210.550754]  do_group_exit+0x8a/0x140
      [  210.550756]  get_signal+0x20a/0xf50
      [  210.550758]  do_signal+0x8c/0xbe0
      [  210.550760]  ? hrtimer_nanosleep+0x1d8/0x200
      [  210.550762]  ? nanosleep_copyout+0x50/0x50
      [  210.550764]  ? restore_sigcontext+0x320/0x320
      [  210.550766]  ? __hrtimer_init+0xf0/0xf0
      [  210.550768]  ? timespec64_add_safe+0x150/0x150
      [  210.550770]  ? mark_held_locks+0x1d/0x90
      [  210.550772]  ? lockdep_hardirqs_on_prepare+0x14c/0x240
      [  210.550774]  __prepare_exit_to_usermode+0x119/0x170
      [  210.550776]  do_syscall_64+0x65/0x300
      [  210.550778]  ? trace_hardirqs_off+0x10/0x120
      [  210.550781]  ? mark_held_locks+0x1d/0x90
      [  210.550783]  ? asm_sysvec_apic_timer_interrupt+0xa/0x20
      [  210.550785]  ? lockdep_hardirqs_on+0x112/0x190
      [  210.550787]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      [  210.550789] RIP: 0033:0x7fc27f1cd157
      [  210.550791] Code: Bad RIP value.
      [  210.550793] RSP: 002b:00007ffd4db27ea8 EFLAGS: 00000246 ORIG_RAX: 0000000000000023
      [  210.550798] RAX: fffffffffffffdfc RBX: ffffffffffffff80 RCX: 00007fc27f1cd157
      [  210.550800] RDX: 00007fc27f025740 RSI: 00007ffd4db27eb0 RDI: 00007ffd4db27eb0
      [  210.550803] RBP: 0000000000000016 R08: 0000000000000000 R09: 000000000000000e
      [  210.550805] R10: 00007ffd4db27dc7 R11: 0000000000000246 R12: 0000000000400c00
      [  210.550808] R13: 00007ffd4db285f0 R14: 0000000000000000 R15: 0000000000000000
      [  210.550809] irq event stamp: 49399
      [  210.550812] hardirqs last  enabled at (49399): [<ffffffff81172d36>] console_unlock+0x556/0x6f0
      [  210.550815] hardirqs last disabled at (49398): [<ffffffff81172897>] console_unlock+0xb7/0x6f0
      [  210.550818] softirqs last  enabled at (48706): [<ffffffff81e0037b>] __do_softirq+0x37b/0x60c
      [  210.550820] softirqs last disabled at (48697): [<ffffffff81c00e2f>] asm_call_on_stack+0xf/0x20
      [  210.550822] ---[ end trace ad18c0e6fa846454 ]---
      [  210.581862] mlx5_core 0000:00:0c.0: mlx5_destroy_flow_table:2132:(pid 342): Flow table 262150 wasn't destroyed, refcount > 1
      
      Fixes: a7ee18bd ("RDMA/mlx5: Allow creating a matcher for a NIC TX flow table")
      Signed-off-by: NMichael Guralnik <michaelgur@nvidia.com>
      Reviewed-by: NMark Bloch <mbloch@nvidia.com>
      Reviewed-by: NMaor Gottlieb <maorg@nvidia.com>
      Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
      8cbcc5ef
    • M
      net/mlx5e: Fix check if netdev is bond slave · 219b3267
      Maor Dickman 提交于
      Bond events handler uses bond_slave_get_rtnl to check if net device
      is bond slave. bond_slave_get_rtnl return the rcu rx_handler pointer
      from the netdev which exists for bond slaves but also exists for
      devices that are attached to linux bridge so using it as indication
      for bond slave is wrong.
      
      Fix by using netif_is_lag_port instead.
      
      Fixes: 7e51891a ("net/mlx5e: Use netdev events to set/del egress acl forward-to-vport rule")
      Signed-off-by: NMaor Dickman <maord@nvidia.com>
      Reviewed-by: NRaed Salem <raeds@nvidia.com>
      Reviewed-by: NAriel Levkovich <lariel@nvidia.com>
      Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
      219b3267