]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mptcp: add the mibs for MP_PRIO
authorGeliang Tang <geliangtang@gmail.com>
Sat, 9 Jan 2021 00:48:01 +0000 (16:48 -0800)
committerJakub Kicinski <kuba@kernel.org>
Sun, 10 Jan 2021 02:18:44 +0000 (18:18 -0800)
This patch added the mibs for MP_PRIO, MPTCP_MIB_MPPRIOTX for transmitting
of the MP_PRIO suboption, and MPTCP_MIB_MPPRIORX for receiving of it.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mptcp/mib.c
net/mptcp/mib.h
net/mptcp/options.c
net/mptcp/pm_netlink.c

index b921cbdd9aaa26e52ba10140bbd3c1d16806720f..8ca196489893f3fd12853834567f20d3ebfe43bc 100644 (file)
@@ -31,6 +31,8 @@ static const struct snmp_mib mptcp_snmp_list[] = {
        SNMP_MIB_ITEM("EchoAdd", MPTCP_MIB_ECHOADD),
        SNMP_MIB_ITEM("RmAddr", MPTCP_MIB_RMADDR),
        SNMP_MIB_ITEM("RmSubflow", MPTCP_MIB_RMSUBFLOW),
+       SNMP_MIB_ITEM("MPPrioTx", MPTCP_MIB_MPPRIOTX),
+       SNMP_MIB_ITEM("MPPrioRx", MPTCP_MIB_MPPRIORX),
        SNMP_MIB_SENTINEL
 };
 
index 47bcecce1106ea63d5f2e9b8883d5c937a8c2738..63914a5ef6a5dae8951553dc2038dc14c5371181 100644 (file)
@@ -24,6 +24,8 @@ enum linux_mptcp_mib_field {
        MPTCP_MIB_ECHOADD,              /* Received ADD_ADDR with echo-flag=1 */
        MPTCP_MIB_RMADDR,               /* Received RM_ADDR */
        MPTCP_MIB_RMSUBFLOW,            /* Remove a subflow */
+       MPTCP_MIB_MPPRIOTX,             /* Transmit a MP_PRIO */
+       MPTCP_MIB_MPPRIORX,             /* Received a MP_PRIO */
        __MPTCP_MIB_MAX
 };
 
index adfa96dd991c388e618c7fd211e65f2944955d54..c9643344a8d740a20a05b8ebeac880c51a7f6c65 100644 (file)
@@ -1034,6 +1034,7 @@ void mptcp_incoming_options(struct sock *sk, struct sk_buff *skb)
 
        if (mp_opt.mp_prio) {
                mptcp_pm_mp_prio_received(sk, mp_opt.backup);
+               MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_MPPRIORX);
                mp_opt.mp_prio = 0;
        }
 
index 8f80099f165799b3b142b1ea2bd6a37d81fb79bf..9b1f6298bbdba9dbaca0dbbe7b4064a5af580e07 100644 (file)
@@ -452,6 +452,7 @@ int mptcp_pm_nl_mp_prio_send_ack(struct mptcp_sock *msk,
 
        mptcp_for_each_subflow(msk, subflow) {
                struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
+               struct sock *sk = (struct sock *)msk;
                struct mptcp_addr_info local;
 
                local_address((struct sock_common *)ssk, &local);
@@ -461,6 +462,7 @@ int mptcp_pm_nl_mp_prio_send_ack(struct mptcp_sock *msk,
                subflow->backup = bkup;
                subflow->send_mp_prio = 1;
                subflow->request_bkup = bkup;
+               __MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_MPPRIOTX);
 
                spin_unlock_bh(&msk->pm.lock);
                pr_debug("send ack for mp_prio");