From: Shradha Shah <sshah@solarflare•com>
To: David Miller <davem@davemloft•net>
Cc: <netdev@vger•kernel.org>, <linux-net-drivers@solarflare•com>
Subject: [PATCH net-next 3/4] sfc: Use cpu_to_mem() to support memoryless nodes
Date: Wed, 28 Oct 2015 15:01:51 +0000 [thread overview]
Message-ID: <5630E35F.5060706@solarflare.com> (raw)
In-Reply-To: <5630E2FD.3070609@solarflare.com>
From: Bert Kenward <bkenward@solarflare•com>
With CONFIG_HAVE_MEMORYLESS_NODES cpu_to_node() may return
nodes without memory, which is not a good choice when later
using that to allocate memory. cpu_to_mem() instead provides
the most appropriate NUMA node to allocate from.
Signed-off-by: Shradha Shah <sshah@solarflare•com>
---
drivers/net/ethernet/sfc/efx.c | 2 +-
drivers/net/ethernet/sfc/net_driver.h | 4 ++--
drivers/net/ethernet/sfc/rx.c | 3 ++-
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 89fbd03..84f9e90 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -445,7 +445,7 @@ efx_alloc_channel(struct efx_nic *efx, int i, struct efx_channel *old_channel)
channel->efx = efx;
channel->channel = i;
channel->type = &efx_default_channel_type;
- channel->irq_node = NUMA_NO_NODE;
+ channel->irq_mem_node = NUMA_NO_NODE;
for (j = 0; j < EFX_TXQ_TYPES; j++) {
tx_queue = &channel->tx_queue[j];
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h
index 0ab9080a..bab6cc0 100644
--- a/drivers/net/ethernet/sfc/net_driver.h
+++ b/drivers/net/ethernet/sfc/net_driver.h
@@ -419,7 +419,7 @@ enum efx_sync_events_state {
* @sync_events_state: Current state of sync events on this channel
* @sync_timestamp_major: Major part of the last ptp sync event
* @sync_timestamp_minor: Minor part of the last ptp sync event
- * @irq_node: NUMA node of interrupt
+ * @irq_mem_node: Memory NUMA node of interrupt
*/
struct efx_channel {
struct efx_nic *efx;
@@ -479,7 +479,7 @@ struct efx_channel {
u32 sync_timestamp_major;
u32 sync_timestamp_minor;
- int irq_node;
+ int irq_mem_node;
};
#ifdef CONFIG_NET_RX_BUSY_POLL
diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c
index c5ef1e8..095d1af 100644
--- a/drivers/net/ethernet/sfc/rx.c
+++ b/drivers/net/ethernet/sfc/rx.c
@@ -171,7 +171,8 @@ static int efx_init_rx_buffers(struct efx_rx_queue *rx_queue, bool atomic)
struct efx_channel *channel;
channel = efx_rx_queue_channel(rx_queue);
- page = alloc_pages_node(channel->irq_node, __GFP_COMP |
+ page = alloc_pages_node(channel->irq_mem_node,
+ __GFP_COMP |
(atomic ?
(GFP_ATOMIC | __GFP_NOWARN)
: GFP_KERNEL),
next prev parent reply other threads:[~2015-10-28 15:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-28 15:00 [PATCH net-next 0/4] sfc: NUMA support Shradha Shah
2015-10-28 15:01 ` [PATCH net-next 1/4] sfc: use __GFP_NOWARN when allocating RX pages from atomic context Shradha Shah
2015-10-28 15:01 ` [PATCH net-next 2/4] sfc: allocate rx pages on the same node as the interrupt Shradha Shah
2015-10-28 15:59 ` Eric Dumazet
2015-11-02 13:17 ` Daniel Pieczko (dpieczko)
2015-10-28 15:01 ` Shradha Shah [this message]
2015-10-28 15:02 ` [PATCH net-next 4/4] sfc: set and clear interrupt affinity hints Shradha Shah
2015-10-28 18:15 ` Sergei Shtylyov
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=5630E35F.5060706@solarflare.com \
--to=sshah@solarflare$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=linux-net-drivers@solarflare$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox