<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/net/mac80211/mesh.h, branch v4.9.123</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>mac80211: mesh: fix cleanup for mesh pathtable</title>
<updated>2016-04-05T19:34:53+00:00</updated>
<author>
<name>Bob Copeland</name>
<email>me@bobcopeland.com</email>
</author>
<published>2016-03-26T15:27:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0371a08fbb3e557f19db41e47a199ad8300c9c97'/>
<id>0371a08fbb3e557f19db41e47a199ad8300c9c97</id>
<content type='text'>
The mesh path table needs to be around for the entire time the
interface is in mesh mode, as users can perform an mpath dump
at any time.  The existing path table lifetime is instead tied
to the mesh BSS which can cause crashes when different MBSSes
are joined in the context of a single interface, or when the
path table is dumped when no MBSS is joined.

Introduce a new function to perform the final teardown of the
interface and perform path table cleanup there.  We already
free the individual path elements when the leaving the mesh
so no additional cleanup is needed there.  This fixes the
following crash:

[   47.753026] BUG: unable to handle kernel paging request at fffffff0
[   47.753026] IP: [&lt;c0239765&gt;] kthread_data+0xa/0xe
[   47.753026] *pde = 00741067 *pte = 00000000
[   47.753026] Oops: 0000 [#4] PREEMPT
[   47.753026] Modules linked in: ppp_generic slhc 8021q garp mrp sch_fq_codel iptable_mangle ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat ip_tables ath9k_htc ath5k 8139too ath10k_pci ath10k_core arc4 ath9k ath9k_common ath9k_hw mac80211 ath cfg80211 cpufreq_powersave br_netfilter bridge stp llc ipw usb_wwan sierra_net usbnet af_alg natsemi via_rhine mii iTCO_wdt iTCO_vendor_support gpio_ich sierra coretemp pcspkr i2c_i801 lpc_ich ata_generic ata_piix libata ide_pci_generic piix e1000e igb i2c_algo_bit ptp pps_core [last unloaded: 8139too]
[   47.753026] CPU: 0 PID: 12 Comm: kworker/u2:1 Tainted: G      D W       4.5.0-wt-V3 #6
[   47.753026] Hardware name: To Be Filled By O.E.M./To be filled by O.E.M., BIOS 080016  11/07/2014
[   47.753026] task: f645a0c0 ti: f6462000 task.ti: f6462000
[   47.753026] EIP: 0060:[&lt;c0239765&gt;] EFLAGS: 00010002 CPU: 0
[   47.753026] EIP is at kthread_data+0xa/0xe
[   47.753026] EAX: 00000000 EBX: 00000000 ECX: 00000000 EDX: 00000000
[   47.753026] ESI: f645a0c0 EDI: f645a2fc EBP: f6463a80 ESP: f6463a78
[   47.753026]  DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068
[   47.753026] CR0: 8005003b CR2: 00000014 CR3: 353e5000 CR4: 00000690
[   47.753026] Stack:
[   47.753026]  c0236866 00000000 f6463aac c05768b4 00000009 f6463ba8 f6463ab0 c0247010
[   47.753026]  00000000 f645a0c0 f6464000 00000009 f6463ba8 f6463ab8 c0576eb2 f645a0c0
[   47.753026]  f6463aec c0228be4 c06335a4 f6463adc f6463ad0 c06c06d4 f6463ae4 c02471b0
[   47.753026] Call Trace:
[   47.753026]  [&lt;c0236866&gt;] ? wq_worker_sleeping+0xb/0x78
[   47.753026]  [&lt;c05768b4&gt;] __schedule+0xda/0x587
[   47.753026]  [&lt;c0247010&gt;] ? vprintk_default+0x12/0x14
[   47.753026]  [&lt;c0576eb2&gt;] schedule+0x72/0x89
[   47.753026]  [&lt;c0228be4&gt;] do_exit+0xb8/0x71d
[   47.753026]  [&lt;c02471b0&gt;] ? kmsg_dump+0xa9/0xae
[   47.753026]  [&lt;c0203576&gt;] oops_end+0x69/0x70
[   47.753026]  [&lt;c021dcdb&gt;] no_context+0x1bb/0x1c5
[   47.753026]  [&lt;c021de1b&gt;] __bad_area_nosemaphore+0x136/0x140
[   47.753026]  [&lt;c021e2ef&gt;] ? vmalloc_sync_all+0x19a/0x19a
[   47.753026]  [&lt;c021de32&gt;] bad_area_nosemaphore+0xd/0x10
[   47.753026]  [&lt;c021e0a1&gt;] __do_page_fault+0x26c/0x320
[   47.753026]  [&lt;c021e2ef&gt;] ? vmalloc_sync_all+0x19a/0x19a
[   47.753026]  [&lt;c021e2fa&gt;] do_page_fault+0xb/0xd
[   47.753026]  [&lt;c05798f8&gt;] error_code+0x58/0x60
[   47.753026]  [&lt;c021e2ef&gt;] ? vmalloc_sync_all+0x19a/0x19a
[   47.753026]  [&lt;c0239765&gt;] ? kthread_data+0xa/0xe
[   47.753026]  [&lt;c0236866&gt;] ? wq_worker_sleeping+0xb/0x78
[   47.753026]  [&lt;c05768b4&gt;] __schedule+0xda/0x587
[   47.753026]  [&lt;c0247010&gt;] ? vprintk_default+0x12/0x14
[   47.753026]  [&lt;c0576eb2&gt;] schedule+0x72/0x89
[   47.753026]  [&lt;c0228be4&gt;] do_exit+0xb8/0x71d
[   47.753026]  [&lt;c02471b0&gt;] ? kmsg_dump+0xa9/0xae
[   47.753026]  [&lt;c0203576&gt;] oops_end+0x69/0x70
[   47.753026]  [&lt;c021dcdb&gt;] no_context+0x1bb/0x1c5
[   47.753026]  [&lt;c021de1b&gt;] __bad_area_nosemaphore+0x136/0x140
[   47.753026]  [&lt;c021e2ef&gt;] ? vmalloc_sync_all+0x19a/0x19a
[   47.753026]  [&lt;c021de32&gt;] bad_area_nosemaphore+0xd/0x10
[   47.753026]  [&lt;c021e0a1&gt;] __do_page_fault+0x26c/0x320
[   47.753026]  [&lt;c021e2ef&gt;] ? vmalloc_sync_all+0x19a/0x19a
[   47.753026]  [&lt;c021e2fa&gt;] do_page_fault+0xb/0xd
[   47.753026]  [&lt;c05798f8&gt;] error_code+0x58/0x60
[   47.753026]  [&lt;c021e2ef&gt;] ? vmalloc_sync_all+0x19a/0x19a
[   47.753026]  [&lt;c0239765&gt;] ? kthread_data+0xa/0xe
[   47.753026]  [&lt;c0236866&gt;] ? wq_worker_sleeping+0xb/0x78
[   47.753026]  [&lt;c05768b4&gt;] __schedule+0xda/0x587
[   47.753026]  [&lt;c0391e32&gt;] ? put_io_context_active+0x6d/0x95
[   47.753026]  [&lt;c0576eb2&gt;] schedule+0x72/0x89
[   47.753026]  [&lt;c02291f8&gt;] do_exit+0x6cc/0x71d
[   47.753026]  [&lt;c0203576&gt;] oops_end+0x69/0x70
[   47.753026]  [&lt;c021dcdb&gt;] no_context+0x1bb/0x1c5
[   47.753026]  [&lt;c021de1b&gt;] __bad_area_nosemaphore+0x136/0x140
[   47.753026]  [&lt;c021e2ef&gt;] ? vmalloc_sync_all+0x19a/0x19a
[   47.753026]  [&lt;c021de32&gt;] bad_area_nosemaphore+0xd/0x10
[   47.753026]  [&lt;c021e0a1&gt;] __do_page_fault+0x26c/0x320
[   47.753026]  [&lt;c03b9160&gt;] ? debug_smp_processor_id+0x12/0x16
[   47.753026]  [&lt;c02015e2&gt;] ? __switch_to+0x24/0x40e
[   47.753026]  [&lt;c021e2ef&gt;] ? vmalloc_sync_all+0x19a/0x19a
[   47.753026]  [&lt;c021e2fa&gt;] do_page_fault+0xb/0xd
[   47.753026]  [&lt;c05798f8&gt;] error_code+0x58/0x60
[   47.753026]  [&lt;c021e2ef&gt;] ? vmalloc_sync_all+0x19a/0x19a
[   47.753026]  [&lt;c03b59d2&gt;] ? rhashtable_walk_init+0x5c/0x93
[   47.753026]  [&lt;f9843221&gt;] mesh_path_tbl_expire.isra.24+0x19/0x82 [mac80211]
[   47.753026]  [&lt;f984408b&gt;] mesh_path_expire+0x11/0x1f [mac80211]
[   47.753026]  [&lt;f9842bb7&gt;] ieee80211_mesh_work+0x73/0x1a9 [mac80211]
[   47.753026]  [&lt;f98207d1&gt;] ieee80211_iface_work+0x2ff/0x311 [mac80211]
[   47.753026]  [&lt;c0235fa3&gt;] process_one_work+0x14b/0x24e
[   47.753026]  [&lt;c0236313&gt;] worker_thread+0x249/0x343
[   47.753026]  [&lt;c02360ca&gt;] ? process_scheduled_works+0x24/0x24
[   47.753026]  [&lt;c0239359&gt;] kthread+0x9e/0xa3
[   47.753026]  [&lt;c0578e50&gt;] ret_from_kernel_thread+0x20/0x40
[   47.753026]  [&lt;c02392bb&gt;] ? kthread_parkme+0x18/0x18
[   47.753026] Code: 6b c0 85 c0 75 05 e8 fb 74 fc ff 89 f8 84 c0 75 08 8d 45 e8 e8 34 dd 33 00 83 c4 28 5b 5e 5f 5d c3 55 8b 80 10 02 00 00 89 e5 5d &lt;8b&gt; 40 f0 c3 55 b9 04 00 00 00 89 e5 52 8b 90 10 02 00 00 8d 45
[   47.753026] EIP: [&lt;c0239765&gt;] kthread_data+0xa/0xe SS:ESP 0068:f6463a78
[   47.753026] CR2: 00000000fffffff0
[   47.753026] ---[ end trace 867ca0bdd0767790 ]---

Fixes: 3b302ada7f0a ("mac80211: mesh: move path tables into if_mesh")
Reported-by: Fred Veldini &lt;fred.veldini@gmail.com&gt;
Signed-off-by: Bob Copeland &lt;me@bobcopeland.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The mesh path table needs to be around for the entire time the
interface is in mesh mode, as users can perform an mpath dump
at any time.  The existing path table lifetime is instead tied
to the mesh BSS which can cause crashes when different MBSSes
are joined in the context of a single interface, or when the
path table is dumped when no MBSS is joined.

Introduce a new function to perform the final teardown of the
interface and perform path table cleanup there.  We already
free the individual path elements when the leaving the mesh
so no additional cleanup is needed there.  This fixes the
following crash:

[   47.753026] BUG: unable to handle kernel paging request at fffffff0
[   47.753026] IP: [&lt;c0239765&gt;] kthread_data+0xa/0xe
[   47.753026] *pde = 00741067 *pte = 00000000
[   47.753026] Oops: 0000 [#4] PREEMPT
[   47.753026] Modules linked in: ppp_generic slhc 8021q garp mrp sch_fq_codel iptable_mangle ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat ip_tables ath9k_htc ath5k 8139too ath10k_pci ath10k_core arc4 ath9k ath9k_common ath9k_hw mac80211 ath cfg80211 cpufreq_powersave br_netfilter bridge stp llc ipw usb_wwan sierra_net usbnet af_alg natsemi via_rhine mii iTCO_wdt iTCO_vendor_support gpio_ich sierra coretemp pcspkr i2c_i801 lpc_ich ata_generic ata_piix libata ide_pci_generic piix e1000e igb i2c_algo_bit ptp pps_core [last unloaded: 8139too]
[   47.753026] CPU: 0 PID: 12 Comm: kworker/u2:1 Tainted: G      D W       4.5.0-wt-V3 #6
[   47.753026] Hardware name: To Be Filled By O.E.M./To be filled by O.E.M., BIOS 080016  11/07/2014
[   47.753026] task: f645a0c0 ti: f6462000 task.ti: f6462000
[   47.753026] EIP: 0060:[&lt;c0239765&gt;] EFLAGS: 00010002 CPU: 0
[   47.753026] EIP is at kthread_data+0xa/0xe
[   47.753026] EAX: 00000000 EBX: 00000000 ECX: 00000000 EDX: 00000000
[   47.753026] ESI: f645a0c0 EDI: f645a2fc EBP: f6463a80 ESP: f6463a78
[   47.753026]  DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068
[   47.753026] CR0: 8005003b CR2: 00000014 CR3: 353e5000 CR4: 00000690
[   47.753026] Stack:
[   47.753026]  c0236866 00000000 f6463aac c05768b4 00000009 f6463ba8 f6463ab0 c0247010
[   47.753026]  00000000 f645a0c0 f6464000 00000009 f6463ba8 f6463ab8 c0576eb2 f645a0c0
[   47.753026]  f6463aec c0228be4 c06335a4 f6463adc f6463ad0 c06c06d4 f6463ae4 c02471b0
[   47.753026] Call Trace:
[   47.753026]  [&lt;c0236866&gt;] ? wq_worker_sleeping+0xb/0x78
[   47.753026]  [&lt;c05768b4&gt;] __schedule+0xda/0x587
[   47.753026]  [&lt;c0247010&gt;] ? vprintk_default+0x12/0x14
[   47.753026]  [&lt;c0576eb2&gt;] schedule+0x72/0x89
[   47.753026]  [&lt;c0228be4&gt;] do_exit+0xb8/0x71d
[   47.753026]  [&lt;c02471b0&gt;] ? kmsg_dump+0xa9/0xae
[   47.753026]  [&lt;c0203576&gt;] oops_end+0x69/0x70
[   47.753026]  [&lt;c021dcdb&gt;] no_context+0x1bb/0x1c5
[   47.753026]  [&lt;c021de1b&gt;] __bad_area_nosemaphore+0x136/0x140
[   47.753026]  [&lt;c021e2ef&gt;] ? vmalloc_sync_all+0x19a/0x19a
[   47.753026]  [&lt;c021de32&gt;] bad_area_nosemaphore+0xd/0x10
[   47.753026]  [&lt;c021e0a1&gt;] __do_page_fault+0x26c/0x320
[   47.753026]  [&lt;c021e2ef&gt;] ? vmalloc_sync_all+0x19a/0x19a
[   47.753026]  [&lt;c021e2fa&gt;] do_page_fault+0xb/0xd
[   47.753026]  [&lt;c05798f8&gt;] error_code+0x58/0x60
[   47.753026]  [&lt;c021e2ef&gt;] ? vmalloc_sync_all+0x19a/0x19a
[   47.753026]  [&lt;c0239765&gt;] ? kthread_data+0xa/0xe
[   47.753026]  [&lt;c0236866&gt;] ? wq_worker_sleeping+0xb/0x78
[   47.753026]  [&lt;c05768b4&gt;] __schedule+0xda/0x587
[   47.753026]  [&lt;c0247010&gt;] ? vprintk_default+0x12/0x14
[   47.753026]  [&lt;c0576eb2&gt;] schedule+0x72/0x89
[   47.753026]  [&lt;c0228be4&gt;] do_exit+0xb8/0x71d
[   47.753026]  [&lt;c02471b0&gt;] ? kmsg_dump+0xa9/0xae
[   47.753026]  [&lt;c0203576&gt;] oops_end+0x69/0x70
[   47.753026]  [&lt;c021dcdb&gt;] no_context+0x1bb/0x1c5
[   47.753026]  [&lt;c021de1b&gt;] __bad_area_nosemaphore+0x136/0x140
[   47.753026]  [&lt;c021e2ef&gt;] ? vmalloc_sync_all+0x19a/0x19a
[   47.753026]  [&lt;c021de32&gt;] bad_area_nosemaphore+0xd/0x10
[   47.753026]  [&lt;c021e0a1&gt;] __do_page_fault+0x26c/0x320
[   47.753026]  [&lt;c021e2ef&gt;] ? vmalloc_sync_all+0x19a/0x19a
[   47.753026]  [&lt;c021e2fa&gt;] do_page_fault+0xb/0xd
[   47.753026]  [&lt;c05798f8&gt;] error_code+0x58/0x60
[   47.753026]  [&lt;c021e2ef&gt;] ? vmalloc_sync_all+0x19a/0x19a
[   47.753026]  [&lt;c0239765&gt;] ? kthread_data+0xa/0xe
[   47.753026]  [&lt;c0236866&gt;] ? wq_worker_sleeping+0xb/0x78
[   47.753026]  [&lt;c05768b4&gt;] __schedule+0xda/0x587
[   47.753026]  [&lt;c0391e32&gt;] ? put_io_context_active+0x6d/0x95
[   47.753026]  [&lt;c0576eb2&gt;] schedule+0x72/0x89
[   47.753026]  [&lt;c02291f8&gt;] do_exit+0x6cc/0x71d
[   47.753026]  [&lt;c0203576&gt;] oops_end+0x69/0x70
[   47.753026]  [&lt;c021dcdb&gt;] no_context+0x1bb/0x1c5
[   47.753026]  [&lt;c021de1b&gt;] __bad_area_nosemaphore+0x136/0x140
[   47.753026]  [&lt;c021e2ef&gt;] ? vmalloc_sync_all+0x19a/0x19a
[   47.753026]  [&lt;c021de32&gt;] bad_area_nosemaphore+0xd/0x10
[   47.753026]  [&lt;c021e0a1&gt;] __do_page_fault+0x26c/0x320
[   47.753026]  [&lt;c03b9160&gt;] ? debug_smp_processor_id+0x12/0x16
[   47.753026]  [&lt;c02015e2&gt;] ? __switch_to+0x24/0x40e
[   47.753026]  [&lt;c021e2ef&gt;] ? vmalloc_sync_all+0x19a/0x19a
[   47.753026]  [&lt;c021e2fa&gt;] do_page_fault+0xb/0xd
[   47.753026]  [&lt;c05798f8&gt;] error_code+0x58/0x60
[   47.753026]  [&lt;c021e2ef&gt;] ? vmalloc_sync_all+0x19a/0x19a
[   47.753026]  [&lt;c03b59d2&gt;] ? rhashtable_walk_init+0x5c/0x93
[   47.753026]  [&lt;f9843221&gt;] mesh_path_tbl_expire.isra.24+0x19/0x82 [mac80211]
[   47.753026]  [&lt;f984408b&gt;] mesh_path_expire+0x11/0x1f [mac80211]
[   47.753026]  [&lt;f9842bb7&gt;] ieee80211_mesh_work+0x73/0x1a9 [mac80211]
[   47.753026]  [&lt;f98207d1&gt;] ieee80211_iface_work+0x2ff/0x311 [mac80211]
[   47.753026]  [&lt;c0235fa3&gt;] process_one_work+0x14b/0x24e
[   47.753026]  [&lt;c0236313&gt;] worker_thread+0x249/0x343
[   47.753026]  [&lt;c02360ca&gt;] ? process_scheduled_works+0x24/0x24
[   47.753026]  [&lt;c0239359&gt;] kthread+0x9e/0xa3
[   47.753026]  [&lt;c0578e50&gt;] ret_from_kernel_thread+0x20/0x40
[   47.753026]  [&lt;c02392bb&gt;] ? kthread_parkme+0x18/0x18
[   47.753026] Code: 6b c0 85 c0 75 05 e8 fb 74 fc ff 89 f8 84 c0 75 08 8d 45 e8 e8 34 dd 33 00 83 c4 28 5b 5e 5f 5d c3 55 8b 80 10 02 00 00 89 e5 5d &lt;8b&gt; 40 f0 c3 55 b9 04 00 00 00 89 e5 52 8b 90 10 02 00 00 8d 45
[   47.753026] EIP: [&lt;c0239765&gt;] kthread_data+0xa/0xe SS:ESP 0068:f6463a78
[   47.753026] CR2: 00000000fffffff0
[   47.753026] ---[ end trace 867ca0bdd0767790 ]---

Fixes: 3b302ada7f0a ("mac80211: mesh: move path tables into if_mesh")
Reported-by: Fred Veldini &lt;fred.veldini@gmail.com&gt;
Signed-off-by: Bob Copeland &lt;me@bobcopeland.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mac80211: mesh: fix mesh path kerneldoc</title>
<updated>2016-04-05T19:34:53+00:00</updated>
<author>
<name>Bob Copeland</name>
<email>me@bobcopeland.com</email>
</author>
<published>2016-03-19T02:11:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=68bb54b47ea1130e57049d86d172d0e098edb3f4'/>
<id>68bb54b47ea1130e57049d86d172d0e098edb3f4</id>
<content type='text'>
Several of the mesh path fields are undocumented and some
of the documentation is no longer correct or relevant after
the switch to rhashtable.  Clean up the kernel doc
accordingly and reorder some fields to match the structure
layout.

Signed-off-by: Bob Copeland &lt;me@bobcopeland.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Several of the mesh path fields are undocumented and some
of the documentation is no longer correct or relevant after
the switch to rhashtable.  Clean up the kernel doc
accordingly and reorder some fields to match the structure
layout.

Signed-off-by: Bob Copeland &lt;me@bobcopeland.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mac80211: mesh: reorder structure members</title>
<updated>2016-04-05T19:34:52+00:00</updated>
<author>
<name>Bob Copeland</name>
<email>me@bobcopeland.com</email>
</author>
<published>2016-03-19T02:11:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3257523bed496316dad95d5a341bfd49ac16624b'/>
<id>3257523bed496316dad95d5a341bfd49ac16624b</id>
<content type='text'>
Reduce padding waste in struct mesh_table and struct rmc_entry by
moving the smaller fields to the end.

Signed-off-by: Bob Copeland &lt;me@bobcopeland.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reduce padding waste in struct mesh_table and struct rmc_entry by
moving the smaller fields to the end.

Signed-off-by: Bob Copeland &lt;me@bobcopeland.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mac80211: mesh: embed gates hlist head directly</title>
<updated>2016-04-05T19:34:51+00:00</updated>
<author>
<name>Bob Copeland</name>
<email>me@bobcopeland.com</email>
</author>
<published>2016-03-19T02:11:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=18b27ff7d2e232b0f07f2f51aa8052ff2a617908'/>
<id>18b27ff7d2e232b0f07f2f51aa8052ff2a617908</id>
<content type='text'>
Since we have converted the mesh path tables to rhashtable, we are
no longer swapping out the entire mesh_pathtbl pointer with RCU.
As a result, we no longer need indirection to the hlist head for
the gates list and can simply embed it, saving a pair of
pointer-sized allocations.

Signed-off-by: Bob Copeland &lt;me@bobcopeland.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since we have converted the mesh path tables to rhashtable, we are
no longer swapping out the entire mesh_pathtbl pointer with RCU.
As a result, we no longer need indirection to the hlist head for
the gates list and can simply embed it, saving a pair of
pointer-sized allocations.

Signed-off-by: Bob Copeland &lt;me@bobcopeland.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mac80211: mesh: use hlist for rmc cache</title>
<updated>2016-04-05T19:34:51+00:00</updated>
<author>
<name>Bob Copeland</name>
<email>me@bobcopeland.com</email>
</author>
<published>2016-03-19T02:11:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=47a0489ce1e518f4936c7fedb93b3d2abd7ccd2e'/>
<id>47a0489ce1e518f4936c7fedb93b3d2abd7ccd2e</id>
<content type='text'>
The RMC cache has 256 list heads plus a u32, which puts it at the
unfortunate size of 4104 bytes with padding.  kmalloc() will then
round this up to the next power-of-two, so we wind up actually
using two pages here where most of the second is wasted.

Switch to hlist heads here to reduce the structure size down to
fit within a page.

Signed-off-by: Bob Copeland &lt;me@bobcopeland.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The RMC cache has 256 list heads plus a u32, which puts it at the
unfortunate size of 4104 bytes with padding.  kmalloc() will then
round this up to the next power-of-two, so we wind up actually
using two pages here where most of the second is wasted.

Switch to hlist heads here to reduce the structure size down to
fit within a page.

Signed-off-by: Bob Copeland &lt;me@bobcopeland.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mac80211: mesh: fix crash in mesh_path_timer</title>
<updated>2016-04-05T19:34:49+00:00</updated>
<author>
<name>Bob Copeland</name>
<email>me@bobcopeland.com</email>
</author>
<published>2016-03-19T02:03:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=749329594b5e0fb612b2de642a692323ddf661dd'/>
<id>749329594b5e0fb612b2de642a692323ddf661dd</id>
<content type='text'>
The mesh_path_reclaim() function, called from an rcu callback, cancels
the mesh_path_timer associated with a mesh path.  Unfortunately, this
call can happen much later, perhaps after the hash table itself is
destroyed.

Such a situation led to the following crash in mesh_path_send_to_gates()
when dereferencing the tbl pointer:

[   23.901661] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
[   23.905516] IP: [&lt;ffffffff814c910b&gt;] mesh_path_send_to_gates+0x2b/0x740
[   23.908757] PGD 99ca067 PUD 99c4067 PMD 0
[   23.910789] Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
[   23.913485] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.5.0-rc6-wt+ #43
[   23.916675] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Debian-1.8.2-1 04/01/2014
[   23.920471] task: ffffffff81685500 ti: ffffffff81678000 task.ti: ffffffff81678000
[   23.922619] RIP: 0010:[&lt;ffffffff814c910b&gt;]  [&lt;ffffffff814c910b&gt;] mesh_path_send_to_gates+0x2b/0x740
[   23.925237] RSP: 0018:ffff88000b403d30  EFLAGS: 00010286
[   23.926739] RAX: 0000000000000000 RBX: ffff880009bc0d20 RCX: 0000000000000102
[   23.928796] RDX: 000000000000002e RSI: 0000000000000001 RDI: ffff880009bc0d20
[   23.930895] RBP: ffff88000b403e18 R08: 0000000000000001 R09: 0000000000000001
[   23.932917] R10: 0000000000000000 R11: 0000000000000001 R12: ffff880009c20940
[   23.936370] R13: ffff880009bc0e70 R14: ffff880009c21c40 R15: ffff880009bc0d20
[   23.939823] FS:  0000000000000000(0000) GS:ffff88000b400000(0000) knlGS:0000000000000000
[   23.943688] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[   23.946429] CR2: 0000000000000008 CR3: 00000000099c5000 CR4: 00000000000006b0
[   23.949861] Stack:
[   23.950840]  000000000000002e ffff880009c20940 ffff88000b403da8 ffffffff8109e551
[   23.954467]  ffffffff82711be2 000000000000002e 0000000000000000 ffffffff8166a5f5
[   23.958141]  0000000000685ce8 0000000000000246 ffff880009bc0d20 ffff880009c20940
[   23.961801] Call Trace:
[   23.962987]  &lt;IRQ&gt;
[   23.963963]  [&lt;ffffffff8109e551&gt;] ? vprintk_emit+0x351/0x5e0
[   23.966782]  [&lt;ffffffff8109e8ff&gt;] ? vprintk_default+0x1f/0x30
[   23.969529]  [&lt;ffffffff810ffa41&gt;] ? printk+0x48/0x50
[   23.971956]  [&lt;ffffffff814ceef3&gt;] mesh_path_timer+0x133/0x160
[   23.974707]  [&lt;ffffffff814cedc0&gt;] ? mesh_nexthop_resolve+0x230/0x230
[   23.977775]  [&lt;ffffffff810b04ee&gt;] call_timer_fn+0xce/0x330
[   23.980448]  [&lt;ffffffff810b0425&gt;] ? call_timer_fn+0x5/0x330
[   23.983126]  [&lt;ffffffff814cedc0&gt;] ? mesh_nexthop_resolve+0x230/0x230
[   23.986091]  [&lt;ffffffff810b097c&gt;] run_timer_softirq+0x22c/0x390

Instead of cancelling in the RCU callback, set a new flag to prevent the
timer from being rearmed, and then cancel the timer synchronously when
freeing the mesh path.  This leaves mesh_path_reclaim() doing nothing
but kfree, so switch to kfree_rcu().

Fixes: 3b302ada7f0a ("mac80211: mesh: move path tables into if_mesh")
Signed-off-by: Bob Copeland &lt;me@bobcopeland.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The mesh_path_reclaim() function, called from an rcu callback, cancels
the mesh_path_timer associated with a mesh path.  Unfortunately, this
call can happen much later, perhaps after the hash table itself is
destroyed.

Such a situation led to the following crash in mesh_path_send_to_gates()
when dereferencing the tbl pointer:

[   23.901661] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
[   23.905516] IP: [&lt;ffffffff814c910b&gt;] mesh_path_send_to_gates+0x2b/0x740
[   23.908757] PGD 99ca067 PUD 99c4067 PMD 0
[   23.910789] Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
[   23.913485] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.5.0-rc6-wt+ #43
[   23.916675] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Debian-1.8.2-1 04/01/2014
[   23.920471] task: ffffffff81685500 ti: ffffffff81678000 task.ti: ffffffff81678000
[   23.922619] RIP: 0010:[&lt;ffffffff814c910b&gt;]  [&lt;ffffffff814c910b&gt;] mesh_path_send_to_gates+0x2b/0x740
[   23.925237] RSP: 0018:ffff88000b403d30  EFLAGS: 00010286
[   23.926739] RAX: 0000000000000000 RBX: ffff880009bc0d20 RCX: 0000000000000102
[   23.928796] RDX: 000000000000002e RSI: 0000000000000001 RDI: ffff880009bc0d20
[   23.930895] RBP: ffff88000b403e18 R08: 0000000000000001 R09: 0000000000000001
[   23.932917] R10: 0000000000000000 R11: 0000000000000001 R12: ffff880009c20940
[   23.936370] R13: ffff880009bc0e70 R14: ffff880009c21c40 R15: ffff880009bc0d20
[   23.939823] FS:  0000000000000000(0000) GS:ffff88000b400000(0000) knlGS:0000000000000000
[   23.943688] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[   23.946429] CR2: 0000000000000008 CR3: 00000000099c5000 CR4: 00000000000006b0
[   23.949861] Stack:
[   23.950840]  000000000000002e ffff880009c20940 ffff88000b403da8 ffffffff8109e551
[   23.954467]  ffffffff82711be2 000000000000002e 0000000000000000 ffffffff8166a5f5
[   23.958141]  0000000000685ce8 0000000000000246 ffff880009bc0d20 ffff880009c20940
[   23.961801] Call Trace:
[   23.962987]  &lt;IRQ&gt;
[   23.963963]  [&lt;ffffffff8109e551&gt;] ? vprintk_emit+0x351/0x5e0
[   23.966782]  [&lt;ffffffff8109e8ff&gt;] ? vprintk_default+0x1f/0x30
[   23.969529]  [&lt;ffffffff810ffa41&gt;] ? printk+0x48/0x50
[   23.971956]  [&lt;ffffffff814ceef3&gt;] mesh_path_timer+0x133/0x160
[   23.974707]  [&lt;ffffffff814cedc0&gt;] ? mesh_nexthop_resolve+0x230/0x230
[   23.977775]  [&lt;ffffffff810b04ee&gt;] call_timer_fn+0xce/0x330
[   23.980448]  [&lt;ffffffff810b0425&gt;] ? call_timer_fn+0x5/0x330
[   23.983126]  [&lt;ffffffff814cedc0&gt;] ? mesh_nexthop_resolve+0x230/0x230
[   23.986091]  [&lt;ffffffff810b097c&gt;] run_timer_softirq+0x22c/0x390

Instead of cancelling in the RCU callback, set a new flag to prevent the
timer from being rearmed, and then cancel the timer synchronously when
freeing the mesh path.  This leaves mesh_path_reclaim() doing nothing
but kfree, so switch to kfree_rcu().

Fixes: 3b302ada7f0a ("mac80211: mesh: move path tables into if_mesh")
Signed-off-by: Bob Copeland &lt;me@bobcopeland.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mac80211: mesh: convert path table to rhashtable</title>
<updated>2016-04-05T08:56:33+00:00</updated>
<author>
<name>Bob Copeland</name>
<email>me@bobcopeland.com</email>
</author>
<published>2016-03-02T15:09:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=60854fd94573f0d3b80b55b40cf0140a0430f3ab'/>
<id>60854fd94573f0d3b80b55b40cf0140a0430f3ab</id>
<content type='text'>
In the time since the mesh path table was implemented as an
RCU-traversable, dynamically growing hash table, a generic RCU
hashtable implementation was added to the kernel.

Switch the mesh path table over to rhashtable to remove some code
and also gain some features like automatic shrinking.

Cc: Thomas Graf &lt;tgraf@suug.ch&gt;
Cc: netdev@vger.kernel.org
Signed-off-by: Bob Copeland &lt;me@bobcopeland.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In the time since the mesh path table was implemented as an
RCU-traversable, dynamically growing hash table, a generic RCU
hashtable implementation was added to the kernel.

Switch the mesh path table over to rhashtable to remove some code
and also gain some features like automatic shrinking.

Cc: Thomas Graf &lt;tgraf@suug.ch&gt;
Cc: netdev@vger.kernel.org
Signed-off-by: Bob Copeland &lt;me@bobcopeland.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mac80211: mesh: embed known gates list in struct mesh_path</title>
<updated>2016-04-05T08:56:32+00:00</updated>
<author>
<name>Bob Copeland</name>
<email>me@bobcopeland.com</email>
</author>
<published>2016-02-29T01:03:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=947c2a0eccec29fcd30e717787e65792b1e607ed'/>
<id>947c2a0eccec29fcd30e717787e65792b1e607ed</id>
<content type='text'>
The mesh path table uses a struct mesh_node in its hlists in
order to support a resizable hash table: the mesh_node provides
an indirection to the actual mesh path so that two different
bucket lists can point to the same path entry.

However, for the known gates list, we don't need this indirection
because there is ever only one list.  So we can just embed the
hlist_node in the mesh path itself, which simplifies things a bit
and saves a linear search whenever we need to find an item in
the list.

Signed-off-by: Bob Copeland &lt;me@bobcopeland.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The mesh path table uses a struct mesh_node in its hlists in
order to support a resizable hash table: the mesh_node provides
an indirection to the actual mesh path so that two different
bucket lists can point to the same path entry.

However, for the known gates list, we don't need this indirection
because there is ever only one list.  So we can just embed the
hlist_node in the mesh path itself, which simplifies things a bit
and saves a linear search whenever we need to find an item in
the list.

Signed-off-by: Bob Copeland &lt;me@bobcopeland.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mac80211: mesh: move path tables into if_mesh</title>
<updated>2016-04-05T08:56:30+00:00</updated>
<author>
<name>Bob Copeland</name>
<email>me@bobcopeland.com</email>
</author>
<published>2016-02-29T01:03:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2bdaf386f99c4a82788812e583ff59c6714ae4d6'/>
<id>2bdaf386f99c4a82788812e583ff59c6714ae4d6</id>
<content type='text'>
The mesh path and mesh gate hashtables are global, containing
all of the mpaths for every mesh interface, but the paths are
all tied logically to a single interface.  The common case is
just a single mesh interface, so optimize for that by moving
the global hashtable into the per-interface struct.

Doing so allows us to drop sdata pointer comparisons inside
the lookups and also saves a few bytes of BSS and data.

Signed-off-by: Bob Copeland &lt;me@bobcopeland.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The mesh path and mesh gate hashtables are global, containing
all of the mpaths for every mesh interface, but the paths are
all tied logically to a single interface.  The common case is
just a single mesh interface, so optimize for that by moving
the global hashtable into the per-interface struct.

Doing so allows us to drop sdata pointer comparisons inside
the lookups and also saves a few bytes of BSS and data.

Signed-off-by: Bob Copeland &lt;me@bobcopeland.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'mac80211-next-for-davem-2016-02-26' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next</title>
<updated>2016-03-01T22:03:27+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2016-03-01T22:02:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d67703fcede6696667218d29f86b4ee6ae618de6'/>
<id>d67703fcede6696667218d29f86b4ee6ae618de6</id>
<content type='text'>
Johannes Berg says:

====================
Here's another round of updates for -next:
 * big A-MSDU RX performance improvement (avoid linearize of paged RX)
 * rfkill changes: cleanups, documentation, platform properties
 * basic PBSS support in cfg80211
 * MU-MIMO action frame processing support
 * BlockAck reordering &amp; duplicate detection offload support
 * various cleanups &amp; little fixes
====================

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Johannes Berg says:

====================
Here's another round of updates for -next:
 * big A-MSDU RX performance improvement (avoid linearize of paged RX)
 * rfkill changes: cleanups, documentation, platform properties
 * basic PBSS support in cfg80211
 * MU-MIMO action frame processing support
 * BlockAck reordering &amp; duplicate detection offload support
 * various cleanups &amp; little fixes
====================

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
