diff --git a/SOURCES/0001-Update-kernel-headers.patch b/SOURCES/0001-Update-kernel-headers.patch new file mode 100644 index 0000000..5b5550f --- /dev/null +++ b/SOURCES/0001-Update-kernel-headers.patch @@ -0,0 +1,227 @@ +From 4cd2ea662ae3255713a7de44e496e6ed32ade0c9 Mon Sep 17 00:00:00 2001 +Message-Id: <4cd2ea662ae3255713a7de44e496e6ed32ade0c9.1587661326.git.aclaudi@redhat.com> +From: Andrea Claudi +Date: Thu, 16 Apr 2020 12:41:48 +0200 +Subject: [PATCH] Update kernel headers + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1770671 +Upstream Status: iproute2.git commit e3af717a8d410 + +commit e3af717a8d410c97d9e0b985219ab8fc9ff18b79 +Author: David Ahern +Date: Sun Aug 18 11:48:02 2019 -0700 + + Update kernel headers + + Update kernel headers to commit: + d83d508b74c4 ("Merge branch 'stmmac-next'") + + Signed-off-by: David Ahern +--- + include/uapi/linux/bpf.h | 37 ++++++++++++++++++- + include/uapi/linux/can/netlink.h | 6 ++-- + include/uapi/linux/devlink.h | 62 ++++++++++++++++++++++++++++++++ + include/uapi/linux/if_bridge.h | 1 + + 4 files changed, 102 insertions(+), 4 deletions(-) + +diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h +index 1e08475275702..79701d3e66f0b 100644 +--- a/include/uapi/linux/bpf.h ++++ b/include/uapi/linux/bpf.h +@@ -134,6 +134,7 @@ enum bpf_map_type { + BPF_MAP_TYPE_QUEUE, + BPF_MAP_TYPE_STACK, + BPF_MAP_TYPE_SK_STORAGE, ++ BPF_MAP_TYPE_DEVMAP_HASH, + }; + + /* Note that tracing related programs such as +@@ -2713,6 +2714,33 @@ union bpf_attr { + * **-EPERM** if no permission to send the *sig*. + * + * **-EAGAIN** if bpf program can try again. ++ * ++ * s64 bpf_tcp_gen_syncookie(struct bpf_sock *sk, void *iph, u32 iph_len, struct tcphdr *th, u32 th_len) ++ * Description ++ * Try to issue a SYN cookie for the packet with corresponding ++ * IP/TCP headers, *iph* and *th*, on the listening socket in *sk*. ++ * ++ * *iph* points to the start of the IPv4 or IPv6 header, while ++ * *iph_len* contains **sizeof**\ (**struct iphdr**) or ++ * **sizeof**\ (**struct ip6hdr**). ++ * ++ * *th* points to the start of the TCP header, while *th_len* ++ * contains the length of the TCP header. ++ * ++ * Return ++ * On success, lower 32 bits hold the generated SYN cookie in ++ * followed by 16 bits which hold the MSS value for that cookie, ++ * and the top 16 bits are unused. ++ * ++ * On failure, the returned value is one of the following: ++ * ++ * **-EINVAL** SYN cookie cannot be issued due to error ++ * ++ * **-ENOENT** SYN cookie should not be issued (no SYN flood) ++ * ++ * **-EOPNOTSUPP** kernel configuration does not enable SYN cookies ++ * ++ * **-EPROTONOSUPPORT** IP packet version is not 4 or 6 + */ + #define __BPF_FUNC_MAPPER(FN) \ + FN(unspec), \ +@@ -2824,7 +2852,8 @@ union bpf_attr { + FN(strtoul), \ + FN(sk_storage_get), \ + FN(sk_storage_delete), \ +- FN(send_signal), ++ FN(send_signal), \ ++ FN(tcp_gen_syncookie), + + /* integer value in 'imm' field of BPF_CALL instruction selects which helper + * function eBPF program intends to call +@@ -3507,6 +3536,10 @@ enum bpf_task_fd_type { + BPF_FD_TYPE_URETPROBE, /* filename + offset */ + }; + ++#define BPF_FLOW_DISSECTOR_F_PARSE_1ST_FRAG (1U << 0) ++#define BPF_FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL (1U << 1) ++#define BPF_FLOW_DISSECTOR_F_STOP_AT_ENCAP (1U << 2) ++ + struct bpf_flow_keys { + __u16 nhoff; + __u16 thoff; +@@ -3528,6 +3561,8 @@ struct bpf_flow_keys { + __u32 ipv6_dst[4]; /* in6_addr; network order */ + }; + }; ++ __u32 flags; ++ __be32 flow_label; + }; + + struct bpf_func_info { +diff --git a/include/uapi/linux/can/netlink.h b/include/uapi/linux/can/netlink.h +index f0c5e58b8ee76..c1f62640e87bc 100644 +--- a/include/uapi/linux/can/netlink.h ++++ b/include/uapi/linux/can/netlink.h +@@ -40,15 +40,15 @@ struct can_bittiming { + }; + + /* +- * CAN harware-dependent bit-timing constant ++ * CAN hardware-dependent bit-timing constant + * + * Used for calculating and checking bit-timing parameters + */ + struct can_bittiming_const { + char name[16]; /* Name of the CAN controller hardware */ +- __u32 tseg1_min; /* Time segement 1 = prop_seg + phase_seg1 */ ++ __u32 tseg1_min; /* Time segment 1 = prop_seg + phase_seg1 */ + __u32 tseg1_max; +- __u32 tseg2_min; /* Time segement 2 = phase_seg2 */ ++ __u32 tseg2_min; /* Time segment 2 = phase_seg2 */ + __u32 tseg2_max; + __u32 sjw_max; /* Synchronisation jump width */ + __u32 brp_min; /* Bit-rate prescaler */ +diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h +index fc195cbd66f45..3fb683bee6ba1 100644 +--- a/include/uapi/linux/devlink.h ++++ b/include/uapi/linux/devlink.h +@@ -107,6 +107,16 @@ enum devlink_command { + DEVLINK_CMD_FLASH_UPDATE_END, /* notification only */ + DEVLINK_CMD_FLASH_UPDATE_STATUS, /* notification only */ + ++ DEVLINK_CMD_TRAP_GET, /* can dump */ ++ DEVLINK_CMD_TRAP_SET, ++ DEVLINK_CMD_TRAP_NEW, ++ DEVLINK_CMD_TRAP_DEL, ++ ++ DEVLINK_CMD_TRAP_GROUP_GET, /* can dump */ ++ DEVLINK_CMD_TRAP_GROUP_SET, ++ DEVLINK_CMD_TRAP_GROUP_NEW, ++ DEVLINK_CMD_TRAP_GROUP_DEL, ++ + /* add new commands above here */ + __DEVLINK_CMD_MAX, + DEVLINK_CMD_MAX = __DEVLINK_CMD_MAX - 1 +@@ -194,6 +204,47 @@ enum devlink_param_fw_load_policy_value { + DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_FLASH, + }; + ++enum { ++ DEVLINK_ATTR_STATS_RX_PACKETS, /* u64 */ ++ DEVLINK_ATTR_STATS_RX_BYTES, /* u64 */ ++ ++ __DEVLINK_ATTR_STATS_MAX, ++ DEVLINK_ATTR_STATS_MAX = __DEVLINK_ATTR_STATS_MAX - 1 ++}; ++ ++/** ++ * enum devlink_trap_action - Packet trap action. ++ * @DEVLINK_TRAP_ACTION_DROP: Packet is dropped by the device and a copy is not ++ * sent to the CPU. ++ * @DEVLINK_TRAP_ACTION_TRAP: The sole copy of the packet is sent to the CPU. ++ */ ++enum devlink_trap_action { ++ DEVLINK_TRAP_ACTION_DROP, ++ DEVLINK_TRAP_ACTION_TRAP, ++}; ++ ++/** ++ * enum devlink_trap_type - Packet trap type. ++ * @DEVLINK_TRAP_TYPE_DROP: Trap reason is a drop. Trapped packets are only ++ * processed by devlink and not injected to the ++ * kernel's Rx path. ++ * @DEVLINK_TRAP_TYPE_EXCEPTION: Trap reason is an exception. Packet was not ++ * forwarded as intended due to an exception ++ * (e.g., missing neighbour entry) and trapped to ++ * control plane for resolution. Trapped packets ++ * are processed by devlink and injected to ++ * the kernel's Rx path. ++ */ ++enum devlink_trap_type { ++ DEVLINK_TRAP_TYPE_DROP, ++ DEVLINK_TRAP_TYPE_EXCEPTION, ++}; ++ ++enum { ++ /* Trap can report input port as metadata */ ++ DEVLINK_ATTR_TRAP_METADATA_TYPE_IN_PORT, ++}; ++ + enum devlink_attr { + /* don't change the order or add anything between, this is ABI! */ + DEVLINK_ATTR_UNSPEC, +@@ -348,6 +399,17 @@ enum devlink_attr { + DEVLINK_ATTR_PORT_PCI_PF_NUMBER, /* u16 */ + DEVLINK_ATTR_PORT_PCI_VF_NUMBER, /* u16 */ + ++ DEVLINK_ATTR_STATS, /* nested */ ++ ++ DEVLINK_ATTR_TRAP_NAME, /* string */ ++ /* enum devlink_trap_action */ ++ DEVLINK_ATTR_TRAP_ACTION, /* u8 */ ++ /* enum devlink_trap_type */ ++ DEVLINK_ATTR_TRAP_TYPE, /* u8 */ ++ DEVLINK_ATTR_TRAP_GENERIC, /* flag */ ++ DEVLINK_ATTR_TRAP_METADATA, /* nested */ ++ DEVLINK_ATTR_TRAP_GROUP_NAME, /* string */ ++ + /* add new attributes above here, update the policy in devlink.c */ + + __DEVLINK_ATTR_MAX, +diff --git a/include/uapi/linux/if_bridge.h b/include/uapi/linux/if_bridge.h +index 04f763cf53029..31fc51bdedb3c 100644 +--- a/include/uapi/linux/if_bridge.h ++++ b/include/uapi/linux/if_bridge.h +@@ -237,6 +237,7 @@ struct br_mdb_entry { + #define MDB_PERMANENT 1 + __u8 state; + #define MDB_FLAGS_OFFLOAD (1 << 0) ++#define MDB_FLAGS_FAST_LEAVE (1 << 1) + __u8 flags; + __u16 vid; + struct { +-- +2.25.3 + diff --git a/SOURCES/0002-Update-kernel-headers.patch b/SOURCES/0002-Update-kernel-headers.patch new file mode 100644 index 0000000..77f6908 --- /dev/null +++ b/SOURCES/0002-Update-kernel-headers.patch @@ -0,0 +1,143 @@ +From 864c5a906ccfe205f886aa4bfb69f738a9a4fb45 Mon Sep 17 00:00:00 2001 +Message-Id: <864c5a906ccfe205f886aa4bfb69f738a9a4fb45.1587661326.git.aclaudi@redhat.com> +In-Reply-To: <4cd2ea662ae3255713a7de44e496e6ed32ade0c9.1587661326.git.aclaudi@redhat.com> +References: <4cd2ea662ae3255713a7de44e496e6ed32ade0c9.1587661326.git.aclaudi@redhat.com> +From: Andrea Claudi +Date: Thu, 16 Apr 2020 12:41:49 +0200 +Subject: [PATCH] Update kernel headers + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1770671 +Upstream Status: iproute2.git commit 17a948c80af57 + +commit 17a948c80af57da2fa86a8e34153f755f86e9c9c +Author: David Ahern +Date: Sat Nov 2 07:43:01 2019 -0700 + + Update kernel headers + + Update kernel headers to commit: + c23fcbbc6aa4 ("tc-testing: added tests with cookie for conntrack TC action") + + Signed-off-by: David Ahern +--- + include/uapi/linux/bpf.h | 28 +++++++++++++++++++++++++++- + include/uapi/linux/pkt_cls.h | 5 +++++ + include/uapi/linux/tcp.h | 10 +++++++++- + include/uapi/linux/tipc.h | 1 + + 4 files changed, 42 insertions(+), 2 deletions(-) + +diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h +index 79701d3e66f0b..3e195ff43fa01 100644 +--- a/include/uapi/linux/bpf.h ++++ b/include/uapi/linux/bpf.h +@@ -413,6 +413,7 @@ union bpf_attr { + __u32 line_info_rec_size; /* userspace bpf_line_info size */ + __aligned_u64 line_info; /* line info */ + __u32 line_info_cnt; /* number of bpf_line_info records */ ++ __u32 attach_btf_id; /* in-kernel BTF type id to attach to */ + }; + + struct { /* anonymous struct used by BPF_OBJ_* commands */ +@@ -2741,6 +2742,30 @@ union bpf_attr { + * **-EOPNOTSUPP** kernel configuration does not enable SYN cookies + * + * **-EPROTONOSUPPORT** IP packet version is not 4 or 6 ++ * ++ * int bpf_skb_output(void *ctx, struct bpf_map *map, u64 flags, void *data, u64 size) ++ * Description ++ * Write raw *data* blob into a special BPF perf event held by ++ * *map* of type **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. This perf ++ * event must have the following attributes: **PERF_SAMPLE_RAW** ++ * as **sample_type**, **PERF_TYPE_SOFTWARE** as **type**, and ++ * **PERF_COUNT_SW_BPF_OUTPUT** as **config**. ++ * ++ * The *flags* are used to indicate the index in *map* for which ++ * the value must be put, masked with **BPF_F_INDEX_MASK**. ++ * Alternatively, *flags* can be set to **BPF_F_CURRENT_CPU** ++ * to indicate that the index of the current CPU core should be ++ * used. ++ * ++ * The value to write, of *size*, is passed through eBPF stack and ++ * pointed by *data*. ++ * ++ * *ctx* is a pointer to in-kernel struct sk_buff. ++ * ++ * This helper is similar to **bpf_perf_event_output**\ () but ++ * restricted to raw_tracepoint bpf programs. ++ * Return ++ * 0 on success, or a negative error in case of failure. + */ + #define __BPF_FUNC_MAPPER(FN) \ + FN(unspec), \ +@@ -2853,7 +2878,8 @@ union bpf_attr { + FN(sk_storage_get), \ + FN(sk_storage_delete), \ + FN(send_signal), \ +- FN(tcp_gen_syncookie), ++ FN(tcp_gen_syncookie), \ ++ FN(skb_output), + + /* integer value in 'imm' field of BPF_CALL instruction selects which helper + * function eBPF program intends to call +diff --git a/include/uapi/linux/pkt_cls.h b/include/uapi/linux/pkt_cls.h +index b057aeeb63386..0a9ab625cba7b 100644 +--- a/include/uapi/linux/pkt_cls.h ++++ b/include/uapi/linux/pkt_cls.h +@@ -16,9 +16,14 @@ enum { + TCA_ACT_STATS, + TCA_ACT_PAD, + TCA_ACT_COOKIE, ++ TCA_ACT_FLAGS, + __TCA_ACT_MAX + }; + ++#define TCA_ACT_FLAGS_NO_PERCPU_STATS 1 /* Don't use percpu allocator for ++ * actions stats. ++ */ ++ + #define TCA_ACT_MAX __TCA_ACT_MAX + #define TCA_OLD_COMPAT (TCA_ACT_MAX+1) + #define TCA_ACT_MAX_PRIO 32 +diff --git a/include/uapi/linux/tcp.h b/include/uapi/linux/tcp.h +index 3fd9b29146b17..acb15ca8558c0 100644 +--- a/include/uapi/linux/tcp.h ++++ b/include/uapi/linux/tcp.h +@@ -155,6 +155,14 @@ enum { + TCP_QUEUES_NR, + }; + ++/* why fastopen failed from client perspective */ ++enum tcp_fastopen_client_fail { ++ TFO_STATUS_UNSPEC, /* catch-all */ ++ TFO_COOKIE_UNAVAILABLE, /* if not in TFO_CLIENT_NO_COOKIE mode */ ++ TFO_DATA_NOT_ACKED, /* SYN-ACK did not ack SYN data */ ++ TFO_SYN_RETRANSMITTED, /* SYN-ACK did not ack SYN data after timeout */ ++}; ++ + /* for TCP_INFO socket option */ + #define TCPI_OPT_TIMESTAMPS 1 + #define TCPI_OPT_SACK 2 +@@ -211,7 +219,7 @@ struct tcp_info { + __u8 tcpi_backoff; + __u8 tcpi_options; + __u8 tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4; +- __u8 tcpi_delivery_rate_app_limited:1; ++ __u8 tcpi_delivery_rate_app_limited:1, tcpi_fastopen_client_fail:2; + + __u32 tcpi_rto; + __u32 tcpi_ato; +diff --git a/include/uapi/linux/tipc.h b/include/uapi/linux/tipc.h +index e16cb4e2af587..0f6f28b2e3010 100644 +--- a/include/uapi/linux/tipc.h ++++ b/include/uapi/linux/tipc.h +@@ -191,6 +191,7 @@ struct sockaddr_tipc { + #define TIPC_GROUP_JOIN 135 /* Takes struct tipc_group_req* */ + #define TIPC_GROUP_LEAVE 136 /* No argument */ + #define TIPC_SOCK_RECVQ_USED 137 /* Default: none (read only) */ ++#define TIPC_NODELAY 138 /* Default: false */ + + /* + * Flag values +-- +2.25.3 + diff --git a/SOURCES/0003-tc-implement-support-for-action-flags.patch b/SOURCES/0003-tc-implement-support-for-action-flags.patch new file mode 100644 index 0000000..6b4ff11 --- /dev/null +++ b/SOURCES/0003-tc-implement-support-for-action-flags.patch @@ -0,0 +1,119 @@ +From a3d12445422afa12a67a7cd121b7add89f6c7d67 Mon Sep 17 00:00:00 2001 +Message-Id: +In-Reply-To: <4cd2ea662ae3255713a7de44e496e6ed32ade0c9.1587661326.git.aclaudi@redhat.com> +References: <4cd2ea662ae3255713a7de44e496e6ed32ade0c9.1587661326.git.aclaudi@redhat.com> +From: Andrea Claudi +Date: Thu, 16 Apr 2020 12:41:49 +0200 +Subject: [PATCH] tc: implement support for action flags + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1770671 +Upstream Status: iproute2.git commit fb2e033add073 + +commit fb2e033add073893dea71bb483353790fe8c5354 +Author: Vlad Buslov +Date: Wed Oct 30 16:20:40 2019 +0200 + + tc: implement support for action flags + + Implement setting and printing of action flags with single available flag + value "no_percpu" that translates to kernel UAPI TCA_ACT_FLAGS value + TCA_ACT_FLAGS_NO_PERCPU_STATS. Update man page with information regarding + usage of action flags. + + Example usage: + + # tc actions add action gact drop no_percpu + # sudo tc actions list action gact + total acts 1 + + action order 0: gact action drop + random type none pass val 0 + index 1 ref 1 bind 0 + no_percpu + + Signed-off-by: Vlad Buslov + Signed-off-by: David Ahern +--- + man/man8/tc-actions.8 | 14 ++++++++++++++ + tc/m_action.c | 19 +++++++++++++++++++ + 2 files changed, 33 insertions(+) + +diff --git a/man/man8/tc-actions.8 b/man/man8/tc-actions.8 +index f46166e3f6859..bee59f7247fae 100644 +--- a/man/man8/tc-actions.8 ++++ b/man/man8/tc-actions.8 +@@ -47,6 +47,8 @@ actions \- independently defined actions in tc + ] [ + .I COOKIESPEC + ] [ ++.I FLAGS ++] [ + .I CONTROL + ] + +@@ -71,6 +73,10 @@ ACTNAME + := + .BI cookie " COOKIE" + ++.I FLAGS ++:= ++.I no_percpu ++ + .I ACTDETAIL + := + .I ACTNAME ACTPARAMS +@@ -186,6 +192,14 @@ As such, it can be used as a correlating value for maintaining user state. + The value to be stored is completely arbitrary and does not require a specific + format. It is stored inside the action structure itself. + ++.TP ++.I FLAGS ++Action-specific flags. Currently, the only supported flag is ++.I no_percpu ++which indicates that action is expected to have minimal software data-path ++traffic and doesn't need to allocate stat counters with percpu allocator. ++This option is intended to be used by hardware-offloaded actions. ++ + .TP + .BI since " MSTIME" + When dumping large number of actions, a millisecond time-filter can be +diff --git a/tc/m_action.c b/tc/m_action.c +index bdc62720879c1..c46aeaafa8ebf 100644 +--- a/tc/m_action.c ++++ b/tc/m_action.c +@@ -249,6 +249,16 @@ done0: + addattr_l(n, MAX_MSG, TCA_ACT_COOKIE, + &act_ck, act_ck_len); + ++ if (*argv && strcmp(*argv, "no_percpu") == 0) { ++ struct nla_bitfield32 flags = ++ { TCA_ACT_FLAGS_NO_PERCPU_STATS, ++ TCA_ACT_FLAGS_NO_PERCPU_STATS }; ++ ++ addattr_l(n, MAX_MSG, TCA_ACT_FLAGS, &flags, ++ sizeof(struct nla_bitfield32)); ++ NEXT_ARG_FWD(); ++ } ++ + addattr_nest_end(n, tail); + ok++; + } +@@ -317,6 +327,15 @@ static int tc_print_one_action(FILE *f, struct rtattr *arg) + strsz, b1, sizeof(b1))); + print_string(PRINT_FP, NULL, "%s", _SL_); + } ++ if (tb[TCA_ACT_FLAGS]) { ++ struct nla_bitfield32 *flags = RTA_DATA(tb[TCA_ACT_FLAGS]); ++ ++ if (flags->selector & TCA_ACT_FLAGS_NO_PERCPU_STATS) ++ print_bool(PRINT_ANY, "no_percpu", "\tno_percpu", ++ flags->value & ++ TCA_ACT_FLAGS_NO_PERCPU_STATS); ++ print_string(PRINT_FP, NULL, "%s", _SL_); ++ } + + return 0; + } +-- +2.25.3 + diff --git a/SOURCES/0004-man-rdma-statistic-Add-filter-description.patch b/SOURCES/0004-man-rdma-statistic-Add-filter-description.patch new file mode 100644 index 0000000..8d60df3 --- /dev/null +++ b/SOURCES/0004-man-rdma-statistic-Add-filter-description.patch @@ -0,0 +1,113 @@ +From f0596659bb2ba71bbe6ec80df9d54ea02775f40f Mon Sep 17 00:00:00 2001 +Message-Id: +In-Reply-To: <4cd2ea662ae3255713a7de44e496e6ed32ade0c9.1587661326.git.aclaudi@redhat.com> +References: <4cd2ea662ae3255713a7de44e496e6ed32ade0c9.1587661326.git.aclaudi@redhat.com> +From: Andrea Claudi +Date: Thu, 23 Apr 2020 12:47:12 +0200 +Subject: [PATCH] man: rdma-statistic: Add filter description + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1786565 +Upstream Status: iproute2.git commit 31824e2299bf5 + +commit 31824e2299bf5dc609026436db629b0c25cc1a10 +Author: Andrea Claudi +Date: Fri Feb 28 18:36:25 2020 +0100 + + man: rdma-statistic: Add filter description + + Add description for filters on rdma statistics show command. + Also add a filter description on the help message of the command. + Additionally, fix some whitespace issue in the man page. + + Reported-by: Zhaojuan Guo + Signed-off-by: Andrea Claudi + Signed-off-by: Stephen Hemminger +--- + man/man8/rdma-statistic.8 | 16 ++++++++++++---- + rdma/stat.c | 1 + + 2 files changed, 13 insertions(+), 4 deletions(-) + +diff --git a/man/man8/rdma-statistic.8 b/man/man8/rdma-statistic.8 +index dea6ff24b499b..cd85ca46993a0 100644 +--- a/man/man8/rdma-statistic.8 ++++ b/man/man8/rdma-statistic.8 +@@ -9,7 +9,7 @@ rdma-statistic \- RDMA statistic counter configuration + .B rdma + .RI "[ " OPTIONS " ]" + .B statistic +-.RI " { " COMMAND " | " ++.RI "{ " COMMAND " | " + .BR help " }" + .sp + +@@ -23,6 +23,7 @@ rdma-statistic \- RDMA statistic counter configuration + .RI "[ " OBJECT " ]" + .B show link + .RI "[ " DEV/PORT_INDX " ]" ++.RI "[ " FILTER_NAME " " FILTER_VALUE " ]" + + .ti -8 + .B rdma statistic +@@ -34,7 +35,7 @@ rdma-statistic \- RDMA statistic counter configuration + .IR OBJECT + .B set + .IR COUNTER_SCOPE +-.RI "[ " DEV/PORT_INDEX "]" ++.RI "[ " DEV/PORT_INDEX " ]" + .B auto + .RI "{ " CRITERIA " | " + .BR off " }" +@@ -44,7 +45,7 @@ rdma-statistic \- RDMA statistic counter configuration + .IR OBJECT + .B bind + .IR COUNTER_SCOPE +-.RI "[ " DEV/PORT_INDEX "]" ++.RI "[ " DEV/PORT_INDEX " ]" + .RI "[ " OBJECT-ID " ]" + .RI "[ " COUNTER-ID " ]" + +@@ -53,7 +54,7 @@ rdma-statistic \- RDMA statistic counter configuration + .IR OBJECT + .B unbind + .IR COUNTER_SCOPE +-.RI "[ " DEV/PORT_INDEX "]" ++.RI "[ " DEV/PORT_INDEX " ]" + .RI "[ " COUNTER-ID " ]" + .RI "[ " OBJECT-ID " ]" + +@@ -69,6 +70,10 @@ rdma-statistic \- RDMA statistic counter configuration + .IR CRITERIA " := " + .RB "{ " type " }" + ++.ti -8 ++.IR FILTER_NAME " := " ++.RB "{ " cntn " | " lqpn " | " pid " }" ++ + .SH "DESCRIPTION" + .SS rdma statistic [object] show - Queries the specified RDMA device for RDMA and driver-specific statistics. Show the default hw counters if object is not specified + +@@ -79,6 +84,9 @@ rdma-statistic \- RDMA statistic counter configuration + .I "PORT_INDEX" + - specifies counters on this RDMA port to show. + ++.I "FILTER_NAME ++- specifies a filter to show only the results matching it. ++ + .SS rdma statistic set - configure counter statistic auto-mode for a specific device/port + In auto mode all objects belong to one category are bind automatically to a single counter set. + +diff --git a/rdma/stat.c b/rdma/stat.c +index ef0bbcf147a70..cd99b7ace73fc 100644 +--- a/rdma/stat.c ++++ b/rdma/stat.c +@@ -22,6 +22,7 @@ static int stat_help(struct rd *rd) + pr_out("where OBJECT: = { qp }\n"); + pr_out(" CRITERIA : = { type }\n"); + pr_out(" COUNTER_SCOPE: = { link | dev }\n"); ++ pr_out(" FILTER_NAME: = { cntn | lqpn | pid }\n"); + pr_out("Examples:\n"); + pr_out(" %s statistic qp show\n", rd->filename); + pr_out(" %s statistic qp show link mlx5_2/1\n", rd->filename); +-- +2.25.3 + diff --git a/SOURCES/0005-man-rdma.8-Add-missing-resource-subcommand-descripti.patch b/SOURCES/0005-man-rdma.8-Add-missing-resource-subcommand-descripti.patch new file mode 100644 index 0000000..d44931f --- /dev/null +++ b/SOURCES/0005-man-rdma.8-Add-missing-resource-subcommand-descripti.patch @@ -0,0 +1,54 @@ +From 44362b42a40ed0f3a3598f55318ed4b0c9f8eb94 Mon Sep 17 00:00:00 2001 +Message-Id: <44362b42a40ed0f3a3598f55318ed4b0c9f8eb94.1587661326.git.aclaudi@redhat.com> +In-Reply-To: <4cd2ea662ae3255713a7de44e496e6ed32ade0c9.1587661326.git.aclaudi@redhat.com> +References: <4cd2ea662ae3255713a7de44e496e6ed32ade0c9.1587661326.git.aclaudi@redhat.com> +From: Andrea Claudi +Date: Thu, 23 Apr 2020 12:49:03 +0200 +Subject: [PATCH] man: rdma.8: Add missing resource subcommand description + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1786576 +Upstream Status: iproute2.git commit 8f1c9d4a3c0d4 + +commit 8f1c9d4a3c0d4e720026b942c922372b3c12e110 +Author: Andrea Claudi +Date: Fri Feb 28 18:36:24 2020 +0100 + + man: rdma.8: Add missing resource subcommand description + + Add resource subcommand in the OBJECT section and a short + description for it. + + Reported-by: Zhaojuan Guo + Signed-off-by: Andrea Claudi + Signed-off-by: Stephen Hemminger +--- + man/man8/rdma.8 | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/man/man8/rdma.8 b/man/man8/rdma.8 +index ef29b1c633644..221bf3343bf4c 100644 +--- a/man/man8/rdma.8 ++++ b/man/man8/rdma.8 +@@ -19,7 +19,7 @@ rdma \- RDMA tool + + .ti -8 + .IR OBJECT " := { " +-.BR dev " | " link " | " system " | " statistic " }" ++.BR dev " | " link " | " resource " | " system " | " statistic " }" + .sp + + .ti -8 +@@ -70,6 +70,10 @@ Generate JSON output. + .B link + - RDMA port related. + ++.TP ++.B resource ++- RDMA resource configuration. ++ + .TP + .B sys + - RDMA subsystem related. +-- +2.25.3 + diff --git a/SOURCES/0006-ip-xfrm-Fix-help-messages.patch b/SOURCES/0006-ip-xfrm-Fix-help-messages.patch new file mode 100644 index 0000000..066af77 --- /dev/null +++ b/SOURCES/0006-ip-xfrm-Fix-help-messages.patch @@ -0,0 +1,111 @@ +From 028ce3bafd9c8415a0cd72ff135f9498d833db21 Mon Sep 17 00:00:00 2001 +Message-Id: <028ce3bafd9c8415a0cd72ff135f9498d833db21.1587661326.git.aclaudi@redhat.com> +In-Reply-To: <4cd2ea662ae3255713a7de44e496e6ed32ade0c9.1587661326.git.aclaudi@redhat.com> +References: <4cd2ea662ae3255713a7de44e496e6ed32ade0c9.1587661326.git.aclaudi@redhat.com> +From: Andrea Claudi +Date: Wed, 15 Apr 2020 19:09:48 +0200 +Subject: [PATCH] ip-xfrm: Fix help messages + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1796045 +Upstream Status: iproute2.git commit 38dd041bfe773 + +commit 38dd041bfe773e481ebf9c8250e49c665af2e215 +Author: Andrea Claudi +Date: Wed Jan 29 15:56:40 2020 +0100 + + ip-xfrm: Fix help messages + + After commit 8589eb4efdf2a ("treewide: refactor help messages") help + messages for xfrm state and policy are broken, printing many times the + same protocol in UPSPEC section: + + $ ip xfrm state help + [...] + UPSPEC := proto { { tcp | tcp | tcp | tcp } [ sport PORT ] [ dport PORT ] | + { icmp | icmp | icmp } [ type NUMBER ] [ code NUMBER ] | + gre [ key { DOTTED-QUAD | NUMBER } ] | PROTO } + + This happens because strxf_proto function is non-reentrant and gets called + multiple times in the same fprintf instruction. + + This commit fix the issue avoiding calls to strxf_proto() with a constant + param, just hardcoding strings for protocol names. + + Fixes: 8589eb4efdf2a ("treewide: refactor help messages") + Signed-off-by: Andrea Claudi + Signed-off-by: Stephen Hemminger +--- + ip/xfrm_policy.c | 21 +++------------------ + ip/xfrm_state.c | 24 +++--------------------- + 2 files changed, 6 insertions(+), 39 deletions(-) + +diff --git a/ip/xfrm_policy.c b/ip/xfrm_policy.c +index 7c0233c182902..d3c706d3225f0 100644 +--- a/ip/xfrm_policy.c ++++ b/ip/xfrm_policy.c +@@ -66,24 +66,9 @@ static void usage(void) + "Usage: ip xfrm policy count\n" + "Usage: ip xfrm policy set [ hthresh4 LBITS RBITS ] [ hthresh6 LBITS RBITS ]\n" + "SELECTOR := [ src ADDR[/PLEN] ] [ dst ADDR[/PLEN] ] [ dev DEV ] [ UPSPEC ]\n" +- "UPSPEC := proto { { "); +- fprintf(stderr, "%s | %s | %s | %s } ", +- strxf_proto(IPPROTO_TCP), +- strxf_proto(IPPROTO_UDP), +- strxf_proto(IPPROTO_SCTP), +- strxf_proto(IPPROTO_DCCP)); +- fprintf(stderr, +- "[ sport PORT ] [ dport PORT ] |\n" +- " { %s | %s | %s } ", +- strxf_proto(IPPROTO_ICMP), +- strxf_proto(IPPROTO_ICMPV6), +- strxf_proto(IPPROTO_MH)); +- fprintf(stderr, +- "[ type NUMBER ] [ code NUMBER ] |\n" +- " %s", +- strxf_proto(IPPROTO_GRE)); +- fprintf(stderr, +- " [ key { DOTTED-QUAD | NUMBER } ] | PROTO }\n" ++ "UPSPEC := proto { { tcp | udp | sctp | dccp } [ sport PORT ] [ dport PORT ] |\n" ++ " { icmp | ipv6-icmp | mobility-header } [ type NUMBER ] [ code NUMBER ] |\n" ++ " gre [ key { DOTTED-QUAD | NUMBER } ] | PROTO }\n" + "DIR := in | out | fwd\n" + "PTYPE := main | sub\n" + "ACTION := allow | block\n" +diff --git a/ip/xfrm_state.c b/ip/xfrm_state.c +index b03ccc5807e90..7b413cd9b9a22 100644 +--- a/ip/xfrm_state.c ++++ b/ip/xfrm_state.c +@@ -106,27 +106,9 @@ static void usage(void) + "EXTRA-FLAG-LIST := [ EXTRA-FLAG-LIST ] EXTRA-FLAG\n" + "EXTRA-FLAG := dont-encap-dscp\n" + "SELECTOR := [ src ADDR[/PLEN] ] [ dst ADDR[/PLEN] ] [ dev DEV ] [ UPSPEC ]\n" +- "UPSPEC := proto { { "); +- fprintf(stderr, +- "%s | %s | %s | %s", +- strxf_proto(IPPROTO_TCP), +- strxf_proto(IPPROTO_UDP), +- strxf_proto(IPPROTO_SCTP), +- strxf_proto(IPPROTO_DCCP)); +- fprintf(stderr, +- " } [ sport PORT ] [ dport PORT ] |\n" +- " { "); +- fprintf(stderr, +- "%s | %s | %s", +- strxf_proto(IPPROTO_ICMP), +- strxf_proto(IPPROTO_ICMPV6), +- strxf_proto(IPPROTO_MH)); +- fprintf(stderr, +- " } [ type NUMBER ] [ code NUMBER ] |\n"); +- fprintf(stderr, +- " %s", strxf_proto(IPPROTO_GRE)); +- fprintf(stderr, +- " [ key { DOTTED-QUAD | NUMBER } ] | PROTO }\n" ++ "UPSPEC := proto { { tcp | udp | sctp | dccp } [ sport PORT ] [ dport PORT ] |\n" ++ " { icmp | ipv6-icmp | mobility-header } [ type NUMBER ] [ code NUMBER ] |\n" ++ " gre [ key { DOTTED-QUAD | NUMBER } ] | PROTO }\n" + "LIMIT-LIST := [ LIMIT-LIST ] limit LIMIT\n" + "LIMIT := { time-soft | time-hard | time-use-soft | time-use-hard } SECONDS |\n" + " { byte-soft | byte-hard } SIZE | { packet-soft | packet-hard } COUNT\n" +-- +2.25.3 + diff --git a/SOURCES/0007-xfrm-not-try-to-delete-ipcomp-states-when-using-dele.patch b/SOURCES/0007-xfrm-not-try-to-delete-ipcomp-states-when-using-dele.patch new file mode 100644 index 0000000..87cbe8c --- /dev/null +++ b/SOURCES/0007-xfrm-not-try-to-delete-ipcomp-states-when-using-dele.patch @@ -0,0 +1,58 @@ +From 7c1351ea866ec811ade4452b5f1791b34b0effe3 Mon Sep 17 00:00:00 2001 +Message-Id: <7c1351ea866ec811ade4452b5f1791b34b0effe3.1587661326.git.aclaudi@redhat.com> +In-Reply-To: <4cd2ea662ae3255713a7de44e496e6ed32ade0c9.1587661326.git.aclaudi@redhat.com> +References: <4cd2ea662ae3255713a7de44e496e6ed32ade0c9.1587661326.git.aclaudi@redhat.com> +From: Andrea Claudi +Date: Thu, 16 Apr 2020 12:10:23 +0200 +Subject: [PATCH] xfrm: not try to delete ipcomp states when using deleteall + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1808634 +Upstream Status: iproute2.git commit f9d696cf414c2 + +commit f9d696cf414c2c475764aa3b29cf288350f1e21f +Author: Xin Long +Date: Mon Feb 24 09:57:01 2020 -0500 + + xfrm: not try to delete ipcomp states when using deleteall + + In kernel space, ipcomp(sub) states used by main states are not + allowed to be deleted by users, they would be freed only when + all main states are destroyed and no one uses them. + + In user space, ip xfrm sta deleteall doesn't filter these ipcomp + states out, and it causes errors: + + # ip xfrm state add src 192.168.0.1 dst 192.168.0.2 spi 0x1000 \ + proto comp comp deflate mode tunnel sel src 192.168.0.1 dst \ + 192.168.0.2 proto gre + # ip xfrm sta deleteall + Failed to send delete-all request + : Operation not permitted + + This patch is to fix it by filtering ipcomp states with a check + xsinfo->id.proto == IPPROTO_IPIP. + + Fixes: c7699875bee0 ("Import patch ipxfrm-20040707_2.diff") + Signed-off-by: Xin Long + Signed-off-by: Stephen Hemminger +--- + ip/xfrm_state.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/ip/xfrm_state.c b/ip/xfrm_state.c +index 7b413cd9b9a22..d014444e9af4f 100644 +--- a/ip/xfrm_state.c ++++ b/ip/xfrm_state.c +@@ -1131,6 +1131,9 @@ static int xfrm_state_keep(struct nlmsghdr *n, void *arg) + if (!xfrm_state_filter_match(xsinfo)) + return 0; + ++ if (xsinfo->id.proto == IPPROTO_IPIP) ++ return 0; ++ + if (xb->offset > xb->size) { + fprintf(stderr, "State buffer overflow\n"); + return -1; +-- +2.25.3 + diff --git a/SOURCES/0008-man-ip.8-Add-missing-vrf-subcommand-description.patch b/SOURCES/0008-man-ip.8-Add-missing-vrf-subcommand-description.patch new file mode 100644 index 0000000..7bc0e7b --- /dev/null +++ b/SOURCES/0008-man-ip.8-Add-missing-vrf-subcommand-description.patch @@ -0,0 +1,62 @@ +From 310becad3223411bc26e0401a838f2a7063406f3 Mon Sep 17 00:00:00 2001 +Message-Id: <310becad3223411bc26e0401a838f2a7063406f3.1587661326.git.aclaudi@redhat.com> +In-Reply-To: <4cd2ea662ae3255713a7de44e496e6ed32ade0c9.1587661326.git.aclaudi@redhat.com> +References: <4cd2ea662ae3255713a7de44e496e6ed32ade0c9.1587661326.git.aclaudi@redhat.com> +From: Andrea Claudi +Date: Thu, 23 Apr 2020 18:56:14 +0200 +Subject: [PATCH] man: ip.8: Add missing vrf subcommand description + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1780010 +Upstream Status: iproute2.git commit 229bb886a3c44 + +commit 229bb886a3c4444521eca16c7ab74a539aaf9cb4 +Author: Andrea Claudi +Date: Thu Feb 27 17:45:43 2020 +0100 + + man: ip.8: Add missing vrf subcommand description + + Add description to the vrf subcommand and a reference to the + dedicated man page. + + Signed-off-by: Andrea Claudi + Reviewed-by: David Ahern + Signed-off-by: Stephen Hemminger +--- + man/man8/ip.8 | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/man/man8/ip.8 b/man/man8/ip.8 +index e2bda2a2ea904..c425aaf1d506e 100644 +--- a/man/man8/ip.8 ++++ b/man/man8/ip.8 +@@ -22,7 +22,7 @@ ip \- show / manipulate routing, network devices, interfaces and tunnels + .BR link " | " address " | " addrlabel " | " route " | " rule " | " neigh " | "\ + ntable " | " tunnel " | " tuntap " | " maddress " | " mroute " | " mrule " | "\ + monitor " | " xfrm " | " netns " | " l2tp " | " tcp_metrics " | " token " | "\ +- macsec " }" ++ macsec " | " vrf " }" + .sp + + .ti -8 +@@ -312,6 +312,10 @@ readability. + .B tuntap + - manage TUN/TAP devices. + ++.TP ++.B vrf ++- manage virtual routing and forwarding devices. ++ + .TP + .B xfrm + - manage IPSec policies. +@@ -411,6 +415,7 @@ was written by Alexey N. Kuznetsov and added in Linux 2.2. + .BR ip-tcp_metrics (8), + .BR ip-token (8), + .BR ip-tunnel (8), ++.BR ip-vrf (8), + .BR ip-xfrm (8) + .br + .RB "IP Command reference " ip-cref.ps +-- +2.25.3 + diff --git a/SPECS/iproute.spec b/SPECS/iproute.spec index 43be57b..0c8241a 100644 --- a/SPECS/iproute.spec +++ b/SPECS/iproute.spec @@ -1,5 +1,5 @@ %define rpmversion 5.3.0 -%define specrelease 1%{?dist} +%define specrelease 2%{?dist} %define pkg_release %{specrelease}%{?buildid} Summary: Advanced IP routing and network device configuration tools @@ -12,6 +12,14 @@ Source0: http://kernel.org/pub/linux/utils/net/%{name}2/%{name}2-%{ve Source1: cbq-0000.example Source2: avpkt Source3: rt_dsfield.deprecated +Patch0: 0001-Update-kernel-headers.patch +Patch1: 0002-Update-kernel-headers.patch +Patch2: 0003-tc-implement-support-for-action-flags.patch +Patch3: 0004-man-rdma-statistic-Add-filter-description.patch +Patch4: 0005-man-rdma.8-Add-missing-resource-subcommand-descripti.patch +Patch5: 0006-ip-xfrm-Fix-help-messages.patch +Patch6: 0007-xfrm-not-try-to-delete-ipcomp-states-when-using-dele.patch +Patch7: 0008-man-ip.8-Add-missing-vrf-subcommand-description.patch License: GPLv2+ and Public Domain BuildRequires: bison BuildRequires: elfutils-libelf-devel @@ -156,6 +164,16 @@ cat %{SOURCE3} >>%{buildroot}%{_sysconfdir}/iproute2/rt_dsfield %{_includedir}/iproute2/bpf_elf.h %changelog +* Thu Apr 23 2020 Andrea Claudi [5.3.0-2.el8] +- man: ip.8: Add missing vrf subcommand description (Andrea Claudi) [1780010] +- xfrm: not try to delete ipcomp states when using deleteall (Andrea Claudi) [1808634] +- ip-xfrm: Fix help messages (Andrea Claudi) [1796045] +- man: rdma.8: Add missing resource subcommand description (Andrea Claudi) [1786576] +- man: rdma-statistic: Add filter description (Andrea Claudi) [1786565] +- tc: implement support for action flags (Andrea Claudi) [1770671] +- Update kernel headers (Andrea Claudi) [1770671] +- Update kernel headers (Andrea Claudi) [1770671] + * Tue Oct 15 2019 Andrea Claudi [5.3.0-1.el8] - New version 5.3.0 [1752857]