From owner-freebsd-net@freebsd.org Tue May 11 14:27:50 2021 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DA902639B23 for ; Tue, 11 May 2021 14:27:50 +0000 (UTC) (envelope-from jim@netgate.com) Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FfgHn2nxJz4RB7 for ; Tue, 11 May 2021 14:27:49 +0000 (UTC) (envelope-from jim@netgate.com) Received: by mail-io1-xd31.google.com with SMTP id i7so10857948ioa.12 for ; Tue, 11 May 2021 07:27:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=3Q3UmIlbpclrBQ0G+sH7Z3OiEEtMKYcQuZeplQwymQQ=; b=k5zxbcOSeVEMvZMHq+99pqRQBZgQXhDsjOCUiUKGhIMHNNLftDAe7DwaqLoig1w2/T vgmV9MpPddCDeG7FnnzZHmYFYuiuhozVAsRzh6jwxf+l6TFyMWJyodJrul3geNDQ7sng aDeT41rerweoxT0mw5MbZ0i5sGnTUpijKg5aYM7icYYF41OX5mEJjiksKtdUom3Nrvl7 aNBi9PkziJgnRca0Oalhb0axzU5wRHx1AR0yOcPZ121g32fbbjdOsn+LuBGLlx9PxgA0 ZFIM8xyNMDJPf1Ej7uuvubJ3GQkc/621WxoKAUJe4KC0OvBKrW6LK/+z+PzOc8A56w9D wkSA== X-Gm-Message-State: AOAM53295eJfi6OhFxtuzobSqtTBtyQPMlFmbQE46YsYTyFG0sl/6M91 zWgR0MuPjmmxwV/p/9Q91ddQ3w== X-Google-Smtp-Source: ABdhPJwjIe6sEfT8Q6Nc8Oi2gkNsIpEAgEn/FPrXHUYYqBKeT+IrlZf1zmc05VosIvYxlIMbwl3Q/w== X-Received: by 2002:a05:6638:2585:: with SMTP id s5mr3132687jat.55.1620743268057; Tue, 11 May 2021 07:27:48 -0700 (PDT) Received: from ?IPv6:2601:280:5b80:b910:101d:c6f:6771:e101? ([2601:280:5b80:b910:101d:c6f:6771:e101]) by smtp.gmail.com with ESMTPSA id d16sm212250ilo.12.2021.05.11.07.27.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 May 2021 07:27:47 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Subject: Re: Vector Packet Processing (VPP) portability on FreeBSD From: Jim Thompson In-Reply-To: Date: Tue, 11 May 2021 08:27:46 -0600 Cc: Konstantin Belousov , "freebsd-net@freebsd.org" , Mark Johnston Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Francois ten Krooden X-Mailer: Apple Mail (2.3654.60.0.2.21) X-Rspamd-Queue-Id: 4FfgHn2nxJz4RB7 X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.49 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[netgate.com:+]; DMARC_POLICY_ALLOW(-0.50)[netgate.com,quarantine]; NEURAL_HAM_SHORT(-0.99)[-0.987]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::d31:from]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[netgate.com:s=google]; FREEFALL_USER(0.00)[jim]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-net@freebsd.org]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::d31:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::d31:from]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-net] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 May 2021 14:27:51 -0000 > On May 11, 2021, at 7:04 AM, Mark Johnston wrote: >=20 > On Tue, May 11, 2021 at 12:43:10PM +0000, Francois ten Krooden wrote: >> On Monday, 10 May 2021 16:10 Konstantin Belousov wrote: >>=20 >>=20 >>> On Mon, May 10, 2021 at 11:08:18AM +0000, Francois ten Krooden = wrote: >>>> 3. What are suitable alternatives for reading information from = procfs and >>> sysfs on FreeBSD? >>> Understand what information is obtained, then what for is it = actually used, >>> then match it against equivalent FreeBSD approach, then gather the >>> required information. >>=20 >> Thank you. This was basically what we suspected. >> One of the ones we are unsure about is what the equivalent of = /proc/self/pagemap on Linux would be. >> The one idea we had is using procstat_getvmmap from libprocstat, but = haven't finished investigating yet. >=20 > I believe DPDK's libeal uses /proc/pagemap to look up the physical > address of large page mappings. Assuming you want to do the same = thing, > there is the MEM_EXTRACT_PADDR /dev/mem ioctl. It was added > specifically for DPDK. See the mem(4) man page for details on its > usage. Upthread mentioned Netgate (we do pfSense) as being possibly involved in = a port of VPP to FreeBSD. We do have some interest, and I had once = handed this to a contractor, but not much progress was made, and we had our hands full with pfSense and = our VPP-based product (tnsr). VPP has been discussed on freebsd-net = before. You and your team have made it much farther. I=E2=80=99d spoken to the VPP =E2=80=98core team=E2=80=99 about the = sustainability of a port of VPP to FreeBSD, and they didn=E2=80=99t say = =E2=80=99No=E2=80=99. The lead VPP person at Cisco used to be a FreeBSD = src committer, and he basically said, =E2=80=9CPatches welcome=E2=80=9D. = Someone will probably want to bring CSIT along to help prevent = regressions on FreeBSD, but that team also seemed open when I checked. IMO, netmap seems a better approach on FreeBSD, as you=E2=80=99ll = eventually want something like the =E2=80=98router plugin=E2=80=99 to be = able to communicate between the kernel and VPP, obtain FIBs, etc. =20 We=E2=80=99ve been strong proponents of (and a main contributor to) the = =E2=80=98linux-cp=E2=80=9D plugin, (a better version of the router = plugin, partially upstreamed to VPP), but it=E2=80=99s based on netlink, = and is has more linux-isms than the main body of VPP. Netmap has a very = nice architecture for building something similar, where packets can be = directly sent to and received from the host rings by VPP, and these host = rings are associated with an interface ring. Netmap-fwd uses this to = good effect. Netmap is slightly slower in maximum PPS than DPDK, but for your use = case (IPsec), you won't see a difference (assuming some things when I = say this.) Jim=