Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3169795pxu; Tue, 8 Dec 2020 05:29:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJyLhrYMaoiRiOQrHdMpcoKPTv+pmYiUAYjHzMabtWabsZ1n5pM/+f/1ur1+/daCtRMEJQBP X-Received: by 2002:a50:cd84:: with SMTP id p4mr23989217edi.81.1607434148435; Tue, 08 Dec 2020 05:29:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607434148; cv=none; d=google.com; s=arc-20160816; b=m+ENTNIUAIM3CGGbC4RaX1oRZQKdOPubOHk74VlFy1587lSqfxh/SRJynubqlMAAAv 8RJoOo/9UZEniGpOzZ6J/ya+SP/NhBUxIDL0fj1+zFmNacT5NQesqFby34HjgBg4E84U YV2+4SpxN5w7XqP3gDOr/dh38GKGbo6JOVOrfYvy39WpCaXmZ7QHKLXHgWX2jArfl7nf wggV9Gwq4yZQq7e5R3jQ/7zThcYK6Bu1wp7KV6HkKbj2m7UAbihwVM4WbnMnptDClV16 8Fwy3yMxVKJ3UbPd0WtI6Kr9RyqdRX22ii1hD6dKUAeNra0ZuQksDcze1/Xv0NHcEMLH lVfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-id:mime-version:subject :cc:to:references:in-reply-to:from:organization:dkim-signature; bh=idJ8/WupSy/edQ30Crz8uX2zPv1PKuxsc+ILe2DB9b0=; b=WhfC+lyB3SSYykB9DhObl3e1XTFd9w4bnMPi1qZNiQjJ0ezS3HtLyZGtN/wTRC6Jt1 IJp6wlaH4qIxD9EqQf/hCwozXg3AjUoxl41pQcvL5VuHn0mzsgg4qFW9HgPOvQHheYv3 nvaJqNiUei91JvYqUU/cNnUp0gKGAjbrGQeSS5nf5ATrNrDDFZFO2Tjcl3hA44SEjdIN sxqO4APZITfZhmBH9Nf83jQit0kl766LlDzMsvSjT3m697gqTnvznrk7k80Sp+N3zjtN Nl+wtpOfsU9L6ayWJhBVyOkzWvitY+/jRXxoOnZN4PqixVr9F8S1FS0QDf7ZPDqdN4St WJyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Od9CGOeR; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k8si5737576ejg.191.2020.12.08.05.28.32; Tue, 08 Dec 2020 05:29:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Od9CGOeR; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727258AbgLHN0i (ORCPT + 99 others); Tue, 8 Dec 2020 08:26:38 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:38017 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729123AbgLHN0h (ORCPT ); Tue, 8 Dec 2020 08:26:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607433911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=idJ8/WupSy/edQ30Crz8uX2zPv1PKuxsc+ILe2DB9b0=; b=Od9CGOeRi6UcTDp1u8RMa8blH1ImgrhYMM2weaf7q6Y+myp9mbOCQcm3s6FbD8Q2ZLeT+e fSty+XNJNpzc3+pOsexkpZDBXTE+MY7Ewoo5WlN/YhnfINXlXGCis4JRbY1pnFVOv6KYgB ZoH1P0rcbEWSfbVBld2+URMAFuT45W0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-283-kqSR4vZoPnaCpsCt-8xsaA-1; Tue, 08 Dec 2020 08:25:09 -0500 X-MC-Unique: kqSR4vZoPnaCpsCt-8xsaA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1EEB2107ACF5; Tue, 8 Dec 2020 13:25:07 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-116-67.rdu2.redhat.com [10.10.116.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 938835D6AB; Tue, 8 Dec 2020 13:25:04 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <118876.1607093975@warthog.procyon.org.uk> References: <118876.1607093975@warthog.procyon.org.uk> <2F96670A-58DC-43A6-A20E-696803F0BFBA@oracle.com> <160518586534.2277919.14475638653680231924.stgit@warthog.procyon.org.uk> To: Chuck Lever , Ard Biesheuvel Cc: dhowells@redhat.com, Bruce Fields , CIFS , Linux NFS Mailing List , Herbert Xu , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Trond Myklebust , linux-crypto@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-afs@lists.infradead.org Subject: Re: Why the auxiliary cipher in gss_krb5_crypto.c? MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <955414.1607433903.1@warthog.procyon.org.uk> Date: Tue, 08 Dec 2020 13:25:03 +0000 Message-ID: <955415.1607433903@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org I wonder - would it make sense to reserve two arrays of scatterlist structs and a mutex per CPU sufficient to map up to 1MiB of pages with each array while the krb5 service is in use? That way sunrpc could, say, grab the mutex, map the input and output buffers, do the entire crypto op in one go and then release the mutex - at least for big ops, small ops needn't use this service. For rxrpc/afs's use case this would probably be overkill - it's doing crypto on each packet, not on whole operations - but I could still make use of it there. However, that then limits the maximum size of an op to 1MiB, plus dangly bits on either side (which can be managed with chained scatterlist structs) and also limits the number of large simultaneous krb5 crypto ops we can do. David