From patchwork Tue Mar 8 04:53:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitris Michailidis X-Patchwork-Id: 12772958 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 217B5C433EF for ; Tue, 8 Mar 2022 04:53:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232005AbiCHEyX (ORCPT ); Mon, 7 Mar 2022 23:54:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230105AbiCHEyW (ORCPT ); Mon, 7 Mar 2022 23:54:22 -0500 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD37E33A17 for ; Mon, 7 Mar 2022 20:53:23 -0800 (PST) Received: by mail-pg1-x52c.google.com with SMTP id t14so15427644pgr.3 for ; Mon, 07 Mar 2022 20:53:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fungible.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=YLOswqucgq3fVrf2Aqd5XvgTNGay1SYRoqe0PXuwbsU=; b=Ys//bkPyTmDAUbdEnhCcf4CAoZO3FzyXlCdzZkxAH2gGLdobQKDklmS/6uTLscwfGD ZJ0I7UjZKByq3L62r4v1/OVR7fO8khInqxlQNPgGG+U2kKV2F90rFHx+ejypu8CqI+l+ 8x9vjITkWxLKdkzPibQGPicudoWW8A6K1uNik= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=YLOswqucgq3fVrf2Aqd5XvgTNGay1SYRoqe0PXuwbsU=; b=UDHndnsVCvtMC/tPEUfSQAodRRCstXbIgdSqWBV771wmbL6yaz5sXJGwul7qQntVOA KKjtH4/WxQ/ku6bNFAzhynSPF0QKcNcn5rK3w/PsmTrAvcg8d5/6xr5gEYDGq/ecGlU/ /5oerz3l8e9lAvjQNJmqjJQzXEOd0A2nUC282J4F+AVRw9q82SMe3ExiArNrIlpYOfsY QN3+btiO7e1bOI9puy/Y0i7g3G1UyEZg1kARUd5ySj6tr9xJqeGcyOzI69/+5/naLrCC 0yNxS2Cz4Pn0ingSW8nrdwaU17wA2VEhyCdFArgV7jay8SsrDrHdv7eB66ViwX+QRped puhQ== X-Gm-Message-State: AOAM532r0NwwZ1TZnl2Y8uH58h9ridncr7N3K07Bmh0TTRqFqQsKC6KG eraKNOMaLQaNR4fmfZowMnX3LGPXY1NqlQ== X-Google-Smtp-Source: ABdhPJyFofTCsVY80vW5l+2jBbXEhaz9JdYlAgpO3mK8B3TOsnAawdHRO7Chw47D8IyzQL/U+X8sLQ== X-Received: by 2002:a63:28c:0:b0:380:9751:8135 with SMTP id 134-20020a63028c000000b0038097518135mr190716pgc.576.1646715203314; Mon, 07 Mar 2022 20:53:23 -0800 (PST) Received: from cab09-qa-09.fungible.local ([12.190.10.11]) by smtp.gmail.com with ESMTPSA id t5-20020a654b85000000b00373cbfbf965sm13505350pgq.46.2022.03.07.20.53.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 20:53:22 -0800 (PST) From: Dimitris Michailidis X-Google-Original-From: Dimitris Michailidis To: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, d.michailidis@fungible.com Cc: Stephen Rothwell Subject: [PATCH net-next] net/fungible: Fix local_memory_node error Date: Mon, 7 Mar 2022 20:53:21 -0800 Message-Id: <20220308045321.2843-1-dmichail@fungible.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Stephen Rothwell reported the following failure on powerpc: ERROR: modpost: ".local_memory_node" [drivers/net/ethernet/fungible/funeth/funeth.ko] undefined! AFAICS this is because local_memory_node() is a non-inline non-exported function when CONFIG_HAVE_MEMORYLESS_NODES=y. It is also the wrong API to get a CPU's memory node. Use cpu_to_mem() in the two spots it's used. Fixes: ee6373ddf3a9 ("net/funeth: probing and netdev ops") Fixes: db37bc177dae ("net/funeth: add the data path") Reported-by: Stephen Rothwell Signed-off-by: Dimitris Michailidis --- drivers/net/ethernet/fungible/funeth/funeth_main.c | 2 +- drivers/net/ethernet/fungible/funeth/funeth_txrx.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/fungible/funeth/funeth_main.c b/drivers/net/ethernet/fungible/funeth/funeth_main.c index c58b10c216ef..67dd02ed1fa3 100644 --- a/drivers/net/ethernet/fungible/funeth/funeth_main.c +++ b/drivers/net/ethernet/fungible/funeth/funeth_main.c @@ -253,7 +253,7 @@ static struct fun_irq *fun_alloc_qirq(struct funeth_priv *fp, unsigned int idx, int cpu, res; cpu = cpumask_local_spread(idx, node); - node = local_memory_node(cpu_to_node(cpu)); + node = cpu_to_mem(cpu); irq = kzalloc_node(sizeof(*irq), GFP_KERNEL, node); if (!irq) diff --git a/drivers/net/ethernet/fungible/funeth/funeth_txrx.h b/drivers/net/ethernet/fungible/funeth/funeth_txrx.h index 7aed0561aeac..04c9f91b7489 100644 --- a/drivers/net/ethernet/fungible/funeth/funeth_txrx.h +++ b/drivers/net/ethernet/fungible/funeth/funeth_txrx.h @@ -239,7 +239,7 @@ static inline void fun_txq_wr_db(const struct funeth_txq *q) static inline int fun_irq_node(const struct fun_irq *p) { - return local_memory_node(cpu_to_node(cpumask_first(&p->affinity_mask))); + return cpu_to_mem(cpumask_first(&p->affinity_mask)); } int fun_rxq_napi_poll(struct napi_struct *napi, int budget);