Intel ix driver no longer compile correcty in 12.2

pos

Member

Reaction score: 12
Messages: 78

Hi
I am using the intel ix driver instead of the one in FreeBSD (ix-3.3.18.tar.gz). https://downloadcenter.intel.com/do...10-Gigabit-Network-Connections-Under-FreeBSD-

I have been using this for a long time. This is due to my 10G test and transparent VLAN devel etc...

After upgrading from 12.1-p10 to 12.2-RELEASE I can no longer compile this. I threw the /usr/src away and downloaded 12.2 src fresh fresh. Same problem.

I have not yet done any digging. But if someone has as clue, it would be very much appreciated...

15:45:10 xanadu:~/ix-3.3.18/src # make
machine -> /usr/src/sys/amd64/include
x86 -> /usr/src/sys/x86/include
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/kern/device_if.m -h
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/kern/bus_if.m -h
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/dev/pci/pci_if.m -h
Warning: Object directory not changed from original /root/ix-3.3.18/src
cc -O2 -pipe -DSMP -DINET -DINET6 -DIXGBE_STANDALONE_BUILD -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -MD -MF.depend.if_ix.o -MTif_ix.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member -mno-aes -mno-avx -std=iso9899:1999 -c if_ix.c -o if_ix.o
In file included from if_ix.c:42:
In file included from ./ixgbe.h:93:
./freebsd_compat_common.h:142:15: error: redefinition of typedef 'iflladdr_cb_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef u_int iflladdr_cb_t(void *, struct sockaddr_dl *, u_int);
^
/usr/src/sys/net/if_var.h:742:15: note: previous definition is here
typedef u_int iflladdr_cb_t(void *, struct sockaddr_dl *, u_int);
^
1 error generated.
*** Error code 1

Stop.
make: stopped in /root/ix-3.3.18/src

Tnx
Peo
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 10,185
Messages: 35,689

Port is slightly older (3.3.14) but if I modify the version to 3.3.18 it builds just fine on 12.2-STABLE. I can't test if it actually works because I don't have the hardware.

So if you really need 3.3.18 I would suggest opening a PR and ask the maintainer if they can update it and/or supply a patch to update the port.
 

Emrion

Aspiring Daemon

Reaction score: 155
Messages: 544

Just a guess: maybe /usr/src/sys/net/if_var.h previously did not contain the iflladdr_cb_t definition. You can try to comment it out in ./freebsd_compat_common.h.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 10,185
Messages: 35,689

I suspect it's actually a compiler option. That same bit of code produces a warning, not an error, if I build my modified port.

Code:
--- ixgbe_netmap.o ---
In file included from ixgbe_netmap.c:81:
In file included from ./ixgbe.h:93:
./freebsd_compat_common.h:142:15: warning: redefinition of typedef 'iflladdr_cb_t' is a C11 feature [-Wtypedef-redefinition]
typedef u_int iflladdr_cb_t(void *, struct sockaddr_dl *, u_int);
              ^
/usr/src/sys/net/if_var.h:742:15: note: previous definition is here
typedef u_int iflladdr_cb_t(void *, struct sockaddr_dl *, u_int);
              ^
--- freebsd_compat_common.o ---
In file included from freebsd_compat_common.c:44:
./freebsd_compat_common.h:142:15: warning: redefinition of typedef 'iflladdr_cb_t' is a C11 feature [-Wtypedef-redefinition]
typedef u_int iflladdr_cb_t(void *, struct sockaddr_dl *, u_int);
              ^
/usr/src/sys/net/if_var.h:742:15: note: previous definition is here
typedef u_int iflladdr_cb_t(void *, struct sockaddr_dl *, u_int);
              ^
1 warning generated.
 
OP
pos

pos

Member

Reaction score: 12
Messages: 78

Port is slightly older (3.3.14) but if I modify the version to 3.3.18 it builds just fine on 12.2-STABLE. I can't test if it actually works because I don't have the hardware.

So if you really need 3.3.18 I would suggest opening a PR and ask the maintainer if they can update it and/or supply a patch to update the port.
Same problem on 3.3.14 as I used before trying 3.3.18.

I upgraded to 12.2-RELEASE and at the same time saw 3.3.18, but it did not work. Then I tried to compile 3.3.14 That did compile fine on 12.1. But 3.3.14 had the same problem on 12.2 as 3.3.18
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 10,185
Messages: 35,689

I does not update as quickly
Talk to the maintainer.

lacks options so I have to rebuild it...
What options are missing? Again, talk to the maintainer and ask if he can add the missing options.

Fixing the port will benefit everybody, not just you.
 
OP
pos

pos

Member

Reaction score: 12
Messages: 78

I suspect it's actually a compiler option. That same bit of code produces a warning, not an error, if I build my modified port.

Code:
--- ixgbe_netmap.o ---
In file included from ixgbe_netmap.c:81:
In file included from ./ixgbe.h:93:
./freebsd_compat_common.h:142:15: warning: redefinition of typedef 'iflladdr_cb_t' is a C11 feature [-Wtypedef-redefinition]
typedef u_int iflladdr_cb_t(void *, struct sockaddr_dl *, u_int);
              ^
/usr/src/sys/net/if_var.h:742:15: note: previous definition is here
typedef u_int iflladdr_cb_t(void *, struct sockaddr_dl *, u_int);
              ^
--- freebsd_compat_common.o ---
In file included from freebsd_compat_common.c:44:
./freebsd_compat_common.h:142:15: warning: redefinition of typedef 'iflladdr_cb_t' is a C11 feature [-Wtypedef-redefinition]
typedef u_int iflladdr_cb_t(void *, struct sockaddr_dl *, u_int);
              ^
/usr/src/sys/net/if_var.h:742:15: note: previous definition is here
typedef u_int iflladdr_cb_t(void *, struct sockaddr_dl *, u_int);
              ^
1 warning generated.
I get an error so it does not build at all.

I will dig into it later today :)
 
OP
pos

pos

Member

Reaction score: 12
Messages: 78

Talk to the maintainer.


What options are missing? Again, talk to the maintainer and ask if he can add the missing options.

Fixing the port will benefit everybody, not just you.
Transparent VLANs is one. I had a mail discussion with the maintainer of the port earlier. He added one compile option I needed. But the FreeBSD driver lacks so much stuff Intel have in the Linux driver. So I am doing some transparent VLAN modifications myself in the source. Some stuff is half there...

I started with SR-IOV, but directly saw transparent VLANs was missing i FreeBSD. But of course there in Linux and windows... So I am spending some spare tim on that.

B t w.... I used to use that port...
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 10,185
Messages: 35,689

This looks relevant:
Code:
MAKE_ENV+=      WERROR=""
So try something like make -DWERROR

I get the exact same redefinition of typedef messages, complaining about the same thing. But with the port they're warnings, not errors.
 

Emrion

Aspiring Daemon

Reaction score: 155
Messages: 544

I downloaded the driver, commented out the iflladdr_cb_t definition in ./freebsd_compat_common.h.

You know what? It compiles successfully (on a 12.2-RELEASE). I can't test further as I don't have the hardware.
 
Last edited:

Emrion

Aspiring Daemon

Reaction score: 155
Messages: 544

In fact, the problem lies there:
C:
#if __FreeBSD_version < 1300051
struct sockaddr_dl;
typedef u_int iflladdr_cb_t(void *, struct sockaddr_dl *, u_int);
u_int if_foreach_lladdr(if_t ifp, iflladdr_cb_t cb, void *cb_arg);
u_int if_foreach_llmaddr(if_t ifp, iflladdr_cb_t cb, void *cb_arg);
u_int if_lladdr_count(if_t ifp);
u_int if_llmaddr_count(if_t ifp);
#endif
This code works:
C:
#if __FreeBSD_version < 1202000
struct sockaddr_dl;
typedef u_int iflladdr_cb_t(void *, struct sockaddr_dl *, u_int);
#endif
#if __FreeBSD_version < 1300051
u_int if_foreach_lladdr(if_t ifp, iflladdr_cb_t cb, void *cb_arg);
u_int if_foreach_llmaddr(if_t ifp, iflladdr_cb_t cb, void *cb_arg);
u_int if_lladdr_count(if_t ifp);
u_int if_llmaddr_count(if_t ifp);
#endif
I attach the patch if someone is interested.
 

Attachments

  • patch_ix-3.3.18_freebsd_compat_common.h.txt
    135 bytes · Views: 33
OP
pos

pos

Member

Reaction score: 12
Messages: 78

FYI

I communicated with Intel a couple of days ago. Yesterday they said:

--snip--
We've had a fix internally for this, but it didn't make it into our latest downloadcenter driver release.

Instead, we should have a new version that works with FreeBSD 12.2 out near the end of the year.
--snip--
 

Emrion

Aspiring Daemon

Reaction score: 155
Messages: 544

FYI

I communicated with Intel a couple of days ago. Yesterday they said:

--snip--
We've had a fix internally for this, but it didn't make it into our latest downloadcenter driver release.

Instead, we should have a new version that works with FreeBSD 12.2 out near the end of the year.
--snip--
I don't understand your point. You have a patch, but you will wait until Christmas? :rolleyes:
After all, that's the right time. :)
 
OP
pos

pos

Member

Reaction score: 12
Messages: 78

I don't understand your point. You have a patch, but you will wait until Christmas? :rolleyes:
After all, that's the right time. :)

:)

Well... My point was to feed it back to intel so they could correct the source, not to wait :) I fixed it myself directly after posting here. Before the patch in this thread....
 

Emrion

Aspiring Daemon

Reaction score: 155
Messages: 544

Just a guess: maybe /usr/src/sys/net/if_var.h previously did not contain the iflladdr_cb_t definition. You can try to comment it out in ./freebsd_compat_common.h.
And before that as well, I suppose. 🙃
 
OP
pos

pos

Member

Reaction score: 12
Messages: 78

And before that as well, I suppose. 🙃
Before that was posted, I don't know :) ha ha I was looking into the code and do not watch the forum every minute, even though I love this forum. I was earlier a fan of OpenBSD for so may years I cannot count. But now I like FreeBSD more. And the FreeBSD forum is great with many competent nice people. The original post was before I even had a time to look at the problem, and there are som many competent persons i this forum. I though someone already had seen it. That's all.

I do other mods in the code as well. Well... trying.... :) to do some stuff around transparent VLANs so SR-IOV would be more usable. I have done some presentations on FreeBSD meetups regarding KVM to BHYVE migration with SR-IOV and VLANS. Then I came across the lack of transparent VLANs in FreeBSD. That was what took my interest in this. SR-IOV works for some cards due to great work done by another guy. But the VF function for transparent VLANs is missing in the FreeBSD driver, but is there in the Linux and windows driver. On spare time I try to make a working "transparentvlan" addition :) This is also the reason I do not use the existing intel-ix-kmod at the moment. It is going slowly forward though as I not have that much time to spare and also have to look at other code blocks outside the driver as well.
 

warwickt

New Member


Messages: 2

Gentlemen, I wish to report that your intel-ix-kmod-3.3.18 patch intel-ixl-kmod/files/patch-freebsd__compat__common.h works very well on our FreeBSD 12.2 ZFS server with the heavy lifting 10GbE LAN and its Intel X500-T1.

Your patch appears so far to enable a better through put with several workstation hosts that use the non-Intel flavour .. Aquantia ACQ107 PCI-e Asus XG-C100C's and MacOS ACQ107NICs.
  1. apply patch to /usr/ports/net
    Code:
    |===================================================================
    |--- intel-ix-kmod/Makefile    (revision 554434)
    |+++ intel-ix-kmod/Makefile    (working copy)
    --------------------------
    Patching file intel-ix-kmod/Makefile using Plan A...
    Hunk #1 succeeded at 2 with fuzz 1.
    Hmm...  The next patch looks like a unified diff to me...
    The text leading up to this was:
    --------------------------
    |Index: intel-ix-kmod/distinfo
    |===================================================================
    |--- intel-ix-kmod/distinfo    (revision 554434)
    |+++ intel-ix-kmod/distinfo    (working copy)
    --------------------------
    Patching file intel-ix-kmod/distinfo using Plan A...
    Hunk #1 succeeded at 1.
    done
  2. assemble and link:
    cd /usr/ports; portmaster net/intel-ix-kmod
  3. check the inventory
    Code:
    # pkg info intel-ix-kmod-3.3.18
    intel-ix-kmod-3.3.18
    Name           : intel-ix-kmod
    Version        : 3.3.18
    Installed on   : Sat Jan  9 13:15:39 2021 HKT
    Origin         : net/intel-ix-kmod
    Architecture   : FreeBSD:12:amd64
    Prefix         : /usr/local
    Categories     : net kld
    Licenses       : BSD2CLAUSE
    Maintainer     : freebsd@intel.com
    WWW            : https://downloadcenter.intel.com
    Comment        : 10 gigabit FreeBSD Base Driver for Intel(R) Network Connections
    Options        :
        NETMAP_AUTO    : on
        NETMAP_OFF     : off
        NETMAP_ON      : off
        SRIOV          : off
    Annotations    :
        FreeBSD_version: 1201000
    Flat size      : 343KiB
    Description    :
    This release includes the 10 gigabit FreeBSD*-based driver for Intel(R) Network
    Connections.
    The ix driver supports all 10 gigabit network connections based on
    82599, 82598EB, X520, X540, and X550 series controllers.
    WWW: https://downloadcenter.intel.com
  4. Change the startup the .ko in /boot/modules/if_ix_updated.ko
    Code:
    if_ix_updated_load="YES"
  5. See where it landed after startup..
    Code:
    # kldstat -hv -n if_ix_updated.ko
    Id Refs Address             Size Name
    6    1 0xffffffff82a3f000  360K if_ix_updated.ko (/boot/modules/if_ix_updated.ko)
        Contains modules:
             Id Name
              8 pci/ix
Works well for the last 12 hours .
Many Thanks to you all and sundry for your marvellous dedication and effort.:)👍
WarwickT
Hong Kong
 

Emrion

Aspiring Daemon

Reaction score: 155
Messages: 544

At least, my little work will be of some use. Some people seem to make patches and keep them to themselves... 😀
 
Top