attach XDP program to interface

This example uses XDP: - set interface links to up - load a XDP program from object file and attach it to eth0 - clear any attached XDP program from eth1

interfaces:
  # attach XDP program from file
  eth0:
    link:
      state: up
      kind: physical
    xdp:
      object: /home/thomas/src/xdp-tutorial/basic01-xdp-pass/xdp_pass_kern.o
      section: xdp

  # clear attached XDP program
  eth1:
    link:
      state: up
      kind: physical
    xdp: no
{
  networking.ifstate = {
    enable = true;
    settings = {
      interfaces = {
        # attach XDP program from file
        eth0 = {
          link = {
            state = "up";
            kind = "physical";
          };
          xdp = {
            object =
              "/home/thomas/src/xdp-tutorial/basic01-xdp-pass/xdp_pass_kern.o";
            section = "xdp";
          };
        };

        # clear attached XDP program
        eth1 = {
          link = {
            state = "up";
            kind = "physical";
          };
          xdp = "no";
        };
      };
    };
  };
}
# attach XDP program from file
ip link set dev eth0 up
ip link set dev enp0s31f6 xdp object /home/thomas/src/xdp-tutorial/basic01-xdp-pass/xdp_pass_kern.o section xdp

# clear attached XDP program
ip link set dev eth1 up
ip link set dev eth1 xdp off