* [PATCH RESEND net-next 0/2] net_rwsem fixes
From: Kirill Tkhai @ 2018-03-30 16:38 UTC (permalink / raw)
To: davem, zhangshengju, ktkhai, jakub.kicinski, dsahern, mschiffer,
daniel, netdev
(Forgot to CC netdev@ :)
Hi,
there is wext_netdev_notifier_call()->wireless_nlevent_flush()
netdevice notifier, which takes net_rwsem, so we can't take
net_rwsem in {,un}register_netdevice_notifier().
Since {,un}register_netdevice_notifier() is executed under
pernet_ops_rwsem, net_namespace_list can't change, while we
holding it, so there is no need net_rwsem in these functions [1/2].
The same is in [2/2]. We make callers of __rtnl_link_unregister()
take pernet_ops_rwsem, and close the race with setup_net()
and cleanup_net(), so __rtnl_link_unregister() does not need it.
This also fixes the problem of that __rtnl_link_unregister() does
not see initializing and exiting nets.
Thanks,
Kirill
---
Kirill Tkhai (2):
net: Remove net_rwsem from {,un}register_netdevice_notifier()
net: Do not take net_rwsem in __rtnl_link_unregister()
drivers/net/dummy.c | 2 ++
drivers/net/ifb.c | 2 ++
net/core/dev.c | 5 -----
net/core/net_namespace.c | 1 +
net/core/rtnetlink.c | 6 +++---
5 files changed, 8 insertions(+), 8 deletions(-)
^ permalink raw reply
* [PATCH RESEND net-next 1/2] net: Remove net_rwsem from {, un}register_netdevice_notifier()
From: Kirill Tkhai @ 2018-03-30 16:38 UTC (permalink / raw)
To: davem, zhangshengju, ktkhai, jakub.kicinski, dsahern, mschiffer,
daniel, netdev
In-Reply-To: <152242784495.18864.4373352355749698367.stgit@localhost.localdomain>
These functions take net_rwsem, while wireless_nlevent_flush()
also takes it. But down_read() can't be taken recursive,
because of rw_semaphore design, which prevents it to be occupied
by only readers forever.
Since we take pernet_ops_rwsem in {,un}register_netdevice_notifier(),
net list can't change, so these down_read()/up_read() can be removed.
Fixes: f0b07bb151b0 "net: Introduce net_rwsem to protect net_namespace_list"
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
net/core/dev.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 07da7add4845..8edb58829124 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1633,7 +1633,6 @@ int register_netdevice_notifier(struct notifier_block *nb)
goto unlock;
if (dev_boot_phase)
goto unlock;
- down_read(&net_rwsem);
for_each_net(net) {
for_each_netdev(net, dev) {
err = call_netdevice_notifier(nb, NETDEV_REGISTER, dev);
@@ -1647,7 +1646,6 @@ int register_netdevice_notifier(struct notifier_block *nb)
call_netdevice_notifier(nb, NETDEV_UP, dev);
}
}
- up_read(&net_rwsem);
unlock:
rtnl_unlock();
@@ -1671,7 +1669,6 @@ int register_netdevice_notifier(struct notifier_block *nb)
}
outroll:
- up_read(&net_rwsem);
raw_notifier_chain_unregister(&netdev_chain, nb);
goto unlock;
}
@@ -1704,7 +1701,6 @@ int unregister_netdevice_notifier(struct notifier_block *nb)
if (err)
goto unlock;
- down_read(&net_rwsem);
for_each_net(net) {
for_each_netdev(net, dev) {
if (dev->flags & IFF_UP) {
@@ -1715,7 +1711,6 @@ int unregister_netdevice_notifier(struct notifier_block *nb)
call_netdevice_notifier(nb, NETDEV_UNREGISTER, dev);
}
}
- up_read(&net_rwsem);
unlock:
rtnl_unlock();
up_write(&pernet_ops_rwsem);
^ permalink raw reply related
* [PATCH RESEND net-next 2/2] net: Do not take net_rwsem in __rtnl_link_unregister()
From: Kirill Tkhai @ 2018-03-30 16:38 UTC (permalink / raw)
To: davem, zhangshengju, ktkhai, jakub.kicinski, dsahern, mschiffer,
daniel, netdev
In-Reply-To: <152242784495.18864.4373352355749698367.stgit@localhost.localdomain>
This function calls call_netdevice_notifier(), which also
may take net_rwsem. So, we can't use net_rwsem here.
This patch makes callers of this functions take pernet_ops_rwsem,
like register_netdevice_notifier() does. This will protect
the modifications of net_namespace_list, and allows notifiers
to take it (they won't have to care about context).
Since __rtnl_link_unregister() is used on module load
and unload (which are not frequent operations), this looks
for me better, than make all call_netdevice_notifier()
always executing in "protected net_namespace_list" context.
Also, this fixes the problem we had a deal in 328fbe747ad4
"Close race between {un, }register_netdevice_notifier and ...",
and guarantees __rtnl_link_unregister() does not skip
exitting net.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
drivers/net/dummy.c | 2 ++
drivers/net/ifb.c | 2 ++
net/core/net_namespace.c | 1 +
net/core/rtnetlink.c | 6 +++---
4 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
index 30b1c8512049..0d15a12a4560 100644
--- a/drivers/net/dummy.c
+++ b/drivers/net/dummy.c
@@ -219,6 +219,7 @@ static int __init dummy_init_module(void)
{
int i, err = 0;
+ down_write(&pernet_ops_rwsem);
rtnl_lock();
err = __rtnl_link_register(&dummy_link_ops);
if (err < 0)
@@ -233,6 +234,7 @@ static int __init dummy_init_module(void)
out:
rtnl_unlock();
+ up_write(&pernet_ops_rwsem);
return err;
}
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c
index 0008da7e9d4c..5f2897ec0edc 100644
--- a/drivers/net/ifb.c
+++ b/drivers/net/ifb.c
@@ -330,6 +330,7 @@ static int __init ifb_init_module(void)
{
int i, err;
+ down_write(&pernet_ops_rwsem);
rtnl_lock();
err = __rtnl_link_register(&ifb_link_ops);
if (err < 0)
@@ -344,6 +345,7 @@ static int __init ifb_init_module(void)
out:
rtnl_unlock();
+ up_write(&pernet_ops_rwsem);
return err;
}
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 7fdf321d4997..a11e03f920d3 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -51,6 +51,7 @@ static bool init_net_initialized;
* outside.
*/
DECLARE_RWSEM(pernet_ops_rwsem);
+EXPORT_SYMBOL_GPL(pernet_ops_rwsem);
#define MIN_PERNET_OPS_ID \
((sizeof(struct net_generic) + sizeof(void *) - 1) / sizeof(void *))
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index e86b28482ca7..45936922d7e2 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -412,17 +412,17 @@ static void __rtnl_kill_links(struct net *net, struct rtnl_link_ops *ops)
* __rtnl_link_unregister - Unregister rtnl_link_ops from rtnetlink.
* @ops: struct rtnl_link_ops * to unregister
*
- * The caller must hold the rtnl_mutex.
+ * The caller must hold the rtnl_mutex and guarantee net_namespace_list
+ * integrity (hold pernet_ops_rwsem for writing to close the race
+ * with setup_net() and cleanup_net()).
*/
void __rtnl_link_unregister(struct rtnl_link_ops *ops)
{
struct net *net;
- down_read(&net_rwsem);
for_each_net(net) {
__rtnl_kill_links(net, ops);
}
- up_read(&net_rwsem);
list_del(&ops->list);
}
EXPORT_SYMBOL_GPL(__rtnl_link_unregister);
^ permalink raw reply related
* Re: [patch iproute2-next] man: fix devlink object list
From: David Ahern @ 2018-03-30 16:43 UTC (permalink / raw)
To: Jiri Pirko, netdev; +Cc: stephen, mlxsw, valex
In-Reply-To: <20180329142616.2717-1-jiri@resnulli.us>
On 3/29/18 8:26 AM, Jiri Pirko wrote:
> From: Jiri Pirko <jiri@mellanox.com>
>
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
> ---
> man/man8/devlink.8 | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
resource and sb exist on master, so this patch seems more appropriate
for it than -next.
^ permalink raw reply
* Re: INFO: task hung in stop_sync_thread (2)
From: syzbot @ 2018-03-30 16:46 UTC (permalink / raw)
To: coreteam, davem, fw, horms, ja, kadlec, linux-kernel, lvs-devel,
netdev, netfilter-devel, pablo, syzkaller-bugs, wensong
In-Reply-To: <000000000000878b6a05688805c5@google.com>
syzbot has found reproducer for the following crash on net-next commit
18845557fd6fc1998f2d0d8c30467f86db587529 (Thu Mar 29 20:24:06 2018 +0000)
Merge tag 'wireless-drivers-next-for-davem-2018-03-29' of
git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next
syzbot dashboard link:
https://syzkaller.appspot.com/bug?extid=5fe074c01b2032ce9618
So far this crash happened 2 times on net-next.
C reproducer: https://syzkaller.appspot.com/x/repro.c?id=5531070485233664
syzkaller reproducer:
https://syzkaller.appspot.com/x/repro.syz?id=5632385408303104
Raw console output:
https://syzkaller.appspot.com/x/log.txt?id=6520566391504896
Kernel config: https://syzkaller.appspot.com/x/.config?id=-37309782588693906
compiler: gcc (GCC) 7.1.1 20170620
IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+5fe074c01b2032ce9618@syzkaller.appspotmail.com
It will help syzbot understand when the bug is fixed.
INFO: task syzkaller923914:4319 blocked for more than 120 seconds.
Not tainted 4.16.0-rc6+ #286
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
syzkaller923914 D23312 4319 4316 0x00000000
Call Trace:
context_switch kernel/sched/core.c:2862 [inline]
__schedule+0x8fb/0x1ec0 kernel/sched/core.c:3440
schedule+0xf5/0x430 kernel/sched/core.c:3499
schedule_timeout+0x1a3/0x230 kernel/time/timer.c:1777
do_wait_for_common kernel/sched/completion.c:86 [inline]
__wait_for_common kernel/sched/completion.c:107 [inline]
wait_for_common kernel/sched/completion.c:118 [inline]
wait_for_completion+0x415/0x770 kernel/sched/completion.c:139
kthread_stop+0x14a/0x7a0 kernel/kthread.c:530
stop_sync_thread+0x3d9/0x740 net/netfilter/ipvs/ip_vs_sync.c:1996
do_ip_vs_set_ctl+0x2b1/0x1cc0 net/netfilter/ipvs/ip_vs_ctl.c:2394
nf_sockopt net/netfilter/nf_sockopt.c:106 [inline]
nf_setsockopt+0x67/0xc0 net/netfilter/nf_sockopt.c:115
ip_setsockopt+0x97/0xa0 net/ipv4/ip_sockglue.c:1253
udp_setsockopt+0x45/0x80 net/ipv4/udp.c:2400
sock_common_setsockopt+0x95/0xd0 net/core/sock.c:3039
SYSC_setsockopt net/socket.c:1850 [inline]
SyS_setsockopt+0x189/0x360 net/socket.c:1829
do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x4459d9
RSP: 002b:00007f1d6f47cdb8 EFLAGS: 00000297 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 00000000006dac24 RCX: 00000000004459d9
RDX: 000000000000048c RSI: 0000000000000000 RDI: 0000000000000008
RBP: 00000000006dac20 R08: 0000000000000018 R09: 0000000000000000
R10: 0000000020000000 R11: 0000000000000297 R12: 0000000000000000
R13: 00007fffcf128acf R14: 00007f1d6f47d9c0 R15: 0000000000000001
INFO: lockdep is turned off.
NMI backtrace for cpu 1
CPU: 1 PID: 869 Comm: khungtaskd Not tainted 4.16.0-rc6+ #286
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x194/0x24d lib/dump_stack.c:53
nmi_cpu_backtrace+0x1d2/0x210 lib/nmi_backtrace.c:103
nmi_trigger_cpumask_backtrace+0x123/0x180 lib/nmi_backtrace.c:62
arch_trigger_cpumask_backtrace+0x14/0x20 arch/x86/kernel/apic/hw_nmi.c:38
trigger_all_cpu_backtrace include/linux/nmi.h:138 [inline]
check_hung_task kernel/hung_task.c:132 [inline]
check_hung_uninterruptible_tasks kernel/hung_task.c:190 [inline]
watchdog+0x90c/0xd60 kernel/hung_task.c:249
kthread+0x33c/0x400 kernel/kthread.c:238
ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:406
Sending NMI from CPU 1 to CPUs 0:
NMI backtrace for cpu 0
CPU: 0 PID: 4317 Comm: syzkaller923914 Not tainted 4.16.0-rc6+ #286
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
RIP: 0010:__sanitizer_cov_trace_pc+0x0/0x50
RSP: 0018:ffff8801b56df138 EFLAGS: 00000093
RAX: ffff8801cbaae640 RBX: 0000000000000000 RCX: ffffffff866a3971
RDX: 0000000000000000 RSI: 0000000000000040 RDI: ffff8801db218038
RBP: ffff8801b56df168 R08: ffff88021fff801c R09: ffff88021fff8008
R10: ffff88021fff8010 R11: ffff88021fff801d R12: ffff8801db218038
R13: 0000000000000040 R14: ffff8801db218038 R15: 00000000ffffffff
FS: 0000000001968880(0000) GS:ffff8801db200000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600400 CR3: 00000001c94dc001 CR4: 00000000001606f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
cpumask_next+0x24/0x30 lib/cpumask.c:21
select_idle_smt kernel/sched/fair.c:6116 [inline]
select_idle_sibling+0x86d/0xda0 kernel/sched/fair.c:6238
select_task_rq_fair+0xe0a/0x2910 kernel/sched/fair.c:6394
select_task_rq kernel/sched/core.c:1554 [inline]
try_to_wake_up+0x4ee/0x15f0 kernel/sched/core.c:2064
default_wake_function+0x30/0x50 kernel/sched/core.c:3693
autoremove_wake_function+0x78/0x350 kernel/sched/wait.c:377
__wake_up_common+0x18e/0x780 kernel/sched/wait.c:97
__wake_up_common_lock+0x1b4/0x310 kernel/sched/wait.c:125
__wake_up_sync_key+0x19/0x20 kernel/sched/wait.c:203
pipe_write+0x63b/0xd60 fs/pipe.c:477
call_write_iter include/linux/fs.h:1782 [inline]
new_sync_write fs/read_write.c:469 [inline]
__vfs_write+0x684/0x970 fs/read_write.c:482
vfs_write+0x189/0x510 fs/read_write.c:544
SYSC_write fs/read_write.c:589 [inline]
SyS_write+0xef/0x220 fs/read_write.c:581
do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x4459d9
RSP: 002b:00007fffcf128b48 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00000000006dada0 RCX: 00000000004459d9
RDX: 0000000000000012 RSI: 00000000004adf28 RDI: 0000000000000001
RBP: 0000000000000010 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006dad8c
R13: 00000000006dada0 R14: 0000000000000005 R15: 0000000000000001
Code: ff 4c 89 e7 e8 62 b2 38 00 e9 32 fd ff ff 48 8b bd d0 fe ff ff e8 f1
b2 38 00 e9 c3 fc ff ff 90 90 90 90 90 90 90 90 90 90 90 90 <55> 65 48 8b
04 25 c0 ed 01 00 48 89 e5 65 8b 15 8c 20 90 7e 81
^ permalink raw reply
* Re: [PATCH net 0/2] Fix vlan tag handling for vlan packets without ethernet headers
From: David Miller @ 2018-03-30 16:49 UTC (permalink / raw)
To: makita.toshiaki; +Cc: netdev, eric.dumazet
In-Reply-To: <1522317930-2951-1-git-send-email-makita.toshiaki@lab.ntt.co.jp>
From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Date: Thu, 29 Mar 2018 19:05:28 +0900
> Eric Dumazet reported syzbot found a new bug which leads to underflow of
> size argument of memmove(), causing crash[1]. This can be triggered by tun
> devices.
>
> The underflow happened because skb_vlan_untag() did not expect vlan packets
> without ethernet headers, and tun can produce such packets.
> I also checked vlan_insert_inner_tag() and found a similar bug.
>
> This series fixes these problems.
>
> [1] https://marc.info/?l=linux-netdev&m=152221753920510&w=2
Series applied, thank you.
^ permalink raw reply
* Re: INFO: task hung in stop_sync_thread (2)
From: Dmitry Vyukov @ 2018-03-30 16:54 UTC (permalink / raw)
To: syzbot
Cc: coreteam, David Miller, Florian Westphal, horms, Julian Anastasov,
Jozsef Kadlecsik, LKML, lvs-devel, netdev, netfilter-devel,
Pablo Neira Ayuso, syzkaller-bugs, wensong
In-Reply-To: <94eb2c05b2d8af3dfa0568a3f964@google.com>
On Fri, Mar 30, 2018 at 6:46 PM, syzbot
<syzbot+5fe074c01b2032ce9618@syzkaller.appspotmail.com> wrote:
> syzbot has found reproducer for the following crash on net-next commit
/\/\/\/\/\/\
now syzbot can test fixes
> 18845557fd6fc1998f2d0d8c30467f86db587529 (Thu Mar 29 20:24:06 2018 +0000)
> Merge tag 'wireless-drivers-next-for-davem-2018-03-29' of
> git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next
> syzbot dashboard link:
> https://syzkaller.appspot.com/bug?extid=5fe074c01b2032ce9618
>
> So far this crash happened 2 times on net-next.
> C reproducer: https://syzkaller.appspot.com/x/repro.c?id=5531070485233664
> syzkaller reproducer:
> https://syzkaller.appspot.com/x/repro.syz?id=5632385408303104
> Raw console output:
> https://syzkaller.appspot.com/x/log.txt?id=6520566391504896
> Kernel config: https://syzkaller.appspot.com/x/.config?id=-37309782588693906
> compiler: gcc (GCC) 7.1.1 20170620
>
> IMPORTANT: if you fix the bug, please add the following tag to the commit:
> Reported-by: syzbot+5fe074c01b2032ce9618@syzkaller.appspotmail.com
> It will help syzbot understand when the bug is fixed.
^ permalink raw reply
* Re: [PATCH] PCI: allow drivers to limit the number of VFs to 0
From: Alexander Duyck @ 2018-03-30 16:54 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jakub Kicinski, Bjorn Helgaas, linux-pci, Netdev, Sathya Perla,
Felix Manlunas, John Fastabend, Jacob Keller, Donald Dutile,
oss-drivers
In-Reply-To: <20180330114905.GA10246@infradead.org>
On Fri, Mar 30, 2018 at 4:49 AM, Christoph Hellwig <hch@infradead.org> wrote:
> On Thu, Mar 29, 2018 at 11:22:31AM -0700, Jakub Kicinski wrote:
>> Some user space depends on driver allowing sriov_totalvfs to be
>> enabled.
>
> I can't make sene of this sentence. Can you explain what user space
> code depends on what semantics? The sriov_totalvfs file should show
> up for any device supporting SR-IOV as far as I can tell.
>
>>
>> For devices which VF support depends on loaded FW we
>> have the pci_sriov_{g,s}et_totalvfs() API. However, this API
>> uses 0 as a special "unset" value, meaning drivers can't limit
>> sriov_totalvfs to 0. Change the special value to be U16_MAX.
>> Use simple min() to determine actual totalvfs.
>
> Please use a PCI_MAX_VFS or similar define instead of plain U16_MAX or ~0.
Actually is there any reason why driver_max_VFs couldn't just be
initialized to the same value as total_VFs?
Also looking over the patch I don't see how writing ~0 would be
accepted unless you also make changes to pci_sriov_set_totalvfs since
it should fail the "numvfs > dev->sriov->total_VFs" check. You might
just want to look at adding a new function that would reset the
driver_max_VFs value instead of trying to write it to an arbitrary
value from the driver.
- Alex
^ permalink raw reply
* Re: [PATCH net] net/dim: Fix int overflow
From: David Miller @ 2018-03-30 16:56 UTC (permalink / raw)
To: talgi; +Cc: netdev, tariqt, andrew.gospodarek, saeedm
In-Reply-To: <1522320832-18416-1-git-send-email-talgi@mellanox.com>
From: Tal Gilboa <talgi@mellanox.com>
Date: Thu, 29 Mar 2018 13:53:52 +0300
> When calculating difference between samples, the values
> are multiplied by 100. Large values may cause int overflow
> when multiplied (usually on first iteration).
> Fixed by forcing 100 to be of type unsigned long.
>
> Fixes: 4c4dbb4a7363 ("net/mlx5e: Move dynamic interrupt coalescing code to include/linux")
> Signed-off-by: Tal Gilboa <talgi@mellanox.com>
Applied, thank you.
^ permalink raw reply
* Re: [PATCH net-next 0/9] devlink: Add support for region access
From: David Ahern @ 2018-03-30 16:57 UTC (permalink / raw)
To: Andrew Lunn, Alex Vesker
Cc: David S. Miller, netdev, Tariq Toukan, Jiri Pirko
In-Reply-To: <20180330143403.GD28244@lunn.ch>
On 3/30/18 8:34 AM, Andrew Lunn wrote:
>>> And it seems to want contiguous pages. How well does that work after
>>> the system has been running for a while and memory is fragmented?
>>
>> The allocation can be changed, there is no read need for contiguous pages.
>> It is important to note that we the amount of snapshots is limited by the
>> driver
>> this can be based on the dump size or expected frequency of collection.
>> I also prefer not to pre-allocate this memory.
>
> The driver code also asks for a 1MB contiguous chunk of memory! You
> really should think about this API, how can you avoid double memory
> allocations. And can kvmalloc be used. But then you get into the
> problem for DMA'ing the memory from the device...
>
> This API also does not scale. 1MB is actually quite small. I'm sure
> there is firmware running on CPUs with a lot more than 1MB of RAM.
> How well does with API work with 64MB? Say i wanted to snapshot my
> GPU? Or the MC/BMC?
>
That and the drivers control the number of snapshots. The user should be
able to control the number of snapshots, and an option to remove all
snapshots to free up that memory.
^ permalink raw reply
* Re: [PATCH net-next] MAINTAINERS: Update my email address from freescale to nxp
From: David Miller @ 2018-03-30 16:58 UTC (permalink / raw)
To: claudiu.manoil; +Cc: netdev, linux-kernel
In-Reply-To: <1522321128-18132-1-git-send-email-claudiu.manoil@nxp.com>
From: Claudiu Manoil <claudiu.manoil@nxp.com>
Date: Thu, 29 Mar 2018 13:58:48 +0300
> The freescale.com address will no longer be available.
>
> Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next 1/1] tc-testing: add connmark action tests
From: David Miller @ 2018-03-30 16:58 UTC (permalink / raw)
To: mrv; +Cc: netdev, kernel, jhs, xiyou.wangcong, jiri
In-Reply-To: <1522327957-5756-1-git-send-email-mrv@mojatatu.com>
From: Roman Mashak <mrv@mojatatu.com>
Date: Thu, 29 Mar 2018 08:52:37 -0400
> Signed-off-by: Roman Mashak <mrv@mojatatu.com>
Applied, thank you.
^ permalink raw reply
* Re: [PATCH] connector: add parent pid and tgid to coredump and exit events
From: David Miller @ 2018-03-30 16:59 UTC (permalink / raw)
To: sstrogin
Cc: zbr, netdev, linux-kernel, xe-linux-external, jderehag,
matt.helsley, minipli
In-Reply-To: <20180329141247.20943-1-sstrogin@cisco.com>
From: Stefan Strogin <sstrogin@cisco.com>
Date: Thu, 29 Mar 2018 17:12:47 +0300
> diff --git a/include/uapi/linux/cn_proc.h b/include/uapi/linux/cn_proc.h
> index 68ff25414700..db210625cee8 100644
> --- a/include/uapi/linux/cn_proc.h
> +++ b/include/uapi/linux/cn_proc.h
> @@ -116,12 +116,16 @@ struct proc_event {
> struct coredump_proc_event {
> __kernel_pid_t process_pid;
> __kernel_pid_t process_tgid;
> + __kernel_pid_t parent_pid;
> + __kernel_pid_t parent_tgid;
> } coredump;
>
> struct exit_proc_event {
> __kernel_pid_t process_pid;
> __kernel_pid_t process_tgid;
> __u32 exit_code, exit_signal;
> + __kernel_pid_t parent_pid;
> + __kernel_pid_t parent_tgid;
> } exit;
>
> } event_data;
I don't think you can add these members without breaking UAPI.
^ permalink raw reply
* Re: pull-request: ieee802154-next 2018-03-29
From: David Miller @ 2018-03-30 17:01 UTC (permalink / raw)
To: stefan; +Cc: linux-wpan, alex.aring, netdev
In-Reply-To: <20180329155138.14417-1-stefan@osg.samsung.com>
From: Stefan Schmidt <stefan@osg.samsung.com>
Date: Thu, 29 Mar 2018 17:51:38 +0200
> An update from ieee802154 for *net-next*
>
> Colin fixed a unused variable in the new mcr20a driver.
> Harry fixed an unitialised data read in the debugfs interface of the
> ca8210 driver.
>
> If there are any issues or you think these are to late for -rc1 (both can also
> go into -rc2 as they are simple fixes) let me know.
Pulled into net-next, thanks Stefan.
^ permalink raw reply
* [PATCH net] ip6_gre: remove redundant 'tunnel' setting in ip6erspan_tap_init()
From: Alexey Kodanev @ 2018-03-30 17:34 UTC (permalink / raw)
To: netdev; +Cc: William Tu, David Miller, Alexey Kodanev
'tunnel' was already set at the start of ip6erspan_tap_init().
Fixes: 5a963eb61b7c ("ip6_gre: Add ERSPAN native tunnel support")
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
net/ipv6/ip6_gre.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index 1bbd093..09901be 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -1757,7 +1757,6 @@ static int ip6erspan_tap_init(struct net_device *dev)
dev->mtu -= 8;
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
- tunnel = netdev_priv(dev);
ip6gre_tnl_link_config(tunnel, 1);
return 0;
--
1.8.3.1
^ permalink raw reply related
* [PATCH net v4 1/3] ipv6: add a wrapper for ip6_dst_store() with flowi6 checks
From: Alexey Kodanev @ 2018-03-30 17:53 UTC (permalink / raw)
To: netdev; +Cc: Eric Dumazet, Martin KaFai Lau, David Miller, Alexey Kodanev
In-Reply-To: <1522432389-15850-1-git-send-email-alexey.kodanev@oracle.com>
Move commonly used pattern of ip6_dst_store() usage to a separate
function - ip6_dst_store_flow(), which will check the addresses
for equality using the flow information, before saving them.
There is no functional changes in this patch. In addition, it will
be used in the next patch, in ip6_sk_dst_lookup_flow().
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
include/net/ipv6.h | 3 ++-
net/ipv6/datagram.c | 9 +--------
net/ipv6/ip6_output.c | 17 +++++++++++++++++
3 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 8606c91..1dd31ca 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -971,7 +971,8 @@ static inline struct sk_buff *ip6_finish_skb(struct sock *sk)
}
unsigned int ip6_dst_mtu_forward(const struct dst_entry *dst);
-
+void ip6_dst_store_flow(struct sock *sk, struct dst_entry *dst,
+ const struct flowi6 *fl6);
int ip6_dst_lookup(struct net *net, struct sock *sk, struct dst_entry **dst,
struct flowi6 *fl6);
struct dst_entry *ip6_dst_lookup_flow(const struct sock *sk, struct flowi6 *fl6,
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
index a9f7eca..8b4fa0c 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -106,14 +106,7 @@ int ip6_datagram_dst_update(struct sock *sk, bool fix_sk_saddr)
}
}
- ip6_dst_store(sk, dst,
- ipv6_addr_equal(&fl6.daddr, &sk->sk_v6_daddr) ?
- &sk->sk_v6_daddr : NULL,
-#ifdef CONFIG_IPV6_SUBTREES
- ipv6_addr_equal(&fl6.saddr, &np->saddr) ?
- &np->saddr :
-#endif
- NULL);
+ ip6_dst_store_flow(sk, dst, &fl6);
out:
fl6_sock_release(flowlabel);
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index a8a9195..ed87ce5 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -943,6 +943,23 @@ static struct dst_entry *ip6_sk_dst_check(struct sock *sk,
return dst;
}
+void ip6_dst_store_flow(struct sock *sk, struct dst_entry *dst,
+ const struct flowi6 *fl6)
+{
+#ifdef CONFIG_IPV6_SUBTREES
+ struct ipv6_pinfo *np = inet6_sk(sk);
+#endif
+
+ ip6_dst_store(sk, dst,
+ ipv6_addr_equal(&fl6->daddr, &sk->sk_v6_daddr) ?
+ &sk->sk_v6_daddr : NULL,
+#ifdef CONFIG_IPV6_SUBTREES
+ ipv6_addr_equal(&fl6->saddr, &np->saddr) ?
+ &np->saddr :
+#endif
+ NULL);
+}
+
static int ip6_dst_lookup_tail(struct net *net, const struct sock *sk,
struct dst_entry **dst, struct flowi6 *fl6)
{
--
1.8.3.1
^ permalink raw reply related
* [PATCH net v4 3/3] ipv6: udp6: set dst cache for a connected sk if current not valid
From: Alexey Kodanev @ 2018-03-30 17:53 UTC (permalink / raw)
To: netdev; +Cc: Eric Dumazet, Martin KaFai Lau, David Miller, Alexey Kodanev
In-Reply-To: <1522432389-15850-1-git-send-email-alexey.kodanev@oracle.com>
A new RTF_CACHE route can be created between ip6_sk_dst_lookup_flow()
and ip6_dst_store() calls in udpv6_sendmsg(), when datagram sending
results to ICMPV6_PKT_TOOBIG error:
udp_v6_send_skb(), for example with vti6 tunnel:
vti6_xmit(), get ICMPV6_PKT_TOOBIG error
skb_dst_update_pmtu(), can create a RTF_CACHE clone
icmpv6_send()
...
udpv6_err()
ip6_sk_update_pmtu()
ip6_update_pmtu(), can create a RTF_CACHE clone
...
ip6_datagram_dst_update()
ip6_dst_store()
And after commit 33c162a980fe ("ipv6: datagram: Update dst cache of
a connected datagram sk during pmtu update"), the UDPv6 error handler
can update socket's dst cache, but it can happen before the update in
the end of udpv6_sendmsg(), preventing getting the new dst cache on
the next udpv6_sendmsg() calls.
In order to fix it, save dst in a connected socket only if the current
socket's dst cache is invalid.
The previous patch prepared ip6_sk_dst_lookup_flow() to do that with
the new argument, and this patch enables it in udpv6_sendmsg().
Fixes: 33c162a980fe ("ipv6: datagram: Update dst cache of a connected datagram sk during pmtu update")
Fixes: 45e4fd26683c ("ipv6: Only create RTF_CACHE routes after encountering pmtu exception")
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
net/ipv6/udp.c | 21 ++-------------------
1 file changed, 2 insertions(+), 19 deletions(-)
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index e49dac4..da13c90 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -1289,7 +1289,7 @@ int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
fl6.flowlabel = ip6_make_flowinfo(ipc6.tclass, fl6.flowlabel);
- dst = ip6_sk_dst_lookup_flow(sk, &fl6, final_p, 0);
+ dst = ip6_sk_dst_lookup_flow(sk, &fl6, final_p, connected);
if (IS_ERR(dst)) {
err = PTR_ERR(dst);
dst = NULL;
@@ -1314,7 +1314,7 @@ int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
err = PTR_ERR(skb);
if (!IS_ERR_OR_NULL(skb))
err = udp_v6_send_skb(skb, &fl6);
- goto release_dst;
+ goto out;
}
lock_sock(sk);
@@ -1348,23 +1348,6 @@ int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
err = np->recverr ? net_xmit_errno(err) : 0;
release_sock(sk);
-release_dst:
- if (dst) {
- if (connected) {
- ip6_dst_store(sk, dst,
- ipv6_addr_equal(&fl6.daddr, &sk->sk_v6_daddr) ?
- &sk->sk_v6_daddr : NULL,
-#ifdef CONFIG_IPV6_SUBTREES
- ipv6_addr_equal(&fl6.saddr, &np->saddr) ?
- &np->saddr :
-#endif
- NULL);
- } else {
- dst_release(dst);
- }
- dst = NULL;
- }
-
out:
dst_release(dst);
fl6_sock_release(flowlabel);
--
1.8.3.1
^ permalink raw reply related
* [PATCH net v4 0/3] ipv6: udp6: set dst cache for a connected sk if current not valid
From: Alexey Kodanev @ 2018-03-30 17:53 UTC (permalink / raw)
To: netdev; +Cc: Eric Dumazet, Martin KaFai Lau, David Miller, Alexey Kodanev
A new RTF_CACHE route can be created with the socket's dst cache
update between the below calls in udpv6_sendmsg(), when datagram
sending results to ICMPV6_PKT_TOOBIG error:
dst = ip6_sk_dst_lookup_flow(...)
...
release_dst:
if (dst) {
if (connected) {
ip6_dst_store(sk, dst)
Therefore, the new socket's dst cache reset to the old one on
"release_dst:".
The first two patches prepare the code to store dst cache
with ip6_sk_dst_lookup_flow():
* the first patch adds ip6_dst_store_flow() function with
commonly used source and destiantion addresses checks using
the flow information.
* the second patch adds new argument to ip6_sk_dst_lookup_flow()
and ability to store dst in the socket's cache. Also, the two
users of the function are updated without enabling the new
behavior: pingv6_sendmsg() and udpv6_sendmsg().
The last patch contains the actual fix that removes sk dst cache
update in the end of udpv6_sendmsg(), and allows to do it in
ip6_sk_dst_lookup_flow().
v4: * fix the error in the build of ip_dst_store_flow() reported by
kbuild test robot due to missing checks for CONFIG_IPV6: add
new function to ip6_output.c instead of ip6_route.h
* add 'const' to struct flowi6 in ip6_dst_store_flow()
* minor commit messages fixes
v3: * instead of moving ip6_dst_store() above udp_v6_send_skb(),
update socket's dst cache inside ip6_sk_dst_lookup_flow()
if the current one is invalid
* the issue not reproduced in 4.1, but starting from 4.2. Add
one more 'Fixes:' commit that creates new RTF_CACHE route.
Though, it is also mentioned in the first one
Alexey Kodanev (3):
ipv6: add a wrapper for ip6_dst_store() with flowi6 checks
ipv6: allow to cache dst for a connected sk in ip6_sk_dst_lookup_flow()
ipv6: udp6: set dst cache for a connected sk if current not valid
include/net/ipv6.h | 6 ++++--
net/ipv6/datagram.c | 9 +--------
net/ipv6/ip6_output.c | 32 +++++++++++++++++++++++++++++---
net/ipv6/ping.c | 2 +-
net/ipv6/udp.c | 21 ++-------------------
5 files changed, 37 insertions(+), 33 deletions(-)
--
1.8.3.1
^ permalink raw reply
* [PATCH net v4 2/3] ipv6: allow to cache dst for a connected sk in ip6_sk_dst_lookup_flow()
From: Alexey Kodanev @ 2018-03-30 17:53 UTC (permalink / raw)
To: netdev; +Cc: Eric Dumazet, Martin KaFai Lau, David Miller, Alexey Kodanev
In-Reply-To: <1522432389-15850-1-git-send-email-alexey.kodanev@oracle.com>
Add 'connected' argument to ip6_sk_dst_lookup_flow() and update
the cache only if ip6_sk_dst_check() returns NULL and a socket
is connected.
The function is used as before, the new behavior for UDP sockets
in udpv6_sendmsg() will be enabled in the next patch.
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
include/net/ipv6.h | 3 ++-
net/ipv6/ip6_output.c | 15 ++++++++++++---
net/ipv6/ping.c | 2 +-
net/ipv6/udp.c | 2 +-
4 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 1dd31ca..769550a 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -978,7 +978,8 @@ int ip6_dst_lookup(struct net *net, struct sock *sk, struct dst_entry **dst,
struct dst_entry *ip6_dst_lookup_flow(const struct sock *sk, struct flowi6 *fl6,
const struct in6_addr *final_dst);
struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6,
- const struct in6_addr *final_dst);
+ const struct in6_addr *final_dst,
+ int connected);
struct dst_entry *ip6_blackhole_route(struct net *net,
struct dst_entry *orig_dst);
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index ed87ce5..cdcdf37 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1122,23 +1122,32 @@ struct dst_entry *ip6_dst_lookup_flow(const struct sock *sk, struct flowi6 *fl6,
* @sk: socket which provides the dst cache and route info
* @fl6: flow to lookup
* @final_dst: final destination address for ipsec lookup
+ * @connected: whether @sk is connected or not
*
* This function performs a route lookup on the given flow with the
* possibility of using the cached route in the socket if it is valid.
* It will take the socket dst lock when operating on the dst cache.
* As a result, this function can only be used in process context.
*
+ * In addition, for a connected socket, cache the dst in the socket
+ * if the current cache is not valid.
+ *
* It returns a valid dst pointer on success, or a pointer encoded
* error code.
*/
struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6,
- const struct in6_addr *final_dst)
+ const struct in6_addr *final_dst,
+ int connected)
{
struct dst_entry *dst = sk_dst_check(sk, inet6_sk(sk)->dst_cookie);
dst = ip6_sk_dst_check(sk, dst, fl6);
- if (!dst)
- dst = ip6_dst_lookup_flow(sk, fl6, final_dst);
+ if (dst)
+ return dst;
+
+ dst = ip6_dst_lookup_flow(sk, fl6, final_dst);
+ if (connected && !IS_ERR(dst))
+ ip6_dst_store_flow(sk, dst_clone(dst), fl6);
return dst;
}
diff --git a/net/ipv6/ping.c b/net/ipv6/ping.c
index d12c55d..546f4a6 100644
--- a/net/ipv6/ping.c
+++ b/net/ipv6/ping.c
@@ -121,7 +121,7 @@ static int ping_v6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
ipc6.tclass = np->tclass;
fl6.flowlabel = ip6_make_flowinfo(ipc6.tclass, fl6.flowlabel);
- dst = ip6_sk_dst_lookup_flow(sk, &fl6, daddr);
+ dst = ip6_sk_dst_lookup_flow(sk, &fl6, daddr, 0);
if (IS_ERR(dst))
return PTR_ERR(dst);
rt = (struct rt6_info *) dst;
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 52e3ea0..e49dac4 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -1289,7 +1289,7 @@ int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
fl6.flowlabel = ip6_make_flowinfo(ipc6.tclass, fl6.flowlabel);
- dst = ip6_sk_dst_lookup_flow(sk, &fl6, final_p);
+ dst = ip6_sk_dst_lookup_flow(sk, &fl6, final_p, 0);
if (IS_ERR(dst)) {
err = PTR_ERR(dst);
dst = NULL;
--
1.8.3.1
^ permalink raw reply related
* Re: [PATCH net-next 0/9] devlink: Add support for region access
From: David Miller @ 2018-03-30 18:07 UTC (permalink / raw)
To: valex; +Cc: andrew, netdev, tariqt, jiri
In-Reply-To: <28b99a08-1967-3044-4010-0faa5d6bfc14@mellanox.com>
From: Alex Vesker <valex@mellanox.com>
Date: Fri, 30 Mar 2018 08:28:39 +0300
> On 3/29/2018 10:51 PM, Andrew Lunn wrote:
>> Also, i doubt write support will be accepted. That sounds like the
>> start of an API to allow a user space driver.
>
> If this will be an issue we will stay with read access only.
Because of registers which are accessed indirectly, it's hard to avoid
supporting write support in some way.
This interface is not for providing a way to do userland drivers, it's
for diagnostics only. And indeed we did discuss this at netconf and
we had broad concensus on this matter at the time.
^ permalink raw reply
* Re: [PATCH net-next 0/9] devlink: Add support for region access
From: David Miller @ 2018-03-30 18:07 UTC (permalink / raw)
To: andrew; +Cc: valex, netdev, tariqt, jiri
In-Reply-To: <20180329195154.GB15565@lunn.ch>
From: Andrew Lunn <andrew@lunn.ch>
Date: Thu, 29 Mar 2018 21:51:54 +0200
> And it seems to want contiguous pages. How well does that work after
> the system has been running for a while and memory is fragmented?
Indeed this will be a problem.
^ permalink raw reply
* Re: [PATCH V2 net-next] liquidio: prevent rx queues from getting stalled
From: David Miller @ 2018-03-30 18:21 UTC (permalink / raw)
To: felix.manlunas; +Cc: netdev, raghu.vatsavayi, derek.chickles, satananda.burla
In-Reply-To: <20180329181322.GA9939@felix-thinkpad.cavium.com>
From: Felix Manlunas <felix.manlunas@cavium.com>
Date: Thu, 29 Mar 2018 11:13:22 -0700
> From: Raghu Vatsavayi <raghu.vatsavayi@cavium.com>
>
> This commit has fix for RX traffic issues when we stress test the driver
> with continuous ifconfig up/down under very high traffic conditions.
>
> Reason for the issue is that, in existing liquidio_stop function NAPI is
> disabled even before actual FW/HW interface is brought down via
> send_rx_ctrl_cmd(lio, 0). Between time frame of NAPI disable and actual
> interface down in firmware, firmware continuously enqueues rx traffic to
> host. When interrupt happens for new packets, host irq handler fails in
> scheduling NAPI as the NAPI is already disabled.
>
> After "ifconfig <iface> up", Host re-enables NAPI but cannot schedule it
> until it receives another Rx interrupt. Host never receives Rx interrupt as
> it never cleared the Rx interrupt it received during interface down
> operation. NIC Rx interrupt gets cleared only when Host processes queue and
> clears the queue counts. Above anomaly leads to other issues like packet
> overflow in FW/HW queues, backpressure.
>
> Fix:
> This commit fixes this issue by disabling NAPI only after informing
> firmware to stop queueing packets to host via send_rx_ctrl_cmd(lio, 0).
> send_rx_ctrl_cmd is not visible in the patch as it is already there in the
> code. The DOWN command also waits for any pending packets to be processed
> by NAPI so that the deadlock will not occur.
>
> Signed-off-by: Raghu Vatsavayi <raghu.vatsavayi@cavium.com>
> Acked-by: Derek Chickles <derek.chickles@cavium.com>
> Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
Applied.
^ permalink raw reply
* Re: [PATCH net] vrf: Fix use after free and double free in vrf_finish_output
From: David Miller @ 2018-03-30 18:21 UTC (permalink / raw)
To: dsahern; +Cc: netdev, mfadon
In-Reply-To: <20180329194952.27097-1-dsahern@gmail.com>
From: David Ahern <dsahern@gmail.com>
Date: Thu, 29 Mar 2018 12:49:52 -0700
> Miguel reported an skb use after free / double free in vrf_finish_output
> when neigh_output returns an error. The vrf driver should return after
> the call to neigh_output as it takes over the skb on error path as well.
>
> Patch is a simplified version of Miguel's patch which was written for 4.9,
> and updated to top of tree.
>
> Fixes: 8f58336d3f78a ("net: Add ethernet header for pass through VRF device")
> Signed-off-by: Miguel Fadon Perlines <mfadon@teldat.com>
> Signed-off-by: David Ahern <dsahern@gmail.com>
Applied and queued up for -stable, thanks David.
^ permalink raw reply
* Re: [net-next V7 PATCH 07/16] virtio_net: convert to use generic xdp_frame and xdp_return_frame API
From: kbuild test robot @ 2018-03-30 18:22 UTC (permalink / raw)
To: Jesper Dangaard Brouer
Cc: kbuild-all, netdev, BjörnTöpel, magnus.karlsson,
eugenia, Jason Wang, John Fastabend, Eran Ben Elisha,
Saeed Mahameed, galp, Jesper Dangaard Brouer, Daniel Borkmann,
Alexei Starovoitov, Tariq Toukan
In-Reply-To: <152234289201.17048.17760447330628182817.stgit@firesoul>
Hi Jesper,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
url: https://github.com/0day-ci/linux/commits/Jesper-Dangaard-Brouer/XDP-redirect-memory-return-API/20180330-203122
reproduce:
# apt-get install sparse
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__
sparse warnings: (new ones prefixed by >>)
>> drivers/net/virtio_net.c:451:26: sparse: incorrect type in assignment (different base types) @@ expected restricted __virtio16 [usertype] hdr_len @@ got unsirestricted __virtio16 [usertype] hdr_len @@
drivers/net/virtio_net.c:451:26: expected restricted __virtio16 [usertype] hdr_len
drivers/net/virtio_net.c:451:26: got unsigned short [unsigned] [usertype] len
drivers/net/virtio_net.c:2140:27: sparse: incorrect type in assignment (different base types) @@ expected unsigned long long [unsigned] [usertype] ctrl_offloads @@ got unsigned] [usertype] ctrl_offloads @@
drivers/net/virtio_net.c:2140:27: expected unsigned long long [unsigned] [usertype] ctrl_offloads
drivers/net/virtio_net.c:2140:27: got restricted __virtio64
vim +451 drivers/net/virtio_net.c
417
418 static bool __virtnet_xdp_xmit(struct virtnet_info *vi,
419 struct xdp_buff *xdp)
420 {
421 struct virtio_net_hdr_mrg_rxbuf *hdr;
422 struct xdp_frame *xdpf, *xdpf_sent;
423 struct send_queue *sq;
424 unsigned int len;
425 unsigned int qp;
426 int err;
427
428 qp = vi->curr_queue_pairs - vi->xdp_queue_pairs + smp_processor_id();
429 sq = &vi->sq[qp];
430
431 /* Free up any pending old buffers before queueing new ones. */
432 while ((xdpf_sent = virtqueue_get_buf(sq->vq, &len)) != NULL)
433 xdp_return_frame(xdpf_sent->data, &xdpf_sent->mem);
434
435 xdpf = convert_to_xdp_frame(xdp);
436 if (unlikely(!xdpf))
437 return -EOVERFLOW;
438
439 /* virtqueue want to use data area in-front of packet */
440 if (unlikely(xdpf->metasize > 0))
441 return -EOPNOTSUPP;
442
443 if (unlikely(xdpf->headroom < vi->hdr_len))
444 return -EOVERFLOW;
445
446 /* Make room for virtqueue hdr (also change xdpf->headroom?) */
447 xdpf->data -= vi->hdr_len;
448 /* Zero header and leave csum up to XDP layers */
449 hdr = xdpf->data;
450 memset(hdr, 0, vi->hdr_len);
> 451 hdr->hdr.hdr_len = xdpf->len; /* Q: is this needed? */
452 xdpf->len += vi->hdr_len;
453
454 sg_init_one(sq->sg, xdpf->data, xdpf->len);
455
456 err = virtqueue_add_outbuf(sq->vq, sq->sg, 1, xdpf, GFP_ATOMIC);
457 if (unlikely(err))
458 return false; /* Caller handle free/refcnt */
459
460 return true;
461 }
462
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
^ permalink raw reply
* Re: [PATCH net-next] tc-testing: Add newline when writing test case files
From: David Miller @ 2018-03-30 18:23 UTC (permalink / raw)
To: lucasb; +Cc: netdev, kernel, jhs, xiyou.wangcong, jiri
In-Reply-To: <1522353490-30164-1-git-send-email-lucasb@mojatatu.com>
From: Lucas Bates <lucasb@mojatatu.com>
Date: Thu, 29 Mar 2018 15:58:10 -0400
> When using the -i feature to generate random ID numbers for test
> cases in tdc, the function that writes the JSON to file doesn't
> add a newline character to the end of the file, so we have to
> add our own.
>
> Signed-off-by: Lucas Bates <lucasb@mojatatu.com>
Applied, thanks Lucas.
^ 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