Re: [PATCH net-next 7/7] net: korina: Make driver COMPILE_TESTable

From: kernel test robot
Date: Tue Apr 13 2021 - 22:07:11 EST


Hi Thomas,

I love your patch! Perhaps something to improve:

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

url: https://github.com/0day-ci/linux/commits/Thomas-Bogendoerfer/net-Korina-improvements/20210414-045102
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 8ef7adc6beb2ef0bce83513dc9e4505e7b21e8c2
config: sparc-allyesconfig (attached as .config)
compiler: sparc64-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/c92cee3d78d891046f2668b2d82c375899d387a4
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Thomas-Bogendoerfer/net-Korina-improvements/20210414-045102
git checkout c92cee3d78d891046f2668b2d82c375899d387a4
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sparc

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/korina.c: In function 'korina_rx':
>> drivers/net/ethernet/korina.c:675:10: warning: conversion from 'long unsigned int' to 'u32' {aka 'unsigned int'} changes value from '18446744073709551613' to '4294967293' [-Woverflow]
675 | writel(~DMA_STAT_DONE, &lp->rx_dma_regs->dmas);
drivers/net/ethernet/korina.c:681:10: warning: conversion from 'long unsigned int' to 'u32' {aka 'unsigned int'} changes value from '18446744073709551591' to '4294967271' [-Woverflow]
681 | writel(~(DMA_STAT_HALT | DMA_STAT_ERR),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +675 drivers/net/ethernet/korina.c

ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 586
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 587 static int korina_rx(struct net_device *dev, int limit)
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 588 {
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 589 struct korina_private *lp = netdev_priv(dev);
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 590 struct dma_desc *rd = &lp->rd_ring[lp->rx_next_done];
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 591 struct sk_buff *skb, *skb_new;
4cf83b664fc14f drivers/net/korina.c Phil Sutter 2009-01-14 592 u32 devcs, pkt_len, dmas;
69e8eeb0eae052 drivers/net/ethernet/korina.c Thomas Bogendoerfer 2021-04-13 593 dma_addr_t ca;
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 594 int count;
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 595
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 596 for (count = 0; count < limit; count++) {
4cf83b664fc14f drivers/net/korina.c Phil Sutter 2009-01-14 597 skb = lp->rx_skb[lp->rx_next_done];
4cf83b664fc14f drivers/net/korina.c Phil Sutter 2009-01-14 598 skb_new = NULL;
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 599
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 600 devcs = rd->devcs;
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 601
4cf83b664fc14f drivers/net/korina.c Phil Sutter 2009-01-14 602 if ((KORINA_RBSIZE - (u32)DMA_COUNT(rd->control)) == 0)
4cf83b664fc14f drivers/net/korina.c Phil Sutter 2009-01-14 603 break;
4cf83b664fc14f drivers/net/korina.c Phil Sutter 2009-01-14 604
69e8eeb0eae052 drivers/net/ethernet/korina.c Thomas Bogendoerfer 2021-04-13 605 ca = rd->ca;
69e8eeb0eae052 drivers/net/ethernet/korina.c Thomas Bogendoerfer 2021-04-13 606
364a97f5d1ae31 drivers/net/ethernet/korina.c Roman Yeryomin 2017-09-17 607 /* check that this is a whole packet
364a97f5d1ae31 drivers/net/ethernet/korina.c Roman Yeryomin 2017-09-17 608 * WARNING: DMA_FD bit incorrectly set
364a97f5d1ae31 drivers/net/ethernet/korina.c Roman Yeryomin 2017-09-17 609 * in Rc32434 (errata ref #077) */
364a97f5d1ae31 drivers/net/ethernet/korina.c Roman Yeryomin 2017-09-17 610 if (!(devcs & ETH_RX_LD))
364a97f5d1ae31 drivers/net/ethernet/korina.c Roman Yeryomin 2017-09-17 611 goto next;
364a97f5d1ae31 drivers/net/ethernet/korina.c Roman Yeryomin 2017-09-17 612
364a97f5d1ae31 drivers/net/ethernet/korina.c Roman Yeryomin 2017-09-17 613 if (!(devcs & ETH_RX_ROK)) {
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 614 /* Update statistics counters */
364a97f5d1ae31 drivers/net/ethernet/korina.c Roman Yeryomin 2017-09-17 615 dev->stats.rx_errors++;
364a97f5d1ae31 drivers/net/ethernet/korina.c Roman Yeryomin 2017-09-17 616 dev->stats.rx_dropped++;
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 617 if (devcs & ETH_RX_CRC)
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 618 dev->stats.rx_crc_errors++;
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 619 if (devcs & ETH_RX_LE)
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 620 dev->stats.rx_length_errors++;
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 621 if (devcs & ETH_RX_OVR)
b1011b375be106 drivers/net/korina.c Phil Sutter 2010-05-29 622 dev->stats.rx_fifo_errors++;
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 623 if (devcs & ETH_RX_CV)
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 624 dev->stats.rx_frame_errors++;
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 625 if (devcs & ETH_RX_CES)
364a97f5d1ae31 drivers/net/ethernet/korina.c Roman Yeryomin 2017-09-17 626 dev->stats.rx_frame_errors++;
364a97f5d1ae31 drivers/net/ethernet/korina.c Roman Yeryomin 2017-09-17 627
364a97f5d1ae31 drivers/net/ethernet/korina.c Roman Yeryomin 2017-09-17 628 goto next;
364a97f5d1ae31 drivers/net/ethernet/korina.c Roman Yeryomin 2017-09-17 629 }
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 630
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 631 /* Malloc up new buffer. */
89d71a66c40d62 drivers/net/korina.c Eric Dumazet 2009-10-13 632 skb_new = netdev_alloc_skb_ip_align(dev, KORINA_RBSIZE);
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 633 if (!skb_new)
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 634 break;
69e8eeb0eae052 drivers/net/ethernet/korina.c Thomas Bogendoerfer 2021-04-13 635
69e8eeb0eae052 drivers/net/ethernet/korina.c Thomas Bogendoerfer 2021-04-13 636 ca = dma_map_single(lp->dmadev, skb_new->data, KORINA_RBSIZE,
69e8eeb0eae052 drivers/net/ethernet/korina.c Thomas Bogendoerfer 2021-04-13 637 DMA_FROM_DEVICE);
69e8eeb0eae052 drivers/net/ethernet/korina.c Thomas Bogendoerfer 2021-04-13 638 if (dma_mapping_error(lp->dmadev, ca)) {
69e8eeb0eae052 drivers/net/ethernet/korina.c Thomas Bogendoerfer 2021-04-13 639 dev_kfree_skb_any(skb_new);
69e8eeb0eae052 drivers/net/ethernet/korina.c Thomas Bogendoerfer 2021-04-13 640 break;
69e8eeb0eae052 drivers/net/ethernet/korina.c Thomas Bogendoerfer 2021-04-13 641 }
69e8eeb0eae052 drivers/net/ethernet/korina.c Thomas Bogendoerfer 2021-04-13 642
69e8eeb0eae052 drivers/net/ethernet/korina.c Thomas Bogendoerfer 2021-04-13 643 pkt_len = RCVPKT_LENGTH(devcs);
69e8eeb0eae052 drivers/net/ethernet/korina.c Thomas Bogendoerfer 2021-04-13 644 dma_unmap_single(lp->dmadev, rd->ca, pkt_len, DMA_FROM_DEVICE);
69e8eeb0eae052 drivers/net/ethernet/korina.c Thomas Bogendoerfer 2021-04-13 645
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 646 /* Do not count the CRC */
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 647 skb_put(skb, pkt_len - 4);
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 648 skb->protocol = eth_type_trans(skb, dev);
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 649
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 650 /* Pass the packet to upper layers */
247c78f2bed0c4 drivers/net/ethernet/korina.c Roman Yeryomin 2017-09-17 651 napi_gro_receive(&lp->napi, skb);
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 652 dev->stats.rx_packets++;
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 653 dev->stats.rx_bytes += pkt_len;
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 654
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 655 /* Update the mcast stats */
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 656 if (devcs & ETH_RX_MP)
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 657 dev->stats.multicast++;
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 658
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 659 lp->rx_skb[lp->rx_next_done] = skb_new;
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 660
364a97f5d1ae31 drivers/net/ethernet/korina.c Roman Yeryomin 2017-09-17 661 next:
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 662 rd->devcs = 0;
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 663
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 664 /* Restore descriptor's curr_addr */
69e8eeb0eae052 drivers/net/ethernet/korina.c Thomas Bogendoerfer 2021-04-13 665 rd->ca = ca;
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 666
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 667 rd->control = DMA_COUNT(KORINA_RBSIZE) |
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 668 DMA_DESC_COD | DMA_DESC_IOD;
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 669 lp->rd_ring[(lp->rx_next_done - 1) &
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 670 KORINA_RDS_MASK].control &=
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 671 ~DMA_DESC_COD;
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 672
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 673 lp->rx_next_done = (lp->rx_next_done + 1) & KORINA_RDS_MASK;
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 674 rd = &lp->rd_ring[lp->rx_next_done];
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 @675 writel(~DMA_STAT_DONE, &lp->rx_dma_regs->dmas);
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 676 }
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 677
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 678 dmas = readl(&lp->rx_dma_regs->dmas);
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 679
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 680 if (dmas & DMA_STAT_HALT) {
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 681 writel(~(DMA_STAT_HALT | DMA_STAT_ERR),
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 682 &lp->rx_dma_regs->dmas);
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 683
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 684 lp->dma_halt_cnt++;
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 685 rd->devcs = 0;
69e8eeb0eae052 drivers/net/ethernet/korina.c Thomas Bogendoerfer 2021-04-13 686 writel(korina_rx_dma(lp, rd - lp->rd_ring),
69e8eeb0eae052 drivers/net/ethernet/korina.c Thomas Bogendoerfer 2021-04-13 687 &lp->rx_dma_regs->dmandptr);
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 688 }
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 689
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 690 return count;
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 691 }
ef11291bcd5f96 drivers/net/korina.c Florian Fainelli 2008-03-19 692

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

Attachment: .config.gz
Description: application/gzip