From patchwork Wed Oct 28 15:01:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shradha Shah X-Patchwork-Id: 537398 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 6E24B1402B9 for ; Thu, 29 Oct 2015 02:02:10 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755485AbbJ1PCF (ORCPT ); Wed, 28 Oct 2015 11:02:05 -0400 Received: from nbfkord-smmo02.seg.att.com ([209.65.160.78]:12472 "EHLO nbfkord-smmo02.seg.att.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753192AbbJ1PCE (ORCPT ); Wed, 28 Oct 2015 11:02:04 -0400 Received: from unknown [12.187.104.26] (EHLO webmail.solarflare.com) by nbfkord-smmo02.seg.att.com(mxl_mta-7.2.4-5) with ESMTP id b63e0365.2b7fbe23c940.3107025.00-2462.7618472.nbfkord-smmo02.seg.att.com (envelope-from ); Wed, 28 Oct 2015 15:02:03 +0000 (UTC) X-MXL-Hash: 5630e36b0cdc5ea7-4a706e07a271eab50381210016cd2ed34376f69f Received: from unknown [12.187.104.26] (EHLO webmail.solarflare.com) by nbfkord-smmo02.seg.att.com(mxl_mta-7.2.4-5) over TLS secured channel with ESMTP id 963e0365.0.3107017.00-1938.7618441.nbfkord-smmo02.seg.att.com (envelope-from ); Wed, 28 Oct 2015 15:02:02 +0000 (UTC) X-MXL-Hash: 5630e36a3080ccc4-848fc555a7f85e038a20ec1545d52debfceeae2a Received: from sshah-desktop.uk.level5networks.com (10.17.20.135) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Wed, 28 Oct 2015 08:01:54 -0700 From: Shradha Shah Subject: [PATCH net-next 3/4] sfc: Use cpu_to_mem() to support memoryless nodes To: David Miller References: <5630E2FD.3070609@solarflare.com> CC: , Message-ID: <5630E35F.5060706@solarflare.com> Date: Wed, 28 Oct 2015 15:01:51 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <5630E2FD.3070609@solarflare.com> X-Originating-IP: [10.17.20.135] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ocex03.SolarFlarecom.com (10.20.40.36) X-AnalysisOut: [v=2.0 cv=erhoOPVX c=1 sm=1 a=8BlWFWvVlq5taO8ncb8nKg==:17 a] X-AnalysisOut: [=zRKbQ67AAAAA:8 a=3VnyBeAh6Z0A:10 a=5lJygRwiOn0A:10 a=zT6I] X-AnalysisOut: [j1Rd-Tw9po6q6ZIA:9 a=pILNOxqGKmIA:10] X-Spam: [F=0.2000000000; CM=0.500; S=0.200(2015072901)] X-MAIL-FROM: X-SOURCE-IP: [12.187.104.26] Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Bert Kenward 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 --- 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(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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),