1. 15 Nov, 2022 9 commits
    • Paolo Abeni's avatar
      Merge branch 'net-hns3-this-series-bugfix-for-the-hns3-ethernet-driver' · 598ab4b1
      Paolo Abeni authored
      Hao Lan says:
      
      ====================
      net: hns3: This series bugfix for the HNS3 ethernet driver.
      
      This series includes some bugfix for the HNS3 ethernet driver.
      Patch 1# fix incorrect hw rss hash type of rx packet.
      Fixes: 79664077 ("net: hns3: support RXD advanced layout")
      Fixes: 232fc64b ("net: hns3: Add HW RSS hash information to RX skb")
      Fixes: ea485867 ("net: hns3: handle the BD info on the last BD of the packet")
      
      Patch 2# fix return value check bug of rx copybreak.
      Fixes: e74a726d ("net: hns3: refactor hns3_nic_reuse_page()")
      Fixes: 99f6b5fb ("net: hns3: use bounce buffer when rx page can not be reused")
      
      Patch 3# net: hns3: fix setting incorrect phy link ksettings
       for firmware in resetting process
      Fixes: f5f2b3e4 ("net: hns3: add support for imp-controlled PHYs")
      Fixes: c5ef83cb ("net: hns3: fix for phy_addr error in hclge_mac_mdio_config")
      Fixes: 2312e050 ("net: hns3: Fix for deadlock problem occurring when unregistering ae_algo")
      ====================
      
      Link: https://lore.kernel.org/r/20221114082048.49450-1-lanhao@huawei.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      598ab4b1
    • Guangbin Huang's avatar
      net: hns3: fix setting incorrect phy link ksettings for firmware in resetting process · 510d7b6a
      Guangbin Huang authored
      Currently, if driver is in phy-imp(phy controlled by imp firmware) mode, as
      driver did not update phy link ksettings after initialization process or
      not update advertising when getting phy link ksettings from firmware, it
      may set incorrect phy link ksettings for firmware in resetting process.
      So fix it.
      
      Fixes: f5f2b3e4 ("net: hns3: add support for imp-controlled PHYs")
      Fixes: c5ef83cb ("net: hns3: fix for phy_addr error in hclge_mac_mdio_config")
      Fixes: 2312e050 ("net: hns3: Fix for deadlock problem occurring when unregistering ae_algo")
      Signed-off-by: default avatarGuangbin Huang <huangguangbin2@huawei.com>
      Signed-off-by: default avatarHao Lan <lanhao@huawei.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      510d7b6a
    • Jie Wang's avatar
      net: hns3: fix return value check bug of rx copybreak · 29df7c69
      Jie Wang authored
      The refactoring of rx copybreak modifies the original return logic, which
      will make this feature unavailable. So this patch fixes the return logic of
      rx copybreak.
      
      Fixes: e74a726d ("net: hns3: refactor hns3_nic_reuse_page()")
      Fixes: 99f6b5fb ("net: hns3: use bounce buffer when rx page can not be reused")
      Signed-off-by: default avatarJie Wang <wangjie125@huawei.com>
      Signed-off-by: default avatarHao Lan <lanhao@huawei.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      29df7c69
    • Jian Shen's avatar
      net: hns3: fix incorrect hw rss hash type of rx packet · a56cad69
      Jian Shen authored
      Currently, the HNS3 driver reports the rss hash type
      of each packet based on the rss hash tuples set. It
      always reports PKT_HASH_TYPE_L4, without checking the
      type of current packet. It's incorrect.
      Fixes it by reporting it base on the packet type.
      
      Fixes: 79664077 ("net: hns3: support RXD advanced layout")
      Fixes: 232fc64b ("net: hns3: Add HW RSS hash information to RX skb")
      Fixes: ea485867 ("net: hns3: handle the BD info on the last BD of the packet")
      Signed-off-by: default avatarJian Shen <shenjian15@huawei.com>
      Signed-off-by: default avatarHao Lan <lanhao@huawei.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      a56cad69
    • Aminuddin Jamaluddin's avatar
      net: phy: marvell: add sleep time after enabling the loopback bit · 18c532e4
      Aminuddin Jamaluddin authored
      Sleep time is added to ensure the phy to be ready after loopback
      bit was set. This to prevent the phy loopback test from failing.
      
      Fixes: 020a45af ("net: phy: marvell: add Marvell specific PHY loopback")
      Cc: <stable@vger.kernel.org> # 5.15.x
      Signed-off-by: default avatarMuhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
      Signed-off-by: default avatarAminuddin Jamaluddin <aminuddin.jamaluddin@intel.com>
      Link: https://lore.kernel.org/r/20221114065302.10625-1-aminuddin.jamaluddin@intel.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      18c532e4
    • Yuan Can's avatar
      net: ena: Fix error handling in ena_init() · d349e9be
      Yuan Can authored
      The ena_init() won't destroy workqueue created by
      create_singlethread_workqueue() when pci_register_driver() failed.
      Call destroy_workqueue() when pci_register_driver() failed to prevent the
      resource leak.
      
      Fixes: 1738cd3e ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
      Signed-off-by: default avatarYuan Can <yuancan@huawei.com>
      Acked-by: default avatarShay Agroskin <shayagr@amazon.com>
      Link: https://lore.kernel.org/r/20221114025659.124726-1-yuancan@huawei.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      d349e9be
    • Cong Wang's avatar
      kcm: close race conditions on sk_receive_queue · 5121197e
      Cong Wang authored
      sk->sk_receive_queue is protected by skb queue lock, but for KCM
      sockets its RX path takes mux->rx_lock to protect more than just
      skb queue. However, kcm_recvmsg() still only grabs the skb queue
      lock, so race conditions still exist.
      
      We can teach kcm_recvmsg() to grab mux->rx_lock too but this would
      introduce a potential performance regression as struct kcm_mux can
      be shared by multiple KCM sockets.
      
      So we have to enforce skb queue lock in requeue_rx_msgs() and handle
      skb peek case carefully in kcm_wait_data(). Fortunately,
      skb_recv_datagram() already handles it nicely and is widely used by
      other sockets, we can just switch to skb_recv_datagram() after
      getting rid of the unnecessary sock lock in kcm_recvmsg() and
      kcm_splice_read(). Side note: SOCK_DONE is not used by KCM sockets,
      so it is safe to get rid of this check too.
      
      I ran the original syzbot reproducer for 30 min without seeing any
      issue.
      
      Fixes: ab7ac4eb ("kcm: Kernel Connection Multiplexor module")
      Reported-by: syzbot+278279efdd2730dd14bf@syzkaller.appspotmail.com
      Reported-by: default avatarshaozhengchao <shaozhengchao@huawei.com>
      Cc: Paolo Abeni <pabeni@redhat.com>
      Cc: Tom Herbert <tom@herbertland.com>
      Signed-off-by: default avatarCong Wang <cong.wang@bytedance.com>
      Link: https://lore.kernel.org/r/20221114005119.597905-1-xiyou.wangcong@gmail.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      5121197e
    • Yuan Can's avatar
      net: ionic: Fix error handling in ionic_init_module() · 280c0f7c
      Yuan Can authored
      A problem about ionic create debugfs failed is triggered with the
      following log given:
      
       [  415.799514] debugfs: Directory 'ionic' with parent '/' already present!
      
      The reason is that ionic_init_module() returns ionic_bus_register_driver()
      directly without checking its return value, if ionic_bus_register_driver()
      failed, it returns without destroy the newly created debugfs, resulting
      the debugfs of ionic can never be created later.
      
       ionic_init_module()
         ionic_debugfs_create() # create debugfs directory
         ionic_bus_register_driver()
           pci_register_driver()
             driver_register()
               bus_add_driver()
                 priv = kzalloc(...) # OOM happened
         # return without destroy debugfs directory
      
      Fix by removing debugfs when ionic_bus_register_driver() returns error.
      
      Fixes: fbfb8031 ("ionic: Add hardware init and device commands")
      Signed-off-by: default avatarYuan Can <yuancan@huawei.com>
      Acked-by: default avatarShannon Nelson <snelson@pensando.io>
      Link: https://lore.kernel.org/r/20221113092929.19161-1-yuancan@huawei.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      280c0f7c
    • Amit Cohen's avatar
      mlxsw: Avoid warnings when not offloaded FDB entry with IPv6 is removed · 30f5312d
      Amit Cohen authored
      FDB entries that perform VXLAN encapsulation with an IPv6 underlay hold
      a reference on a resource - the KVDL entry where the IPv6 underlay
      destination IP is stored. For that, the driver maintains two hash tables:
      1. Maps IPv6 to KVDL index
      2. Maps {MAC, FID index} to IPv6 address
      
      When a FDB entry is removed, the second table is used to find the relevant
      IPv6 address and the first table is used to remove the reference count and
      free the index if is not used anymore.
      
      In order for a packet to be forwarded to a single remote VTEP, FDB
      entries need to be configured at both the bridge and VXLAN devices' FDB
      tables. Both entries are squashed into one {MAC, VLAN/VNI} -> IP entry
      in the hardware. Therefore, in case one entry is removed, the entry will
      be removed from the hardware and the remaining entry will be unmarked
      with 'offload' flag since it is not offloaded anymore.
      
      For example, the two FDB entries should be added to allow packets to be
      forwarded via vx10:
      $ bridge fdb add dev vx10 aa:bb:cc:dd:ee:ff self static dst 2001:db8:5::1
      $ bridge fdb add dev vx10 aa:bb:cc:dd:ee:ff master static vlan 10
      
      When one entry will be removed, the second one will not be offloaded
      anymore. When the first entry (in VXLAN FDB) will be removed / will not be
      offloaded anymore, the two mappings in IPv6 hash tables will be removed.
      
      In case that the second entry is removed before the first one, unexpected
      warnings[1][2] will be shown in user space as a result of removing the
      first entry. The issue is that not offloaded entry is removed, the driver
      tries to search the relevant entries in the hash tables, does not find them
      and therefore warns.
      
      Do not handle removing of not offloaded VXLAN FDB entries, as they were
      already removed when the offload flag was removed.
      
      [1]:
      WARNING: CPU: 1 PID: 239 at drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c:914 mlxsw_sp_nve_ipv6_addr_map_del+0x6b/0x80 [mlxsw_spectrum]
      ...
      Hardware name: Mellanox Technologies Ltd. Mellanox switch/Mellanox switch, BIOS 4.6.5 05/21/2015
      Workqueue: mlxsw_core_ordered mlxsw_sp_switchdev_vxlan_fdb_event_work [mlxsw_spectrum]
      RIP: 0010:mlxsw_sp_nve_ipv6_addr_map_del+0x6b/0x80 [mlxsw_spectrum]
      ...
      Call Trace:
        <TASK>
        mlxsw_sp_port_fdb_tunnel_uc_op+0x6cf/0x7b0 [mlxsw_spectrum]
        mlxsw_sp_switchdev_vxlan_fdb_event_work+0x17c/0x420 [mlxsw_spectrum]
        ? finish_task_switch.isra.0+0x8c/0x290
        process_one_work+0x1cd/0x390
        worker_thread+0x48/0x3c0
        ? process_one_work+0x390/0x390
        kthread+0xe0/0x110
        ? kthread_complete_and_exit+0x20/0x20
        ret_from_fork+0x1f/0x30
        </TASK>
      
      [2]:
      WARNING: CPU: 0 PID: 239 at drivers/net/ethernet/mellanox/mlxsw/spectrum.c:3035 mlxsw_sp_ipv6_addr_put+0x142/0x220 [mlxsw_spectrum]
      ...
      Hardware name: Mellanox Technologies Ltd. Mellanox switch/Mellanox switch, BIOS 4.6.5 05/21/2015
      Workqueue: mlxsw_core_ordered mlxsw_sp_switchdev_vxlan_fdb_event_work [mlxsw_spectrum]
      RIP: 0010:mlxsw_sp_ipv6_addr_put+0x142/0x220 [mlxsw_spectrum]
      ...
      Call Trace:
        <TASK>
        ? mlxsw_sp_port_fdb_tun_uc_op6_sfd_write+0x5c1/0x610 [mlxsw_spectrum]
        mlxsw_sp_port_fdb_tunnel_uc_op+0x6ec/0x7b0 [mlxsw_spectrum]
        mlxsw_sp_switchdev_vxlan_fdb_event_work+0x17c/0x420 [mlxsw_spectrum]
        ? finish_task_switch.isra.0+0x8c/0x290
        process_one_work+0x1cd/0x390
        worker_thread+0x48/0x3c0
        ? process_one_work+0x390/0x390
        kthread+0xe0/0x110
        ? kthread_complete_and_exit+0x20/0x20
        ret_from_fork+0x1f/0x30
        </TASK>
      
      Fixes: 0860c764 ("mlxsw: spectrum_nve: Keep track of IPv6 addresses used by FDB entries")
      Signed-off-by: default avatarAmit Cohen <amcohen@nvidia.com>
      Reviewed-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Link: https://lore.kernel.org/r/c186de8cbd28e3eb661e06f31f7f2f2dff30020f.1668184350.git.petrm@nvidia.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      30f5312d
  2. 14 Nov, 2022 12 commits
  3. 12 Nov, 2022 8 commits
  4. 11 Nov, 2022 10 commits
  5. 10 Nov, 2022 1 commit