Upgrading kernel on Ubuntu (20.04) LTS
Upgrading kernels on LTS releases of ubuntu can easily be done by enabling an LTS enablement stack. This guide will show how and what to consider.
You might like to run LTS versions of operating systems because you don't need access to the newest features direct after release. While this is a good choice for systems running a particular workload over the whole lifecycle, there are other setups where you want to get access to newer features.
In our case we've a scenario where we want to run Kubernetes with Cilium CNI and we would like to use XDP to get a very efficient and fast datapath. Ubuntu 20.04 ships with kernel 5.4 and has therefore hv_netvsc with driver version 5.4 - but XDP acceleration on Cilium requires at least version 5.6.
Long story short: We want to upgrade the kernel. Luckily - as most things in ubuntu - this is quite easy and straight forward.
Use Hardware Enablement Stack
The solution is to use the Hardware Enablement Stack (HWE) which will give you access to newer kernels. Enabling HWE is done using a single command:
As you can see we've enabled HWE and upgraded the kernel.
Applying the kernel requires a reboot here.
Where's the catch?
Well, like in probably any case there's no free lunch. In this case: HWE kernels are only supported 6 months. This is critical because support means that there won't be any security patches after quite a short time. So be sure to have the right automation tools in place to stay up to date here.
More information about LTS enablement stack is available at ubuntu's documentation: Kernel/LTSEnablementStack - Ubuntu Wiki