Bug 198805

Summary: LINT: ixgbe(4)/ixl(4) fails to compile on powerpc/powerpc64 because of missing netmap symbols
Product: Base System Reporter: Enji Cooper <ngie>
Component: kernAssignee: Enji Cooper <ngie>
Status: Closed FIXED    
Severity: Affects Many People CC: erj, jhibbits, luigi, nwhitehorn, sbruno
Priority: --- Keywords: IntelNetworking
Version: 10.2-STABLE   
Hardware: Any   
OS: Any   

Description Enji Cooper freebsd_committer 2015-03-22 21:05:37 UTC
Reproduced with:

$ hostname
ref10-amd64.freebsd.org
$ pwd
/home/ngie/head
$ make tinderbox JFLAG=-j24
$ svn info .
Path: .
Working Copy Root Path: /home/ngie/head
URL: svn://svn.freebsd.org/base/head
Relative URL: ^/head
Repository Root: svn://svn.freebsd.org/base
Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revision: 280339
Node Kind: directory
Schedule: normal
Last Changed Author: adrian
Last Changed Rev: 280337
Last Changed Date: 2015-03-22 02:15:09 +0000 (Sun, 22 Mar 2015)

$ tail -n 20 _.powerpc.LINT*
==> _.powerpc.LINT <==
linking kernel
ix_txrx.o:(.got2+0x98): undefined reference to `ix_crcstrip'
*** [kernel] Error code 1

make[5]: stopped in /home/ngie/obj/powerpc.powerpc/home/ngie/head/sys/LINT
1 error

make[5]: stopped in /home/ngie/obj/powerpc.powerpc/home/ngie/head/sys/LINT
*** [buildkernel] Error code 2

make[4]: stopped in /home/ngie/head
1 error

make[4]: stopped in /home/ngie/head
*** [buildkernel] Error code 2

make[3]: stopped in /home/ngie/head
1 error

make[3]: stopped in /home/ngie/head

==> _.powerpc.LINT64 <==
linking kernel
ix_txrx.o:(.got+0x130): undefined reference to `ix_crcstrip'
*** [kernel] Error code 1

make[5]: stopped in /home/ngie/obj/powerpc.powerpc64/home/ngie/head/sys/LINT64
1 error

make[5]: stopped in /home/ngie/obj/powerpc.powerpc64/home/ngie/head/sys/LINT64
*** [buildkernel] Error code 2

make[4]: stopped in /home/ngie/head
1 error

make[4]: stopped in /home/ngie/head
*** [buildkernel] Error code 2

make[3]: stopped in /home/ngie/head
1 error

make[3]: stopped in /home/ngie/head
Comment 1 Enji Cooper freebsd_committer 2015-03-22 22:17:18 UTC
Correction -- the issue reported is in ixgbe, not ixl -- however it affects both.

My guess is that it's because the variable's static:

sys/dev/netmap/ixgbe_netmap.h:static int ix_rx_miss, ix_rx_miss_bufs, ix_crcstrip;

Why isn't this localized in ixgbe(4)/ixl(4)?
Comment 2 Eric Joyner freebsd_committer 2015-03-25 00:05:58 UTC
Does luigi want to weigh in on this?

The mention in ix_txrx.c is in ixgbe_setup_hw_rsc(), and according to the X540 datasheet, setting the CRCSTRIP option is required when hardware RSC is enabled, so that check needs to be removed or there should be an explanation saying that disabling CRCSTRIP doesn't break netmap.

As for if_ix.c, maybe the extern int ix_crcstrip declaration should be moved there.
Comment 3 Sean Bruno freebsd_committer 2015-06-30 18:43:47 UTC
Is this still the case?  I think this has been papered over at svn r280430
Comment 4 Sean Bruno freebsd_committer 2015-08-03 20:21:15 UTC
dragging the powerpc folks into this one.
Comment 5 Enji Cooper freebsd_committer 2015-11-09 09:59:21 UTC
Giving ixgbe bug to erj.
Comment 6 Enji Cooper freebsd_committer 2015-12-14 14:00:45 UTC
Still an issue on stable/10, but not head... I'll see if I can MFC the change.

$ set -x; tail -20 $PWD/_.powerpc.LINT64; svnversion; uname -a
+ tail -20 /scratch/tmp/ngie/svn/_.powerpc.LINT64
linking kernel
ix_txrx.o:(.got+0x120): undefined reference to `ix_crcstrip'
*** [kernel] Error code 1

make[5]: stopped in /scratch/tmp/ngie/obj/powerpc.powerpc64/scratch/tmp/ngie/svn/sys/LINT64
1 error

make[5]: stopped in /scratch/tmp/ngie/obj/powerpc.powerpc64/scratch/tmp/ngie/svn/sys/LINT64
*** [buildkernel] Error code 2

make[4]: stopped in /scratch/tmp/ngie/svn
1 error

make[4]: stopped in /scratch/tmp/ngie/svn
*** [buildkernel] Error code 2

make[3]: stopped in /scratch/tmp/ngie/svn
1 error

make[3]: stopped in /scratch/tmp/ngie/svn
+ svnversion
292177
+ uname -a
FreeBSD ref10-amd64.freebsd.org 10.2-STABLE FreeBSD 10.2-STABLE #0 r291875: Sat Dec  5 23:54:35 UTC 2015     peter@build-10.freebsd.org:/usr/obj/usr/src/sys/CLUSTER10  amd64
Comment 7 commit-hook freebsd_committer 2015-12-14 14:44:33 UTC
A commit references this bug:

Author: ngie
Date: Mon Dec 14 14:44:23 UTC 2015
New revision: 292211
URL: https://svnweb.freebsd.org/changeset/base/292211

Log:
  Unbreak the powerpc/powerpc64 tinderbox

  PR: 198805
  Submitted by: sbruno

  MFC r280430:

  r280430 (by bz):

  Make ix_crcstrip a public symbol for the moment;  it probably is not
  the right solution but I will leave it to experts to untangle this
  problem to properly stop the build failures.

  At the moment only if_ix.c includes dev/netmap/ixgbe_netmap.h which is
  good as ixgbe_netmap.h defines a couple of (file) static variables--thus
  local to if_ix.c.
  static int ix_crcstrip however now also got checked from ix_txrx.c
  (as an extern) and should not be visible there.  In fact we do see
  powerpc and powerpc64 build failures because of this.  It is unclear
  to me why on other (clang built?) architectures this does not lead
  to a reference of an undefined symbol and similar build breakage.

Changes:
_U  stable/10/
  stable/10/sys/dev/netmap/ixgbe_netmap.h