From patchwork Wed May 29 07:23:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Damato X-Patchwork-Id: 1940960 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=fastly.com header.i=@fastly.com header.a=rsa-sha256 header.s=google header.b=INLVoNhJ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=uclibc-ng.org (client-ip=2a00:1828:2000:679::23; helo=helium.openadk.org; envelope-from=devel-bounces@uclibc-ng.org; receiver=patchwork.ozlabs.org) Received: from helium.openadk.org (helium.openadk.org [IPv6:2a00:1828:2000:679::23]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vq19k0wSzz20Pr for ; Wed, 29 May 2024 17:24:55 +1000 (AEST) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id 1B9963528331; Wed, 29 May 2024 09:24:35 +0200 (CEST) Authentication-Results: helium.openadk.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=fastly.com header.i=@fastly.com header.a=rsa-sha256 header.s=google header.b=INLVoNhJ; dkim-atps=neutral Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by helium.openadk.org (Postfix) with ESMTPS id 8C2B23528323 for ; Wed, 29 May 2024 09:24:06 +0200 (CEST) Received: by mail-pj1-f43.google.com with SMTP id 98e67ed59e1d1-2bdf446f3d1so1368511a91.3 for ; Wed, 29 May 2024 00:24:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1716967444; x=1717572244; darn=uclibc-ng.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ki2csbz6HVWWeWwLfL5fPn2R4UUe6g7AN3vqw7LWyDU=; b=INLVoNhJmIKnF7R+iSC936CHIfsDXNT+WZz+3pncs3JAHVLL6pwRKviwBJaF/p7M5v s9Gzo2OXvIA5ba5a+DJ7JGUcpZb1BmHVNp9/wCsUbL5SkJyeSo+L3bYurAbvrYVFifXv JmQvhQQaE4jV0rMOEmkxfd9q6YjtUzQmxdk2w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716967444; x=1717572244; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ki2csbz6HVWWeWwLfL5fPn2R4UUe6g7AN3vqw7LWyDU=; b=g15mPEa8oTysda0vHHB5Snpr/usw7l41bhLMu+m/Lt71CA554apSb+632FlIoQYEIx G2OUXAxVSPUnM5FL0SkYXI7WgsrovFUOkikIq3exL9Rz3Ggn7U5g9mY/SFsjGfJPb2x5 QiK7pQsQCsXOt1Rx24K+DF1sc0XSgCPwE4P/aVXKgbTmIDwz/QvPznWpvYHBHz2uPci8 VBXQe4B2RkHqveLTM4rDCMycBR1eyXbEdOc1xu0fIwBUVlFDqUkTzc7c9oSBAHoE8ZY1 Qk8wYBrZ4lFZU7cfmflaDqd7w6NBz0EbyPL3TApqjUimDDWjhvd59Aay5/qVOpj3SZsJ pXwA== X-Gm-Message-State: AOJu0YwVOVmQF7ElPo9AgEKXGXi3UPf0siOPQs5pGcqa2LuED3jEx1bL tYeogocTnNN0Qs/2LbE/gNj7P/S3BwkwEKCo+VqtngFivcEa3cRrwRTRwFD1Yovstl/Y1Mznjvp I6gd2eYWnR0RBRnXMPfZCZVdWTTJA85uIT64i1xAFaevF3HBnvav+PWcUamTKddcUawLQw6lz5n R7nHlkDITIUISMJdj2bMp/pK5ijaEd0VI= X-Google-Smtp-Source: AGHT+IEH0j3TSIAvRjg/k/833QPESymJ/WAxgxb5L/dbiZaKWD11r+FyqUeralbqwpWT42iC7THPOg== X-Received: by 2002:a17:90a:db93:b0:2a2:9b37:367a with SMTP id 98e67ed59e1d1-2bf5f715562mr12875818a91.39.1716967443507; Wed, 29 May 2024 00:24:03 -0700 (PDT) Received: from localhost.localdomain ([2620:11a:c019:0:65e:3115:2f58:c5fd]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2bf5f50c3fdsm8990315a91.18.2024.05.29.00.24.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 00:24:03 -0700 (PDT) From: Joe Damato To: devel@uclibc-ng.org Date: Wed, 29 May 2024 07:23:50 +0000 Message-Id: <20240529072350.9395-1-jdamato@fastly.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Message-ID-Hash: YV7J4YFJNRIM325CNJAG6ACC4FYDAWYS X-Message-ID-Hash: YV7J4YFJNRIM325CNJAG6ACC4FYDAWYS X-MailFrom: jdamato@fastly.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Joe Damato X-Mailman-Version: 3.3.3 Precedence: list Subject: [uclibc-ng-devel] [PATCH] epoll.h: Add epoll ioctls List-Id: uClibc-ng Development Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: add two ioctls to get and set struct epoll_params to allow users to control epoll based busy polling of network sockets. added to uapi in commit 18e2bf0edf4dd88d9656ec92395aa47392e85b61 (Linux kernel 6.9 and newer). Signed-off-by: Joe Damato --- libc/sysdeps/linux/common/sys/epoll.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libc/sysdeps/linux/common/sys/epoll.h b/libc/sysdeps/linux/common/sys/epoll.h index 5551bed0d..5138d77a9 100644 --- a/libc/sysdeps/linux/common/sys/epoll.h +++ b/libc/sysdeps/linux/common/sys/epoll.h @@ -19,6 +19,7 @@ #define _SYS_EPOLL_H 1 #include +#include #include /* Get __sigset_t. */ @@ -87,6 +88,19 @@ struct epoll_event epoll_data_t data; /* User data variable */ } __EPOLL_PACKED; +struct epoll_params +{ + uint32_t busy_poll_usecs; + uint16_t busy_poll_budget; + uint8_t prefer_busy_poll; + + /* pad the struct to a multiple of 64bits */ + uint8_t __pad; +}; + +#define EPOLL_IOC_TYPE 0x8A +#define EPIOCSPARAMS _IOW(EPOLL_IOC_TYPE, 0x01, struct epoll_params) +#define EPIOCGPARAMS _IOR(EPOLL_IOC_TYPE, 0x02, struct epoll_params) __BEGIN_DECLS