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.

hns3: 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/hisilicon/hns3/Makefile: hns3_common/hclge_comm_cmd.o is added to multiple modules: hclge hclgevf
scripts/Makefile.build:254: drivers/net/ethernet/hisilicon/hns3/Makefile: hns3_common/hclge_comm_rss.o is added to multiple modules: hclge hclgevf
scripts/Makefile.build:254: drivers/net/ethernet/hisilicon/hns3/Makefile: hns3_common/hclge_comm_tqp_stats.o is added to multiple modules: hclge hclgevf

Change the way that hns3 is built by moving the three common files into a
separate module with exported symbols instead.

Fixes: 5f20be4e90e6 ("net: hns3: refactor hns3 makefile to support hns3_common module")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://lore.kernel.org/r/20240528161603.2443125-1-arnd@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Arnd Bergmann and committed by
Jakub Kicinski
e3bbb994 727c94c9

+35 -6
+5 -6
drivers/net/ethernet/hisilicon/hns3/Makefile
··· 15 15 16 16 hns3-$(CONFIG_HNS3_DCB) += hns3_dcbnl.o 17 17 18 - obj-$(CONFIG_HNS3_HCLGEVF) += hclgevf.o 18 + obj-$(CONFIG_HNS3_HCLGEVF) += hclgevf.o hclge-common.o 19 19 20 - hclgevf-objs = hns3vf/hclgevf_main.o hns3vf/hclgevf_mbx.o hns3vf/hclgevf_devlink.o hns3vf/hclgevf_regs.o \ 21 - hns3_common/hclge_comm_cmd.o hns3_common/hclge_comm_rss.o hns3_common/hclge_comm_tqp_stats.o 20 + hclge-common-objs += hns3_common/hclge_comm_cmd.o hns3_common/hclge_comm_rss.o hns3_common/hclge_comm_tqp_stats.o 22 21 23 - obj-$(CONFIG_HNS3_HCLGE) += hclge.o 22 + hclgevf-objs = hns3vf/hclgevf_main.o hns3vf/hclgevf_mbx.o hns3vf/hclgevf_devlink.o hns3vf/hclgevf_regs.o 23 + 24 + obj-$(CONFIG_HNS3_HCLGE) += hclge.o hclge-common.o 24 25 hclge-objs = hns3pf/hclge_main.o hns3pf/hclge_mdio.o hns3pf/hclge_tm.o hns3pf/hclge_regs.o \ 25 26 hns3pf/hclge_mbx.o hns3pf/hclge_err.o hns3pf/hclge_debugfs.o hns3pf/hclge_ptp.o hns3pf/hclge_devlink.o \ 26 - hns3_common/hclge_comm_cmd.o hns3_common/hclge_comm_rss.o hns3_common/hclge_comm_tqp_stats.o 27 - 28 27 29 28 hclge-$(CONFIG_HNS3_DCB) += hns3pf/hclge_dcb.o
+11
drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.c
··· 48 48 else 49 49 desc->flag &= cpu_to_le16(~HCLGE_COMM_CMD_FLAG_WR); 50 50 } 51 + EXPORT_SYMBOL_GPL(hclge_comm_cmd_reuse_desc); 51 52 52 53 static void hclge_comm_set_default_capability(struct hnae3_ae_dev *ae_dev, 53 54 bool is_pf) ··· 73 72 if (is_read) 74 73 desc->flag |= cpu_to_le16(HCLGE_COMM_CMD_FLAG_WR); 75 74 } 75 + EXPORT_SYMBOL_GPL(hclge_comm_cmd_setup_basic_desc); 76 76 77 77 int hclge_comm_firmware_compat_config(struct hnae3_ae_dev *ae_dev, 78 78 struct hclge_comm_hw *hw, bool en) ··· 519 517 520 518 return ret; 521 519 } 520 + EXPORT_SYMBOL_GPL(hclge_comm_cmd_send); 522 521 523 522 static void hclge_comm_cmd_uninit_regs(struct hclge_comm_hw *hw) 524 523 { ··· 556 553 hclge_comm_free_cmd_desc(&cmdq->csq); 557 554 hclge_comm_free_cmd_desc(&cmdq->crq); 558 555 } 556 + EXPORT_SYMBOL_GPL(hclge_comm_cmd_uninit); 559 557 560 558 int hclge_comm_cmd_queue_init(struct pci_dev *pdev, struct hclge_comm_hw *hw) 561 559 { ··· 595 591 hclge_comm_free_cmd_desc(&hw->cmq.csq); 596 592 return ret; 597 593 } 594 + EXPORT_SYMBOL_GPL(hclge_comm_cmd_queue_init); 598 595 599 596 void hclge_comm_cmd_init_ops(struct hclge_comm_hw *hw, 600 597 const struct hclge_comm_cmq_ops *ops) ··· 607 602 cmdq->ops.trace_cmd_get = ops->trace_cmd_get; 608 603 } 609 604 } 605 + EXPORT_SYMBOL_GPL(hclge_comm_cmd_init_ops); 610 606 611 607 int hclge_comm_cmd_init(struct hnae3_ae_dev *ae_dev, struct hclge_comm_hw *hw, 612 608 u32 *fw_version, bool is_pf, ··· 678 672 679 673 return ret; 680 674 } 675 + EXPORT_SYMBOL_GPL(hclge_comm_cmd_init); 676 + 677 + MODULE_LICENSE("GPL"); 678 + MODULE_DESCRIPTION("HNS3: Hisilicon Ethernet PF/VF Common Library"); 679 + MODULE_AUTHOR("Huawei Tech. Co., Ltd.");
+14
drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_rss.c
··· 62 62 63 63 return 0; 64 64 } 65 + EXPORT_SYMBOL_GPL(hclge_comm_rss_init_cfg); 65 66 66 67 void hclge_comm_get_rss_tc_info(u16 rss_size, u8 hw_tc_map, u16 *tc_offset, 67 68 u16 *tc_valid, u16 *tc_size) ··· 79 78 tc_offset[i] = (hw_tc_map & BIT(i)) ? rss_size * i : 0; 80 79 } 81 80 } 81 + EXPORT_SYMBOL_GPL(hclge_comm_get_rss_tc_info); 82 82 83 83 int hclge_comm_set_rss_tc_mode(struct hclge_comm_hw *hw, u16 *tc_offset, 84 84 u16 *tc_valid, u16 *tc_size) ··· 115 113 116 114 return ret; 117 115 } 116 + EXPORT_SYMBOL_GPL(hclge_comm_set_rss_tc_mode); 118 117 119 118 int hclge_comm_set_rss_hash_key(struct hclge_comm_rss_cfg *rss_cfg, 120 119 struct hclge_comm_hw *hw, const u8 *key, ··· 146 143 147 144 return 0; 148 145 } 146 + EXPORT_SYMBOL_GPL(hclge_comm_set_rss_hash_key); 149 147 150 148 int hclge_comm_set_rss_tuple(struct hnae3_ae_dev *ae_dev, 151 149 struct hclge_comm_hw *hw, ··· 189 185 rss_cfg->rss_tuple_sets.ipv6_fragment_en = req->ipv6_fragment_en; 190 186 return 0; 191 187 } 188 + EXPORT_SYMBOL_GPL(hclge_comm_set_rss_tuple); 192 189 193 190 u32 hclge_comm_get_rss_key_size(struct hnae3_handle *handle) 194 191 { 195 192 return HCLGE_COMM_RSS_KEY_SIZE; 196 193 } 194 + EXPORT_SYMBOL_GPL(hclge_comm_get_rss_key_size); 197 195 198 196 int hclge_comm_parse_rss_hfunc(struct hclge_comm_rss_cfg *rss_cfg, 199 197 const u8 hfunc, u8 *hash_algo) ··· 223 217 for (i = 0; i < ae_dev->dev_specs.rss_ind_tbl_size; i++) 224 218 rss_cfg->rss_indirection_tbl[i] = i % rss_cfg->rss_size; 225 219 } 220 + EXPORT_SYMBOL_GPL(hclge_comm_rss_indir_init_cfg); 226 221 227 222 int hclge_comm_get_rss_tuple(struct hclge_comm_rss_cfg *rss_cfg, int flow_type, 228 223 u8 *tuple_sets) ··· 257 250 258 251 return 0; 259 252 } 253 + EXPORT_SYMBOL_GPL(hclge_comm_get_rss_tuple); 260 254 261 255 static void 262 256 hclge_comm_append_rss_msb_info(struct hclge_comm_rss_ind_tbl_cmd *req, ··· 312 304 } 313 305 return 0; 314 306 } 307 + EXPORT_SYMBOL_GPL(hclge_comm_set_rss_indir_table); 315 308 316 309 int hclge_comm_set_rss_input_tuple(struct hclge_comm_hw *hw, 317 310 struct hclge_comm_rss_cfg *rss_cfg) ··· 341 332 "failed to configure rss input, ret = %d.\n", ret); 342 333 return ret; 343 334 } 335 + EXPORT_SYMBOL_GPL(hclge_comm_set_rss_input_tuple); 344 336 345 337 void hclge_comm_get_rss_hash_info(struct hclge_comm_rss_cfg *rss_cfg, u8 *key, 346 338 u8 *hfunc) ··· 365 355 if (key) 366 356 memcpy(key, rss_cfg->rss_hash_key, HCLGE_COMM_RSS_KEY_SIZE); 367 357 } 358 + EXPORT_SYMBOL_GPL(hclge_comm_get_rss_hash_info); 368 359 369 360 void hclge_comm_get_rss_indir_tbl(struct hclge_comm_rss_cfg *rss_cfg, 370 361 u32 *indir, u16 rss_ind_tbl_size) ··· 378 367 for (i = 0; i < rss_ind_tbl_size; i++) 379 368 indir[i] = rss_cfg->rss_indirection_tbl[i]; 380 369 } 370 + EXPORT_SYMBOL_GPL(hclge_comm_get_rss_indir_tbl); 381 371 382 372 int hclge_comm_set_rss_algo_key(struct hclge_comm_hw *hw, const u8 hfunc, 383 373 const u8 *key) ··· 420 408 421 409 return 0; 422 410 } 411 + EXPORT_SYMBOL_GPL(hclge_comm_set_rss_algo_key); 423 412 424 413 static u8 hclge_comm_get_rss_hash_bits(struct ethtool_rxnfc *nfc) 425 414 { ··· 515 502 516 503 return tuple_data; 517 504 } 505 + EXPORT_SYMBOL_GPL(hclge_comm_convert_rss_tuple);
+5
drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.c
··· 26 26 27 27 return buff; 28 28 } 29 + EXPORT_SYMBOL_GPL(hclge_comm_tqps_get_stats); 29 30 30 31 int hclge_comm_tqps_get_sset_count(struct hnae3_handle *handle) 31 32 { ··· 34 33 35 34 return kinfo->num_tqps * HCLGE_COMM_QUEUE_PAIR_SIZE; 36 35 } 36 + EXPORT_SYMBOL_GPL(hclge_comm_tqps_get_sset_count); 37 37 38 38 u8 *hclge_comm_tqps_get_strings(struct hnae3_handle *handle, u8 *data) 39 39 { ··· 58 56 59 57 return buff; 60 58 } 59 + EXPORT_SYMBOL_GPL(hclge_comm_tqps_get_strings); 61 60 62 61 int hclge_comm_tqps_update_stats(struct hnae3_handle *handle, 63 62 struct hclge_comm_hw *hw) ··· 102 99 103 100 return 0; 104 101 } 102 + EXPORT_SYMBOL_GPL(hclge_comm_tqps_update_stats); 105 103 106 104 void hclge_comm_reset_tqp_stats(struct hnae3_handle *handle) 107 105 { ··· 117 113 memset(&tqp->tqp_stats, 0, sizeof(tqp->tqp_stats)); 118 114 } 119 115 } 116 + EXPORT_SYMBOL_GPL(hclge_comm_reset_tqp_stats);