From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f66.google.com (mail-lf0-f66.google.com [209.85.215.66]) by dpdk.org (Postfix) with ESMTP id 41D541EE0E for ; Wed, 13 Jun 2018 08:11:39 +0200 (CEST) Received: by mail-lf0-f66.google.com with SMTP id v135-v6so2011595lfa.9 for ; Tue, 12 Jun 2018 23:11:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=xQlDtYWyyCg5zi8x96IEk9JfydV4rrAIo0rZBDHlBxA=; b=UKMPUoV/Rlj5x5UBdpEacYA0seU+7aN+zA5ypMbVCDutRt+3XG2PO/dHF0qtUOMkyu XS385ZZoLKNaRRi8KmwlF9KEMf/Y6886OxFFM9NWgcazzkEBnA/0ZMF4ipam+nuVnPrx YI8KcL+UAaZv6xseeEdOv5qHsqcwNIcnZwCLic7scCSBMS0K3agv1OVaOsca+85aKi8/ 9F/ixEuqWkW3ZvrNYeOienC8JJ1ZEJDgG3HdwHKttU067I99XdU10bL5IX7d+QKT9QeM YNsb3GW1UQv3xxfsmjcAPejGA6ftITDMk6RX00yWETh8xsw27ePDrArpbBwdowKI/Eig HCuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=xQlDtYWyyCg5zi8x96IEk9JfydV4rrAIo0rZBDHlBxA=; b=TiBkQ44OBA/NwauMRqxnLbK/F6xAmGzWWaz9YpHirBdd2jgJkE4oWPbWePgnpBjqA7 3NQA5CSc6Ihh+JPXQ13tnnk5hafaT5Gl7DWoOC1DSkQZg8v8yQqy43MMgdpAg+nmztzv y4oKC6yebHq8+YZK7QH2+tDDeCaYw2nm0FLJB8aYfkSlQgAM/JZtgcw+JrMKVMQq0L3E mlPS885kMz7oDVhbWYhtt934LXHU5k6WL16XiVBRwnpZl9VX5kTDdaP2gGHlwHRnUH2z LJNa8k0G7MWgVdv5KBg+YMyyZ4spZ2ErMYIcl7FBMt9TbeaJ2pLqaT3b4D227e3NdoD2 YlOg== X-Gm-Message-State: APt69E0nRpRe2rSVKcfii6wKK45xeuLoHKFnOEOYRdfjXPwLNPgR19PN uj9V6E+q/VUSIQpd5YdEIARYMA== X-Google-Smtp-Source: ADUXVKJiRHEAn+1GtNb7uQ076LUiNXxX4fjeK903keXYMG4juLjMhgcirg5DfOwEcoiC3NoCq+DyiQ== X-Received: by 2002:a2e:4442:: with SMTP id r63-v6mr2222091lja.89.1528870298856; Tue, 12 Jun 2018 23:11:38 -0700 (PDT) Received: from localhost (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id g1-v6sm379299ljj.81.2018.06.12.23.11.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Jun 2018 23:11:37 -0700 (PDT) Date: Wed, 13 Jun 2018 08:11:37 +0200 From: Tomasz Duszynski To: "De Lara Guarch, Pablo" Cc: Tomasz Duszynski , "Doherty, Declan" , "akhil.goyal@nxp.com" , "ravi1.kumar@amd.com" , "jerin.jacob@caviumnetworks.com" , "Zhang, Roy Fan" , "Trahe, Fiona" , "jianjay.zhou@huawei.com" , "dev@dpdk.org" Message-ID: <20180613061137.GB1913@sh> References: <20180608220234.10170-1-pablo.de.lara.guarch@intel.com> <20180608220234.10170-4-pablo.de.lara.guarch@intel.com> <20180612113736.GA1913@sh> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: User-Agent: Mutt/1.5.23.1 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH 3/6] cryptodev: remove max number of sessions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 06:11:39 -0000 On Tue, Jun 12, 2018 at 01:53:36PM +0000, De Lara Guarch, Pablo wrote: > > > > -----Original Message----- > > From: Tomasz Duszynski [mailto:tdu@semihalf.com] > > Sent: Tuesday, June 12, 2018 12:38 PM > > To: De Lara Guarch, Pablo > > Cc: Doherty, Declan ; akhil.goyal@nxp.com; > > ravi1.kumar@amd.com; jerin.jacob@caviumnetworks.com; Zhang, Roy Fan > > ; Trahe, Fiona ; > > tdu@semihalf.com; jianjay.zhou@huawei.com; dev@dpdk.org > > Subject: Re: [PATCH 3/6] cryptodev: remove max number of sessions > > > > Hello Pablo, > > > > On Fri, Jun 08, 2018 at 11:02:31PM +0100, Pablo de Lara wrote: > > > Sessions are not created and stored in the crypto device > > > anymore, since now the session mempool is created > > > at the application level. > > > > > > Therefore the limitation of the maximum number of sessions > > > that can be created should not be dependent of the crypto device. > > > > > > Signed-off-by: Pablo de Lara > > ... > > > > diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd.c > > b/drivers/crypto/mvsam/rte_mrvl_pmd.c > > > index 1b6029a56..822b6cac7 100644 > > > --- a/drivers/crypto/mvsam/rte_mrvl_pmd.c > > > +++ b/drivers/crypto/mvsam/rte_mrvl_pmd.c > > > @@ -719,7 +719,6 @@ cryptodev_mrvl_crypto_create(const char *name, > > > internals =3D dev->data->dev_private; > > > > > > internals->max_nb_qpairs =3D init_params->max_nb_queue_pairs; > > > - internals->max_nb_sessions =3D init_params->max_nb_sessions; > > > > > > /* > > > * ret =3D=3D -EEXIST is correct, it means DMA > > > @@ -734,8 +733,6 @@ cryptodev_mrvl_crypto_create(const char *name, > > > "DMA memory has been already initialized by a > > different driver."); > > > } > > > > > > - sam_params.max_num_sessions =3D internals->max_nb_sessions; > > > > This will not fly since library maintains separate list of sessions. > > We have to initialize this number to something sane. Since we cannot > > get it from userspace perhaps make that compile-time configurable > > by adding separate CONFIG_? > > Hi Tomasz, > > If you need to have an actual limit, you could define it internally > (not adding an external configuration option), but bear in mind that > This won't prevent an application from trying to allocate more sessions. You can define arbitrary number of session on condition you have enough memory. So no hard limit here. What bothers me is the case where app wants to initialize more session than the library internally has. If this happens userspace will get an error. On the other hand requesting some arbitrary large number of session from library and hoping app will never use so many wastes memory (which might be valuable on resource constrained systems). That is why keeping the number of sessions in app and library in sync is important. Do we have any option in DPDK now to workaround this? > > If your PMD has a limitation on the maximum number of sessions, then mayb= e this change > won't work for you (removing the maximum number of sessions), so let me k= now and we can discuss this. > > Thanks, > Pablo > > P.S. Please, next time, strip out the code that you are not commenting, a= s it was hard to find this question :) > -- - Tomasz Duszy=C5=84ski