ip: link: add support for netdevsim device type
netdevsim is a new software device for testing kernel APIs without any hardware attached. Allow users to create such devices. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
This commit is contained in:
parent
874c734c1c
commit
7d424c7193
|
|
@ -10,7 +10,7 @@ IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o ipnetns.o \
|
||||||
link_iptnl.o link_gre6.o iplink_bond.o iplink_bond_slave.o iplink_hsr.o \
|
link_iptnl.o link_gre6.o iplink_bond.o iplink_bond_slave.o iplink_hsr.o \
|
||||||
iplink_bridge.o iplink_bridge_slave.o ipfou.o iplink_ipvlan.o \
|
iplink_bridge.o iplink_bridge_slave.o ipfou.o iplink_ipvlan.o \
|
||||||
iplink_geneve.o iplink_vrf.o iproute_lwtunnel.o ipmacsec.o ipila.o \
|
iplink_geneve.o iplink_vrf.o iproute_lwtunnel.o ipmacsec.o ipila.o \
|
||||||
ipvrf.o iplink_xstats.o ipseg6.o
|
ipvrf.o iplink_xstats.o ipseg6.o iplink_netdevsim.o
|
||||||
|
|
||||||
RTMONOBJ=rtmon.o
|
RTMONOBJ=rtmon.o
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ static void usage(void)
|
||||||
fprintf(stderr, " bridge | bond | ipoib | ip6tnl | ipip | sit | vxlan | lowpan |\n");
|
fprintf(stderr, " bridge | bond | ipoib | ip6tnl | ipip | sit | vxlan | lowpan |\n");
|
||||||
fprintf(stderr, " gre | gretap | erspan | ip6gre | ip6gretap | ip6erspan | vti |\n");
|
fprintf(stderr, " gre | gretap | erspan | ip6gre | ip6gretap | ip6erspan | vti |\n");
|
||||||
fprintf(stderr, " nlmon | can | bond_slave | ipvlan | geneve | bridge_slave |\n");
|
fprintf(stderr, " nlmon | can | bond_slave | ipvlan | geneve | bridge_slave |\n");
|
||||||
fprintf(stderr, " hsr | macsec\n");
|
fprintf(stderr, " hsr | macsec | netdevsim\n");
|
||||||
|
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ void iplink_usage(void)
|
||||||
" bridge | bond | team | ipoib | ip6tnl | ipip | sit | vxlan |\n"
|
" bridge | bond | team | ipoib | ip6tnl | ipip | sit | vxlan |\n"
|
||||||
" gre | gretap | erspan | ip6gre | ip6gretap | ip6erspan |\n"
|
" gre | gretap | erspan | ip6gre | ip6gretap | ip6erspan |\n"
|
||||||
" vti | nlmon | team_slave | bond_slave | ipvlan | geneve |\n"
|
" vti | nlmon | team_slave | bond_slave | ipvlan | geneve |\n"
|
||||||
" bridge_slave | vrf | macsec }\n");
|
" bridge_slave | vrf | macsec | netdevsim }\n");
|
||||||
}
|
}
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "utils.h"
|
||||||
|
#include "ip_common.h"
|
||||||
|
|
||||||
|
static void netdevsim_print_help(struct link_util *lu,
|
||||||
|
int argc, char **argv, FILE *f)
|
||||||
|
{
|
||||||
|
fprintf(f, "Usage: ... netdevsim\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
struct link_util netdevsim_link_util = {
|
||||||
|
.id = "netdevsim",
|
||||||
|
.print_help = netdevsim_print_help,
|
||||||
|
};
|
||||||
|
|
@ -217,7 +217,8 @@ ip-link \- network device configuration
|
||||||
.BR lowpan " |"
|
.BR lowpan " |"
|
||||||
.BR geneve " |"
|
.BR geneve " |"
|
||||||
.BR vrf " |"
|
.BR vrf " |"
|
||||||
.BR macsec " ]"
|
.BR macsec " |"
|
||||||
|
.BR netdevsim " ]"
|
||||||
|
|
||||||
.ti -8
|
.ti -8
|
||||||
.IR ETYPE " := [ " TYPE " |"
|
.IR ETYPE " := [ " TYPE " |"
|
||||||
|
|
@ -337,6 +338,9 @@ Link types:
|
||||||
.sp
|
.sp
|
||||||
.BR vrf
|
.BR vrf
|
||||||
- Interface for L3 VRF domains
|
- Interface for L3 VRF domains
|
||||||
|
.sp
|
||||||
|
.BR netdevsim
|
||||||
|
- Interface for netdev API tests
|
||||||
.in -8
|
.in -8
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue