Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ethernet: octeontx2: avoid linking objects into multiple modules

Each object file contains information about which module it gets linked
into, so linking the same file into multiple modules now causes a warning:

scripts/Makefile.build:254: drivers/net/ethernet/marvell/octeontx2/nic/Makefile: otx2_devlink.o is added to multiple modules: rvu_nicpf rvu_nicvf

Change the way that octeontx2 ethernet is built by moving the common
file into a separate module with exported symbols instead.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://lore.kernel.org/r/20240528152527.2148092-1-arnd@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Arnd Bergmann and committed by
Jakub Kicinski
727c94c9 030fae30

+25 -6
+8 -6
drivers/net/ethernet/marvell/octeontx2/nic/Makefile
··· 3 3 # Makefile for Marvell's RVU Ethernet device drivers 4 4 # 5 5 6 - obj-$(CONFIG_OCTEONTX2_PF) += rvu_nicpf.o otx2_ptp.o 7 - obj-$(CONFIG_OCTEONTX2_VF) += rvu_nicvf.o otx2_ptp.o 6 + obj-$(CONFIG_OCTEONTX2_PF) += rvu_nicpf.o otx2_ptp.o otx2_devlink.o 7 + obj-$(CONFIG_OCTEONTX2_VF) += rvu_nicvf.o otx2_ptp.o otx2_devlink.o 8 8 9 9 rvu_nicpf-y := otx2_pf.o otx2_common.o otx2_txrx.o otx2_ethtool.o \ 10 10 otx2_flows.o otx2_tc.o cn10k.o otx2_dmac_flt.o \ 11 - otx2_devlink.o qos_sq.o qos.o 12 - rvu_nicvf-y := otx2_vf.o otx2_devlink.o 11 + qos_sq.o qos.o 12 + rvu_nicvf-y := otx2_vf.o 13 13 14 - rvu_nicpf-$(CONFIG_DCB) += otx2_dcbnl.o 15 - rvu_nicvf-$(CONFIG_DCB) += otx2_dcbnl.o 14 + ifdef CONFIG_DCB 15 + obj-$(CONFIG_OCTEONTX2_PF) += otx2_dcbnl.o 16 + obj-$(CONFIG_OCTEONTX2_VF) += otx2_dcbnl.o 17 + endif 16 18 rvu_nicpf-$(CONFIG_MACSEC) += cn10k_macsec.o 17 19 18 20 ccflags-y += -I$(srctree)/drivers/net/ethernet/marvell/octeontx2/af
+11
drivers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c
··· 54 54 55 55 return 0; 56 56 } 57 + EXPORT_SYMBOL_GPL(otx2_pfc_txschq_config); 57 58 58 59 static int otx2_pfc_txschq_alloc_one(struct otx2_nic *pfvf, u8 prio) 59 60 { ··· 123 122 124 123 return 0; 125 124 } 125 + EXPORT_SYMBOL_GPL(otx2_pfc_txschq_alloc); 126 126 127 127 static int otx2_pfc_txschq_stop_one(struct otx2_nic *pfvf, u8 prio) 128 128 { ··· 262 260 263 261 return 0; 264 262 } 263 + EXPORT_SYMBOL_GPL(otx2_pfc_txschq_update); 265 264 266 265 int otx2_pfc_txschq_stop(struct otx2_nic *pfvf) 267 266 { ··· 285 282 286 283 return 0; 287 284 } 285 + EXPORT_SYMBOL_GPL(otx2_pfc_txschq_stop); 288 286 289 287 int otx2_config_priority_flow_ctrl(struct otx2_nic *pfvf) 290 288 { ··· 325 321 mutex_unlock(&pfvf->mbox.lock); 326 322 return err; 327 323 } 324 + EXPORT_SYMBOL_GPL(otx2_config_priority_flow_ctrl); 328 325 329 326 void otx2_update_bpid_in_rqctx(struct otx2_nic *pfvf, int vlan_prio, int qidx, 330 327 bool pfc_enable) ··· 390 385 "Updating BPIDs in CQ and Aura contexts of RQ%d failed with err %d\n", 391 386 qidx, err); 392 387 } 388 + EXPORT_SYMBOL_GPL(otx2_update_bpid_in_rqctx); 393 389 394 390 static int otx2_dcbnl_ieee_getpfc(struct net_device *dev, struct ieee_pfc *pfc) 395 391 { ··· 478 472 479 473 return 0; 480 474 } 475 + EXPORT_SYMBOL_GPL(otx2_dcbnl_set_ops); 476 + 477 + MODULE_LICENSE("GPL"); 478 + MODULE_DESCRIPTION("Marvell RVU dcbnl"); 479 + MODULE_AUTHOR("Sunil Goutham <sgoutham@marvell.com>");
+6
drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c
··· 113 113 devlink_free(dl); 114 114 return err; 115 115 } 116 + EXPORT_SYMBOL_GPL(otx2_register_dl); 116 117 117 118 void otx2_unregister_dl(struct otx2_nic *pfvf) 118 119 { ··· 125 124 ARRAY_SIZE(otx2_dl_params)); 126 125 devlink_free(dl); 127 126 } 127 + EXPORT_SYMBOL_GPL(otx2_unregister_dl); 128 + 129 + MODULE_LICENSE("GPL"); 130 + MODULE_DESCRIPTION("Marvell RVU PF/VF Netdev Devlink"); 131 + MODULE_AUTHOR("Sunil Goutham <sgoutham@marvell.com>");