Message ID | 20231026081959.3477034-4-lixiaoyan@google.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | Analyze and Reorganize core Networking Structs to optimize cacheline consumption | expand |
On Thu, 26 Oct 2023 08:19:56 +0000 Coco Li wrote: > Subject: [PATCH v4 net-next 3/6] net-smnp: reorganize SNMP fast path variables s/smnp/snmp/ > names of the metrics. User space binaries not ignoreing the ignoring > +/* Enums in this file are exported by their name and by > + * their values. User space binaries should ingest both > + * of the above, and therefore ordering changes in this > + * file does not break user space. For an example, please > + * see the output of /proc/net/netstat. I don't understand, what does it mean to be exposed by value? User space uses the enum to offset into something or not? If not why don't we move the enum out of uAPI entirely? > + /* Caacheline organization can be found documented in Cacheline Please invest (your time) a spell check :S
On Thu, Oct 26, 2023 at 7:20 AM Jakub Kicinski <kuba@kernel.org> wrote: > > On Thu, 26 Oct 2023 08:19:56 +0000 Coco Li wrote: > > Subject: [PATCH v4 net-next 3/6] net-smnp: reorganize SNMP fast path variables > > s/smnp/snmp/ > > > names of the metrics. User space binaries not ignoreing the > > ignoring > > > +/* Enums in this file are exported by their name and by > > + * their values. User space binaries should ingest both > > + * of the above, and therefore ordering changes in this > > + * file does not break user space. For an example, please > > + * see the output of /proc/net/netstat. > > I don't understand, what does it mean to be exposed by value? > User space uses the enum to offset into something or not? > If not why don't we move the enum out of uAPI entirely? > I mostly meant that i.e. cat /proc/net/netstat will export enum names first, and that userspace binary should consume both the name and the value. I have no objections to moving the enums outside, but that seems a bit tangential to the purpose of this patch series. > > + /* Caacheline organization can be found documented in > > Cacheline > > Please invest (your time) a spell check :S Much apologies, will run through spell checkers in the future.
On Thu, 26 Oct 2023 16:52:35 -0700 Coco Li wrote: > I have no objections to moving the enums outside, but that seems a bit > tangential to the purpose of this patch series. My thinking is - we assume we can reshuffle this enum, because nobody uses the enum values directly. If someone does, tho, we would be breaking binary compatibility. Moving it out of include/uapi/ would break the build for anyone trying to refer to the enum, That gives us quicker signal that we may have broken someone's code.
On Fri, Oct 27, 2023 at 3:23 AM Jakub Kicinski <kuba@kernel.org> wrote: > > On Thu, 26 Oct 2023 16:52:35 -0700 Coco Li wrote: > > I have no objections to moving the enums outside, but that seems a bit > > tangential to the purpose of this patch series. > > My thinking is - we assume we can reshuffle this enum, because nobody > uses the enum values directly. If someone does, tho, we would be > breaking binary compatibility. > > Moving it out of include/uapi/ would break the build for anyone trying > to refer to the enum, That gives us quicker signal that we may have > broken someone's code. Note that we already in the past shuffled values without anyone objecting... We probably can move the enums out of uapi, I suggest we remove this patch from the series and do that in the next cycle, I think other reorgs are more important.
On Fri, Oct 27, 2023, 12:55 AM Eric Dumazet <edumazet@google.com> wrote: > > On Fri, Oct 27, 2023 at 3:23 AM Jakub Kicinski <kuba@kernel.org> wrote: > > > > On Thu, 26 Oct 2023 16:52:35 -0700 Coco Li wrote: > > > I have no objections to moving the enums outside, but that seems a bit > > > tangential to the purpose of this patch series. > > > > My thinking is - we assume we can reshuffle this enum, because nobody > > uses the enum values directly. If someone does, tho, we would be > > breaking binary compatibility. > > > > Moving it out of include/uapi/ would break the build for anyone trying > > to refer to the enum, That gives us quicker signal that we may have > > broken someone's code. > > Note that we already in the past shuffled values without anyone objecting... > > We probably can move the enums out of uapi, I suggest we remove this > patch from the series > and do that in the next cycle, I think other reorgs are more important. I agree. Will remove this commit in v5 of patch which I will update soon, and send in a separate patch series to move enum out of uapi and reorganize snmp counters. Thanks for the discussion!
diff --git a/include/uapi/linux/snmp.h b/include/uapi/linux/snmp.h index b2b72886cb6d1..70be81c1fdb6d 100644 --- a/include/uapi/linux/snmp.h +++ b/include/uapi/linux/snmp.h @@ -8,6 +8,13 @@ #ifndef _LINUX_SNMP_H #define _LINUX_SNMP_H +/* Enums in this file are exported by their name and by + * their values. User space binaries should ingest both + * of the above, and therefore ordering changes in this + * file does not break user space. For an example, please + * see the output of /proc/net/netstat. + */ + /* ipstats mib definitions */ /* * RFC 1213: MIB-II @@ -170,7 +177,28 @@ enum /* linux mib definitions */ enum { + /* Caacheline organization can be found documented in + * Documentation/networking/net_cachelines/snmp.rst. + * Please update the document when adding new fields. + */ + LINUX_MIB_NUM = 0, + /* TX hotpath */ + LINUX_MIB_TCPAUTOCORKING, /* TCPAutoCorking */ + LINUX_MIB_TCPFROMZEROWINDOWADV, /* TCPFromZeroWindowAdv */ + LINUX_MIB_TCPTOZEROWINDOWADV, /* TCPToZeroWindowAdv */ + LINUX_MIB_TCPWANTZEROWINDOWADV, /* TCPWantZeroWindowAdv */ + LINUX_MIB_TCPORIGDATASENT, /* TCPOrigDataSent */ + LINUX_MIB_TCPPUREACKS, /* TCPPureAcks */ + LINUX_MIB_TCPHPACKS, /* TCPHPAcks */ + LINUX_MIB_TCPDELIVERED, /* TCPDelivered */ + /* RX hotpath */ + LINUX_MIB_TCPHPHITS, /* TCPHPHits */ + LINUX_MIB_TCPRCVCOALESCE, /* TCPRcvCoalesce */ + LINUX_MIB_TCPKEEPALIVE, /* TCPKeepAlive */ + LINUX_MIB_DELAYEDACKS, /* DelayedACKs */ + LINUX_MIB_DELAYEDACKLOCKED, /* DelayedACKLocked */ + /* End of hotpath variables */ LINUX_MIB_SYNCOOKIESSENT, /* SyncookiesSent */ LINUX_MIB_SYNCOOKIESRECV, /* SyncookiesRecv */ LINUX_MIB_SYNCOOKIESFAILED, /* SyncookiesFailed */ @@ -186,14 +214,9 @@ enum LINUX_MIB_TIMEWAITKILLED, /* TimeWaitKilled */ LINUX_MIB_PAWSACTIVEREJECTED, /* PAWSActiveRejected */ LINUX_MIB_PAWSESTABREJECTED, /* PAWSEstabRejected */ - LINUX_MIB_DELAYEDACKS, /* DelayedACKs */ - LINUX_MIB_DELAYEDACKLOCKED, /* DelayedACKLocked */ LINUX_MIB_DELAYEDACKLOST, /* DelayedACKLost */ LINUX_MIB_LISTENOVERFLOWS, /* ListenOverflows */ LINUX_MIB_LISTENDROPS, /* ListenDrops */ - LINUX_MIB_TCPHPHITS, /* TCPHPHits */ - LINUX_MIB_TCPPUREACKS, /* TCPPureAcks */ - LINUX_MIB_TCPHPACKS, /* TCPHPAcks */ LINUX_MIB_TCPRENORECOVERY, /* TCPRenoRecovery */ LINUX_MIB_TCPSACKRECOVERY, /* TCPSackRecovery */ LINUX_MIB_TCPSACKRENEGING, /* TCPSACKReneging */ @@ -247,7 +270,6 @@ enum LINUX_MIB_TCPREQQFULLDOCOOKIES, /* TCPReqQFullDoCookies */ LINUX_MIB_TCPREQQFULLDROP, /* TCPReqQFullDrop */ LINUX_MIB_TCPRETRANSFAIL, /* TCPRetransFail */ - LINUX_MIB_TCPRCVCOALESCE, /* TCPRcvCoalesce */ LINUX_MIB_TCPBACKLOGCOALESCE, /* TCPBacklogCoalesce */ LINUX_MIB_TCPOFOQUEUE, /* TCPOFOQueue */ LINUX_MIB_TCPOFODROP, /* TCPOFODrop */ @@ -263,12 +285,7 @@ enum LINUX_MIB_TCPFASTOPENBLACKHOLE, /* TCPFastOpenBlackholeDetect */ LINUX_MIB_TCPSPURIOUS_RTX_HOSTQUEUES, /* TCPSpuriousRtxHostQueues */ LINUX_MIB_BUSYPOLLRXPACKETS, /* BusyPollRxPackets */ - LINUX_MIB_TCPAUTOCORKING, /* TCPAutoCorking */ - LINUX_MIB_TCPFROMZEROWINDOWADV, /* TCPFromZeroWindowAdv */ - LINUX_MIB_TCPTOZEROWINDOWADV, /* TCPToZeroWindowAdv */ - LINUX_MIB_TCPWANTZEROWINDOWADV, /* TCPWantZeroWindowAdv */ LINUX_MIB_TCPSYNRETRANS, /* TCPSynRetrans */ - LINUX_MIB_TCPORIGDATASENT, /* TCPOrigDataSent */ LINUX_MIB_TCPHYSTARTTRAINDETECT, /* TCPHystartTrainDetect */ LINUX_MIB_TCPHYSTARTTRAINCWND, /* TCPHystartTrainCwnd */ LINUX_MIB_TCPHYSTARTDELAYDETECT, /* TCPHystartDelayDetect */ @@ -280,10 +297,8 @@ enum LINUX_MIB_TCPACKSKIPPEDTIMEWAIT, /* TCPACKSkippedTimeWait */ LINUX_MIB_TCPACKSKIPPEDCHALLENGE, /* TCPACKSkippedChallenge */ LINUX_MIB_TCPWINPROBE, /* TCPWinProbe */ - LINUX_MIB_TCPKEEPALIVE, /* TCPKeepAlive */ LINUX_MIB_TCPMTUPFAIL, /* TCPMTUPFail */ LINUX_MIB_TCPMTUPSUCCESS, /* TCPMTUPSuccess */ - LINUX_MIB_TCPDELIVERED, /* TCPDelivered */ LINUX_MIB_TCPDELIVEREDCE, /* TCPDeliveredCE */ LINUX_MIB_TCPACKCOMPRESSED, /* TCPAckCompressed */ LINUX_MIB_TCPZEROWINDOWDROP, /* TCPZeroWindowDrop */