From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 81203426D4; Fri, 6 Oct 2023 19:04:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0755F402C8; Fri, 6 Oct 2023 19:04:18 +0200 (CEST) Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by mails.dpdk.org (Postfix) with ESMTP id 82B9C402B9 for ; Fri, 6 Oct 2023 19:04:16 +0200 (CEST) Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-6969b391791so1900808b3a.3 for ; Fri, 06 Oct 2023 10:04:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1696611855; x=1697216655; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=aHbDxLC00CeVmOmv7uSvFW91/+HgkxiNi9Ot3zn4/TA=; b=ZCLT8Udwd0MOsPP3qmX9eV2hpRz0BrrPVe9n5aNjsV7+QAUoKXSPKGxm1nMeWySt/J Xp4B59fy0jd7GdkNkNk9vA0W7BvAHEvfhbFqfuFbwiUhSIS/TPe+v4lfOnqpE0kt78N2 uqfrG9bIiq5waVy8OPrUfqOBphoscjP1O8tziP4PJKUSsONneir/PI8lXz0BNGJtJWTk iZt1HR5V4iiNTUss+P02YBp0VIC2B5zfCktE8V1uws4aflcwlXo/VeVd2/DlDWywaNG5 0JLMEIiNRjTwxjC/LftKE0J36TBxMYm16T+j4Mk+6NhDrto3JhyhgoU/6zDgqa/U2kXa fppA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696611855; x=1697216655; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aHbDxLC00CeVmOmv7uSvFW91/+HgkxiNi9Ot3zn4/TA=; b=vHCpgweMi40g8LFcDKAYepc9vM3WIh9TjZluz7AjsHSx6Wgz/Ct/0HfEgBs2i94Yrt KAEe0x/PmyS1KTzHB7fx3lM50VAVhLPT+xzmVWSgbVmfjxBE8oRWz4gMlMRrvLAwaHsb ZYoEcCWzPwdprRwFSD3NsfByo5jPvmA4G2lR38RlPXmPGIKySbkMatwvNRh+G8UnOUtM l2uVP4fs0LOn9fXatM8iauxNTkrqI+Mw8kYmOjqS2fBzFk7WfLCYAdMMaobs6dlwjNbA 3jG1lD9NYXdww6OdA3cII+UU5tcvBCu2c37MVCAxTC+36zRgJ6n+cTqxABqaDmfUMg5r gCqg== X-Gm-Message-State: AOJu0Yxj/BupYS52w6eG3FPtYDf7z4tdL8l/04HIiV5u1QkLhyHSla0I C0byoYf7NNPlYpC/Rwzix4TTGA== X-Google-Smtp-Source: AGHT+IFnZGZWUIKufXKlsrzoDj6x9F4glby1/bhfMR28s3cs0XJiOgtGQPz6FcuF3UHW58IDayUHRw== X-Received: by 2002:a05:6a20:4305:b0:15e:2d9f:cae0 with SMTP id h5-20020a056a20430500b0015e2d9fcae0mr9932674pzk.10.1696611855489; Fri, 06 Oct 2023 10:04:15 -0700 (PDT) Received: from hermes.local (204-195-126-68.wavecable.com. [204.195.126.68]) by smtp.gmail.com with ESMTPSA id n16-20020a62e510000000b00687fcb1e609sm1702544pff.116.2023.10.06.10.04.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 10:04:14 -0700 (PDT) Date: Fri, 6 Oct 2023 10:04:12 -0700 From: Stephen Hemminger To: Morten =?UTF-8?B?QnLDuHJ1cA==?= Cc: "Harman Kalra" , "Anatoly Burakov" , "David Hunt" , , , Subject: Re: How to rte_epoll_wait for IPC? Message-ID: <20231006100412.5e8e9ef2@hermes.local> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9EF09@smartserver.smartshare.dk> References: <98CBD80474FA8B44BF855DF32C47DC35E9EF02@smartserver.smartshare.dk> <20231006090306.0ba9d5e6@hermes.local> <98CBD80474FA8B44BF855DF32C47DC35E9EF09@smartserver.smartshare.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Fri, 6 Oct 2023 18:28:10 +0200 Morten Br=C3=B8rup wrote: > > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > > Sent: Friday, 6 October 2023 18.03 > >=20 > > On Fri, 6 Oct 2023 12:03:46 +0200 > > Morten Br=C3=B8rup wrote: > > =20 > > > 2. The "processing" thread receives its packets from the rte_ring. =20 > > This thread should sleep until packets are ready for it in the rte_ring= . =20 > > > > > > The "ingress" thread knows when it puts packets into the rte_ring, so= =20 > > it can signal that event to the "processing" thread, to wake it up; > > either as an interrupt/signal, or through a file descriptor. Is this > > supported by rte_epoll (or other DPDK APIs), and how? > >=20 > > When having to do this in applications, I used a eventfd() as well as > > the rte ring. > > The ingress write's to eventfd and the other thread used epoll on the > > fd. > >=20 > > Optimized this by having the ingress thread only signal via write if > > ring was in empty state. > > And the reader thread only needs to do (epoll/read) if ring became empty > > during last cycle; > > i.e num packets from rte_ring_burst() was 0. > >=20 > > Basically, when using epoll and other SW event models, you need to turn > > all data sources > > into file descriptors. =20 >=20 > This sounds exactly like what I am looking for. >=20 > Are there DPDK APIs for eventfd(), so I can use them with rte_epoll_wait? Eventfd is just a system call. You then add the resulting fd to epoll object with rte_epoll_ctl().