* [net-next PATCH] fib_trie: Only display main table in /proc/net/route
@ 2015-03-11 23:36 Alexander Duyck
2015-03-12 1:22 ` David Miller
2015-03-12 19:13 ` Eric Dumazet
0 siblings, 2 replies; 5+ messages in thread
From: Alexander Duyck @ 2015-03-11 23:36 UTC (permalink / raw)
To: netdev; +Cc: davem
When we merged the tries for local and main I had overlooked the iterator
for /proc/net/route. As a result it was outputting both local and main
when the two tries were merged.
This patch resolves that by only providing output for aliases that are
actually in the main trie. As a result we should go back to the original
behavior which I assume will be necessary to maintain legacy support.
Fixes: 0ddcf43d5 ("ipv4: FIB Local/MAIN table collapse")
Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
---
net/ipv4/fib_trie.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 7b2badd..dd488c1 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -2539,6 +2539,8 @@ static unsigned int fib_flag_trans(int type, __be32 mask, const struct fib_info
*/
static int fib_route_seq_show(struct seq_file *seq, void *v)
{
+ struct fib_route_iter *iter = seq->private;
+ struct fib_table *tb = iter->main_tb;
struct fib_alias *fa;
struct key_vector *l = v;
__be32 prefix;
@@ -2561,6 +2563,9 @@ static int fib_route_seq_show(struct seq_file *seq, void *v)
(fa->fa_type == RTN_MULTICAST))
continue;
+ if (fa->tb_id != tb->tb_id)
+ continue;
+
seq_setwidth(seq, 127);
if (fi)
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [net-next PATCH] fib_trie: Only display main table in /proc/net/route
2015-03-11 23:36 [net-next PATCH] fib_trie: Only display main table in /proc/net/route Alexander Duyck
@ 2015-03-12 1:22 ` David Miller
2015-03-12 1:36 ` Alexander Duyck
2015-03-12 19:13 ` Eric Dumazet
1 sibling, 1 reply; 5+ messages in thread
From: David Miller @ 2015-03-12 1:22 UTC (permalink / raw)
To: alexander.h.duyck; +Cc: netdev
From: Alexander Duyck <alexander.h.duyck@redhat.com>
Date: Wed, 11 Mar 2015 16:36:08 -0700
> When we merged the tries for local and main I had overlooked the iterator
> for /proc/net/route. As a result it was outputting both local and main
> when the two tries were merged.
>
> This patch resolves that by only providing output for aliases that are
> actually in the main trie. As a result we should go back to the original
> behavior which I assume will be necessary to maintain legacy support.
>
> Fixes: 0ddcf43d5 ("ipv4: FIB Local/MAIN table collapse")
>
> Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
Applied, thanks Alex.
Please don't put empty lines between Fixes: tags and the signoffs
and acks, they belong together.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [net-next PATCH] fib_trie: Only display main table in /proc/net/route
2015-03-12 1:22 ` David Miller
@ 2015-03-12 1:36 ` Alexander Duyck
0 siblings, 0 replies; 5+ messages in thread
From: Alexander Duyck @ 2015-03-12 1:36 UTC (permalink / raw)
To: David Miller, alexander.h.duyck; +Cc: netdev
On 03/11/2015 06:22 PM, David Miller wrote:
> From: Alexander Duyck <alexander.h.duyck@redhat.com>
> Date: Wed, 11 Mar 2015 16:36:08 -0700
>
>> When we merged the tries for local and main I had overlooked the iterator
>> for /proc/net/route. As a result it was outputting both local and main
>> when the two tries were merged.
>>
>> This patch resolves that by only providing output for aliases that are
>> actually in the main trie. As a result we should go back to the original
>> behavior which I assume will be necessary to maintain legacy support.
>>
>> Fixes: 0ddcf43d5 ("ipv4: FIB Local/MAIN table collapse")
>>
>> Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
> Applied, thanks Alex.
>
> Please don't put empty lines between Fixes: tags and the signoffs
> and acks, they belong together.
I'll try to remember that for any other patches.
Thanks.
- Alex
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [net-next PATCH] fib_trie: Only display main table in /proc/net/route
2015-03-11 23:36 [net-next PATCH] fib_trie: Only display main table in /proc/net/route Alexander Duyck
2015-03-12 1:22 ` David Miller
@ 2015-03-12 19:13 ` Eric Dumazet
2015-03-12 19:56 ` Alexander Duyck
1 sibling, 1 reply; 5+ messages in thread
From: Eric Dumazet @ 2015-03-12 19:13 UTC (permalink / raw)
To: Alexander Duyck; +Cc: netdev, davem
Alex,
I caught this message with latest net-next
[ 31.449563] WARNING: CPU: 2 PID: 10307 at net/ipv4/fib_trie.c:1124 fib_table_insert+0x467/0x4d0()
[ 31.449564] Modules linked in: w1_therm wire cdc_acm ehci_pci ehci_hcd i2c_dev i2c_i801 i2c_core msr cpuid ib_uverbs mlx4_ib ib_sa ib_mad ib_core ib_addr ip6table_mangle ip6_tables ipv6 xt_multiport iptable_mangle
[ 31.449576] CPU: 2 PID: 10307 Comm: route Not tainted 4.0.0-smp-DEV #1321
[ 31.449578] ffffffff8197e8b3 ffff883ff235fa78 ffffffff8160c40f 00000000000000d5
[ 31.449579] 0000000000000000 ffff883ff235fab8 ffffffff810a35d7 0000000000000000
[ 31.449581] 0000000000000000 000000007f000000 ffff883ff235fb90 0000000000000008
[ 31.449582] Call Trace:
[ 31.449587] [<ffffffff8160c40f>] dump_stack+0x45/0x57
[ 31.449591] [<ffffffff810a35d7>] warn_slowpath_common+0x97/0xe0
[ 31.449592] [<ffffffff810a363a>] warn_slowpath_null+0x1a/0x20
[ 31.449594] [<ffffffff815e5fc7>] fib_table_insert+0x467/0x4d0
[ 31.449597] [<ffffffff815e10de>] ip_rt_ioctl+0x30e/0x460
[ 31.449599] [<ffffffff811e0000>] ? do_readv_writev+0x70/0x2e0
[ 31.449601] [<ffffffff815d9485>] inet_ioctl+0x65/0x90
[ 31.449604] [<ffffffff81541e90>] sock_do_ioctl+0x30/0x70
[ 31.449606] [<ffffffff81541fef>] routing_ioctl+0x11f/0x220
[ 31.449608] [<ffffffff81546c68>] ? sk_prot_alloc+0x48/0x1a0
[ 31.449610] [<ffffffff811e0000>] ? do_readv_writev+0x70/0x2e0
[ 31.449611] [<ffffffff81542a52>] compat_sock_ioctl+0x702/0x930
[ 31.449613] [<ffffffff81542d11>] ? sock_alloc_file+0x91/0x120
[ 31.449616] [<ffffffff811fc7bb>] ? __fd_install+0x2b/0x60
[ 31.449617] [<ffffffff811fc815>] ? fd_install+0x25/0x30
[ 31.449619] [<ffffffff81542deb>] ? sock_map_fd+0x4b/0x70
[ 31.449621] [<ffffffff81230233>] compat_SyS_ioctl+0xf3/0x1220
[ 31.449624] [<ffffffff8157f27e>] ? compat_SyS_socketcall+0x9e/0x4a0
[ 31.449626] [<ffffffff81095dec>] ? do_page_fault+0xc/0x10
[ 31.449629] [<ffffffff81614c93>] sysenter_dispatch+0x7/0x1a
[ 31.449630] ---[ end trace 0f37afa3e6f481a5 ]---
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [net-next PATCH] fib_trie: Only display main table in /proc/net/route
2015-03-12 19:13 ` Eric Dumazet
@ 2015-03-12 19:56 ` Alexander Duyck
0 siblings, 0 replies; 5+ messages in thread
From: Alexander Duyck @ 2015-03-12 19:56 UTC (permalink / raw)
To: Eric Dumazet, Alexander Duyck; +Cc: netdev, davem
On 03/12/2015 12:13 PM, Eric Dumazet wrote:
> Alex,
>
> I caught this message with latest net-next
>
> [ 31.449563] WARNING: CPU: 2 PID: 10307 at net/ipv4/fib_trie.c:1124 fib_table_insert+0x467/0x4d0()
> [ 31.449564] Modules linked in: w1_therm wire cdc_acm ehci_pci ehci_hcd i2c_dev i2c_i801 i2c_core msr cpuid ib_uverbs mlx4_ib ib_sa ib_mad ib_core ib_addr ip6table_mangle ip6_tables ipv6 xt_multiport iptable_mangle
> [ 31.449576] CPU: 2 PID: 10307 Comm: route Not tainted 4.0.0-smp-DEV #1321
> [ 31.449578] ffffffff8197e8b3 ffff883ff235fa78 ffffffff8160c40f 00000000000000d5
> [ 31.449579] 0000000000000000 ffff883ff235fab8 ffffffff810a35d7 0000000000000000
> [ 31.449581] 0000000000000000 000000007f000000 ffff883ff235fb90 0000000000000008
> [ 31.449582] Call Trace:
> [ 31.449587] [<ffffffff8160c40f>] dump_stack+0x45/0x57
> [ 31.449591] [<ffffffff810a35d7>] warn_slowpath_common+0x97/0xe0
> [ 31.449592] [<ffffffff810a363a>] warn_slowpath_null+0x1a/0x20
> [ 31.449594] [<ffffffff815e5fc7>] fib_table_insert+0x467/0x4d0
> [ 31.449597] [<ffffffff815e10de>] ip_rt_ioctl+0x30e/0x460
> [ 31.449599] [<ffffffff811e0000>] ? do_readv_writev+0x70/0x2e0
> [ 31.449601] [<ffffffff815d9485>] inet_ioctl+0x65/0x90
> [ 31.449604] [<ffffffff81541e90>] sock_do_ioctl+0x30/0x70
> [ 31.449606] [<ffffffff81541fef>] routing_ioctl+0x11f/0x220
> [ 31.449608] [<ffffffff81546c68>] ? sk_prot_alloc+0x48/0x1a0
> [ 31.449610] [<ffffffff811e0000>] ? do_readv_writev+0x70/0x2e0
> [ 31.449611] [<ffffffff81542a52>] compat_sock_ioctl+0x702/0x930
> [ 31.449613] [<ffffffff81542d11>] ? sock_alloc_file+0x91/0x120
> [ 31.449616] [<ffffffff811fc7bb>] ? __fd_install+0x2b/0x60
> [ 31.449617] [<ffffffff811fc815>] ? fd_install+0x25/0x30
> [ 31.449619] [<ffffffff81542deb>] ? sock_map_fd+0x4b/0x70
> [ 31.449621] [<ffffffff81230233>] compat_SyS_ioctl+0xf3/0x1220
> [ 31.449624] [<ffffffff8157f27e>] ? compat_SyS_socketcall+0x9e/0x4a0
> [ 31.449626] [<ffffffff81095dec>] ? do_page_fault+0xc/0x10
> [ 31.449629] [<ffffffff81614c93>] sysenter_dispatch+0x7/0x1a
> [ 31.449630] ---[ end trace 0f37afa3e6f481a5 ]---
The WARN_ON that is being triggered here is indicating that you have a
route that had identical prefix length, tos, and priority but belonged
to the other half of the merged table.
It should probably just be dropped though as I don't know if it is
really necessary. I assume I could probably go though and just verify
the ordering for insertion so that we have local and then main in such a
case.
- Alex
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-03-12 19:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-11 23:36 [net-next PATCH] fib_trie: Only display main table in /proc/net/route Alexander Duyck
2015-03-12 1:22 ` David Miller
2015-03-12 1:36 ` Alexander Duyck
2015-03-12 19:13 ` Eric Dumazet
2015-03-12 19:56 ` Alexander Duyck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).