Skip to content
  1. Nov 27, 2020
    • Marc Kleine-Budde's avatar
      can: m_can: fix nominal bitiming tseg2 min for version >= 3.1 · e3409e41
      Marc Kleine-Budde authored
      
      
      At lest the revision 3.3.0 of the bosch m_can IP core specifies that valid
      register values for "Nominal Time segment after sample point (NTSEG2)" are from
      1 to 127. As the hardware uses a value of one more than the programmed value,
      mean tseg2_min is 2.
      
      This patch fixes the tseg2_min value accordingly.
      
      Cc: Dan Murphy <dmurphy@ti.com>
      Cc: Mario Huettel <mario.huettel@gmx.net>
      Acked-by: default avatarSriram Dash <sriram.dash@samsung.com>
      Link: https://lore.kernel.org/r/20201124190751.3972238-1-mkl@pengutronix.de
      Fixes: b03cfc5b
      
       ("can: m_can: Enable M_CAN version dependent initialization")
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      e3409e41
    • Marc Kleine-Budde's avatar
      can: m_can: m_can_open(): remove IRQF_TRIGGER_FALLING from request_threaded_irq()'s flags · 865f5b67
      Marc Kleine-Budde authored
      
      
      The threaded IRQ handler is used for the tcan4x5x driver only. The IRQ pin of
      the tcan4x5x controller is active low, so better not use IRQF_TRIGGER_FALLING
      when requesting the IRQ. As this can result in missing interrupts.
      
      Further, if the device tree specified the interrupt as "IRQ_TYPE_LEVEL_LOW",
      unloading and reloading of the driver results in the following error during
      ifup:
      
      | irq: type mismatch, failed to map hwirq-31 for gpio@20a8000!
      | tcan4x5x spi1.1: m_can device registered (irq=0, version=32)
      | tcan4x5x spi1.1 can2: TCAN4X5X successfully initialized.
      | tcan4x5x spi1.1 can2: failed to request interrupt
      
      This patch fixes the problem by removing the IRQF_TRIGGER_FALLING from the
      request_threaded_irq().
      
      Fixes: f524f829b75a ("can: m_can: Create a m_can platform framework")
      Cc: Dan Murphy <dmurphy@ti.com>
      Cc: Sriram Dash <sriram.dash@samsung.com>
      Cc: Pankaj Sharma <pankj.sharma@samsung.com>
      Link: https://lore.kernel.org/r/20201127093548.509253-1-mkl@pengutronix.de
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      865f5b67
  2. Nov 26, 2020
    • Marc Kleine-Budde's avatar
      can: mcp251xfd: mcp251xfd_probe(): bail out if no IRQ was given · 1a1c436b
      Marc Kleine-Budde authored
      
      
      This patch add a check to the mcp251xfd_probe() function to bail out and give
      the user a proper error message if no IRQ is specified. Otherwise the driver
      will probe just fine but ifup will fail with a meaningless "RTNETLINK answers:
      Invalid argument" error message.
      
      Link: https://lore.kernel.org/r/20201123113522.3820052-1-mkl@pengutronix.de
      Reported-by: default avatarNiels Petter <petter@ka-long.de>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      1a1c436b
    • Marc Kleine-Budde's avatar
      can: gs_usb: fix endianess problem with candleLight firmware · 4ba1cb39
      Marc Kleine-Budde authored
      
      
      The firmware on the original USB2CAN by Geschwister Schneider Technologie
      Entwicklungs- und Vertriebs UG exchanges all data between the host and the
      device in host byte order. This is done with the struct
      gs_host_config::byte_order member, which is sent first to indicate the desired
      byte order.
      
      The widely used open source firmware candleLight doesn't support this feature
      and exchanges the data in little endian byte order. This breaks if a device
      with candleLight firmware is used on big endianess systems.
      
      To fix this problem, all u32 (but not the struct gs_host_frame::echo_id, which
      is a transparent cookie) are converted to __le32.
      
      Cc: Maximilian Schneider <max@schneidersoft.net>
      Cc: Hubert Denkmair <hubert@denkmair.de>
      Reported-by: default avatarMichael Rausch <mr@netadair.de>
      Link: https://lore.kernel.org/r/b58aace7-61f3-6df7-c6df-69fee2c66906@netadair.de
      Tested-by: default avatarOleksij Rempel <o.rempel@pengutronix.de>
      Fixes: d08e973a
      
       ("can: gs_usb: Added support for the GS_USB CAN devices")
      Link: https://lore.kernel.org/r/20201120103818.3386964-1-mkl@pengutronix.de
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      4ba1cb39
    • Rohit Maheshwari's avatar
      ch_ktls: lock is not freed · cbf3d603
      Rohit Maheshwari authored
      Currently lock gets freed only if timeout expires, but missed a
      case when HW returns failure and goes for cleanup.
      
      Fixes: efca3878
      
       ("ch_ktls: Issue if connection offload fails")
      Signed-off-by: default avatarRohit Maheshwari <rohitm@chelsio.com>
      Link: https://lore.kernel.org/r/20201125072626.10861-1-rohitm@chelsio.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      cbf3d603
    • Maxim Mikityanskiy's avatar
      net/tls: Protect from calling tls_dev_del for TLS RX twice · 025cc2fb
      Maxim Mikityanskiy authored
      tls_device_offload_cleanup_rx doesn't clear tls_ctx->netdev after
      calling tls_dev_del if TLX TX offload is also enabled. Clearing
      tls_ctx->netdev gets postponed until tls_device_gc_task. It leaves a
      time frame when tls_device_down may get called and call tls_dev_del for
      RX one extra time, confusing the driver, which may lead to a crash.
      
      This patch corrects this racy behavior by adding a flag to prevent
      tls_device_down from calling tls_dev_del the second time.
      
      Fixes: e8f69799
      
       ("net/tls: Add generic NIC offload infrastructure")
      Signed-off-by: default avatarMaxim Mikityanskiy <maximmi@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      Link: https://lore.kernel.org/r/20201125221810.69870-1-saeedm@nvidia.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      025cc2fb
    • Jakub Kicinski's avatar
      Merge branch 'devlink-port-attribute-fixes' · a060133c
      Jakub Kicinski authored
      
      
      Parav Pandit says:
      
      ====================
      devlink port attribute fixes
      
      This patchset contains 2 small fixes for devlink port attributes.
      
      Patch summary:
      Patch-1 synchronize the devlink port attribute reader
              with net namespace change operation
      Patch-2 Ensure to return devlink port's netdevice attributes
              when netdev and devlink instance belong to same net namespace
      ====================
      
      Link: https://lore.kernel.org/r/20201125091620.6781-1-parav@nvidia.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a060133c
    • Parav Pandit's avatar
      devlink: Make sure devlink instance and port are in same net namespace · a7b43649
      Parav Pandit authored
      When devlink reload operation is not used, netdev of an Ethernet port may
      be present in different net namespace than the net namespace of the
      devlink instance.
      
      Ensure that both the devlink instance and devlink port netdev are located
      in same net namespace.
      
      Fixes: 070c63f2
      
       ("net: devlink: allow to change namespaces during reload")
      Signed-off-by: default avatarParav Pandit <parav@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a7b43649
    • Parav Pandit's avatar
      devlink: Hold rtnl lock while reading netdev attributes · b187c9b4
      Parav Pandit authored
      A netdevice of a devlink port can be moved to different net namespace
      than its parent devlink instance.
      This scenario occurs when devlink reload is not used.
      
      When netdevice is undergoing migration to net namespace, its ifindex
      and name may change.
      
      In such use case, devlink port query may read stale netdev attributes.
      
      Fix it by reading them under rtnl lock.
      
      Fixes: bfcd3a46
      
       ("Introduce devlink infrastructure")
      Signed-off-by: default avatarParav Pandit <parav@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b187c9b4
    • Min Li's avatar
      ptp: clockmatrix: bug fix for idtcm_strverscmp · 3cb2e6d9
      Min Li authored
      Feed kstrtou8 with NULL terminated string.
      
      Changes since v1:
      -Use sscanf to get rid of adhoc string parse.
      Changes since v2:
      -Check if sscanf returns 3.
      
      Fixes: 7ea5fda2
      
       ("ptp: ptp_clockmatrix: update to support 4.8.7 firmware")
      Signed-off-by: default avatarMin Li <min.li.xe@renesas.com>
      Link: https://lore.kernel.org/r/1606273115-25792-1-git-send-email-min.li.xe@renesas.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      3cb2e6d9
    • Vladimir Oltean's avatar
      enetc: Let the hardware auto-advance the taprio base-time of 0 · 90cf87d1
      Vladimir Oltean authored
      The tc-taprio base time indicates the beginning of the tc-taprio
      schedule, which is cyclic by definition (where the length of the cycle
      in nanoseconds is called the cycle time). The base time is a 64-bit PTP
      time in the TAI domain.
      
      Logically, the base-time should be a future time. But that imposes some
      restrictions to user space, which has to retrieve the current PTP time
      from the NIC first, then calculate a base time that will still be larger
      than the base time by the time the kernel driver programs this value
      into the hardware. Actually ensuring that the programmed base time is in
      the future is still a problem even if the kernel alone deals with this.
      
      Luckily, the enetc hardware already advances a base-time that is in the
      past into a congruent time in the immediate future, according to the
      same formula that can be found in the software implementation of taprio
      (in taprio_get_start_time):
      
      	/* Schedule the start time for the beginning of the next
      	 * cycle.
      	 */
      	n = div64_s64(ktime_sub_ns(now, base), cycle);
      	*start = ktime_add_ns(base, (n + 1) * cycle);
      
      There's only one problem: the driver doesn't let the hardware do that.
      It interferes with the base-time passed from user space, by special-casing
      the situation when the base-time is zero, and replaces that with the
      current PTP time. This changes the intended effective base-time of the
      schedule, which will in the end have a different phase offset than if
      the base-time of 0.000000000 was to be advanced by an integer multiple
      of the cycle-time.
      
      Fixes: 34c6adf1
      
       ("enetc: Configure the Time-Aware Scheduler via tc-taprio offload")
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Link: https://lore.kernel.org/r/20201124220259.3027991-1-vladimir.oltean@nxp.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      90cf87d1
    • Eric Dumazet's avatar
      gro_cells: reduce number of synchronize_net() calls · 2543a600
      Eric Dumazet authored
      After cited commit, gro_cells_destroy() became damn slow
      on hosts with a lot of cores.
      
      This is because we have one additional synchronize_net() per cpu as
      stated in the changelog.
      
      gro_cells_init() is setting NAPI_STATE_NO_BUSY_POLL, and this was enough
      to not have one synchronize_net() call per netif_napi_del()
      
      We can factorize all the synchronize_net() to a single one,
      right before freeing per-cpu memory.
      
      Fixes: 5198d545
      
       ("net: remove napi_hash_del() from driver-facing API")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Link: https://lore.kernel.org/r/20201124203822.1360107-1-eric.dumazet@gmail.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      2543a600
    • Antonio Borneo's avatar
      net: stmmac: fix incorrect merge of patch upstream · 12a8fe56
      Antonio Borneo authored
      Commit 75792624 ("net: stmmac: add flexible PPS to dwmac
      4.10a") was intended to modify the struct dwmac410_ops, but it got
      somehow badly merged and modified the struct dwmac4_ops.
      
      Revert the modification in struct dwmac4_ops and re-apply it
      properly in struct dwmac410_ops.
      
      Fixes: 75792624
      
       ("net: stmmac: add flexible PPS to dwmac 4.10a")
      Signed-off-by: default avatarAntonio Borneo <antonio.borneo@st.com>
      Reported-by: default avatarAhmad Fatoum <a.fatoum@pengutronix.de>
      Link: https://lore.kernel.org/r/20201124223729.886992-1-antonio.borneo@st.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      12a8fe56
    • Wang Hai's avatar
      ipv6: addrlabel: fix possible memory leak in ip6addrlbl_net_init · e255e11e
      Wang Hai authored
      kmemleak report a memory leak as follows:
      
      unreferenced object 0xffff8880059c6a00 (size 64):
        comm "ip", pid 23696, jiffies 4296590183 (age 1755.384s)
        hex dump (first 32 bytes):
          20 01 00 10 00 00 00 00 00 00 00 00 00 00 00 00   ...............
          1c 00 00 00 00 00 00 00 00 00 00 00 07 00 00 00  ................
        backtrace:
          [<00000000aa4e7a87>] ip6addrlbl_add+0x90/0xbb0
          [<0000000070b8d7f1>] ip6addrlbl_net_init+0x109/0x170
          [<000000006a9ca9d4>] ops_init+0xa8/0x3c0
          [<000000002da57bf2>] setup_net+0x2de/0x7e0
          [<000000004e52d573>] copy_net_ns+0x27d/0x530
          [<00000000b07ae2b4>] create_new_namespaces+0x382/0xa30
          [<000000003b76d36f>] unshare_nsproxy_namespaces+0xa1/0x1d0
          [<0000000030653721>] ksys_unshare+0x3a4/0x780
          [<0000000007e82e40>] __x64_sys_unshare+0x2d/0x40
          [<0000000031a10c08>] do_syscall_64+0x33/0x40
          [<0000000099df30e7>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      We should free all rules when we catch an error in ip6addrlbl_net_init().
      otherwise a memory leak will occur.
      
      Fixes: 2a8cc6c8
      
       ("[IPV6] ADDRCONF: Support RFC3484 configurable address selection policy table.")
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Signed-off-by: default avatarWang Hai <wanghai38@huawei.com>
      Link: https://lore.kernel.org/r/20201124071728.8385-1-wanghai38@huawei.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      e255e11e
  3. Nov 25, 2020
    • Jakub Kicinski's avatar
      Documentation: netdev-FAQ: suggest how to post co-dependent series · 6f7a1f9c
      Jakub Kicinski authored
      
      
      Make an explicit suggestion how to post user space side of kernel
      patches to avoid reposts when patchwork groups the wrong patches.
      
      v2: mention the cases unlike iproute2 explicitly
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6f7a1f9c
    • Jakub Kicinski's avatar
      Merge tag 'batadv-net-pullrequest-20201124' of git://git.open-mesh.org/linux-merge · 26c89965
      Jakub Kicinski authored
      
      
      Simon Wunderlich says:
      
      ====================
      Here is a batman-adv bugfix:
      
       - set module owner to THIS_MODULE, by Taehee Yoo
      
      * tag 'batadv-net-pullrequest-20201124' of git://git.open-mesh.org/linux-merge:
        batman-adv: set .owner to THIS_MODULE
      ====================
      
      Link: https://lore.kernel.org/r/20201124134417.17269-1-sw@simonwunderlich.de
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      26c89965
    • Jakub Kicinski's avatar
      Merge branch 'ibmvnic-null-pointer-dereference' · 49d66ed8
      Jakub Kicinski authored
      
      
      Lijun Pan says:
      
      ====================
      ibmvnic: null pointer dereference
      
      Fix two NULL pointer dereference crash issues.
      Improve module removal procedure.
      ====================
      
      Link: https://lore.kernel.org/r/20201123193547.57225-1-ljp@linux.ibm.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      49d66ed8
    • Lijun Pan's avatar
      ibmvnic: enhance resetting status check during module exit · 3ada2881
      Lijun Pan authored
      Based on the discussion with Sukadev Bhattiprolu and Dany Madden,
      we believe that checking adapter->resetting bit is preferred
      since RESETTING state flag is not as strict as resetting bit.
      RESETTING state flag is removed since it is verbose now.
      
      Fixes: 7d7195a0
      
       ("ibmvnic: Do not process device remove during device reset")
      Signed-off-by: default avatarLijun Pan <ljp@linux.ibm.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      3ada2881
    • Lijun Pan's avatar
      ibmvnic: fix NULL pointer dereference in ibmvic_reset_crq · 0e435bef
      Lijun Pan authored
      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: default avatarLijun Pan <ljp@linux.ibm.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      0e435bef
    • Lijun Pan's avatar
      ibmvnic: fix NULL pointer dereference in reset_sub_crq_queues · a0faaa27
      Lijun Pan authored
      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: default avatarLijun Pan <ljp@linux.ibm.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a0faaa27
    • Jakub Kicinski's avatar
      Merge branch 'fixes-for-ena-driver' · 5fc145f1
      Jakub Kicinski authored
      
      
      Shay Agroskin says:
      
      ====================
      Fixes for ENA driver
      
      - fix wrong data offset on machines that support rx offset
      - work-around Intel iommu issue
      - fix out of bound access when request id is wrong
      ====================
      
      Link: https://lore.kernel.org/r/20201123190859.21298-1-shayagr@amazon.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      5fc145f1
    • Shay Agroskin's avatar
      net: ena: fix packet's addresses for rx_offset feature · 1396d314
      Shay Agroskin authored
      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: default avatarShay Agroskin <shayagr@amazon.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      1396d314
    • Shay Agroskin's avatar
      net: ena: set initial DMA width to avoid intel iommu issue · 09323b3b
      Shay Agroskin authored
      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: default avatarMike Cui <mikecui@amazon.com>
      Signed-off-by: default avatarArthur Kiyanovski <akiyano@amazon.com>
      Signed-off-by: default avatarShay Agroskin <shayagr@amazon.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      09323b3b
    • Shay Agroskin's avatar
      net: ena: handle bad request id in ena_netdev · 5b7022cf
      Shay Agroskin authored
      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: default avatarIdo Segev <idose@amazon.com>
      Signed-off-by: default avatarShay Agroskin <shayagr@amazon.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      5b7022cf
    • Krzysztof Kozlowski's avatar
      nfc: s3fwrn5: use signed integer for parsing GPIO numbers · d8f0a867
      Krzysztof Kozlowski authored
      GPIOs - as returned by of_get_named_gpio() and used by the gpiolib - are
      signed integers, where negative number indicates error.  The return
      value of of_get_named_gpio() should not be assigned to an unsigned int
      because in case of !CONFIG_GPIOLIB such number would be a valid GPIO.
      
      Fixes: c04c674f
      
       ("nfc: s3fwrn5: Add driver for Samsung S3FWRN5 NFC Chip")
      Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
      Link: https://lore.kernel.org/r/20201123162351.209100-1-krzk@kernel.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      d8f0a867
    • Ezequiel Garcia's avatar
      dpaa2-eth: Fix compile error due to missing devlink support · 078eb55c
      Ezequiel Garcia authored
      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: default avatarEzequiel Garcia <ezequiel@collabora.com>
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Link: https://lore.kernel.org/r/20201123163553.1666476-1-ciorneiioana@gmail.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      078eb55c
    • Jesper Dangaard Brouer's avatar
      MAINTAINERS: Update page pool entry · bc40a369
      Jesper Dangaard Brouer authored
      
      
      Add some file F: matches that is related to page_pool.
      
      Acked-by: default avatarIlias Apalodimas <ilias.apalodimas@linaro.org>
      Signed-off-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
      Link: https://lore.kernel.org/r/160613894639.2826716.14635284017814375894.stgit@firesoul
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      bc40a369
    • Alexander Duyck's avatar
      tcp: Set ECT0 bit in tos/tclass for synack when BPF needs ECN · 407c85c7
      Alexander Duyck authored
      When a BPF program is used to select between a type of TCP congestion
      control algorithm that uses either ECN or not there is a case where the
      synack for the frame was coming up without the ECT0 bit set. A bit of
      research found that this was due to the final socket being configured to
      dctcp while the listener socket was staying in cubic.
      
      To reproduce it all that is needed is to monitor TCP traffic while running
      the sample bpf program "samples/bpf/tcp_cong_kern.c". What is observed,
      assuming tcp_dctcp module is loaded or compiled in and the traffic matches
      the rules in the sample file, is that for all frames with the exception of
      the synack the ECT0 bit is set.
      
      To address that it is necessary to make one additional call to
      tcp_bpf_ca_needs_ecn using the request socket and then use the output of
      that to set the ECT0 bit for the tos/tclass of the packet.
      
      Fixes: 91b5b21c
      
       ("bpf: Add support for changing congestion control")
      Signed-off-by: default avatarAlexander Duyck <alexanderduyck@fb.com>
      Link: https://lore.kernel.org/r/160593039663.2604.1374502006916871573.stgit@localhost.localdomain
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      407c85c7
    • Moshe Shemesh's avatar
      devlink: Fix reload stats structure · 5204bb68
      Moshe Shemesh authored
      Fix reload stats structure exposed to the user. Change stats structure
      hierarchy to have the reload action as a parent of the stat entry and
      then stat entry includes value per limit. This will also help to avoid
      string concatenation on iproute2 output.
      
      Reload stats structure before this fix:
      "stats": {
          "reload": {
              "driver_reinit": 2,
              "fw_activate": 1,
              "fw_activate_no_reset": 0
           }
      }
      
      After this fix:
      "stats": {
          "reload": {
              "driver_reinit": {
                  "unspecified": 2
              },
              "fw_activate": {
                  "unspecified": 1,
                  "no_reset": 0
              }
      }
      
      Fixes: a254c264
      
       ("devlink: Add reload stats")
      Signed-off-by: default avatarMoshe Shemesh <moshe@mellanox.com>
      Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
      Link: https://lore.kernel.org/r/1606109785-25197-1-git-send-email-moshe@mellanox.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      5204bb68
    • Lincoln Ramsay's avatar
      aquantia: Remove the build_skb path · 9bd2702d
      Lincoln Ramsay authored
      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: default avatarLincoln Ramsay <lincoln.ramsay@opengear.com>
      Link: https://lore.kernel.org/r/MWHPR1001MB23184F3EAFA413E0D1910EC9E8FC0@MWHPR1001MB2318.namprd10.prod.outlook.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      9bd2702d
  4. Nov 24, 2020
    • Eyal Birger's avatar
      net/packet: fix packet receive on L3 devices without visible hard header · d5496990
      Eyal Birger authored
      In the patchset merged by commit b9fcf0a0
      ("Merge branch 'support-AF_PACKET-for-layer-3-devices'") L3 devices which
      did not have header_ops were given one for the purpose of protocol parsing
      on af_packet transmit path.
      
      That change made af_packet receive path regard these devices as having a
      visible L3 header and therefore aligned incoming skb->data to point to the
      skb's mac_header. Some devices, such as ipip, xfrmi, and others, do not
      reset their mac_header prior to ingress and therefore their incoming
      packets became malformed.
      
      Ideally these devices would reset their mac headers, or af_packet would be
      able to rely on dev->hard_header_len being 0 for such cases, but it seems
      this is not the case.
      
      Fix by changing af_packet RX ll visibility criteria to include the
      existence of a '.create()' header operation, which is used when creating
      a device hard header - via dev_hard_header() - by upper layers, and does
      not exist in these L3 devices.
      
      As this predicate may be useful in other situations, add it as a common
      dev_has_header() helper in netdevice.h.
      
      Fixes: b9fcf0a0
      
       ("Merge branch 'support-AF_PACKET-for-layer-3-devices'")
      Signed-off-by: default avatarEyal Birger <eyal.birger@gmail.com>
      Acked-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
      Acked-by: default avatarWillem de Bruijn <willemb@google.com>
      Link: https://lore.kernel.org/r/20201121062817.3178900-1-eyal.birger@gmail.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      d5496990
    • Sylwester Dziedziuch's avatar
      i40e: Fix removing driver while bare-metal VFs pass traffic · 2980cbd4
      Sylwester Dziedziuch authored
      Prevent VFs from resetting when PF driver is being unloaded:
      - introduce new pf state: __I40E_VF_RESETS_DISABLED;
      - check if pf state has __I40E_VF_RESETS_DISABLED state set,
        if so, disable any further VFLR event notifications;
      - when i40e_remove (rmmod i40e) is called, disable any resets on
        the VFs;
      
      Previously if there were bare-metal VFs passing traffic and PF
      driver was removed, there was a possibility of VFs triggering a Tx
      timeout right before iavf_remove. This was causing iavf_close to
      not be called because there is a check in the beginning of  iavf_remove
      that bails out early if adapter->state < IAVF_DOWN_PENDING. This
      makes it so some resources do not get cleaned up.
      
      Fixes: 6a9ddb36
      
       ("i40e: disable IOV before freeing resources")
      Signed-off-by: default avatarSlawomir Laba <slawomirx.laba@intel.com>
      Signed-off-by: default avatarBrett Creeley <brett.creeley@intel.com>
      Signed-off-by: default avatarSylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>
      Tested-by: default avatarKonrad Jankowski <konrad0.jankowski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Link: https://lore.kernel.org/r/20201120180640.3654474-1-anthony.l.nguyen@intel.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      2980cbd4
    • Stefano Garzarella's avatar
      vsock/virtio: discard packets only when socket is really closed · 3fe356d5
      Stefano Garzarella authored
      Starting from commit 8692cefc ("virtio_vsock: Fix race condition
      in virtio_transport_recv_pkt"), we discard packets in
      virtio_transport_recv_pkt() if the socket has been released.
      
      When the socket is connected, we schedule a delayed work to wait the
      RST packet from the other peer, also if SHUTDOWN_MASK is set in
      sk->sk_shutdown.
      This is done to complete the virtio-vsock shutdown algorithm, releasing
      the port assigned to the socket definitively only when the other peer
      has consumed all the packets.
      
      If we discard the RST packet received, the socket will be closed only
      when the VSOCK_CLOSE_TIMEOUT is reached.
      
      Sergio discovered the issue while running ab(1) HTTP benchmark using
      libkrun [1] and observing a latency increase with that commit.
      
      To avoid this issue, we discard packet only if the socket is really
      closed (SOCK_DONE flag is set).
      We also set SOCK_DONE in virtio_transport_release() when we don't need
      to wait any packets from the other peer (we didn't schedule the delayed
      work). In this case we remove the socket from the vsock lists, releasing
      the port assigned.
      
      [1] https://github.com/containers/libkrun
      
      Fixes: 8692cefc
      
       ("virtio_vsock: Fix race condition in virtio_transport_recv_pkt")
      Cc: justin.he@arm.com
      Reported-by: default avatarSergio Lopez <slp@redhat.com>
      Tested-by: default avatarSergio Lopez <slp@redhat.com>
      Signed-off-by: default avatarStefano Garzarella <sgarzare@redhat.com>
      Acked-by: default avatarJia He <justin.he@arm.com>
      Link: https://lore.kernel.org/r/20201120104736.73749-1-sgarzare@redhat.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      3fe356d5
    • Ricardo Dias's avatar
      tcp: fix race condition when creating child sockets from syncookies · 01770a16
      Ricardo Dias authored
      
      
      When the TCP stack is in SYN flood mode, the server child socket is
      created from the SYN cookie received in a TCP packet with the ACK flag
      set.
      
      The child socket is created when the server receives the first TCP
      packet with a valid SYN cookie from the client. Usually, this packet
      corresponds to the final step of the TCP 3-way handshake, the ACK
      packet. But is also possible to receive a valid SYN cookie from the
      first TCP data packet sent by the client, and thus create a child socket
      from that SYN cookie.
      
      Since a client socket is ready to send data as soon as it receives the
      SYN+ACK packet from the server, the client can send the ACK packet (sent
      by the TCP stack code), and the first data packet (sent by the userspace
      program) almost at the same time, and thus the server will equally
      receive the two TCP packets with valid SYN cookies almost at the same
      instant.
      
      When such event happens, the TCP stack code has a race condition that
      occurs between the momement a lookup is done to the established
      connections hashtable to check for the existence of a connection for the
      same client, and the moment that the child socket is added to the
      established connections hashtable. As a consequence, this race condition
      can lead to a situation where we add two child sockets to the
      established connections hashtable and deliver two sockets to the
      userspace program to the same client.
      
      This patch fixes the race condition by checking if an existing child
      socket exists for the same client when we are adding the second child
      socket to the established connections socket. If an existing child
      socket exists, we drop the packet and discard the second child socket
      to the same client.
      
      Signed-off-by: default avatarRicardo Dias <rdias@singlestore.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Link: https://lore.kernel.org/r/20201120111133.GA67501@rdias-suse-pc.lan
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      01770a16
    • Jakub Kicinski's avatar
      Merge tag 'wireless-drivers-2020-11-23' of... · 1eae77bf
      Jakub Kicinski authored
      
      Merge tag 'wireless-drivers-2020-11-23' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers
      
      Kalle Valo says:
      
      ====================
      wireless-drivers fixes for v5.10
      
      First set of fixes for v5.10. One fix for iwlwifi kernel panic, others
      less notable.
      
      rtw88
      
      * fix a bogus test found by clang
      
      iwlwifi
      
      * fix long memory reads causing soft lockup warnings
      
      * fix kernel panic during Channel Switch Announcement (CSA)
      
      * other smaller fixes
      
      MAINTAINERS
      
      * email address updates
      
      * tag 'wireless-drivers-2020-11-23' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers:
        iwlwifi: mvm: fix kernel panic in case of assert during CSA
        iwlwifi: pcie: set LTR to avoid completion timeout
        iwlwifi: mvm: write queue_sync_state only for sync
        iwlwifi: mvm: properly cancel a session protection for P2P
        iwlwifi: mvm: use the HOT_SPOT_CMD to cancel an AUX ROC
        iwlwifi: sta: set max HE max A-MPDU according to HE capa
        MAINTAINERS: update maintainers list for Cypress
        MAINTAINERS: update Yan-Hsuan's email address
        iwlwifi: pcie: limit memory read spin time
        rtw88: fix fw_fifo_addr check
      ====================
      
      Link: https://lore.kernel.org/r/20201123161037.C11D1C43460@smtp.codeaurora.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      1eae77bf
  5. Nov 22, 2020