Re: [PATCH for-next 1/2] RDMA/bnxt_re: Code refactor while populating user MRs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Selvin,

I love your patch! Perhaps something to improve:

[auto build test WARNING on rdma/for-next]
[also build test WARNING on v5.11-rc2 next-20210104]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Selvin-Xavier/RDMA-bnxt_re-Allow-bigger-user-MRs/20210107-145124
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git for-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/a37827df6f226ed7b3fd1a3ccc4c47f5b893adf9
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Selvin-Xavier/RDMA-bnxt_re-Allow-bigger-user-MRs/20210107-145124
        git checkout a37827df6f226ed7b3fd1a3ccc4c47f5b893adf9
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

   drivers/infiniband/hw/bnxt_re/ib_verbs.c: In function 'bnxt_re_create_fence_mr':
>> drivers/infiniband/hw/bnxt_re/ib_verbs.c:472:6: warning: variable 'pbl_tbl' set but not used [-Wunused-but-set-variable]
     472 |  u64 pbl_tbl;
         |      ^~~~~~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for FRAME_POINTER
   Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
   Selected by
   - FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86


vim +/pbl_tbl +472 drivers/infiniband/hw/bnxt_re/ib_verbs.c

9152e0b722b290 Eddie Wai     2017-06-14  462  
9152e0b722b290 Eddie Wai     2017-06-14  463  static int bnxt_re_create_fence_mr(struct bnxt_re_pd *pd)
9152e0b722b290 Eddie Wai     2017-06-14  464  {
9152e0b722b290 Eddie Wai     2017-06-14  465  	int mr_access_flags = IB_ACCESS_LOCAL_WRITE | IB_ACCESS_MW_BIND;
9152e0b722b290 Eddie Wai     2017-06-14  466  	struct bnxt_re_fence_data *fence = &pd->fence;
9152e0b722b290 Eddie Wai     2017-06-14  467  	struct bnxt_re_dev *rdev = pd->rdev;
9152e0b722b290 Eddie Wai     2017-06-14  468  	struct device *dev = &rdev->en_dev->pdev->dev;
9152e0b722b290 Eddie Wai     2017-06-14  469  	struct bnxt_re_mr *mr = NULL;
9152e0b722b290 Eddie Wai     2017-06-14  470  	dma_addr_t dma_addr = 0;
9152e0b722b290 Eddie Wai     2017-06-14  471  	struct ib_mw *mw;
9152e0b722b290 Eddie Wai     2017-06-14 @472  	u64 pbl_tbl;
9152e0b722b290 Eddie Wai     2017-06-14  473  	int rc;
9152e0b722b290 Eddie Wai     2017-06-14  474  
9152e0b722b290 Eddie Wai     2017-06-14  475  	dma_addr = dma_map_single(dev, fence->va, BNXT_RE_FENCE_BYTES,
9152e0b722b290 Eddie Wai     2017-06-14  476  				  DMA_BIDIRECTIONAL);
9152e0b722b290 Eddie Wai     2017-06-14  477  	rc = dma_mapping_error(dev, dma_addr);
9152e0b722b290 Eddie Wai     2017-06-14  478  	if (rc) {
6ccad8483b2866 Devesh Sharma 2020-02-15  479  		ibdev_err(&rdev->ibdev, "Failed to dma-map fence-MR-mem\n");
9152e0b722b290 Eddie Wai     2017-06-14  480  		rc = -EIO;
9152e0b722b290 Eddie Wai     2017-06-14  481  		fence->dma_addr = 0;
9152e0b722b290 Eddie Wai     2017-06-14  482  		goto fail;
9152e0b722b290 Eddie Wai     2017-06-14  483  	}
9152e0b722b290 Eddie Wai     2017-06-14  484  	fence->dma_addr = dma_addr;
9152e0b722b290 Eddie Wai     2017-06-14  485  
9152e0b722b290 Eddie Wai     2017-06-14  486  	/* Allocate a MR */
9152e0b722b290 Eddie Wai     2017-06-14  487  	mr = kzalloc(sizeof(*mr), GFP_KERNEL);
9152e0b722b290 Eddie Wai     2017-06-14  488  	if (!mr) {
9152e0b722b290 Eddie Wai     2017-06-14  489  		rc = -ENOMEM;
9152e0b722b290 Eddie Wai     2017-06-14  490  		goto fail;
9152e0b722b290 Eddie Wai     2017-06-14  491  	}
9152e0b722b290 Eddie Wai     2017-06-14  492  	fence->mr = mr;
9152e0b722b290 Eddie Wai     2017-06-14  493  	mr->rdev = rdev;
9152e0b722b290 Eddie Wai     2017-06-14  494  	mr->qplib_mr.pd = &pd->qplib_pd;
9152e0b722b290 Eddie Wai     2017-06-14  495  	mr->qplib_mr.type = CMDQ_ALLOCATE_MRW_MRW_FLAGS_PMR;
9152e0b722b290 Eddie Wai     2017-06-14  496  	mr->qplib_mr.flags = __from_ib_access_flags(mr_access_flags);
9152e0b722b290 Eddie Wai     2017-06-14  497  	rc = bnxt_qplib_alloc_mrw(&rdev->qplib_res, &mr->qplib_mr);
9152e0b722b290 Eddie Wai     2017-06-14  498  	if (rc) {
6ccad8483b2866 Devesh Sharma 2020-02-15  499  		ibdev_err(&rdev->ibdev, "Failed to alloc fence-HW-MR\n");
9152e0b722b290 Eddie Wai     2017-06-14  500  		goto fail;
9152e0b722b290 Eddie Wai     2017-06-14  501  	}
9152e0b722b290 Eddie Wai     2017-06-14  502  
9152e0b722b290 Eddie Wai     2017-06-14  503  	/* Register MR */
9152e0b722b290 Eddie Wai     2017-06-14  504  	mr->ib_mr.lkey = mr->qplib_mr.lkey;
9152e0b722b290 Eddie Wai     2017-06-14  505  	mr->qplib_mr.va = (u64)(unsigned long)fence->va;
9152e0b722b290 Eddie Wai     2017-06-14  506  	mr->qplib_mr.total_size = BNXT_RE_FENCE_BYTES;
9152e0b722b290 Eddie Wai     2017-06-14  507  	pbl_tbl = dma_addr;
a37827df6f226e Selvin Xavier 2021-01-06  508  	rc = bnxt_qplib_reg_mr(&rdev->qplib_res, &mr->qplib_mr, NULL,
a37827df6f226e Selvin Xavier 2021-01-06  509  			       BNXT_RE_FENCE_PBL_SIZE, PAGE_SIZE);
9152e0b722b290 Eddie Wai     2017-06-14  510  	if (rc) {
6ccad8483b2866 Devesh Sharma 2020-02-15  511  		ibdev_err(&rdev->ibdev, "Failed to register fence-MR\n");
9152e0b722b290 Eddie Wai     2017-06-14  512  		goto fail;
9152e0b722b290 Eddie Wai     2017-06-14  513  	}
9152e0b722b290 Eddie Wai     2017-06-14  514  	mr->ib_mr.rkey = mr->qplib_mr.rkey;
9152e0b722b290 Eddie Wai     2017-06-14  515  
9152e0b722b290 Eddie Wai     2017-06-14  516  	/* Create a fence MW only for kernel consumers */
9152e0b722b290 Eddie Wai     2017-06-14  517  	mw = bnxt_re_alloc_mw(&pd->ib_pd, IB_MW_TYPE_1, NULL);
653f0a71daf1a7 Dan Carpenter 2017-07-10  518  	if (IS_ERR(mw)) {
6ccad8483b2866 Devesh Sharma 2020-02-15  519  		ibdev_err(&rdev->ibdev,
9152e0b722b290 Eddie Wai     2017-06-14  520  			  "Failed to create fence-MW for PD: %p\n", pd);
653f0a71daf1a7 Dan Carpenter 2017-07-10  521  		rc = PTR_ERR(mw);
9152e0b722b290 Eddie Wai     2017-06-14  522  		goto fail;
9152e0b722b290 Eddie Wai     2017-06-14  523  	}
9152e0b722b290 Eddie Wai     2017-06-14  524  	fence->mw = mw;
9152e0b722b290 Eddie Wai     2017-06-14  525  
9152e0b722b290 Eddie Wai     2017-06-14  526  	bnxt_re_create_fence_wqe(pd);
9152e0b722b290 Eddie Wai     2017-06-14  527  	return 0;
9152e0b722b290 Eddie Wai     2017-06-14  528  
9152e0b722b290 Eddie Wai     2017-06-14  529  fail:
9152e0b722b290 Eddie Wai     2017-06-14  530  	bnxt_re_destroy_fence_mr(pd);
9152e0b722b290 Eddie Wai     2017-06-14  531  	return rc;
9152e0b722b290 Eddie Wai     2017-06-14  532  }
9152e0b722b290 Eddie Wai     2017-06-14  533  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux