* [PATCH iproute2 1/4] ip vrf: Move kernel config hint to prog_load failure
From: David Ahern @ 2016-12-15 20:06 UTC (permalink / raw)
To: netdev, stephen; +Cc: David Ahern
In-Reply-To: <1481832422-10267-1-git-send-email-dsa@cumulusnetworks.com>
Move the hint about CGROUP_BPF enabled to prog_load failure since
it fails before the attach. Update the existing error message to
print to stderr.
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
---
ip/ipvrf.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/ip/ipvrf.c b/ip/ipvrf.c
index 4d59845416cd..44ad7e07024a 100644
--- a/ip/ipvrf.c
+++ b/ip/ipvrf.c
@@ -170,14 +170,15 @@ static int vrf_configure_cgroup(const char *path, int ifindex)
*/
prog_fd = prog_load(ifindex);
if (prog_fd < 0) {
- printf("Failed to load BPF prog: '%s'\n", strerror(errno));
+ fprintf(stderr, "Failed to load BPF prog: '%s'\n",
+ strerror(errno));
+ fprintf(stderr, "Kernel compiled with CGROUP_BPF enabled?\n");
goto out;
}
if (bpf_prog_attach_fd(prog_fd, cg_fd, BPF_CGROUP_INET_SOCK_CREATE)) {
fprintf(stderr, "Failed to attach prog to cgroup: '%s'\n",
strerror(errno));
- fprintf(stderr, "Kernel compiled with CGROUP_BPF enabled?\n");
goto out;
}
--
2.1.4
^ permalink raw reply related
* [PATCH iproute2 0/4] ip vrf fixups
From: David Ahern @ 2016-12-15 20:06 UTC (permalink / raw)
To: netdev, stephen; +Cc: David Ahern
Some minor cleanups to the 'ip vrf' command.
Patch 1 moves the CGROUP_BPF hint to the failure of prog_load since it
fails first.
Patch 2 refactors ipvrf_identify. The action part is moved to a function
that can be used standalone and in the process flipped to fopen/fgets for
robustness should the cgroups file grow larger than 4k.
Patch 3 fixes the path switching to "default" VRF.
Patch 4 moves a task to default VRF when switching namespaces.
David Ahern (4):
ip vrf: Move kernel config hint to prog_load failure
ip vrf: Refactor ipvrf_identify
ip vrf: Fix reset to default VRF
ip netns: Reset vrf to default VRF on namespace switch
ip/ip_common.h | 1 +
ip/ipnetns.c | 5 +++
ip/ipvrf.c | 103 +++++++++++++++++++++++++++++++++++----------------------
3 files changed, 69 insertions(+), 40 deletions(-)
--
2.1.4
^ permalink raw reply
* Re: [PATCH v2 net] rebased to master
From: Florian Fainelli @ 2016-12-15 19:59 UTC (permalink / raw)
To: Manuel Bessler, netdev
In-Reply-To: <1481826099-12840-1-git-send-email-manuel.bessler@sensus.com>
On 12/15/2016 10:21 AM, Manuel Bessler wrote:
> 'ifconfig eth0 down' makes r6040_close() trigger:
> INFO: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected
>
> Fixed by moving calls to phy_stop(), napi_disable(), netif_stop_queue()
> to outside of the module's private spin_lock_irq block.
>
> Found on a Versalogic Tomcat SBC with a Vortex86 SoC
>
> s1660e_5150:~# sudo ifconfig eth0 down
> [ 61.306415] ======================================================
> [ 61.306415] [ INFO: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected ]
> [ 61.306415] 4.9.0-gb898d2d-manuel #1 Not tainted
> [ 61.306415] ------------------------------------------------------
> [ 61.306415] ifconfig/449 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
> [ 61.306415] (&dev->lock){+.+...}, at: [<c1336276>] phy_stop+0x16/0x80
>
> [ 61.306415] and this task is already holding:
> [ 61.306415] (&(&lp->lock)->rlock){+.-...}, at: [<d0934c84>] r6040_close+0x24/0x230 [r6040]
> which would create a new lock dependency:
> [ 61.306415] (&(&lp->lock)->rlock){+.-...} -> (&dev->lock){+.+...}
>
> [ 61.306415] but this new dependency connects a SOFTIRQ-irq-safe lock:
> [ 61.306415] (&(&lp->lock)->rlock){+.-...}
> [ 61.306415] ... which became SOFTIRQ-irq-safe at:
> [ 61.306415] [ 61.306415] [<c1075bc5>] __lock_acquire+0x555/0x1770
> [ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
> [ 61.306415] [ 61.306415] [<c14bb334>] _raw_spin_lock_irqsave+0x24/0x40
> [ 61.306415] [ 61.306415] [<d0934ac0>] r6040_start_xmit+0x30/0x1d0 [r6040]
> [ 61.306415] [ 61.306415] [<c13a7d4d>] dev_hard_start_xmit+0x9d/0x2d0
> [ 61.306415] [ 61.306415] [<c13c8a38>] sch_direct_xmit+0xa8/0x140
> [ 61.306415] [ 61.306415] [<c13a8436>] __dev_queue_xmit+0x416/0x780
> [ 61.306415] [ 61.306415] [<c13a87aa>] dev_queue_xmit+0xa/0x10
> [ 61.306415] [ 61.306415] [<c13b4837>] neigh_resolve_output+0x147/0x220
> [ 61.306415] [ 61.306415] [<c144541b>] ip6_finish_output2+0x2fb/0x910
> [ 61.306415] [ 61.306415] [<c14494e6>] ip6_finish_output+0xa6/0x1a0
> [ 61.306415] [ 61.306415] [<c1449635>] ip6_output+0x55/0x320
> [ 61.306415] [ 61.306415] [<c146f4d2>] mld_sendpack+0x352/0x560
> [ 61.306415] [ 61.306415] [<c146fe55>] mld_ifc_timer_expire+0x155/0x280
> [ 61.306415] [ 61.306415] [<c108b081>] call_timer_fn+0x81/0x270
> [ 61.306415] [ 61.306415] [<c108b331>] expire_timers+0xc1/0x180
> [ 61.306415] [ 61.306415] [<c108b4f7>] run_timer_softirq+0x77/0x150
> [ 61.306415] [ 61.306415] [<c1043d04>] __do_softirq+0xb4/0x3d0
> [ 61.306415] [ 61.306415] [<c101a15c>] do_softirq_own_stack+0x1c/0x30
> [ 61.306415] [ 61.306415] [<c104416e>] irq_exit+0x8e/0xa0
> [ 61.306415] [ 61.306415] [<c1019d31>] do_IRQ+0x51/0x100
> [ 61.306415] [ 61.306415] [<c14bc176>] common_interrupt+0x36/0x40
> [ 61.306415] [ 61.306415] [<c1134928>] set_root+0x68/0xf0
> [ 61.306415] [ 61.306415] [<c1136120>] path_init+0x400/0x640
> [ 61.306415] [ 61.306415] [<c11386bf>] path_lookupat+0xf/0xe0
> [ 61.306415] [ 61.306415] [<c1139ebc>] filename_lookup+0x6c/0x100
> [ 61.306415] [ 61.306415] [<c1139fd5>] user_path_at_empty+0x25/0x30
> [ 61.306415] [ 61.306415] [<c11298c6>] SyS_faccessat+0x86/0x1e0
> [ 61.306415] [ 61.306415] [<c1129a30>] SyS_access+0x10/0x20
> [ 61.306415] [ 61.306415] [<c100179f>] do_int80_syscall_32+0x3f/0x110
> [ 61.306415] [ 61.306415] [<c14bba3f>] restore_all+0x0/0x61
> [ 61.306415]
> [ 61.306415] to a SOFTIRQ-irq-unsafe lock:
> [ 61.306415] (&dev->lock){+.+...}
> [ 61.306415] ... which became SOFTIRQ-irq-unsafe at:
> [ 61.306415] ...[ 61.306415]
> [ 61.306415] [<c1075c0c>] __lock_acquire+0x59c/0x1770
> [ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
> [ 61.306415] [ 61.306415] [<c14b7add>] mutex_lock_nested+0x2d/0x4a0
> [ 61.306415] [ 61.306415] [<c133747d>] phy_probe+0x4d/0xc0
> [ 61.306415] [ 61.306415] [<c1338afe>] phy_attach_direct+0xbe/0x190
> [ 61.306415] [ 61.306415] [<c1338ca7>] phy_connect_direct+0x17/0x60
> [ 61.306415] [ 61.306415] [<c1338d23>] phy_connect+0x33/0x70
> [ 61.306415] [ 61.306415] [<d09357a0>] r6040_init_one+0x3a0/0x500 [r6040]
> [ 61.306415] [ 61.306415] [<c12a78c7>] pci_device_probe+0x77/0xd0
> [ 61.306415] [ 61.306415] [<c12f5e15>] driver_probe_device+0x145/0x280
> [ 61.306415] [ 61.306415] [<c12f5fd9>] __driver_attach+0x89/0x90
> [ 61.306415] [ 61.306415] [<c12f43ef>] bus_for_each_dev+0x4f/0x80
> [ 61.306415] [ 61.306415] [<c12f5954>] driver_attach+0x14/0x20
> [ 61.306415] [ 61.306415] [<c12f55b7>] bus_add_driver+0x197/0x210
> [ 61.306415] [ 61.306415] [<c12f6a21>] driver_register+0x51/0xd0
> [ 61.306415] [ 61.306415] [<c12a6955>] __pci_register_driver+0x45/0x50
> [ 61.306415] [ 61.306415] [<d0938017>] 0xd0938017
> [ 61.306415] [ 61.306415] [<c100043f>] do_one_initcall+0x2f/0x140
> [ 61.306415] [ 61.306415] [<c10e48c0>] do_init_module+0x4a/0x19b
> [ 61.306415] [ 61.306415] [<c10a680e>] load_module+0x1b2e/0x2070
> [ 61.306415] [ 61.306415] [<c10a6eb9>] SyS_finit_module+0x69/0x80
> [ 61.306415] [ 61.306415] [<c100179f>] do_int80_syscall_32+0x3f/0x110
> [ 61.306415] [ 61.306415] [<c14bba3f>] restore_all+0x0/0x61
> [ 61.306415]
> [ 61.306415] other info that might help us debug this:
> [ 61.306415]
> [ 61.306415] Possible interrupt unsafe locking scenario:
> [ 61.306415]
> [ 61.306415] CPU0 CPU1
> [ 61.306415] ---- ----
> [ 61.306415] lock(&dev->lock);
> [ 61.306415] local_irq_disable();
> [ 61.306415] lock(&(&lp->lock)->rlock);
> [ 61.306415] lock(&dev->lock);
> [ 61.306415] <Interrupt>
> [ 61.306415] lock(&(&lp->lock)->rlock);
> [ 61.306415]
> [ 61.306415] *** DEADLOCK ***
> [ 61.306415]
> [ 61.306415] 2 locks held by ifconfig/449:
> [ 61.306415] #0: (rtnl_mutex){+.+.+.}, at: [<c13b68ef>] rtnl_lock+0xf/0x20
> [ 61.306415] #1: (&(&lp->lock)->rlock){+.-...}, at: [<d0934c84>] r6040_close+0x24/0x230 [r6040]
> [ 61.306415]
> [ 61.306415] the dependencies between SOFTIRQ-irq-safe lock and the holding lock:
> [ 61.306415] -> (&(&lp->lock)->rlock){+.-...} ops: 3049 {
> [ 61.306415] HARDIRQ-ON-W at:
> [ 61.306415] [ 61.306415] [<c1075be7>] __lock_acquire+0x577/0x1770
> [ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
> [ 61.306415] [ 61.306415] [<c14bb21b>] _raw_spin_lock+0x1b/0x30
> [ 61.306415] [ 61.306415] [<d09343cc>] r6040_poll+0x2c/0x330 [r6040]
> [ 61.306415] [ 61.306415] [<c13a5577>] net_rx_action+0x197/0x340
> [ 61.306415] [ 61.306415] [<c1043d04>] __do_softirq+0xb4/0x3d0
> [ 61.306415] [ 61.306415] [<c1044037>] run_ksoftirqd+0x17/0x40
> [ 61.306415] [ 61.306415] [<c105fe91>] smpboot_thread_fn+0x141/0x180
> [ 61.306415] [ 61.306415] [<c105c84e>] kthread+0xde/0x110
> [ 61.306415] [ 61.306415] [<c14bb949>] ret_from_fork+0x19/0x30
> [ 61.306415] IN-SOFTIRQ-W at:
> [ 61.306415] [ 61.306415] [<c1075bc5>] __lock_acquire+0x555/0x1770
> [ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
> [ 61.306415] [ 61.306415] [<c14bb334>] _raw_spin_lock_irqsave+0x24/0x40
> [ 61.306415] [ 61.306415] [<d0934ac0>] r6040_start_xmit+0x30/0x1d0 [r6040]
> [ 61.306415] [ 61.306415] [<c13a7d4d>] dev_hard_start_xmit+0x9d/0x2d0
> [ 61.306415] [ 61.306415] [<c13c8a38>] sch_direct_xmit+0xa8/0x140
> [ 61.306415] [ 61.306415] [<c13a8436>] __dev_queue_xmit+0x416/0x780
> [ 61.306415] [ 61.306415] [<c13a87aa>] dev_queue_xmit+0xa/0x10
> [ 61.306415] [ 61.306415] [<c13b4837>] neigh_resolve_output+0x147/0x220
> [ 61.306415] [ 61.306415] [<c144541b>] ip6_finish_output2+0x2fb/0x910
> [ 61.306415] [ 61.306415] [<c14494e6>] ip6_finish_output+0xa6/0x1a0
> [ 61.306415] [ 61.306415] [<c1449635>] ip6_output+0x55/0x320
> [ 61.306415] [ 61.306415] [<c146f4d2>] mld_sendpack+0x352/0x560
> [ 61.306415] [ 61.306415] [<c146fe55>] mld_ifc_timer_expire+0x155/0x280
> [ 61.306415] [ 61.306415] [<c108b081>] call_timer_fn+0x81/0x270
> [ 61.306415] [ 61.306415] [<c108b331>] expire_timers+0xc1/0x180
> [ 61.306415] [ 61.306415] [<c108b4f7>] run_timer_softirq+0x77/0x150
> [ 61.306415] [ 61.306415] [<c1043d04>] __do_softirq+0xb4/0x3d0
> [ 61.306415] [ 61.306415] [<c101a15c>] do_softirq_own_stack+0x1c/0x30
> [ 61.306415] [ 61.306415] [<c104416e>] irq_exit+0x8e/0xa0
> [ 61.306415] [ 61.306415] [<c1019d31>] do_IRQ+0x51/0x100
> [ 61.306415] [ 61.306415] [<c14bc176>] common_interrupt+0x36/0x40
> [ 61.306415] [ 61.306415] [<c1134928>] set_root+0x68/0xf0
> [ 61.306415] [ 61.306415] [<c1136120>] path_init+0x400/0x640
> [ 61.306415] [ 61.306415] [<c11386bf>] path_lookupat+0xf/0xe0
> [ 61.306415] [ 61.306415] [<c1139ebc>] filename_lookup+0x6c/0x100
> [ 61.306415] [ 61.306415] [<c1139fd5>] user_path_at_empty+0x25/0x30
> [ 61.306415] [ 61.306415] [<c11298c6>] SyS_faccessat+0x86/0x1e0
> [ 61.306415] [ 61.306415] [<c1129a30>] SyS_access+0x10/0x20
> [ 61.306415] [ 61.306415] [<c100179f>] do_int80_syscall_32+0x3f/0x110
> [ 61.306415] [ 61.306415] [<c14bba3f>] restore_all+0x0/0x61
> [ 61.306415] INITIAL USE at:
> [ 61.306415] [ 61.306415] [<c107586e>] __lock_acquire+0x1fe/0x1770
> [ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
> [ 61.306415] [ 61.306415] [<c14bb334>] _raw_spin_lock_irqsave+0x24/0x40
> [ 61.306415] [ 61.306415] [<d093474e>] r6040_get_stats+0x1e/0x60 [r6040]
> [ 61.306415] [ 61.306415] [<c139fb16>] dev_get_stats+0x96/0xc0
> [ 61.306415] [ 61.306415] [<c14b416e>] rtnl_fill_stats+0x36/0xfd
> [ 61.306415] [ 61.306415] [<c13b7b3c>] rtnl_fill_ifinfo+0x47c/0xce0
> [ 61.306415] [ 61.306415] [<c13bc08e>] rtmsg_ifinfo_build_skb+0x4e/0xd0
> [ 61.306415] [ 61.306415] [<c13bc120>] rtmsg_ifinfo.part.20+0x10/0x40
> [ 61.306415] [ 61.306415] [<c13bc16b>] rtmsg_ifinfo+0x1b/0x20
> [ 61.306415] [ 61.306415] [<c13a9d19>] register_netdevice+0x409/0x550
> [ 61.306415] [ 61.306415] [<c13a9e72>] register_netdev+0x12/0x20
> [ 61.306415] [ 61.306415] [<d09357e8>] r6040_init_one+0x3e8/0x500 [r6040]
> [ 61.306415] [ 61.306415] [<c12a78c7>] pci_device_probe+0x77/0xd0
> [ 61.306415] [ 61.306415] [<c12f5e15>] driver_probe_device+0x145/0x280
> [ 61.306415] [ 61.306415] [<c12f5fd9>] __driver_attach+0x89/0x90
> [ 61.306415] [ 61.306415] [<c12f43ef>] bus_for_each_dev+0x4f/0x80
> [ 61.306415] [ 61.306415] [<c12f5954>] driver_attach+0x14/0x20
> [ 61.306415] [ 61.306415] [<c12f55b7>] bus_add_driver+0x197/0x210
> [ 61.306415] [ 61.306415] [<c12f6a21>] driver_register+0x51/0xd0
> [ 61.306415] [ 61.306415] [<c12a6955>] __pci_register_driver+0x45/0x50
> [ 61.306415] [ 61.306415] [<d0938017>] 0xd0938017
> [ 61.306415] [ 61.306415] [<c100043f>] do_one_initcall+0x2f/0x140
> [ 61.306415] [ 61.306415] [<c10e48c0>] do_init_module+0x4a/0x19b
> [ 61.306415] [ 61.306415] [<c10a680e>] load_module+0x1b2e/0x2070
> [ 61.306415] [ 61.306415] [<c10a6eb9>] SyS_finit_module+0x69/0x80
> [ 61.306415] [ 61.306415] [<c100179f>] do_int80_syscall_32+0x3f/0x110
> [ 61.306415] [ 61.306415] [<c14bba3f>] restore_all+0x0/0x61
> [ 61.306415] }
> [ 61.306415] ... key at: [<d0936280>] __key.45893+0x0/0xfffff739 [r6040]
> [ 61.306415] ... acquired at:
> [ 61.306415] [ 61.306415] [<c1074a32>] check_irq_usage+0x42/0xb0
> [ 61.306415] [ 61.306415] [<c107677c>] __lock_acquire+0x110c/0x1770
> [ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
> [ 61.306415] [ 61.306415] [<c14b7add>] mutex_lock_nested+0x2d/0x4a0
> [ 61.306415] [ 61.306415] [<c1336276>] phy_stop+0x16/0x80
> [ 61.306415] [ 61.306415] [<d0934ce9>] r6040_close+0x89/0x230 [r6040]
> [ 61.306415] [ 61.306415] [<c13a0a91>] __dev_close_many+0x61/0xa0
> [ 61.306415] [ 61.306415] [<c13a0bbf>] __dev_close+0x1f/0x30
> [ 61.306415] [ 61.306415] [<c13a9127>] __dev_change_flags+0x87/0x150
> [ 61.306415] [ 61.306415] [<c13a9213>] dev_change_flags+0x23/0x60
> [ 61.306415] [ 61.306415] [<c1416238>] devinet_ioctl+0x5f8/0x6f0
> [ 61.306415] [ 61.306415] [<c1417f75>] inet_ioctl+0x65/0x90
> [ 61.306415] [ 61.306415] [<c1389b54>] sock_ioctl+0x124/0x2b0
> [ 61.306415] [ 61.306415] [<c113cf7c>] do_vfs_ioctl+0x7c/0x790
> [ 61.306415] [ 61.306415] [<c113d6b8>] SyS_ioctl+0x28/0x50
> [ 61.306415] [ 61.306415] [<c100179f>] do_int80_syscall_32+0x3f/0x110
> [ 61.306415] [ 61.306415] [<c14bba3f>] restore_all+0x0/0x61
> [ 61.306415]
> [ 61.306415]
> the dependencies between the lock to be acquired[ 61.306415] and SOFTIRQ-irq-unsafe lock:
> [ 61.306415] -> (&dev->lock){+.+...} ops: 56 {
> [ 61.306415] HARDIRQ-ON-W at:
> [ 61.306415] [ 61.306415] [<c1075be7>] __lock_acquire+0x577/0x1770
> [ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
> [ 61.306415] [ 61.306415] [<c14b7add>] mutex_lock_nested+0x2d/0x4a0
> [ 61.306415] [ 61.306415] [<c133747d>] phy_probe+0x4d/0xc0
> [ 61.306415] [ 61.306415] [<c1338afe>] phy_attach_direct+0xbe/0x190
> [ 61.306415] [ 61.306415] [<c1338ca7>] phy_connect_direct+0x17/0x60
> [ 61.306415] [ 61.306415] [<c1338d23>] phy_connect+0x33/0x70
> [ 61.306415] [ 61.306415] [<d09357a0>] r6040_init_one+0x3a0/0x500 [r6040]
> [ 61.306415] [ 61.306415] [<c12a78c7>] pci_device_probe+0x77/0xd0
> [ 61.306415] [ 61.306415] [<c12f5e15>] driver_probe_device+0x145/0x280
> [ 61.306415] [ 61.306415] [<c12f5fd9>] __driver_attach+0x89/0x90
> [ 61.306415] [ 61.306415] [<c12f43ef>] bus_for_each_dev+0x4f/0x80
> [ 61.306415] [ 61.306415] [<c12f5954>] driver_attach+0x14/0x20
> [ 61.306415] [ 61.306415] [<c12f55b7>] bus_add_driver+0x197/0x210
> [ 61.306415] [ 61.306415] [<c12f6a21>] driver_register+0x51/0xd0
> [ 61.306415] [ 61.306415] [<c12a6955>] __pci_register_driver+0x45/0x50
> [ 61.306415] [ 61.306415] [<d0938017>] 0xd0938017
> [ 61.306415] [ 61.306415] [<c100043f>] do_one_initcall+0x2f/0x140
> [ 61.306415] [ 61.306415] [<c10e48c0>] do_init_module+0x4a/0x19b
> [ 61.306415] [ 61.306415] [<c10a680e>] load_module+0x1b2e/0x2070
> [ 61.306415] [ 61.306415] [<c10a6eb9>] SyS_finit_module+0x69/0x80
> [ 61.306415] [ 61.306415] [<c100179f>] do_int80_syscall_32+0x3f/0x110
> [ 61.306415] [ 61.306415] [<c14bba3f>] restore_all+0x0/0x61
> [ 61.306415] SOFTIRQ-ON-W at:
> [ 61.306415] [ 61.306415] [<c1075c0c>] __lock_acquire+0x59c/0x1770
> [ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
> [ 61.306415] [ 61.306415] [<c14b7add>] mutex_lock_nested+0x2d/0x4a0
> [ 61.306415] [ 61.306415] [<c133747d>] phy_probe+0x4d/0xc0
> [ 61.306415] [ 61.306415] [<c1338afe>] phy_attach_direct+0xbe/0x190
> [ 61.306415] [ 61.306415] [<c1338ca7>] phy_connect_direct+0x17/0x60
> [ 61.306415] [ 61.306415] [<c1338d23>] phy_connect+0x33/0x70
> [ 61.306415] [ 61.306415] [<d09357a0>] r6040_init_one+0x3a0/0x500 [r6040]
> [ 61.306415] [ 61.306415] [<c12a78c7>] pci_device_probe+0x77/0xd0
> [ 61.306415] [ 61.306415] [<c12f5e15>] driver_probe_device+0x145/0x280
> [ 61.306415] [ 61.306415] [<c12f5fd9>] __driver_attach+0x89/0x90
> [ 61.306415] [ 61.306415] [<c12f43ef>] bus_for_each_dev+0x4f/0x80
> [ 61.306415] [ 61.306415] [<c12f5954>] driver_attach+0x14/0x20
> [ 61.306415] [ 61.306415] [<c12f55b7>] bus_add_driver+0x197/0x210
> [ 61.306415] [ 61.306415] [<c12f6a21>] driver_register+0x51/0xd0
> [ 61.306415] [ 61.306415] [<c12a6955>] __pci_register_driver+0x45/0x50
> [ 61.306415] [ 61.306415] [<d0938017>] 0xd0938017
> [ 61.306415] [ 61.306415] [<c100043f>] do_one_initcall+0x2f/0x140
> [ 61.306415] [ 61.306415] [<c10e48c0>] do_init_module+0x4a/0x19b
> [ 61.306415] [ 61.306415] [<c10a680e>] load_module+0x1b2e/0x2070
> [ 61.306415] [ 61.306415] [<c10a6eb9>] SyS_finit_module+0x69/0x80
> [ 61.306415] [ 61.306415] [<c100179f>] do_int80_syscall_32+0x3f/0x110
> [ 61.306415] [ 61.306415] [<c14bba3f>] restore_all+0x0/0x61
> [ 61.306415] INITIAL USE at:
> [ 61.306415] [ 61.306415] [<c107586e>] __lock_acquire+0x1fe/0x1770
> [ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
> [ 61.306415] [ 61.306415] [<c14b7add>] mutex_lock_nested+0x2d/0x4a0
> [ 61.306415] [ 61.306415] [<c133747d>] phy_probe+0x4d/0xc0
> [ 61.306415] [ 61.306415] [<c1338afe>] phy_attach_direct+0xbe/0x190
> [ 61.306415] [ 61.306415] [<c1338ca7>] phy_connect_direct+0x17/0x60
> [ 61.306415] [ 61.306415] [<c1338d23>] phy_connect+0x33/0x70
> [ 61.306415] [ 61.306415] [<d09357a0>] r6040_init_one+0x3a0/0x500 [r6040]
> [ 61.306415] [ 61.306415] [<c12a78c7>] pci_device_probe+0x77/0xd0
> [ 61.306415] [ 61.306415] [<c12f5e15>] driver_probe_device+0x145/0x280
> [ 61.306415] [ 61.306415] [<c12f5fd9>] __driver_attach+0x89/0x90
> [ 61.306415] [ 61.306415] [<c12f43ef>] bus_for_each_dev+0x4f/0x80
> [ 61.306415] [ 61.306415] [<c12f5954>] driver_attach+0x14/0x20
> [ 61.306415] [ 61.306415] [<c12f55b7>] bus_add_driver+0x197/0x210
> [ 61.306415] [ 61.306415] [<c12f6a21>] driver_register+0x51/0xd0
> [ 61.306415] [ 61.306415] [<c12a6955>] __pci_register_driver+0x45/0x50
> [ 61.306415] [ 61.306415] [<d0938017>] 0xd0938017
> [ 61.306415] [ 61.306415] [<c100043f>] do_one_initcall+0x2f/0x140
> [ 61.306415] [ 61.306415] [<c10e48c0>] do_init_module+0x4a/0x19b
> [ 61.306415] [ 61.306415] [<c10a680e>] load_module+0x1b2e/0x2070
> [ 61.306415] [ 61.306415] [<c10a6eb9>] SyS_finit_module+0x69/0x80
> [ 61.306415] [ 61.306415] [<c100179f>] do_int80_syscall_32+0x3f/0x110
> [ 61.306415] [ 61.306415] [<c14bba3f>] restore_all+0x0/0x61
> [ 61.306415] }
> [ 61.306415] ... key at: [<c1f28f39>] __key.43998+0x0/0x8
> [ 61.306415] ... acquired at:
> [ 61.306415] [ 61.306415] [<c1074a32>] check_irq_usage+0x42/0xb0
> [ 61.306415] [ 61.306415] [<c107677c>] __lock_acquire+0x110c/0x1770
> [ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
> [ 61.306415] [ 61.306415] [<c14b7add>] mutex_lock_nested+0x2d/0x4a0
> [ 61.306415] [ 61.306415] [<c1336276>] phy_stop+0x16/0x80
> [ 61.306415] [ 61.306415] [<d0934ce9>] r6040_close+0x89/0x230 [r6040]
> [ 61.306415] [ 61.306415] [<c13a0a91>] __dev_close_many+0x61/0xa0
> [ 61.306415] [ 61.306415] [<c13a0bbf>] __dev_close+0x1f/0x30
> [ 61.306415] [ 61.306415] [<c13a9127>] __dev_change_flags+0x87/0x150
> [ 61.306415] [ 61.306415] [<c13a9213>] dev_change_flags+0x23/0x60
> [ 61.306415] [ 61.306415] [<c1416238>] devinet_ioctl+0x5f8/0x6f0
> [ 61.306415] [ 61.306415] [<c1417f75>] inet_ioctl+0x65/0x90
> [ 61.306415] [ 61.306415] [<c1389b54>] sock_ioctl+0x124/0x2b0
> [ 61.306415] [ 61.306415] [<c113cf7c>] do_vfs_ioctl+0x7c/0x790
> [ 61.306415] [ 61.306415] [<c113d6b8>] SyS_ioctl+0x28/0x50
> [ 61.306415] [ 61.306415] [<c100179f>] do_int80_syscall_32+0x3f/0x110
> [ 61.306415] [ 61.306415] [<c14bba3f>] restore_all+0x0/0x61
> [ 61.306415]
> [ 61.306415]
> [ 61.306415] stack backtrace:
> [ 61.306415] CPU: 0 PID: 449 Comm: ifconfig Not tainted 4.9.0-gb898d2d-manuel #1
> [ 61.306415] Call Trace:
> [ 61.306415] dump_stack+0x16/0x19
> [ 61.306415] check_usage+0x3f6/0x550
> [ 61.306415] ? check_usage+0x4d/0x550
> [ 61.306415] check_irq_usage+0x42/0xb0
> [ 61.306415] __lock_acquire+0x110c/0x1770
> [ 61.306415] lock_acquire+0x7c/0x150
> [ 61.306415] ? phy_stop+0x16/0x80
> [ 61.306415] mutex_lock_nested+0x2d/0x4a0
> [ 61.306415] ? phy_stop+0x16/0x80
> [ 61.306415] ? r6040_close+0x24/0x230 [r6040]
> [ 61.306415] ? __delay+0x9/0x10
> [ 61.306415] phy_stop+0x16/0x80
> [ 61.306415] r6040_close+0x89/0x230 [r6040]
> [ 61.306415] __dev_close_many+0x61/0xa0
> [ 61.306415] __dev_close+0x1f/0x30
> [ 61.306415] __dev_change_flags+0x87/0x150
> [ 61.306415] dev_change_flags+0x23/0x60
> [ 61.306415] devinet_ioctl+0x5f8/0x6f0
> [ 61.306415] inet_ioctl+0x65/0x90
> [ 61.306415] sock_ioctl+0x124/0x2b0
> [ 61.306415] ? dlci_ioctl_set+0x30/0x30
> [ 61.306415] do_vfs_ioctl+0x7c/0x790
> [ 61.306415] ? trace_hardirqs_on+0xb/0x10
> [ 61.306415] ? call_rcu_sched+0xd/0x10
> [ 61.306415] ? __put_cred+0x32/0x50
> [ 61.306415] ? SyS_faccessat+0x178/0x1e0
> [ 61.306415] SyS_ioctl+0x28/0x50
> [ 61.306415] do_int80_syscall_32+0x3f/0x110
> [ 61.306415] entry_INT80_32+0x2f/0x2f
> [ 61.306415] EIP: 0xb764d364
> [ 61.306415] EFLAGS: 00000286 CPU: 0
> [ 61.306415] EAX: ffffffda EBX: 00000004 ECX: 00008914 EDX: bfa99d7c
> [ 61.306415] ESI: bfa99e4c EDI: fffffffe EBP: 00000004 ESP: bfa99d58
> [ 61.306415] DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 007b
> [ 63.836607] r6040 0000:00:08.0 eth0: Link is Down
>
> Signed-off-by: Manuel Bessler <manuel.bessler@sensus.com>
Would have been nice to CC the maintainer of the driver. Your patch
subject is no longer correct now, you should use the same subject you
used for the first submission.
Other than that:
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
> drivers/net/ethernet/rdc/r6040.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/rdc/r6040.c b/drivers/net/ethernet/rdc/r6040.c
> index 4ff4e04..aa11b70 100644
> --- a/drivers/net/ethernet/rdc/r6040.c
> +++ b/drivers/net/ethernet/rdc/r6040.c
> @@ -472,8 +472,6 @@ static void r6040_down(struct net_device *dev)
> iowrite16(adrp[0], ioaddr + MID_0L);
> iowrite16(adrp[1], ioaddr + MID_0M);
> iowrite16(adrp[2], ioaddr + MID_0H);
> -
> - phy_stop(dev->phydev);
> }
>
> static int r6040_close(struct net_device *dev)
> @@ -481,12 +479,12 @@ static int r6040_close(struct net_device *dev)
> struct r6040_private *lp = netdev_priv(dev);
> struct pci_dev *pdev = lp->pdev;
>
> - spin_lock_irq(&lp->lock);
> + phy_stop(dev->phydev);
> napi_disable(&lp->napi);
> netif_stop_queue(dev);
> - r6040_down(dev);
>
> - free_irq(dev->irq, dev);
> + spin_lock_irq(&lp->lock);
> + r6040_down(dev);
>
> /* Free RX buffer */
> r6040_free_rxbufs(dev);
> @@ -496,6 +494,8 @@ static int r6040_close(struct net_device *dev)
>
> spin_unlock_irq(&lp->lock);
>
> + free_irq(dev->irq, dev);
> +
> /* Free Descriptor memory */
> if (lp->rx_ring) {
> pci_free_consistent(pdev,
>
--
Florian
^ permalink raw reply
* Re: [PATCH] net: sfc: use new api ethtool_{get|set}_link_ksettings
From: Jarod Wilson @ 2016-12-15 19:59 UTC (permalink / raw)
To: Philippe Reynes, linux-net-drivers, ecree, bkenward; +Cc: netdev, linux-kernel
In-Reply-To: <1481757173-16000-1-git-send-email-tremyfr@gmail.com>
On 2016-12-14 6:12 PM, Philippe Reynes wrote:
> The ethtool api {get|set}_settings is deprecated.
> We move this driver to new api {get|set}_link_ksettings.
>
> Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
> ---
> drivers/net/ethernet/sfc/ethtool.c | 35 ++++++++++++-------
> drivers/net/ethernet/sfc/mcdi_port.c | 60 ++++++++++++++++++++------------
> drivers/net/ethernet/sfc/net_driver.h | 12 +++---
> 3 files changed, 65 insertions(+), 42 deletions(-)
What about drivers/net/ethernet/sfc/falcon/ethtool.c? Coming in a
separate patch?
--
Jarod Wilson
jarod@redhat.com
^ permalink raw reply
* Re: [PATCH 5/8] linux: drop __bitwise__ everywhere
From: Lee Duncan @ 2016-12-15 19:44 UTC (permalink / raw)
To: Michael S. Tsirkin, linux-kernel
Cc: Kukjin Kim, Krzysztof Kozlowski, Javier Martinez Canillas,
Russell King, Alasdair Kergon, Mike Snitzer, dm-devel, Shaohua Li,
Johannes Berg, Emmanuel Grumbach, Luca Coelho,
Intel Linux Wireless, Kalle Valo, Greg Kroah-Hartman, Jiri Slaby,
Chris Leech, James E.J. Bottomley, Martin K. Petersen,
Nicholas A. Bellinger, Jason Wang, Alexander Aring,
Stefan Schmidt, "David S. Miller" <d
In-Reply-To: <1481778865-27667-6-git-send-email-mst@redhat.com>
On 12/14/2016 09:15 PM, Michael S. Tsirkin wrote:
> __bitwise__ used to mean "yes, please enable sparse checks
> unconditionally", but now that we dropped __CHECK_ENDIAN__
> __bitwise is exactly the same.
> There aren't many users, replace it by __bitwise everywhere.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> arch/arm/plat-samsung/include/plat/gpio-cfg.h | 2 +-
> drivers/md/dm-cache-block-types.h | 6 +++---
> drivers/net/ethernet/sun/sunhme.h | 2 +-
> drivers/net/wireless/intel/iwlwifi/iwl-fw-file.h | 4 ++--
> include/linux/mmzone.h | 2 +-
> include/linux/serial_core.h | 4 ++--
> include/linux/types.h | 4 ++--
> include/scsi/iscsi_proto.h | 2 +-
> include/target/target_core_base.h | 2 +-
> include/uapi/linux/virtio_types.h | 6 +++---
> net/ieee802154/6lowpan/6lowpan_i.h | 2 +-
> net/mac80211/ieee80211_i.h | 4 ++--
> 12 files changed, 20 insertions(+), 20 deletions(-)
>
> diff --git a/arch/arm/plat-samsung/include/plat/gpio-cfg.h b/arch/arm/plat-samsung/include/plat/gpio-cfg.h
> index 21391fa..e55d1f5 100644
> --- a/arch/arm/plat-samsung/include/plat/gpio-cfg.h
> +++ b/arch/arm/plat-samsung/include/plat/gpio-cfg.h
> @@ -26,7 +26,7 @@
>
> #include <linux/types.h>
>
> -typedef unsigned int __bitwise__ samsung_gpio_pull_t;
> +typedef unsigned int __bitwise samsung_gpio_pull_t;
>
> /* forward declaration if gpio-core.h hasn't been included */
> struct samsung_gpio_chip;
> diff --git a/drivers/md/dm-cache-block-types.h b/drivers/md/dm-cache-block-types.h
> index bed4ad4..389c9e8 100644
> --- a/drivers/md/dm-cache-block-types.h
> +++ b/drivers/md/dm-cache-block-types.h
> @@ -17,9 +17,9 @@
> * discard bitset.
> */
>
> -typedef dm_block_t __bitwise__ dm_oblock_t;
> -typedef uint32_t __bitwise__ dm_cblock_t;
> -typedef dm_block_t __bitwise__ dm_dblock_t;
> +typedef dm_block_t __bitwise dm_oblock_t;
> +typedef uint32_t __bitwise dm_cblock_t;
> +typedef dm_block_t __bitwise dm_dblock_t;
>
> static inline dm_oblock_t to_oblock(dm_block_t b)
> {
> diff --git a/drivers/net/ethernet/sun/sunhme.h b/drivers/net/ethernet/sun/sunhme.h
> index f430765..4a8d5b1 100644
> --- a/drivers/net/ethernet/sun/sunhme.h
> +++ b/drivers/net/ethernet/sun/sunhme.h
> @@ -302,7 +302,7 @@
> * Always write the address first before setting the ownership
> * bits to avoid races with the hardware scanning the ring.
> */
> -typedef u32 __bitwise__ hme32;
> +typedef u32 __bitwise hme32;
>
> struct happy_meal_rxd {
> hme32 rx_flags;
> diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-fw-file.h b/drivers/net/wireless/intel/iwlwifi/iwl-fw-file.h
> index 1ad0ec1..84813b5 100644
> --- a/drivers/net/wireless/intel/iwlwifi/iwl-fw-file.h
> +++ b/drivers/net/wireless/intel/iwlwifi/iwl-fw-file.h
> @@ -228,7 +228,7 @@ enum iwl_ucode_tlv_flag {
> IWL_UCODE_TLV_FLAGS_BCAST_FILTERING = BIT(29),
> };
>
> -typedef unsigned int __bitwise__ iwl_ucode_tlv_api_t;
> +typedef unsigned int __bitwise iwl_ucode_tlv_api_t;
>
> /**
> * enum iwl_ucode_tlv_api - ucode api
> @@ -258,7 +258,7 @@ enum iwl_ucode_tlv_api {
> #endif
> };
>
> -typedef unsigned int __bitwise__ iwl_ucode_tlv_capa_t;
> +typedef unsigned int __bitwise iwl_ucode_tlv_capa_t;
>
> /**
> * enum iwl_ucode_tlv_capa - ucode capabilities
> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
> index 0f088f3..36d9896 100644
> --- a/include/linux/mmzone.h
> +++ b/include/linux/mmzone.h
> @@ -246,7 +246,7 @@ struct lruvec {
> #define ISOLATE_UNEVICTABLE ((__force isolate_mode_t)0x8)
>
> /* LRU Isolation modes. */
> -typedef unsigned __bitwise__ isolate_mode_t;
> +typedef unsigned __bitwise isolate_mode_t;
>
> enum zone_watermarks {
> WMARK_MIN,
> diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
> index 5d49488..5def8e8 100644
> --- a/include/linux/serial_core.h
> +++ b/include/linux/serial_core.h
> @@ -111,8 +111,8 @@ struct uart_icount {
> __u32 buf_overrun;
> };
>
> -typedef unsigned int __bitwise__ upf_t;
> -typedef unsigned int __bitwise__ upstat_t;
> +typedef unsigned int __bitwise upf_t;
> +typedef unsigned int __bitwise upstat_t;
>
> struct uart_port {
> spinlock_t lock; /* port lock */
> diff --git a/include/linux/types.h b/include/linux/types.h
> index baf7183..d501ad3 100644
> --- a/include/linux/types.h
> +++ b/include/linux/types.h
> @@ -154,8 +154,8 @@ typedef u64 dma_addr_t;
> typedef u32 dma_addr_t;
> #endif
>
> -typedef unsigned __bitwise__ gfp_t;
> -typedef unsigned __bitwise__ fmode_t;
> +typedef unsigned __bitwise gfp_t;
> +typedef unsigned __bitwise fmode_t;
>
> #ifdef CONFIG_PHYS_ADDR_T_64BIT
> typedef u64 phys_addr_t;
> diff --git a/include/scsi/iscsi_proto.h b/include/scsi/iscsi_proto.h
> index c1260d8..df156f1 100644
> --- a/include/scsi/iscsi_proto.h
> +++ b/include/scsi/iscsi_proto.h
> @@ -74,7 +74,7 @@ static inline int iscsi_sna_gte(u32 n1, u32 n2)
> #define zero_data(p) {p[0]=0;p[1]=0;p[2]=0;}
>
> /* initiator tags; opaque for target */
> -typedef uint32_t __bitwise__ itt_t;
> +typedef uint32_t __bitwise itt_t;
> /* below makes sense only for initiator that created this tag */
> #define build_itt(itt, age) ((__force itt_t)\
> ((itt) | ((age) << ISCSI_AGE_SHIFT)))
> diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
> index c211900..0055828 100644
> --- a/include/target/target_core_base.h
> +++ b/include/target/target_core_base.h
> @@ -149,7 +149,7 @@ enum se_cmd_flags_table {
> * Used by transport_send_check_condition_and_sense()
> * to signal which ASC/ASCQ sense payload should be built.
> */
> -typedef unsigned __bitwise__ sense_reason_t;
> +typedef unsigned __bitwise sense_reason_t;
>
> enum tcm_sense_reason_table {
> #define R(x) (__force sense_reason_t )(x)
> diff --git a/include/uapi/linux/virtio_types.h b/include/uapi/linux/virtio_types.h
> index e845e8c..55c3b73 100644
> --- a/include/uapi/linux/virtio_types.h
> +++ b/include/uapi/linux/virtio_types.h
> @@ -39,8 +39,8 @@
> * - __le{16,32,64} for standard-compliant virtio devices
> */
>
> -typedef __u16 __bitwise__ __virtio16;
> -typedef __u32 __bitwise__ __virtio32;
> -typedef __u64 __bitwise__ __virtio64;
> +typedef __u16 __bitwise __virtio16;
> +typedef __u32 __bitwise __virtio32;
> +typedef __u64 __bitwise __virtio64;
>
> #endif /* _UAPI_LINUX_VIRTIO_TYPES_H */
> diff --git a/net/ieee802154/6lowpan/6lowpan_i.h b/net/ieee802154/6lowpan/6lowpan_i.h
> index 5ac7789..ac7c96b 100644
> --- a/net/ieee802154/6lowpan/6lowpan_i.h
> +++ b/net/ieee802154/6lowpan/6lowpan_i.h
> @@ -7,7 +7,7 @@
> #include <net/inet_frag.h>
> #include <net/6lowpan.h>
>
> -typedef unsigned __bitwise__ lowpan_rx_result;
> +typedef unsigned __bitwise lowpan_rx_result;
> #define RX_CONTINUE ((__force lowpan_rx_result) 0u)
> #define RX_DROP_UNUSABLE ((__force lowpan_rx_result) 1u)
> #define RX_DROP ((__force lowpan_rx_result) 2u)
> diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
> index d37a577..b2069fb 100644
> --- a/net/mac80211/ieee80211_i.h
> +++ b/net/mac80211/ieee80211_i.h
> @@ -159,7 +159,7 @@ enum ieee80211_bss_valid_data_flags {
> IEEE80211_BSS_VALID_ERP = BIT(3)
> };
>
> -typedef unsigned __bitwise__ ieee80211_tx_result;
> +typedef unsigned __bitwise ieee80211_tx_result;
> #define TX_CONTINUE ((__force ieee80211_tx_result) 0u)
> #define TX_DROP ((__force ieee80211_tx_result) 1u)
> #define TX_QUEUED ((__force ieee80211_tx_result) 2u)
> @@ -180,7 +180,7 @@ struct ieee80211_tx_data {
> };
>
>
> -typedef unsigned __bitwise__ ieee80211_rx_result;
> +typedef unsigned __bitwise ieee80211_rx_result;
> #define RX_CONTINUE ((__force ieee80211_rx_result) 0u)
> #define RX_DROP_UNUSABLE ((__force ieee80211_rx_result) 1u)
> #define RX_DROP_MONITOR ((__force ieee80211_rx_result) 2u)
>
For iscsi initiator, looks good.
Akced-by: Lee Duncan <lduncan@suse.com>
--
Lee Duncan
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [PATCH v2 2/2] net: ethernet: stmmac: remove private tx queue lock
From: Lino Sanfilippo @ 2016-12-15 19:42 UTC (permalink / raw)
To: Niklas Cassel
Cc: ks.giri, linux-kernel, davem, bh74.an, peppe.cavallaro,
alexandre.torgue, pavel, romieu, netdev, vipul.pandya
In-Reply-To: <CAD5ja63O5jFtt=RyXTBxRxKSaJVfyL+kFeJwwen-pt0ifQARYQ@mail.gmail.com>
Hi,
On 15.12.2016 19:52, Niklas Cassel wrote:
> Since v1 of this patch has already been merged to net-next, I think that
> you should create a new patch on top of that, rather than submitting a v2.
>
> http://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/drivers/net/ethernet/stmicro/stmmac?id=739c8e149ae40a1eb044edb92a133b93b59369d8
>
It is v2 that has been merged, not v1.
Both versions only differed in the commit message.
Regards,
Lino
^ permalink raw reply
* Re: [PATCH v2 2/2] net: ethernet: stmmac: remove private tx queue lock
From: Lino Sanfilippo @ 2016-12-15 19:37 UTC (permalink / raw)
To: Pavel Machek
Cc: bh74.an, ks.giri, vipul.pandya, peppe.cavallaro, alexandre.torgue,
romieu, davem, linux-kernel, netdev
In-Reply-To: <20161215094517.GA406@amd>
Hi,
On 15.12.2016 10:45, Pavel Machek wrote:
> Hi!
>
>> The driver uses a private lock for synchronization of the xmit function and
>> the xmit completion handler, but since the NETIF_F_LLTX flag is not set,
>> the xmit function is also called with the xmit_lock held.
>>
>> On the other hand the completion handler uses the reverse locking order by
>> first taking the private lock and (in case that the tx queue had been
>> stopped) then the xmit_lock.
>>
>> Improve the locking by removing the private lock and using only the
>> xmit_lock for synchronization instead.
>
> Do you have stmmac hardware to test on?
>
Unfortunately not (I mentioned that the patch I send was only compile tested in
the first version but I think I forgot to do so in the last version).
> I believe something is very wrong with the locking there. In
> particular... scheduling the stmmac_tx_timer() function to run often
> should not do anything bad if locking is correct... but it breaks the
> driver rather quickly. [Example patch below, needs applying to two
> places in net-next.]
>
Do you get this result only after the private lock is removed? Or has this problem
been there before? And how exactly does the failure look like?
Regards,
Lino
^ permalink raw reply
* Re: [PATCH 1/2] net: ethernet: sxgbe: remove private tx queue lock
From: Lino Sanfilippo @ 2016-12-15 19:27 UTC (permalink / raw)
To: Pavel Machek
Cc: Francois Romieu, bh74.an, ks.giri, vipul.pandya, peppe.cavallaro,
alexandre.torgue, davem, linux-kernel, netdev
In-Reply-To: <20161211201104.GB20574@amd>
Hi Pavel,
sorry for the late reply.
On 11.12.2016 21:11, Pavel Machek wrote:
>
> Do you understand what stmmac_tx_err(priv); is supposed to do? In
> particular, if it is called while the driver is working ok -- should
> the driver survive that?
As far as I understood it is supposed to fixup an errorneous tx path, e.g. a
missing tx completion for transmitted frames.
Some drivers do this by restarting only the HW parts responsible for tx, some
others by restarting the complete hardware.
But IMO it should also be ok to be called if the HW is still working fine.
> Because it does not currently, and I don't know how to test that
> code. Unplugging the cable does not provoke that.
>
> I tried
>
> } else if (unlikely(status == tx_hard_error))
> stmmac_tx_err(priv);
> +
> + {
> + static int i;
> + i++;
> + if (i==1000) {
> + i = 0;
> + printk("Simulated error\n");
> + stmmac_tx_err(priv);
> + }
> + }
> }
>
Ok, there is this race that Francois mentioned so it is not surprising that
the driver does not survive the call of stmmac_tx_err() as it is called now.
Thats why I suggested to do a proper shutdown and restart of the tx path to
avoid the race.
Regards,
Lino
^ permalink raw reply
* Re: [PATCH perf/core REBASE 2/5] samples/bpf: Switch over to libbpf
From: Arnaldo Carvalho de Melo @ 2016-12-15 19:04 UTC (permalink / raw)
To: Joe Stringer
Cc: LKML, netdev, Wang Nan, ast, Daniel Borkmann,
Arnaldo Carvalho de Melo
In-Reply-To: <CAPWQB7HMzpPOgA1rdrKHmbxU29gkaUS1UQF69pHLrfsNhjDvMQ@mail.gmail.com>
Em Thu, Dec 15, 2016 at 10:29:19AM -0800, Joe Stringer escreveu:
> On 15 December 2016 at 07:50, Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> > Em Wed, Dec 14, 2016 at 02:43:39PM -0800, Joe Stringer escreveu:
> >> Now that libbpf under tools/lib/bpf/* is synced with the version from
> >> samples/bpf, we can get rid most of the libbpf library here.
> >>
> >> Signed-off-by: Joe Stringer <joe@ovn.org>
> >> Cc: Alexei Starovoitov <ast@fb.com>
> >> Cc: Daniel Borkmann <daniel@iogearbox.net>
> >> Cc: Wang Nan <wangnan0@huawei.com>
> >> Link: http://lkml.kernel.org/r/20161209024620.31660-6-joe@ovn.org
> >> [ Use -I$(srctree)/tools/lib/ to support out of source code tree builds, as noticed by Wang Nan ]
> >> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> >
> > So, right before this patch building samples/bpf works, then, after, it fails,
> > investigating:
> >
> > [root@1e797fdfbf4f linux]# make -j4 O=/tmp/build/linux/ headers_install
> > make[1]: Entering directory '/tmp/build/linux'
> > CHK include/generated/uapi/linux/version.h
> > make[1]: Leaving directory '/tmp/build/linux'
> > [root@1e797fdfbf4f linux]# make -j4 O=/tmp/build/linux/ samples/bpf/
> > make[1]: Entering directory '/tmp/build/linux'
> > CHK include/config/kernel.release
> > GEN ./Makefile
> > CHK include/generated/uapi/linux/version.h
> > Using /git/linux as source for kernel
> > CHK include/generated/utsrelease.h
> > CHK include/generated/timeconst.h
> > CHK include/generated/bounds.h
> > CHK include/generated/asm-offsets.h
> > CALL /git/linux/scripts/checksyscalls.sh
> > HOSTCC samples/bpf/test_lru_dist.o
> > HOSTCC samples/bpf/libbpf.o
> > HOSTCC samples/bpf/sock_example.o
> > HOSTCC samples/bpf/bpf_load.o
> > In file included from /git/linux/samples/bpf/libbpf.c:12:0:
> > /git/linux/samples/bpf/libbpf.h:5:21: fatal error: bpf/bpf.h: No such file or directory
> > #include <bpf/bpf.h>
> > ^
> > compilation terminated.
> > In file included from /git/linux/samples/bpf/test_lru_dist.c:24:0:
> > /git/linux/samples/bpf/libbpf.h:5:21: fatal error: bpf/bpf.h: No such file or directory
> > #include <bpf/bpf.h>
> > ^
> > compilation terminated.
> > make[2]: *** [scripts/Makefile.host:124: samples/bpf/test_lru_dist.o] Error 1
> > make[2]: *** Waiting for unfinished jobs....
> > make[2]: *** [scripts/Makefile.host:124: samples/bpf/libbpf.o] Error 1
> > In file included from /git/linux/samples/bpf/bpf_load.c:24:0:
> > /git/linux/samples/bpf/libbpf.h:5:21: fatal error: bpf/bpf.h: No such file or directory
> > #include <bpf/bpf.h>
> > ^
> > compilation terminated.
> > make[2]: *** [scripts/Makefile.host:124: samples/bpf/bpf_load.o] Error 1
> > In file included from /git/linux/samples/bpf/sock_example.c:29:0:
> > /git/linux/samples/bpf/libbpf.h:5:21: fatal error: bpf/bpf.h: No such file or directory
> > #include <bpf/bpf.h>
> > ^
> > compilation terminated.
> > make[2]: *** [scripts/Makefile.host:124: samples/bpf/sock_example.o] Error 1
> > make[1]: *** [/git/linux/Makefile:1659: samples/bpf/] Error 2
> > make[1]: Leaving directory '/tmp/build/linux'
> > make: *** [Makefile:150: sub-make] Error 2
> > [root@1e797fdfbf4f linux]#
>
> Sorry about that.
>
> It looks like this fragment which ended up in "samples/bpf: Remove
> perf_event_open() declaration" patch should be here instead:
I figured that out, but there is another problem, see my other messages,
- Arnaldo
> diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
> index add514e2984a..9718f664fedf 100644
> --- a/samples/bpf/Makefile
> +++ b/samples/bpf/Makefile
> @@ -108,6 +108,8 @@ always += xdp_tx_iptunnel_kern.o
>
> HOSTCFLAGS += -I$(objtree)/usr/include
> HOSTCFLAGS += -I$(srctree)/tools/testing/selftests/bpf/
> +HOSTCFLAGS += -I$(srctree)/tools/lib/ -I$(srctree)/tools/include
> +HOSTCFLAGS += -I$(srctree)/tools/perf
>
> HOSTCFLAGS_bpf_load.o += -I$(objtree)/usr/include -Wno-unused-variable
> HOSTLOADLIBES_fds_example += -lelf
^ permalink raw reply
* Re: Soft lockup in inet_put_port on 4.6
From: Josef Bacik @ 2016-12-15 18:53 UTC (permalink / raw)
To: Tom Herbert
Cc: Craig Gallek, Hannes Frederic Sowa, Eric Dumazet,
Linux Kernel Network Developers
In-Reply-To: <CALx6S369T_hvoTgyHbmeSiR2p3d68h+0tMKqMmcGYLrKiN3JMA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3507 bytes --]
On Tue, Dec 13, 2016 at 6:32 PM, Tom Herbert <tom@herbertland.com>
wrote:
> On Tue, Dec 13, 2016 at 3:03 PM, Craig Gallek <kraigatgoog@gmail.com>
> wrote:
>> On Tue, Dec 13, 2016 at 3:51 PM, Tom Herbert <tom@herbertland.com>
>> wrote:
>>> I think there may be some suspicious code in inet_csk_get_port. At
>>> tb_found there is:
>>>
>>> if (((tb->fastreuse > 0 && reuse) ||
>>> (tb->fastreuseport > 0 &&
>>> !rcu_access_pointer(sk->sk_reuseport_cb) &&
>>> sk->sk_reuseport && uid_eq(tb->fastuid,
>>> uid))) &&
>>> smallest_size == -1)
>>> goto success;
>>> if (inet_csk(sk)->icsk_af_ops->bind_conflict(sk,
>>> tb, true)) {
>>> if ((reuse ||
>>> (tb->fastreuseport > 0 &&
>>> sk->sk_reuseport &&
>>>
>>> !rcu_access_pointer(sk->sk_reuseport_cb) &&
>>> uid_eq(tb->fastuid, uid))) &&
>>> smallest_size != -1 && --attempts >=
>>> 0) {
>>> spin_unlock_bh(&head->lock);
>>> goto again;
>>> }
>>> goto fail_unlock;
>>> }
>>>
>>> AFAICT there is redundancy in these two conditionals. The same
>>> clause
>>> is being checked in both: (tb->fastreuseport > 0 &&
>>> !rcu_access_pointer(sk->sk_reuseport_cb) && sk->sk_reuseport &&
>>> uid_eq(tb->fastuid, uid))) && smallest_size == -1. If this is true
>>> the
>>> first conditional should be hit, goto done, and the second will
>>> never
>>> evaluate that part to true-- unless the sk is changed (do we need
>>> READ_ONCE for sk->sk_reuseport_cb?).
>> That's an interesting point... It looks like this function also
>> changed in 4.6 from using a single local_bh_disable() at the
>> beginning
>> with several spin_lock(&head->lock) to exclusively
>> spin_lock_bh(&head->lock) at each locking point. Perhaps the full
>> bh
>> disable variant was preventing the timers in your stack trace from
>> running interleaved with this function before?
>
> Could be, although dropping the lock shouldn't be able to affect the
> search state. TBH, I'm a little lost in reading function, the
> SO_REUSEPORT handling is pretty complicated. For instance,
> rcu_access_pointer(sk->sk_reuseport_cb) is checked three times in that
> function and also in every call to inet_csk_bind_conflict. I wonder if
> we can simply this under the assumption that SO_REUSEPORT is only
> allowed if the port number (snum) is explicitly specified.
Ok first I have data for you Hannes, here's the time distributions
before during and after the lockup (with all the debugging in place the
box eventually recovers). I've attached it as a text file since it is
long.
Second is I was thinking about why we would spend so much time doing
the ->owners list, and obviously it's because of the massive amount of
timewait sockets on the owners list. I wrote the following dumb patch
and tested it and the problem has disappeared completely. Now I don't
know if this is right at all, but I thought it was weird we weren't
copying the soreuseport option from the original socket onto the twsk.
Is there are reason we aren't doing this currently? Does this help
explain what is happening? Thanks,
Josef
[-- Attachment #2.1: timing-dist.txt --]
[-- Type: text/plain, Size: 30972 bytes --]
inet_csk_get_port : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 0 | |
8 -> 15 : 0 | |
16 -> 31 : 0 | |
32 -> 63 : 0 | |
64 -> 127 : 0 | |
128 -> 255 : 0 | |
256 -> 511 : 0 | |
512 -> 1023 : 0 | |
1024 -> 2047 : 4 |* |
2048 -> 4095 : 100 |****************************************|
4096 -> 8191 : 64 |************************* |
8192 -> 16383 : 35 |************** |
16384 -> 32767 : 2 | |
inet_csk_bind_conflict : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 0 | |
8 -> 15 : 0 | |
16 -> 31 : 0 | |
32 -> 63 : 0 | |
64 -> 127 : 0 | |
128 -> 255 : 0 | |
256 -> 511 : 0 | |
512 -> 1023 : 0 | |
1024 -> 2047 : 1 |* |
2048 -> 4095 : 38 |****************************************|
4096 -> 8191 : 9 |********* |
8192 -> 16383 : 2 |** |
16384 -> 32767 : 1 |* |
<restart happens>
inet_csk_bind_conflict : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 0 | |
8 -> 15 : 0 | |
16 -> 31 : 0 | |
32 -> 63 : 0 | |
64 -> 127 : 0 | |
128 -> 255 : 0 | |
256 -> 511 : 0 | |
512 -> 1023 : 0 | |
1024 -> 2047 : 9 |** |
2048 -> 4095 : 54 |**************** |
4096 -> 8191 : 15 |**** |
8192 -> 16383 : 0 | |
16384 -> 32767 : 1 | |
32768 -> 65535 : 0 | |
65536 -> 131071 : 0 | |
131072 -> 262143 : 0 | |
262144 -> 524287 : 0 | |
524288 -> 1048575 : 0 | |
1048576 -> 2097151 : 0 | |
2097152 -> 4194303 : 130 |****************************************|
4194304 -> 8388607 : 0 | |
8388608 -> 16777215 : 0 | |
16777216 -> 33554431 : 0 | |
33554432 -> 67108863 : 92 |**************************** |
inet_csk_get_port : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 0 | |
8 -> 15 : 0 | |
16 -> 31 : 0 | |
32 -> 63 : 0 | |
64 -> 127 : 0 | |
128 -> 255 : 0 | |
256 -> 511 : 0 | |
512 -> 1023 : 0 | |
1024 -> 2047 : 11 | |
2048 -> 4095 : 132 |********* |
4096 -> 8191 : 91 |****** |
8192 -> 16383 : 13 | |
16384 -> 32767 : 0 | |
32768 -> 65535 : 0 | |
65536 -> 131071 : 0 | |
131072 -> 262143 : 0 | |
262144 -> 524287 : 0 | |
524288 -> 1048575 : 0 | |
1048576 -> 2097151 : 0 | |
2097152 -> 4194303 : 401 |**************************** |
4194304 -> 8388607 : 274 |******************* |
8388608 -> 16777215 : 0 | |
16777216 -> 33554431 : 16 |* |
33554432 -> 67108863 : 561 |****************************************|
inet_csk_bind_conflict : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 0 | |
8 -> 15 : 0 | |
16 -> 31 : 0 | |
32 -> 63 : 0 | |
64 -> 127 : 0 | |
128 -> 255 : 0 | |
256 -> 511 : 0 | |
512 -> 1023 : 0 | |
1024 -> 2047 : 6 | |
2048 -> 4095 : 68 |**** |
4096 -> 8191 : 9 | |
8192 -> 16383 : 2 | |
16384 -> 32767 : 0 | |
32768 -> 65535 : 0 | |
65536 -> 131071 : 0 | |
131072 -> 262143 : 0 | |
262144 -> 524287 : 0 | |
524288 -> 1048575 : 0 | |
1048576 -> 2097151 : 0 | |
2097152 -> 4194303 : 650 |****************************************|
4194304 -> 8388607 : 0 | |
8388608 -> 16777215 : 0 | |
16777216 -> 33554431 : 15 | |
33554432 -> 67108863 : 583 |*********************************** |
inet_csk_get_port : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 0 | |
8 -> 15 : 0 | |
16 -> 31 : 0 | |
32 -> 63 : 0 | |
64 -> 127 : 0 | |
128 -> 255 : 0 | |
256 -> 511 : 0 | |
512 -> 1023 : 0 | |
1024 -> 2047 : 18 |* |
2048 -> 4095 : 263 |******************** |
4096 -> 8191 : 188 |************** |
8192 -> 16383 : 186 |************** |
16384 -> 32767 : 7 | |
32768 -> 65535 : 1 | |
65536 -> 131071 : 1 | |
131072 -> 262143 : 0 | |
262144 -> 524287 : 0 | |
524288 -> 1048575 : 0 | |
1048576 -> 2097151 : 0 | |
2097152 -> 4194303 : 37 |** |
4194304 -> 8388607 : 454 |********************************** |
8388608 -> 16777215 : 9 | |
16777216 -> 33554431 : 24 |* |
33554432 -> 67108863 : 526 |****************************************|
<soft lockup messages start happening>
inet_csk_bind_conflict : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 0 | |
8 -> 15 : 0 | |
16 -> 31 : 0 | |
32 -> 63 : 0 | |
64 -> 127 : 0 | |
128 -> 255 : 0 | |
256 -> 511 : 0 | |
512 -> 1023 : 0 | |
1024 -> 2047 : 20 |* |
2048 -> 4095 : 130 |********** |
4096 -> 8191 : 40 |*** |
8192 -> 16383 : 2 | |
16384 -> 32767 : 1 | |
32768 -> 65535 : 0 | |
65536 -> 131071 : 0 | |
131072 -> 262143 : 0 | |
262144 -> 524287 : 0 | |
524288 -> 1048575 : 0 | |
1048576 -> 2097151 : 0 | |
2097152 -> 4194303 : 506 |*************************************** |
4194304 -> 8388607 : 0 | |
8388608 -> 16777215 : 0 | |
16777216 -> 33554431 : 23 |* |
33554432 -> 67108863 : 511 |****************************************|
inet_csk_get_port : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 0 | |
8 -> 15 : 0 | |
16 -> 31 : 0 | |
32 -> 63 : 0 | |
64 -> 127 : 0 | |
128 -> 255 : 0 | |
256 -> 511 : 0 | |
512 -> 1023 : 0 | |
1024 -> 2047 : 9 | |
2048 -> 4095 : 356 |********************|
4096 -> 8191 : 230 |************ |
8192 -> 16383 : 342 |******************* |
16384 -> 32767 : 12 | |
32768 -> 65535 : 1 | |
65536 -> 131071 : 0 | |
131072 -> 262143 : 0 | |
262144 -> 524287 : 1 | |
524288 -> 1048575 : 0 | |
1048576 -> 2097151 : 0 | |
2097152 -> 4194303 : 311 |***************** |
4194304 -> 8388607 : 163 |********* |
8388608 -> 16777215 : 1 | |
16777216 -> 33554431 : 3 | |
33554432 -> 67108863 : 338 |****************** |
67108864 -> 134217727 : 55 |*** |
134217728 -> 268435455 : 65 |*** |
268435456 -> 536870911 : 36 |** |
536870912 -> 1073741823 : 22 |* |
1073741824 -> 2147483647 : 16 | |
2147483648 -> 4294967295 : 7 | |
4294967296 -> 8589934591 : 1 | |
inet_csk_bind_conflict : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 0 | |
8 -> 15 : 0 | |
16 -> 31 : 0 | |
32 -> 63 : 0 | |
64 -> 127 : 0 | |
128 -> 255 : 0 | |
256 -> 511 : 0 | |
512 -> 1023 : 0 | |
1024 -> 2047 : 2 | |
2048 -> 4095 : 86 |*** |
4096 -> 8191 : 16 | |
8192 -> 16383 : 0 | |
16384 -> 32767 : 0 | |
32768 -> 65535 : 0 | |
65536 -> 131071 : 0 | |
131072 -> 262143 : 0 | |
262144 -> 524287 : 0 | |
524288 -> 1048575 : 0 | |
1048576 -> 2097151 : 187 |******* |
2097152 -> 4194303 : 975 |****************************************|
4194304 -> 8388607 : 0 | |
8388608 -> 16777215 : 0 | |
16777216 -> 33554431 : 337 |************* |
33554432 -> 67108863 : 442 |****************** |
inet_csk_get_port : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 0 | |
8 -> 15 : 0 | |
16 -> 31 : 0 | |
32 -> 63 : 0 | |
64 -> 127 : 0 | |
128 -> 255 : 0 | |
256 -> 511 : 0 | |
512 -> 1023 : 0 | |
1024 -> 2047 : 162 |**** |
2048 -> 4095 : 495 |************** |
4096 -> 8191 : 66 |* |
8192 -> 16383 : 6 | |
16384 -> 32767 : 2 | |
32768 -> 65535 : 0 | |
65536 -> 131071 : 0 | |
131072 -> 262143 : 0 | |
262144 -> 524287 : 0 | |
524288 -> 1048575 : 0 | |
1048576 -> 2097151 : 0 | |
2097152 -> 4194303 : 680 |********************|
4194304 -> 8388607 : 166 |**** |
8388608 -> 16777215 : 10 | |
16777216 -> 33554431 : 6 | |
33554432 -> 67108863 : 150 |**** |
67108864 -> 134217727 : 275 |******** |
134217728 -> 268435455 : 205 |****** |
268435456 -> 536870911 : 151 |**** |
536870912 -> 1073741823 : 137 |**** |
1073741824 -> 2147483647 : 76 |** |
2147483648 -> 4294967295 : 48 |* |
4294967296 -> 8589934591 : 6 | |
8589934592 -> 17179869183 : 2 | |
inet_csk_bind_conflict : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 0 | |
8 -> 15 : 0 | |
16 -> 31 : 0 | |
32 -> 63 : 0 | |
64 -> 127 : 0 | |
128 -> 255 : 0 | |
256 -> 511 : 0 | |
512 -> 1023 : 0 | |
1024 -> 2047 : 7 | |
2048 -> 4095 : 40 |*** |
4096 -> 8191 : 0 | |
8192 -> 16383 : 0 | |
16384 -> 32767 : 0 | |
32768 -> 65535 : 0 | |
65536 -> 131071 : 0 | |
131072 -> 262143 : 0 | |
262144 -> 524287 : 0 | |
524288 -> 1048575 : 0 | |
1048576 -> 2097151 : 33 |** |
2097152 -> 4194303 : 159 |************ |
4194304 -> 8388607 : 0 | |
8388608 -> 16777215 : 0 | |
16777216 -> 33554431 : 311 |************************* |
33554432 -> 67108863 : 493 |****************************************|
inet_csk_get_port : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 0 | |
8 -> 15 : 0 | |
16 -> 31 : 0 | |
32 -> 63 : 0 | |
64 -> 127 : 0 | |
128 -> 255 : 0 | |
256 -> 511 : 0 | |
512 -> 1023 : 0 | |
1024 -> 2047 : 129 |******************* |
2048 -> 4095 : 55 |******** |
4096 -> 8191 : 47 |******* |
8192 -> 16383 : 17 |** |
16384 -> 32767 : 2 | |
32768 -> 65535 : 0 | |
65536 -> 131071 : 0 | |
131072 -> 262143 : 0 | |
262144 -> 524287 : 0 | |
524288 -> 1048575 : 0 | |
1048576 -> 2097151 : 30 |**** |
2097152 -> 4194303 : 130 |********************|
4194304 -> 8388607 : 24 |*** |
8388608 -> 16777215 : 0 | |
16777216 -> 33554431 : 13 |** |
33554432 -> 67108863 : 118 |****************** |
67108864 -> 134217727 : 58 |******** |
134217728 -> 268435455 : 17 |** |
268435456 -> 536870911 : 7 |* |
536870912 -> 1073741823 : 0 | |
1073741824 -> 2147483647 : 1 | |
2147483648 -> 4294967295 : 0 | |
4294967296 -> 8589934591 : 1 | |
inet_csk_bind_conflict : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 0 | |
8 -> 15 : 0 | |
16 -> 31 : 0 | |
32 -> 63 : 0 | |
64 -> 127 : 0 | |
128 -> 255 : 0 | |
256 -> 511 : 0 | |
512 -> 1023 : 0 | |
1024 -> 2047 : 6 |* |
2048 -> 4095 : 14 |** |
4096 -> 8191 : 0 | |
8192 -> 16383 : 1 | |
16384 -> 32767 : 0 | |
32768 -> 65535 : 0 | |
65536 -> 131071 : 0 | |
131072 -> 262143 : 0 | |
262144 -> 524287 : 0 | |
524288 -> 1048575 : 0 | |
1048576 -> 2097151 : 158 |******************************** |
2097152 -> 4194303 : 22 |**** |
4194304 -> 8388607 : 0 | |
8388608 -> 16777215 : 0 | |
16777216 -> 33554431 : 192 |****************************************|
33554432 -> 67108863 : 9 |* |
<recovers>
inet_csk_get_port : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 0 | |
8 -> 15 : 0 | |
16 -> 31 : 0 | |
32 -> 63 : 0 | |
64 -> 127 : 0 | |
128 -> 255 : 0 | |
256 -> 511 : 0 | |
512 -> 1023 : 0 | |
1024 -> 2047 : 10 |**************** |
2048 -> 4095 : 25 |****************************************|
4096 -> 8191 : 16 |************************* |
8192 -> 16383 : 1 |* |
16384 -> 32767 : 0 | |
32768 -> 65535 : 1 |* |
inet_csk_bind_conflict : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 0 | |
8 -> 15 : 0 | |
16 -> 31 : 0 | |
32 -> 63 : 0 | |
64 -> 127 : 0 | |
128 -> 255 : 0 | |
256 -> 511 : 0 | |
512 -> 1023 : 0 | |
1024 -> 2047 : 10 |********************************* |
2048 -> 4095 : 12 |****************************************|
inet_csk_get_port : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 0 | |
8 -> 15 : 0 | |
16 -> 31 : 0 | |
32 -> 63 : 0 | |
64 -> 127 : 0 | |
128 -> 255 : 0 | |
256 -> 511 : 0 | |
512 -> 1023 : 0 | |
1024 -> 2047 : 0 | |
2048 -> 4095 : 0 | |
4096 -> 8191 : 4 |****************************************|
8192 -> 16383 : 1 |********** |
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2.2: tw-reuseport.patch --]
[-- Type: text/x-patch, Size: 1229 bytes --]
commit ea66f43c5b4d94625ad7322e4097acd9a06d7fdd
Author: Josef Bacik <jbacik@fb.com>
Date: Wed Dec 14 11:54:49 2016 -0800
do reuseport too
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h
index c9b3eb7..567017b 100644
--- a/include/net/inet_timewait_sock.h
+++ b/include/net/inet_timewait_sock.h
@@ -55,6 +55,7 @@ struct inet_timewait_sock {
#define tw_family __tw_common.skc_family
#define tw_state __tw_common.skc_state
#define tw_reuse __tw_common.skc_reuse
+#define tw_reuseport __tw_common.skc_reuseport
#define tw_ipv6only __tw_common.skc_ipv6only
#define tw_bound_dev_if __tw_common.skc_bound_dev_if
#define tw_node __tw_common.skc_nulls_node
diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c
index a1b1057..04c560e 100644
--- a/net/ipv4/inet_timewait_sock.c
+++ b/net/ipv4/inet_timewait_sock.c
@@ -183,6 +183,7 @@ struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk,
tw->tw_dport = inet->inet_dport;
tw->tw_family = sk->sk_family;
tw->tw_reuse = sk->sk_reuse;
+ tw->tw_reuseport = sk->sk_reuseport;
tw->tw_hash = sk->sk_hash;
tw->tw_ipv6only = 0;
tw->tw_transparent = inet->transparent;
^ permalink raw reply related
* Re: [PATCH v3 3/3] random: use siphash24 instead of md5 for get_random_int/long
From: Jason A. Donenfeld @ 2016-12-15 18:51 UTC (permalink / raw)
To: David Laight
Cc: Netdev, kernel-hardening@lists.openwall.com, LKML,
linux-crypto@vger.kernel.org, Jean-Philippe Aumasson, Ted Tso
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6DB02401A1@AcuExch.aculab.com>
Hi David,
On Thu, Dec 15, 2016 at 11:14 AM, David Laight <David.Laight@aculab.com> wrote:
> From: Behalf Of Jason A. Donenfeld
>> Sent: 14 December 2016 18:46
> ...
>> + ret = *chaining = siphash24((u8 *)&combined, offsetof(typeof(combined), end),
>
> If you make the first argument 'const void *' you won't need the cast
> on every call.
>
> I'd also suggest making the key u64[2].
I'll do both. Thanks for the suggestion.
Jason
^ permalink raw reply
* Re: [PATCH v2 1/4] siphash: add cryptographically secure hashtable function
From: Jason A. Donenfeld @ 2016-12-15 18:50 UTC (permalink / raw)
To: Hannes Frederic Sowa, David Laight
Cc: Netdev, kernel-hardening@lists.openwall.com,
Jean-Philippe Aumasson, LKML, Linux Crypto Mailing List,
Daniel J . Bernstein, Linus Torvalds, Eric Biggers
In-Reply-To: <924ef794-eae0-2a6b-508b-069718339edc@stressinduktion.org>
Hi David & Hannes,
This conversation is veering off course. I think this doesn't really
matter at all. Gcc converts u64 into essentially a pair of u32 on
32-bit platforms, so the alignment requirements for 32-bit is at a
maximum 32 bits. On 64-bit platforms the alignment requirements are
related at a maximum to the biggest register size, so 64-bit
alignment. For this reason, no matter the behavior of __aligned(8),
we're okay. Likewise, even without __aligned(8), if gcc aligns structs
by their biggest member, then we get 4 byte alignment on 32-bit and 8
byte alignment on 64-bit, which is fine. There's no 32-bit platform
that will trap on a 64-bit unaligned access because there's no such
thing as a 64-bit access there. In short, we're fine.
(The reason in6_addr aligns itself to 4 bytes on 64-bit platforms is
that it's defined as being u32 blah[4]. If we added a u64 blah[2],
we'd get 8 byte alignment, but that's not in the header. Feel free to
start a new thread about this issue if you feel this ought to be added
for whatever reason.)
One optimization that's been suggested on this list is that instead of
u8 key[16] and requiring the alignment attribute, I should just use
u64 key[2]. This seems reasonable to me, and it will also save the
endian conversion call. These keys generally aren't transmitted over a
network, so I don't think a byte-wise encoding is particularly
important.
The other suggestion I've seen is that I make the functions take a
const void * instead of a const u8 * for the data, in order to save
ugly casts. I'll do this too.
Meanwhile Linus has condemned our 4dwords/2qwords naming, and I'll
need to think of something different. The best I can think of right
now is siphash_4_u32/siphash_2_u64, but I don't find it especially
pretty. Open to suggestions.
Regards,
Jason
^ permalink raw reply
* Re: [RFC v2 00/10] HFI Virtual Network Interface Controller (VNIC)
From: Jason Gunthorpe @ 2016-12-15 18:48 UTC (permalink / raw)
To: Doug Ledford
Cc: ira.weiny, Leon Romanovsky, Jeff Kirsher, David S. Miller,
Vishwanathapura, Niranjana, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA,
dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w
In-Reply-To: <4e22bf29-2260-0768-ab17-9a8df6306f37-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
On Thu, Dec 15, 2016 at 01:19:18PM -0500, Doug Ledford wrote:
> On 12/15/2016 12:07 PM, Jason Gunthorpe wrote:
> > On Thu, Dec 15, 2016 at 11:28:06AM -0500, Doug Ledford wrote:
> >
> >> 1) Since your intent is to make this work with multiple versions of the
> >> hfi drivers, I disagree with Jason that just because there is only one
> >> driver today that we should keep it simple. Design it right from the
> >> beginning of multi driver is your intent is, IMO, a better way to go.
> >> You'll work out the bugs in the initial implementation and when it comes
> >> time to add the second driver, things will go much more smoothly.
> >
> > If that is your position then this should be a straight up IB ULP that
> > works with any IB hardware.
>
> Yes, see my comments in point #3 of my previous email...
Well, I'm not opposed to the vnic idea - Mellanox had (has?) a similar
IB driver. There are lots of good reasons to strictly maintain the
ethernet presentation.
There is much more going on here than just changing the LLADDR,
essentially everything MAD focused is different compared to ipoib, and
it looks like the required datastructures are different too. This is
more of a map a mac to a OPA_LRH approach with SA mediated discovery,
by my eye.
The main share is the 'skb send' part, we've talked about hoisting
that out of ipoib in the past anyhow. A generic verb along those lines
would probably allow the sdma optimization for hfi for both this new
ulp and ipoib without creating such an ugly HFI1 specific interface.
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [upstream-release] [PATCH net 2/4] fsl/fman: arm: call of_platform_populate() for arm64 platfrom
From: Scott Wood @ 2016-12-15 18:41 UTC (permalink / raw)
To: Madalin-Cristian Bucur, netdev@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
davem@davemloft.net
In-Reply-To: <1481807497-4724-3-git-send-email-madalin.bucur@nxp.com>
On 12/15/2016 07:11 AM, Madalin Bucur wrote:
> From: Igal Liberman <igal.liberman@freescale.com>
>
> Signed-off-by: Igal Liberman <igal.liberman@freescale.com>
> ---
> drivers/net/ethernet/freescale/fman/fman.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/net/ethernet/freescale/fman/fman.c b/drivers/net/ethernet/freescale/fman/fman.c
> index dafd9e1..f36b4eb 100644
> --- a/drivers/net/ethernet/freescale/fman/fman.c
> +++ b/drivers/net/ethernet/freescale/fman/fman.c
> @@ -2868,6 +2868,16 @@ static struct fman *read_dts_node(struct platform_device *of_dev)
>
> fman->dev = &of_dev->dev;
>
> +#ifdef CONFIG_ARM64
> + /* call of_platform_populate in order to probe sub-nodes on arm64 */
> + err = of_platform_populate(fm_node, NULL, NULL, &of_dev->dev);
> + if (err) {
> + dev_err(&of_dev->dev, "%s: of_platform_populate() failed\n",
> + __func__);
> + goto fman_free;
> + }
> +#endif
Should we remove fsl,fman from the PPC of_device_ids[], so this doesn't
need an ifdef?
Why is it #ifdef CONFIG_ARM64 rather than #ifndef CONFIG_PPC?
-Scott
^ permalink raw reply
* Re: [PATCH perf/core REBASE 2/5] samples/bpf: Switch over to libbpf
From: Arnaldo Carvalho de Melo @ 2016-12-15 18:36 UTC (permalink / raw)
To: Joe Stringer
Cc: linux-kernel, netdev, wangnan0, ast, daniel,
Arnaldo Carvalho de Melo
In-Reply-To: <20161215183440.GH6866@kernel.org>
Em Thu, Dec 15, 2016 at 03:34:40PM -0300, Arnaldo Carvalho de Melo escreveu:
>
> So, I'm stopping here so that I can push what I have to Ingo, then I'll get
> back to this, hopefully by then you beat me and I have just to retest 8-)
Ah, I left what I have in the tmp.perf/samples-libbpf branch in my tree
at git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git.
I'll remove just the HEAD one and push the rest to Ingo.
- Arnaldo
^ permalink raw reply
* Re: [PATCH perf/core REBASE 2/5] samples/bpf: Switch over to libbpf
From: Arnaldo Carvalho de Melo @ 2016-12-15 18:34 UTC (permalink / raw)
To: Joe Stringer
Cc: linux-kernel, netdev, wangnan0, ast, daniel,
Arnaldo Carvalho de Melo
In-Reply-To: <20161215182918.GG6866@kernel.org>
Em Thu, Dec 15, 2016 at 03:29:18PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Thu, Dec 15, 2016 at 12:50:22PM -0300, Arnaldo Carvalho de Melo escreveu:
> > Em Wed, Dec 14, 2016 at 02:43:39PM -0800, Joe Stringer escreveu:
> > > Now that libbpf under tools/lib/bpf/* is synced with the version from
> > > samples/bpf, we can get rid most of the libbpf library here.
> > >
> > > Signed-off-by: Joe Stringer <joe@ovn.org>
> > > Cc: Alexei Starovoitov <ast@fb.com>
> > > Cc: Daniel Borkmann <daniel@iogearbox.net>
> > > Cc: Wang Nan <wangnan0@huawei.com>
> > > Link: http://lkml.kernel.org/r/20161209024620.31660-6-joe@ovn.org
> > > [ Use -I$(srctree)/tools/lib/ to support out of source code tree builds, as noticed by Wang Nan ]
>
> So, the above comment no longer applied to this adjusted patch from you,
> as you removed one hunk too much, that, after applied, gets samples/bpf/
> to build successfully:
>
> diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
> index add514e2984a..81b0ef2f7994 100644
> --- a/samples/bpf/Makefile
> +++ b/samples/bpf/Makefile
> @@ -107,6 +107,7 @@ always += lwt_len_hist_kern.o
> always += xdp_tx_iptunnel_kern.o
>
> HOSTCFLAGS += -I$(objtree)/usr/include
> +HOSTCFLAGS += -I$(srctree)/tools/lib/
> HOSTCFLAGS += -I$(srctree)/tools/testing/selftests/bpf/
>
> HOSTCFLAGS_bpf_load.o += -I$(objtree)/usr/include -Wno-unused-variable
>
> ---------------------
>
> I added it, continuing...
But then, when I tried to run offwaketime with it, it fails:
[root@jouet bpf]# ./offwaketime ls
bpf_load_program() err=22
BPF_LDX uses reserved fields
bpf_load_program() err=22
BPF_LDX uses reserved fields
[root@jouet bpf]#
If I remove this patch and try again, it works:
[root@jouet bpf]# ./offwaketime | head -4
swapper/1;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule;__schedule;-;---;; 46
chrome;return_from_SYSCALL_64;do_syscall_64;exit_to_usermode_loop;schedule;__schedule;-;try_to_wake_up;do_futex;sys_futex;do_syscall_64;return_from_SYSCALL_64;;Chrome_ChildIOT 1
firefox;entry_SYSCALL_64_fastpath;sys_poll;do_sys_poll;poll_schedule_timeout;schedule_hrtimeout_range;schedule_hrtimeout_range_clock;schedule;__schedule;-;try_to_wake_up;pollwake;__wake_up_common;__wake_up_sync_key;pipe_write;__vfs_write;vfs_write;sys_write;entry_SYSCALL_64_fastpath;;Timer 3
dockerd-current;entry_SYSCALL_64_fastpath;sys_select;core_sys_select;do_select;poll_schedule_timeout;schedule_hrtimeout_range;schedule_hrtimeout_range_clock;schedule;__schedule;-;try_to_wake_up;futex_wake;do_futex;sys_futex;entry_SYSCALL_64_fastpath;;dockerd-current 2
[root@jouet bpf]#
So, I'm stopping here so that I can push what I have to Ingo, then I'll get
back to this, hopefully by then you beat me and I have just to retest 8-)
- Arnaldo
^ permalink raw reply
* Re: [PATCH perf/core REBASE 2/5] samples/bpf: Switch over to libbpf
From: Joe Stringer @ 2016-12-15 18:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: LKML, netdev, Wang Nan, ast, Daniel Borkmann,
Arnaldo Carvalho de Melo
In-Reply-To: <20161215155022.GE6866@kernel.org>
On 15 December 2016 at 07:50, Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> Em Wed, Dec 14, 2016 at 02:43:39PM -0800, Joe Stringer escreveu:
>> Now that libbpf under tools/lib/bpf/* is synced with the version from
>> samples/bpf, we can get rid most of the libbpf library here.
>>
>> Signed-off-by: Joe Stringer <joe@ovn.org>
>> Cc: Alexei Starovoitov <ast@fb.com>
>> Cc: Daniel Borkmann <daniel@iogearbox.net>
>> Cc: Wang Nan <wangnan0@huawei.com>
>> Link: http://lkml.kernel.org/r/20161209024620.31660-6-joe@ovn.org
>> [ Use -I$(srctree)/tools/lib/ to support out of source code tree builds, as noticed by Wang Nan ]
>> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> So, right before this patch building samples/bpf works, then, after, it fails,
> investigating:
>
> [root@1e797fdfbf4f linux]# make -j4 O=/tmp/build/linux/ headers_install
> make[1]: Entering directory '/tmp/build/linux'
> CHK include/generated/uapi/linux/version.h
> make[1]: Leaving directory '/tmp/build/linux'
> [root@1e797fdfbf4f linux]# make -j4 O=/tmp/build/linux/ samples/bpf/
> make[1]: Entering directory '/tmp/build/linux'
> CHK include/config/kernel.release
> GEN ./Makefile
> CHK include/generated/uapi/linux/version.h
> Using /git/linux as source for kernel
> CHK include/generated/utsrelease.h
> CHK include/generated/timeconst.h
> CHK include/generated/bounds.h
> CHK include/generated/asm-offsets.h
> CALL /git/linux/scripts/checksyscalls.sh
> HOSTCC samples/bpf/test_lru_dist.o
> HOSTCC samples/bpf/libbpf.o
> HOSTCC samples/bpf/sock_example.o
> HOSTCC samples/bpf/bpf_load.o
> In file included from /git/linux/samples/bpf/libbpf.c:12:0:
> /git/linux/samples/bpf/libbpf.h:5:21: fatal error: bpf/bpf.h: No such file or directory
> #include <bpf/bpf.h>
> ^
> compilation terminated.
> In file included from /git/linux/samples/bpf/test_lru_dist.c:24:0:
> /git/linux/samples/bpf/libbpf.h:5:21: fatal error: bpf/bpf.h: No such file or directory
> #include <bpf/bpf.h>
> ^
> compilation terminated.
> make[2]: *** [scripts/Makefile.host:124: samples/bpf/test_lru_dist.o] Error 1
> make[2]: *** Waiting for unfinished jobs....
> make[2]: *** [scripts/Makefile.host:124: samples/bpf/libbpf.o] Error 1
> In file included from /git/linux/samples/bpf/bpf_load.c:24:0:
> /git/linux/samples/bpf/libbpf.h:5:21: fatal error: bpf/bpf.h: No such file or directory
> #include <bpf/bpf.h>
> ^
> compilation terminated.
> make[2]: *** [scripts/Makefile.host:124: samples/bpf/bpf_load.o] Error 1
> In file included from /git/linux/samples/bpf/sock_example.c:29:0:
> /git/linux/samples/bpf/libbpf.h:5:21: fatal error: bpf/bpf.h: No such file or directory
> #include <bpf/bpf.h>
> ^
> compilation terminated.
> make[2]: *** [scripts/Makefile.host:124: samples/bpf/sock_example.o] Error 1
> make[1]: *** [/git/linux/Makefile:1659: samples/bpf/] Error 2
> make[1]: Leaving directory '/tmp/build/linux'
> make: *** [Makefile:150: sub-make] Error 2
> [root@1e797fdfbf4f linux]#
Sorry about that.
It looks like this fragment which ended up in "samples/bpf: Remove
perf_event_open() declaration" patch should be here instead:
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index add514e2984a..9718f664fedf 100644
--- a/samples/bpf/Makefile
+++ b/samples/bpf/Makefile
@@ -108,6 +108,8 @@ always += xdp_tx_iptunnel_kern.o
HOSTCFLAGS += -I$(objtree)/usr/include
HOSTCFLAGS += -I$(srctree)/tools/testing/selftests/bpf/
+HOSTCFLAGS += -I$(srctree)/tools/lib/ -I$(srctree)/tools/include
+HOSTCFLAGS += -I$(srctree)/tools/perf
HOSTCFLAGS_bpf_load.o += -I$(objtree)/usr/include -Wno-unused-variable
HOSTLOADLIBES_fds_example += -lelf
^ permalink raw reply related
* Re: [PATCH perf/core REBASE 2/5] samples/bpf: Switch over to libbpf
From: Arnaldo Carvalho de Melo @ 2016-12-15 18:29 UTC (permalink / raw)
To: Joe Stringer
Cc: linux-kernel, netdev, wangnan0, ast, daniel,
Arnaldo Carvalho de Melo
In-Reply-To: <20161215155022.GE6866@kernel.org>
Em Thu, Dec 15, 2016 at 12:50:22PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Wed, Dec 14, 2016 at 02:43:39PM -0800, Joe Stringer escreveu:
> > Now that libbpf under tools/lib/bpf/* is synced with the version from
> > samples/bpf, we can get rid most of the libbpf library here.
> >
> > Signed-off-by: Joe Stringer <joe@ovn.org>
> > Cc: Alexei Starovoitov <ast@fb.com>
> > Cc: Daniel Borkmann <daniel@iogearbox.net>
> > Cc: Wang Nan <wangnan0@huawei.com>
> > Link: http://lkml.kernel.org/r/20161209024620.31660-6-joe@ovn.org
> > [ Use -I$(srctree)/tools/lib/ to support out of source code tree builds, as noticed by Wang Nan ]
So, the above comment no longer applied to this adjusted patch from you,
as you removed one hunk too much, that, after applied, gets samples/bpf/
to build successfully:
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index add514e2984a..81b0ef2f7994 100644
--- a/samples/bpf/Makefile
+++ b/samples/bpf/Makefile
@@ -107,6 +107,7 @@ always += lwt_len_hist_kern.o
always += xdp_tx_iptunnel_kern.o
HOSTCFLAGS += -I$(objtree)/usr/include
+HOSTCFLAGS += -I$(srctree)/tools/lib/
HOSTCFLAGS += -I$(srctree)/tools/testing/selftests/bpf/
HOSTCFLAGS_bpf_load.o += -I$(objtree)/usr/include -Wno-unused-variable
---------------------
I added it, continuing...
- Arnaldo
> > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> So, right before this patch building samples/bpf works, then, after, it fails,
> investigating:
>
> [root@1e797fdfbf4f linux]# make -j4 O=/tmp/build/linux/ headers_install
> make[1]: Entering directory '/tmp/build/linux'
> CHK include/generated/uapi/linux/version.h
> make[1]: Leaving directory '/tmp/build/linux'
> [root@1e797fdfbf4f linux]# make -j4 O=/tmp/build/linux/ samples/bpf/
> make[1]: Entering directory '/tmp/build/linux'
> CHK include/config/kernel.release
> GEN ./Makefile
> CHK include/generated/uapi/linux/version.h
> Using /git/linux as source for kernel
> CHK include/generated/utsrelease.h
> CHK include/generated/timeconst.h
> CHK include/generated/bounds.h
> CHK include/generated/asm-offsets.h
> CALL /git/linux/scripts/checksyscalls.sh
> HOSTCC samples/bpf/test_lru_dist.o
> HOSTCC samples/bpf/libbpf.o
> HOSTCC samples/bpf/sock_example.o
> HOSTCC samples/bpf/bpf_load.o
> In file included from /git/linux/samples/bpf/libbpf.c:12:0:
> /git/linux/samples/bpf/libbpf.h:5:21: fatal error: bpf/bpf.h: No such file or directory
> #include <bpf/bpf.h>
> ^
> compilation terminated.
> In file included from /git/linux/samples/bpf/test_lru_dist.c:24:0:
> /git/linux/samples/bpf/libbpf.h:5:21: fatal error: bpf/bpf.h: No such file or directory
> #include <bpf/bpf.h>
> ^
> compilation terminated.
> make[2]: *** [scripts/Makefile.host:124: samples/bpf/test_lru_dist.o] Error 1
> make[2]: *** Waiting for unfinished jobs....
> make[2]: *** [scripts/Makefile.host:124: samples/bpf/libbpf.o] Error 1
> In file included from /git/linux/samples/bpf/bpf_load.c:24:0:
> /git/linux/samples/bpf/libbpf.h:5:21: fatal error: bpf/bpf.h: No such file or directory
> #include <bpf/bpf.h>
> ^
> compilation terminated.
> make[2]: *** [scripts/Makefile.host:124: samples/bpf/bpf_load.o] Error 1
> In file included from /git/linux/samples/bpf/sock_example.c:29:0:
> /git/linux/samples/bpf/libbpf.h:5:21: fatal error: bpf/bpf.h: No such file or directory
> #include <bpf/bpf.h>
> ^
> compilation terminated.
> make[2]: *** [scripts/Makefile.host:124: samples/bpf/sock_example.o] Error 1
> make[1]: *** [/git/linux/Makefile:1659: samples/bpf/] Error 2
> make[1]: Leaving directory '/tmp/build/linux'
> make: *** [Makefile:150: sub-make] Error 2
> [root@1e797fdfbf4f linux]#
^ permalink raw reply related
* [PATCH v2 net] rebased to master
From: Manuel Bessler @ 2016-12-15 18:21 UTC (permalink / raw)
To: netdev; +Cc: Manuel Bessler
In-Reply-To: <1481823997-11604-1-git-send-email-manuel.bessler@sensus.com>
'ifconfig eth0 down' makes r6040_close() trigger:
INFO: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected
Fixed by moving calls to phy_stop(), napi_disable(), netif_stop_queue()
to outside of the module's private spin_lock_irq block.
Found on a Versalogic Tomcat SBC with a Vortex86 SoC
s1660e_5150:~# sudo ifconfig eth0 down
[ 61.306415] ======================================================
[ 61.306415] [ INFO: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected ]
[ 61.306415] 4.9.0-gb898d2d-manuel #1 Not tainted
[ 61.306415] ------------------------------------------------------
[ 61.306415] ifconfig/449 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
[ 61.306415] (&dev->lock){+.+...}, at: [<c1336276>] phy_stop+0x16/0x80
[ 61.306415] and this task is already holding:
[ 61.306415] (&(&lp->lock)->rlock){+.-...}, at: [<d0934c84>] r6040_close+0x24/0x230 [r6040]
which would create a new lock dependency:
[ 61.306415] (&(&lp->lock)->rlock){+.-...} -> (&dev->lock){+.+...}
[ 61.306415] but this new dependency connects a SOFTIRQ-irq-safe lock:
[ 61.306415] (&(&lp->lock)->rlock){+.-...}
[ 61.306415] ... which became SOFTIRQ-irq-safe at:
[ 61.306415] [ 61.306415] [<c1075bc5>] __lock_acquire+0x555/0x1770
[ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
[ 61.306415] [ 61.306415] [<c14bb334>] _raw_spin_lock_irqsave+0x24/0x40
[ 61.306415] [ 61.306415] [<d0934ac0>] r6040_start_xmit+0x30/0x1d0 [r6040]
[ 61.306415] [ 61.306415] [<c13a7d4d>] dev_hard_start_xmit+0x9d/0x2d0
[ 61.306415] [ 61.306415] [<c13c8a38>] sch_direct_xmit+0xa8/0x140
[ 61.306415] [ 61.306415] [<c13a8436>] __dev_queue_xmit+0x416/0x780
[ 61.306415] [ 61.306415] [<c13a87aa>] dev_queue_xmit+0xa/0x10
[ 61.306415] [ 61.306415] [<c13b4837>] neigh_resolve_output+0x147/0x220
[ 61.306415] [ 61.306415] [<c144541b>] ip6_finish_output2+0x2fb/0x910
[ 61.306415] [ 61.306415] [<c14494e6>] ip6_finish_output+0xa6/0x1a0
[ 61.306415] [ 61.306415] [<c1449635>] ip6_output+0x55/0x320
[ 61.306415] [ 61.306415] [<c146f4d2>] mld_sendpack+0x352/0x560
[ 61.306415] [ 61.306415] [<c146fe55>] mld_ifc_timer_expire+0x155/0x280
[ 61.306415] [ 61.306415] [<c108b081>] call_timer_fn+0x81/0x270
[ 61.306415] [ 61.306415] [<c108b331>] expire_timers+0xc1/0x180
[ 61.306415] [ 61.306415] [<c108b4f7>] run_timer_softirq+0x77/0x150
[ 61.306415] [ 61.306415] [<c1043d04>] __do_softirq+0xb4/0x3d0
[ 61.306415] [ 61.306415] [<c101a15c>] do_softirq_own_stack+0x1c/0x30
[ 61.306415] [ 61.306415] [<c104416e>] irq_exit+0x8e/0xa0
[ 61.306415] [ 61.306415] [<c1019d31>] do_IRQ+0x51/0x100
[ 61.306415] [ 61.306415] [<c14bc176>] common_interrupt+0x36/0x40
[ 61.306415] [ 61.306415] [<c1134928>] set_root+0x68/0xf0
[ 61.306415] [ 61.306415] [<c1136120>] path_init+0x400/0x640
[ 61.306415] [ 61.306415] [<c11386bf>] path_lookupat+0xf/0xe0
[ 61.306415] [ 61.306415] [<c1139ebc>] filename_lookup+0x6c/0x100
[ 61.306415] [ 61.306415] [<c1139fd5>] user_path_at_empty+0x25/0x30
[ 61.306415] [ 61.306415] [<c11298c6>] SyS_faccessat+0x86/0x1e0
[ 61.306415] [ 61.306415] [<c1129a30>] SyS_access+0x10/0x20
[ 61.306415] [ 61.306415] [<c100179f>] do_int80_syscall_32+0x3f/0x110
[ 61.306415] [ 61.306415] [<c14bba3f>] restore_all+0x0/0x61
[ 61.306415]
[ 61.306415] to a SOFTIRQ-irq-unsafe lock:
[ 61.306415] (&dev->lock){+.+...}
[ 61.306415] ... which became SOFTIRQ-irq-unsafe at:
[ 61.306415] ...[ 61.306415]
[ 61.306415] [<c1075c0c>] __lock_acquire+0x59c/0x1770
[ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
[ 61.306415] [ 61.306415] [<c14b7add>] mutex_lock_nested+0x2d/0x4a0
[ 61.306415] [ 61.306415] [<c133747d>] phy_probe+0x4d/0xc0
[ 61.306415] [ 61.306415] [<c1338afe>] phy_attach_direct+0xbe/0x190
[ 61.306415] [ 61.306415] [<c1338ca7>] phy_connect_direct+0x17/0x60
[ 61.306415] [ 61.306415] [<c1338d23>] phy_connect+0x33/0x70
[ 61.306415] [ 61.306415] [<d09357a0>] r6040_init_one+0x3a0/0x500 [r6040]
[ 61.306415] [ 61.306415] [<c12a78c7>] pci_device_probe+0x77/0xd0
[ 61.306415] [ 61.306415] [<c12f5e15>] driver_probe_device+0x145/0x280
[ 61.306415] [ 61.306415] [<c12f5fd9>] __driver_attach+0x89/0x90
[ 61.306415] [ 61.306415] [<c12f43ef>] bus_for_each_dev+0x4f/0x80
[ 61.306415] [ 61.306415] [<c12f5954>] driver_attach+0x14/0x20
[ 61.306415] [ 61.306415] [<c12f55b7>] bus_add_driver+0x197/0x210
[ 61.306415] [ 61.306415] [<c12f6a21>] driver_register+0x51/0xd0
[ 61.306415] [ 61.306415] [<c12a6955>] __pci_register_driver+0x45/0x50
[ 61.306415] [ 61.306415] [<d0938017>] 0xd0938017
[ 61.306415] [ 61.306415] [<c100043f>] do_one_initcall+0x2f/0x140
[ 61.306415] [ 61.306415] [<c10e48c0>] do_init_module+0x4a/0x19b
[ 61.306415] [ 61.306415] [<c10a680e>] load_module+0x1b2e/0x2070
[ 61.306415] [ 61.306415] [<c10a6eb9>] SyS_finit_module+0x69/0x80
[ 61.306415] [ 61.306415] [<c100179f>] do_int80_syscall_32+0x3f/0x110
[ 61.306415] [ 61.306415] [<c14bba3f>] restore_all+0x0/0x61
[ 61.306415]
[ 61.306415] other info that might help us debug this:
[ 61.306415]
[ 61.306415] Possible interrupt unsafe locking scenario:
[ 61.306415]
[ 61.306415] CPU0 CPU1
[ 61.306415] ---- ----
[ 61.306415] lock(&dev->lock);
[ 61.306415] local_irq_disable();
[ 61.306415] lock(&(&lp->lock)->rlock);
[ 61.306415] lock(&dev->lock);
[ 61.306415] <Interrupt>
[ 61.306415] lock(&(&lp->lock)->rlock);
[ 61.306415]
[ 61.306415] *** DEADLOCK ***
[ 61.306415]
[ 61.306415] 2 locks held by ifconfig/449:
[ 61.306415] #0: (rtnl_mutex){+.+.+.}, at: [<c13b68ef>] rtnl_lock+0xf/0x20
[ 61.306415] #1: (&(&lp->lock)->rlock){+.-...}, at: [<d0934c84>] r6040_close+0x24/0x230 [r6040]
[ 61.306415]
[ 61.306415] the dependencies between SOFTIRQ-irq-safe lock and the holding lock:
[ 61.306415] -> (&(&lp->lock)->rlock){+.-...} ops: 3049 {
[ 61.306415] HARDIRQ-ON-W at:
[ 61.306415] [ 61.306415] [<c1075be7>] __lock_acquire+0x577/0x1770
[ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
[ 61.306415] [ 61.306415] [<c14bb21b>] _raw_spin_lock+0x1b/0x30
[ 61.306415] [ 61.306415] [<d09343cc>] r6040_poll+0x2c/0x330 [r6040]
[ 61.306415] [ 61.306415] [<c13a5577>] net_rx_action+0x197/0x340
[ 61.306415] [ 61.306415] [<c1043d04>] __do_softirq+0xb4/0x3d0
[ 61.306415] [ 61.306415] [<c1044037>] run_ksoftirqd+0x17/0x40
[ 61.306415] [ 61.306415] [<c105fe91>] smpboot_thread_fn+0x141/0x180
[ 61.306415] [ 61.306415] [<c105c84e>] kthread+0xde/0x110
[ 61.306415] [ 61.306415] [<c14bb949>] ret_from_fork+0x19/0x30
[ 61.306415] IN-SOFTIRQ-W at:
[ 61.306415] [ 61.306415] [<c1075bc5>] __lock_acquire+0x555/0x1770
[ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
[ 61.306415] [ 61.306415] [<c14bb334>] _raw_spin_lock_irqsave+0x24/0x40
[ 61.306415] [ 61.306415] [<d0934ac0>] r6040_start_xmit+0x30/0x1d0 [r6040]
[ 61.306415] [ 61.306415] [<c13a7d4d>] dev_hard_start_xmit+0x9d/0x2d0
[ 61.306415] [ 61.306415] [<c13c8a38>] sch_direct_xmit+0xa8/0x140
[ 61.306415] [ 61.306415] [<c13a8436>] __dev_queue_xmit+0x416/0x780
[ 61.306415] [ 61.306415] [<c13a87aa>] dev_queue_xmit+0xa/0x10
[ 61.306415] [ 61.306415] [<c13b4837>] neigh_resolve_output+0x147/0x220
[ 61.306415] [ 61.306415] [<c144541b>] ip6_finish_output2+0x2fb/0x910
[ 61.306415] [ 61.306415] [<c14494e6>] ip6_finish_output+0xa6/0x1a0
[ 61.306415] [ 61.306415] [<c1449635>] ip6_output+0x55/0x320
[ 61.306415] [ 61.306415] [<c146f4d2>] mld_sendpack+0x352/0x560
[ 61.306415] [ 61.306415] [<c146fe55>] mld_ifc_timer_expire+0x155/0x280
[ 61.306415] [ 61.306415] [<c108b081>] call_timer_fn+0x81/0x270
[ 61.306415] [ 61.306415] [<c108b331>] expire_timers+0xc1/0x180
[ 61.306415] [ 61.306415] [<c108b4f7>] run_timer_softirq+0x77/0x150
[ 61.306415] [ 61.306415] [<c1043d04>] __do_softirq+0xb4/0x3d0
[ 61.306415] [ 61.306415] [<c101a15c>] do_softirq_own_stack+0x1c/0x30
[ 61.306415] [ 61.306415] [<c104416e>] irq_exit+0x8e/0xa0
[ 61.306415] [ 61.306415] [<c1019d31>] do_IRQ+0x51/0x100
[ 61.306415] [ 61.306415] [<c14bc176>] common_interrupt+0x36/0x40
[ 61.306415] [ 61.306415] [<c1134928>] set_root+0x68/0xf0
[ 61.306415] [ 61.306415] [<c1136120>] path_init+0x400/0x640
[ 61.306415] [ 61.306415] [<c11386bf>] path_lookupat+0xf/0xe0
[ 61.306415] [ 61.306415] [<c1139ebc>] filename_lookup+0x6c/0x100
[ 61.306415] [ 61.306415] [<c1139fd5>] user_path_at_empty+0x25/0x30
[ 61.306415] [ 61.306415] [<c11298c6>] SyS_faccessat+0x86/0x1e0
[ 61.306415] [ 61.306415] [<c1129a30>] SyS_access+0x10/0x20
[ 61.306415] [ 61.306415] [<c100179f>] do_int80_syscall_32+0x3f/0x110
[ 61.306415] [ 61.306415] [<c14bba3f>] restore_all+0x0/0x61
[ 61.306415] INITIAL USE at:
[ 61.306415] [ 61.306415] [<c107586e>] __lock_acquire+0x1fe/0x1770
[ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
[ 61.306415] [ 61.306415] [<c14bb334>] _raw_spin_lock_irqsave+0x24/0x40
[ 61.306415] [ 61.306415] [<d093474e>] r6040_get_stats+0x1e/0x60 [r6040]
[ 61.306415] [ 61.306415] [<c139fb16>] dev_get_stats+0x96/0xc0
[ 61.306415] [ 61.306415] [<c14b416e>] rtnl_fill_stats+0x36/0xfd
[ 61.306415] [ 61.306415] [<c13b7b3c>] rtnl_fill_ifinfo+0x47c/0xce0
[ 61.306415] [ 61.306415] [<c13bc08e>] rtmsg_ifinfo_build_skb+0x4e/0xd0
[ 61.306415] [ 61.306415] [<c13bc120>] rtmsg_ifinfo.part.20+0x10/0x40
[ 61.306415] [ 61.306415] [<c13bc16b>] rtmsg_ifinfo+0x1b/0x20
[ 61.306415] [ 61.306415] [<c13a9d19>] register_netdevice+0x409/0x550
[ 61.306415] [ 61.306415] [<c13a9e72>] register_netdev+0x12/0x20
[ 61.306415] [ 61.306415] [<d09357e8>] r6040_init_one+0x3e8/0x500 [r6040]
[ 61.306415] [ 61.306415] [<c12a78c7>] pci_device_probe+0x77/0xd0
[ 61.306415] [ 61.306415] [<c12f5e15>] driver_probe_device+0x145/0x280
[ 61.306415] [ 61.306415] [<c12f5fd9>] __driver_attach+0x89/0x90
[ 61.306415] [ 61.306415] [<c12f43ef>] bus_for_each_dev+0x4f/0x80
[ 61.306415] [ 61.306415] [<c12f5954>] driver_attach+0x14/0x20
[ 61.306415] [ 61.306415] [<c12f55b7>] bus_add_driver+0x197/0x210
[ 61.306415] [ 61.306415] [<c12f6a21>] driver_register+0x51/0xd0
[ 61.306415] [ 61.306415] [<c12a6955>] __pci_register_driver+0x45/0x50
[ 61.306415] [ 61.306415] [<d0938017>] 0xd0938017
[ 61.306415] [ 61.306415] [<c100043f>] do_one_initcall+0x2f/0x140
[ 61.306415] [ 61.306415] [<c10e48c0>] do_init_module+0x4a/0x19b
[ 61.306415] [ 61.306415] [<c10a680e>] load_module+0x1b2e/0x2070
[ 61.306415] [ 61.306415] [<c10a6eb9>] SyS_finit_module+0x69/0x80
[ 61.306415] [ 61.306415] [<c100179f>] do_int80_syscall_32+0x3f/0x110
[ 61.306415] [ 61.306415] [<c14bba3f>] restore_all+0x0/0x61
[ 61.306415] }
[ 61.306415] ... key at: [<d0936280>] __key.45893+0x0/0xfffff739 [r6040]
[ 61.306415] ... acquired at:
[ 61.306415] [ 61.306415] [<c1074a32>] check_irq_usage+0x42/0xb0
[ 61.306415] [ 61.306415] [<c107677c>] __lock_acquire+0x110c/0x1770
[ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
[ 61.306415] [ 61.306415] [<c14b7add>] mutex_lock_nested+0x2d/0x4a0
[ 61.306415] [ 61.306415] [<c1336276>] phy_stop+0x16/0x80
[ 61.306415] [ 61.306415] [<d0934ce9>] r6040_close+0x89/0x230 [r6040]
[ 61.306415] [ 61.306415] [<c13a0a91>] __dev_close_many+0x61/0xa0
[ 61.306415] [ 61.306415] [<c13a0bbf>] __dev_close+0x1f/0x30
[ 61.306415] [ 61.306415] [<c13a9127>] __dev_change_flags+0x87/0x150
[ 61.306415] [ 61.306415] [<c13a9213>] dev_change_flags+0x23/0x60
[ 61.306415] [ 61.306415] [<c1416238>] devinet_ioctl+0x5f8/0x6f0
[ 61.306415] [ 61.306415] [<c1417f75>] inet_ioctl+0x65/0x90
[ 61.306415] [ 61.306415] [<c1389b54>] sock_ioctl+0x124/0x2b0
[ 61.306415] [ 61.306415] [<c113cf7c>] do_vfs_ioctl+0x7c/0x790
[ 61.306415] [ 61.306415] [<c113d6b8>] SyS_ioctl+0x28/0x50
[ 61.306415] [ 61.306415] [<c100179f>] do_int80_syscall_32+0x3f/0x110
[ 61.306415] [ 61.306415] [<c14bba3f>] restore_all+0x0/0x61
[ 61.306415]
[ 61.306415]
the dependencies between the lock to be acquired[ 61.306415] and SOFTIRQ-irq-unsafe lock:
[ 61.306415] -> (&dev->lock){+.+...} ops: 56 {
[ 61.306415] HARDIRQ-ON-W at:
[ 61.306415] [ 61.306415] [<c1075be7>] __lock_acquire+0x577/0x1770
[ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
[ 61.306415] [ 61.306415] [<c14b7add>] mutex_lock_nested+0x2d/0x4a0
[ 61.306415] [ 61.306415] [<c133747d>] phy_probe+0x4d/0xc0
[ 61.306415] [ 61.306415] [<c1338afe>] phy_attach_direct+0xbe/0x190
[ 61.306415] [ 61.306415] [<c1338ca7>] phy_connect_direct+0x17/0x60
[ 61.306415] [ 61.306415] [<c1338d23>] phy_connect+0x33/0x70
[ 61.306415] [ 61.306415] [<d09357a0>] r6040_init_one+0x3a0/0x500 [r6040]
[ 61.306415] [ 61.306415] [<c12a78c7>] pci_device_probe+0x77/0xd0
[ 61.306415] [ 61.306415] [<c12f5e15>] driver_probe_device+0x145/0x280
[ 61.306415] [ 61.306415] [<c12f5fd9>] __driver_attach+0x89/0x90
[ 61.306415] [ 61.306415] [<c12f43ef>] bus_for_each_dev+0x4f/0x80
[ 61.306415] [ 61.306415] [<c12f5954>] driver_attach+0x14/0x20
[ 61.306415] [ 61.306415] [<c12f55b7>] bus_add_driver+0x197/0x210
[ 61.306415] [ 61.306415] [<c12f6a21>] driver_register+0x51/0xd0
[ 61.306415] [ 61.306415] [<c12a6955>] __pci_register_driver+0x45/0x50
[ 61.306415] [ 61.306415] [<d0938017>] 0xd0938017
[ 61.306415] [ 61.306415] [<c100043f>] do_one_initcall+0x2f/0x140
[ 61.306415] [ 61.306415] [<c10e48c0>] do_init_module+0x4a/0x19b
[ 61.306415] [ 61.306415] [<c10a680e>] load_module+0x1b2e/0x2070
[ 61.306415] [ 61.306415] [<c10a6eb9>] SyS_finit_module+0x69/0x80
[ 61.306415] [ 61.306415] [<c100179f>] do_int80_syscall_32+0x3f/0x110
[ 61.306415] [ 61.306415] [<c14bba3f>] restore_all+0x0/0x61
[ 61.306415] SOFTIRQ-ON-W at:
[ 61.306415] [ 61.306415] [<c1075c0c>] __lock_acquire+0x59c/0x1770
[ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
[ 61.306415] [ 61.306415] [<c14b7add>] mutex_lock_nested+0x2d/0x4a0
[ 61.306415] [ 61.306415] [<c133747d>] phy_probe+0x4d/0xc0
[ 61.306415] [ 61.306415] [<c1338afe>] phy_attach_direct+0xbe/0x190
[ 61.306415] [ 61.306415] [<c1338ca7>] phy_connect_direct+0x17/0x60
[ 61.306415] [ 61.306415] [<c1338d23>] phy_connect+0x33/0x70
[ 61.306415] [ 61.306415] [<d09357a0>] r6040_init_one+0x3a0/0x500 [r6040]
[ 61.306415] [ 61.306415] [<c12a78c7>] pci_device_probe+0x77/0xd0
[ 61.306415] [ 61.306415] [<c12f5e15>] driver_probe_device+0x145/0x280
[ 61.306415] [ 61.306415] [<c12f5fd9>] __driver_attach+0x89/0x90
[ 61.306415] [ 61.306415] [<c12f43ef>] bus_for_each_dev+0x4f/0x80
[ 61.306415] [ 61.306415] [<c12f5954>] driver_attach+0x14/0x20
[ 61.306415] [ 61.306415] [<c12f55b7>] bus_add_driver+0x197/0x210
[ 61.306415] [ 61.306415] [<c12f6a21>] driver_register+0x51/0xd0
[ 61.306415] [ 61.306415] [<c12a6955>] __pci_register_driver+0x45/0x50
[ 61.306415] [ 61.306415] [<d0938017>] 0xd0938017
[ 61.306415] [ 61.306415] [<c100043f>] do_one_initcall+0x2f/0x140
[ 61.306415] [ 61.306415] [<c10e48c0>] do_init_module+0x4a/0x19b
[ 61.306415] [ 61.306415] [<c10a680e>] load_module+0x1b2e/0x2070
[ 61.306415] [ 61.306415] [<c10a6eb9>] SyS_finit_module+0x69/0x80
[ 61.306415] [ 61.306415] [<c100179f>] do_int80_syscall_32+0x3f/0x110
[ 61.306415] [ 61.306415] [<c14bba3f>] restore_all+0x0/0x61
[ 61.306415] INITIAL USE at:
[ 61.306415] [ 61.306415] [<c107586e>] __lock_acquire+0x1fe/0x1770
[ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
[ 61.306415] [ 61.306415] [<c14b7add>] mutex_lock_nested+0x2d/0x4a0
[ 61.306415] [ 61.306415] [<c133747d>] phy_probe+0x4d/0xc0
[ 61.306415] [ 61.306415] [<c1338afe>] phy_attach_direct+0xbe/0x190
[ 61.306415] [ 61.306415] [<c1338ca7>] phy_connect_direct+0x17/0x60
[ 61.306415] [ 61.306415] [<c1338d23>] phy_connect+0x33/0x70
[ 61.306415] [ 61.306415] [<d09357a0>] r6040_init_one+0x3a0/0x500 [r6040]
[ 61.306415] [ 61.306415] [<c12a78c7>] pci_device_probe+0x77/0xd0
[ 61.306415] [ 61.306415] [<c12f5e15>] driver_probe_device+0x145/0x280
[ 61.306415] [ 61.306415] [<c12f5fd9>] __driver_attach+0x89/0x90
[ 61.306415] [ 61.306415] [<c12f43ef>] bus_for_each_dev+0x4f/0x80
[ 61.306415] [ 61.306415] [<c12f5954>] driver_attach+0x14/0x20
[ 61.306415] [ 61.306415] [<c12f55b7>] bus_add_driver+0x197/0x210
[ 61.306415] [ 61.306415] [<c12f6a21>] driver_register+0x51/0xd0
[ 61.306415] [ 61.306415] [<c12a6955>] __pci_register_driver+0x45/0x50
[ 61.306415] [ 61.306415] [<d0938017>] 0xd0938017
[ 61.306415] [ 61.306415] [<c100043f>] do_one_initcall+0x2f/0x140
[ 61.306415] [ 61.306415] [<c10e48c0>] do_init_module+0x4a/0x19b
[ 61.306415] [ 61.306415] [<c10a680e>] load_module+0x1b2e/0x2070
[ 61.306415] [ 61.306415] [<c10a6eb9>] SyS_finit_module+0x69/0x80
[ 61.306415] [ 61.306415] [<c100179f>] do_int80_syscall_32+0x3f/0x110
[ 61.306415] [ 61.306415] [<c14bba3f>] restore_all+0x0/0x61
[ 61.306415] }
[ 61.306415] ... key at: [<c1f28f39>] __key.43998+0x0/0x8
[ 61.306415] ... acquired at:
[ 61.306415] [ 61.306415] [<c1074a32>] check_irq_usage+0x42/0xb0
[ 61.306415] [ 61.306415] [<c107677c>] __lock_acquire+0x110c/0x1770
[ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
[ 61.306415] [ 61.306415] [<c14b7add>] mutex_lock_nested+0x2d/0x4a0
[ 61.306415] [ 61.306415] [<c1336276>] phy_stop+0x16/0x80
[ 61.306415] [ 61.306415] [<d0934ce9>] r6040_close+0x89/0x230 [r6040]
[ 61.306415] [ 61.306415] [<c13a0a91>] __dev_close_many+0x61/0xa0
[ 61.306415] [ 61.306415] [<c13a0bbf>] __dev_close+0x1f/0x30
[ 61.306415] [ 61.306415] [<c13a9127>] __dev_change_flags+0x87/0x150
[ 61.306415] [ 61.306415] [<c13a9213>] dev_change_flags+0x23/0x60
[ 61.306415] [ 61.306415] [<c1416238>] devinet_ioctl+0x5f8/0x6f0
[ 61.306415] [ 61.306415] [<c1417f75>] inet_ioctl+0x65/0x90
[ 61.306415] [ 61.306415] [<c1389b54>] sock_ioctl+0x124/0x2b0
[ 61.306415] [ 61.306415] [<c113cf7c>] do_vfs_ioctl+0x7c/0x790
[ 61.306415] [ 61.306415] [<c113d6b8>] SyS_ioctl+0x28/0x50
[ 61.306415] [ 61.306415] [<c100179f>] do_int80_syscall_32+0x3f/0x110
[ 61.306415] [ 61.306415] [<c14bba3f>] restore_all+0x0/0x61
[ 61.306415]
[ 61.306415]
[ 61.306415] stack backtrace:
[ 61.306415] CPU: 0 PID: 449 Comm: ifconfig Not tainted 4.9.0-gb898d2d-manuel #1
[ 61.306415] Call Trace:
[ 61.306415] dump_stack+0x16/0x19
[ 61.306415] check_usage+0x3f6/0x550
[ 61.306415] ? check_usage+0x4d/0x550
[ 61.306415] check_irq_usage+0x42/0xb0
[ 61.306415] __lock_acquire+0x110c/0x1770
[ 61.306415] lock_acquire+0x7c/0x150
[ 61.306415] ? phy_stop+0x16/0x80
[ 61.306415] mutex_lock_nested+0x2d/0x4a0
[ 61.306415] ? phy_stop+0x16/0x80
[ 61.306415] ? r6040_close+0x24/0x230 [r6040]
[ 61.306415] ? __delay+0x9/0x10
[ 61.306415] phy_stop+0x16/0x80
[ 61.306415] r6040_close+0x89/0x230 [r6040]
[ 61.306415] __dev_close_many+0x61/0xa0
[ 61.306415] __dev_close+0x1f/0x30
[ 61.306415] __dev_change_flags+0x87/0x150
[ 61.306415] dev_change_flags+0x23/0x60
[ 61.306415] devinet_ioctl+0x5f8/0x6f0
[ 61.306415] inet_ioctl+0x65/0x90
[ 61.306415] sock_ioctl+0x124/0x2b0
[ 61.306415] ? dlci_ioctl_set+0x30/0x30
[ 61.306415] do_vfs_ioctl+0x7c/0x790
[ 61.306415] ? trace_hardirqs_on+0xb/0x10
[ 61.306415] ? call_rcu_sched+0xd/0x10
[ 61.306415] ? __put_cred+0x32/0x50
[ 61.306415] ? SyS_faccessat+0x178/0x1e0
[ 61.306415] SyS_ioctl+0x28/0x50
[ 61.306415] do_int80_syscall_32+0x3f/0x110
[ 61.306415] entry_INT80_32+0x2f/0x2f
[ 61.306415] EIP: 0xb764d364
[ 61.306415] EFLAGS: 00000286 CPU: 0
[ 61.306415] EAX: ffffffda EBX: 00000004 ECX: 00008914 EDX: bfa99d7c
[ 61.306415] ESI: bfa99e4c EDI: fffffffe EBP: 00000004 ESP: bfa99d58
[ 61.306415] DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 007b
[ 63.836607] r6040 0000:00:08.0 eth0: Link is Down
Signed-off-by: Manuel Bessler <manuel.bessler@sensus.com>
---
drivers/net/ethernet/rdc/r6040.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/rdc/r6040.c b/drivers/net/ethernet/rdc/r6040.c
index 4ff4e04..aa11b70 100644
--- a/drivers/net/ethernet/rdc/r6040.c
+++ b/drivers/net/ethernet/rdc/r6040.c
@@ -472,8 +472,6 @@ static void r6040_down(struct net_device *dev)
iowrite16(adrp[0], ioaddr + MID_0L);
iowrite16(adrp[1], ioaddr + MID_0M);
iowrite16(adrp[2], ioaddr + MID_0H);
-
- phy_stop(dev->phydev);
}
static int r6040_close(struct net_device *dev)
@@ -481,12 +479,12 @@ static int r6040_close(struct net_device *dev)
struct r6040_private *lp = netdev_priv(dev);
struct pci_dev *pdev = lp->pdev;
- spin_lock_irq(&lp->lock);
+ phy_stop(dev->phydev);
napi_disable(&lp->napi);
netif_stop_queue(dev);
- r6040_down(dev);
- free_irq(dev->irq, dev);
+ spin_lock_irq(&lp->lock);
+ r6040_down(dev);
/* Free RX buffer */
r6040_free_rxbufs(dev);
@@ -496,6 +494,8 @@ static int r6040_close(struct net_device *dev)
spin_unlock_irq(&lp->lock);
+ free_irq(dev->irq, dev);
+
/* Free Descriptor memory */
if (lp->rx_ring) {
pci_free_consistent(pdev,
--
2.7.4
^ permalink raw reply related
* Re: [RFC v2 00/10] HFI Virtual Network Interface Controller (VNIC)
From: Doug Ledford @ 2016-12-15 18:19 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: ira.weiny, Leon Romanovsky, Jeff Kirsher, David S. Miller,
Vishwanathapura, Niranjana, linux-rdma, netdev,
dennis.dalessandro
In-Reply-To: <20161215170713.GD3264@obsidianresearch.com>
[-- Attachment #1.1: Type: text/plain, Size: 1181 bytes --]
On 12/15/2016 12:07 PM, Jason Gunthorpe wrote:
> On Thu, Dec 15, 2016 at 11:28:06AM -0500, Doug Ledford wrote:
>
>> 1) Since your intent is to make this work with multiple versions of the
>> hfi drivers, I disagree with Jason that just because there is only one
>> driver today that we should keep it simple. Design it right from the
>> beginning of multi driver is your intent is, IMO, a better way to go.
>> You'll work out the bugs in the initial implementation and when it comes
>> time to add the second driver, things will go much more smoothly.
>
> If that is your position then this should be a straight up IB ULP that
> works with any IB hardware.
Yes, see my comments in point #3 of my previous email...
> There is nothing HFI specific about it except for the
> micro-optimization of pushing packets via SDMA instead of post_send,
> and that same micro optimization probably applies to ipoib.
>
> In other words, lets see the first version as a straight ULP with no
> special HFI hooks, then we can discuss how best to micro optimize it
> for HFI SDMA.
>
> Jason
>
--
Doug Ledford <dledford@redhat.com>
GPG Key ID: 0E572FDD
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
^ permalink raw reply
* [PATCH net] r6040: move spinlock in r6040_close as SOFTIRQ-unsafe lock order detected
From: Manuel Bessler @ 2016-12-15 17:46 UTC (permalink / raw)
To: netdev; +Cc: Manuel Bessler
'ifconfig eth0 down' makes r6040_close() trigger:
INFO: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected
Fixed by moving calls to phy_stop(), napi_disable(), netif_stop_queue()
to outside of the module's private spin_lock_irq block.
Found on a Versalogic Tomcat SBC with a Vortex86 SoC
s1660e_5150:~# sudo ifconfig eth0 down
[ 61.306415] ======================================================
[ 61.306415] [ INFO: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected ]
[ 61.306415] 4.9.0-gb898d2d-manuel #1 Not tainted
[ 61.306415] ------------------------------------------------------
[ 61.306415] ifconfig/449 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
[ 61.306415] (&dev->lock){+.+...}, at: [<c1336276>] phy_stop+0x16/0x80
[ 61.306415] and this task is already holding:
[ 61.306415] (&(&lp->lock)->rlock){+.-...}, at: [<d0934c84>] r6040_close+0x24/0x230 [r6040]
which would create a new lock dependency:
[ 61.306415] (&(&lp->lock)->rlock){+.-...} -> (&dev->lock){+.+...}
[ 61.306415] but this new dependency connects a SOFTIRQ-irq-safe lock:
[ 61.306415] (&(&lp->lock)->rlock){+.-...}
[ 61.306415] ... which became SOFTIRQ-irq-safe at:
[ 61.306415] [ 61.306415] [<c1075bc5>] __lock_acquire+0x555/0x1770
[ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
[ 61.306415] [ 61.306415] [<c14bb334>] _raw_spin_lock_irqsave+0x24/0x40
[ 61.306415] [ 61.306415] [<d0934ac0>] r6040_start_xmit+0x30/0x1d0 [r6040]
[ 61.306415] [ 61.306415] [<c13a7d4d>] dev_hard_start_xmit+0x9d/0x2d0
[ 61.306415] [ 61.306415] [<c13c8a38>] sch_direct_xmit+0xa8/0x140
[ 61.306415] [ 61.306415] [<c13a8436>] __dev_queue_xmit+0x416/0x780
[ 61.306415] [ 61.306415] [<c13a87aa>] dev_queue_xmit+0xa/0x10
[ 61.306415] [ 61.306415] [<c13b4837>] neigh_resolve_output+0x147/0x220
[ 61.306415] [ 61.306415] [<c144541b>] ip6_finish_output2+0x2fb/0x910
[ 61.306415] [ 61.306415] [<c14494e6>] ip6_finish_output+0xa6/0x1a0
[ 61.306415] [ 61.306415] [<c1449635>] ip6_output+0x55/0x320
[ 61.306415] [ 61.306415] [<c146f4d2>] mld_sendpack+0x352/0x560
[ 61.306415] [ 61.306415] [<c146fe55>] mld_ifc_timer_expire+0x155/0x280
[ 61.306415] [ 61.306415] [<c108b081>] call_timer_fn+0x81/0x270
[ 61.306415] [ 61.306415] [<c108b331>] expire_timers+0xc1/0x180
[ 61.306415] [ 61.306415] [<c108b4f7>] run_timer_softirq+0x77/0x150
[ 61.306415] [ 61.306415] [<c1043d04>] __do_softirq+0xb4/0x3d0
[ 61.306415] [ 61.306415] [<c101a15c>] do_softirq_own_stack+0x1c/0x30
[ 61.306415] [ 61.306415] [<c104416e>] irq_exit+0x8e/0xa0
[ 61.306415] [ 61.306415] [<c1019d31>] do_IRQ+0x51/0x100
[ 61.306415] [ 61.306415] [<c14bc176>] common_interrupt+0x36/0x40
[ 61.306415] [ 61.306415] [<c1134928>] set_root+0x68/0xf0
[ 61.306415] [ 61.306415] [<c1136120>] path_init+0x400/0x640
[ 61.306415] [ 61.306415] [<c11386bf>] path_lookupat+0xf/0xe0
[ 61.306415] [ 61.306415] [<c1139ebc>] filename_lookup+0x6c/0x100
[ 61.306415] [ 61.306415] [<c1139fd5>] user_path_at_empty+0x25/0x30
[ 61.306415] [ 61.306415] [<c11298c6>] SyS_faccessat+0x86/0x1e0
[ 61.306415] [ 61.306415] [<c1129a30>] SyS_access+0x10/0x20
[ 61.306415] [ 61.306415] [<c100179f>] do_int80_syscall_32+0x3f/0x110
[ 61.306415] [ 61.306415] [<c14bba3f>] restore_all+0x0/0x61
[ 61.306415]
[ 61.306415] to a SOFTIRQ-irq-unsafe lock:
[ 61.306415] (&dev->lock){+.+...}
[ 61.306415] ... which became SOFTIRQ-irq-unsafe at:
[ 61.306415] ...[ 61.306415]
[ 61.306415] [<c1075c0c>] __lock_acquire+0x59c/0x1770
[ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
[ 61.306415] [ 61.306415] [<c14b7add>] mutex_lock_nested+0x2d/0x4a0
[ 61.306415] [ 61.306415] [<c133747d>] phy_probe+0x4d/0xc0
[ 61.306415] [ 61.306415] [<c1338afe>] phy_attach_direct+0xbe/0x190
[ 61.306415] [ 61.306415] [<c1338ca7>] phy_connect_direct+0x17/0x60
[ 61.306415] [ 61.306415] [<c1338d23>] phy_connect+0x33/0x70
[ 61.306415] [ 61.306415] [<d09357a0>] r6040_init_one+0x3a0/0x500 [r6040]
[ 61.306415] [ 61.306415] [<c12a78c7>] pci_device_probe+0x77/0xd0
[ 61.306415] [ 61.306415] [<c12f5e15>] driver_probe_device+0x145/0x280
[ 61.306415] [ 61.306415] [<c12f5fd9>] __driver_attach+0x89/0x90
[ 61.306415] [ 61.306415] [<c12f43ef>] bus_for_each_dev+0x4f/0x80
[ 61.306415] [ 61.306415] [<c12f5954>] driver_attach+0x14/0x20
[ 61.306415] [ 61.306415] [<c12f55b7>] bus_add_driver+0x197/0x210
[ 61.306415] [ 61.306415] [<c12f6a21>] driver_register+0x51/0xd0
[ 61.306415] [ 61.306415] [<c12a6955>] __pci_register_driver+0x45/0x50
[ 61.306415] [ 61.306415] [<d0938017>] 0xd0938017
[ 61.306415] [ 61.306415] [<c100043f>] do_one_initcall+0x2f/0x140
[ 61.306415] [ 61.306415] [<c10e48c0>] do_init_module+0x4a/0x19b
[ 61.306415] [ 61.306415] [<c10a680e>] load_module+0x1b2e/0x2070
[ 61.306415] [ 61.306415] [<c10a6eb9>] SyS_finit_module+0x69/0x80
[ 61.306415] [ 61.306415] [<c100179f>] do_int80_syscall_32+0x3f/0x110
[ 61.306415] [ 61.306415] [<c14bba3f>] restore_all+0x0/0x61
[ 61.306415]
[ 61.306415] other info that might help us debug this:
[ 61.306415]
[ 61.306415] Possible interrupt unsafe locking scenario:
[ 61.306415]
[ 61.306415] CPU0 CPU1
[ 61.306415] ---- ----
[ 61.306415] lock(&dev->lock);
[ 61.306415] local_irq_disable();
[ 61.306415] lock(&(&lp->lock)->rlock);
[ 61.306415] lock(&dev->lock);
[ 61.306415] <Interrupt>
[ 61.306415] lock(&(&lp->lock)->rlock);
[ 61.306415]
[ 61.306415] *** DEADLOCK ***
[ 61.306415]
[ 61.306415] 2 locks held by ifconfig/449:
[ 61.306415] #0: (rtnl_mutex){+.+.+.}, at: [<c13b68ef>] rtnl_lock+0xf/0x20
[ 61.306415] #1: (&(&lp->lock)->rlock){+.-...}, at: [<d0934c84>] r6040_close+0x24/0x230 [r6040]
[ 61.306415]
[ 61.306415] the dependencies between SOFTIRQ-irq-safe lock and the holding lock:
[ 61.306415] -> (&(&lp->lock)->rlock){+.-...} ops: 3049 {
[ 61.306415] HARDIRQ-ON-W at:
[ 61.306415] [ 61.306415] [<c1075be7>] __lock_acquire+0x577/0x1770
[ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
[ 61.306415] [ 61.306415] [<c14bb21b>] _raw_spin_lock+0x1b/0x30
[ 61.306415] [ 61.306415] [<d09343cc>] r6040_poll+0x2c/0x330 [r6040]
[ 61.306415] [ 61.306415] [<c13a5577>] net_rx_action+0x197/0x340
[ 61.306415] [ 61.306415] [<c1043d04>] __do_softirq+0xb4/0x3d0
[ 61.306415] [ 61.306415] [<c1044037>] run_ksoftirqd+0x17/0x40
[ 61.306415] [ 61.306415] [<c105fe91>] smpboot_thread_fn+0x141/0x180
[ 61.306415] [ 61.306415] [<c105c84e>] kthread+0xde/0x110
[ 61.306415] [ 61.306415] [<c14bb949>] ret_from_fork+0x19/0x30
[ 61.306415] IN-SOFTIRQ-W at:
[ 61.306415] [ 61.306415] [<c1075bc5>] __lock_acquire+0x555/0x1770
[ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
[ 61.306415] [ 61.306415] [<c14bb334>] _raw_spin_lock_irqsave+0x24/0x40
[ 61.306415] [ 61.306415] [<d0934ac0>] r6040_start_xmit+0x30/0x1d0 [r6040]
[ 61.306415] [ 61.306415] [<c13a7d4d>] dev_hard_start_xmit+0x9d/0x2d0
[ 61.306415] [ 61.306415] [<c13c8a38>] sch_direct_xmit+0xa8/0x140
[ 61.306415] [ 61.306415] [<c13a8436>] __dev_queue_xmit+0x416/0x780
[ 61.306415] [ 61.306415] [<c13a87aa>] dev_queue_xmit+0xa/0x10
[ 61.306415] [ 61.306415] [<c13b4837>] neigh_resolve_output+0x147/0x220
[ 61.306415] [ 61.306415] [<c144541b>] ip6_finish_output2+0x2fb/0x910
[ 61.306415] [ 61.306415] [<c14494e6>] ip6_finish_output+0xa6/0x1a0
[ 61.306415] [ 61.306415] [<c1449635>] ip6_output+0x55/0x320
[ 61.306415] [ 61.306415] [<c146f4d2>] mld_sendpack+0x352/0x560
[ 61.306415] [ 61.306415] [<c146fe55>] mld_ifc_timer_expire+0x155/0x280
[ 61.306415] [ 61.306415] [<c108b081>] call_timer_fn+0x81/0x270
[ 61.306415] [ 61.306415] [<c108b331>] expire_timers+0xc1/0x180
[ 61.306415] [ 61.306415] [<c108b4f7>] run_timer_softirq+0x77/0x150
[ 61.306415] [ 61.306415] [<c1043d04>] __do_softirq+0xb4/0x3d0
[ 61.306415] [ 61.306415] [<c101a15c>] do_softirq_own_stack+0x1c/0x30
[ 61.306415] [ 61.306415] [<c104416e>] irq_exit+0x8e/0xa0
[ 61.306415] [ 61.306415] [<c1019d31>] do_IRQ+0x51/0x100
[ 61.306415] [ 61.306415] [<c14bc176>] common_interrupt+0x36/0x40
[ 61.306415] [ 61.306415] [<c1134928>] set_root+0x68/0xf0
[ 61.306415] [ 61.306415] [<c1136120>] path_init+0x400/0x640
[ 61.306415] [ 61.306415] [<c11386bf>] path_lookupat+0xf/0xe0
[ 61.306415] [ 61.306415] [<c1139ebc>] filename_lookup+0x6c/0x100
[ 61.306415] [ 61.306415] [<c1139fd5>] user_path_at_empty+0x25/0x30
[ 61.306415] [ 61.306415] [<c11298c6>] SyS_faccessat+0x86/0x1e0
[ 61.306415] [ 61.306415] [<c1129a30>] SyS_access+0x10/0x20
[ 61.306415] [ 61.306415] [<c100179f>] do_int80_syscall_32+0x3f/0x110
[ 61.306415] [ 61.306415] [<c14bba3f>] restore_all+0x0/0x61
[ 61.306415] INITIAL USE at:
[ 61.306415] [ 61.306415] [<c107586e>] __lock_acquire+0x1fe/0x1770
[ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
[ 61.306415] [ 61.306415] [<c14bb334>] _raw_spin_lock_irqsave+0x24/0x40
[ 61.306415] [ 61.306415] [<d093474e>] r6040_get_stats+0x1e/0x60 [r6040]
[ 61.306415] [ 61.306415] [<c139fb16>] dev_get_stats+0x96/0xc0
[ 61.306415] [ 61.306415] [<c14b416e>] rtnl_fill_stats+0x36/0xfd
[ 61.306415] [ 61.306415] [<c13b7b3c>] rtnl_fill_ifinfo+0x47c/0xce0
[ 61.306415] [ 61.306415] [<c13bc08e>] rtmsg_ifinfo_build_skb+0x4e/0xd0
[ 61.306415] [ 61.306415] [<c13bc120>] rtmsg_ifinfo.part.20+0x10/0x40
[ 61.306415] [ 61.306415] [<c13bc16b>] rtmsg_ifinfo+0x1b/0x20
[ 61.306415] [ 61.306415] [<c13a9d19>] register_netdevice+0x409/0x550
[ 61.306415] [ 61.306415] [<c13a9e72>] register_netdev+0x12/0x20
[ 61.306415] [ 61.306415] [<d09357e8>] r6040_init_one+0x3e8/0x500 [r6040]
[ 61.306415] [ 61.306415] [<c12a78c7>] pci_device_probe+0x77/0xd0
[ 61.306415] [ 61.306415] [<c12f5e15>] driver_probe_device+0x145/0x280
[ 61.306415] [ 61.306415] [<c12f5fd9>] __driver_attach+0x89/0x90
[ 61.306415] [ 61.306415] [<c12f43ef>] bus_for_each_dev+0x4f/0x80
[ 61.306415] [ 61.306415] [<c12f5954>] driver_attach+0x14/0x20
[ 61.306415] [ 61.306415] [<c12f55b7>] bus_add_driver+0x197/0x210
[ 61.306415] [ 61.306415] [<c12f6a21>] driver_register+0x51/0xd0
[ 61.306415] [ 61.306415] [<c12a6955>] __pci_register_driver+0x45/0x50
[ 61.306415] [ 61.306415] [<d0938017>] 0xd0938017
[ 61.306415] [ 61.306415] [<c100043f>] do_one_initcall+0x2f/0x140
[ 61.306415] [ 61.306415] [<c10e48c0>] do_init_module+0x4a/0x19b
[ 61.306415] [ 61.306415] [<c10a680e>] load_module+0x1b2e/0x2070
[ 61.306415] [ 61.306415] [<c10a6eb9>] SyS_finit_module+0x69/0x80
[ 61.306415] [ 61.306415] [<c100179f>] do_int80_syscall_32+0x3f/0x110
[ 61.306415] [ 61.306415] [<c14bba3f>] restore_all+0x0/0x61
[ 61.306415] }
[ 61.306415] ... key at: [<d0936280>] __key.45893+0x0/0xfffff739 [r6040]
[ 61.306415] ... acquired at:
[ 61.306415] [ 61.306415] [<c1074a32>] check_irq_usage+0x42/0xb0
[ 61.306415] [ 61.306415] [<c107677c>] __lock_acquire+0x110c/0x1770
[ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
[ 61.306415] [ 61.306415] [<c14b7add>] mutex_lock_nested+0x2d/0x4a0
[ 61.306415] [ 61.306415] [<c1336276>] phy_stop+0x16/0x80
[ 61.306415] [ 61.306415] [<d0934ce9>] r6040_close+0x89/0x230 [r6040]
[ 61.306415] [ 61.306415] [<c13a0a91>] __dev_close_many+0x61/0xa0
[ 61.306415] [ 61.306415] [<c13a0bbf>] __dev_close+0x1f/0x30
[ 61.306415] [ 61.306415] [<c13a9127>] __dev_change_flags+0x87/0x150
[ 61.306415] [ 61.306415] [<c13a9213>] dev_change_flags+0x23/0x60
[ 61.306415] [ 61.306415] [<c1416238>] devinet_ioctl+0x5f8/0x6f0
[ 61.306415] [ 61.306415] [<c1417f75>] inet_ioctl+0x65/0x90
[ 61.306415] [ 61.306415] [<c1389b54>] sock_ioctl+0x124/0x2b0
[ 61.306415] [ 61.306415] [<c113cf7c>] do_vfs_ioctl+0x7c/0x790
[ 61.306415] [ 61.306415] [<c113d6b8>] SyS_ioctl+0x28/0x50
[ 61.306415] [ 61.306415] [<c100179f>] do_int80_syscall_32+0x3f/0x110
[ 61.306415] [ 61.306415] [<c14bba3f>] restore_all+0x0/0x61
[ 61.306415]
[ 61.306415]
the dependencies between the lock to be acquired[ 61.306415] and SOFTIRQ-irq-unsafe lock:
[ 61.306415] -> (&dev->lock){+.+...} ops: 56 {
[ 61.306415] HARDIRQ-ON-W at:
[ 61.306415] [ 61.306415] [<c1075be7>] __lock_acquire+0x577/0x1770
[ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
[ 61.306415] [ 61.306415] [<c14b7add>] mutex_lock_nested+0x2d/0x4a0
[ 61.306415] [ 61.306415] [<c133747d>] phy_probe+0x4d/0xc0
[ 61.306415] [ 61.306415] [<c1338afe>] phy_attach_direct+0xbe/0x190
[ 61.306415] [ 61.306415] [<c1338ca7>] phy_connect_direct+0x17/0x60
[ 61.306415] [ 61.306415] [<c1338d23>] phy_connect+0x33/0x70
[ 61.306415] [ 61.306415] [<d09357a0>] r6040_init_one+0x3a0/0x500 [r6040]
[ 61.306415] [ 61.306415] [<c12a78c7>] pci_device_probe+0x77/0xd0
[ 61.306415] [ 61.306415] [<c12f5e15>] driver_probe_device+0x145/0x280
[ 61.306415] [ 61.306415] [<c12f5fd9>] __driver_attach+0x89/0x90
[ 61.306415] [ 61.306415] [<c12f43ef>] bus_for_each_dev+0x4f/0x80
[ 61.306415] [ 61.306415] [<c12f5954>] driver_attach+0x14/0x20
[ 61.306415] [ 61.306415] [<c12f55b7>] bus_add_driver+0x197/0x210
[ 61.306415] [ 61.306415] [<c12f6a21>] driver_register+0x51/0xd0
[ 61.306415] [ 61.306415] [<c12a6955>] __pci_register_driver+0x45/0x50
[ 61.306415] [ 61.306415] [<d0938017>] 0xd0938017
[ 61.306415] [ 61.306415] [<c100043f>] do_one_initcall+0x2f/0x140
[ 61.306415] [ 61.306415] [<c10e48c0>] do_init_module+0x4a/0x19b
[ 61.306415] [ 61.306415] [<c10a680e>] load_module+0x1b2e/0x2070
[ 61.306415] [ 61.306415] [<c10a6eb9>] SyS_finit_module+0x69/0x80
[ 61.306415] [ 61.306415] [<c100179f>] do_int80_syscall_32+0x3f/0x110
[ 61.306415] [ 61.306415] [<c14bba3f>] restore_all+0x0/0x61
[ 61.306415] SOFTIRQ-ON-W at:
[ 61.306415] [ 61.306415] [<c1075c0c>] __lock_acquire+0x59c/0x1770
[ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
[ 61.306415] [ 61.306415] [<c14b7add>] mutex_lock_nested+0x2d/0x4a0
[ 61.306415] [ 61.306415] [<c133747d>] phy_probe+0x4d/0xc0
[ 61.306415] [ 61.306415] [<c1338afe>] phy_attach_direct+0xbe/0x190
[ 61.306415] [ 61.306415] [<c1338ca7>] phy_connect_direct+0x17/0x60
[ 61.306415] [ 61.306415] [<c1338d23>] phy_connect+0x33/0x70
[ 61.306415] [ 61.306415] [<d09357a0>] r6040_init_one+0x3a0/0x500 [r6040]
[ 61.306415] [ 61.306415] [<c12a78c7>] pci_device_probe+0x77/0xd0
[ 61.306415] [ 61.306415] [<c12f5e15>] driver_probe_device+0x145/0x280
[ 61.306415] [ 61.306415] [<c12f5fd9>] __driver_attach+0x89/0x90
[ 61.306415] [ 61.306415] [<c12f43ef>] bus_for_each_dev+0x4f/0x80
[ 61.306415] [ 61.306415] [<c12f5954>] driver_attach+0x14/0x20
[ 61.306415] [ 61.306415] [<c12f55b7>] bus_add_driver+0x197/0x210
[ 61.306415] [ 61.306415] [<c12f6a21>] driver_register+0x51/0xd0
[ 61.306415] [ 61.306415] [<c12a6955>] __pci_register_driver+0x45/0x50
[ 61.306415] [ 61.306415] [<d0938017>] 0xd0938017
[ 61.306415] [ 61.306415] [<c100043f>] do_one_initcall+0x2f/0x140
[ 61.306415] [ 61.306415] [<c10e48c0>] do_init_module+0x4a/0x19b
[ 61.306415] [ 61.306415] [<c10a680e>] load_module+0x1b2e/0x2070
[ 61.306415] [ 61.306415] [<c10a6eb9>] SyS_finit_module+0x69/0x80
[ 61.306415] [ 61.306415] [<c100179f>] do_int80_syscall_32+0x3f/0x110
[ 61.306415] [ 61.306415] [<c14bba3f>] restore_all+0x0/0x61
[ 61.306415] INITIAL USE at:
[ 61.306415] [ 61.306415] [<c107586e>] __lock_acquire+0x1fe/0x1770
[ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
[ 61.306415] [ 61.306415] [<c14b7add>] mutex_lock_nested+0x2d/0x4a0
[ 61.306415] [ 61.306415] [<c133747d>] phy_probe+0x4d/0xc0
[ 61.306415] [ 61.306415] [<c1338afe>] phy_attach_direct+0xbe/0x190
[ 61.306415] [ 61.306415] [<c1338ca7>] phy_connect_direct+0x17/0x60
[ 61.306415] [ 61.306415] [<c1338d23>] phy_connect+0x33/0x70
[ 61.306415] [ 61.306415] [<d09357a0>] r6040_init_one+0x3a0/0x500 [r6040]
[ 61.306415] [ 61.306415] [<c12a78c7>] pci_device_probe+0x77/0xd0
[ 61.306415] [ 61.306415] [<c12f5e15>] driver_probe_device+0x145/0x280
[ 61.306415] [ 61.306415] [<c12f5fd9>] __driver_attach+0x89/0x90
[ 61.306415] [ 61.306415] [<c12f43ef>] bus_for_each_dev+0x4f/0x80
[ 61.306415] [ 61.306415] [<c12f5954>] driver_attach+0x14/0x20
[ 61.306415] [ 61.306415] [<c12f55b7>] bus_add_driver+0x197/0x210
[ 61.306415] [ 61.306415] [<c12f6a21>] driver_register+0x51/0xd0
[ 61.306415] [ 61.306415] [<c12a6955>] __pci_register_driver+0x45/0x50
[ 61.306415] [ 61.306415] [<d0938017>] 0xd0938017
[ 61.306415] [ 61.306415] [<c100043f>] do_one_initcall+0x2f/0x140
[ 61.306415] [ 61.306415] [<c10e48c0>] do_init_module+0x4a/0x19b
[ 61.306415] [ 61.306415] [<c10a680e>] load_module+0x1b2e/0x2070
[ 61.306415] [ 61.306415] [<c10a6eb9>] SyS_finit_module+0x69/0x80
[ 61.306415] [ 61.306415] [<c100179f>] do_int80_syscall_32+0x3f/0x110
[ 61.306415] [ 61.306415] [<c14bba3f>] restore_all+0x0/0x61
[ 61.306415] }
[ 61.306415] ... key at: [<c1f28f39>] __key.43998+0x0/0x8
[ 61.306415] ... acquired at:
[ 61.306415] [ 61.306415] [<c1074a32>] check_irq_usage+0x42/0xb0
[ 61.306415] [ 61.306415] [<c107677c>] __lock_acquire+0x110c/0x1770
[ 61.306415] [ 61.306415] [<c107717c>] lock_acquire+0x7c/0x150
[ 61.306415] [ 61.306415] [<c14b7add>] mutex_lock_nested+0x2d/0x4a0
[ 61.306415] [ 61.306415] [<c1336276>] phy_stop+0x16/0x80
[ 61.306415] [ 61.306415] [<d0934ce9>] r6040_close+0x89/0x230 [r6040]
[ 61.306415] [ 61.306415] [<c13a0a91>] __dev_close_many+0x61/0xa0
[ 61.306415] [ 61.306415] [<c13a0bbf>] __dev_close+0x1f/0x30
[ 61.306415] [ 61.306415] [<c13a9127>] __dev_change_flags+0x87/0x150
[ 61.306415] [ 61.306415] [<c13a9213>] dev_change_flags+0x23/0x60
[ 61.306415] [ 61.306415] [<c1416238>] devinet_ioctl+0x5f8/0x6f0
[ 61.306415] [ 61.306415] [<c1417f75>] inet_ioctl+0x65/0x90
[ 61.306415] [ 61.306415] [<c1389b54>] sock_ioctl+0x124/0x2b0
[ 61.306415] [ 61.306415] [<c113cf7c>] do_vfs_ioctl+0x7c/0x790
[ 61.306415] [ 61.306415] [<c113d6b8>] SyS_ioctl+0x28/0x50
[ 61.306415] [ 61.306415] [<c100179f>] do_int80_syscall_32+0x3f/0x110
[ 61.306415] [ 61.306415] [<c14bba3f>] restore_all+0x0/0x61
[ 61.306415]
[ 61.306415]
[ 61.306415] stack backtrace:
[ 61.306415] CPU: 0 PID: 449 Comm: ifconfig Not tainted 4.9.0-gb898d2d-manuel #1
[ 61.306415] Call Trace:
[ 61.306415] dump_stack+0x16/0x19
[ 61.306415] check_usage+0x3f6/0x550
[ 61.306415] ? check_usage+0x4d/0x550
[ 61.306415] check_irq_usage+0x42/0xb0
[ 61.306415] __lock_acquire+0x110c/0x1770
[ 61.306415] lock_acquire+0x7c/0x150
[ 61.306415] ? phy_stop+0x16/0x80
[ 61.306415] mutex_lock_nested+0x2d/0x4a0
[ 61.306415] ? phy_stop+0x16/0x80
[ 61.306415] ? r6040_close+0x24/0x230 [r6040]
[ 61.306415] ? __delay+0x9/0x10
[ 61.306415] phy_stop+0x16/0x80
[ 61.306415] r6040_close+0x89/0x230 [r6040]
[ 61.306415] __dev_close_many+0x61/0xa0
[ 61.306415] __dev_close+0x1f/0x30
[ 61.306415] __dev_change_flags+0x87/0x150
[ 61.306415] dev_change_flags+0x23/0x60
[ 61.306415] devinet_ioctl+0x5f8/0x6f0
[ 61.306415] inet_ioctl+0x65/0x90
[ 61.306415] sock_ioctl+0x124/0x2b0
[ 61.306415] ? dlci_ioctl_set+0x30/0x30
[ 61.306415] do_vfs_ioctl+0x7c/0x790
[ 61.306415] ? trace_hardirqs_on+0xb/0x10
[ 61.306415] ? call_rcu_sched+0xd/0x10
[ 61.306415] ? __put_cred+0x32/0x50
[ 61.306415] ? SyS_faccessat+0x178/0x1e0
[ 61.306415] SyS_ioctl+0x28/0x50
[ 61.306415] do_int80_syscall_32+0x3f/0x110
[ 61.306415] entry_INT80_32+0x2f/0x2f
[ 61.306415] EIP: 0xb764d364
[ 61.306415] EFLAGS: 00000286 CPU: 0
[ 61.306415] EAX: ffffffda EBX: 00000004 ECX: 00008914 EDX: bfa99d7c
[ 61.306415] ESI: bfa99e4c EDI: fffffffe EBP: 00000004 ESP: bfa99d58
[ 61.306415] DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 007b
[ 63.836607] r6040 0000:00:08.0 eth0: Link is Down
Signed-off-by: Manuel Bessler <manuel.bessler@sensus.com>
---
drivers/net/ethernet/rdc/r6040.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/rdc/r6040.c b/drivers/net/ethernet/rdc/r6040.c
index 9a37247..1b4a653 100644
--- a/drivers/net/ethernet/rdc/r6040.c
+++ b/drivers/net/ethernet/rdc/r6040.c
@@ -473,8 +473,6 @@ static void r6040_down(struct net_device *dev)
iowrite16(adrp[0], ioaddr + MID_0L);
iowrite16(adrp[1], ioaddr + MID_0M);
iowrite16(adrp[2], ioaddr + MID_0H);
-
- phy_stop(lp->phydev);
}
static int r6040_close(struct net_device *dev)
@@ -482,12 +480,12 @@ static int r6040_close(struct net_device *dev)
struct r6040_private *lp = netdev_priv(dev);
struct pci_dev *pdev = lp->pdev;
- spin_lock_irq(&lp->lock);
+ phy_stop(lp->phydev);
napi_disable(&lp->napi);
netif_stop_queue(dev);
- r6040_down(dev);
- free_irq(dev->irq, dev);
+ spin_lock_irq(&lp->lock);
+ r6040_down(dev);
/* Free RX buffer */
r6040_free_rxbufs(dev);
@@ -497,6 +495,8 @@ static int r6040_close(struct net_device *dev)
spin_unlock_irq(&lp->lock);
+ free_irq(dev->irq, dev);
+
/* Free Descriptor memory */
if (lp->rx_ring) {
pci_free_consistent(pdev,
--
2.7.4
^ permalink raw reply related
* Re: [PATCH net-next 1/3] net:dsa:mv88e6xxx: use hashtable to store multicast entries
From: Vivien Didelot @ 2016-12-15 17:50 UTC (permalink / raw)
To: Florian Fainelli, Volodymyr Bendiuga, Andrew Lunn
Cc: Volodymyr Bendiuga, netdev, Volodymyr Bendiuga, John Crispin
In-Reply-To: <be3b69b7-b6a3-a939-cf77-c62e5a1fe719@gmail.com>
Florian Fainelli <f.fainelli@gmail.com> writes:
>> In all cases *if caching is really needed*, I think it won't hurt to do
>> it in DSA core even if a switch support FDB dump operations on a
>> per-port basis, as Andrew mentioned.
>
> Agreed, and there does not appear to be any need to new dsa_switch_ops
> operations to be introduced?
Nope.
^ permalink raw reply
* Re: [PATCH net-next 1/3] net:dsa:mv88e6xxx: use hashtable to store multicast entries
From: John Crispin @ 2016-12-15 17:47 UTC (permalink / raw)
To: Vivien Didelot, Volodymyr Bendiuga, Andrew Lunn
Cc: Volodymyr Bendiuga, Florian Fainelli, netdev, Volodymyr Bendiuga
In-Reply-To: <87eg19hzw1.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me>
On 15/12/2016 18:21, Vivien Didelot wrote:
> Hi Volodymyr,
>
> Volodymyr Bendiuga <volodymyr.bendiuga@gmail.com> writes:
>
>> Hi Andrew,
>>
>> I have tested the approach you wrote in previous mails, the one
>> with setting next.mac to address we are looking for -1. It seems
>> to be as slow as the original implementation, unfortunately.
>
> Hum, that is what I was expecting... The ATU GetNext operation
> (alongside an ether_addr_equal() call) should be quite fast.
>
>> We use 6097 and 6352 chips, and both of them can not do any port
>> filtering in hardware for fdb dump operation. Seems like they would
>> benefit from cache. But I am not sure about other switches.
>>
>> Does anyone know about such feature in other switches?
>
> Marvell switches cannot filter ATU entries for a specific port, they
> contain a port vector.
>
> I guess Florian might answer for Broadcom switches, and John might
> answer for Qualcomm switches.
>
> In all cases *if caching is really needed*, I think it won't hurt to do
> it in DSA core even if a switch support FDB dump operations on a
> per-port basis, as Andrew mentioned.
QCA switches allow defining a port mask in a fdb search/iterate
operation. just had a look in the brcm driver and it filters in software
John
^ permalink raw reply
* Re: [RFC v2 02/10] IB/hfi-vnic: Virtual Network Interface Controller (VNIC) interface
From: Stephen Hemminger @ 2016-12-15 17:36 UTC (permalink / raw)
To: Vishwanathapura, Niranjana
Cc: dledford, linux-rdma, netdev, dennis.dalessandro, ira.weiny
In-Reply-To: <20161215085349.GA90068@knc-06.sc.intel.com>
On Thu, 15 Dec 2016 00:53:49 -0800
"Vishwanathapura, Niranjana" <niranjana.vishwanathapura@intel.com> wrote:
> On Wed, Dec 14, 2016 at 11:59:34PM -0800, Vishwanathapura, Niranjana wrote:
> >+
> >+static inline bool is_hfi_ibdev(struct ib_device *ibdev)
> >+{
> >+ return !memcmp(ibdev->name, "hfi", 3);
> >+}
>
> I am thinking of adding a device capability flag to indicate HFI VNIC capabilty
> instead of relying on the device name as above to identify a hfi ib deice.
> Any comments? Probably it can be addressed by a separate patch later.
>
> Niranjana
>
> >
Agreed. device name can change at anytime.
^ permalink raw reply
* Re: [PATCH iproute2 v2 1/3] ifstat: Add extended statistics to ifstat
From: Stephen Hemminger @ 2016-12-15 17:33 UTC (permalink / raw)
To: Nogah Frankel; +Cc: netdev, roopa, jiri, eladr, yotamg, idosch, ogerlitz
In-Reply-To: <1481806845-63384-2-git-send-email-nogahf@mellanox.com>
On Thu, 15 Dec 2016 15:00:43 +0200
Nogah Frankel <nogahf@mellanox.com> wrote:
> Extended stats are part of the RTM_GETSTATS method. This patch adds them
> to ifstat.
> While extended stats can come in many forms, we support only the
> rtnl_link_stats64 struct for them (which is the 64 bits version of struct
> rtnl_link_stats).
> We support stats in the main nesting level, or one lower.
> The extension can be called by its name or any shorten of it. If there is
> more than one matched, the first one will be picked.
>
> To get the extended stats the flag -x <stats type> is used.
>
> Signed-off-by: Nogah Frankel <nogahf@mellanox.com>
> Reviewed-by: Jiri Pirko <jiri@mellanox.com>
> ---
> misc/ifstat.c | 161 ++++++++++++++++++++++++++++++++++++++++++++++++++++------
> 1 file changed, 146 insertions(+), 15 deletions(-)
>
> diff --git a/misc/ifstat.c b/misc/ifstat.c
> index 92d67b0..d17ae21 100644
> --- a/misc/ifstat.c
> +++ b/misc/ifstat.c
> @@ -35,6 +35,7 @@
>
> #include <SNAPSHOT.h>
>
> +#include "utils.h"
> int dump_zeros;
> int reset_history;
> int ignore_history;
Minor nit, please cleanup include order here (original code was wrong).
Standard practice is:
#include system headers (like stdio.h etc)
#include "xxx.h" local headers.
Should be:
#include <getopt.h>
#include <linux/if.h>
#include <linux/if_link.h>
#include "json_writer.h"
#include "libnetlink.h"
#include "utils.h"
#include "SNAPSHOT.h"
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox