From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <users-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id C8F3941C44
	for <public@inbox.dpdk.org>; Thu,  9 Feb 2023 01:00:59 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 8A68840DDA;
	Thu,  9 Feb 2023 01:00:59 +0100 (CET)
Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com
 [209.85.216.54]) by mails.dpdk.org (Postfix) with ESMTP id B05A04067B
 for <users@dpdk.org>; Thu,  9 Feb 2023 01:00:58 +0100 (CET)
Received: by mail-pj1-f54.google.com with SMTP id
 gj9-20020a17090b108900b0023114156d36so3984595pjb.4
 for <users@dpdk.org>; Wed, 08 Feb 2023 16:00:58 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=networkplumber-org.20210112.gappssmtp.com; s=20210112;
 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=d2e6RtqSdN2A0/KlGFkBw9emTYVeeN0YFreov9ywjhc=;
 b=v+pps+FZ9aoJeaBWOFDu+h36UVJ9fpLUSMCeSEV1kDe/LZZyHFSqUbk708u/CGAmd7
 JxE75HGj1EeLE04RXYYPNl/gt/gwGhviT5kxOUF2Neux4SVX/ao8XNcm5vcllcDo347W
 Y2FUJo7SG4y5RhDGO9aIA+3bodKQzwp5I3P4VYSN9Nwnig6JZBeAU4Cyxatvl70gIM0T
 dqcDHLSg90dd23UqfydYT7QsfXpSurtF0BzK7RNQ6N08dYmfJ69auOI56+ncyfrQZQjl
 mojzsRrN9YoTCX36Ah5A56TkiYvg7sDRvO+L1+FfGPZHKNxkHA+glSqxXnZBSR5hpUVu
 TGGw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 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=d2e6RtqSdN2A0/KlGFkBw9emTYVeeN0YFreov9ywjhc=;
 b=BErS80RS3QvuXEdyrO9QswFsLUkTDivLKM9Djakc3afFH1tdbWrBK6rn4cYfWX9oJv
 qv5OC8FCIiD7mbdeJSLA30rh0OceUMCU/h1mKr/mi7cAXYP7qAzZRvZ+ChfAOkMIFjOU
 CQ336FGrkLzEgSbuU9TxxNSXhNC++2H6Ud40nylqLHduCmBgzFLuIknxE/YTnp7pRCO9
 7Q+LOmeOGg7uyl/VwkngcX/eOxP5Ab+VzNgnXjQ/QrB3bNaSOfMDG8oU9QYnaGYu4ylO
 PVUyWZwOFA+Ys9QLGKDIjShxpH3whM7TM8rn4DdVPEQB63LNJxmuxoI14QTem2u6/iN9
 XRAA==
X-Gm-Message-State: AO0yUKVBu6WxtqrOE2d7VzydCsYbgx1n2VSc0SBNWwDDt0y/faqzskDB
 IzkDE6hfyvoOMhaSN4Pvu/TXZQ==
X-Google-Smtp-Source: AK7set+R906clhYS91OqSAU7boe2I01UpozKjG8BXwQODVokfmmIhmLbau19fW5c5h6UU9rAA30WLA==
X-Received: by 2002:a05:6a20:8e05:b0:c3:18f8:6c3a with SMTP id
 y5-20020a056a208e0500b000c318f86c3amr4729575pzj.9.1675900857725; 
 Wed, 08 Feb 2023 16:00:57 -0800 (PST)
Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218])
 by smtp.gmail.com with ESMTPSA id
 l9-20020a62be09000000b00581f76c1da1sm11785766pff.191.2023.02.08.16.00.57
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 08 Feb 2023 16:00:57 -0800 (PST)
Date: Wed, 8 Feb 2023 16:00:55 -0800
From: Stephen Hemminger <stephen@networkplumber.org>
To: Ken Cox <kenstir@gmail.com>
Cc: users@dpdk.org
Subject: Re: Porting application from libevent
Message-ID: <20230208160055.57592913@hermes.local>
In-Reply-To: <CAJX1j5H=C5DXTGr0ttOW5bG6VyKc+igE0vfkMLDS+RbXRBKiVw@mail.gmail.com>
References: <CAJX1j5H=C5DXTGr0ttOW5bG6VyKc+igE0vfkMLDS+RbXRBKiVw@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-BeenThere: users@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK usage discussions <users.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/users>,
 <mailto:users-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/users/>
List-Post: <mailto:users@dpdk.org>
List-Help: <mailto:users-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/users>,
 <mailto:users-request@dpdk.org?subject=subscribe>
Errors-To: users-bounces@dpdk.org

On Wed, 8 Feb 2023 14:46:19 -0500
Ken Cox <kenstir@gmail.com> wrote:

> I have several server applications based on libevent (
> https://github.com/libevent/libevent) that use high-resolution timers, UDP,
> and TCP sockets.  Right now they run on SR-IOV instances and I would like
> to port these to DPDK to get access to bonded interfaces.  Any advice?
> 
> I read most of the DPDK Programmer's Guide, and looked at the Event Device
> Library, but it is quite low-level and will entail a substantial amount of
> rework.
> I looked at dpdk-ans (https://github.com/ansyun/dpdk-ans), which provides a
> socket API on top of DPDK, but it seems to be not recently maintained.
> I also looked at seastar (https://github.com/scylladb/seastar), which
> provides an event-driven framework on top of DPDK, but it would require a
> complete rewrite from libevent to futures and C++17.
> 
> Any advice would be very much appreciated!
> 
> --
> -Ken

I have some experience with libevent. It is really mostly a wrapper on
top of file descriptor (epoll) based API. You might be able to do something
with hardware that supports interrupts in DPDK and using rte_epoll().

This would let application wait for packet or other sources.  Still would
need to process packets and may or may not get the data you want; then go
back to sleep only if idle. Kind of like the Linux NAPI model. There is
an example of using this in l3fwd-power example.