net: reorganize IP MIB values (II)
Subsystems (2)
PATCH 1/1 net: reorganize IP MIB values (II)
Commit 14a196807482 ("net: reorganize IP MIB values") changed MIB values to group hot fields together.
Since then 5 new fields have been added without caring about data locality.
This patch moves IPSTATS_MIB_OUTPKTS, IPSTATS_MIB_NOECTPKTS, IPSTATS_MIB_ECT1PKTS, IPSTATS_MIB_ECT0PKTS, IPSTATS_MIB_CEPKTS to the hot portion of per-cpu data.
--- include/uapi/linux/snmp.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
include/uapi/linux/snmp.h +6 -6
@@ -23,9 +23,14 @@ enumIPSTATS_MIB_INPKTS ,/* InReceives */ IPSTATS_MIB_INOCTETS ,/* InOctets */ IPSTATS_MIB_INDELIVERS ,/* InDelivers */ -IPSTATS_MIB_OUTFORWDATAGRAMS ,/* OutForwDatagrams */ +IPSTATS_MIB_NOECTPKTS ,/* InNoECTPkts */ +IPSTATS_MIB_ECT1PKTS ,/* InECT1Pkts */ +IPSTATS_MIB_ECT0PKTS ,/* InECT0Pkts */ +IPSTATS_MIB_CEPKTS ,/* InCEPkts */ IPSTATS_MIB_OUTREQUESTS ,/* OutRequests */ +IPSTATS_MIB_OUTPKTS ,/* OutTransmits */ IPSTATS_MIB_OUTOCTETS ,/* OutOctets */ +IPSTATS_MIB_OUTFORWDATAGRAMS ,/* OutForwDatagrams */ /* other fields */ IPSTATS_MIB_INHDRERRORS ,/* InHdrErrors */ IPSTATS_MIB_INTOOBIGERRORS, /* InTooBigErrors */
@@ -52,12 +57,7 @@ enumIPSTATS_MIB_INBCASTOCTETS ,/* InBcastOctets */ IPSTATS_MIB_OUTBCASTOCTETS ,/* OutBcastOctets */ IPSTATS_MIB_CSUMERRORS ,/* InCsumErrors */ -IPSTATS_MIB_NOECTPKTS ,/* InNoECTPkts */ -IPSTATS_MIB_ECT1PKTS ,/* InECT1Pkts */ -IPSTATS_MIB_ECT0PKTS ,/* InECT0Pkts */ -IPSTATS_MIB_CEPKTS ,/* InCEPkts */ IPSTATS_MIB_REASM_OVERLAPS ,/* ReasmOverlaps */ -IPSTATS_MIB_OUTPKTS ,/* OutTransmits */ __IPSTATS_MIB_MAX };
Signature · 1 line
2.49.0.rc1.451.g8f38331e32-goog
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 11 lines · On Thu, 20 Mar 2025 10:14:34 +0000 you wrote:
Commit
14a196807482("net: reorganize IP MIB values") changed MIB values to group hot fields together.Since then 5 new fields have been added without caring about data locality.
This patch moves
IPSTATS_MIB_OUTPKTS,IPSTATS_MIB_NOECTPKTS,IPSTATS_MIB_ECT1PKTS,IPSTATS_MIB_ECT0PKTS,IPSTATS_MIB_CEPKTSto the hot portion of per-cpu data.[...]
Here is the summary with links:
- [net-next] net: reorganize IP MIB values (II)
https://git.kernel.org/netdev/net-next/c/652e2c777862
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
Quoted 9 lines · Eric Dumazet
Commit
14a196807482("net: reorganize IP MIB values") changed MIB values to group hot fields together.Since then 5 new fields have been added without caring about data locality.
This patch moves
IPSTATS_MIB_OUTPKTS,IPSTATS_MIB_NOECTPKTS,IPSTATS_MIB_ECT1PKTS,IPSTATS_MIB_ECT0PKTS,IPSTATS_MIB_CEPKTSto the hot portion of per-cpu data.
Hi,
the patch
reorders the enum values in the user space header. It's not only done by this patch, for example also b4a11b2033b7d3dfdd46592f7036a775b18cecd1. Similarly, the LINUX_MIB_* enums keep changing.
This seems problematic to me. For example, iproute2 does:
which only works as long as the kernel headers (at compile time) are in sync with the running kernel. That is often not the case, for example with containers.
libnl3 also is affected and tries to (badly) workaround this:
https://github.com/thom311/libnl/commit/5981a39583ab65dca230a8ee70625626d9ec9fc8
How do you suggest should API users handle this? In the future, would it be possible to keep the API stable and backward compatible?
Thank you,
Thomas