1. 10 8月, 2019 1 次提交
  2. 29 7月, 2019 1 次提交
  3. 26 6月, 2019 2 次提交
  4. 15 6月, 2019 2 次提交
  5. 10 6月, 2019 1 次提交
  6. 04 6月, 2019 2 次提交
  7. 27 5月, 2019 1 次提交
  8. 04 5月, 2019 3 次提交
    • J
      net: hns3: add support for FEC encoding control · 7e6ec914
      Jian Shen 提交于
      This patch adds support for FEC encoding control, user can change
      FEC mode by command ethtool --set-fec, and get FEC mode by command
      ethtool --show-fec. The fec capability is changed follow the port
      speed. If autoneg on, the user configure fec mode will be overwritten
      by autoneg result.
      Signed-off-by: NJian Shen <shenjian15@huawei.com>
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7e6ec914
    • J
      net: hns3: add autoneg and change speed support for fibre port · 22f48e24
      Jian Shen 提交于
      Previously, our driver only supports phydev to autoneg or change
      port speed. This patch adds support for fibre port, driver gets
      media speed capability and autoneg capability from firmware. If
      the media supports multiple speeds, user can change port speed
      with command "ethtool -s <devname> speed xxxx autoneg off duplex
      full". If autoneg on, the user configuration may be overwritten
      by the autoneg result.
      Signed-off-by: NJian Shen <shenjian15@huawei.com>
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      22f48e24
    • J
      net: hns3: add support for multiple media type · 88d10bd6
      Jian Shen 提交于
      Previously, we can only identify copper and fiber type, the
      supported link modes of port information are always showing
      SR type. This patch adds support for multiple media types,
      include SR, LR CR, KR. Driver needs to query the media type
      from firmware periodicly, and updates the port information.
      
      The new port information looks like this:
      Settings for eth0:
              Supported ports: [ FIBRE ]
              Supported link modes:   25000baseCR/Full
                                      25000baseSR/Full
                                      1000baseX/Full
                                      10000baseCR/Full
                                      10000baseSR/Full
                                      10000baseLR/Full
              Supported pause frame use: Symmetric
              Supports auto-negotiation: No
              Supported FEC modes: None BaseR
              Advertised link modes:  Not reported
              Advertised pause frame use: No
              Advertised auto-negotiation: No
              Advertised FEC modes: Not reported
              Speed: 10000Mb/s
              Duplex: Full
              Port: FIBRE
              PHYAD: 0
              Transceiver: internal
              Auto-negotiation: off
              Current message level: 0x00000036 (54)
                                     probe link ifdown ifup
              Link detected: yes
      
      In order to be compatible with old firmware which only support
      sfp speed, we remained using the same query command, and kept
      the former logic.
      Signed-off-by: NJian Shen <shenjian15@huawei.com>
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      88d10bd6
  9. 20 4月, 2019 2 次提交
  10. 15 4月, 2019 2 次提交
    • J
      net: hns3: fix VLAN offload handle for VLAN inserted by port · 44e626f7
      Jian Shen 提交于
      Currently, in TX direction, driver implements the TX VLAN offload
      by checking the VLAN header in skb, and filling it into TX descriptor.
      Usually it works well, but if enable inserting VLAN header based on
      port, it may conflict when out_tag field of TX descriptor is already
      used, and cause RAS error.
      
      In RX direction, hardware supports stripping max two VLAN headers.
      For vlan_tci in skb can only store one VLAN tag, when RX VLAN offload
      enabled, driver tells hardware to strip one VLAN header from RX
      packet; when RX VLAN offload disabled, driver tells hardware not to
      strip VLAN header from RX packet. Now if port based insert VLAN
      enabled, all RX packets will have the port based VLAN header. This
      header is useless for stack, driver needs to ask hardware to strip
      it. Unfortunately, hardware can't drop this VLAN header, and always
      fill it into RX descriptor, so driver has to identify and drop it.
      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>
      44e626f7
    • J
      net: hns3: modify VLAN initialization to be compatible with port based VLAN · 741fca16
      Jian Shen 提交于
      Our hardware supports inserting a specified VLAN header for each
      function when sending packets. User can enable it with command
      "ip link set <devname> vf  <vfid> vlan <vlan id>".
      For this VLAN header is inserted by hardware, not from stack,
      hardware also needs to strip it from received packets before
      sending to stack.  In this case, driver needs to tell
      hardware which VLAN to insert or strip.
      
      The current VLAN initialization doesn't allow inserting
      VLAN header by hardware, this patch modifies it, in order be
      compatible with VLAN inserted base on port.
      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>
      741fca16
  11. 10 3月, 2019 1 次提交
  12. 25 2月, 2019 1 次提交
  13. 03 2月, 2019 1 次提交
  14. 31 1月, 2019 2 次提交
    • 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
    • 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
  15. 27 1月, 2019 1 次提交
  16. 24 1月, 2019 1 次提交
  17. 19 1月, 2019 2 次提交
  18. 20 12月, 2018 1 次提交
  19. 16 12月, 2018 1 次提交
  20. 08 12月, 2018 2 次提交
  21. 24 11月, 2018 2 次提交
    • L
      net: hns3: Add "FD flow table" info query function · 3c666b58
      liuzhongzhu 提交于
      All the Flow Director rules are stored in tcam blocks.
      For each bit of tcam entry, the match value
      depends on two input value(x, y).
      
      debugfs command:
      echo dump fd tcam > cmd
      
      Sample output:
      root@(none)# echo dump fd tcam > cmd
      hns3 0000:7d:00.0: read result tcam key x(31):
      hns3 0000:7d:00.0: 00000000
      hns3 0000:7d:00.0: 00000000
      hns3 0000:7d:00.0: 00000000
      hns3 0000:7d:00.0: 08000000
      hns3 0000:7d:00.0: 00000600
      hns3 0000:7d:00.0: 00000000
      hns3 0000:7d:00.0: 00000000
      hns3 0000:7d:00.0: 00000000
      hns3 0000:7d:00.0: 00000000
      hns3 0000:7d:00.0: 00000000
      hns3 0000:7d:00.0: 00000000
      hns3 0000:7d:00.0: 00000000
      hns3 0000:7d:00.0: 00000000
      hns3 0000:7d:00.0: read result tcam key y(31):
      hns3 0000:7d:00.0: 00000000
      hns3 0000:7d:00.0: 00000000
      hns3 0000:7d:00.0: 00000000
      hns3 0000:7d:00.0: f7ff0000
      hns3 0000:7d:00.0: 0000f900
      hns3 0000:7d:00.0: 00000000
      hns3 0000:7d:00.0: 00000000
      hns3 0000:7d:00.0: 00000000
      hns3 0000:7d:00.0: 00000000
      hns3 0000:7d:00.0: 00000000
      hns3 0000:7d:00.0: 00000000
      hns3 0000:7d:00.0: 00000000
      hns3 0000:7d:00.0: 0000fff8
      root@(none)#
      Signed-off-by: Nliuzhongzhu <liuzhongzhu@huawei.com>
      Signed-off-by: NSalil Mehta <salil.mehta@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3c666b58
    • L
      net: hns3: Add debugfs framework registration · b2292360
      liuzhongzhu 提交于
      Add the debugfs framework to the driver and create a debugfs
      command interface for each device.
      
      example command:
      "echo queue info > cmd" Query the packet forwarding queue information.
      Signed-off-by: Nliuzhongzhu <liuzhongzhu@huawei.com>
      Signed-off-by: NSalil Mehta <salil.mehta@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b2292360
  22. 18 11月, 2018 1 次提交
  23. 16 11月, 2018 2 次提交
  24. 10 11月, 2018 3 次提交
    • H
      net: hns3: add PCIe FLR support for PF · 6b9a97ee
      Huazhong Tan 提交于
      This patch implements the .reset_prepare and .reset_done
      ops from pci framework to support the PF FLR.
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6b9a97ee
    • H
      net: hns3: add reset handling for VF when doing PF reset · aa5c4f17
      Huazhong Tan 提交于
      When PF performs a function reset, the hardware will reset both PF
      and all the VF belong to this PF. Hence, both PF's driver and VF's
      driver need to perform corresponding reset operations.
      
      Before PF driver asserting function reset to hardware, it firstly
      set up VF's hardware reset status, and inform the VF driver with
      HNAE3_VF_PF_FUNC_RESET, then VF driver sets this reset type to
      reset_pending and shechule reset task to stop IO and waits for the
      hardware reset status to clear. When PF driver has reinitialized the
      hardware and is ready to process mailbox from VF, PF driver clears
      VF's hardware reset status for VF to continue its reset process.
      
      Also, this patch uses readl_poll_timeout to simplify the hardware reset
      status waitting.
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NYunsheng Lin <linyunsheng@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      aa5c4f17
    • H
      net: hns3: adjust VF's reset process · dea846e8
      Huazhong Tan 提交于
      Currently when VF need to reset itself, it will send a cmd to PF,
      after receiving the VF reset requset, PF sends a cmd to inform
      VF to enter the reset process and send a cmd to firmware to do the
      actual reset for the VF, it is possible that firmware has resetted
      the VF, but VF has not entered the reset process, which may cause
      IO not stopped problem when firmware is resetting VF.
      
      This patch fixes it by adjusting the VF reset process, when VF
      need to reset itself, it will enter the reset process first, and
      it will tell the PF to send cmd to firmware to reset itself.
      
      Add member reset_pending to struct hclgevf_dev, which indicates that
      there is reset event need to be processed by the VF's reset task, and
      the VF's reset task chooses the highest-level one and clears other
      low-level one when it processes reset_pending.
      
      hclge_inform_reset_assert_to_vf function is unused now, but it will
      be used to support the PF reset with VF working, so declare it in
      the header file.
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NYunsheng Lin <linyunsheng@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      dea846e8
  25. 08 11月, 2018 2 次提交