drivers/nvme/host/tcp.c:1578: warning: Function parameter or struct member 'queue' not described in 'nvme_tcp_set_queue_io_cpu'

From: kernel test robot
Date: Mon Feb 03 2025 - 10:20:21 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 2014c95afecee3e76ca4a56956a936e23283f05b
commit: 32193789878c259e39b97bd0c0f2f0ccbe5cb8a8 nvme-tcp: Fix I/O queue cpu spreading for multiple controllers
date: 3 weeks ago
config: alpha-randconfig-p001-20211207 (https://download.01.org/0day-ci/archive/20250203/202502032315.Rlhp9d3Y-lkp@xxxxxxxxx/config)
compiler: alpha-linux-gcc (GCC) 12.4.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250203/202502032315.Rlhp9d3Y-lkp@xxxxxxxxx/reproduce)

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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202502032315.Rlhp9d3Y-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> drivers/nvme/host/tcp.c:1578: warning: Function parameter or struct member 'queue' not described in 'nvme_tcp_set_queue_io_cpu'
>> drivers/nvme/host/tcp.c:1578: warning: expecting prototype for Track the number of queues assigned to each cpu using a global per(). Prototype was for nvme_tcp_set_queue_io_cpu() instead


vim +1578 drivers/nvme/host/tcp.c

40510a639ec08db Sagi Grimberg 2020-02-25 1567
32193789878c259 Sagi Grimberg 2025-01-04 1568 /**
32193789878c259 Sagi Grimberg 2025-01-04 1569 * Track the number of queues assigned to each cpu using a global per-cpu
32193789878c259 Sagi Grimberg 2025-01-04 1570 * counter and select the least used cpu from the mq_map. Our goal is to spread
32193789878c259 Sagi Grimberg 2025-01-04 1571 * different controllers I/O threads across different cpu cores.
32193789878c259 Sagi Grimberg 2025-01-04 1572 *
32193789878c259 Sagi Grimberg 2025-01-04 1573 * Note that the accounting is not 100% perfect, but we don't need to be, we're
32193789878c259 Sagi Grimberg 2025-01-04 1574 * simply putting our best effort to select the best candidate cpu core that we
32193789878c259 Sagi Grimberg 2025-01-04 1575 * find at any given point.
32193789878c259 Sagi Grimberg 2025-01-04 1576 */
40510a639ec08db Sagi Grimberg 2020-02-25 1577 static void nvme_tcp_set_queue_io_cpu(struct nvme_tcp_queue *queue)
40510a639ec08db Sagi Grimberg 2020-02-25 @1578 {
40510a639ec08db Sagi Grimberg 2020-02-25 1579 struct nvme_tcp_ctrl *ctrl = queue->ctrl;
32193789878c259 Sagi Grimberg 2025-01-04 1580 struct blk_mq_tag_set *set = &ctrl->tag_set;
32193789878c259 Sagi Grimberg 2025-01-04 1581 int qid = nvme_tcp_queue_id(queue) - 1;
32193789878c259 Sagi Grimberg 2025-01-04 1582 unsigned int *mq_map = NULL;
32193789878c259 Sagi Grimberg 2025-01-04 1583 int cpu, min_queues = INT_MAX, io_cpu;
32193789878c259 Sagi Grimberg 2025-01-04 1584
32193789878c259 Sagi Grimberg 2025-01-04 1585 if (wq_unbound)
32193789878c259 Sagi Grimberg 2025-01-04 1586 goto out;
40510a639ec08db Sagi Grimberg 2020-02-25 1587
40510a639ec08db Sagi Grimberg 2020-02-25 1588 if (nvme_tcp_default_queue(queue))
32193789878c259 Sagi Grimberg 2025-01-04 1589 mq_map = set->map[HCTX_TYPE_DEFAULT].mq_map;
40510a639ec08db Sagi Grimberg 2020-02-25 1590 else if (nvme_tcp_read_queue(queue))
32193789878c259 Sagi Grimberg 2025-01-04 1591 mq_map = set->map[HCTX_TYPE_READ].mq_map;
40510a639ec08db Sagi Grimberg 2020-02-25 1592 else if (nvme_tcp_poll_queue(queue))
32193789878c259 Sagi Grimberg 2025-01-04 1593 mq_map = set->map[HCTX_TYPE_POLL].mq_map;
32193789878c259 Sagi Grimberg 2025-01-04 1594
32193789878c259 Sagi Grimberg 2025-01-04 1595 if (WARN_ON(!mq_map))
32193789878c259 Sagi Grimberg 2025-01-04 1596 goto out;
32193789878c259 Sagi Grimberg 2025-01-04 1597
32193789878c259 Sagi Grimberg 2025-01-04 1598 /* Search for the least used cpu from the mq_map */
32193789878c259 Sagi Grimberg 2025-01-04 1599 io_cpu = WORK_CPU_UNBOUND;
32193789878c259 Sagi Grimberg 2025-01-04 1600 for_each_online_cpu(cpu) {
32193789878c259 Sagi Grimberg 2025-01-04 1601 int num_queues = atomic_read(&nvme_tcp_cpu_queues[cpu]);
32193789878c259 Sagi Grimberg 2025-01-04 1602
32193789878c259 Sagi Grimberg 2025-01-04 1603 if (mq_map[cpu] != qid)
32193789878c259 Sagi Grimberg 2025-01-04 1604 continue;
32193789878c259 Sagi Grimberg 2025-01-04 1605 if (num_queues < min_queues) {
32193789878c259 Sagi Grimberg 2025-01-04 1606 io_cpu = cpu;
32193789878c259 Sagi Grimberg 2025-01-04 1607 min_queues = num_queues;
32193789878c259 Sagi Grimberg 2025-01-04 1608 }
32193789878c259 Sagi Grimberg 2025-01-04 1609 }
32193789878c259 Sagi Grimberg 2025-01-04 1610 if (io_cpu != WORK_CPU_UNBOUND) {
32193789878c259 Sagi Grimberg 2025-01-04 1611 queue->io_cpu = io_cpu;
32193789878c259 Sagi Grimberg 2025-01-04 1612 atomic_inc(&nvme_tcp_cpu_queues[io_cpu]);
32193789878c259 Sagi Grimberg 2025-01-04 1613 set_bit(NVME_TCP_Q_IO_CPU_SET, &queue->flags);
32193789878c259 Sagi Grimberg 2025-01-04 1614 }
32193789878c259 Sagi Grimberg 2025-01-04 1615 out:
32193789878c259 Sagi Grimberg 2025-01-04 1616 dev_dbg(ctrl->ctrl.device, "queue %d: using cpu %d\n",
32193789878c259 Sagi Grimberg 2025-01-04 1617 qid, queue->io_cpu);
40510a639ec08db Sagi Grimberg 2020-02-25 1618 }
40510a639ec08db Sagi Grimberg 2020-02-25 1619

:::::: The code at line 1578 was first introduced by commit
:::::: 40510a639ec08db81d5ff9c79856baf9dda94748 nvme-tcp: optimize queue io_cpu assignment for multiple queue maps

:::::: TO: Sagi Grimberg <sagi@xxxxxxxxxxx>
:::::: CC: Keith Busch <kbusch@xxxxxxxxxx>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki