Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Mahanta Jambigi <mjambigi@linux.ibm.com>,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, alibuda@linux.alibaba.com,
	dust.li@linux.alibaba.com, sidraya@linux.ibm.com
Cc: oe-kbuild-all@lists.linux.dev, hidayath@linux.ibm.com,
	pasic@linux.ibm.com, horms@kernel.org, tonylu@linux.alibaba.com,
	guwen@linux.alibaba.com, netdev@vger.kernel.org,
	linux-s390@vger.kernel.org, linux-rdma@vger.kernel.org,
	stable@vger.kernel.org, Mahanta Jambigi <mjambigi@linux.ibm.com>
Subject: Re: [PATCH net] net/smc: unmap the sg table when a DMA map coalesces entries
Date: Fri, 4 Dec 2026 13:06:34 +0800	[thread overview]
Message-ID: <20261204130347.gF7vPNHv-lkp@intel.com> (raw)
In-Reply-To: <20261203125008.2061833-1-mjambigi@linux.ibm.com>

Hi Mahanta,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Mahanta-Jambigi/net-smc-unmap-the-sg-table-when-a-DMA-map-coalesces-entries/20261203-135008
base:   net/main
patch link:    https://lore.kernel.org/r/20261203125008.2061833-1-mjambigi%40linux.ibm.com
patch subject: [PATCH net] net/smc: unmap the sg table when a DMA map coalesces entries
config: x86_64-rhel-9.4-bpf (https://download.01.org/0day-ci/archive/20261204/20261204130347.gF7vPNHv-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261204/20261204130347.gF7vPNHv-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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/20261204130347.gF7vPNHv-lkp@intel.com/

All warnings (new ones prefixed by >>):

   net/smc/smc_core.c: In function 'smcr_buf_map_link':
>> net/smc/smc_core.c:2254:1: warning: label 'free_table' defined but not used [-Wunused-label]
    2254 | free_table:
         | ^~~~~~~~~~


vim +/free_table +2254 net/smc/smc_core.c

952310ccf2d8619 Ursula Braun    2017-01-09  2183  
b8d199451c99b37 Wen Gu          2022-07-14  2184  /* map an buf to a link */
b9247544c1bccfe Karsten Graul   2020-04-29  2185  static int smcr_buf_map_link(struct smc_buf_desc *buf_desc, bool is_rmb,
b9247544c1bccfe Karsten Graul   2020-04-29  2186  			     struct smc_link *lnk)
cd6851f30386e5e Ursula Braun    2017-01-09  2187  {
b8d199451c99b37 Wen Gu          2022-07-14  2188  	int rc, i, nents, offset, buf_size, size, access_flags;
b8d199451c99b37 Wen Gu          2022-07-14  2189  	struct scatterlist *sg;
b8d199451c99b37 Wen Gu          2022-07-14  2190  	void *buf;
cd6851f30386e5e Ursula Braun    2017-01-09  2191  
b9247544c1bccfe Karsten Graul   2020-04-29  2192  	if (buf_desc->is_map_ib[lnk->link_idx])
b9247544c1bccfe Karsten Graul   2020-04-29  2193  		return 0;
a3fe3d01bd0d7cd Ursula Braun    2017-07-28  2194  
b8d199451c99b37 Wen Gu          2022-07-14  2195  	if (buf_desc->is_vm) {
b8d199451c99b37 Wen Gu          2022-07-14  2196  		buf = buf_desc->cpu_addr;
b8d199451c99b37 Wen Gu          2022-07-14  2197  		buf_size = buf_desc->len;
b8d199451c99b37 Wen Gu          2022-07-14  2198  		offset = offset_in_page(buf_desc->cpu_addr);
b8d199451c99b37 Wen Gu          2022-07-14  2199  		nents = PAGE_ALIGN(buf_size + offset) / PAGE_SIZE;
b8d199451c99b37 Wen Gu          2022-07-14  2200  	} else {
b8d199451c99b37 Wen Gu          2022-07-14  2201  		nents = 1;
b8d199451c99b37 Wen Gu          2022-07-14  2202  	}
b8d199451c99b37 Wen Gu          2022-07-14  2203  
b8d199451c99b37 Wen Gu          2022-07-14  2204  	rc = sg_alloc_table(&buf_desc->sgt[lnk->link_idx], nents, GFP_KERNEL);
b9247544c1bccfe Karsten Graul   2020-04-29  2205  	if (rc)
b9247544c1bccfe Karsten Graul   2020-04-29  2206  		return rc;
b8d199451c99b37 Wen Gu          2022-07-14  2207  
b8d199451c99b37 Wen Gu          2022-07-14  2208  	if (buf_desc->is_vm) {
b8d199451c99b37 Wen Gu          2022-07-14  2209  		/* virtually contiguous buffer */
b8d199451c99b37 Wen Gu          2022-07-14  2210  		for_each_sg(buf_desc->sgt[lnk->link_idx].sgl, sg, nents, i) {
b8d199451c99b37 Wen Gu          2022-07-14  2211  			size = min_t(int, PAGE_SIZE - offset, buf_size);
b8d199451c99b37 Wen Gu          2022-07-14  2212  			sg_set_page(sg, vmalloc_to_page(buf), size, offset);
10bc9761d12e440 Dan Carpenter   2025-01-08  2213  			buf += size;
b8d199451c99b37 Wen Gu          2022-07-14  2214  			buf_size -= size;
b8d199451c99b37 Wen Gu          2022-07-14  2215  			offset = 0;
b8d199451c99b37 Wen Gu          2022-07-14  2216  		}
b8d199451c99b37 Wen Gu          2022-07-14  2217  	} else {
b8d199451c99b37 Wen Gu          2022-07-14  2218  		/* physically contiguous buffer */
387707fdf48697c Karsten Graul   2020-04-29  2219  		sg_set_buf(buf_desc->sgt[lnk->link_idx].sgl,
b9247544c1bccfe Karsten Graul   2020-04-29  2220  			   buf_desc->cpu_addr, buf_desc->len);
b8d199451c99b37 Wen Gu          2022-07-14  2221  	}
a3fe3d01bd0d7cd Ursula Braun    2017-07-28  2222  
3e034725c0d8143 Ursula Braun    2017-07-28  2223  	/* map sg table to DMA address */
387707fdf48697c Karsten Graul   2020-04-29  2224  	rc = smc_ib_buf_map_sg(lnk, buf_desc,
b33982c3a6838d1 Ursula Braun    2017-07-28  2225  			       is_rmb ? DMA_FROM_DEVICE : DMA_TO_DEVICE);
3e034725c0d8143 Ursula Braun    2017-07-28  2226  	/* SMC protocol depends on mapping to one DMA address only */
b8d199451c99b37 Wen Gu          2022-07-14  2227  	if (rc != nents) {
b9247544c1bccfe Karsten Graul   2020-04-29  2228  		rc = -EAGAIN;
489cce6c25f0fab Mahanta Jambigi 2026-12-03  2229  		goto buf_unmap;
cd6851f30386e5e Ursula Braun    2017-01-09  2230  	}
3e034725c0d8143 Ursula Braun    2017-07-28  2231  
0ef69e788411cba Guangguan Wang  2022-07-14  2232  	buf_desc->is_dma_need_sync |=
0ef69e788411cba Guangguan Wang  2022-07-14  2233  		smc_ib_is_sg_need_sync(lnk, buf_desc) << lnk->link_idx;
0ef69e788411cba Guangguan Wang  2022-07-14  2234  
b8d199451c99b37 Wen Gu          2022-07-14  2235  	if (is_rmb || buf_desc->is_vm) {
b8d199451c99b37 Wen Gu          2022-07-14  2236  		/* create a new memory region for the RMB or vzalloced sndbuf */
b8d199451c99b37 Wen Gu          2022-07-14  2237  		access_flags = is_rmb ?
b8d199451c99b37 Wen Gu          2022-07-14  2238  			       IB_ACCESS_REMOTE_WRITE | IB_ACCESS_LOCAL_WRITE :
b8d199451c99b37 Wen Gu          2022-07-14  2239  			       IB_ACCESS_LOCAL_WRITE;
b8d199451c99b37 Wen Gu          2022-07-14  2240  
b8d199451c99b37 Wen Gu          2022-07-14  2241  		rc = smc_ib_get_memory_region(lnk->roce_pd, access_flags,
387707fdf48697c Karsten Graul   2020-04-29  2242  					      buf_desc, lnk->link_idx);
b9247544c1bccfe Karsten Graul   2020-04-29  2243  		if (rc)
b9247544c1bccfe Karsten Graul   2020-04-29  2244  			goto buf_unmap;
b8d199451c99b37 Wen Gu          2022-07-14  2245  		smc_ib_sync_sg_for_device(lnk, buf_desc,
b8d199451c99b37 Wen Gu          2022-07-14  2246  					  is_rmb ? DMA_FROM_DEVICE : DMA_TO_DEVICE);
b33982c3a6838d1 Ursula Braun    2017-07-28  2247  	}
b9247544c1bccfe Karsten Graul   2020-04-29  2248  	buf_desc->is_map_ib[lnk->link_idx] = true;
b9247544c1bccfe Karsten Graul   2020-04-29  2249  	return 0;
b9247544c1bccfe Karsten Graul   2020-04-29  2250  
b9247544c1bccfe Karsten Graul   2020-04-29  2251  buf_unmap:
b9247544c1bccfe Karsten Graul   2020-04-29  2252  	smc_ib_buf_unmap_sg(lnk, buf_desc,
b9247544c1bccfe Karsten Graul   2020-04-29  2253  			    is_rmb ? DMA_FROM_DEVICE : DMA_TO_DEVICE);
b9247544c1bccfe Karsten Graul   2020-04-29 @2254  free_table:
b9247544c1bccfe Karsten Graul   2020-04-29  2255  	sg_free_table(&buf_desc->sgt[lnk->link_idx]);
b9247544c1bccfe Karsten Graul   2020-04-29  2256  	return rc;
897e1c245773d93 Ursula Braun    2017-07-28  2257  }
b33982c3a6838d1 Ursula Braun    2017-07-28  2258  

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

      parent reply	other threads:[~2026-12-04  5:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 12:50 [PATCH net] net/smc: unmap the sg table when a DMA map coalesces entries Mahanta Jambigi
2026-12-03 12:53 ` netdev-bot+sinfo
2026-12-04  2:42 ` Dust Li
2026-12-04  5:30   ` Mahanta Jambigi
2026-12-04  3:46 ` kernel test robot
2026-12-04  5:06 ` kernel test robot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261204130347.gF7vPNHv-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=alibuda@linux.alibaba.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dust.li@linux.alibaba.com \
    --cc=edumazet@google.com \
    --cc=guwen@linux.alibaba.com \
    --cc=hidayath@linux.ibm.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mjambigi@linux.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pabeni@redhat.com \
    --cc=pasic@linux.ibm.com \
    --cc=sidraya@linux.ibm.com \
    --cc=stable@vger.kernel.org \
    --cc=tonylu@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox