Bug 196743

Summary: iwlwifi: adding too many link-layer multicast addresses produces a warning - WIFILNX-1329
Product: Drivers Reporter: regwz
Component: network-wirelessAssignee: DO NOT USE - assign "network-wireless-intel" component instead (linuxwifi)
Status: CLOSED CODE_FIX    
Severity: low CC: luca
Priority: P1    
Hardware: x86-64   
OS: Linux   
Kernel Version: 4.12.8 Subsystem:
Regression: No Bisected commit-id:
Attachments: Potential fix

Description regwz 2017-08-23 14:47:33 UTC
Adding a multicast address to a device that has at least 50 of them already present produces a warning.
The addresses were added using the script below:

#!/bin/bash
for i in {0..255}
do
	hex=$(printf '%02x' $i)
	ip maddress add 33:33:ff:00:00:$hex dev wlp4s0
done


Command MCAST_FILTER_CMD (0x1d0) is too large (328 bytes)
------------[ cut here ]------------
WARNING: CPU: 0 PID: 3839 at drivers/net/wireless/intel/iwlwifi/pcie/tx.c:1526 iwl_pcie_enqueue_hcmd+0x8d8/0xb00 [iwlwifi]
Modules linked in: nfnetlink_queue nfnetlink_log nfnetlink bluetooth ecdh_generic fuse ctr ccm nf_conntrack_ipv6 nf_defrag_ipv6 nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack libcrc32c crc32c_generic ip6table_filter iptable_filter ip6_tables nls_iso8859_1 nls_cp437 msr vfat fat intel_rapl x86_pkg_temp_ther
 thermal wmi led_class tpm battery ac mac_hid sch_fq_codel sg ip_tables x_tables ext4 crc16 jbd2 fscrypto mbcache dm_crypt algif_skcipher af_alg dm_mod dax sr_mod cdrom sd_mod crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel pcbc rtsx_pci_sdmmc mmc_core serio_raw atkbd libps2 ahci libahci aesni_intel aes
CPU: 0 PID: 3839 Comm: kworker/u16:1 Not tainted 4.12.8-2-ARCH #1
Hardware name: LENOVO 20DF004PMC/20DF004PMC, BIOS J5ET57WW (1.28 ) 06/01/2017
Workqueue: phy0 ieee80211_reconfig_filter [mac80211]
task: ffff8bc15f76d580 task.stack: ffffb5ac03b8c000
RIP: 0010:iwl_pcie_enqueue_hcmd+0x8d8/0xb00 [iwlwifi]
RSP: 0018:ffffb5ac03b8fb38 EFLAGS: 00010282
RAX: 0000000000000039 RBX: 00000000000001d0 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffff8bc25ec0dcc8 RDI: ffff8bc25ec0dcc8
RBP: ffffb5ac03b8fbd8 R08: 000000000000032d R09: 0000000000000004
R10: 0000000000000008 R11: 0000000000000001 R12: ffff8bc258200018
R13: ffff8bc24e6cc000 R14: 0000000000000001 R15: 0000000000000148
FS:  0000000000000000(0000) GS:ffff8bc25ec00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f977f26fd40 CR3: 0000000062a09000 CR4: 00000000003406f0
Call Trace:
 ? enqueue_task_fair+0xb6/0x6d0
 iwl_trans_pcie_send_hcmd+0x166/0x500 [iwlwifi]
 ? try_to_wake_up+0x59/0x440
 iwl_trans_send_cmd+0x55/0xa0 [iwlwifi]
 ? default_wake_function+0x12/0x20
 iwl_mvm_send_cmd+0x29/0x80 [iwlmvm]
 ? iwl_mvm_update_mu_groups+0x80/0x80 [iwlmvm]
 iwl_mvm_send_cmd_pdu+0x58/0x80 [iwlmvm]
 iwl_mvm_mc_iface_iterator+0x6b/0x90 [iwlmvm]
 ? iwl_mvm_mc_iface_iterator+0x6b/0x90 [iwlmvm]
 __iterate_interfaces+0x78/0x110 [mac80211]
 ? iwl_mvm_update_mu_groups+0x80/0x80 [iwlmvm]
 ieee80211_iterate_active_interfaces_atomic+0x33/0x50 [mac80211]
 iwl_mvm_recalc_multicast+0x48/0x70 [iwlmvm]
 iwl_mvm_configure_filter+0x4c/0x70 [iwlmvm]
 ieee80211_configure_filter+0x140/0x340 [mac80211]
 ieee80211_reconfig_filter+0x15/0x20 [mac80211]
 process_one_work+0x1de/0x430
 worker_thread+0x47/0x3f0
 kthread+0x125/0x140
 ? process_one_work+0x430/0x430
 ? kthread_create_on_node+0x70/0x70
 ret_from_fork+0x25/0x30
Code: ed fc ff ff 8b 5b 28 4c 89 e7 89 4d b0 89 de e8 2f c5 00 00 8b 4d b0 89 da 48 89 c6 48 c7 c7 78 78 8f c0 0f b7 c9 e8 ab de 8a f7 <0f> ff c7 45 b0 ea ff ff ff e9 81 f8 ff ff 4d 89 f4 48 8b b5 68 
---[ end trace 5ff5af742e33689f ]---
iwlwifi 0000:04:00.0: Error sending MCAST_FILTER_CMD: enqueue_hcmd failed: -22
iwlwifi 0000:04:00.0: mcast filter cmd error. ret=-22



Each additional address added produces a warning:

Command MCAST_FILTER_CMD (0x1d0) is too large (332 bytes)
[...]
Command MCAST_FILTER_CMD (0x1d0) is too large (340 bytes)
[...]
Command MCAST_FILTER_CMD (0x1d0) is too large (344 bytes)
[...]
Command MCAST_FILTER_CMD (0x1d0) is too large (352 bytes)
[...]



device info:
Intel(R) Dual Band Wireless AC 3160, REV=0x164

driver: iwlwifi
version: 4.12.8-2-ARCH
firmware-version: 17.459231.0
expansion-rom-version: 
bus-info: 0000:04:00.0
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no
Comment 1 Luca Coelho 2017-09-01 15:31:12 UTC
I found the issue and will have a patch for testing soon.

Please let me know if you want me to add a "Reported-by" to the patch (with your name, which I don't know ;).
Comment 2 Luca Coelho 2017-09-01 15:36:46 UTC
Created attachment 258171 [details]
Potential fix

Please try this patch to see if the problem goes away.
Comment 3 regwz 2017-09-01 20:29:10 UTC
No kernel warnings with this patch applied (kernel 4.12.10-1-ARCH).

What was tested:
- addding 10 multicast addresses, the ten addresses passed the filter, the address next in sequence did not
- the same with over 50 addresses
- deleting the addresses to see whether they get filtered again; they did

Everything seems OK.

Also, thank you for the offer, but I do not wish to be acknowledged by a Reported-by tag.
Comment 4 Luca Coelho 2017-09-02 05:41:49 UTC
Great, thanks for reporting and testing the fix!

I'll move this patch through our process and it will eventually reach the mainline.
Comment 5 Luca Coelho 2017-09-04 13:19:02 UTC
Patch merged in our internal tree.  It will go upstream soon after the merge window closes.