Commit 1e09e581 authored by Lukas Wunner's avatar Lukas Wunner Committed by David S. Miller

pktgen: Allow on loopback device

When pktgen is used to measure the performance of dev_queue_xmit()
packet handling in the core, it is preferable to not hand down
packets to a low-level Ethernet driver as it would distort the
measurements.

Allow using pktgen on the loopback device, thus constraining
measurements to core code.
Signed-off-by: default avatarLukas Wunner <lukas@wunner.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 62751b68
...@@ -2003,8 +2003,8 @@ static int pktgen_setup_dev(const struct pktgen_net *pn, ...@@ -2003,8 +2003,8 @@ static int pktgen_setup_dev(const struct pktgen_net *pn,
return -ENODEV; return -ENODEV;
} }
if (odev->type != ARPHRD_ETHER) { if (odev->type != ARPHRD_ETHER && odev->type != ARPHRD_LOOPBACK) {
pr_err("not an ethernet device: \"%s\"\n", ifname); pr_err("not an ethernet or loopback device: \"%s\"\n", ifname);
err = -EINVAL; err = -EINVAL;
} else if (!netif_running(odev)) { } else if (!netif_running(odev)) {
pr_err("device is down: \"%s\"\n", ifname); pr_err("device is down: \"%s\"\n", ifname);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment