All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH net-next v5 4/4] gve: Add support for raw addressing in the tx path
Date: Sun, 01 Nov 2020 19:02:46 +0800	[thread overview]
Message-ID: <202011011841.mIF7PhW8-lkp@intel.com> (raw)
In-Reply-To: <20201020181252.753330-5-awogbemila@google.com>

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

Hi David,

I love your patch! Perhaps something to improve:

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

url:    https://github.com/0day-ci/linux/commits/David-Awogbemila/GVE-Raw-Addressing/20201021-021418
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 105faa8742437c28815b2a3eb8314ebc5fd9288c
config: m68k-randconfig-r024-20201030 (attached as .config)
compiler: m68k-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/efba17c94e11da051bdb6b209b740da2a3a0b6be
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review David-Awogbemila/GVE-Raw-Addressing/20201021-021418
        git checkout efba17c94e11da051bdb6b209b740da2a3a0b6be
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k 

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:511:25: warning: variable 'buf' set but not used [-Wunused-but-set-variable]
     511 |  struct gve_tx_dma_buf *buf;
         |                         ^~~

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

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

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

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

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: David Awogbemila <awogbemila@google.com>, netdev@vger.kernel.org
Cc: kbuild-all@lists.01.org, Catherine Sullivan <csully@google.com>,
	Yangchun Fu <yangchun@google.com>,
	David Awogbemila <awogbemila@google.com>
Subject: Re: [PATCH net-next v5 4/4] gve: Add support for raw addressing in the tx path
Date: Sun, 1 Nov 2020 19:02:46 +0800	[thread overview]
Message-ID: <202011011841.mIF7PhW8-lkp@intel.com> (raw)
In-Reply-To: <20201020181252.753330-5-awogbemila@google.com>

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

Hi David,

I love your patch! Perhaps something to improve:

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

url:    https://github.com/0day-ci/linux/commits/David-Awogbemila/GVE-Raw-Addressing/20201021-021418
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 105faa8742437c28815b2a3eb8314ebc5fd9288c
config: m68k-randconfig-r024-20201030 (attached as .config)
compiler: m68k-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/efba17c94e11da051bdb6b209b740da2a3a0b6be
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review David-Awogbemila/GVE-Raw-Addressing/20201021-021418
        git checkout efba17c94e11da051bdb6b209b740da2a3a0b6be
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k 

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:511:25: warning: variable 'buf' set but not used [-Wunused-but-set-variable]
     511 |  struct gve_tx_dma_buf *buf;
         |                         ^~~

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

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

---
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: 25575 bytes --]

  reply	other threads:[~2020-11-01 11:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-20 18:12 [PATCH net-next v5 0/4] GVE Raw Addressing David Awogbemila
2020-10-20 18:12 ` [PATCH net-next v5 1/4] gve: Add support for raw addressing device option David Awogbemila
2020-10-20 18:12 ` [PATCH net-next v5 2/4] gve: Add support for raw addressing to the rx path David Awogbemila
2020-10-20 18:12 ` [PATCH net-next v5 3/4] gve: Rx Buffer Recycling David Awogbemila
2020-10-20 18:12 ` [PATCH net-next v5 4/4] gve: Add support for raw addressing in the tx path David Awogbemila
2020-11-01 11:02   ` kernel test robot [this message]
2020-11-01 11:02     ` kernel test robot
2020-10-20 21:23 ` [PATCH net-next v5 0/4] GVE Raw Addressing Jakub Kicinski

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=202011011841.mIF7PhW8-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /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 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.