From owner-freebsd-arch@freebsd.org  Thu Jan 11 07:46:48 2018
Return-Path: <owner-freebsd-arch@freebsd.org>
Delivered-To: freebsd-arch@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76917E750BA
 for <freebsd-arch@mailman.ysv.freebsd.org>;
 Thu, 11 Jan 2018 07:46:48 +0000 (UTC)
 (envelope-from phk@critter.freebsd.dk)
Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org
 [IPv6:2001:1900:2254:206a::50:5])
 by mx1.freebsd.org (Postfix) with ESMTP id 61E7B83C28
 for <freebsd-arch@freebsd.org>; Thu, 11 Jan 2018 07:46:48 +0000 (UTC)
 (envelope-from phk@critter.freebsd.dk)
Received: by mailman.ysv.freebsd.org (Postfix)
 id 61438E750B9; Thu, 11 Jan 2018 07:46:48 +0000 (UTC)
Delivered-To: arch@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60F50E750B8
 for <arch@mailman.ysv.freebsd.org>; Thu, 11 Jan 2018 07:46:48 +0000 (UTC)
 (envelope-from phk@critter.freebsd.dk)
Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222])
 by mx1.freebsd.org (Postfix) with ESMTP id 271F983C26;
 Thu, 11 Jan 2018 07:46:47 +0000 (UTC)
 (envelope-from phk@critter.freebsd.dk)
Received: from critter.freebsd.dk (unknown [192.168.55.3])
 by phk.freebsd.dk (Postfix) with ESMTP id 5C23927396;
 Thu, 11 Jan 2018 07:46:40 +0000 (UTC)
Received: from critter.freebsd.dk (localhost [127.0.0.1])
 by critter.freebsd.dk (8.15.2/8.15.2) with ESMTPS id w0B7kOoL051885
 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO);
 Thu, 11 Jan 2018 07:46:24 GMT (envelope-from phk@critter.freebsd.dk)
Received: (from phk@localhost)
 by critter.freebsd.dk (8.15.2/8.15.2/Submit) id w0B7kOM1051884;
 Thu, 11 Jan 2018 07:46:24 GMT (envelope-from phk)
To: John Baldwin <jhb@freebsd.org>
cc: arch@freebsd.org
Subject: Re: Ranting about OCF / crypto(9)
In-reply-to: <3790717.UIxaijsHl3@ralph.baldwin.cx>
From: "Poul-Henning Kamp" <phk@phk.freebsd.dk>
References: <3790717.UIxaijsHl3@ralph.baldwin.cx>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <51882.1515656784.1@critter.freebsd.dk>
Date: Thu, 11 Jan 2018 07:46:24 +0000
Message-ID: <51883.1515656784@critter.freebsd.dk>
X-BeenThere: freebsd-arch@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: Discussion related to FreeBSD architecture <freebsd-arch.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-arch>,
 <mailto:freebsd-arch-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-arch/>
List-Post: <mailto:freebsd-arch@freebsd.org>
List-Help: <mailto:freebsd-arch-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-arch>,
 <mailto:freebsd-arch-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 11 Jan 2018 07:46:48 -0000

--------
In message <3790717.UIxaijsHl3@ralph.baldwin.cx>, John Baldwin writes:

>- OCF is over flexible and overly broad.

I would actually argue that it is neithe, quite the contrary.

With the kernel-userland transition becoming more expensive, what
we need is a DSL where you can put entire processing steps into the
kernel, sort of like BPF but more general.

Ideally, you should be able to push something like this into
the kernel and have it executed in a single syscall:

	h = hash:sha256()
	b = file_buffer()
	f = open("/tmp/foo", "r")
	while f.read(b):
		h.input(b)
	return h.hex()

BPF is the existence proof that stuff like this is both
feasible and profitable, now we just need to take it to
the next level.

If we had a language like this, accept-filters whouldn't be
necessary.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.