From d5dfcd4489e25c1b6e985fb6b8a700c8a49c68df Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Tue, 3 May 2022 18:33:11 +0100 Subject: bpo-46696: Add socket.SO_INCOMING_CPU constant (#31237) Co-authored-by: Jelle Zijlstra --- Doc/library/socket.rst | 9 +++++++++ .../NEWS.d/next/Library/2022-02-09-21-40-02.bpo-46696.nPXRno.rst | 1 + Modules/socketmodule.c | 3 +++ 3 files changed, 13 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2022-02-09-21-40-02.bpo-46696.nPXRno.rst diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index 3b1912c..ee1aee5 100755 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -575,6 +575,15 @@ Constants .. availability:: FreeBSD. +.. data:: SO_INCOMING_CPU + + Constant to optimize CPU locality, to be used in conjunction with + :data:`SO_REUSEPORT`. + + .. versionadded:: 3.11 + + .. availability:: Linux >= 3.9 + Functions ^^^^^^^^^ diff --git a/Misc/NEWS.d/next/Library/2022-02-09-21-40-02.bpo-46696.nPXRno.rst b/Misc/NEWS.d/next/Library/2022-02-09-21-40-02.bpo-46696.nPXRno.rst new file mode 100644 index 0000000..04c4188 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-02-09-21-40-02.bpo-46696.nPXRno.rst @@ -0,0 +1 @@ +Add ``SO_INCOMING_CPU`` constant to :mod:`socket`. diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 9ecabaf..c650b25 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -7505,6 +7505,9 @@ PyInit__socket(void) #ifdef SO_EXCLUSIVEADDRUSE PyModule_AddIntMacro(m, SO_EXCLUSIVEADDRUSE); #endif +#ifdef SO_INCOMING_CPU + PyModule_AddIntMacro(m, SO_INCOMING_CPU); +#endif #ifdef SO_KEEPALIVE PyModule_AddIntMacro(m, SO_KEEPALIVE); -- cgit v0.12