Re: [PATCH net-next] net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)

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

 



Hi Dexuan,

I love your patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Dexuan-Cui/net-mana-Add-a-driver-for-Microsoft-Azure-Network-Adapter-MANA/20210407-072552
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git cc0626c2aaed8e475efdd85fa374b497a7192e35
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-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/f086d8bc693c2686de24a81398e49496ab3747a9
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Dexuan-Cui/net-mana-Add-a-driver-for-Microsoft-Azure-Network-Adapter-MANA/20210407-072552
        git checkout f086d8bc693c2686de24a81398e49496ab3747a9
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc 

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/net/ethernet/microsoft/mana/hw_channel.c: In function 'hwc_post_rx_wqe':
   drivers/net/ethernet/microsoft/mana/hw_channel.c:88:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      88 |  sge->address = (u64)req->buf_sge_addr;
         |                 ^
   drivers/net/ethernet/microsoft/mana/hw_channel.c: In function 'hwc_alloc_dma_buf':
>> drivers/net/ethernet/microsoft/mana/hw_channel.c:426:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     426 |  base_pa = (u8 *)dma_buf->mem_info.dma_handle;
         |            ^
   drivers/net/ethernet/microsoft/mana/hw_channel.c: In function 'hwc_post_tx_wqe':
   drivers/net/ethernet/microsoft/mana/hw_channel.c:542:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     542 |  sge->address = (u64)req->buf_sge_addr;
         |                 ^

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for PCI_HYPERV
   Depends on PCI && X86_64 && HYPERV && PCI_MSI && PCI_MSI_IRQ_DOMAIN && SYSFS
   Selected by
   - MICROSOFT_MANA && NETDEVICES && ETHERNET && NET_VENDOR_MICROSOFT && PCI_MSI


vim +426 drivers/net/ethernet/microsoft/mana/hw_channel.c

   394	
   395	static int hwc_alloc_dma_buf(struct hw_channel_context *hwc, u16 q_depth,
   396				     u32 max_msg_size, struct hwc_dma_buf **dma_buf_p)
   397	{
   398		struct gdma_context *gc = gdma_dev_to_context(hwc->gdma_dev);
   399		struct gdma_mem_info *gmi;
   400		struct hwc_work_request *hwc_wr;
   401		struct hwc_dma_buf *dma_buf;
   402		u32 buf_size;
   403		void *virt_addr;
   404		u8 *base_pa;
   405		int err;
   406		u16 i;
   407	
   408		dma_buf = kzalloc(sizeof(*dma_buf) +
   409				  q_depth * sizeof(struct hwc_work_request),
   410				  GFP_KERNEL);
   411		if (!dma_buf)
   412			return -ENOMEM;
   413	
   414		dma_buf->num_reqs = q_depth;
   415	
   416		buf_size = ALIGN(q_depth * max_msg_size, PAGE_SIZE);
   417	
   418		gmi = &dma_buf->mem_info;
   419		err = gdma_alloc_memory(gc, buf_size, gmi);
   420		if (err) {
   421			pr_err("Failed to allocate dma buffer: %d\n", err);
   422			goto out;
   423		}
   424	
   425		virt_addr = dma_buf->mem_info.virt_addr;
 > 426		base_pa = (u8 *)dma_buf->mem_info.dma_handle;
   427	
   428		for (i = 0; i < q_depth; i++) {
   429			hwc_wr = &dma_buf->reqs[i];
   430	
   431			hwc_wr->buf_va = virt_addr + i * max_msg_size;
   432			hwc_wr->buf_sge_addr = base_pa + i * max_msg_size;
   433	
   434			hwc_wr->buf_len = max_msg_size;
   435		}
   436	
   437		*dma_buf_p = dma_buf;
   438		return 0;
   439	out:
   440		kfree(dma_buf);
   441		return err;
   442	}
   443	

---
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 Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux