Received: by 10.223.185.116 with SMTP id b49csp1837399wrg; Thu, 15 Feb 2018 02:22:35 -0800 (PST) X-Google-Smtp-Source: AH8x224C/vDck1mdcCyXAxOmtd9Vemksew0MIFAEAstHswNO+cAvlee3uSCXESXggMn2OUqj8G52 X-Received: by 2002:a17:902:68cb:: with SMTP id x11-v6mr2084164plm.198.1518690155538; Thu, 15 Feb 2018 02:22:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518690155; cv=none; d=google.com; s=arc-20160816; b=I1jU2Gy0UB7iqMuRIa9KMIyGv102XizKqEZjo8dNw6oRwzqKjAojx7HvL8a45FxPYK LBCluFQFfzXIlNjGW0nC9PnSFl8/PDJyyFabVuSrTcpN8aOJfP+vdNqI1sThbk0A09lN UC5FtvuNFiDVt7v+i0hFgfS+ahc0sPd4ywFwP22yCPUPwZeI9CAkXu8AEwu5JAglgcOw ypQPbFdbkEUpaBcKlTxuUXAxERETc0zHxgiS6BNUpskOYKI9pWzLlYVqM4sEffMFl0ZI Q8xwB/3dKp7LhmYzd4i7EPXBjQs06cWgLDrxMTqb0bOF+gH0l4floUE+Z1G7EFaEzAc7 lqBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=CKQoK4T3dK+TRddhJ+WI11R66QlJhGB+ksaOeVPas58=; b=PMxVt7zXYbkeepwEE70WjI/CRQit0aI9bX4sGXCcBJPk14HIRF29FwFRFyXOsUB+NB hUAY0AAyxVJD3hJJsDmeonqaOYa7yty23207LNk3OxV7B4CoIdOdI7mdgz2fjakjBsuP +sdz2vx58FixrDdJObLUPfkN0i/fbKYLttYjuzq+i4DEXFQ86msHi0O9v5W8bEnX2AAP pauNEFPxZJd+nluccR5pGH81I2xIAdgBokgPgOz058tpulPuKT7GJMfiZUPqd0ORSFC7 t4XRv7HFcA0+qMgBOz7g2ofo7srQRFKzGKOvAB0k0Hp6DcTxmraH+9ElZ5TCdmkh3ObM eFlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=2C5/7SE9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x65si3171686pfa.74.2018.02.15.02.22.21; Thu, 15 Feb 2018 02:22:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=2C5/7SE9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755467AbeBOKVF (ORCPT + 99 others); Thu, 15 Feb 2018 05:21:05 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:37356 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755324AbeBOKVD (ORCPT ); Thu, 15 Feb 2018 05:21:03 -0500 Received: by mail-lf0-f67.google.com with SMTP id f137so33293677lfe.4 for ; Thu, 15 Feb 2018 02:21:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=CKQoK4T3dK+TRddhJ+WI11R66QlJhGB+ksaOeVPas58=; b=2C5/7SE9OtPy9jf/RWiv3uAxYuY7e+Hl/v2pAD4Uf7gFRzoKHjly+OJUHYIjbrxJTH sTJQVTh62YMfZoDDvxL8E2tJtWZm7FgQcruf4YDgGKWZgNXELfkQTeFYZSg25aQj+7Uc fMIO0xRR04qaDQOW24x5C8hdfw5SMtC9HWM5gqs3CC/dZ+NqI7if2AwNH3htBVGM+3pF d71hRE5ia1y+Hq74likBLkTjAUiEre6SZPgpy8uDLN9HqQexbS8Ae68RLrAx9NAaNo9B MIMU2lA/y1/xbODcmGk53Hmp2OfnvMQheAWXrIQmkPPvTBt+8O/6ew/e4Y66DC+S/wYc J4Tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=CKQoK4T3dK+TRddhJ+WI11R66QlJhGB+ksaOeVPas58=; b=pWbNBvgU3htopvbmmUb+xIUgkI3Us3ZAWGmUlLx5N5ZOKVTg9P6en7CZd8P0SMYCgB zOqB3UnOfNa+ijpZ59B6RKMcIik/Md9jIFfupivQIyJcqGT59v5IdguuW02lcbuDS5XS mfZHM+T3xvcqMt+KprDlSxvZ/BPnaPpNrtoPx8q5Ppj6rJNFqAd88KMYBTTi2/40dq36 W8a3bKVg58W2hS3nn6kOsiY/mmsJvyVIbkjp4j3jzZHKEmjA/7aJK4ggOxn76Jdsg1TU MqqL/xz9oFEJBFn1IrC7EmJd+wGvkQLL4AQVFVhGatzivZzFIkMICR6cCKpMOfk7dtDX O85g== X-Gm-Message-State: APf1xPC7C4TK2HhGgB3ULuEhGm9pag1KkbHuDKyQPjnJgkHh5PVH8SvN sDDYRTttl0uqbWaNgfzUDZW5CQ== X-Received: by 10.25.159.195 with SMTP id i186mr1470445lfe.95.1518690062624; Thu, 15 Feb 2018 02:21:02 -0800 (PST) Received: from [192.168.0.10] (x1-6-a4-08-f5-18-3c-3a.cpe.webspeed.dk. [188.176.29.198]) by smtp.googlemail.com with ESMTPSA id f199sm1509977lfg.44.2018.02.15.02.21.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Feb 2018 02:21:01 -0800 (PST) Subject: Re: [PATCH 3/8] lightnvm: add support for 2.0 address format To: =?UTF-8?Q?Javier_Gonz=c3=a1lez?= Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, =?UTF-8?Q?Javier_Gonz=c3=a1lez?= References: <1518530768-20956-1-git-send-email-javier@cnexlabs.com> <1518530768-20956-4-git-send-email-javier@cnexlabs.com> From: =?UTF-8?Q?Matias_Bj=c3=b8rling?= Message-ID: <45cb1863-9f23-fffd-82ee-4ce37e6625d7@lightnvm.io> Date: Thu, 15 Feb 2018 11:21:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <1518530768-20956-4-git-send-email-javier@cnexlabs.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/13/2018 03:06 PM, Javier González wrote: > Add support for 2.0 address format. Also, align address bits for 1.2 and 2.0 to > align. > > Signed-off-by: Javier González > --- > include/linux/lightnvm.h | 45 ++++++++++++++++++++++++++++++++------------- > 1 file changed, 32 insertions(+), 13 deletions(-) > > diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h > index 6a567bd19b73..e035ae4c9acc 100644 > --- a/include/linux/lightnvm.h > +++ b/include/linux/lightnvm.h > @@ -16,12 +16,21 @@ enum { > NVM_IOTYPE_GC = 1, > }; > > -#define NVM_BLK_BITS (16) > -#define NVM_PG_BITS (16) > -#define NVM_SEC_BITS (8) > -#define NVM_PL_BITS (8) > -#define NVM_LUN_BITS (8) > -#define NVM_CH_BITS (7) > +/* 1.2 format */ > +#define NVM_12_CH_BITS (8) > +#define NVM_12_LUN_BITS (8) > +#define NVM_12_BLK_BITS (16) > +#define NVM_12_PG_BITS (16) > +#define NVM_12_PL_BITS (4) > +#define NVM_12_SEC_BITS (4) > +#define NVM_12_RESERVED (8) > + > +/* 2.0 format */ > +#define NVM_20_CH_BITS (8) > +#define NVM_20_LUN_BITS (8) > +#define NVM_20_CHK_BITS (16) > +#define NVM_20_SEC_BITS (24) > +#define NVM_20_RESERVED (8) > > enum { > NVM_OCSSD_SPEC_12 = 12, > @@ -31,16 +40,26 @@ enum { > struct ppa_addr { > /* Generic structure for all addresses */ > union { > + /* 1.2 device format */ > struct { > - u64 blk : NVM_BLK_BITS; > - u64 pg : NVM_PG_BITS; > - u64 sec : NVM_SEC_BITS; > - u64 pl : NVM_PL_BITS; > - u64 lun : NVM_LUN_BITS; > - u64 ch : NVM_CH_BITS; > - u64 reserved : 1; > + u64 ch : NVM_12_CH_BITS; > + u64 lun : NVM_12_LUN_BITS; > + u64 blk : NVM_12_BLK_BITS; > + u64 pg : NVM_12_PG_BITS; > + u64 pl : NVM_12_PL_BITS; > + u64 sec : NVM_12_SEC_BITS; > + u64 reserved : NVM_12_RESERVED; > } g; > > + /* 2.0 device format */ > + struct { > + u64 ch : NVM_20_CH_BITS; > + u64 lun : NVM_20_LUN_BITS; > + u64 chk : NVM_20_CHK_BITS; > + u64 sec : NVM_20_SEC_BITS; > + u64 reserved : NVM_20_RESERVED; > + } m; > + > struct { > u64 line : 63; > u64 is_cached : 1; > You can fold this into the next patch.