Can't compile Intel e1000e-3.8.7 driver

While compiling Intel e10002 driver for I217 adapter I get this error -

[Wed Jan 13 03:14:08 flux@flux ~/.local/src/e1000e-3.8.7] 
# sudo make -C src
[sudo] password for root: 
make: Entering directory '/home/flux/.local/src/e1000e-3.8.7/src'
expr: non-integer argument
make[1]: Entering directory '/usr/src/linux-5.3.18-lp152.57'
make[2]: Entering directory '/usr/src/linux-5.3.18-lp152.57-obj/x86_64/default'
  CC [M]  /home/flux/.local/src/e1000e-3.8.7/src/netdev.o
In file included from /home/flux/.local/src/e1000e-3.8.7/src/e1000.h:14:0,
                 from /home/flux/.local/src/e1000e-3.8.7/src/netdev.c:30:
/home/flux/.local/src/e1000e-3.8.7/src/kcompat.h:886:31: error: operator '&&' has no right operand
         SLE_LOCALVERSION_CODE >= KERNEL_VERSION(92,0,0) && \
                               ^~
/home/flux/.local/src/e1000e-3.8.7/src/kcompat.h:897:31: error: operator '==' has no left operand
        (SLE_LOCALVERSION_CODE == KERNEL_VERSION(6,33,0) || \
                               ^~
/home/flux/.local/src/e1000e-3.8.7/src/kcompat.h:910:31: error: operator '==' has no left operand
        (SLE_LOCALVERSION_CODE == KERNEL_VERSION(94,41,0) || \
                               ^~
/home/flux/.local/src/e1000e-3.8.7/src/kcompat.h:916:31: error: operator '==' has no left operand
        (SLE_LOCALVERSION_CODE == KERNEL_VERSION(23,0,0) || \
                               ^~
/home/flux/.local/src/e1000e-3.8.7/src/kcompat.h:929:30: error: operator '&&' has no right operand
        SLE_LOCALVERSION_CODE >= KERNEL_VERSION(25,23,0))
                              ^~
In file included from /home/flux/.local/src/e1000e-3.8.7/src/e1000.h:14:0,
                 from /home/flux/.local/src/e1000e-3.8.7/src/netdev.c:30:
/home/flux/.local/src/e1000e-3.8.7/src/kcompat.h:7202:30: error: operator '>=' has no left operand
       (SLE_LOCALVERSION_CODE >= KERNEL_VERSION(14,0,0)))
                              ^~
make[3]: *** [/usr/src/linux-5.3.18-lp152.57/scripts/Makefile.build:282: /home/flux/.local/src/e1000e-3.8.7/src/netdev.o] Error 1
make[2]: *** [/usr/src/linux-5.3.18-lp152.57/Makefile:1650: _module_/home/flux/.local/src/e1000e-3.8.7/src] Error 2
make[2]: Leaving directory '/usr/src/linux-5.3.18-lp152.57-obj/x86_64/default'
make[1]: *** [Makefile:179: sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-5.3.18-lp152.57'
make: *** [Makefile:73: default] Error 2
make: Leaving directory '/home/flux/.local/src/e1000e-3.8.7/src'

Any idea how to fix this.

I have no idea what is wrong, but you should never compile things as root. Run make as a normal user. Only the installation should be done as root (else you can not write to the places where it is to be installed),

Yeah, I’ll keep that in mind. I get same error with different driver versions. There were several fails with stuff like “pci_cleanup_aer_uncorrect_error_status(pdev);”, fixed those but I am not sure about the other stuff.
I removed SLE-12 to SLE15_1 and there is some progress but now there are new errors -


/home/flux/.local/src/e1000e-3.8.7/src/kcompat.h:7090:28: error: redefinition of ‘skb_frag_off’
 static inline unsigned int skb_frag_off(const skb_frag_t * frag)

Fixed it but not sure whether it will work or not -

[Wed Jan 13 04:48:59 flux@flux ~/.local/src/e1000e-3.8.7] 
# make -C src
make: Entering directory '/home/flux/.local/src/e1000e-3.8.7/src'
expr: non-integer argument
make[1]: Entering directory '/usr/src/linux-5.3.18-lp152.57'
make[2]: Entering directory '/usr/src/linux-5.3.18-lp152.57-obj/x86_64/default'
  CC [M]  /home/flux/.local/src/e1000e-3.8.7/src/netdev.o
  CC [M]  /home/flux/.local/src/e1000e-3.8.7/src/ethtool.o
  CC [M]  /home/flux/.local/src/e1000e-3.8.7/src/ich8lan.o
  CC [M]  /home/flux/.local/src/e1000e-3.8.7/src/mac.o
  CC [M]  /home/flux/.local/src/e1000e-3.8.7/src/nvm.o
  CC [M]  /home/flux/.local/src/e1000e-3.8.7/src/phy.o
  CC [M]  /home/flux/.local/src/e1000e-3.8.7/src/manage.o
  CC [M]  /home/flux/.local/src/e1000e-3.8.7/src/80003es2lan.o
  CC [M]  /home/flux/.local/src/e1000e-3.8.7/src/82571.o
  CC [M]  /home/flux/.local/src/e1000e-3.8.7/src/param.o
  CC [M]  /home/flux/.local/src/e1000e-3.8.7/src/ptp.o
  CC [M]  /home/flux/.local/src/e1000e-3.8.7/src/kcompat.o
  LD [M]  /home/flux/.local/src/e1000e-3.8.7/src/e1000e.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/flux/.local/src/e1000e-3.8.7/src/e1000e.mod.o
  LD [M]  /home/flux/.local/src/e1000e-3.8.7/src/e1000e.ko
make[2]: Leaving directory '/usr/src/linux-5.3.18-lp152.57-obj/x86_64/default'
make[1]: Leaving directory '/usr/src/linux-5.3.18-lp152.57'
make: Leaving directory '/home/flux/.local/src/e1000e-3.8.7/src'

Is there a possibility for checking the compiled driver without installing it?

insmod /home/flux/.local/src/e1000e-3.8.7/src/e1000e.ko