Using Ubuntu 20.04, I had successfully built the Intel irdma driver. However, the kernel version changed with an update and irdma would no longer build. The solution was to get grub to default to the desired kernel version. To do this, first list /boot/grub/grub.cfg and find the appropriate string for the desired version. In my case, this was:
Ubuntu, with Linux 5.4.0-42-generic
Then, edit /etc/default/grub and change the GRUB_DEFAULT line to this:
GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 5.4.0-42-generic"
to activate the new default option and then reboot.