1. 31 1月, 2019 7 次提交
    • H
      net: hns3: fix netif_napi_del() not do problem when unloading · e2152785
      Huazhong Tan 提交于
      When the driver is unloading, if a global reset occurs,
      unmap_ring_from_vector() in the hns3_nic_uninit_vector_data() will
      fail, and hns3_nic_uninit_vector_data() just return. There may be
      some netif_napi_del() not be done.
      
      Since hardware will unmap all ring while resetting, so
      hns3_nic_uninit_vector_data() should ignore this error, and do the
      rest uninitialization.
      
      Fixes: 76ad4f0e ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e2152785
    • H
      net: hns3: Fix NULL deref when unloading driver · c8a8045b
      Huazhong Tan 提交于
      When the driver is unloading, if there is a calling of ndo_open occurs
      between phy_disconnect() and unregister_netdev(), it will end up
      causing the kernel to eventually hit a NULL deref:
      
      [14942.417828] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000048
      [14942.529878] Mem abort info:
      [14942.551166]   ESR = 0x96000006
      [14942.567070]   Exception class = DABT (current EL), IL = 32 bits
      [14942.623081]   SET = 0, FnV = 0
      [14942.639112]   EA = 0, S1PTW = 0
      [14942.643628] Data abort info:
      [14942.659227]   ISV = 0, ISS = 0x00000006
      [14942.674870]   CM = 0, WnR = 0
      [14942.679449] user pgtable: 4k pages, 48-bit VAs, pgdp = 00000000224ad6ad
      [14942.695595] [0000000000000048] pgd=00000021e6673003, pud=00000021dbf01003, pmd=0000000000000000
      [14942.723163] Internal error: Oops: 96000006 [#1] PREEMPT SMP
      [14942.729358] Modules linked in: hns3(O) hclge(O) pv680_mii(O) hnae3(O) [last unloaded: hclge]
      [14942.738907] CPU: 1 PID: 26629 Comm: kworker/u4:13 Tainted: G           O      4.18.0-rc1-12928-ga960791-dirty #145
      [14942.749491] Hardware name: Huawei Technologies Co., Ltd. D05/D05, BIOS Hi1620 FPGA TB BOOT BIOS B763 08/17/2018
      [14942.760392] Workqueue: events_power_efficient phy_state_machine
      [14942.766644] pstate: 80c00009 (Nzcv daif +PAN +UAO)
      [14942.771918] pc : test_and_set_bit+0x18/0x38
      [14942.776589] lr : netif_carrier_off+0x24/0x70
      [14942.781033] sp : ffff0000121abd20
      [14942.784518] x29: ffff0000121abd20 x28: 0000000000000000
      [14942.790208] x27: ffff0000164d3cd8 x26: ffff8021da68b7b8
      [14942.795832] x25: 0000000000000000 x24: ffff8021eb407800
      [14942.801445] x23: 0000000000000000 x22: 0000000000000000
      [14942.807046] x21: 0000000000000001 x20: 0000000000000000
      [14942.812672] x19: 0000000000000000 x18: ffff000009781708
      [14942.818284] x17: 00000000004970e8 x16: ffff00000816ad48
      [14942.823900] x15: 0000000000000000 x14: 0000000000000008
      [14942.829528] x13: 0000000000000000 x12: 0000000000000f65
      [14942.835149] x11: 0000000000000001 x10: 00000000000009d0
      [14942.840753] x9 : ffff0000121abaa0 x8 : 0000000000000000
      [14942.846360] x7 : ffff000009781708 x6 : 0000000000000003
      [14942.851970] x5 : 0000000000000020 x4 : 0000000000000004
      [14942.857575] x3 : 0000000000000002 x2 : 0000000000000001
      [14942.863180] x1 : 0000000000000048 x0 : 0000000000000000
      [14942.868875] Process kworker/u4:13 (pid: 26629, stack limit = 0x00000000c909dbf3)
      [14942.876464] Call trace:
      [14942.879200]  test_and_set_bit+0x18/0x38
      [14942.883376]  phy_link_change+0x38/0x78
      [14942.887378]  phy_state_machine+0x3dc/0x4f8
      [14942.891968]  process_one_work+0x158/0x470
      [14942.896223]  worker_thread+0x50/0x470
      [14942.900219]  kthread+0x104/0x130
      [14942.903905]  ret_from_fork+0x10/0x1c
      [14942.907755] Code: d2800022 8b400c21 f9800031 9ac32044 (c85f7c22)
      [14942.914185] ---[ end trace 968c9e12eb740b23 ]---
      
      So this patch fixes it by modifying the timing to do phy_connect_direct()
      and phy_disconnect().
      
      Fixes: 256727da ("net: hns3: Add MDIO support to HNS3 Ethernet driver for hip08 SoC")
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c8a8045b
    • Y
      net: hns3: only support tc 0 for VF · de67a690
      Yunsheng Lin 提交于
      When the VF shares the same TC config as PF, the business
      running on PF and VF must have samiliar module.
      
      For simplicity, we are not considering VF sharing the same tc
      configuration as PF use case, so this patch removes the support
      of TC configuration from VF and forcing VF to just use single
      TC.
      Signed-off-by: NYunsheng Lin <linyunsheng@huawei.com>
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      de67a690
    • H
      net: hns3: change hnae3_register_ae_dev() to int · 74354140
      Huazhong Tan 提交于
      hnae3_register_ae_dev() may fail, and it should return a error code
      to its caller, so change hnae3_register_ae_dev() return type to int.
      
      Also, when hnae3_register_ae_dev() return error, hns3_probe() should
      do some error handling and return the error code.
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      74354140
    • P
      net: hns3: use the correct interface to stop|open port · fc0c174f
      Peng Li 提交于
      dev_close() stop the netdev and the service base on the netdev
      will stop. But ndev->netdev_ops->ndo_stop() may only stop HW
      and stack queue, the service base on the netdev can still work.
      
      Fixes: 5668abda ("net: hns3: add support for set_ringparam")
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fc0c174f
    • J
      net: hns3: fix VF dump register issue · 8e1445a6
      Jian Shen 提交于
      In original codes, the .get_regs_len and .get_regs were missed
      assigned. This patch fixes it.
      
      Fixes: 1600c3e5 ("net: hns3: Support "ethtool -d" for HNS3 VF driver")
      Signed-off-by: NJian Shen <shenjian15@huawei.com>
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8e1445a6
    • L
      net: hns3: reuse the definition of l3 and l4 header info union · 1a6e552d
      liyongxin 提交于
      Union l3_hdr_info and l4_hdr_info have already been defined in
      the hns3_enet.h, so it is unnecessary to define them elsewhere.
      
      This patch removes the redundant definition, and reuses the one
      defined in the hns3_enet.h.
      Signed-off-by: Nliyongxin <liyongxin1@huawei.com>
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1a6e552d
  2. 28 1月, 2019 3 次提交
  3. 27 1月, 2019 12 次提交
  4. 24 1月, 2019 12 次提交
  5. 19 1月, 2019 6 次提交