1. 23 5月, 2018 11 次提交
    • E
      tcp: do not aggressively quick ack after ECN events · 522040ea
      Eric Dumazet 提交于
      ECN signals currently forces TCP to enter quickack mode for
      up to 16 (TCP_MAX_QUICKACKS) following incoming packets.
      
      We believe this is not needed, and only sending one immediate ack
      for the current packet should be enough.
      
      This should reduce the extra load noticed in DCTCP environments,
      after congestion events.
      
      This is part 2 of our effort to reduce pure ACK packets.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Acked-by: NSoheil Hassas Yeganeh <soheil@google.com>
      Acked-by: NYuchung Cheng <ycheng@google.com>
      Acked-by: NNeal Cardwell <ncardwell@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      522040ea
    • E
      tcp: add max_quickacks param to tcp_incr_quickack and tcp_enter_quickack_mode · 9a9c9b51
      Eric Dumazet 提交于
      We want to add finer control of the number of ACK packets sent after
      ECN events.
      
      This patch is not changing current behavior, it only enables following
      change.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Acked-by: NSoheil Hassas Yeganeh <soheil@google.com>
      Acked-by: NNeal Cardwell <ncardwell@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9a9c9b51
    • V
      net: sched: don't disable bh when accessing action idr · 290aa0ad
      Vlad Buslov 提交于
      Initial net_device implementation used ingress_lock spinlock to synchronize
      ingress path of device. This lock was used in both process and bh context.
      In some code paths action map lock was obtained while holding ingress_lock.
      Commit e1e992e5 ("[NET_SCHED] protect action config/dump from irqs")
      modified actions to always disable bh, while using action map lock, in
      order to prevent deadlock on ingress_lock in softirq. This lock was removed
      from net_device, so disabling bh, while accessing action map, is no longer
      necessary.
      
      Replace all action idr spinlock usage with regular calls that do not
      disable bh.
      Signed-off-by: NVlad Buslov <vladbu@mellanox.com>
      Acked-by: NJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      290aa0ad
    • D
      Merge branch 'net-ipv6-Fix-route-append-and-replace-use-cases' · 73bf1fc5
      David S. Miller 提交于
      David Ahern says:
      
      ====================
      net/ipv6: Fix route append and replace use cases
      
      This patch set fixes a few append and replace uses cases for IPv6 and
      adds test cases that codifies the expectations of how append and replace
      are expected to work. In paricular it allows a multipath route to have
      a dev-only nexthop, something Thomas tried to accomplish with commit
      edd7ceb7 ("ipv6: Allow non-gateway ECMP for IPv6") which had to be
      reverted because of breakage, and to replace an existing FIB entry
      with a reject route.
      
      There are a number of inconsistent and surprising aspects to the Linux
      API for adding, deleting, replacing and changing FIB entries. For example,
      with IPv4 NLM_F_APPEND means insert the route after any existing entries
      with the same key (prefix + priority + TOS for IPv4) and NLM_F_CREATE
      without the append flag inserts the new route before any existing entries.
      
      IPv6 on the other hand attempts to guess whether a new route should be
      appended to an existing one, possibly creating a multipath route, or to
      add a new entry after any existing ones. This applies to both the 'append'
      (NLM_F_CREATE + NLM_F_APPEND) and 'prepend' (NLM_F_CREATE only) cases
      meaning for IPv6 the NLM_F_APPEND is basically ignored. This guessing
      whether the route should be added to a multipath route (gateway routes)
      or inserted after existing entries (non-gateway based routes) means a
      multipath route can not have a dev only nexthop (potentially required in
      some cases - tunnels or VRF route leaking for example) and route 'replace'
      is a bit adhoc treating gateway based routes and dev-only / reject routes
      differently.
      
      This has led to frustration with developers working on routing suites
      such as FRR where workarounds such as delete and add are used instead of
      replace.
      
      After this patch set there are 2 differences between IPv4 and IPv6:
      1. 'ip ro prepend' = NLM_F_CREATE only
          IPv4 adds the new route before any existing ones
          IPv6 adds new route after any existing ones
      
      2. 'ip ro append' = NLM_F_CREATE|NLM_F_APPEND
         IPv4 adds the new route after any existing ones
         IPv6 adds the nexthop to existing routes converting to multipath
      
      For the former, there are cases where we want same prefix routes added
      after existing ones (e.g., multicast, prefix routes for macvlan when used
      for virtual router redundancy). Requiring the APPEND flag to add a new
      route to an existing one helps here but is a slight change in behavior
      since prepend with gateway routes now create a separate entry.
      
      For the latter IPv6 behavior is preferred - appending a route for the same
      prefix and metric to make a multipath route, so really IPv4 not allowing an
      existing route to be updated is the limiter. This will be fixed when
      nexthops become separate objects - a future patch set.
      
      Thank you to Thomas and Ido for testing earlier versions of this set, and
      to Ido for providing an update to the mlxsw driver.
      
      Changes since RFC
      - cleanup wording in test script; add comments about expected failures
        and why
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      73bf1fc5
    • D
      selftests: fib_tests: Add ipv4 route add append replace tests · abb1860a
      David Ahern 提交于
      Add IPv4 route tests covering add, append and replace permutations.
      Assumes the ability to add a basic single path route works; this is
      required for example when adding an address to an interface.
      
      $ fib_tests.sh -t ipv4_rt
      
      IPv4 route add / append tests
          TEST: Attempt to add duplicate route - gw                           [ OK ]
          TEST: Attempt to add duplicate route - dev only                     [ OK ]
          TEST: Attempt to add duplicate route - reject route                 [ OK ]
          TEST: Add new nexthop for existing prefix                           [ OK ]
          TEST: Append nexthop to existing route - gw                         [ OK ]
          TEST: Append nexthop to existing route - dev only                   [ OK ]
          TEST: Append nexthop to existing route - reject route               [ OK ]
          TEST: Append nexthop to existing reject route - gw                  [ OK ]
          TEST: Append nexthop to existing reject route - dev only            [ OK ]
          TEST: add multipath route                                           [ OK ]
          TEST: Attempt to add duplicate multipath route                      [ OK ]
          TEST: Route add with different metrics                              [ OK ]
          TEST: Route delete with metric                                      [ OK ]
      
      IPv4 route replace tests
          TEST: Single path with single path                                  [ OK ]
          TEST: Single path with multipath                                    [ OK ]
          TEST: Single path with reject route                                 [ OK ]
          TEST: Single path with single path via multipath attribute          [ OK ]
          TEST: Invalid nexthop                                               [ OK ]
          TEST: Single path - replace of non-existent route                   [ OK ]
          TEST: Multipath with multipath                                      [ OK ]
          TEST: Multipath with single path                                    [ OK ]
          TEST: Multipath with single path via multipath attribute            [ OK ]
          TEST: Multipath with reject route                                   [ OK ]
          TEST: Multipath - invalid first nexthop                             [ OK ]
          TEST: Multipath - invalid second nexthop                            [ OK ]
          TEST: Multipath - replace of non-existent route                     [ OK ]
      Signed-off-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      abb1860a
    • D
      selftests: fib_tests: Add ipv6 route add append replace tests · f9a5a9d8
      David Ahern 提交于
      Add IPv6 route tests covering add, append and replace permutations.
      Assumes the ability to add a basic single path route works; this is
      required for example when adding an address to an interface.
      
      $ fib_tests.sh -t ipv6_rt
      
      IPv6 route add / append tests
          TEST: Attempt to add duplicate route - gw                           [ OK ]
          TEST: Attempt to add duplicate route - dev only                     [ OK ]
          TEST: Attempt to add duplicate route - reject route                 [ OK ]
          TEST: Add new route for existing prefix (w/o NLM_F_EXCL)            [ OK ]
          TEST: Append nexthop to existing route - gw                         [ OK ]
          TEST: Append nexthop to existing route - dev only                   [ OK ]
          TEST: Append nexthop to existing route - reject route               [ OK ]
          TEST: Append nexthop to existing reject route - gw                  [ OK ]
          TEST: Append nexthop to existing reject route - dev only            [ OK ]
          TEST: Add multipath route                                           [ OK ]
          TEST: Attempt to add duplicate multipath route                      [ OK ]
          TEST: Route add with different metrics                              [ OK ]
          TEST: Route delete with metric                                      [ OK ]
      
      IPv6 route replace tests
          TEST: Single path with single path                                  [ OK ]
          TEST: Single path with multipath                                    [ OK ]
          TEST: Single path with reject route                                 [ OK ]
          TEST: Single path with single path via multipath attribute          [ OK ]
          TEST: Invalid nexthop                                               [ OK ]
          TEST: Single path - replace of non-existent route                   [ OK ]
          TEST: Multipath with multipath                                      [ OK ]
          TEST: Multipath with single path                                    [ OK ]
          TEST: Multipath with single path via multipath attribute            [ OK ]
          TEST: Multipath with reject route                                   [ OK ]
          TEST: Multipath - invalid first nexthop                             [ OK ]
          TEST: Multipath - invalid second nexthop                            [ OK ]
          TEST: Multipath - replace of non-existent route                     [ OK ]
      Signed-off-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f9a5a9d8
    • D
      selftests: fib_tests: Add option to pause after each test · 7df15e6c
      David Ahern 提交于
      Add option to pause after each test before cleanup is done. Allows
      user to do manual inspection or more ad-hoc testing after each test
      with the setup in tact.
      Signed-off-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7df15e6c
    • D
      selftests: fib_tests: Add command line options · 1c7447b4
      David Ahern 提交于
      Add command line options for controlling pause on fail, controlling
      specific tests to run and verbose mode rather than relying on environment
      variables.
      Signed-off-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1c7447b4
    • D
      selftests: fib_tests: Add success-fail counts · 37ce42c1
      David Ahern 提交于
      As more tests are added, it is convenient to have a tally at the end.
      Signed-off-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      37ce42c1
    • D
      net/ipv6: Simplify route replace and appending into multipath route · f34436a4
      David Ahern 提交于
      Bring consistency to ipv6 route replace and append semantics.
      
      Remove rt6_qualify_for_ecmp which is just guess work. It fails in 2 cases:
      1. can not replace a route with a reject route. Existing code appends
         a new route instead of replacing the existing one.
      
      2. can not have a multipath route where a leg uses a dev only nexthop
      
      Existing use cases affected by this change:
      1. adding a route with existing prefix and metric using NLM_F_CREATE
         without NLM_F_APPEND or NLM_F_EXCL (ie., what iproute2 calls
         'prepend'). Existing code auto-determines that the new nexthop can
         be appended to an existing route to create a multipath route. This
         change breaks that by requiring the APPEND flag for the new route
         to be added to an existing one. Instead the prepend just adds another
         route entry.
      
      2. route replace. Existing code replaces first matching multipath route
         if new route is multipath capable and fallback to first matching
         non-ECMP route (reject or dev only route) in case one isn't available.
         New behavior replaces first matching route. (Thanks to Ido for spotting
         this one)
      
      Note: Newer iproute2 is needed to display multipath routes with a dev-only
            nexthop. This is due to a bug in iproute2 and parsing nexthops.
      Signed-off-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f34436a4
    • D
      mlxsw: spectrum_router: Add support for route append · 5a15a1b0
      David Ahern 提交于
      Handle append for gateway based routes. Dev-only multipath routes will
      be handled by a follow on patch.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5a15a1b0
  2. 22 5月, 2018 11 次提交
  3. 21 5月, 2018 18 次提交
    • L
      Merge tag 'mips_fixes_4.17_2' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/mips · 6741c4bb
      Linus Torvalds 提交于
      Pull MIPS fixes from James Hogan:
      
       - fix build with DEBUG_ZBOOT and MACH_JZ4770 (4.16)
      
       - include xilfpga FDT in fitImage and stop generating dtb.o (4.15)
      
       - fix software IO coherence on CM SMP systems (4.8)
      
       - ptrace: Fix PEEKUSR/POKEUSR to o32 FGRs (3.14)
      
       - ptrace: Expose FIR register through FP regset (3.13)
      
       - fix typo in KVM debugfs file name (3.10)
      
      * tag 'mips_fixes_4.17_2' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/mips:
        MIPS: Fix ptrace(2) PTRACE_PEEKUSR and PTRACE_POKEUSR accesses to o32 FGRs
        MIPS: xilfpga: Actually include FDT in fitImage
        MIPS: xilfpga: Stop generating useless dtb.o
        KVM: Fix spelling mistake: "cop_unsuable" -> "cop_unusable"
        MIPS: ptrace: Expose FIR register through FP regset
        MIPS: Fix build with DEBUG_ZBOOT and MACH_JZ4770
        MIPS: c-r4k: Fix data corruption related to cache coherence
      6741c4bb
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 5aef268a
      Linus Torvalds 提交于
      Pull networking fixes from David Miller:
      
       1) Fix refcounting bug for connections in on-packet scheduling mode of
          IPVS, from Julian Anastasov.
      
       2) Set network header properly in AF_PACKET's packet_snd, from Willem
          de Bruijn.
      
       3) Fix regressions in 3c59x by converting to generic DMA API. It was
          relying upon the hack that the PCI DMA interfaces would accept NULL
          for EISA devices. From Christoph Hellwig.
      
       4) Remove RDMA devices before unregistering netdev in QEDE driver, from
          Michal Kalderon.
      
       5) Use after free in TUN driver ptr_ring usage, from Jason Wang.
      
       6) Properly check for missing netlink attributes in SMC_PNETID
          requests, from Eric Biggers.
      
       7) Set DMA mask before performaing any DMA operations in vmxnet3
          driver, from Regis Duchesne.
      
       8) Fix mlx5 build with SMP=n, from Saeed Mahameed.
      
       9) Classifier fixes in bcm_sf2 driver from Florian Fainelli.
      
      10) Tuntap use after free during release, from Jason Wang.
      
      11) Don't use stack memory in scatterlists in tls code, from Matt
          Mullins.
      
      12) Not fully initialized flow key object in ipv4 routing code, from
          David Ahern.
      
      13) Various packet headroom bug fixes in ip6_gre driver, from Petr
          Machata.
      
      14) Remove queues from XPS maps using correct index, from Amritha
          Nambiar.
      
      15) Fix use after free in sock_diag, from Eric Dumazet.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (64 commits)
        net: ip6_gre: fix tunnel metadata device sharing.
        cxgb4: fix offset in collecting TX rate limit info
        net: sched: red: avoid hashing NULL child
        sock_diag: fix use-after-free read in __sk_free
        sh_eth: Change platform check to CONFIG_ARCH_RENESAS
        net: dsa: Do not register devlink for unused ports
        net: Fix a bug in removing queues from XPS map
        bpf: fix truncated jump targets on heavy expansions
        bpf: parse and verdict prog attach may race with bpf map update
        bpf: sockmap update rollback on error can incorrectly dec prog refcnt
        net: test tailroom before appending to linear skb
        net: ip6_gre: Fix ip6erspan hlen calculation
        net: ip6_gre: Split up ip6gre_changelink()
        net: ip6_gre: Split up ip6gre_newlink()
        net: ip6_gre: Split up ip6gre_tnl_change()
        net: ip6_gre: Split up ip6gre_tnl_link_config()
        net: ip6_gre: Fix headroom request in ip6erspan_tunnel_xmit()
        net: ip6_gre: Request headroom in __gre6_xmit()
        selftests/bpf: check return value of fopen in test_verifier.c
        erspan: fix invalid erspan version.
        ...
      5aef268a
    • D
      mv88e6xxx: Fix uninitialized variable warning. · 7ddae24f
      David S. Miller 提交于
      In mv88e6xxx_probe(), ("np" or "pdata") might be an invariant
      but GCC can't see that, therefore:
      
      drivers/net/dsa/mv88e6xxx/chip.c: In function ‘mv88e6xxx_probe’:
      drivers/net/dsa/mv88e6xxx/chip.c:4420:13: warning: ‘compat_info’ may be used uninitialized in this function [-Wmaybe-uninitialized]
        chip->info = compat_info;
      
      Actually, it should have warned on the "if (!compat_info)" test, but
      whatever.
      
      Explicitly initialize to NULL in the variable declaration to
      deal with this.
      
      Fixes: 877b7cb0 ("net: dsa: mv88e6xxx: Add minimal platform_data support")
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7ddae24f
    • F
      net: dsa: b53: Extend platform data to include DSA ports · bf3c592b
      Florian Fainelli 提交于
      The b53 driver already defines and internally uses platform data to let the
      glue drivers specify parameters such as the chip id.  What we were missing was
      a way to tell the core DSA layer about the ports and their type.
      
      Place a dsa_chip_data structure at the beginning of b53_platform_data for
      dsa_register_switch() to access it. This does not require modifications to
      b53_common.c which will pass platform_data trough.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bf3c592b
    • D
      Merge branch 'mv88exxx-pdata' · bf4bd7a7
      David S. Miller 提交于
      Andrew Lunn says:
      
      ====================
      Platform data support for mv88exxx
      
      There are a few Intel based platforms making use of the mv88exxx.
      These don't easily have access to device tree in order to instantiate
      the switch driver. These patches allow the use of platform data to
      hold the configuration.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bf4bd7a7
    • A
      net: dsa: mv88e6xxx: Add support for EEPROM via platform data · 00baabe5
      Andrew Lunn 提交于
      Add the size of the EEPROM to the platform data, so it can also be
      instantiated by a platform device.
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      00baabe5
    • A
      net: dsa: mv88e6xxx: Add minimal platform_data support · 877b7cb0
      Andrew Lunn 提交于
      Not all the world uses device tree. Some parts of the world still use
      platform devices and platform data. Add basic support for probing a
      Marvell switch via platform data.
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      877b7cb0
    • A
      net: dsa: mv88e6xxx: Remove OF check for IRQ domain · 577941eb
      Andrew Lunn 提交于
      An IRQ domain will work without an OF node. It is not possible to
      reference interrupts via a phandle, but C code can still use
      irq_find_mapping() to get an interrupt from the domain.
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      577941eb
    • D
      Merge branch 'sh_eth-typos' · 81ee33d8
      David S. Miller 提交于
      Sergei Shtylyov says:
      
      ====================
      sh_eth: fix typos/grammar
      
      Here's a set of 3 patches against DaveM's 'net-next.git' repo plus the R8A77980
      support patches posted earlier. They fix the comments typos/grammar and another
      typo in the EESR bit...
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      81ee33d8
    • S
      sh_eth: fix typo in comment to BCULR write · 6b14787a
      Sergei Shtylyov 提交于
      Simon has noticed a typo in the comment accompaining the BCULR write --
      fix it and move the comment before the write (following the style of
      the other comments), while at it...
      Reported-by: NSimon Horman <horms@verge.net.au>
      Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6b14787a
    • S
      sh_eth: fix comment grammar in 'struct sh_eth_cpu_data' · 9c59c9a8
      Sergei Shtylyov 提交于
      All the verbs in the comments to the 'struct sh_eth_cpu_data' declaration
      should  be in a  3rd person singular, to match the nouns.
      Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9c59c9a8
    • S
      sh_eth: fix typo in EESR.TRO bit name · 27164491
      Sergei Shtylyov 提交于
      The  correct name of the EESR bit 8 is TRO (transmit retry over), not RTO.
      Note that EESIPR bit 8, TROIP remained correct...
      Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      27164491
    • D
      Merge branch 'hns3-next' · 6c8598b7
      David S. Miller 提交于
      Salil Mehta says:
      
      ====================
      Misc. bug fixes and cleanup for HNS3 driver
      
      This patch-set presents miscellaneous bug fixes and cleanups found
      during internal review, system testing and cleanup.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6c8598b7
    • Y
      net: hns3: Fix for CMDQ and Misc. interrupt init order problem · eddf0462
      Yunsheng Lin 提交于
      When vf module is loading, the cmd queue initialization should
      happen before misc interrupt initialization, otherwise the misc
      interrupt handle will cause using uninitialized cmd queue problem.
      There is also the same issue when vf module is unloading.
      
      This patch fixes it by adjusting the location of some function.
      
      Fixes: e2cb1dec ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support")
      Signed-off-by: NYunsheng Lin <linyunsheng@huawei.com>
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NSalil Mehta <salil.mehta@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      eddf0462
    • X
      net: hns3: Fixes kernel panic issue during rmmod hns3 driver · 7bb572fd
      Xi Wang 提交于
      If CONFIG_ARM_SMMU_V3 is enabled, arm64's dma_ops will replace
      arm64_swiotlb_dma_ops with iommu_dma_ops. When releasing contiguous
      dma memory, the new ops will call the vunmap function which cannot
      be run in interrupt context.
      
      Currently, spin_lock_bh is called before vunmap is executed. This
      disables BH and causes the interrupt context to be detected to
      generate a kernel panic like below:
      
      [ 2831.573400] kernel BUG at mm/vmalloc.c:1621!
      [ 2831.577659] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
      ...
      [ 2831.699907] Process rmmod (pid: 1893, stack limit = 0x0000000055103ee2)
      [ 2831.706507] Call trace:
      [ 2831.708941]  vunmap+0x48/0x50
      [ 2831.711897]  dma_common_free_remap+0x78/0x88
      [ 2831.716155]  __iommu_free_attrs+0xa8/0x1c0
      [ 2831.720255]  hclge_free_cmd_desc+0xc8/0x118 [hclge]
      [ 2831.725128]  hclge_destroy_cmd_queue+0x34/0x68 [hclge]
      [ 2831.730261]  hclge_uninit_ae_dev+0x90/0x100 [hclge]
      [ 2831.735127]  hnae3_unregister_ae_dev+0xb0/0x868 [hnae3]
      [ 2831.740345]  hns3_remove+0x3c/0x90 [hns3]
      [ 2831.744344]  pci_device_remove+0x48/0x108
      [ 2831.748342]  device_release_driver_internal+0x164/0x200
      [ 2831.753553]  driver_detach+0x4c/0x88
      [ 2831.757116]  bus_remove_driver+0x60/0xc0
      [ 2831.761026]  driver_unregister+0x34/0x60
      [ 2831.764935]  pci_unregister_driver+0x30/0xb0
      [ 2831.769197]  hns3_exit_module+0x10/0x978 [hns3]
      [ 2831.773715]  SyS_delete_module+0x1f8/0x248
      [ 2831.777799]  el0_svc_naked+0x30/0x34
      
      This patch fixes it by using spin_lock instead of spin_lock_bh.
      
      Fixes: 68c0a5c7 ("net: hns3: Add HNS3 IMP(Integrated Mgmt Proc) Cmd Interface Support")
      Signed-off-by: NXi Wang <wangxi11@huawei.com>
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NSalil Mehta <salil.mehta@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7bb572fd
    • F
      net: hns3: Fix for netdev not running problem after calling net_stop and net_open · f30dfddc
      Fuyun Liang 提交于
      The link status update function is called by timer every second. But
      net_stop and net_open may be called with very short intervals. The link
      status update function can not detect the link state has changed. It
      causes the netdev not running problem.
      
      This patch fixes it by updating the link state in ae_stop function.
      
      Fixes: 46a3df9f ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
      Signed-off-by: NFuyun Liang <liangfuyun1@huawei.com>
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NSalil Mehta <salil.mehta@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f30dfddc
    • H
      net: hns3: Use enums instead of magic number in hclge_is_special_opcode · 42687543
      Huazhong Tan 提交于
      This patch does bit of a clean-up by using already defined enums for
      certain values in function hclge_is_special_opcode(). Below enums from
      have been used as replacements for magic values:
      
      enum hclge_opcode_type{
      	<snip>
      	HCLGE_OPC_STATS_64_BIT		= 0x0030,
      	HCLGE_OPC_STATS_32_BIT		= 0x0031,
      	HCLGE_OPC_STATS_MAC		= 0x0032,
      	<snip>
      };
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NSalil Mehta <salil.mehta@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      42687543
    • X
      net: hns3: Fix for hns3 module is loaded multiple times problem · 3c7624d8
      Xi Wang 提交于
      If the hns3 driver has been built into kernel and then loaded with
      the same driver which built as KLM, it may trigger an error like
      below:
      
      [   20.009555] hns3: Hisilicon Ethernet Network Driver for Hip08 Family - version
      [   20.016789] hns3: Copyright (c) 2017 Huawei Corporation.
      [   20.022100] Error: Driver 'hns3' is already registered, aborting...
      [   23.517397] Unable to handle kernel NULL pointer dereference at virtual address 00000000
      ...
      [   23.691583] Process insmod (pid: 1982, stack limit = 0x00000000cd5f21cb)
      [   23.698270] Call trace:
      [   23.700705]  __list_del_entry_valid+0x2c/0xd8
      [   23.705049]  hnae3_unregister_client+0x68/0xa8
      [   23.709487]  hns3_init_module+0x98/0x1000 [hns3]
      [   23.714093]  do_one_initcall+0x5c/0x170
      [   23.717918]  do_init_module+0x64/0x1f4
      [   23.721654]  load_module+0x1d14/0x24b0
      [   23.725390]  SyS_init_module+0x158/0x208
      [   23.729300]  el0_svc_naked+0x30/0x34
      
      This patch fixes it by adding module version info.
      
      Fixes: 38caee9d ("net: hns3: Add support of the HNAE3 framework")
      Signed-off-by: NXi Wang <wangxi11@huawei.com>
      Signed-off-by: NSalil Mehta <salil.mehta@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3c7624d8