1. 10 11月, 2021 2 次提交
  2. 08 11月, 2021 1 次提交
  3. 28 10月, 2021 1 次提交
  4. 27 10月, 2021 7 次提交
    • G
      net: hns3: adjust string spaces of some parameters of tx bd info in debugfs · 630a6738
      Guangbin Huang 提交于
      This patch adjusts the string spaces of some parameters of tx bd info in
      debugfs according to their maximum needs.
      Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      630a6738
    • G
      net: hns3: expand buffer len for some debugfs command · c7a6e397
      Guangbin Huang 提交于
      The specified buffer length for three debugfs files fd_tcam, uc and tqp
      is not enough for their maximum needs, so this patch fixes them.
      
      Fixes: b5a0b70d ("net: hns3: refactor dump fd tcam of debugfs")
      Fixes: 1556ea91 ("net: hns3: refactor dump mac list of debugfs")
      Fixes: d96b0e59 ("net: hns3: refactor dump reg of debugfs")
      Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c7a6e397
    • J
      net: hns3: add more string spaces for dumping packets number of queue info in debugfs · 6754614a
      Jie Wang 提交于
      As the width of packets number registers is 32 bits, they needs at most
      10 characters for decimal data printing, but now the string spaces is not
      enough, so this patch fixes it.
      
      Fixes: e44c495d ("net: hns3: refactor queue info of debugfs")
      Signed-off-by: NJie Wang <wangjie125@huawei.com>
      Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6754614a
    • J
      net: hns3: fix data endian problem of some functions of debugfs · 2a21dab5
      Jie Wang 提交于
      The member data in struct hclge_desc is type of __le32, it needs endian
      conversion before using it, and some functions of debugfs didn't do that,
      so this patch fixes it.
      
      Fixes: c0ebebb9 ("net: hns3: Add "dcb register" status information query function")
      Signed-off-by: NJie Wang <wangjie125@huawei.com>
      Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2a21dab5
    • G
      net: hns3: ignore reset event before initialization process is done · 0251d196
      Guangbin Huang 提交于
      Currently, if there is a reset event triggered by RAS during device in
      initialization process, driver may run reset process concurrently with
      initialization process. In this case, it may cause problem. For example,
      the RSS indirection table may has not been alloc memory in initialization
      process yet, but it is used in reset process, it will cause a call trace
      like this:
      
      [61228.744836] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
      ...
      [61228.897677] Workqueue: hclgevf hclgevf_service_task [hclgevf]
      [61228.911390] pstate: 40400009 (nZcv daif +PAN -UAO -TCO BTYPE=--)
      [61228.918670] pc : hclgevf_set_rss_indir_table+0xb4/0x190 [hclgevf]
      [61228.927812] lr : hclgevf_set_rss_indir_table+0x90/0x190 [hclgevf]
      [61228.937248] sp : ffff8000162ebb50
      [61228.941087] x29: ffff8000162ebb50 x28: ffffb77add72dbc0 x27: ffff0820c7dc8080
      [61228.949516] x26: 0000000000000000 x25: ffff0820ad4fc880 x24: ffff0820c7dc8080
      [61228.958220] x23: ffff0820c7dc8090 x22: 00000000ffffffff x21: 0000000000000040
      [61228.966360] x20: ffffb77add72b9c0 x19: 0000000000000000 x18: 0000000000000030
      [61228.974646] x17: 0000000000000000 x16: ffffb77ae713feb0 x15: ffff0820ad4fcce8
      [61228.982808] x14: ffffffffffffffff x13: ffff8000962eb7f7 x12: 00003834ec70c960
      [61228.991990] x11: 00e0fafa8c206982 x10: 9670facc78a8f9a8 x9 : ffffb77add717530
      [61229.001123] x8 : ffff0820ad4fd6b8 x7 : 0000000000000000 x6 : 0000000000000011
      [61229.010249] x5 : 00000000000cb1b0 x4 : 0000000000002adb x3 : 0000000000000049
      [61229.018662] x2 : ffff8000162ebbb8 x1 : 0000000000000000 x0 : 0000000000000480
      [61229.027002] Call trace:
      [61229.030177]  hclgevf_set_rss_indir_table+0xb4/0x190 [hclgevf]
      [61229.039009]  hclgevf_rss_init_hw+0x128/0x1b4 [hclgevf]
      [61229.046809]  hclgevf_reset_rebuild+0x17c/0x69c [hclgevf]
      [61229.053862]  hclgevf_reset_service_task+0x4cc/0xa80 [hclgevf]
      [61229.061306]  hclgevf_service_task+0x6c/0x630 [hclgevf]
      [61229.068491]  process_one_work+0x1dc/0x48c
      [61229.074121]  worker_thread+0x15c/0x464
      [61229.078562]  kthread+0x168/0x16c
      [61229.082873]  ret_from_fork+0x10/0x18
      [61229.088221] Code: 7900e7f6 f904a683 d503201f 9101a3e2 (38616b43)
      [61229.095357] ---[ end trace 153661a538f6768c ]---
      
      To fix this problem, don't schedule reset task before initialization
      process is done.
      Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0251d196
    • Y
      net: hns3: change hclge/hclgevf workqueue to WQ_UNBOUND mode · f29da408
      Yufeng Mo 提交于
      Currently, the workqueue of hclge/hclgevf is executed on
      the CPU that initiates scheduling requests by default. In
      stress scenarios, the CPU may be busy and workqueue scheduling
      is completed after a long period of time. To avoid this
      situation and implement proper scheduling, use the WQ_UNBOUND
      mode instead. In this way, the workqueue can be performed on
      a relatively idle CPU.
      Signed-off-by: NYufeng Mo <moyufeng@huawei.com>
      Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f29da408
    • G
      net: hns3: fix pause config problem after autoneg disabled · 3bda2e5d
      Guangbin Huang 提交于
      If a TP port is configured by follow steps:
      1.ethtool -s ethx autoneg off speed 100 duplex full
      2.ethtool -A ethx rx on tx on
      3.ethtool -s ethx autoneg on(rx&tx negotiated pause results are off)
      4.ethtool -s ethx autoneg off speed 100 duplex full
      
      In step 3, driver will set rx&tx pause parameters of hardware to off as
      pause parameters negotiated with link partner are off.
      
      After step 4, the "ethtool -a ethx" command shows both rx and tx pause
      parameters are on. However, pause parameters of hardware are still off
      and port has no flow control function actually.
      
      To fix this problem, if autoneg is disabled, driver uses its saved
      parameters to restore pause of hardware. If the speed is not changed in
      this case, there is no link state changed for phy, it will cause the pause
      parameter is not taken effect, so we need to force phy to go down and up.
      
      Fixes: aacbe27e ("net: hns3: modify how pause options is displayed")
      Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3bda2e5d
  5. 25 10月, 2021 8 次提交
  6. 20 10月, 2021 8 次提交
  7. 15 10月, 2021 1 次提交
  8. 13 10月, 2021 2 次提交
    • L
      devlink: Delete reload enable/disable interface · 82465bec
      Leon Romanovsky 提交于
      Commit a0c76345 ("devlink: disallow reload operation during device
      cleanup") added devlink_reload_{enable,disable}() APIs to prevent reload
      operation from racing with device probe/dismantle.
      
      After recent changes to move devlink_register() to the end of device
      probe and devlink_unregister() to the beginning of device dismantle,
      these races can no longer happen. Reload operations will be denied if
      the devlink instance is unregistered and devlink_unregister() will block
      until all in-flight operations are done.
      
      Therefore, remove these devlink_reload_{enable,disable}() APIs.
      Signed-off-by: NLeon Romanovsky <leonro@nvidia.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      82465bec
    • L
      devlink: Allow control devlink ops behavior through feature mask · bd032e35
      Leon Romanovsky 提交于
      Introduce new devlink call to set feature mask to control devlink
      behavior during device initialization phase after devlink_alloc()
      is already called.
      
      This allows us to set reload ops based on device property which
      is not known at the beginning of driver initialization.
      
      For the sake of simplicity, this API lacks any type of locking and
      needs to be called before devlink_register() to make sure that no
      parallel access to the ops is possible at this stage.
      Signed-off-by: NLeon Romanovsky <leonro@nvidia.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      bd032e35
  9. 12 10月, 2021 1 次提交
  10. 02 10月, 2021 1 次提交
  11. 29 9月, 2021 8 次提交
    • G
      net: hns3: disable firmware compatible features when uninstall PF · 0178839c
      Guangbin Huang 提交于
      Currently, the firmware compatible features are enabled in PF driver
      initialization process, but they are not disabled in PF driver
      deinitialization process and firmware keeps these features in enabled
      status.
      
      In this case, if load an old PF driver (for example, in VM) which not
      support the firmware compatible features, firmware will still send mailbox
      message to PF when link status changed and PF will print
      "un-supported mailbox message, code = 201".
      
      To fix this problem, disable these firmware compatible features in PF
      driver deinitialization process.
      
      Fixes: ed8fb4b2 ("net: hns3: add link change event report")
      Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0178839c
    • G
      net: hns3: fix always enable rx vlan filter problem after selftest · 27bf4af6
      Guangbin Huang 提交于
      Currently, the rx vlan filter will always be disabled before selftest and
      be enabled after selftest as the rx vlan filter feature is fixed on in
      old device earlier than V3.
      
      However, this feature is not fixed in some new devices and it can be
      disabled by user. In this case, it is wrong if rx vlan filter is enabled
      after selftest. So fix it.
      
      Fixes: bcc26e8d ("net: hns3: remove unused code in hns3_self_test()")
      Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      27bf4af6
    • G
      net: hns3: PF enable promisc for VF when mac table is overflow · 276e6042
      Guangbin Huang 提交于
      If unicast mac address table is full, and user add a new mac address, the
      unicast promisc needs to be enabled for the new unicast mac address can be
      used. So does the multicast promisc.
      
      Now this feature has been implemented for PF, and VF should be implemented
      too. When the mac table of VF is overflow, PF will enable promisc for this
      VF.
      
      Fixes: 1e6e7610 ("net: hns3: configure promisc mode for VF asynchronously")
      Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      276e6042
    • J
      net: hns3: fix show wrong state when add existing uc mac address · 108b3c78
      Jian Shen 提交于
      Currently, if function adds an existing unicast mac address, eventhough
      driver will not add this address into hardware, but it will return 0 in
      function hclge_add_uc_addr_common(). It will cause the state of this
      unicast mac address is ACTIVE in driver, but it should be in TO-ADD state.
      
      To fix this problem, function hclge_add_uc_addr_common() returns -EEXIST
      if mac address is existing, and delete two error log to avoid printing
      them all the time after this modification.
      
      Fixes: 72110b56 ("net: hns3: return 0 and print warning when hit duplicate MAC")
      Signed-off-by: NJian Shen <shenjian15@huawei.com>
      Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      108b3c78
    • J
      net: hns3: fix mixed flag HCLGE_FLAG_MQPRIO_ENABLE and HCLGE_FLAG_DCB_ENABLE · 0472e95f
      Jian Shen 提交于
      HCLGE_FLAG_MQPRIO_ENABLE is supposed to set when enable
      multiple TCs with tc mqprio, and HCLGE_FLAG_DCB_ENABLE is
      supposed to set when enable multiple TCs with ets. But
      the driver mixed the flags when updating the tm configuration.
      
      Furtherly, PFC should be available when HCLGE_FLAG_MQPRIO_ENABLE
      too, so remove the unnecessary limitation.
      
      Fixes: 5a5c9091 ("net: hns3: add support for tc mqprio offload")
      Signed-off-by: NJian Shen <shenjian15@huawei.com>
      Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0472e95f
    • J
      net: hns3: don't rollback when destroy mqprio fail · d82650be
      Jian Shen 提交于
      For destroy mqprio is irreversible in stack, so it's unnecessary
      to rollback the tc configuration when destroy mqprio failed.
      Otherwise, it may cause the configuration being inconsistent
      between driver and netstack.
      
      As the failure is usually caused by reset, and the driver will
      restore the configuration after reset, so it can keep the
      configuration being consistent between driver and hardware.
      
      Fixes: 5a5c9091 ("net: hns3: add support for tc mqprio offload")
      Signed-off-by: NJian Shen <shenjian15@huawei.com>
      Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d82650be
    • J
      net: hns3: remove tc enable checking · a8e76fef
      Jian Shen 提交于
      Currently, in function hns3_nic_set_real_num_queue(), the
      driver doesn't report the queue count and offset for disabled
      tc. If user enables multiple TCs, but only maps user
      priorities to partial of them, it may cause the queue range
      of the unmapped TC being displayed abnormally.
      
      Fix it by removing the tc enable checking, ensure the queue
      count is not zero.
      
      With this change, the tc_en is useless now, so remove it.
      
      Fixes: a75a8efa ("net: hns3: Fix tc setup when netdev is first up")
      Signed-off-by: NJian Shen <shenjian15@huawei.com>
      Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a8e76fef
    • J
      net: hns3: do not allow call hns3_nic_net_open repeatedly · 5b09e88e
      Jian Shen 提交于
      hns3_nic_net_open() is not allowed to called repeatly, but there
      is no checking for this. When doing device reset and setup tc
      concurrently, there is a small oppotunity to call hns3_nic_net_open
      repeatedly, and cause kernel bug by calling napi_enable twice.
      
      The calltrace information is like below:
      [ 3078.222780] ------------[ cut here ]------------
      [ 3078.230255] kernel BUG at net/core/dev.c:6991!
      [ 3078.236224] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
      [ 3078.243431] Modules linked in: hns3 hclgevf hclge hnae3 vfio_iommu_type1 vfio_pci vfio_virqfd vfio pv680_mii(O)
      [ 3078.258880] CPU: 0 PID: 295 Comm: kworker/u8:5 Tainted: G           O      5.14.0-rc4+ #1
      [ 3078.269102] Hardware name:  , BIOS KpxxxFPGA 1P B600 V181 08/12/2021
      [ 3078.276801] Workqueue: hclge hclge_service_task [hclge]
      [ 3078.288774] pstate: 60400009 (nZCv daif +PAN -UAO -TCO BTYPE=--)
      [ 3078.296168] pc : napi_enable+0x80/0x84
      tc qdisc sho[w  3d0e7v8 .e3t0h218 79] lr : hns3_nic_net_open+0x138/0x510 [hns3]
      
      [ 3078.314771] sp : ffff8000108abb20
      [ 3078.319099] x29: ffff8000108abb20 x28: 0000000000000000 x27: ffff0820a8490300
      [ 3078.329121] x26: 0000000000000001 x25: ffff08209cfc6200 x24: 0000000000000000
      [ 3078.339044] x23: ffff0820a8490300 x22: ffff08209cd76000 x21: ffff0820abfe3880
      [ 3078.349018] x20: 0000000000000000 x19: ffff08209cd76900 x18: 0000000000000000
      [ 3078.358620] x17: 0000000000000000 x16: ffffc816e1727a50 x15: 0000ffff8f4ff930
      [ 3078.368895] x14: 0000000000000000 x13: 0000000000000000 x12: 0000259e9dbeb6b4
      [ 3078.377987] x11: 0096a8f7e764eb40 x10: 634615ad28d3eab5 x9 : ffffc816ad8885b8
      [ 3078.387091] x8 : ffff08209cfc6fb8 x7 : ffff0820ac0da058 x6 : ffff0820a8490344
      [ 3078.396356] x5 : 0000000000000140 x4 : 0000000000000003 x3 : ffff08209cd76938
      [ 3078.405365] x2 : 0000000000000000 x1 : 0000000000000010 x0 : ffff0820abfe38a0
      [ 3078.414657] Call trace:
      [ 3078.418517]  napi_enable+0x80/0x84
      [ 3078.424626]  hns3_reset_notify_up_enet+0x78/0xd0 [hns3]
      [ 3078.433469]  hns3_reset_notify+0x64/0x80 [hns3]
      [ 3078.441430]  hclge_notify_client+0x68/0xb0 [hclge]
      [ 3078.450511]  hclge_reset_rebuild+0x524/0x884 [hclge]
      [ 3078.458879]  hclge_reset_service_task+0x3c4/0x680 [hclge]
      [ 3078.467470]  hclge_service_task+0xb0/0xb54 [hclge]
      [ 3078.475675]  process_one_work+0x1dc/0x48c
      [ 3078.481888]  worker_thread+0x15c/0x464
      [ 3078.487104]  kthread+0x160/0x170
      [ 3078.492479]  ret_from_fork+0x10/0x18
      [ 3078.498785] Code: c8027c81 35ffffa2 d50323bf d65f03c0 (d4210000)
      [ 3078.506889] ---[ end trace 8ebe0340a1b0fb44 ]---
      
      Once hns3_nic_net_open() is excute success, the flag
      HNS3_NIC_STATE_DOWN will be cleared. So add checking for this
      flag, directly return when HNS3_NIC_STATE_DOWN is no set.
      
      Fixes: e8884027 ("net: hns3: call hns3_nic_net_open() while doing HNAE3_UP_CLIENT")
      Signed-off-by: NJian Shen <shenjian15@huawei.com>
      Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5b09e88e