[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aLf0eJcvCj9zcn-g@igalia.com>
Date: Wed, 3 Sep 2025 08:55:36 +0100
From: Luis Henriques <luis@...lia.com>
To: Viacheslav Dubeyko <Slava.Dubeyko@....com>
Cc: "409411716@....tku.edu.tw" <409411716@....tku.edu.tw>,
"visitorckw@...il.com" <visitorckw@...il.com>,
Xiubo Li <xiubli@...hat.com>,
"idryomov@...il.com" <idryomov@...il.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"ceph-devel@...r.kernel.org" <ceph-devel@...r.kernel.org>
Subject: Re: [PATCH] ceph: optimize ceph_base64_encode() with block processing
On Tue, Sep 02, 2025 at 09:21:14PM +0000, Viacheslav Dubeyko wrote:
> On Wed, 2025-09-03 at 05:05 +0800, Kuan-Wei Chiu wrote:
> > On Tue, Sep 02, 2025 at 07:37:22PM +0000, Viacheslav Dubeyko wrote:
> > > On Sat, 2025-08-30 at 21:28 +0800, Guan-Chun Wu wrote:
> > > > Previously, ceph_base64_encode() used a bitstream approach, handling one
> > > > input byte at a time and performing extra bit operations. While correct,
> > > > this method was suboptimal.
> > > >
> > >
> > > Sounds interesting!
> > >
> > > Is ceph_base64_decode() efficient then?
> > > Do we have something in crypto library of Linux kernel? Maybe we can use
> > > something efficient enough from there?
> > >
> > Hi Viacheslav,
> >
> > FYI, we already have base64 encode/decode implementations in
> > lib/base64.c. As discussed in another thread [1], I think we can put
> > the optimized version there and have users switch to call the library
> > functions.
> >
> > [1]: https://lore.kernel.org/lkml/38753d95-8503-4b72-9590-cb129aa49a41@t-8ch.de/
> >
> >
>
> Sounds great! Generalized version of this algorithm is much better than
> supporting some implementation in Ceph code.
Please note that ceph can not use the default base64 implementation because
it uses the '_' character in the encoding, as explained in commit
64e86f632bf1 ("ceph: add base64 endcoding routines for encrypted names")
That's why it implements it's own version according to an IMAP RFC, which
uses '+' and ',' instead of '-' and '_'.
Cheers,
--
Luis
Powered by blists - more mailing lists