1. 01 Feb, 2019 30 commits
  2. 31 Jan, 2019 2 commits
    • Heiner Kallweit's avatar
      r8169: improve WoL handling · fa6821cb
      Heiner Kallweit authored
      WoL handling for the RTL8168 family is a little bit tricky because of
      different types of broken BIOS and/or chip quirks.
      
      Two known issues:
      1. Network properly resumes from suspend only if WoL is enabled in the chip.
      2. Some notebooks wake up immediately if system is suspended and network
         device is wakeup-enabled.
      
      Few patches tried to deal with this:
      7edf6d31 ("r8169: disable WOL per default")
      18041b52 ("r8169: restore previous behavior to accept BIOS WoL
      settings")
      
      Currently we have the situation that the chip WoL settings as set by
      the BIOS are respected (to prevent issue 1), but the device doesn't get
      wakeup-enabled (to prevent issue 2).
      
      This leads to another issue:
      If systemd is told to set WoL it first checks whether the requested
      settings are active already (and does nothing if yes). Due to the chip
      WoL flags being set properly systemd assumes that WoL is configured
      properly in our case. Result is that device doesn't get wakeup-enabled
      and WoL doesn't work (until it's set e.g. by ethtool).
      
      This patch now:
      - leaves the chip WoL settings as is (to prevent issue 1)
      - keeps the behavior to not wakeup-enable the device initially
        (to prevent issue 2)
      - In addition we report WoL as being disabled in get_wol, matching
        that device isn't wakeup-enabled. If systemd is told to enable WoL,
        it will therefore detect that it has to do something and will
        call set_wol.
      
      Of course the user still has the option to override this with
      e.g. ethtool.
      
      v2:
      - Don't just exclude __rtl8169_get_wol() from compiling, remove it.
      v3:
      - adjust commit message
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fa6821cb
    • Julian Wiedmann's avatar
      macvlan: use netif_is_macvlan_port() · 913564fb
      Julian Wiedmann authored
      Replace the macvlan_port_exists() macro with its twin from netdevice.h
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      913564fb
  3. 30 Jan, 2019 8 commits
    • David S. Miller's avatar
      Merge branch 'hns3-next' · 630afc77
      David S. Miller authored
      Huazhong Tan says:
      
      ====================
      code optimizations & bugfixes for HNS3 driver
      
      This patchset includes bugfixes and code optimizations for the HNS3
      ethernet controller driver
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      630afc77
    • Jian Shen's avatar
      net: hns3: keep flow director state unchanged when reset · 9abeb7d8
      Jian Shen authored
      In orginal codes, driver always enables flow director when
      intializing. When user disable flow director with command
      ethtool -K, the flow director will be enabled again after
      resetting.
      
      This patch fixes it by only enabling it when first initialzing.
      
      Fixes: 6871af29 ("net: hns3: Add reset handle for flow director")
      Signed-off-by: default avatarJian Shen <shenjian15@huawei.com>
      Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
      Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9abeb7d8
    • Jian Shen's avatar
      net: hns3: stop sending keep alive msg to PF when VF is resetting · c59a85c0
      Jian Shen authored
      When VF is resetting, it can't communicate to PF with mailbox msg.
      This patch adds reset state checking before sending keep alive msg
      to PF.
      
      Fixes: a6d818e3 ("net: hns3: Add vport alive state checking support")
      Signed-off-by: default avatarJian Shen <shenjian15@huawei.com>
      Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
      Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c59a85c0
    • Peng Li's avatar
      net: hns3: fix an issue for hclgevf_ae_get_hdev · eed9535f
      Peng Li authored
      HNS3 VF driver support NIC and Roce, hdev stores NIC
      handle and Roce handle, should use correct parameter for
      container_of.
      Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
      Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      eed9535f
    • Huazhong Tan's avatar
      net: hns3: fix improper error handling in the hclge_init_ae_dev() · 9fc55413
      Huazhong Tan authored
      While hclge_init_umv_space() failed in the hclge_init_ae_dev(),
      we should undo all the operation which has been done successfully,
      the last success operation maybe hclge_mac_mdio_config(), so if
      hclge_init_umv_space() failed, we also need to undo it.
      
      Fixes: 288475b2ad01 ("{topost} net: hns3: refine umv space allocation")
      Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9fc55413
    • Jian Shen's avatar
      net: hns3: fix for rss result nonuniform · 472d7ece
      Jian Shen authored
      The rss result is more uniform when use recommended hash key from
      microsoft, instead of the one generated by netdev_rss_key_fill().
      Also using hash algorithm "xor" is better than "toeplitz".
      
      This patch modifies the default hash key and hash algorithm.
      Signed-off-by: default avatarJian Shen <shenjian15@huawei.com>
      Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
      Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      472d7ece
    • Huazhong Tan's avatar
      net: hns3: fix netif_napi_del() not do problem when unloading · e2152785
      Huazhong Tan authored
      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: default avatarHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e2152785
    • Huazhong Tan's avatar
      net: hns3: Fix NULL deref when unloading driver · c8a8045b
      Huazhong Tan authored
      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: default avatarHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c8a8045b