From owner-freebsd-hackers@freebsd.org Sun Jan 31 03:24:01 2016 Return-Path: Delivered-To: freebsd-hackers@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 ED1A0A73E91 for ; Sun, 31 Jan 2016 03:24:00 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ob0-x22c.google.com (mail-ob0-x22c.google.com [IPv6:2607:f8b0:4003:c01::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B5235E03; Sun, 31 Jan 2016 03:24:00 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-ob0-x22c.google.com with SMTP id is5so93670102obc.0; Sat, 30 Jan 2016 19:24:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=mBZ9an5UwqLqhsouPCwDrfAK3MS5jxRMFyxC7DyyDj0=; b=lC0K+lT5K8Qr0Z3QCuIuFjX3mc/yDCQ9h8zUri1mRw9I1ROfGR3DBvI4UbEoIKD6xK tRYBkkz9XII3gtSdWvlvM53Kfn/hlnaA+f8G4hv7xU0WrQQWi8dxrtqyNSjRXai4F4Ph 4Mn7eHNNYMgghGsndzXiUjBRPHF2YJ0mANH1vh6a+n2fB3Xc2VWXb4LFIwOpsaZ4l3Nt r7jYZRW1R3f002jHJrz2m+7WMKrN9kHYz6Gi7d0dZVw3VT040X0JXDjaEbYwT1y1bERS 5lEYTzmlH+lz4LTMRskwjHvuOBVCc73j+xOs2MjZrfiEZ7EXrirBKnakYgY19oncjo+H dU4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=mBZ9an5UwqLqhsouPCwDrfAK3MS5jxRMFyxC7DyyDj0=; b=XLghTHkBEN7CeQ6kl4VpSM9PP034oP+ApQRcdaEHwzgCDxm5E4pfGt+dqBNyBz+v2r x/E2L6HGCPKIOZ5w4nPOTUOj0cc0QpxYh/QcRXr8yZ2dt4d/ok0kbbGfWeqrI3nY0s8z 0ORmibEsV84EGbSRNyv06IogW4eLP9uwIEDZqzLqsQh4T8f9skBIcarivfctxw6bNESU 9jSKgJYubdyVDQkg5UT5DQOcG02mrSi40Mhk4yFR5mBlC7skBKePZ7KDGzacBl8vszao EEXvzTOee1yhKH3scnwebbjAt9twY4r3H4WfgvJ5H6EGGGetIAhIddAQ8N+ROAktVRXd Legg== X-Gm-Message-State: AG10YORpv5kfl2s9G1/DO7XaEjPL+WvcNWa2IZXLO0qLENDMHbOc5wRhXs1fzrCQ2nS7yPd7nhWHG/AIS+cfJg== MIME-Version: 1.0 X-Received: by 10.182.79.103 with SMTP id i7mr12568782obx.41.1454210639982; Sat, 30 Jan 2016 19:23:59 -0800 (PST) Sender: asomers@gmail.com Received: by 10.202.210.79 with HTTP; Sat, 30 Jan 2016 19:23:59 -0800 (PST) In-Reply-To: References: Date: Sat, 30 Jan 2016 20:23:59 -0700 X-Google-Sender-Auth: Zfv-ux1HY_X4z8tTT7B7Obo2s8o Message-ID: Subject: Re: aesni doesn't play nice with krb5 From: Alan Somers To: cem@freebsd.org Cc: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jan 2016 03:24:01 -0000 Fast work! I should be able to test it by Tuesday. By inspection, the code looks good. -Alan On Sat, Jan 30, 2016 at 4:01 PM, Conrad Meyer wrote: > I have an untested patch to fix this issue: > https://reviews.freebsd.org/D5146 . If you have time, please review > or test the patch. > > Thanks, > Conrad > > On Wed, Jan 27, 2016 at 3:55 PM, Alan Somers wrote: >> I'm experimenting with Kerberized NFS, but my performance sucks when I >> use krb5p. I tracked the problem down to an interaction between aesni >> and krb5: aes_set_key in kcrypto_aes.c registers for a crypto session >> and requests support for two algorithms: CRYPTO_SHA1_HMAC and >> CRYPTO_AES_CBC. aesni(4) supports the latter, but not the former. So >> crypto_select_driver returns cryptosoft and krb5 uses software for >> both algorithms. >> >> It's too bad that aesni doesn't support SHA1, but other software like >> OpenSSL deals with it by using hardware for AES and software for SHA1. >> It seems to me like krb5 could be made to do the same by registering >> for two sessions, one for each algorithm. In fact, it seems like it >> would be pretty easy to do. The changes would probably be confined >> strictly to crypto_aes.c. Is there any reason why this wouldn't work? >> >> -Alan