tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: f8ab733c9440022fd40f3c6d44e18f6ae930dc48 commit: bbae0ca11850da2793282896206974656859a73e [18710/30000] SCSI: SSSRAID: Introduce map_queue in sssraid module config: x86_64-randconfig-014-20240420 (https://download.01.org/0day-ci/archive/20240420/202404200623.QfzEE7tC-lkp@i...) compiler: gcc-12 (Ubuntu 12.3.0-9ubuntu2) 12.3.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240420/202404200623.QfzEE7tC-lkp@i...)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot lkp@intel.com | Closes: https://lore.kernel.org/oe-kbuild-all/202404200623.QfzEE7tC-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/scsi/sssraid/sssraid_os.c: In function 'sssraid_map_queues': drivers/scsi/sssraid/sssraid_os.c:1568:9: error: implicit declaration of function 'for_each_pci_msi_entry'; did you mean 'for_each_msi_entry'? [-Werror=implicit-function-declaration] 1568 | for_each_pci_msi_entry(entry, pdev) { | ^~~~~~~~~~~~~~~~~~~~~~ | for_each_msi_entry drivers/scsi/sssraid/sssraid_os.c:1568:44: error: expected ';' before '{' token 1568 | for_each_pci_msi_entry(entry, pdev) { | ^~ | ; drivers/scsi/sssraid/sssraid_os.c:1566:22: warning: unused variable 'node_id_array' [-Wunused-variable] 1566 | unsigned int node_id_array[100]; | ^~~~~~~~~~~~~ drivers/scsi/sssraid/sssraid_os.c:1565:28: warning: unused variable 'i' [-Wunused-variable] 1565 | u8 node_count = 0, i; | ^ drivers/scsi/sssraid/sssraid_os.c:1565:12: warning: unused variable 'node_count' [-Wunused-variable] 1565 | u8 node_count = 0, i; | ^~~~~~~~~~ drivers/scsi/sssraid/sssraid_os.c:1564:33: warning: unused variable 'cpu_index' [-Wunused-variable] 1564 | int cpu, first_sibling, cpu_index = 0; | ^~~~~~~~~ drivers/scsi/sssraid/sssraid_os.c:1564:18: warning: unused variable 'first_sibling' [-Wunused-variable] 1564 | int cpu, first_sibling, cpu_index = 0; | ^~~~~~~~~~~~~ drivers/scsi/sssraid/sssraid_os.c:1564:13: warning: unused variable 'cpu' [-Wunused-variable] 1564 | int cpu, first_sibling, cpu_index = 0; | ^~~ drivers/scsi/sssraid/sssraid_os.c:1563:31: warning: unused variable 'node_id_last' [-Wunused-variable] 1563 | unsigned int node_id, node_id_last = 0xFFFFFFFF; | ^~~~~~~~~~~~ drivers/scsi/sssraid/sssraid_os.c:1563:22: warning: unused variable 'node_id' [-Wunused-variable] 1563 | unsigned int node_id, node_id_last = 0xFFFFFFFF; | ^~~~~~~ drivers/scsi/sssraid/sssraid_os.c:1562:22: warning: unused variable 'nr_queues' [-Wunused-variable] 1562 | unsigned int nr_queues = queue_map->nr_queues; | ^~~~~~~~~ drivers/scsi/sssraid/sssraid_os.c:1561:23: warning: unused variable 'map' [-Wunused-variable] 1561 | unsigned int *map = queue_map->mq_map; | ^~~ drivers/scsi/sssraid/sssraid_os.c:1560:22: warning: unused variable 'queue_offset' [-Wunused-variable] 1560 | unsigned int queue_offset = queue_map->queue_offset; | ^~~~~~~~~~~~ drivers/scsi/sssraid/sssraid_os.c:1559:31: warning: unused variable 'node_mask' [-Wunused-variable] 1559 | const struct cpumask *node_mask = NULL; | ^~~~~~~~~
drivers/scsi/sssraid/sssraid_os.c:1556:35: warning: unused variable 'affinity' [-Wunused-variable]
1556 | struct irq_affinity_desc *affinity = NULL; | ^~~~~~~~ drivers/scsi/sssraid/sssraid_os.c:1612:1: warning: no return statement in function returning non-void [-Wreturn-type] 1612 | } | ^ drivers/scsi/sssraid/sssraid_os.c: At top level: drivers/scsi/sssraid/sssraid_os.c:1466:12: warning: 'sssraid_get_first_sibling' defined but not used [-Wunused-function] 1466 | static int sssraid_get_first_sibling(unsigned int cpu) | ^~~~~~~~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors
vim +/affinity +1556 drivers/scsi/sssraid/sssraid_os.c
1550 1551 static int sssraid_map_queues(struct Scsi_Host *shost) 1552 { 1553 struct sssraid_ioc *sdioc = shost_priv(shost); 1554 struct pci_dev *pdev = sdioc->pdev; 1555 struct msi_desc *entry = NULL;
1556 struct irq_affinity_desc *affinity = NULL;
1557 struct blk_mq_tag_set *tag_set = &shost->tag_set; 1558 struct blk_mq_queue_map *queue_map = &tag_set->map[HCTX_TYPE_DEFAULT]; 1559 const struct cpumask *node_mask = NULL; 1560 unsigned int queue_offset = queue_map->queue_offset;
1561 unsigned int *map = queue_map->mq_map;
1562 unsigned int nr_queues = queue_map->nr_queues; 1563 unsigned int node_id, node_id_last = 0xFFFFFFFF; 1564 int cpu, first_sibling, cpu_index = 0; 1565 u8 node_count = 0, i; 1566 unsigned int node_id_array[100]; 1567 1568 for_each_pci_msi_entry(entry, pdev) { 1569 struct list_head *msi_list = &pdev->dev.msi_list; 1570 1571 if (list_is_last(msi_list, &entry->list)) 1572 goto get_next_numa_node; 1573 1574 if (entry->irq) { 1575 affinity = entry->affinity; 1576 node_mask = &affinity->mask; 1577 1578 cpu = cpumask_first(node_mask); 1579 node_id = cpu_to_node(cpu); 1580 if (node_id_last == node_id) 1581 continue; 1582 1583 for (i = 0; i < node_count; i++) { 1584 if (node_id == node_id_array[i]) 1585 goto get_next_numa_node; 1586 } 1587 node_id_array[node_count++] = node_id; 1588 node_id_last = node_id; 1589 } 1590 get_next_numa_node: 1591 continue; 1592 } 1593 1594 for (i = 0; i < node_count; i++) { 1595 node_mask = cpumask_of_node(node_id_array[i]); 1596 dbgprint(sdioc, "NUMA_node = %d\n", node_id_array[i]); 1597 for_each_cpu(cpu, node_mask) { 1598 if (cpu_index < nr_queues) { 1599 map[cpu_index++] = queue_offset + (cpu % nr_queues); 1600 } else { 1601 first_sibling = sssraid_get_first_sibling(cpu); 1602 if (first_sibling == cpu) 1603 map[cpu_index++] = queue_offset + (cpu % nr_queues); 1604 else 1605 map[cpu_index++] = map[first_sibling]; 1606 } 1607 dbgprint(sdioc, "map[%d] = %d\n", cpu_index - 1, map[cpu_index - 1]); 1608 } 1609 } 1610 1611 return 0; 1612 } 1613