1. 22 2月, 2017 22 次提交
  2. 21 2月, 2017 18 次提交
    • J
      virito-net: set queues after reset during xdp_set · 017b29c3
      Jason Wang 提交于
      We set queues before reset which will cause a crash[1]. This is
      because is_xdp_raw_buffer_queue() depends on the old xdp queue pairs
      number to do the correct detection. So fix this by
      
      - passing xdp queue pairs and current queue pairs to virtnet_reset()
      - change vi->xdp_qp after reset but before refill, to make sure both
        free_unused_bufs() and refill can make correct detection of XDP.
      - remove the duplicated queue pairs setting before virtnet_reset()
        since we will do it inside virtnet_reset()
      
      [1]
      
      [   74.328168] general protection fault: 0000 [#1] SMP
      [   74.328625] Modules linked in: nfsd xfs libcrc32c virtio_net virtio_pci
      [   74.329117] CPU: 0 PID: 2849 Comm: xdp2 Not tainted 4.10.0-rc7+ #499
      [   74.329577] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.10.1-0-g8891697-prebuilt.qemu-project.org 04/01/2014
      [   74.330424] task: ffff88007a894000 task.stack: ffffc90004388000
      [   74.330844] RIP: 0010:skb_release_head_state+0x28/0x80
      [   74.331298] RSP: 0018:ffffc9000438b8d0 EFLAGS: 00010206
      [   74.331676] RAX: 0000000000000000 RBX: ffff88007ad96300 RCX: 0000000000000000
      [   74.332217] RDX: ffff88007fc137a8 RSI: ffff88007fc0db28 RDI: 0001bf00000001be
      [   74.332758] RBP: ffffc9000438b8d8 R08: 000000000005008f R09: 00000000000005f9
      [   74.333274] R10: ffff88007d001700 R11: ffffffff820a8a4d R12: ffff88007ad96300
      [   74.333787] R13: 0000000000000002 R14: ffff880036604000 R15: 000077ff80000000
      [   74.334308] FS:  00007fc70d8a7b40(0000) GS:ffff88007fc00000(0000) knlGS:0000000000000000
      [   74.334891] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   74.335314] CR2: 00007fff4144a710 CR3: 000000007ab56000 CR4: 00000000003406f0
      [   74.335830] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [   74.336373] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [   74.336895] Call Trace:
      [   74.337086]  skb_release_all+0xd/0x30
      [   74.337356]  consume_skb+0x2c/0x90
      [   74.337607]  free_unused_bufs+0x1ff/0x270 [virtio_net]
      [   74.337988]  ? vp_synchronize_vectors+0x3b/0x60 [virtio_pci]
      [   74.338398]  virtnet_xdp+0x21e/0x440 [virtio_net]
      [   74.338741]  dev_change_xdp_fd+0x101/0x140
      [   74.339048]  do_setlink+0xcf4/0xd20
      [   74.339304]  ? symcmp+0xf/0x20
      [   74.339529]  ? mls_level_isvalid+0x52/0x60
      [   74.339828]  ? mls_range_isvalid+0x43/0x50
      [   74.340135]  ? nla_parse+0xa0/0x100
      [   74.340400]  rtnl_setlink+0xd4/0x120
      [   74.340664]  ? cpumask_next_and+0x30/0x50
      [   74.340966]  rtnetlink_rcv_msg+0x7f/0x1f0
      [   74.341259]  ? sock_has_perm+0x59/0x60
      [   74.341586]  ? napi_consume_skb+0xe2/0x100
      [   74.342010]  ? rtnl_newlink+0x890/0x890
      [   74.342435]  netlink_rcv_skb+0x92/0xb0
      [   74.342846]  rtnetlink_rcv+0x23/0x30
      [   74.343277]  netlink_unicast+0x162/0x210
      [   74.343677]  netlink_sendmsg+0x2db/0x390
      [   74.343968]  sock_sendmsg+0x33/0x40
      [   74.344233]  SYSC_sendto+0xee/0x160
      [   74.344482]  ? SYSC_bind+0xb0/0xe0
      [   74.344806]  ? sock_alloc_file+0x92/0x110
      [   74.345106]  ? fd_install+0x20/0x30
      [   74.345360]  ? sock_map_fd+0x3f/0x60
      [   74.345586]  SyS_sendto+0x9/0x10
      [   74.345790]  entry_SYSCALL_64_fastpath+0x1a/0xa9
      [   74.346086] RIP: 0033:0x7fc70d1b8f6d
      [   74.346312] RSP: 002b:00007fff4144a708 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
      [   74.346785] RAX: ffffffffffffffda RBX: 00000000ffffffff RCX: 00007fc70d1b8f6d
      [   74.347244] RDX: 000000000000002c RSI: 00007fff4144a720 RDI: 0000000000000003
      [   74.347683] RBP: 0000000000000003 R08: 0000000000000000 R09: 0000000000000000
      [   74.348544] R10: 0000000000000000 R11: 0000000000000246 R12: 00007fff4144bd90
      [   74.349082] R13: 0000000000000002 R14: 0000000000000002 R15: 00007fff4144cda0
      [   74.349607] Code: 00 00 00 55 48 89 e5 53 48 89 fb 48 8b 7f 58 48 85 ff 74 0e 40 f6 c7 01 74 3d 48 c7 43 58 00 00 00 00 48 8b 7b 68 48 85 ff 74 05 <f0> ff 0f 74 20 48 8b 43 60 48 85 c0 74 14 65 8b 15 f3 ab 8d 7e
      [   74.351008] RIP: skb_release_head_state+0x28/0x80 RSP: ffffc9000438b8d0
      [   74.351625] ---[ end trace fe6e19fd11cfc80b ]---
      
      Fixes: 2de2f7f4 ("virtio_net: XDP support for adjust_head")
      Cc: John Fastabend <john.fastabend@gmail.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      017b29c3
    • M
      dpaa_eth: implement ioctl() for PHY-related ops · 1763413a
      Michael Walle 提交于
      This commit adds the ndo_do_ioctl() callback which allows the userspace to
      access PHY registers, for example. This will make mii-diag and similar
      tools work.
      Signed-off-by: NMichael Walle <michael@walle.cc>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1763413a
    • P
      net: qualcomm: qca: use new api ethtool_{get|set}_link_ksettings · 2cf8a897
      Philippe Reynes 提交于
      The ethtool api {get|set}_settings is deprecated.
      We move this driver to new api {get|set}_link_ksettings.
      
      As I don't have the hardware, I'd be very pleased if
      someone may test this patch.
      Signed-off-by: NPhilippe Reynes <tremyfr@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2cf8a897
    • D
      Merge branch 'bnxt_en-probe-and-open-bugs' · 836dacdd
      David S. Miller 提交于
      Michael Chan says:
      
      ====================
      bnxt_en: Fix probe and open bugs.
      
      Fix 3 issues related to bnxt_init_one() and bnxt_open().  Don't probe
      bridge devices and fixup some error code paths.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      836dacdd
    • S
      bnxt_en: fix pci cleanup in bnxt_init_one() failure path · 17086399
      Sathya Perla 提交于
      In the bnxt_init_one() failure path, bar1 and bar2 are not
      being unmapped.  This commit fixes this issue.  Reorganize the
      code so that bnxt_init_one()'s failure path and bnxt_remove_one()
      can call the same function to do the PCI cleanup.
      Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      17086399
    • M
      bnxt_en: Fix NULL pointer dereference in a failure path during open. · daf1f1e7
      Michael Chan 提交于
      If bnxt_hwrm_ring_free() is called during a failure path in bnxt_open(),
      it is possible that the completion rings have not been allocated yet.
      In that case, the completion doorbell has not been initialized, and
      calling bnxt_disable_int() will crash.  Fix it by checking that the
      completion ring has been initialized before writing to the completion
      ring doorbell.
      Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      daf1f1e7
    • R
      bnxt_en: Reject driver probe against all bridge devices · 4e00338a
      Ray Jui 提交于
      There are additional SoC devices that use the same device ID for
      bridge and NIC devices.  The bnxt driver should reject probe against
      all bridge devices since it's meant to be used with only endpoint
      devices.
      Signed-off-by: NRay Jui <ray.jui@broadcom.com>
      Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4e00338a
    • D
      Merge branch 'qed-bug-fixes' · 5a4dcdca
      David S. Miller 提交于
      Yuval Mintz says:
      
      ====================
      qed*: Bug fixes
      
      This is a respin of the series with same name for net-next
      instead of net [only patch #10 is changed].
      
      The 3 first patches here are a repost of
      ("qed: RoCE infrastructure fixes"). The fourth is an additional
      RoCE-related infrastructure fix, and the latter contain various fixes
      to qed/qede.
      
      Please consider applying these to `net-next'.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5a4dcdca
    • M
      qed*: Fix link indication race · 65ed2ffd
      Mintz, Yuval 提交于
      Driver changes the link properties via communication with
      the management firmware, and re-reads the resulting link status
      when it receives an indication that the link has changed.
      However, there are certain scenarios where such indications
      might be missing, and so driver also re-reads the current link
      results without attention in several places. Specifically, it
      does so during load and when resetting the link.
      
      This creates a race where driver might reflect incorrect
      link status - e.g., when explicit reading of the link status is
      switched by attention with the changed configuration.
      
      Correct this flow by a lock syncronizing the handling of the
      link indications [both explicit requests and attention].
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      65ed2ffd
    • M
      qed: Don't allocate SBs using main PTT · 85750d74
      Mintz, Yuval 提交于
      Flows accessing registers require the flow to hold a PTT entry.
      To protect 'major' load/unload flows a main_ptt is pre-allocated
      to guarantee such flows wouldn't be blocked by PTT being
      unavailable.
      
      Status block initialization currently uses the main_ptt which
      is incorrect, as this flow might run concurrently to others
      [E.g., loading qedr while toggling qede]. That would have dire
      effects as it means registers' access to device breaks and further
      read/writes might access incorrect addresses.
      
      Instead, when initializing status blocks acquire/release a PTT
      as part of the flow.
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      85750d74
    • S
      qede: Prevent index problems in loopback test · afe981d6
      Sudarsana Reddy Kalluru 提交于
      Driver currently utilizes the same loop variable in two
      nested loops.
      Signed-off-by: NSudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      afe981d6
    • M
      qed: Reflect PF link when initializing VF · 33b2fbd0
      Mintz, Yuval 提交于
      VF learns of the current link state via its bulletin board,
      which might reflect either the physical link state or some
      user-configured logical state.
      Whenever the physical link changes or whnever such a configuration
      is explicitly made by user the PF driver would update the bulletin
      that the VF reads. But if neither has happened - i.e., PF still
      hasn't got a physical link up and no additional configuration was
      done the VF wouldn't have a valid link information available.
      
      Simply reflect the physical link state whenever the VF is
      initialized. The user could then affect it however he wants.
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      33b2fbd0
    • M
      qede: Free netdevice only after stoping slowpath · 885185df
      Mintz, Yuval 提交于
      qed needs to be informed of the removal of the qede interface
      prior to its actual removal, as qede has some registered callbacks
      that might get called async to the removal flow.
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      885185df
    • M
      qede: Initialize lock and slowpath workqueue early · 0e0b80a9
      Mintz, Yuval 提交于
      Need to make sure the slowpath workqueue and the qede lock
      are ready for the registration of the netdevice, as once
      registered there's no guarantee those wouldn't be used.
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0e0b80a9
    • R
      qed: Reserve doorbell BAR space for present CPUs · c2dedf87
      Ram Amrani 提交于
      Reserving doorbell BAR space according to the currently active CPUs
      may result in a bug if disabled CPUs are later enabled but no
      doorbell space was reserved for them.
      Signed-off-by: NRam Amrani <Ram.Amrani@cavium.com>
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c2dedf87
    • R
      qed: Don't free a QP more than once · 300c0d7c
      Ram Amrani 提交于
      If QP is in reset state then there are no resources to free so avoid
      freeing any.
      Signed-off-by: NRam Amrani <Ram.Amrani@cavium.com>
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      300c0d7c
    • R
      qed: Read queue state before releasing buffer · c5212b94
      Ram Amrani 提交于
      Currently the state is read only after the buffers are relesed.
      Signed-off-by: NRam Amrani <Ram.Amrani@cavium.com>
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c5212b94
    • R
      qed: Release CQ resource under lock on failure · 670dde55
      Ram Amrani 提交于
      The CQ resource pool is protected by a spin lock. When a CQ creation
      fails it now deallocates under that lock as well.
      Signed-off-by: NRam Amrani <Ram.Amrani@cavium.com>
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      670dde55