diff options
author | 2020-03-10 11:49:46 +0100 | |
---|---|---|
committer | 2020-03-10 15:44:59 -0700 | |
commit | 1e09e5818b3a07ee824addf0d048df3797de687e (patch) | |
tree | e55336a292a07d8e03f5a69b7087512d10dc2247 /net | |
parent | flow_offload: use flow_action_for_each in flow_action_mixed_hw_stats_types_ch... (diff) | |
download | linux-1e09e5818b3a07ee824addf0d048df3797de687e.tar.gz linux-1e09e5818b3a07ee824addf0d048df3797de687e.tar.bz2 linux-1e09e5818b3a07ee824addf0d048df3797de687e.zip |
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: Lukas Wunner <lukas@wunner.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/pktgen.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index acc849df60b5..f2b3d8dd40f4 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c @@ -2003,8 +2003,8 @@ static int pktgen_setup_dev(const struct pktgen_net *pn, return -ENODEV; } - if (odev->type != ARPHRD_ETHER) { - pr_err("not an ethernet device: \"%s\"\n", ifname); + if (odev->type != ARPHRD_ETHER && odev->type != ARPHRD_LOOPBACK) { + pr_err("not an ethernet or loopback device: \"%s\"\n", ifname); err = -EINVAL; } else if (!netif_running(odev)) { pr_err("device is down: \"%s\"\n", ifname); |