[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202410292232.sT4alx5x-lkp@intel.com>
Date: Tue, 29 Oct 2024 22:21:22 +0800
From: kernel test robot <lkp@...el.com>
To: John Ousterhout <ouster@...stanford.edu>, netdev@...r.kernel.org
Cc: oe-kbuild-all@...ts.linux.dev, John Ousterhout <ouster@...stanford.edu>
Subject: Re: [PATCH net-next 12/12] net: homa: create Makefile and Kconfig
Hi John,
kernel test robot noticed the following build warnings:
[auto build test WARNING on net-next/main]
url: https://github.com/intel-lab-lkp/linux/commits/John-Ousterhout/net-homa-define-user-visible-API-for-Homa/20241029-095137
base: net-next/main
patch link: https://lore.kernel.org/r/20241028213541.1529-13-ouster%40cs.stanford.edu
patch subject: [PATCH net-next 12/12] net: homa: create Makefile and Kconfig
config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20241029/202410292232.sT4alx5x-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241029/202410292232.sT4alx5x-lkp@intel.com/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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410292232.sT4alx5x-lkp@intel.com/
All warnings (new ones prefixed by >>):
net/homa/homa_pool.c: In function 'homa_pool_init':
>> net/homa/homa_pool.c:55:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
55 | if (((__u64)region) & ~PAGE_MASK)
| ^
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for GET_FREE_REGION
Depends on [n]: SPARSEMEM [=n]
Selected by [m]:
- RESOURCE_KUNIT_TEST [=m] && RUNTIME_TESTING_MENU [=y] && KUNIT [=m]
vim +55 net/homa/homa_pool.c
2076aa7e789765 John Ousterhout 2024-10-28 40
2076aa7e789765 John Ousterhout 2024-10-28 41 /**
2076aa7e789765 John Ousterhout 2024-10-28 42 * homa_pool_init() - Initialize a homa_pool; any previous contents of the
2076aa7e789765 John Ousterhout 2024-10-28 43 * objects are overwritten.
2076aa7e789765 John Ousterhout 2024-10-28 44 * @hsk: Socket containing the pool to initialize.
2076aa7e789765 John Ousterhout 2024-10-28 45 * @region: First byte of the memory region for the pool, allocated
2076aa7e789765 John Ousterhout 2024-10-28 46 * by the application; must be page-aligned.
2076aa7e789765 John Ousterhout 2024-10-28 47 * @region_size: Total number of bytes available at @buf_region.
2076aa7e789765 John Ousterhout 2024-10-28 48 * Return: Either zero (for success) or a negative errno for failure.
2076aa7e789765 John Ousterhout 2024-10-28 49 */
2076aa7e789765 John Ousterhout 2024-10-28 50 int homa_pool_init(struct homa_sock *hsk, void *region, __u64 region_size)
2076aa7e789765 John Ousterhout 2024-10-28 51 {
2076aa7e789765 John Ousterhout 2024-10-28 52 struct homa_pool *pool = hsk->buffer_pool;
2076aa7e789765 John Ousterhout 2024-10-28 53 int i, result;
2076aa7e789765 John Ousterhout 2024-10-28 54
2076aa7e789765 John Ousterhout 2024-10-28 @55 if (((__u64)region) & ~PAGE_MASK)
2076aa7e789765 John Ousterhout 2024-10-28 56 return -EINVAL;
2076aa7e789765 John Ousterhout 2024-10-28 57 pool->hsk = hsk;
2076aa7e789765 John Ousterhout 2024-10-28 58 pool->region = (char *)region;
2076aa7e789765 John Ousterhout 2024-10-28 59 pool->num_bpages = region_size >> HOMA_BPAGE_SHIFT;
2076aa7e789765 John Ousterhout 2024-10-28 60 pool->descriptors = NULL;
2076aa7e789765 John Ousterhout 2024-10-28 61 pool->cores = NULL;
2076aa7e789765 John Ousterhout 2024-10-28 62 if (pool->num_bpages < MIN_POOL_SIZE) {
2076aa7e789765 John Ousterhout 2024-10-28 63 result = -EINVAL;
2076aa7e789765 John Ousterhout 2024-10-28 64 goto error;
2076aa7e789765 John Ousterhout 2024-10-28 65 }
2076aa7e789765 John Ousterhout 2024-10-28 66 pool->descriptors = kmalloc_array(pool->num_bpages,
2076aa7e789765 John Ousterhout 2024-10-28 67 sizeof(struct homa_bpage), GFP_ATOMIC);
2076aa7e789765 John Ousterhout 2024-10-28 68 if (!pool->descriptors) {
2076aa7e789765 John Ousterhout 2024-10-28 69 result = -ENOMEM;
2076aa7e789765 John Ousterhout 2024-10-28 70 goto error;
2076aa7e789765 John Ousterhout 2024-10-28 71 }
2076aa7e789765 John Ousterhout 2024-10-28 72 for (i = 0; i < pool->num_bpages; i++) {
2076aa7e789765 John Ousterhout 2024-10-28 73 struct homa_bpage *bp = &pool->descriptors[i];
2076aa7e789765 John Ousterhout 2024-10-28 74
2076aa7e789765 John Ousterhout 2024-10-28 75 spin_lock_init(&bp->lock);
2076aa7e789765 John Ousterhout 2024-10-28 76 atomic_set(&bp->refs, 0);
2076aa7e789765 John Ousterhout 2024-10-28 77 bp->owner = -1;
2076aa7e789765 John Ousterhout 2024-10-28 78 bp->expiration = 0;
2076aa7e789765 John Ousterhout 2024-10-28 79 }
2076aa7e789765 John Ousterhout 2024-10-28 80 atomic_set(&pool->free_bpages, pool->num_bpages);
2076aa7e789765 John Ousterhout 2024-10-28 81 pool->bpages_needed = INT_MAX;
2076aa7e789765 John Ousterhout 2024-10-28 82
2076aa7e789765 John Ousterhout 2024-10-28 83 /* Allocate and initialize core-specific data. */
2076aa7e789765 John Ousterhout 2024-10-28 84 pool->cores = kmalloc_array(nr_cpu_ids, sizeof(struct homa_pool_core),
2076aa7e789765 John Ousterhout 2024-10-28 85 GFP_ATOMIC);
2076aa7e789765 John Ousterhout 2024-10-28 86 if (!pool->cores) {
2076aa7e789765 John Ousterhout 2024-10-28 87 result = -ENOMEM;
2076aa7e789765 John Ousterhout 2024-10-28 88 goto error;
2076aa7e789765 John Ousterhout 2024-10-28 89 }
2076aa7e789765 John Ousterhout 2024-10-28 90 pool->num_cores = nr_cpu_ids;
2076aa7e789765 John Ousterhout 2024-10-28 91 for (i = 0; i < pool->num_cores; i++) {
2076aa7e789765 John Ousterhout 2024-10-28 92 pool->cores[i].page_hint = 0;
2076aa7e789765 John Ousterhout 2024-10-28 93 pool->cores[i].allocated = 0;
2076aa7e789765 John Ousterhout 2024-10-28 94 pool->cores[i].next_candidate = 0;
2076aa7e789765 John Ousterhout 2024-10-28 95 }
2076aa7e789765 John Ousterhout 2024-10-28 96 pool->check_waiting_invoked = 0;
2076aa7e789765 John Ousterhout 2024-10-28 97
2076aa7e789765 John Ousterhout 2024-10-28 98 return 0;
2076aa7e789765 John Ousterhout 2024-10-28 99
2076aa7e789765 John Ousterhout 2024-10-28 100 error:
2076aa7e789765 John Ousterhout 2024-10-28 101 kfree(pool->descriptors);
2076aa7e789765 John Ousterhout 2024-10-28 102 kfree(pool->cores);
2076aa7e789765 John Ousterhout 2024-10-28 103 pool->region = NULL;
2076aa7e789765 John Ousterhout 2024-10-28 104 return result;
2076aa7e789765 John Ousterhout 2024-10-28 105 }
2076aa7e789765 John Ousterhout 2024-10-28 106
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists