Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mptcp: add the mib for data checksum

This patch added the mib for the data checksum, MPTCP_MIB_DATACSUMERR.

Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Geliang Tang and committed by
David S. Miller
fe3ab1cb 4e14867d

+5 -1
+1
net/mptcp/mib.c
··· 25 25 SNMP_MIB_ITEM("MPJoinAckHMacFailure", MPTCP_MIB_JOINACKMAC), 26 26 SNMP_MIB_ITEM("DSSNotMatching", MPTCP_MIB_DSSNOMATCH), 27 27 SNMP_MIB_ITEM("InfiniteMapRx", MPTCP_MIB_INFINITEMAPRX), 28 + SNMP_MIB_ITEM("DataCsumErr", MPTCP_MIB_DATACSUMERR), 28 29 SNMP_MIB_ITEM("OFOQueueTail", MPTCP_MIB_OFOQUEUETAIL), 29 30 SNMP_MIB_ITEM("OFOQueue", MPTCP_MIB_OFOQUEUE), 30 31 SNMP_MIB_ITEM("OFOMerge", MPTCP_MIB_OFOMERGE),
+1
net/mptcp/mib.h
··· 18 18 MPTCP_MIB_JOINACKMAC, /* HMAC was wrong on ACK + MP_JOIN */ 19 19 MPTCP_MIB_DSSNOMATCH, /* Received a new mapping that did not match the previous one */ 20 20 MPTCP_MIB_INFINITEMAPRX, /* Received an infinite mapping */ 21 + MPTCP_MIB_DATACSUMERR, /* The data checksum fail */ 21 22 MPTCP_MIB_OFOQUEUETAIL, /* Segments inserted into OoO queue tail */ 22 23 MPTCP_MIB_OFOQUEUE, /* Segments inserted into OoO queue */ 23 24 MPTCP_MIB_OFOMERGE, /* Segments merged in OoO queue */
+3 -1
net/mptcp/subflow.c
··· 900 900 header.csum = 0; 901 901 902 902 csum = csum_partial(&header, sizeof(header), subflow->map_data_csum); 903 - if (unlikely(csum_fold(csum))) 903 + if (unlikely(csum_fold(csum))) { 904 + MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_DATACSUMERR); 904 905 return subflow->mp_join ? MAPPING_INVALID : MAPPING_DUMMY; 906 + } 905 907 906 908 return MAPPING_OK; 907 909 }