Re: [PATCH net-next V3 1/2] net: Utility function to get affinity_hint by policy
flat view
From: David Miller <davem@davemloft.net>
Date: 2014-03-07 21:05:27
Amir, although this patch is fine, when I tried to apply this series the second patch (the mlx4 one) did not apply. In fact, that second patch is corrupted, in this hunk: ====================
@@ -1521,6 +1521,31 @@ static void mlx4_en_linkstate(struct work_struct *work) mutex_unlock(&mdev->state_lock); } +static void mlx4_en_init_affinity_hint(struct mlx4_en_priv *priv, int ring_idx) +{ + struct mlx4_en_rx_ring *ring = priv->rx_ring[ring_idx]; + int numa_node = priv->mdev->dev->numa_node; + + if (numa_node == -1) + return; + + if (!zalloc_cpumask_var(&ring->affinity_mask, GFP_KERNEL)) { + en_err(priv, "Failed to allocate core mask\n"); + return; + } + + if (netif_set_rx_queue_affinity_hint(ring_idx, numa_node, + ring->affinity_mask)) { + en_err(priv, "Failed setting affinity hint\n"); + free_cpumask_var(ring->affinity_mask); + ring->affinity_mask = NULL; + } +} + +static void mlx4_en_free_affinity_hint(struct mlx4_en_priv *priv, int ring_idx) +{ + free_cpumask_var(priv->rx_ring[ring_idx]->affinity_mask); + priv->rx_ring[ring_idx]->affinity_mask = NULL; +} int mlx4_en_start_port(struct net_device *dev) {
==================== The hunk header says "before the change there are 6 lines, after the change there are 31 lines" But that's not right, after the change there will be 32 lines. Please respin, thanks.