Pass XDP flags to the xdp ndo. This will allow drivers to look at the mode flags and make decisions about offload.
Unified · Split
| @@ -820,6 +820,7 @@ struct netdev_xdp { · 819 unmodified lines | ||
| 820 | 820 | union { |
| 821 | 821 | /* XDP_SETUP_PROG */ |
| 822 | 822 | struct { |
| 823 | + u32 flags; | |
| 823 | 824 | struct bpf_prog *prog; |
| 824 | 825 | struct netlink_ext_ack *extack; |
| 825 | 826 | }; |
| @@ -6951,7 +6951,7 @@ bool __dev_xdp_attached(struct net_device *dev, xdp_op_t xdp_op, · 6950 unmodified lines | ||
| 6951 | 6951 | } |
| 6952 | 6952 | |
| 6953 | 6953 | static int dev_xdp_install(struct net_device *dev, xdp_op_t xdp_op, |
| 6954 | − struct netlink_ext_ack *extack, | |
| 6954 | + struct netlink_ext_ack *extack, u32 flags, | |
| 6955 | 6955 | struct bpf_prog *prog) |
| 6956 | 6956 | { |
| 6957 | 6957 | struct netdev_xdp xdp; |
| @@ -6959,6 +6959,7 @@ static int dev_xdp_install(struct net_device *dev, xdp_op_t xdp_op, · 1 unmodified line | ||
| 6959 | 6959 | memset(&xdp, 0, sizeof(xdp)); |
| 6960 | 6960 | xdp.command = XDP_SETUP_PROG; |
| 6961 | 6961 | xdp.extack = extack; |
| 6962 | + xdp.flags = flags; | |
| 6962 | 6963 | xdp.prog = prog; |
| 6963 | 6964 | |
| 6964 | 6965 | return xdp_op(dev, &xdp); |
| @@ -7003,7 +7004,7 @@ int dev_change_xdp_fd(struct net_device *dev, struct netlink_ext_ack *extack, · 38 unmodified lines | ||
| 7003 | 7004 | return PTR_ERR(prog); |
| 7004 | 7005 | } |
| 7005 | 7006 | |
| 7006 | − err = dev_xdp_install(dev, xdp_op, extack, prog); | |
| 7007 | + err = dev_xdp_install(dev, xdp_op, extack, flags, prog); | |
| 7007 | 7008 | if (err < 0 && prog) |
| 7008 | 7009 | bpf_prog_put(prog); |
| 7009 | 7010 | |