From d892193e2a2bc5f30acad906589a0e32a50cb88b Mon Sep 17 00:00:00 2001 From: David Carlier Date: Wed, 9 Feb 2022 21:36:22 +0000 Subject: [PATCH 1/4] socketmodule SO_INCOMING_CPU constant addition --- Doc/library/socket.rst | 9 +++++++++ Modules/socketmodule.c | 3 +++ 2 files changed, 12 insertions(+) diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index 3b1912cff88a41..35617080b5a4b4 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 + `SO_REUSEPORT`. + + .. versionadded:: 3.11 + + .. availability:: Linux >= 3.9 + Functions ^^^^^^^^^ diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 9ecabaf9730744..c650b25c095090 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); From 59b1422d3f7c04d24d95c397a81ac356a2621304 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Wed, 9 Feb 2022 21:40:05 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NEWS.d/next/Library/2022-02-09-21-40-02.bpo-46696.nPXRno.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2022-02-09-21-40-02.bpo-46696.nPXRno.rst 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 00000000000000..04c41887afd6e4 --- /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`. From a2ddf3326efe6d89834ad662fae60f55bc958627 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Tue, 3 May 2022 09:37:53 -0600 Subject: [PATCH 3/4] Apply suggestions from code review --- Doc/library/socket.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index 35617080b5a4b4..49da98a0304452 100755 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -577,13 +577,15 @@ Constants .. data:: SO_INCOMING_CPU - Constant to optimize cpu locality, to be used in conjunction with - `SO_REUSEPORT`. + Constant to optimize CPU locality, to be used in conjunction with + :data:`SO_REUSEPORT`. .. versionadded:: 3.11 .. availability:: Linux >= 3.9 + .. availability:: Linux >= 3.9 + Functions ^^^^^^^^^ From 604dabc5c7d6426916334eeba2fcc9c65c8889cb Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Tue, 3 May 2022 09:38:21 -0600 Subject: [PATCH 4/4] Update Doc/library/socket.rst --- Doc/library/socket.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index 49da98a0304452..ee1aee5278b3be 100755 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -584,8 +584,6 @@ Constants .. availability:: Linux >= 3.9 - .. availability:: Linux >= 3.9 - Functions ^^^^^^^^^