Eliminate the term slave in iproute2
Subsystems (3)
cover Eliminate the term slave in iproute2
These patches remove the term slave from the iproute2 visible command line, documentation, and variable naming.
This needs doing despite the fact it will cause cosmetic changes to visible outputs.
Stephen Hemminger (5):
bpf: replace slave with sub
bridge: remove slave from comments and message
testsuite: replace Enslave with Insert
ip: replace slave_kind
ip: rename slave to subport
bridge/vlan.c | 4 +-
ip/Makefile | 4 +-
ip/ip_common.h | 2 +-
ip/ipaddress.c | 44 ++++++++--------
ip/iplink.c | 4 +-
ip/iplink_bond.c | 44 ++++++++--------
...ink_bond_slave.c => iplink_bond_subport.c} | 48 ++++++++---------
...bridge_slave.c => iplink_bridge_subport.c} | 52 +++++++++----------
ip/iplink_hsr.c | 20 +++----
ip/iplink_team.c | 10 ++--
ip/iplink_vrf.c | 8 +--
ip/iplink_xstats.c | 2 +-
lib/bpf.c | 8 +--
lib/namespace.c | 2 +-
man/man8/ip-address.8.in | 8 +--
man/man8/ip-link.8.in | 26 +++++-----
man/man8/ip-nexthop.8 | 2 +-
testsuite/tests/bridge/vlan/show.t | 4 +-
testsuite/tests/bridge/vlan/tunnelshow.t | 4 +-
19 files changed, 148 insertions(+), 148 deletions(-)
rename ip/{iplink_bond_slave.c => iplink_bond_subport.c} (74%)
rename ip/{iplink_bridge_slave.c => iplink_bridge_subport.c} (88%)Signature · 1 line
2.26.2
PATCH 1/5 bpf: replace slave with sub
The term sub interface is more appropriate for bpf devices.
--- lib/bpf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
lib/bpf.c +4 -4
@@ -666,7 +666,7 @@ static int bpf_gen_master(const char *base, const char *name)return bpf_gen_global (bpf_sub_dir); } -static int bpf_slave_via_bind_mnt (const char *full_name, +static int bpf_sub_via_bind_mnt (const char *full_name,const char *full_link) {int ret;
@@ -689,7 +689,7 @@ static int bpf_slave_via_bind_mnt(const char *full_name,return ret; } -static int bpf_gen_slave (const char *base,const char *name, +static int bpf_gen_sub (const char *base,const char *name,const char *link) {char bpf_lnk_dir[PATH_MAX +NAME_MAX +1 ];
@@ -709,7 +709,7 @@ static int bpf_gen_slave(const char *base, const char *name,return ret; } -return bpf_slave_via_bind_mnt (bpf_sub_dir, +return bpf_sub_via_bind_mnt (bpf_sub_dir, bpf_lnk_dir); }
@@ -733,7 +733,7 @@ static int bpf_gen_hierarchy(const char *base) ret =bpf_gen_master (base,bpf_prog_to_subdir (__bpf_types[0 ]));for (i =1 ; i <ARRAY_SIZE (__bpf_types) && !ret; i++) - ret =bpf_gen_slave (base, + ret =bpf_gen_sub (base,bpf_prog_to_subdir (__bpf_types[i]),bpf_prog_to_subdir (__bpf_types[0 ]));return ret;
Signature · 1 line
2.26.2
PATCH 2/5 bridge: remove slave from comments and message
In reply to Stephen HemmingerNo need for slave in comment and message.
Can't change API (yet) since part of Linux uapi.
--- bridge/vlan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
bridge/vlan.c +2 -2
@@ -469,7 +469,7 @@ static void print_vlan_stats_attr(struct rtattr *attr, int ifindex)if (filter_vlan && filter_vlan != vstats->vid)continue ; -/* skip pure port entries, they'll be dumped via the slave stats call */ +/* skip pure port entries, they'll be dumped via the port stats call */ if ((vstats->flags &BRIDGE_VLAN_INFO_MASTER ) && !(vstats->flags &BRIDGE_VLAN_INFO_BRENTRY ))continue ;
@@ -592,7 +592,7 @@ static int vlan_show(int argc, char **argv, int subject) filt_mask =IFLA_STATS_FILTER_BIT (IFLA_STATS_LINK_XSTATS_SLAVE );if (rtnl_statsdump_req_filter (&rth,AF_UNSPEC , filt_mask) <0 ) { -perror ("Cannot send slave dump request" ); +perror ("Cannot send port stats dump request" );exit (1 ); }
Signature · 1 line
2.26.2
PATCH 3/5 testsuite: replace Enslave with Insert
In reply to Stephen HemmingerUse the term insert instead of enslave because it is more descriptive and less offensive.
--- testsuite/tests/bridge/vlan/show.t | 4 ++-- testsuite/tests/bridge/vlan/tunnelshow.t | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
testsuite/tests/bridge/vlan/show.t +2 -2
@@ -12,13 +12,13 @@ ts_ip "$0" "Add $BR_DEV bridge interface" link add $BR_DEV type bridge ts_ip "$0" "Add $VX0_DEV vxlan interface" \ link add $VX0_DEV type vxlan dstport 4789 external -ts_ip "$0" "Enslave $VX0_DEV under $BR_DEV" \ +ts_ip "$0" "Insert $VX0_DEV under $BR_DEV" \ link set dev $VX0_DEV master $BR_DEV ts_bridge "$0" "Delete default vlan from $VX0_DEV" \ vlan del dev $VX0_DEV vid 1 ts_ip "$0" "Add $VX1_DEV vxlan interface" \ link add $VX1_DEV type vxlan dstport 4790 external -ts_ip "$0" "Enslave $VX1_DEV under $BR_DEV" \ +ts_ip "$0" "Insert $VX1_DEV under $BR_DEV" \ link set dev $VX1_DEV master $BR_DEV # Test that bridge ports without vlans do not appear in the output
testsuite/tests/bridge/vlan/tunnelshow.t +1 -1
@@ -11,7 +11,7 @@ ts_ip "$0" "Add $BR_DEV bridge interface" link add $BR_DEV type bridge ts_ip "$0" "Add $VX_DEV vxlan interface" \ link add $VX_DEV type vxlan dstport 4789 external -ts_ip "$0" "Enslave $VX_DEV under $BR_DEV" \ +ts_ip "$0" "Insert $VX_DEV under $BR_DEV" \ link set dev $VX_DEV master $BR_DEV ts_ip "$0" "Set vlan_tunnel on $VX_DEV" \ link set dev $VX_DEV type bridge_slave vlan_tunnel on
Signature · 1 line
2.26.2
PATCH 4/5 ip: replace slave_kind
In reply to Stephen HemmingerInstead of slave_kind, rename variable to sub_kind to describe the kind of sub-device that is being looked for when filtering messages.
--- ip/ip_common.h | 2 +- ip/ipaddress.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
ip/ip_common.h +1 -1
@@ -23,7 +23,7 @@ struct link_filter {int group;int master;char *kind; -char *slave_kind; +char *sub_kind;int target_nsid; };
ip/ipaddress.c +2 -2
@@ -924,7 +924,7 @@ int print_linkinfo(struct nlmsghdr *n, void *arg)if (filter.kind &&match_link_kind (tb, filter.kind,0 ))return -1 ; -if (filter.slave_kind &&match_link_kind (tb, filter.slave_kind,1 )) +if (filter.sub_kind &&match_link_kind (tb, filter.sub_kind,1 ))return -1 ;if (n->nlmsg_type ==RTM_DELLINK )
@@ -2012,7 +2012,7 @@ static int ipaddr_list_flush_or_save(int argc, char **argv, int action) soff =strlen (*argv) -strlen ("_slave" );if (!strcmp (*argv + soff,"_slave" )) { (*argv)[soff] ='\0' ; - filter.slave_kind = *argv; + filter.sub_kind = *argv; }else { filter.kind = *argv; }
Signature · 1 line
2.26.2
PATCH 5/5 ip: rename slave to subport
In reply to Stephen HemmingerReplace use of slave by subport in bridge/bond/team/vrf and hsr. The word slave is unnecessarily hostile and is not used in any of the relevant standards from IETF or IEEE.
Use the term subport across the iproute2 command set instead.
Patches to keep old term on input with nag warnings are underconsideration.
---
ip/Makefile | 4 +-
ip/ip_common.h | 2 +-
ip/ipaddress.c | 44 ++++++++--------
ip/iplink.c | 4 +-
ip/iplink_bond.c | 44 ++++++++--------
...ink_bond_slave.c => iplink_bond_subport.c} | 48 ++++++++---------
...bridge_slave.c => iplink_bridge_subport.c} | 52 +++++++++----------
ip/iplink_hsr.c | 20 +++----
ip/iplink_team.c | 10 ++--
ip/iplink_vrf.c | 8 +--
ip/iplink_xstats.c | 2 +-
lib/namespace.c | 2 +-
man/man8/ip-address.8.in | 8 +--
man/man8/ip-link.8.in | 26 +++++-----
man/man8/ip-nexthop.8 | 2 +-
testsuite/tests/bridge/vlan/tunnelshow.t | 2 +-
16 files changed, 139 insertions(+), 139 deletions(-)
rename ip/{iplink_bond_slave.c => iplink_bond_subport.c} (74%)
rename ip/{iplink_bridge_slave.c => iplink_bridge_subport.c} (88%)ip/Makefile +2 -2
@@ -7,8 +7,8 @@ IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o ipnetns.o \ iplink_vlan.o link_veth.o link_gre.o iplink_can.o iplink_xdp.o \ iplink_macvlan.o ipl2tp.o link_vti.o link_vti6.o link_xfrm.o \ iplink_vxlan.o tcp_metrics.o iplink_ipoib.o ipnetconf.o link_ip6tnl.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 \ + link_iptnl.o link_gre6.o iplink_bond.o iplink_bond_subport.o iplink_hsr.o \ + iplink_bridge.o iplink_bridge_subport.o ipfou.o iplink_ipvlan.o \ iplink_geneve.o iplink_vrf.o iproute_lwtunnel.o ipmacsec.o ipila.o \ ipvrf.o iplink_xstats.o ipseg6.o iplink_netdevsim.o iplink_rmnet.o \ ipnexthop.o ipmptcp.o
ip/ip_common.h +1 -1
@@ -23,7 +23,7 @@ struct link_filter {int group;int master;char *kind; -char *sub_kind; +char *subport_kind;int target_nsid; };
ip/ipaddress.c +22 -22
104 lines not on this page · raw message
ip/iplink.c +2 -2
@@ -123,7 +123,7 @@ void iplink_usage(void)"TYPE := { vlan | veth | vcan | vxcan | dummy | ifb | macvlan | macvtap |\n" " bridge | bond | team | ipoib | ip6tnl | ipip | sit | vxlan |\n" " gre | gretap | erspan | ip6gre | ip6gretap | ip6erspan |\n" -" vti | nlmon | team_slave | bond_slave | bridge_slave |\n" +" vti | nlmon | team_subport | bond_subport | bridge_subport |\n" " ipvlan | ipvtap | geneve | vrf | macsec | netdevsim | rmnet |\n" " xfrm }\n"); }
@@ -1052,7 +1052,7 @@ static int iplink_modify(int cmd, unsigned int flags, int argc, char **argv) strlen(type)); lu =get_link_kind (type); -if (ulinep && !strcmp (ulinep,"_slave" )) +if (ulinep && !strcmp (ulinep,"_subport" )) iflatype =IFLA_INFO_SLAVE_DATA ;else iflatype =IFLA_INFO_DATA ;
ip/iplink_bond.c +22 -22
115 lines not on this page · raw message
ip/iplink_bond_subport.c renamed from ip/iplink_bond_slave.c +24 -24
142 lines not on this page · raw message
ip/iplink_bridge_subport.c renamed from ip/iplink_bridge_slave.c +26 -26
149 lines not on this page · raw message
ip/iplink_hsr.c +10 -10
@@ -24,13 +24,13 @@static void print_usage (FILE *f) {fprintf (f, -"Usage:\tip link add name NAME type hsr slave1 SLAVE1-IF slave2 SLAVE2-IF\n" +"Usage:\tip link add name NAME type hsr subport1 SLAVE1-IF subport2 SLAVE2-IF\n" "\t[ supervision ADDR-BYTE ] [version VERSION]\n" "\n" "NAME\n" " name of new hsr device (e.g. hsr0)\n" "SLAVE1-IF, SLAVE2-IF\n" -" the two slave devices bound to the HSR device\n" +" the two subport devices bound to the HSR device\n" "ADDR-BYTE\n" " 0-255; the last byte of the multicast address used for HSR supervision\n" " frames (default = 0)\n"
@@ -64,13 +64,13 @@ static int hsr_parse_opt(struct link_util *lu, int argc, char **argv,invarg ("version is invalid" , *argv);addattr_l (n,1024 ,IFLA_HSR_VERSION , &protocol_version,1 ); - }else if (matches (*argv,"slave1" ) ==0 ) { + }else if (matches (*argv,"subport1" ) ==0 ) {NEXT_ARG (); ifindex =ll_name_to_index (*argv);if (ifindex ==0 )invarg ("No such interface" , *argv);addattr_l (n,1024 ,IFLA_HSR_SLAVE1 , &ifindex,4 ); - }else if (matches (*argv,"slave2" ) ==0 ) { + }else if (matches (*argv,"subport2" ) ==0 ) {NEXT_ARG (); ifindex =ll_name_to_index (*argv);if (ifindex ==0 )
@@ -112,19 +112,19 @@ static void hsr_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])if (tb[IFLA_HSR_SLAVE1 ])print_string (PRINT_ANY , -"slave1" , -"slave1 %s " , +"subport1" , +"subport1 %s " ,ll_index_to_name (rta_getattr_u32 (tb[IFLA_HSR_SLAVE1 ])));else -print_null (PRINT_ANY ,"slave1" ,"slave1 %s " ,"<none>" ); +print_null (PRINT_ANY ,"subport1" ,"subport1 %s " ,"<none>" );if (tb[IFLA_HSR_SLAVE2 ])print_string (PRINT_ANY , -"slave2" , -"slave2 %s " , +"subport2" , +"subport2 %s " ,ll_index_to_name (rta_getattr_u32 (tb[IFLA_HSR_SLAVE2 ])));else -print_null (PRINT_ANY ,"slave2" ,"slave2 %s " ,"<none>" ); +print_null (PRINT_ANY ,"subport2" ,"subport2 %s " ,"<none>" );if (tb[IFLA_HSR_SEQ_NR ]) print_int(PRINT_ANY,
ip/iplink_team.c +5 -5
@@ -11,16 +11,16 @@ static void team_print_help(struct link_util *lu,fprintf (f,"Usage: ... team\n" ); } -static void team_slave_print_help (struct link_util *lu, +static void team_subport_print_help (struct link_util *lu,int argc,char **argv,FILE *f) { -fprintf (f,"Usage: ... team_slave\n" ); +fprintf (f,"Usage: ... team_subport\n" ); }struct link_util team_link_util = { .id ="team" , .print_help = team_print_help, -}, team_slave_link_util = { - .id ="team_slave" , - .print_help = team_slave_print_help, +}, team_subport_link_util = { + .id ="team_subport" , + .print_help = team_subport_print_help, };
ip/iplink_vrf.c +4 -4
@@ -68,7 +68,7 @@ static void vrf_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[]) rta_getattr_u32(tb[IFLA_VRF_TABLE])); } -static void vrf_slave_print_opt (struct link_util *lu,FILE *f, +static void vrf_subport_print_opt (struct link_util *lu,FILE *f,struct rtattr *tb[]) {if (!tb)
@@ -96,10 +96,10 @@ struct link_util vrf_link_util = { .print_help = vrf_print_help, }; -struct link_util vrf_slave_link_util = { - .id ="vrf_slave" , +struct link_util vrf_subport_link_util = { + .id ="vrf_subport" , .maxattr =IFLA_VRF_PORT_MAX , - .print_opt = vrf_slave_print_opt, + .print_opt = vrf_subport_print_opt, };/* returns table id if name is a VRF device */
ip/iplink_xstats.c +1 -1
@@ -60,7 +60,7 @@ int iplink_ifla_xstats(int argc, char **argv) lu->parse_ifla_xstats(lu, argc-1, argv+1))return -1 ; -if (strstr (lu->id,"_slave" )) +if (strstr (lu->id,"_subport" )) filt_mask =IFLA_STATS_FILTER_BIT (IFLA_STATS_LINK_XSTATS_SLAVE );else filt_mask =IFLA_STATS_FILTER_BIT (IFLA_STATS_LINK_XSTATS );
lib/namespace.c +1 -1
@@ -75,7 +75,7 @@ int netns_switch(char *name) }/* Don't let any mounts propagate back to the parent */ if (mount ("" ,"/" ,"none" ,MS_SLAVE |MS_REC ,NULL )) { -fprintf (stderr,"\"mount --make-rslave /\" failed: %s\n" , +fprintf (stderr,"\"mount --make-rsubport /\" failed: %s\n" ,strerror (errno));return -1 ; }
man/man8/ip-address.8.in +4 -4
@@ -108,9 +108,9 @@ ip-address \- protocol address management .ti -8 .IR TYPE " := [ " .BR bridge " | " -.BR bridge_slave " |" +.BR bridge_subport " |" .BR bond " | " -.BR bond_slave " |" +.BR bond_subport " |" .BR can " | " .BR dummy " | " .BR hsr " | "
@@ -320,11 +320,11 @@ is a usual shell style pattern. .TP .BI master " DEVICE" -only list interfaces enslaved to this master device. +only list interfaces ensubportd to this master device. .TP .BI vrf " NAME " -only list interfaces enslaved to this vrf. +only list interfaces ensubportd to this vrf. .TP .BI type " TYPE"
man/man8/ip-link.8.in +13 -13
@@ -231,7 +231,7 @@ ip-link \- network device configuration .ti -8 .IR ETYPE " := [ " TYPE " |" -.BR bridge_slave " | " bond_slave " ]" +.BR bridge_subport " | " bond_subport " ]" .ti -8 .IR VFVLAN-LIST " := [ " VFVLAN-LIST " ] " VFVLAN
@@ -1357,7 +1357,7 @@ For a link of type the following additional arguments are supported: .BI "ip link add link " DEVICE " name " NAME " type hsr" -.BI slave1 " SLAVE1-IF " slave2 " SLAVE2-IF " +.BI subport1 " SLAVE1-IF " subport2 " SLAVE2-IF " .RB [ " supervision" .IR ADDR-BYTE " ] [" .BR version " { " 0 " | " 1 " } ]"
@@ -1367,10 +1367,10 @@ the following additional arguments are supported: .BR type " hsr " - specifies the link type to use, here HSR. -.BI slave1 " SLAVE1-IF " +.BI subport1 " SLAVE1-IF " - Specifies the physical device used for the first of the two ring ports. -.BI slave2 " SLAVE2-IF " +.BI subport2 " SLAVE2-IF " - Specifies the physical device used for the second of the two ring ports. .BI supervision " ADDR-BYTE"
@@ -2136,7 +2136,7 @@ described already. .TP .BI master " DEVICE" -set master device of the device (enslave device). +set master device of the device (ensubport device). .TP .BI nomaster
@@ -2168,7 +2168,7 @@ set peer netnsid for a cross-netns interface Change type-specific settings. For a list of supported types and arguments refer to the description of .B "ip link add" -above. In addition to that, it is possible to manipulate settings to slave +above. In addition to that, it is possible to manipulate settings to subport devices: .TP
@@ -2177,7 +2177,7 @@ For a link with master .B bridge the following additional arguments are supported: -.B "ip link set type bridge_slave" +.B "ip link set type bridge_subport" [ .B fdb_flush ] [
@@ -2226,7 +2226,7 @@ the following additional arguments are supported: .in +8 .sp .B fdb_flush -- flush bridge slave's fdb dynamic entries. +- flush bridge subport's fdb dynamic entries. .BI state " STATE" - Set port state.
@@ -2331,7 +2331,7 @@ For a link with master .B bond the following additional arguments are supported: -.B "ip link set type bond_slave" +.B "ip link set type bond_subport" [ .BI queue_id " ID" ]
@@ -2339,7 +2339,7 @@ the following additional arguments are supported: .in +8 .sp .BI queue_id " ID" -- set the slave's queue ID (a 16bit unsigned value). +- set the subport's queue ID (a 16bit unsigned value). .in -8
@@ -2388,12 +2388,12 @@ only display running interfaces. .TP .BI master " DEVICE " .I DEVICE -specifies the master device which enslaves devices to show. +specifies the master device which ensubports devices to show. .TP .BI vrf " NAME " .I NAME -speficies the VRF which enslaves devices to show. +speficies the VRF which ensubports devices to show. .TP .BI type " TYPE "
@@ -2451,7 +2451,7 @@ Shows the vlan devices. .PP ip link show master br0 .RS 4 -Shows devices enslaved by br0 +Shows devices ensubportd by br0 .RE .PP ip link set dev ppp0 mtu 1400
man/man8/ip-nexthop.8 +1 -1
@@ -144,7 +144,7 @@ show the nexthops using the given device. show the nexthops using devices associated with the vrf name .TP .BI master " DEV " -show the nexthops using devices enslaved to given master device +show the nexthops using devices ensubportd to given master device .TP .BI groups show only nexthop groups
testsuite/tests/bridge/vlan/tunnelshow.t +1 -1
@@ -14,7 +14,7 @@ ts_ip "$0" "Add $VX_DEV vxlan interface" \ ts_ip "$0" "Insert $VX_DEV under $BR_DEV" \ link set dev $VX_DEV master $BR_DEV ts_ip "$0" "Set vlan_tunnel on $VX_DEV" \ - link set dev $VX_DEV type bridge_slave vlan_tunnel on + link set dev $VX_DEV type bridge_subport vlan_tunnel on ts_bridge "$0" "Add single vlan" vlan add dev $VX_DEV vid 1000 ts_bridge "$0" "Add single tunnel" \
Signature · 1 line
2.26.2
Jakub Kicinski
maintainerQuoted 5 lines · On Tue, 23 Jun 2020 16:53:02 -0700 Stephen Hemminger wrote:
These patches remove the term slave from the iproute2 visible command line, documentation, and variable naming.
This needs doing despite the fact it will cause cosmetic changes to visible outputs.
And non-cosmetic changes in machine-readable (JSON) output :(
Quoted 5 lines · Stephen Hemminger
These patches remove the term slave from the iproute2 visible command line, documentation, and variable naming.
This needs doing despite the fact it will cause cosmetic changes to visible outputs.
AFAICS, your patches don't only change output of the command, they also change command line parsing so that they break backward compatibility and break existing scripts and tools. This is a very bad idea.
If you really want to go through this exercise - and I don't agree with the "needs doing" claim - you definitely should preserve existing keywords as aliases.
Michal
Quoted 11 lines · On Wed, 24 Jun 2020 11:51:42 +0200 Michal Kubecek <[email protected]> wrote:
Quoted 5 lines · Stephen Hemminger
These patches remove the term slave from the iproute2 visible command line, documentation, and variable naming.
This needs doing despite the fact it will cause cosmetic changes to visible outputs.
AFAICS, your patches don't only change output of the command, they also change command line parsing so that they break backward compatibility and break existing scripts and tools. This is a very bad idea.
Quoted 5 lines
If you really want to go through this exercise - and I don't agree with the "needs doing" claim - you definitely should preserve existing keywords as aliases.
Michal
Sure the old keywords could be silent aliases for new ones.