tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 26e122e97a3d0390ebec389347f64f3730fdf48f commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces date: 6 days ago config: alpha-randconfig-s031-20200624 (attached as .config) compiler: alpha-linux-gcc (GCC) 9.3.0 reproduce: # apt-get install sparse # sparse version: v0.6.2-dirty git checkout 670d0a4b10704667765f7d18f7592993d02783aa # save the attached .config to linux build tree make W=1 C=1 ARCH=alpha CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <l...@intel.com> sparse warnings: (new ones prefixed by >>) drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c:302:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] vld_tid @@ got restricted __be32 [usertype] @@ drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c:302:22: sparse: expected unsigned int [usertype] vld_tid drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c:302:22: sparse: got restricted __be32 [usertype] drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c:305:27: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] pgsz_tag_clr @@ got restricted __be32 [usertype] @@ drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c:305:27: sparse: expected unsigned int [usertype] pgsz_tag_clr drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c:305:27: sparse: got restricted __be32 [usertype] drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c:306:25: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] max_offset @@ got restricted __be32 [usertype] @@ drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c:306:25: sparse: expected unsigned int [usertype] max_offset drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c:306:25: sparse: got restricted __be32 [usertype] drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c:307:26: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] page_offset @@ got restricted __be32 [usertype] @@ drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c:307:26: sparse: expected unsigned int [usertype] page_offset drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c:307:26: sparse: got restricted __be32 [usertype] >> drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c:368:15: sparse: sparse: >> incorrect type in assignment (different address spaces) @@ expected >> struct cxgbi_ppm_pool *pools @@ got void [noderef] __percpu * @@ drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c:368:15: sparse: expected struct cxgbi_ppm_pool *pools >> drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c:368:15: sparse: got >> void [noderef] __percpu * >> drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c:374:48: sparse: sparse: >> incorrect type in initializer (different address spaces) @@ expected >> void const [noderef] __percpu *__vpp_verify @@ got struct cxgbi_ppm_pool >> * @@ >> drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c:374:48: sparse: >> expected void const [noderef] __percpu *__vpp_verify drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c:374:48: sparse: got struct cxgbi_ppm_pool * >> drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c:484:19: sparse: sparse: >> incorrect type in assignment (different address spaces) @@ expected >> struct cxgbi_ppm_pool [noderef] __percpu *pool @@ got struct >> cxgbi_ppm_pool *[assigned] pool @@ >> drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c:484:19: sparse: >> expected struct cxgbi_ppm_pool [noderef] __percpu *pool drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c:484:19: sparse: got struct cxgbi_ppm_pool *[assigned] pool >> drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c:511:21: sparse: sparse: >> incorrect type in argument 1 (different address spaces) @@ expected void >> [noderef] __percpu *__pdata @@ got struct cxgbi_ppm_pool *[assigned] >> pool @@ >> drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c:511:21: sparse: >> expected void [noderef] __percpu *__pdata drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c:511:21: sparse: got struct cxgbi_ppm_pool *[assigned] pool vim +368 drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 291 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 292 void cxgbi_ppm_make_ppod_hdr(struct cxgbi_ppm *ppm, u32 tag, 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 293 unsigned int tid, unsigned int offset, 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 294 unsigned int length, 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 295 struct cxgbi_pagepod_hdr *hdr) 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 296 { 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 297 /* The ddp tag in pagepod should be with bit 31:30 set to 0. 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 298 * The ddp Tag on the wire should be with non-zero 31:30 to the peer 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 299 */ 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 300 tag &= 0x3FFFFFFF; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 301 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 302 hdr->vld_tid = htonl(PPOD_VALID_FLAG | PPOD_TID(tid)); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 303 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 304 hdr->rsvd = 0; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 @305 hdr->pgsz_tag_clr = htonl(tag & ppm->tformat.idx_clr_mask); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 @306 hdr->max_offset = htonl(length); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 @307 hdr->page_offset = htonl(offset); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 308 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 309 pr_debug("ippm: tag 0x%x, tid 0x%x, xfer %u, off %u.\n", 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 310 tag, tid, length, offset); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 311 } 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 312 EXPORT_SYMBOL(cxgbi_ppm_make_ppod_hdr); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 313 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 314 static void ppm_free(struct cxgbi_ppm *ppm) 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 315 { 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 316 vfree(ppm); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 317 } 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 318 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 319 static void ppm_destroy(struct kref *kref) 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 320 { 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 321 struct cxgbi_ppm *ppm = container_of(kref, 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 322 struct cxgbi_ppm, 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 323 refcnt); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 324 pr_info("ippm: kref 0, destroy %s ppm 0x%p.\n", 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 325 ppm->ndev->name, ppm); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 326 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 327 *ppm->ppm_pp = NULL; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 328 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 329 free_percpu(ppm->pool); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 330 ppm_free(ppm); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 331 } 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 332 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 333 int cxgbi_ppm_release(struct cxgbi_ppm *ppm) 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 334 { 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 335 if (ppm) { 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 336 int rv; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 337 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 338 rv = kref_put(&ppm->refcnt, ppm_destroy); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 339 return rv; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 340 } 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 341 return 1; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 342 } 9d5c44b7c4f434 drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2016-07-21 343 EXPORT_SYMBOL(cxgbi_ppm_release); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 344 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 345 static struct cxgbi_ppm_pool *ppm_alloc_cpu_pool(unsigned int *total, 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 346 unsigned int *pcpu_ppmax) 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 347 { 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 348 struct cxgbi_ppm_pool *pools; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 349 unsigned int ppmax = (*total) / num_possible_cpus(); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 350 unsigned int max = (PCPU_MIN_UNIT_SIZE - sizeof(*pools)) << 3; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 351 unsigned int bmap; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 352 unsigned int alloc_sz; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 353 unsigned int count = 0; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 354 unsigned int cpu; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 355 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 356 /* make sure per cpu pool fits into PCPU_MIN_UNIT_SIZE */ 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 357 if (ppmax > max) 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 358 ppmax = max; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 359 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 360 /* pool size must be multiple of unsigned long */ cc5a726c79158b drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-04-03 361 bmap = ppmax / BITS_PER_TYPE(unsigned long); cc5a726c79158b drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-04-03 362 if (!bmap) cc5a726c79158b drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-04-03 363 return NULL; cc5a726c79158b drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-04-03 364 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 365 ppmax = (bmap * sizeof(unsigned long)) << 3; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 366 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 367 alloc_sz = sizeof(*pools) + sizeof(unsigned long) * bmap; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 @368 pools = __alloc_percpu(alloc_sz, __alignof__(struct cxgbi_ppm_pool)); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 369 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 370 if (!pools) 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 371 return NULL; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 372 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 373 for_each_possible_cpu(cpu) { 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 @374 struct cxgbi_ppm_pool *ppool = per_cpu_ptr(pools, cpu); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 375 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 376 memset(ppool, 0, alloc_sz); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 377 spin_lock_init(&ppool->lock); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 378 count += ppmax; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 379 } 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 380 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 381 *total = count; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 382 *pcpu_ppmax = ppmax; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 383 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 384 return pools; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 385 } 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 386 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 387 int cxgbi_ppm_init(void **ppm_pp, struct net_device *ndev, 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 388 struct pci_dev *pdev, void *lldev, a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 389 struct cxgbi_tag_format *tformat, unsigned int iscsi_size, a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 390 unsigned int llimit, unsigned int start, a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 391 unsigned int reserve_factor, unsigned int iscsi_edram_start, a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 392 unsigned int iscsi_edram_size) 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 393 { 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 394 struct cxgbi_ppm *ppm = (struct cxgbi_ppm *)(*ppm_pp); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 395 struct cxgbi_ppm_pool *pool = NULL; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 396 unsigned int pool_index_max = 0; a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 397 unsigned int ppmax_pool = 0; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 398 unsigned int ppod_bmap_size; a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 399 unsigned int alloc_sz; a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 400 unsigned int ppmax; a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 401 a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 402 if (!iscsi_edram_start) a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 403 iscsi_edram_size = 0; a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 404 a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 405 if (iscsi_edram_size && a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 406 ((iscsi_edram_start + iscsi_edram_size) != start)) { a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 407 pr_err("iscsi ppod region not contiguous: EDRAM start 0x%x " a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 408 "size 0x%x DDR start 0x%x\n", a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 409 iscsi_edram_start, iscsi_edram_size, start); a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 410 return -EINVAL; a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 411 } a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 412 a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 413 if (iscsi_edram_size) { a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 414 reserve_factor = 0; a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 415 start = iscsi_edram_start; a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 416 } a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 417 a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 418 ppmax = (iscsi_edram_size + iscsi_size) >> PPOD_SIZE_SHIFT; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 419 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 420 if (ppm) { 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 421 pr_info("ippm: %s, ppm 0x%p,0x%p already initialized, %u/%u.\n", 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 422 ndev->name, ppm_pp, ppm, ppm->ppmax, ppmax); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 423 kref_get(&ppm->refcnt); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 424 return 1; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 425 } 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 426 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 427 if (reserve_factor) { 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 428 ppmax_pool = ppmax / reserve_factor; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 429 pool = ppm_alloc_cpu_pool(&ppmax_pool, &pool_index_max); cc5a726c79158b drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-04-03 430 if (!pool) { cc5a726c79158b drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-04-03 431 ppmax_pool = 0; cc5a726c79158b drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-04-03 432 reserve_factor = 0; cc5a726c79158b drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-04-03 433 } 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 434 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 435 pr_debug("%s: ppmax %u, cpu total %u, per cpu %u.\n", 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 436 ndev->name, ppmax, ppmax_pool, pool_index_max); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 437 } 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 438 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 439 ppod_bmap_size = BITS_TO_LONGS(ppmax - ppmax_pool); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 440 alloc_sz = sizeof(struct cxgbi_ppm) + 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 441 ppmax * (sizeof(struct cxgbi_ppod_data)) + 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 442 ppod_bmap_size * sizeof(unsigned long); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 443 4c303373497015 drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c YueHaibing 2018-07-19 444 ppm = vzalloc(alloc_sz); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 445 if (!ppm) 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 446 goto release_ppm_pool; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 447 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 448 ppm->ppod_bmap = (unsigned long *)(&ppm->ppod_data[ppmax]); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 449 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 450 if ((ppod_bmap_size >> 3) > (ppmax - ppmax_pool)) { 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 451 unsigned int start = ppmax - ppmax_pool; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 452 unsigned int end = ppod_bmap_size >> 3; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 453 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 454 bitmap_set(ppm->ppod_bmap, ppmax, end - start); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 455 pr_info("%s: %u - %u < %u * 8, mask extra bits %u, %u.\n", 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 456 __func__, ppmax, ppmax_pool, ppod_bmap_size, start, 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 457 end); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 458 } a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 459 if (iscsi_edram_size) { a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 460 unsigned int first_ddr_idx = a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 461 iscsi_edram_size >> PPOD_SIZE_SHIFT; a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 462 a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 463 ppm->max_index_in_edram = first_ddr_idx - 1; a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 464 bitmap_set(ppm->ppod_bmap, first_ddr_idx, 1); a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 465 pr_debug("reserved %u ppod in bitmap\n", first_ddr_idx); a248384e6420eb drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c Varun Prakash 2019-06-10 466 } 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 467 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 468 spin_lock_init(&ppm->map_lock); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 469 kref_init(&ppm->refcnt); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 470 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 471 memcpy(&ppm->tformat, tformat, sizeof(struct cxgbi_tag_format)); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 472 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 473 ppm->ppm_pp = ppm_pp; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 474 ppm->ndev = ndev; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 475 ppm->pdev = pdev; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 476 ppm->lldev = lldev; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 477 ppm->ppmax = ppmax; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 478 ppm->next = 0; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 479 ppm->llimit = llimit; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 480 ppm->base_idx = start > llimit ? 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 481 (start - llimit + 1) >> PPOD_SIZE_SHIFT : 0; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 482 ppm->bmap_index_max = ppmax - ppmax_pool; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 483 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 @484 ppm->pool = pool; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 485 ppm->pool_rsvd = ppmax_pool; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 486 ppm->pool_index_max = pool_index_max; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 487 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 488 /* check one more time */ 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 489 if (*ppm_pp) { 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 490 ppm_free(ppm); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 491 ppm = (struct cxgbi_ppm *)(*ppm_pp); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 492 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 493 pr_info("ippm: %s, ppm 0x%p,0x%p already initialized, %u/%u.\n", 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 494 ndev->name, ppm_pp, *ppm_pp, ppm->ppmax, ppmax); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 495 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 496 kref_get(&ppm->refcnt); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 497 return 1; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 498 } 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 499 *ppm_pp = ppm; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 500 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 501 ppm->tformat.pgsz_idx_dflt = cxgbi_ppm_find_page_index(ppm, PAGE_SIZE); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 502 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 503 pr_info("ippm %s: ppm 0x%p, 0x%p, base %u/%u, pg %lu,%u, rsvd %u,%u.\n", 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 504 ndev->name, ppm_pp, ppm, ppm->base_idx, ppm->ppmax, PAGE_SIZE, 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 505 ppm->tformat.pgsz_idx_dflt, ppm->pool_rsvd, 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 506 ppm->pool_index_max); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 507 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 508 return 0; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 509 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 510 release_ppm_pool: 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 @511 free_percpu(pool); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 512 return -ENOMEM; 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 513 } 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 514 EXPORT_SYMBOL(cxgbi_ppm_init); 47da7e62b391a7 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ppm.c Varun Prakash 2016-02-14 515 :::::: The code at line 368 was first introduced by commit :::::: 47da7e62b391a74465c942d821bcbf879457a014 cxgb4: add iSCSI DDP page pod manager :::::: TO: Varun Prakash <va...@chelsio.com> :::::: CC: Nicholas Bellinger <n...@linux-iscsi.org> --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org
.config.gz
Description: application/gzip