[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202011011841.mIF7PhW8-lkp@intel.com>
Date: Sun, 1 Nov 2020 19:02:46 +0800
From: kernel test robot <lkp@...el.com>
To: David Awogbemila <awogbemila@...gle.com>, netdev@...r.kernel.org
Cc: kbuild-all@...ts.01.org, Catherine Sullivan <csully@...gle.com>,
Yangchun Fu <yangchun@...gle.com>,
David Awogbemila <awogbemila@...gle.com>
Subject: Re: [PATCH net-next v5 4/4] gve: Add support for raw addressing in
the tx path
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@...el.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
Download attachment ".config.gz" of type "application/gzip" (25575 bytes)
Powered by blists - more mailing lists