diff options
author | David Ahern <dsahern@kernel.org> | 2024-02-27 04:09:35 +0000 |
---|---|---|
committer | David Ahern <dsahern@kernel.org> | 2024-02-27 04:09:35 +0000 |
commit | 4306b28650fe55650d8bb7943b0ab8f63319140f (patch) | |
tree | 4c0571b740fa709b0ceeebce3b1fd2ba7c9e7c9b | |
parent | 7c05edd3eceee354f0a2fca7c90f72971a0daccf (diff) | |
parent | 1d7f908103be90e8ac836ef0ce03b72997664b5a (diff) | |
download | iproute2-4306b28650fe55650d8bb7943b0ab8f63319140f.tar.gz |
Merge remote-tracking branch 'main/main' into next
Signed-off-by: David Ahern <dsahern@kernel.org>
-rw-r--r-- | man/man8/ip-link.8.in | 5 | ||||
-rw-r--r-- | man/man8/ip.8 | 10 | ||||
-rw-r--r-- | tc/f_cgroup.c | 4 | ||||
-rw-r--r-- | tc/f_flow.c | 64 | ||||
-rw-r--r-- | tc/f_fw.c | 12 | ||||
-rw-r--r-- | tc/f_route.c | 16 |
6 files changed, 65 insertions, 46 deletions
diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in index dd686ae15..31e2d7f0f 100644 --- a/man/man8/ip-link.8.in +++ b/man/man8/ip-link.8.in @@ -445,6 +445,11 @@ TCP for IPv6 on this device when the size is greater than 65536. specifies the recommended maximum size of a IPv4 Generic Segment Offload packet the new device should accept. This is especially used to enable BIG TCP for IPv4 on this device by setting to a size greater than 65536. +Note that +.B gso_max_size +needs to be set to a size greater than or equal to +.B gso_ipv4_max_size +to really enable BIG TCP for IPv4. .TP .BI gso_max_segs " SEGMENTS " diff --git a/man/man8/ip.8 b/man/man8/ip.8 index 72227d44f..cc8a61e18 100644 --- a/man/man8/ip.8 +++ b/man/man8/ip.8 @@ -19,10 +19,12 @@ ip \- show / manipulate routing, network devices, interfaces and tunnels .ti -8 .IR OBJECT " := { " -.BR link " | " address " | " addrlabel " | " route " | " rule " | " neigh " | "\ - ntable " | " tunnel " | " tuntap " | " maddress " | " mroute " | " mrule " | "\ - monitor " | " xfrm " | " netns " | " l2tp " | " tcp_metrics " | " token " | "\ - macsec " | " vrf " | " mptcp " | " ioam " | " stats " }" +.BR address " | " addrlabel " | " fou " | " help " | " ila " | " ioam " | "\ + l2tp " | " link " | " macsec " | " maddress " | " monitor " | " mptcp " | "\ + mroute " | " mrule " | " neighbor " | " neighbour " | " netconf " | "\ + netns " | " nexthop " | " ntable " | " ntbl " | " route " | " rule " | "\ + sr " | " tap " | " tcpmetrics " | " token " | " tunnel " | " tuntap " | "\ + vrf " | " xfrm " }" .sp .ti -8 diff --git a/tc/f_cgroup.c b/tc/f_cgroup.c index a4fc03d14..291d6e7eb 100644 --- a/tc/f_cgroup.c +++ b/tc/f_cgroup.c @@ -86,13 +86,13 @@ static int cgroup_print_opt(struct filter_util *qu, FILE *f, parse_rtattr_nested(tb, TCA_CGROUP_MAX, opt); if (handle) - fprintf(f, "handle 0x%x ", handle); + print_0xhex(PRINT_ANY, "handle", "handle %#llx ", handle); if (tb[TCA_CGROUP_EMATCHES]) print_ematch(f, tb[TCA_CGROUP_EMATCHES]); if (tb[TCA_CGROUP_POLICE]) { - fprintf(f, "\n"); + print_nl(); tc_print_police(f, tb[TCA_CGROUP_POLICE]); } diff --git a/tc/f_flow.c b/tc/f_flow.c index 2445aaef5..4a29af22e 100644 --- a/tc/f_flow.c +++ b/tc/f_flow.c @@ -258,6 +258,21 @@ static int flow_parse_opt(struct filter_util *fu, char *handle, return 0; } +static const char *flow_mode2str(__u32 mode) +{ + static char buf[128]; + + switch (mode) { + case FLOW_MODE_MAP: + return "map"; + case FLOW_MODE_HASH: + return "hash"; + default: + snprintf(buf, sizeof(buf), "%#x", mode); + return buf; + } +} + static int flow_print_opt(struct filter_util *fu, FILE *f, struct rtattr *opt, __u32 handle) { @@ -272,33 +287,26 @@ static int flow_print_opt(struct filter_util *fu, FILE *f, struct rtattr *opt, parse_rtattr_nested(tb, TCA_FLOW_MAX, opt); - fprintf(f, "handle 0x%x ", handle); + print_0xhex(PRINT_ANY, "handle", "handle %#llx ", handle); if (tb[TCA_FLOW_MODE]) { __u32 mode = rta_getattr_u32(tb[TCA_FLOW_MODE]); - - switch (mode) { - case FLOW_MODE_MAP: - fprintf(f, "map "); - break; - case FLOW_MODE_HASH: - fprintf(f, "hash "); - break; - } + print_string(PRINT_ANY, "mode", "%s ", flow_mode2str(mode)); } if (tb[TCA_FLOW_KEYS]) { __u32 keymask = rta_getattr_u32(tb[TCA_FLOW_KEYS]); - char *sep = ""; + char *sep = " "; - fprintf(f, "keys "); + open_json_array(PRINT_ANY, "keys"); for (i = 0; i <= FLOW_KEY_MAX; i++) { if (keymask & (1 << i)) { - fprintf(f, "%s%s", sep, flow_keys[i]); + print_string(PRINT_FP, NULL, "%s", sep); + print_string(PRINT_ANY, NULL, "%s", flow_keys[i]); sep = ","; } } - fprintf(f, " "); + close_json_array(PRINT_ANY, " "); } if (tb[TCA_FLOW_MASK]) @@ -311,37 +319,37 @@ static int flow_print_opt(struct filter_util *fu, FILE *f, struct rtattr *opt, __u32 xor = mask & val; if (mask != ~0) - fprintf(f, "and 0x%.8x ", mask); + print_0xhex(PRINT_ANY, "and", "and 0x%.8x ", mask); if (xor != 0) - fprintf(f, "xor 0x%.8x ", xor); + print_0xhex(PRINT_ANY, "xor", "xor 0x%.8x ", xor); if (or != 0) - fprintf(f, "or 0x%.8x ", or); + print_0xhex(PRINT_ANY, "or", "or 0x%.8x ", or); } if (tb[TCA_FLOW_RSHIFT]) - fprintf(f, "rshift %u ", - rta_getattr_u32(tb[TCA_FLOW_RSHIFT])); + print_uint(PRINT_ANY, "rshift", "rshift %u ", + rta_getattr_u32(tb[TCA_FLOW_RSHIFT])); if (tb[TCA_FLOW_ADDEND]) - fprintf(f, "addend 0x%x ", - rta_getattr_u32(tb[TCA_FLOW_ADDEND])); + print_0xhex(PRINT_ANY, "addend", "addend 0x%x ", + rta_getattr_u32(tb[TCA_FLOW_ADDEND])); if (tb[TCA_FLOW_DIVISOR]) - fprintf(f, "divisor %u ", - rta_getattr_u32(tb[TCA_FLOW_DIVISOR])); + print_uint(PRINT_ANY, "divisor", "divisor %u ", + rta_getattr_u32(tb[TCA_FLOW_DIVISOR])); if (tb[TCA_FLOW_BASECLASS]) - fprintf(f, "baseclass %s ", - sprint_tc_classid(rta_getattr_u32(tb[TCA_FLOW_BASECLASS]), b1)); + print_string(PRINT_ANY, "baseclass", "baseclass %s ", + sprint_tc_classid(rta_getattr_u32(tb[TCA_FLOW_BASECLASS]), b1)); if (tb[TCA_FLOW_PERTURB]) - fprintf(f, "perturb %usec ", - rta_getattr_u32(tb[TCA_FLOW_PERTURB])); + print_uint(PRINT_ANY, "perturb", "perturb %usec ", + rta_getattr_u32(tb[TCA_FLOW_PERTURB])); if (tb[TCA_FLOW_EMATCHES]) print_ematch(f, tb[TCA_FLOW_EMATCHES]); if (tb[TCA_FLOW_POLICE]) tc_print_police(f, tb[TCA_FLOW_POLICE]); if (tb[TCA_FLOW_ACT]) { - fprintf(f, "\n"); + print_nl(); tc_print_action(f, tb[TCA_FLOW_ACT], 0); } return 0; @@ -124,16 +124,16 @@ static int fw_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt, __u if (handle || tb[TCA_FW_MASK]) { __u32 mark = 0, mask = 0; - open_json_object("handle"); + open_json_object("fw"); if (handle) mark = handle; if (tb[TCA_FW_MASK] && (mask = rta_getattr_u32(tb[TCA_FW_MASK])) != 0xFFFFFFFF) { - print_hex(PRINT_ANY, "mark", "handle 0x%x", mark); - print_hex(PRINT_ANY, "mask", "/0x%x ", mask); + print_0xhex(PRINT_ANY, "mark", "handle 0x%x", mark); + print_0xhex(PRINT_ANY, "mask", "/0x%x ", mask); } else { - print_hex(PRINT_ANY, "mark", "handle 0x%x ", mark); - print_hex(PRINT_JSON, "mask", NULL, 0xFFFFFFFF); + print_0xhex(PRINT_ANY, "mark", "handle 0x%x ", mark); + print_0xhex(PRINT_JSON, "mask", NULL, 0xFFFFFFFF); } close_json_object(); } @@ -155,7 +155,7 @@ static int fw_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt, __u } if (tb[TCA_FW_ACT]) { - print_string(PRINT_FP, NULL, "\n", ""); + print_nl(); tc_print_action(f, tb[TCA_FW_ACT], 0); } return 0; diff --git a/tc/f_route.c b/tc/f_route.c index e92c79857..ca8a8dddc 100644 --- a/tc/f_route.c +++ b/tc/f_route.c @@ -146,20 +146,24 @@ static int route_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt, parse_rtattr_nested(tb, TCA_ROUTE4_MAX, opt); if (handle) - fprintf(f, "fh 0x%08x ", handle); + print_0xhex(PRINT_ANY, "fh", "fh 0x%08x ", handle); if (handle&0x7F00) - fprintf(f, "order %d ", (handle>>8)&0x7F); + print_uint(PRINT_ANY, "order", "order %d ", (handle >> 8) & 0x7F); if (tb[TCA_ROUTE4_CLASSID]) { SPRINT_BUF(b1); - fprintf(f, "flowid %s ", sprint_tc_classid(rta_getattr_u32(tb[TCA_ROUTE4_CLASSID]), b1)); + print_string(PRINT_ANY, "flowid", "flowid %s ", + sprint_tc_classid(rta_getattr_u32(tb[TCA_ROUTE4_CLASSID]), b1)); } if (tb[TCA_ROUTE4_TO]) - fprintf(f, "to %s ", rtnl_rtrealm_n2a(rta_getattr_u32(tb[TCA_ROUTE4_TO]), b1, sizeof(b1))); + print_string(PRINT_ANY, "name", "to %s ", + rtnl_rtrealm_n2a(rta_getattr_u32(tb[TCA_ROUTE4_TO]), b1, sizeof(b1))); if (tb[TCA_ROUTE4_FROM]) - fprintf(f, "from %s ", rtnl_rtrealm_n2a(rta_getattr_u32(tb[TCA_ROUTE4_FROM]), b1, sizeof(b1))); + print_string(PRINT_ANY, "name", "from %s ", + rtnl_rtrealm_n2a(rta_getattr_u32(tb[TCA_ROUTE4_FROM]), b1, sizeof(b1))); if (tb[TCA_ROUTE4_IIF]) - fprintf(f, "fromif %s", ll_index_to_name(rta_getattr_u32(tb[TCA_ROUTE4_IIF]))); + print_color_string(PRINT_ANY, COLOR_IFNAME, "fromif", "fromif %s", + ll_index_to_name(rta_getattr_u32(tb[TCA_ROUTE4_IIF]))); if (tb[TCA_ROUTE4_POLICE]) tc_print_police(f, tb[TCA_ROUTE4_POLICE]); if (tb[TCA_ROUTE4_ACT]) |