summaryrefslogtreecommitdiffstats
path: root/include/target/target_core_fabric.h
diff options
context:
space:
mode:
authorSabrina Dubroca2018-11-29 14:14:49 +0100
committerDavid S. Miller2018-11-29 20:06:08 +0100
commit867d0ad476db89a1e8af3f297af402399a54eea5 (patch)
tree075055a7fd00fe41bc76ba070136c7765cf282c6 /include/target/target_core_fabric.h
parentnet: restore call to netdev_queue_numa_node_write when resetting XPS (diff)
downloadkernel-qcow2-linux-867d0ad476db89a1e8af3f297af402399a54eea5.tar.gz
kernel-qcow2-linux-867d0ad476db89a1e8af3f297af402399a54eea5.tar.xz
kernel-qcow2-linux-867d0ad476db89a1e8af3f297af402399a54eea5.zip
net: fix XPS static_key accounting
Commit 04157469b7b8 ("net: Use static_key for XPS maps") introduced a static key for XPS, but the increments/decrements don't match. First, the static key's counter is incremented once for each queue, but only decremented once for a whole batch of queues, leading to large unbalances. Second, the xps_rxqs_needed key is decremented whenever we reset a batch of queues, whether they had any rxqs mapping or not, so that if we setup cpu-XPS on em1 and RXQS-XPS on em2, resetting the queues on em1 would decrement the xps_rxqs_needed key. This reworks the accounting scheme so that the xps_needed key is incremented only once for each type of XPS for all the queues on a device, and the xps_rxqs_needed key is incremented only once for all queues. This is sufficient to let us retrieve queues via get_xps_queue(). This patch introduces a new reset_xps_maps(), which reinitializes and frees the appropriate map (xps_rxqs_map or xps_cpus_map), and drops a reference to the needed keys: - both xps_needed and xps_rxqs_needed, in case of rxqs maps, - only xps_needed, in case of CPU maps. Now, we also need to call reset_xps_maps() at the end of __netif_set_xps_queue() when there's no active map left, for example when writing '00000000,00000000' to all queues' xps_rxqs setting. Fixes: 04157469b7b8 ("net: Use static_key for XPS maps") Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/target/target_core_fabric.h')
0 files changed, 0 insertions, 0 deletions