From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Benjamin Poirier <bpoirier@suse.de>,
Ido Shamay <idos@mellanox.com>,
"David S. Miller" <davem@davemloft.net>
Subject: [PATCH 3.19 3/7] mlx4: Fix tx ring affinity_mask creation
Date: Fri, 8 May 2015 13:12:22 +0200 [thread overview]
Message-ID: <20150508111055.311610443@linuxfoundation.org> (raw)
In-Reply-To: <20150508111054.717693099@linuxfoundation.org>
3.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Poirier <bpoirier@suse.de>
[ Upstream commit 42eab005a5dd5d7ea2b0328aecc4d6cc0c23c9c2 ]
By default, the number of tx queues is limited by the number of online cpus
in mlx4_en_get_profile(). However, this limit no longer holds after the
ethtool .set_channels method has been called. In that situation, the driver
may access invalid bits of certain cpumask variables when queue_index >=
nr_cpu_ids.
Signed-off-by: Benjamin Poirier <bpoirier@suse.de>
Acked-by: Ido Shamay <idos@mellanox.com>
Fixes: d03a68f ("net/mlx4_en: Configure the XPS queue mapping on driver load")
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/mellanox/mlx4/en_tx.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
--- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
@@ -143,8 +143,10 @@ int mlx4_en_create_tx_ring(struct mlx4_e
ring->hwtstamp_tx_type = priv->hwtstamp_config.tx_type;
ring->queue_index = queue_index;
- if (queue_index < priv->num_tx_rings_p_up && cpu_online(queue_index))
- cpumask_set_cpu(queue_index, &ring->affinity_mask);
+ if (queue_index < priv->num_tx_rings_p_up)
+ cpumask_set_cpu_local_first(queue_index,
+ priv->mdev->dev->numa_node,
+ &ring->affinity_mask);
*pring = ring;
return 0;
@@ -213,7 +215,7 @@ int mlx4_en_activate_tx_ring(struct mlx4
err = mlx4_qp_to_ready(mdev->dev, &ring->wqres.mtt, &ring->context,
&ring->qp, &ring->qp_state);
- if (!user_prio && cpu_online(ring->queue_index))
+ if (!cpumask_empty(&ring->affinity_mask))
netif_set_xps_queue(priv->dev, &ring->affinity_mask,
ring->queue_index);
next prev parent reply other threads:[~2015-05-08 11:12 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-08 11:12 [PATCH 3.19 0/7] 3.19.8-stable review Greg Kroah-Hartman
2015-05-08 11:12 ` [PATCH 3.19 1/7] bpf: fix 64-bit divide Greg Kroah-Hartman
2015-05-08 11:12 ` [PATCH 3.19 2/7] route: Use ipv4_mtu instead of raw rt_pmtu Greg Kroah-Hartman
2015-05-08 11:12 ` Greg Kroah-Hartman [this message]
2015-05-08 11:12 ` [PATCH 3.19 4/7] cxgb4: Fix MC1 memory offset calculation Greg Kroah-Hartman
2015-05-08 11:12 ` [PATCH 3.19 5/7] net/mlx4_en: Schedule napi when RX buffers allocation fails Greg Kroah-Hartman
2015-05-08 11:12 ` [PATCH 3.19 6/7] ipv4: Missing sk_nulls_node_init() in ping_unhash() Greg Kroah-Hartman
2015-05-08 11:12 ` [PATCH 3.19 7/7] clk: at91: usb: fix determine_rate prototype Greg Kroah-Hartman
2015-05-08 15:14 ` [PATCH 3.19 0/7] 3.19.8-stable review Shuah Khan
2015-05-08 20:45 ` Greg Kroah-Hartman
2015-05-08 18:51 ` Guenter Roeck
2015-05-08 20:45 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150508111055.311610443@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=bpoirier@suse.de \
--cc=davem@davemloft.net \
--cc=idos@mellanox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.