Skip to content

Commit 1e09e58

Browse files
l1kdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 62751b6 commit 1e09e58

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/core/pktgen.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2003,8 +2003,8 @@ static int pktgen_setup_dev(const struct pktgen_net *pn,
20032003
return -ENODEV;
20042004
}
20052005

2006-
if (odev->type != ARPHRD_ETHER) {
2007-
pr_err("not an ethernet device: \"%s\"\n", ifname);
2006+
if (odev->type != ARPHRD_ETHER && odev->type != ARPHRD_LOOPBACK) {
2007+
pr_err("not an ethernet or loopback device: \"%s\"\n", ifname);
20082008
err = -EINVAL;
20092009
} else if (!netif_running(odev)) {
20102010
pr_err("device is down: \"%s\"\n", ifname);

0 commit comments

Comments
 (0)