invarg("Invalid \"mtu\" value\n", *argv);
addattr_l(&req->n, sizeof(*req), IFLA_MTU, &mtu, 4);
} else if (strcmp(*argv, "xdpgeneric") == 0 ||
+ strcmp(*argv, "xdpdrv") == 0 ||
strcmp(*argv, "xdp") == 0) {
bool generic = strcmp(*argv, "xdpgeneric") == 0;
+ bool drv = strcmp(*argv, "xdpdrv") == 0;
NEXT_ARG();
- if (xdp_parse(&argc, &argv, req, generic))
+ if (xdp_parse(&argc, &argv, req, generic, drv))
exit(-1);
} else if (strcmp(*argv, "netns") == 0) {
NEXT_ARG();
return 0;
}
-int xdp_parse(int *argc, char ***argv, struct iplink_req *req, bool generic)
+int xdp_parse(int *argc, char ***argv, struct iplink_req *req, bool generic,
+ bool drv)
{
struct bpf_cfg_in cfg = {
.argc = *argc,
xdp.flags |= XDP_FLAGS_UPDATE_IF_NOEXIST;
if (generic)
xdp.flags |= XDP_FLAGS_SKB_MODE;
+ if (drv)
+ xdp.flags |= XDP_FLAGS_DRV_MODE;
if (*argc == 1) {
if (strcmp(**argv, "none") == 0 ||
#include "utils.h"
-int xdp_parse(int *argc, char ***argv, struct iplink_req *req, bool generic);
+int xdp_parse(int *argc, char ***argv, struct iplink_req *req, bool generic,
+ bool drv);
void xdp_dump(FILE *fp, struct rtattr *tb);
#endif /* __XDP__ */
.RB "[ " port_guid " eui64 ] ]"
.br
.in -9
-.RB "[ { " xdp " | " xdpgeneric " } { " off " | "
+.RB "[ { " xdp " | " xdpgeneric " | " xdpdrv " } { " off " | "
.br
.in +8
.BR object
loaded under
.B xdpgeneric object "|" pinned
then the kernel will use the generic XDP variant instead of the native one.
+.B xdpdrv
+has the opposite effect of requestsing that the automatic fallback to the
+generic XDP variant be disabled and in case driver is not XDP-capable error
+should be returned.
+.B xdpdrv
+also disables hardware offloads.
.B off
(or