bpf: only clean up XDP from devices with XDP attached
bpf: only clean up XDP from devices with XDP attached

Currently, during agent startup, cilium removes XDP from all
interfaces except for `cilium_host`, `cilium_net` and `$XDP_DEV`
regardless of whether there is an XDP program attached to it.

For some drivers, e.g. Mellanox mlx5, the following command will
cause device reset regardless of whether there is an XDP program
attached to it, which introduces node and pod network interruption:
`ip link set dev $DEV xdpdrv off`.

This patch adds a check of XDP program existence to avoid such
network interruption.

Fixes: #13526
Reported-by: ArthurChiao <16a56a00a836623a07eccc04d896898d9695bb9c@hotmail.com>
Signed-off-by: Jaff Cheng <99154de6adbd9e51f9917403229e99ed58e4e4f8@gmail.com>

cilium/cilium,michi-covalent/cilium,cilium/cilium,tklauser/cilium,tgraf/cilium,tgraf/cilium,tgraf/cilium,tklauser/cilium,michi-covalent/cilium,michi-covalent/cilium,tgraf/cilium,tklauser/cilium,cilium/cilium,cilium/cilium,tklauser/cilium,tklauser/cilium,tgraf/cilium,michi-covalent/cilium,michi-covalent/cilium,tgraf/cilium,cilium/cilium