Skip to content

Commit 5ee4434

Browse files
committed
xdp-trafficgen: Output helpful suggestions if interface probing fails
In some cases we can say something more about why probing for XDP feature support for an interface fails (because of particular driver quirks). Add output to the 'probe' command for these cases. Signed-off-by: Toke Høiland-Jørgensen <[email protected]>
1 parent b4a633a commit 5ee4434

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

xdp-trafficgen/xdp-trafficgen.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,8 +1038,23 @@ int do_probe(const void *opt, __unused const char *pin_root_path)
10381038
const struct probeopt *cfg = opt;
10391039
int err1 = 0, err2;
10401040

1041-
if (cfg->iface.ifindex)
1041+
if (cfg->iface.ifindex) {
10421042
err1 = check_iface_support(&cfg->iface);
1043+
if (err1) {
1044+
const char *name = get_driver_name(cfg->iface.ifindex);
1045+
if (driver_needs_xdp_pass(&cfg->iface)) {
1046+
pr_info(" Note that this driver (%s) needs an XDP program "
1047+
"loaded to use XDP_REDIRECT.\n"
1048+
" Loading a dummy XDP program on the interface "
1049+
"may enable support.\n", name);
1050+
} else {
1051+
1052+
if (!strcmp(name, "veth"))
1053+
pr_info(" Note that enabling GRO on both ends of a "
1054+
"veth pair may enable XDP support\n");
1055+
}
1056+
}
1057+
}
10431058

10441059
err2 = probe_kernel_support();
10451060
if (!err2)

0 commit comments

Comments
 (0)