All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/net/ethernet/google/gve/gve_tx.c:507:25: warning: variable 'buf' set but not used
@ 2021-05-18 20:58 kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-05-18 20:58 UTC (permalink / raw)
  To: Catherine Sullivan
  Cc: kbuild-all, linux-kernel, Yangchun Fu, David Awogbemila

[-- Attachment #1: Type: text/plain, Size: 4583 bytes --]

Hi Catherine,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   8ac91e6c6033ebc12c5c1e4aa171b81a662bd70f
commit: 6f007c6486d69967ac1d9e67df9ae9c77d49f1cc gve: Add support for raw addressing in the tx path
date:   5 months ago
config: i386-randconfig-r035-20210519 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6f007c6486d69967ac1d9e67df9ae9c77d49f1cc
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 6f007c6486d69967ac1d9e67df9ae9c77d49f1cc
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

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

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/google/gve/gve_tx.c: In function 'gve_tx_add_skb_no_copy':
>> drivers/net/ethernet/google/gve/gve_tx.c:507:25: warning: variable 'buf' set but not used [-Wunused-but-set-variable]
     507 |  struct gve_tx_dma_buf *buf;
         |                         ^~~


vim +/buf +507 drivers/net/ethernet/google/gve/gve_tx.c

   497	
   498	static int gve_tx_add_skb_no_copy(struct gve_priv *priv, struct gve_tx_ring *tx,
   499					  struct sk_buff *skb)
   500	{
   501		const struct skb_shared_info *shinfo = skb_shinfo(skb);
   502		int hlen, payload_nfrags, l4_hdr_offset;
   503		union gve_tx_desc *pkt_desc, *seg_desc;
   504		struct gve_tx_buffer_state *info;
   505		bool is_gso = skb_is_gso(skb);
   506		u32 idx = tx->req & tx->mask;
 > 507		struct gve_tx_dma_buf *buf;
   508		u64 addr;
   509		u32 len;
   510		int i;
   511	
   512		info = &tx->info[idx];
   513		pkt_desc = &tx->desc[idx];
   514	
   515		l4_hdr_offset = skb_checksum_start_offset(skb);
   516		/* If the skb is gso, then we want only up to the tcp header in the first segment
   517		 * to efficiently replicate on each segment otherwise we want the linear portion
   518		 * of the skb (which will contain the checksum because skb->csum_start and
   519		 * skb->csum_offset are given relative to skb->head) in the first segment.
   520		 */
   521		hlen = is_gso ? l4_hdr_offset + tcp_hdrlen(skb) : skb_headlen(skb);
   522		len = skb_headlen(skb);
   523	
   524		info->skb =  skb;
   525	
   526		addr = dma_map_single(tx->dev, skb->data, len, DMA_TO_DEVICE);
   527		if (unlikely(dma_mapping_error(tx->dev, addr))) {
   528			tx->dma_mapping_error++;
   529			goto drop;
   530		}
   531		buf = &info->buf;
   532		dma_unmap_len_set(buf, len, len);
   533		dma_unmap_addr_set(buf, dma, addr);
   534	
   535		payload_nfrags = shinfo->nr_frags;
   536		if (hlen < len) {
   537			/* For gso the rest of the linear portion of the skb needs to
   538			 * be in its own descriptor.
   539			 */
   540			payload_nfrags++;
   541			gve_tx_fill_pkt_desc(pkt_desc, skb, is_gso, l4_hdr_offset,
   542					     1 + payload_nfrags, hlen, addr);
   543	
   544			len -= hlen;
   545			addr += hlen;
   546			idx = (tx->req + 1) & tx->mask;
   547			seg_desc = &tx->desc[idx];
   548			gve_tx_fill_seg_desc(seg_desc, skb, is_gso, len, addr);
   549		} else {
   550			gve_tx_fill_pkt_desc(pkt_desc, skb, is_gso, l4_hdr_offset,
   551					     1 + payload_nfrags, hlen, addr);
   552		}
   553	
   554		for (i = 0; i < shinfo->nr_frags; i++) {
   555			const skb_frag_t *frag = &shinfo->frags[i];
   556	
   557			idx = (idx + 1) & tx->mask;
   558			seg_desc = &tx->desc[idx];
   559			len = skb_frag_size(frag);
   560			addr = skb_frag_dma_map(tx->dev, frag, 0, len, DMA_TO_DEVICE);
   561			if (unlikely(dma_mapping_error(tx->dev, addr))) {
   562				tx->dma_mapping_error++;
   563				goto unmap_drop;
   564			}
   565			buf = &tx->info[idx].buf;
   566			tx->info[idx].skb = NULL;
   567			dma_unmap_len_set(buf, len, len);
   568			dma_unmap_addr_set(buf, dma, addr);
   569	
   570			gve_tx_fill_seg_desc(seg_desc, skb, is_gso, len, addr);
   571		}
   572	
   573		return 1 + payload_nfrags;
   574	
   575	unmap_drop:
   576		i += (payload_nfrags == shinfo->nr_frags ? 1 : 2);
   577		while (i--) {
   578			idx--;
   579			gve_tx_unmap_buf(tx->dev, &tx->info[idx & tx->mask]);
   580		}
   581	drop:
   582		tx->dropped_pkt++;
   583		return 0;
   584	}
   585	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 35189 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* drivers/net/ethernet/google/gve/gve_tx.c:507:25: warning: variable 'buf' set but not used
@ 2021-10-02 20:03 kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-10-02 20:03 UTC (permalink / raw)
  To: Catherine Sullivan
  Cc: llvm, kbuild-all, linux-kernel, Yangchun Fu, David Awogbemila

[-- Attachment #1: Type: text/plain, Size: 4732 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   02d5e016800d082058b3d3b7c3ede136cdc6ddcb
commit: 6f007c6486d69967ac1d9e67df9ae9c77d49f1cc gve: Add support for raw addressing in the tx path
date:   10 months ago
config: i386-randconfig-a014-20211003 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 962e503cc8bc411f7523cc393acae8aae425b1c4)
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://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6f007c6486d69967ac1d9e67df9ae9c77d49f1cc
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 6f007c6486d69967ac1d9e67df9ae9c77d49f1cc
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=i386 

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

All warnings (new ones prefixed by >>):

>> drivers/net/ethernet/google/gve/gve_tx.c:507:25: warning: variable 'buf' set but not used [-Wunused-but-set-variable]
           struct gve_tx_dma_buf *buf;
                                  ^
   1 warning generated.


vim +/buf +507 drivers/net/ethernet/google/gve/gve_tx.c

   497	
   498	static int gve_tx_add_skb_no_copy(struct gve_priv *priv, struct gve_tx_ring *tx,
   499					  struct sk_buff *skb)
   500	{
   501		const struct skb_shared_info *shinfo = skb_shinfo(skb);
   502		int hlen, payload_nfrags, l4_hdr_offset;
   503		union gve_tx_desc *pkt_desc, *seg_desc;
   504		struct gve_tx_buffer_state *info;
   505		bool is_gso = skb_is_gso(skb);
   506		u32 idx = tx->req & tx->mask;
 > 507		struct gve_tx_dma_buf *buf;
   508		u64 addr;
   509		u32 len;
   510		int i;
   511	
   512		info = &tx->info[idx];
   513		pkt_desc = &tx->desc[idx];
   514	
   515		l4_hdr_offset = skb_checksum_start_offset(skb);
   516		/* If the skb is gso, then we want only up to the tcp header in the first segment
   517		 * to efficiently replicate on each segment otherwise we want the linear portion
   518		 * of the skb (which will contain the checksum because skb->csum_start and
   519		 * skb->csum_offset are given relative to skb->head) in the first segment.
   520		 */
   521		hlen = is_gso ? l4_hdr_offset + tcp_hdrlen(skb) : skb_headlen(skb);
   522		len = skb_headlen(skb);
   523	
   524		info->skb =  skb;
   525	
   526		addr = dma_map_single(tx->dev, skb->data, len, DMA_TO_DEVICE);
   527		if (unlikely(dma_mapping_error(tx->dev, addr))) {
   528			tx->dma_mapping_error++;
   529			goto drop;
   530		}
   531		buf = &info->buf;
   532		dma_unmap_len_set(buf, len, len);
   533		dma_unmap_addr_set(buf, dma, addr);
   534	
   535		payload_nfrags = shinfo->nr_frags;
   536		if (hlen < len) {
   537			/* For gso the rest of the linear portion of the skb needs to
   538			 * be in its own descriptor.
   539			 */
   540			payload_nfrags++;
   541			gve_tx_fill_pkt_desc(pkt_desc, skb, is_gso, l4_hdr_offset,
   542					     1 + payload_nfrags, hlen, addr);
   543	
   544			len -= hlen;
   545			addr += hlen;
   546			idx = (tx->req + 1) & tx->mask;
   547			seg_desc = &tx->desc[idx];
   548			gve_tx_fill_seg_desc(seg_desc, skb, is_gso, len, addr);
   549		} else {
   550			gve_tx_fill_pkt_desc(pkt_desc, skb, is_gso, l4_hdr_offset,
   551					     1 + payload_nfrags, hlen, addr);
   552		}
   553	
   554		for (i = 0; i < shinfo->nr_frags; i++) {
   555			const skb_frag_t *frag = &shinfo->frags[i];
   556	
   557			idx = (idx + 1) & tx->mask;
   558			seg_desc = &tx->desc[idx];
   559			len = skb_frag_size(frag);
   560			addr = skb_frag_dma_map(tx->dev, frag, 0, len, DMA_TO_DEVICE);
   561			if (unlikely(dma_mapping_error(tx->dev, addr))) {
   562				tx->dma_mapping_error++;
   563				goto unmap_drop;
   564			}
   565			buf = &tx->info[idx].buf;
   566			tx->info[idx].skb = NULL;
   567			dma_unmap_len_set(buf, len, len);
   568			dma_unmap_addr_set(buf, dma, addr);
   569	
   570			gve_tx_fill_seg_desc(seg_desc, skb, is_gso, len, addr);
   571		}
   572	
   573		return 1 + payload_nfrags;
   574	
   575	unmap_drop:
   576		i += (payload_nfrags == shinfo->nr_frags ? 1 : 2);
   577		while (i--) {
   578			idx--;
   579			gve_tx_unmap_buf(tx->dev, &tx->info[idx & tx->mask]);
   580		}
   581	drop:
   582		tx->dropped_pkt++;
   583		return 0;
   584	}
   585	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 38899 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* drivers/net/ethernet/google/gve/gve_tx.c:507:25: warning: variable 'buf' set but not used
@ 2021-08-28 21:45 kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-08-28 21:45 UTC (permalink / raw)
  To: Catherine Sullivan
  Cc: llvm, kbuild-all, linux-kernel, Yangchun Fu, David Awogbemila

[-- Attachment #1: Type: text/plain, Size: 4727 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   3f5ad13cb012939e1797ec9cdf43941c169216d2
commit: 6f007c6486d69967ac1d9e67df9ae9c77d49f1cc gve: Add support for raw addressing in the tx path
date:   9 months ago
config: i386-randconfig-a001-20210829 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 4e1a164d7bd53653f79decc121afe784d2fde0a7)
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://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6f007c6486d69967ac1d9e67df9ae9c77d49f1cc
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 6f007c6486d69967ac1d9e67df9ae9c77d49f1cc
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 

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

All warnings (new ones prefixed by >>):

>> drivers/net/ethernet/google/gve/gve_tx.c:507:25: warning: variable 'buf' set but not used [-Wunused-but-set-variable]
           struct gve_tx_dma_buf *buf;
                                  ^
   1 warning generated.


vim +/buf +507 drivers/net/ethernet/google/gve/gve_tx.c

   497	
   498	static int gve_tx_add_skb_no_copy(struct gve_priv *priv, struct gve_tx_ring *tx,
   499					  struct sk_buff *skb)
   500	{
   501		const struct skb_shared_info *shinfo = skb_shinfo(skb);
   502		int hlen, payload_nfrags, l4_hdr_offset;
   503		union gve_tx_desc *pkt_desc, *seg_desc;
   504		struct gve_tx_buffer_state *info;
   505		bool is_gso = skb_is_gso(skb);
   506		u32 idx = tx->req & tx->mask;
 > 507		struct gve_tx_dma_buf *buf;
   508		u64 addr;
   509		u32 len;
   510		int i;
   511	
   512		info = &tx->info[idx];
   513		pkt_desc = &tx->desc[idx];
   514	
   515		l4_hdr_offset = skb_checksum_start_offset(skb);
   516		/* If the skb is gso, then we want only up to the tcp header in the first segment
   517		 * to efficiently replicate on each segment otherwise we want the linear portion
   518		 * of the skb (which will contain the checksum because skb->csum_start and
   519		 * skb->csum_offset are given relative to skb->head) in the first segment.
   520		 */
   521		hlen = is_gso ? l4_hdr_offset + tcp_hdrlen(skb) : skb_headlen(skb);
   522		len = skb_headlen(skb);
   523	
   524		info->skb =  skb;
   525	
   526		addr = dma_map_single(tx->dev, skb->data, len, DMA_TO_DEVICE);
   527		if (unlikely(dma_mapping_error(tx->dev, addr))) {
   528			tx->dma_mapping_error++;
   529			goto drop;
   530		}
   531		buf = &info->buf;
   532		dma_unmap_len_set(buf, len, len);
   533		dma_unmap_addr_set(buf, dma, addr);
   534	
   535		payload_nfrags = shinfo->nr_frags;
   536		if (hlen < len) {
   537			/* For gso the rest of the linear portion of the skb needs to
   538			 * be in its own descriptor.
   539			 */
   540			payload_nfrags++;
   541			gve_tx_fill_pkt_desc(pkt_desc, skb, is_gso, l4_hdr_offset,
   542					     1 + payload_nfrags, hlen, addr);
   543	
   544			len -= hlen;
   545			addr += hlen;
   546			idx = (tx->req + 1) & tx->mask;
   547			seg_desc = &tx->desc[idx];
   548			gve_tx_fill_seg_desc(seg_desc, skb, is_gso, len, addr);
   549		} else {
   550			gve_tx_fill_pkt_desc(pkt_desc, skb, is_gso, l4_hdr_offset,
   551					     1 + payload_nfrags, hlen, addr);
   552		}
   553	
   554		for (i = 0; i < shinfo->nr_frags; i++) {
   555			const skb_frag_t *frag = &shinfo->frags[i];
   556	
   557			idx = (idx + 1) & tx->mask;
   558			seg_desc = &tx->desc[idx];
   559			len = skb_frag_size(frag);
   560			addr = skb_frag_dma_map(tx->dev, frag, 0, len, DMA_TO_DEVICE);
   561			if (unlikely(dma_mapping_error(tx->dev, addr))) {
   562				tx->dma_mapping_error++;
   563				goto unmap_drop;
   564			}
   565			buf = &tx->info[idx].buf;
   566			tx->info[idx].skb = NULL;
   567			dma_unmap_len_set(buf, len, len);
   568			dma_unmap_addr_set(buf, dma, addr);
   569	
   570			gve_tx_fill_seg_desc(seg_desc, skb, is_gso, len, addr);
   571		}
   572	
   573		return 1 + payload_nfrags;
   574	
   575	unmap_drop:
   576		i += (payload_nfrags == shinfo->nr_frags ? 1 : 2);
   577		while (i--) {
   578			idx--;
   579			gve_tx_unmap_buf(tx->dev, &tx->info[idx & tx->mask]);
   580		}
   581	drop:
   582		tx->dropped_pkt++;
   583		return 0;
   584	}
   585	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 42743 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* drivers/net/ethernet/google/gve/gve_tx.c:507:25: warning: variable 'buf' set but not used
@ 2021-07-19  0:29 kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-07-19  0:29 UTC (permalink / raw)
  To: Catherine Sullivan
  Cc: kbuild-all, linux-kernel, Yangchun Fu, David Awogbemila

[-- Attachment #1: Type: text/plain, Size: 4598 bytes --]

Hi Catherine,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   2734d6c1b1a089fb593ef6a23d4b70903526fe0c
commit: 6f007c6486d69967ac1d9e67df9ae9c77d49f1cc gve: Add support for raw addressing in the tx path
date:   7 months ago
config: i386-randconfig-r035-20210719 (attached as .config)
compiler: gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6f007c6486d69967ac1d9e67df9ae9c77d49f1cc
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 6f007c6486d69967ac1d9e67df9ae9c77d49f1cc
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

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

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/google/gve/gve_tx.c: In function 'gve_tx_add_skb_no_copy':
>> drivers/net/ethernet/google/gve/gve_tx.c:507:25: warning: variable 'buf' set but not used [-Wunused-but-set-variable]
     507 |  struct gve_tx_dma_buf *buf;
         |                         ^~~


vim +/buf +507 drivers/net/ethernet/google/gve/gve_tx.c

   497	
   498	static int gve_tx_add_skb_no_copy(struct gve_priv *priv, struct gve_tx_ring *tx,
   499					  struct sk_buff *skb)
   500	{
   501		const struct skb_shared_info *shinfo = skb_shinfo(skb);
   502		int hlen, payload_nfrags, l4_hdr_offset;
   503		union gve_tx_desc *pkt_desc, *seg_desc;
   504		struct gve_tx_buffer_state *info;
   505		bool is_gso = skb_is_gso(skb);
   506		u32 idx = tx->req & tx->mask;
 > 507		struct gve_tx_dma_buf *buf;
   508		u64 addr;
   509		u32 len;
   510		int i;
   511	
   512		info = &tx->info[idx];
   513		pkt_desc = &tx->desc[idx];
   514	
   515		l4_hdr_offset = skb_checksum_start_offset(skb);
   516		/* If the skb is gso, then we want only up to the tcp header in the first segment
   517		 * to efficiently replicate on each segment otherwise we want the linear portion
   518		 * of the skb (which will contain the checksum because skb->csum_start and
   519		 * skb->csum_offset are given relative to skb->head) in the first segment.
   520		 */
   521		hlen = is_gso ? l4_hdr_offset + tcp_hdrlen(skb) : skb_headlen(skb);
   522		len = skb_headlen(skb);
   523	
   524		info->skb =  skb;
   525	
   526		addr = dma_map_single(tx->dev, skb->data, len, DMA_TO_DEVICE);
   527		if (unlikely(dma_mapping_error(tx->dev, addr))) {
   528			tx->dma_mapping_error++;
   529			goto drop;
   530		}
   531		buf = &info->buf;
   532		dma_unmap_len_set(buf, len, len);
   533		dma_unmap_addr_set(buf, dma, addr);
   534	
   535		payload_nfrags = shinfo->nr_frags;
   536		if (hlen < len) {
   537			/* For gso the rest of the linear portion of the skb needs to
   538			 * be in its own descriptor.
   539			 */
   540			payload_nfrags++;
   541			gve_tx_fill_pkt_desc(pkt_desc, skb, is_gso, l4_hdr_offset,
   542					     1 + payload_nfrags, hlen, addr);
   543	
   544			len -= hlen;
   545			addr += hlen;
   546			idx = (tx->req + 1) & tx->mask;
   547			seg_desc = &tx->desc[idx];
   548			gve_tx_fill_seg_desc(seg_desc, skb, is_gso, len, addr);
   549		} else {
   550			gve_tx_fill_pkt_desc(pkt_desc, skb, is_gso, l4_hdr_offset,
   551					     1 + payload_nfrags, hlen, addr);
   552		}
   553	
   554		for (i = 0; i < shinfo->nr_frags; i++) {
   555			const skb_frag_t *frag = &shinfo->frags[i];
   556	
   557			idx = (idx + 1) & tx->mask;
   558			seg_desc = &tx->desc[idx];
   559			len = skb_frag_size(frag);
   560			addr = skb_frag_dma_map(tx->dev, frag, 0, len, DMA_TO_DEVICE);
   561			if (unlikely(dma_mapping_error(tx->dev, addr))) {
   562				tx->dma_mapping_error++;
   563				goto unmap_drop;
   564			}
   565			buf = &tx->info[idx].buf;
   566			tx->info[idx].skb = NULL;
   567			dma_unmap_len_set(buf, len, len);
   568			dma_unmap_addr_set(buf, dma, addr);
   569	
   570			gve_tx_fill_seg_desc(seg_desc, skb, is_gso, len, addr);
   571		}
   572	
   573		return 1 + payload_nfrags;
   574	
   575	unmap_drop:
   576		i += (payload_nfrags == shinfo->nr_frags ? 1 : 2);
   577		while (i--) {
   578			idx--;
   579			gve_tx_unmap_buf(tx->dev, &tx->info[idx & tx->mask]);
   580		}
   581	drop:
   582		tx->dropped_pkt++;
   583		return 0;
   584	}
   585	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 45374 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* drivers/net/ethernet/google/gve/gve_tx.c:507:25: warning: variable 'buf' set but not used
@ 2021-01-16 20:18 kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-01-16 20:18 UTC (permalink / raw)
  To: Catherine Sullivan
  Cc: kbuild-all, linux-kernel, Yangchun Fu, David Awogbemila

[-- Attachment #1: Type: text/plain, Size: 4582 bytes --]

Hi Catherine,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   1d94330a437a573cfdf848f6743b1ed169242c8a
commit: 6f007c6486d69967ac1d9e67df9ae9c77d49f1cc gve: Add support for raw addressing in the tx path
date:   6 weeks ago
config: i386-randconfig-r026-20210117 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6f007c6486d69967ac1d9e67df9ae9c77d49f1cc
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 6f007c6486d69967ac1d9e67df9ae9c77d49f1cc
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

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

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/google/gve/gve_tx.c: In function 'gve_tx_add_skb_no_copy':
>> drivers/net/ethernet/google/gve/gve_tx.c:507:25: warning: variable 'buf' set but not used [-Wunused-but-set-variable]
     507 |  struct gve_tx_dma_buf *buf;
         |                         ^~~


vim +/buf +507 drivers/net/ethernet/google/gve/gve_tx.c

   497	
   498	static int gve_tx_add_skb_no_copy(struct gve_priv *priv, struct gve_tx_ring *tx,
   499					  struct sk_buff *skb)
   500	{
   501		const struct skb_shared_info *shinfo = skb_shinfo(skb);
   502		int hlen, payload_nfrags, l4_hdr_offset;
   503		union gve_tx_desc *pkt_desc, *seg_desc;
   504		struct gve_tx_buffer_state *info;
   505		bool is_gso = skb_is_gso(skb);
   506		u32 idx = tx->req & tx->mask;
 > 507		struct gve_tx_dma_buf *buf;
   508		u64 addr;
   509		u32 len;
   510		int i;
   511	
   512		info = &tx->info[idx];
   513		pkt_desc = &tx->desc[idx];
   514	
   515		l4_hdr_offset = skb_checksum_start_offset(skb);
   516		/* If the skb is gso, then we want only up to the tcp header in the first segment
   517		 * to efficiently replicate on each segment otherwise we want the linear portion
   518		 * of the skb (which will contain the checksum because skb->csum_start and
   519		 * skb->csum_offset are given relative to skb->head) in the first segment.
   520		 */
   521		hlen = is_gso ? l4_hdr_offset + tcp_hdrlen(skb) : skb_headlen(skb);
   522		len = skb_headlen(skb);
   523	
   524		info->skb =  skb;
   525	
   526		addr = dma_map_single(tx->dev, skb->data, len, DMA_TO_DEVICE);
   527		if (unlikely(dma_mapping_error(tx->dev, addr))) {
   528			tx->dma_mapping_error++;
   529			goto drop;
   530		}
   531		buf = &info->buf;
   532		dma_unmap_len_set(buf, len, len);
   533		dma_unmap_addr_set(buf, dma, addr);
   534	
   535		payload_nfrags = shinfo->nr_frags;
   536		if (hlen < len) {
   537			/* For gso the rest of the linear portion of the skb needs to
   538			 * be in its own descriptor.
   539			 */
   540			payload_nfrags++;
   541			gve_tx_fill_pkt_desc(pkt_desc, skb, is_gso, l4_hdr_offset,
   542					     1 + payload_nfrags, hlen, addr);
   543	
   544			len -= hlen;
   545			addr += hlen;
   546			idx = (tx->req + 1) & tx->mask;
   547			seg_desc = &tx->desc[idx];
   548			gve_tx_fill_seg_desc(seg_desc, skb, is_gso, len, addr);
   549		} else {
   550			gve_tx_fill_pkt_desc(pkt_desc, skb, is_gso, l4_hdr_offset,
   551					     1 + payload_nfrags, hlen, addr);
   552		}
   553	
   554		for (i = 0; i < shinfo->nr_frags; i++) {
   555			const skb_frag_t *frag = &shinfo->frags[i];
   556	
   557			idx = (idx + 1) & tx->mask;
   558			seg_desc = &tx->desc[idx];
   559			len = skb_frag_size(frag);
   560			addr = skb_frag_dma_map(tx->dev, frag, 0, len, DMA_TO_DEVICE);
   561			if (unlikely(dma_mapping_error(tx->dev, addr))) {
   562				tx->dma_mapping_error++;
   563				goto unmap_drop;
   564			}
   565			buf = &tx->info[idx].buf;
   566			tx->info[idx].skb = NULL;
   567			dma_unmap_len_set(buf, len, len);
   568			dma_unmap_addr_set(buf, dma, addr);
   569	
   570			gve_tx_fill_seg_desc(seg_desc, skb, is_gso, len, addr);
   571		}
   572	
   573		return 1 + payload_nfrags;
   574	
   575	unmap_drop:
   576		i += (payload_nfrags == shinfo->nr_frags ? 1 : 2);
   577		while (i--) {
   578			idx--;
   579			gve_tx_unmap_buf(tx->dev, &tx->info[idx & tx->mask]);
   580		}
   581	drop:
   582		tx->dropped_pkt++;
   583		return 0;
   584	}
   585	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34483 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* drivers/net/ethernet/google/gve/gve_tx.c:507:25: warning: variable 'buf' set but not used
@ 2021-01-01 16:59 kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-01-01 16:59 UTC (permalink / raw)
  To: Catherine Sullivan
  Cc: kbuild-all, linux-kernel, Yangchun Fu, David Awogbemila

[-- Attachment #1: Type: text/plain, Size: 4528 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f6e1ea19649216156576aeafa784e3b4cee45549
commit: 6f007c6486d69967ac1d9e67df9ae9c77d49f1cc gve: Add support for raw addressing in the tx path
date:   3 weeks ago
config: i386-randconfig-r034-20210101 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6f007c6486d69967ac1d9e67df9ae9c77d49f1cc
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 6f007c6486d69967ac1d9e67df9ae9c77d49f1cc
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

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

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/google/gve/gve_tx.c: In function 'gve_tx_add_skb_no_copy':
>> drivers/net/ethernet/google/gve/gve_tx.c:507:25: warning: variable 'buf' set but not used [-Wunused-but-set-variable]
     507 |  struct gve_tx_dma_buf *buf;
         |                         ^~~


vim +/buf +507 drivers/net/ethernet/google/gve/gve_tx.c

   497	
   498	static int gve_tx_add_skb_no_copy(struct gve_priv *priv, struct gve_tx_ring *tx,
   499					  struct sk_buff *skb)
   500	{
   501		const struct skb_shared_info *shinfo = skb_shinfo(skb);
   502		int hlen, payload_nfrags, l4_hdr_offset;
   503		union gve_tx_desc *pkt_desc, *seg_desc;
   504		struct gve_tx_buffer_state *info;
   505		bool is_gso = skb_is_gso(skb);
   506		u32 idx = tx->req & tx->mask;
 > 507		struct gve_tx_dma_buf *buf;
   508		u64 addr;
   509		u32 len;
   510		int i;
   511	
   512		info = &tx->info[idx];
   513		pkt_desc = &tx->desc[idx];
   514	
   515		l4_hdr_offset = skb_checksum_start_offset(skb);
   516		/* If the skb is gso, then we want only up to the tcp header in the first segment
   517		 * to efficiently replicate on each segment otherwise we want the linear portion
   518		 * of the skb (which will contain the checksum because skb->csum_start and
   519		 * skb->csum_offset are given relative to skb->head) in the first segment.
   520		 */
   521		hlen = is_gso ? l4_hdr_offset + tcp_hdrlen(skb) : skb_headlen(skb);
   522		len = skb_headlen(skb);
   523	
   524		info->skb =  skb;
   525	
   526		addr = dma_map_single(tx->dev, skb->data, len, DMA_TO_DEVICE);
   527		if (unlikely(dma_mapping_error(tx->dev, addr))) {
   528			tx->dma_mapping_error++;
   529			goto drop;
   530		}
   531		buf = &info->buf;
   532		dma_unmap_len_set(buf, len, len);
   533		dma_unmap_addr_set(buf, dma, addr);
   534	
   535		payload_nfrags = shinfo->nr_frags;
   536		if (hlen < len) {
   537			/* For gso the rest of the linear portion of the skb needs to
   538			 * be in its own descriptor.
   539			 */
   540			payload_nfrags++;
   541			gve_tx_fill_pkt_desc(pkt_desc, skb, is_gso, l4_hdr_offset,
   542					     1 + payload_nfrags, hlen, addr);
   543	
   544			len -= hlen;
   545			addr += hlen;
   546			idx = (tx->req + 1) & tx->mask;
   547			seg_desc = &tx->desc[idx];
   548			gve_tx_fill_seg_desc(seg_desc, skb, is_gso, len, addr);
   549		} else {
   550			gve_tx_fill_pkt_desc(pkt_desc, skb, is_gso, l4_hdr_offset,
   551					     1 + payload_nfrags, hlen, addr);
   552		}
   553	
   554		for (i = 0; i < shinfo->nr_frags; i++) {
   555			const skb_frag_t *frag = &shinfo->frags[i];
   556	
   557			idx = (idx + 1) & tx->mask;
   558			seg_desc = &tx->desc[idx];
   559			len = skb_frag_size(frag);
   560			addr = skb_frag_dma_map(tx->dev, frag, 0, len, DMA_TO_DEVICE);
   561			if (unlikely(dma_mapping_error(tx->dev, addr))) {
   562				tx->dma_mapping_error++;
   563				goto unmap_drop;
   564			}
   565			buf = &tx->info[idx].buf;
   566			tx->info[idx].skb = NULL;
   567			dma_unmap_len_set(buf, len, len);
   568			dma_unmap_addr_set(buf, dma, addr);
   569	
   570			gve_tx_fill_seg_desc(seg_desc, skb, is_gso, len, addr);
   571		}
   572	
   573		return 1 + payload_nfrags;
   574	
   575	unmap_drop:
   576		i += (payload_nfrags == shinfo->nr_frags ? 1 : 2);
   577		while (i--) {
   578			idx--;
   579			gve_tx_unmap_buf(tx->dev, &tx->info[idx & tx->mask]);
   580		}
   581	drop:
   582		tx->dropped_pkt++;
   583		return 0;
   584	}
   585	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 42436 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-10-02 20:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 20:58 drivers/net/ethernet/google/gve/gve_tx.c:507:25: warning: variable 'buf' set but not used kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2021-10-02 20:03 kernel test robot
2021-08-28 21:45 kernel test robot
2021-07-19  0:29 kernel test robot
2021-01-16 20:18 kernel test robot
2021-01-01 16:59 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.