Commit 132f743b authored by Antoine Tenart's avatar Antoine Tenart Committed by David S. Miller
Browse files

net: improve queue removal readability in __netif_set_xps_queue



Improve the readability of the loop removing tx-queue from unused
CPUs/rx-queues in __netif_set_xps_queue. The change should only be
cosmetic.

Signed-off-by: default avatarAntoine Tenart <atenart@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 402fbb99
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -2784,14 +2784,17 @@ int __netif_set_xps_queue(struct net_device *dev, const unsigned long *mask,

	/* removes tx-queue from unused CPUs/rx-queues */
	for (j = 0; j < dev_maps->nr_ids; j++) {
		for (i = tc, tci = j * dev_maps->num_tc; i--; tci++)
			active |= remove_xps_queue(dev_maps, tci, index);
		if (!netif_attr_test_mask(j, mask, dev_maps->nr_ids) ||
		    !netif_attr_test_online(j, online_mask, dev_maps->nr_ids))
			active |= remove_xps_queue(dev_maps, tci, index);
		for (i = dev_maps->num_tc - tc, tci++; --i; tci++)
		tci = j * dev_maps->num_tc;

		for (i = 0; i < dev_maps->num_tc; i++, tci++) {
			if (i == tc &&
			    netif_attr_test_mask(j, mask, dev_maps->nr_ids) &&
			    netif_attr_test_online(j, online_mask, dev_maps->nr_ids))
				continue;

			active |= remove_xps_queue(dev_maps, tci, index);
		}
	}

	/* free map if not active */
	if (!active)