Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2406216rwb; Sat, 19 Nov 2022 15:37:02 -0800 (PST) X-Google-Smtp-Source: AA0mqf4K3nq7qyM0st97fBXvSsqcqt4Sktxxfa7J8zt0vAPWWZyeWUWbuBRkyxsqjWK7YkMVvwTs X-Received: by 2002:a17:906:c40b:b0:7ae:1e53:95b2 with SMTP id u11-20020a170906c40b00b007ae1e5395b2mr10538199ejz.333.1668901022365; Sat, 19 Nov 2022 15:37:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668901022; cv=none; d=google.com; s=arc-20160816; b=Sp/FN7wffmwijqpoRhiUCB8ljuRZvpo55aDMNp6imztLn7SV3oUGcFUdozTNcbgsT3 b9nNf8Opz7EHQBpqMCPQW13qn2T0ZNMwbs1+Nk3EjY3qx71a6MPggD2OJSAOqQg8+wus suuQkHPC83BIFxCFtXpJfxziMV5RR3s/NYAvh+i8ZgK30M+RyLdKjNkUIUwn4x5AaXiv dvID4n0GV/HzkPZYEo/55fREu0jTIRZ2Y6kPGPV5+4lnFpenxNXERfiHbxUinIjmYhyF QtygVR8eBLq20aOsQfBXdd7elAfGsLiSVuzmJrdhEpWqgVXIQqW7gVIyLJ5SL7sEf2FX qIhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :feedback-id:references:in-reply-to:message-id:subject:cc:from:to :dkim-signature:date; bh=lZ7Rs/ZnddACw1jvzs/PqLsltYLTGpkimYjbYKt//JU=; b=GXtfzLs+DSJ3/sGQ59S+gtFQapXQGKlfdziuYi0YYEIa77vpeAdklZZmcazj+5Fc3F CHAYjsPF3E44tWQ+RnyyESWUH59gizwgzeSurEwmyd1jM8rLohNE9iRlGbUKsPb54AZ4 y6RXvow12KEAzES/nTdIYaOQhTMzeWkxMn6W4tQIQcge14Lc9Uc1TyBj6WRCtqdQpLtA q6FdFFiSrtNhp1gT+aqrJAaRXOU/O+ZzFHw+RTtYjnlANzJOJ5pgXH/rYTlz/Ywu/bhA rWfz6/q7KBmPxxbpnLJ2aMyxz9dCBP2vBzZheIxdD9A9aBBBexFBcNhZz+8N4GhCEjGx uImA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail3 header.b=MwkzEn1Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds15-20020a0564021ccf00b00459b51c2b25si6467616edb.438.2022.11.19.15.36.38; Sat, 19 Nov 2022 15:37:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail3 header.b=MwkzEn1Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235376AbiKSXLO (ORCPT + 90 others); Sat, 19 Nov 2022 18:11:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234216AbiKSXKu (ORCPT ); Sat, 19 Nov 2022 18:10:50 -0500 Received: from mail-40133.protonmail.ch (mail-40133.protonmail.ch [185.70.40.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 552451A237; Sat, 19 Nov 2022 15:10:47 -0800 (PST) Date: Sat, 19 Nov 2022 23:10:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail3; t=1668899445; x=1669158645; bh=lZ7Rs/ZnddACw1jvzs/PqLsltYLTGpkimYjbYKt//JU=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=MwkzEn1Z43pI6k3ysRRUAd78NdgilKCbiURPSU97ud6PlYDuD3r4wX6kynsud2BDV FTgz0dIEhO0vqk69Q9ajklQkuUJTQUtv5Kfke1xyFpEpF9rgACfyhr4daSrfsx3B1J NwVytXSux8c4DY7dTJbFnBZ/5qoUCO+b5JS9y9tdhpIdlnUzDdVB481RrUoLPXyFop 7beDz4m4lmYWIDUYmcAC+eEZKejYBokFJWi6hPnMt+kecxCZ+rwCuKqGUI83jvEfX6 Np0bActEFWr2aY6rHGeA31YLT/OZPm6Ym/XQ2GGyRphcbaJSkCAUykj1kUORpfvI1G tMIri4Tqm44TQ== To: linux-kbuild@vger.kernel.org From: Alexander Lobakin Cc: Alexander Lobakin , Masahiro Yamada , Nicolas Schier , Jens Axboe , Boris Brezillon , Borislav Petkov , Tony Luck , Miquel Raynal , Vladimir Oltean , Alexandre Belloni , Derek Chickles , Ioana Ciornei , Salil Mehta , Sunil Goutham , Grygorii Strashko , Daniel Scally , Hans de Goede , Mark Brown , Andy Shevchenko , NXP Linux Team , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 17/18] net: octeontx2: fix mixed module-builtin object Message-ID: <20221119225650.1044591-18-alobakin@pm.me> In-Reply-To: <20221119225650.1044591-1-alobakin@pm.me> References: <20221119225650.1044591-1-alobakin@pm.me> Feedback-ID: 22809121:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With CONFIG_OCTEONTX2_PF=3Dy and CONFIG_OCTEONTX2_VF=3Dm, several object files are linked to a module and also to vmlinux even though the expected CFLAGS are different between builtins and modules. This is the same situation as fixed by commit 637a642f5ca5 ("zstd: Fixing mixed module-builtin objects"). There's also no need to duplicate relatively big piece of object code into two modules. Introduce the new module, rvu_niccommon, to provide the common functions to both rvu_nicpf and rvu_nicvf. Also, otx2_ptp.o was not shared, but built as a standalone module (it was fixed already a year ago the same way this commit does due to link issues). As it's used by both PF and VF modules in the same way, just link it into that new common one. Fixes: 2da489432747 ("octeontx2-pf: devlink params support to set mcam entr= y count") Fixes: 8e67558177f8 ("octeontx2-pf: PFC config support with DCBx") Suggested-by: Masahiro Yamada Signed-off-by: Alexander Lobakin --- drivers/net/ethernet/marvell/octeontx2/Kconfig | 5 +++++ .../net/ethernet/marvell/octeontx2/nic/Makefile | 14 +++++++------- .../ethernet/marvell/octeontx2/nic/otx2_common.h | 1 - .../ethernet/marvell/octeontx2/nic/otx2_dcbnl.c | 8 +++++++- .../ethernet/marvell/octeontx2/nic/otx2_devlink.c | 2 ++ .../net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 2 ++ .../net/ethernet/marvell/octeontx2/nic/otx2_ptp.c | 2 +- .../net/ethernet/marvell/octeontx2/nic/otx2_vf.c | 2 ++ 8 files changed, 26 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/Kconfig b/drivers/net/e= thernet/marvell/octeontx2/Kconfig index 6b4f640163f7..eb03bdcaf606 100644 --- a/drivers/net/ethernet/marvell/octeontx2/Kconfig +++ b/drivers/net/ethernet/marvell/octeontx2/Kconfig @@ -28,8 +28,12 @@ config NDC_DIS_DYNAMIC_CACHING =09 , NPA stack pages etc in NDC. Also locks down NIX SQ/CQ/RQ/RSS and =09 NPA Aura/Pool contexts. +config OCTEONTX2_NIC_COMMON +=09tristate + config OCTEONTX2_PF =09tristate "Marvell OcteonTX2 NIC Physical Function driver" +=09select OCTEONTX2_NIC_COMMON =09select OCTEONTX2_MBOX =09select NET_DEVLINK =09depends on MACSEC || !MACSEC @@ -44,5 +48,6 @@ config OCTEONTX2_PF config OCTEONTX2_VF =09tristate "Marvell OcteonTX2 NIC Virtual Function driver" =09depends on OCTEONTX2_PF +=09select OCTEONTX2_NIC_COMMON =09help =09 This driver supports Marvell's OcteonTX2 NIC virtual function. diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/Makefile b/drivers/= net/ethernet/marvell/octeontx2/nic/Makefile index 73fdb8798614..040c841645bd 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/Makefile +++ b/drivers/net/ethernet/marvell/octeontx2/nic/Makefile @@ -3,16 +3,16 @@ # Makefile for Marvell's RVU Ethernet device drivers # -obj-$(CONFIG_OCTEONTX2_PF) +=3D rvu_nicpf.o otx2_ptp.o -obj-$(CONFIG_OCTEONTX2_VF) +=3D rvu_nicvf.o otx2_ptp.o +obj-$(CONFIG_OCTEONTX2_NIC_COMMON) +=3D rvu_niccommon.o +obj-$(CONFIG_OCTEONTX2_PF) +=3D rvu_nicpf.o +obj-$(CONFIG_OCTEONTX2_VF) +=3D rvu_nicvf.o +rvu_niccommon-y :=3D otx2_devlink.o otx2_ptp.o rvu_nicpf-y :=3D otx2_pf.o otx2_common.o otx2_txrx.o otx2_ethtool.o \ - otx2_flows.o otx2_tc.o cn10k.o otx2_dmac_flt.o \ - otx2_devlink.o -rvu_nicvf-y :=3D otx2_vf.o otx2_devlink.o + otx2_flows.o otx2_tc.o cn10k.o otx2_dmac_flt.o +rvu_nicvf-y :=3D otx2_vf.o -rvu_nicpf-$(CONFIG_DCB) +=3D otx2_dcbnl.o -rvu_nicvf-$(CONFIG_DCB) +=3D otx2_dcbnl.o +rvu_niccommon-$(CONFIG_DCB) +=3D otx2_dcbnl.o rvu_nicpf-$(CONFIG_MACSEC) +=3D cn10k_macsec.o ccflags-y +=3D -I$(srctree)/drivers/net/ethernet/marvell/octeontx2/af diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h b/dri= vers/net/ethernet/marvell/octeontx2/nic/otx2_common.h index 282db6fe3b08..06307000cfd1 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h @@ -1018,7 +1018,6 @@ int otx2_dcbnl_set_ops(struct net_device *dev); /* PFC support */ int otx2_pfc_txschq_config(struct otx2_nic *pfvf); int otx2_pfc_txschq_alloc(struct otx2_nic *pfvf); -int otx2_pfc_txschq_update(struct otx2_nic *pfvf); int otx2_pfc_txschq_stop(struct otx2_nic *pfvf); #endif diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c b/driv= ers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c index ccaf97bb1ce0..8e862785325d 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c @@ -54,6 +54,7 @@ int otx2_pfc_txschq_config(struct otx2_nic *pfvf) =09return 0; } +EXPORT_SYMBOL_NS_GPL(otx2_pfc_txschq_config, OCTEONTX2_NIC_COMMON); static int otx2_pfc_txschq_alloc_one(struct otx2_nic *pfvf, u8 prio) { @@ -122,6 +123,7 @@ int otx2_pfc_txschq_alloc(struct otx2_nic *pfvf) =09return 0; } +EXPORT_SYMBOL_NS_GPL(otx2_pfc_txschq_alloc, OCTEONTX2_NIC_COMMON); static int otx2_pfc_txschq_stop_one(struct otx2_nic *pfvf, u8 prio) { @@ -201,7 +203,7 @@ static int otx2_pfc_update_sq_smq_mapping(struct otx2_n= ic *pfvf, int prio) =09return 0; } -int otx2_pfc_txschq_update(struct otx2_nic *pfvf) +static int otx2_pfc_txschq_update(struct otx2_nic *pfvf) { =09bool if_up =3D netif_running(pfvf->netdev); =09u8 pfc_en =3D pfvf->pfc_en, pfc_bit_set; @@ -289,6 +291,7 @@ int otx2_pfc_txschq_stop(struct otx2_nic *pfvf) =09return 0; } +EXPORT_SYMBOL_NS_GPL(otx2_pfc_txschq_stop, OCTEONTX2_NIC_COMMON); int otx2_config_priority_flow_ctrl(struct otx2_nic *pfvf) { @@ -328,6 +331,7 @@ int otx2_config_priority_flow_ctrl(struct otx2_nic *pfv= f) =09mutex_unlock(&pfvf->mbox.lock); =09return err; } +EXPORT_SYMBOL_NS_GPL(otx2_config_priority_flow_ctrl, OCTEONTX2_NIC_COMMON)= ; void otx2_update_bpid_in_rqctx(struct otx2_nic *pfvf, int vlan_prio, int q= idx, =09=09=09 bool pfc_enable) @@ -392,6 +396,7 @@ void otx2_update_bpid_in_rqctx(struct otx2_nic *pfvf, i= nt vlan_prio, int qidx, =09=09=09 "Updating BPIDs in CQ and Aura contexts of RQ%d failed with err = %d\n", =09=09=09 qidx, err); } +EXPORT_SYMBOL_NS_GPL(otx2_update_bpid_in_rqctx, OCTEONTX2_NIC_COMMON); static int otx2_dcbnl_ieee_getpfc(struct net_device *dev, struct ieee_pfc = *pfc) { @@ -468,3 +473,4 @@ int otx2_dcbnl_set_ops(struct net_device *dev) =09return 0; } +EXPORT_SYMBOL_NS_GPL(otx2_dcbnl_set_ops, OCTEONTX2_NIC_COMMON); diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c b/dr= ivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c index 777a27047c8e..73cbedb861f3 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c @@ -128,6 +128,7 @@ int otx2_register_dl(struct otx2_nic *pfvf) =09devlink_free(dl); =09return err; } +EXPORT_SYMBOL_NS_GPL(otx2_register_dl, OCTEONTX2_NIC_COMMON); void otx2_unregister_dl(struct otx2_nic *pfvf) { @@ -139,3 +140,4 @@ void otx2_unregister_dl(struct otx2_nic *pfvf) =09=09=09=09 ARRAY_SIZE(otx2_dl_params)); =09devlink_free(dl); } +EXPORT_SYMBOL_NS_GPL(otx2_unregister_dl, OCTEONTX2_NIC_COMMON); diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drivers= /net/ethernet/marvell/octeontx2/nic/otx2_pf.c index 303930499a4c..11e3ccee61c1 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c @@ -34,6 +34,8 @@ static const struct pci_device_id otx2_pf_id_table[] =3D = { =09{ 0, } /* end of table */ }; +MODULE_IMPORT_NS(OCTEONTX2_NIC_COMMON); + MODULE_AUTHOR("Sunil Goutham "); MODULE_DESCRIPTION(DRV_STRING); MODULE_LICENSE("GPL v2"); diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ptp.c b/driver= s/net/ethernet/marvell/octeontx2/nic/otx2_ptp.c index 896b2f9bac34..ef48f50d3771 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ptp.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ptp.c @@ -394,5 +394,5 @@ int otx2_ptp_tstamp2time(struct otx2_nic *pfvf, u64 tst= amp, u64 *tsns) EXPORT_SYMBOL_GPL(otx2_ptp_tstamp2time); MODULE_AUTHOR("Sunil Goutham "); -MODULE_DESCRIPTION("Marvell RVU NIC PTP Driver"); +MODULE_DESCRIPTION("Marvell RVU NIC Common Module"); MODULE_LICENSE("GPL v2"); diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c b/drivers= /net/ethernet/marvell/octeontx2/nic/otx2_vf.c index 86653bb8e403..59ec45e16637 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c @@ -24,6 +24,8 @@ static const struct pci_device_id otx2_vf_id_table[] =3D = { =09{ } }; +MODULE_IMPORT_NS(OCTEONTX2_NIC_COMMON); + MODULE_AUTHOR("Sunil Goutham "); MODULE_DESCRIPTION(DRV_STRING); MODULE_LICENSE("GPL v2"); -- 2.38.1