Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755852AbcLSQC4 (ORCPT ); Mon, 19 Dec 2016 11:02:56 -0500 Received: from mail-sn1nam02on0054.outbound.protection.outlook.com ([104.47.36.54]:49760 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755058AbcLSQCy (ORCPT ); Mon, 19 Dec 2016 11:02:54 -0500 X-Greylist: delayed 10856 seconds by postgrey-1.27 at vger.kernel.org; Mon, 19 Dec 2016 11:02:53 EST Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jan.Glauber@cavium.com; Date: Mon, 19 Dec 2016 13:29:23 +0100 From: Jan Glauber To: Corentin Labbe CC: Herbert Xu , , , "David S . Miller" , Mahipal Challa , Vishnu Nair Subject: Re: [RFC PATCH 1/3] crypto: zip - Add ThunderX ZIP driver core Message-ID: <20161219122923.GA18379@hardcore> References: <20161212150439.18627-1-jglauber@cavium.com> <20161212150439.18627-2-jglauber@cavium.com> <20161213133900.GA10647@Red> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20161213133900.GA10647@Red> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [88.67.141.122] X-ClientProxiedBy: HE1PR02CA0054.eurprd02.prod.outlook.com (10.163.170.22) To CY1PR07MB2587.namprd07.prod.outlook.com (10.167.16.137) X-MS-Office365-Filtering-Correlation-Id: bfe68288-b212-43ff-70f0-08d4280ab2cf X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR07MB2587; X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2587;3:vf3JeNcnGyxsK3VY+mPoAZHckIQ5oZaO12yZb6fDm9N1AugML2isRGPpKFeCQsleqKzTa1ktlToTZu3yzP3NQTpJfasyG8mYeXniyPq+QjgQa+Sx5kz2AVqZFEXB5+i2dl3xqdwS5fd8h6lB0qqCJ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eJpNtYTvvIBMmEJteHoxYUWWeptEx0APrWC9bReDv1OFEfWb0v13wybHGFrZZwVZD5FFmjwYZgF+O839tLjTe55TjzfZi1gl/nBvENlK29ZFQbtXn9lFOBM4EA7w0WJWWI7KJmomQUPcbcq1vHj7wrxPChL1HTDEGxu/txIqdbEFQHT8z+9MRGiVr1RC/5DG1oinUkUPQ==;20:ucj7rvIkuBJjeKrnK1D+oKidEVZ4mo6ZEAl8AHEv5K7ymMbmChpFFjtNthwIleLgHvSfZnRNgaDBWWVS1llilhDhbY4WxknSYzehr5aueZjVjRHq0bfBhHnDZTLYPbFbi7+97HGxwbCj5BhqquCkfG3mhPdPoXRXEEmIGbXbLa3Zpjh3N8eNXiwANIZV8VhVfYMmIq8yqQefw/We1Akbs4ml0NT54xSSfX2H/EGqyptiFfEjB0ZHSw7ZyDe0H1DijYIU33cMhxz+Pi34VIuSPq5ghTdR19812rONNdCIfC7kln7GZqHHA3zJSSgENUtXQqNqnu05F/hao/Vso0tDJlF7KoNWM/4aPlG03v8jpBWOyGnnLoMhlFk/s2DQflGDpd9kHhOegg8tm3WKfBm6SF597lixYsmt5t69A5rtvzXwU6qOf8x3zisAJ9GDE9hodRCoG2wtU/Tgb8PWYOw5vqQ0JdFL4SjCBGCdWdZClr7bpgkMIbDGRFX4wq4oTRH1c6oEKrmhIzlkrKqe+TIXBrsRqUJnHDt2i3dzLQUNVntl6UP/AASyGTSJl3Xm10qqAYvTecbhYATWbJGE96vHGI3gWce+DbIJ/fclqVb/UIw= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(6072148);SRVR:CY1PR07MB2587;BCL:0;PCL:0;RULEID:;SRVR:CY1PR07MB2587; X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2587;4:SC7bdjcgk07c520lEZge8vVMDSvsNZWbkrQ+Fu/N1vEclabJNOUsF7V8ilce3iK73zjPYehivN8m/+mHYPykfo3F2YJ1rjykY799vIuCd7f7lgX5vJoFGlDUXDdmJxQ4MpCbIBAZ5H0yHqwBDmKjiAu4sF/vCMyPecuWNzMeIWZzk0G0x559JS+e2aQFiD2rnNEhUHevvc3A0KMnop0MPhT8i41hr1JI4aX5yun0zbkhLgAe/50TANj+eNAqc7n5wxlL4hS0vZKdZ75XU2BOekTxqlpLQ4CqxJIaTYT29ERfhUJC5m8WZZIkDXWp18ADDadeFRyWrNh/sre8dfOs44bUK0mGY23cYUc7Z+Lhj6gmV0dg1+7V9tkcNf/DzQyQ6jKT7oO2VVK0VIBzpzurocvx9wDEvA+laaSGI1qC8cA7NfKf6datb2AKKHmsEhlFuCzD1k4IC89njXoOQ8Yhoi1gzOOX5qxqSQHUZ7yMGB3L/BHppVy7QZ7b2yx5APo5smrFewn85UuiAbOHvqQ7ULzFLDWVEjLKeUigc587W2Tef5gyZYdFay/YVO1oNP2pGOW5mY7EFQ0FCfIDofCKeQ== X-Forefront-PRVS: 01613DFDC8 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(199003)(24454002)(189002)(25786008)(5660300001)(83506001)(66066001)(6116002)(1076002)(47776003)(107886002)(8676002)(50466002)(6666003)(229853002)(6496003)(33716001)(4326007)(305945005)(110136003)(2950100002)(39060400001)(81166006)(81156014)(2906002)(6916009)(42882006)(38730400001)(9686002)(92566002)(23726003)(189998001)(97756001)(4001350100001)(106356001)(105586002)(7736002)(42186005)(33656002)(97736004)(68736007)(54356999)(46406003)(76176999)(50986999)(3846002)(101416001)(4001430100002)(18370500001)(21314002)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR07MB2587;H:hardcore;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR07M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t/Vx5xruCqtUSylpsPPAuawW66VeKlYgMophXNIhql89VDzZln50lcKI0ORGC4UusNOIKbdT1Y+Mauq3RmrJpwLmnI+xXCDW8ARw==;24:GADuhKDe5pO479eqBQGJQiyP+gXx2X/pEGnIAPAP6pF+zIWTLmVGG4OWt0sU57SgcVPfRVXuRDUpBt5ao4yrp89y3GQklA2JX7ldBm8gBE8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2587;7:hKOOXUuFVpmXV5YmNMp0Dcxo9kDpzWB0JR0AyirBtKBNhXFyVANjnqa/1zowque6f2qjE+RMxlSNduBJ/9AT6Nyns3JeUXXM24s+NXck+l9/Qlc3p3ZLJxaO838dqUnmhUR1htY1d+hZbIVL2Rs8FfvGdSsnp6N9nk9PpqoDcRD8Yx5MKwhumQTrAN0Ix4lyY/iVXw/EhQWNtGqX6MyXpzPqcmlmXyVUKyQZxdXVlu4JAZP6+8lzfODkKzAea7/Ltvubz2WL+B3rLyOUl115Zq2nIMZVSlo8KfLkfEl7mt+elPlPNiiA+FXWGqnQRFGPSWEG7cNdD7mmmzFCJb+kZd0760hYLw4TwI5tWrWC5/jZtrObZTqAdjFxYoFgDSY6eL6HKEXq4MGtLXyncVF2mlibKKZJpk/HKvVM88ijiYb/ZYVXdpn2UXZNK8toP0lY229znyD7Il7mkJGJqgLWOw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2016 12:29:35.9841 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2587 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 7498 Lines: 293 Hi Corentin, thanks for your review! Your comments all look reasonable to me, Mahipal will address them. Since I posted this series at the beginning of the merge window I'd like to wait for some more time before we post an updated version. --Jan On Tue, Dec 13, 2016 at 02:39:00PM +0100, Corentin Labbe wrote: > Hello > > I have some comment below > > On Mon, Dec 12, 2016 at 04:04:37PM +0100, Jan Glauber wrote: > > From: Mahipal Challa > > > [...] > > --- a/drivers/crypto/Makefile > > +++ b/drivers/crypto/Makefile > > @@ -27,6 +27,7 @@ obj-$(CONFIG_CRYPTO_DEV_MXC_SCC) += mxc-scc.o > > obj-$(CONFIG_CRYPTO_DEV_TALITOS) += talitos.o > > obj-$(CONFIG_CRYPTO_DEV_UX500) += ux500/ > > obj-$(CONFIG_CRYPTO_DEV_QAT) += qat/ > > +obj-$(CONFIG_CRYPTO_DEV_CAVIUM_ZIP) += cavium/ > > obj-$(CONFIG_CRYPTO_DEV_QCE) += qce/ > > obj-$(CONFIG_CRYPTO_DEV_VMX) += vmx/ > > obj-$(CONFIG_CRYPTO_DEV_SUN4I_SS) += sunxi-ss/ > > Try to keep some alphabetical order > > [...] > > +/* ZIP invocation result completion status codes */ > > +#define ZIP_NOTDONE 0x0 > > + > > +/* Successful completion. */ > > +#define ZIP_SUCCESS 0x1 > > + > > +/* Output truncated */ > > +#define ZIP_DTRUNC 0x2 > > + > > +/* Dynamic Stop */ > > +#define ZIP_DYNAMIC_STOP 0x3 > > + > > +/* Uncompress ran out of input data when IWORD0[EF] was set */ > > +#define ZIP_ITRUNC 0x4 > > + > > +/* Uncompress found the reserved block type 3 */ > > +#define ZIP_RBLOCK 0x5 > > + > > +/* Uncompress found LEN != ZIP_NLEN in an uncompressed block in the input */ > > +#define ZIP_NLEN 0x6 > > + > > +/* Uncompress found a bad code in the main Huffman codes. */ > > +#define ZIP_BADCODE 0x7 > > + > > +/* Uncompress found a bad code in the 19 Huffman codes encoding lengths. */ > > +#define ZIP_BADCODE2 0x8 > > + > > +/* Compress found a zero-length input. */ > > +#define ZIP_ZERO_LEN 0x9 > > + > > +/* The compress or decompress encountered an internal parity error. */ > > +#define ZIP_PARITY 0xA > > Perhaps all errors could begin with ZIP_ERR_xxx ? > > [...] > > +static inline u64 zip_depth(void) > > +{ > > + struct zip_device *zip_dev = zip_get_device(zip_get_node_id()); > > + > > + if (!zip_dev) > > + return -ENODEV; > > + > > + return zip_dev->depth; > > +} > > This function is not used. > > > + > > +static inline u64 zip_onfsize(void) > > +{ > > + struct zip_device *zip_dev = zip_get_device(zip_get_node_id()); > > + > > + if (!zip_dev) > > + return -ENODEV; > > + > > + return zip_dev->onfsize; > > +} > > Same for this > > > + > > +static inline u64 zip_ctxsize(void) > > +{ > > + struct zip_device *zip_dev = zip_get_device(zip_get_node_id()); > > + > > + if (!zip_dev) > > + return -ENODEV; > > + > > + return zip_dev->ctxsize; > > +} > > Again > > [...] > > + > > +/* > > + * Allocates new ZIP device structure > > + * Returns zip_device pointer or NULL if cannot allocate memory for zip_device > > + */ > > +static struct zip_device *zip_alloc_device(struct pci_dev *pdev) > > pdev is not used, so you can remove it from arglist. > Or keep it and use devm_kzalloc for allocating zip > > > +{ > > + struct zip_device *zip = NULL; > > + int idx = 0; > > + > > + for (idx = 0; idx < MAX_ZIP_DEVICES; idx++) { > > + if (!zip_dev[idx]) > > + break; > > + } > > + > > + zip = kzalloc(sizeof(*zip), GFP_KERNEL); > > + > > + if (!zip) > > + return NULL; > > + > > + zip_dev[idx] = zip; > > + zip->index = idx; > > + return zip; > > +} > > [...] > > +static int zip_probe(struct pci_dev *pdev, const struct pci_device_id *ent) > > +{ > > + struct device *dev = &pdev->dev; > > + struct zip_device *zip = NULL; > > + int err; > > + > > + zip_dbg_enter(); > > + > > + zip = zip_alloc_device(pdev); > > + > > + if (!zip) > > + return -ENOMEM; > > + > > + pr_info("Found ZIP device %d %x:%x on Node %d\n", zip->index, > > + pdev->vendor, pdev->device, dev_to_node(dev)); > > You use lots of pr_info, why not using more dev_info/dev_err ? > > > + > > + zip->pdev = pdev; > > + > > + pci_set_drvdata(pdev, zip); > > + > > + err = pci_enable_device(pdev); > > + if (err) { > > + zip_err("Failed to enable PCI device"); > > + goto err_free_device; > > + } > > + > > + err = pci_request_regions(pdev, DRV_NAME); > > + if (err) { > > + zip_err("PCI request regions failed 0x%x", err); > > + goto err_disable_device; > > + } > > + > > + err = pci_set_dma_mask(pdev, DMA_BIT_MASK(48)); > > + if (err) { > > + dev_err(dev, "Unable to get usable DMA configuration\n"); > > + goto err_release_regions; > > + } > > + > > + err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(48)); > > + if (err) { > > + dev_err(dev, "Unable to get 48-bit DMA for allocations\n"); > > + goto err_release_regions; > > + } > > + > > + /* MAP configuration registers */ > > + zip->reg_base = pci_ioremap_bar(pdev, PCI_CFG_ZIP_PF_BAR0); > > + if (!zip->reg_base) { > > + zip_err("ZIP: Cannot map BAR0 CSR memory space, aborting"); > > + err = -ENOMEM; > > + goto err_release_regions; > > + } > > + > > + /* Initialize ZIP Hardware */ > > + err = zip_init_hw(zip); > > + if (err) > > + goto err_release_regions; > > + > > + return 0; > > + > > +err_release_regions: > > + if (zip->reg_base) > > + iounmap(zip->reg_base); > > + pci_release_regions(pdev); > > + > > +err_disable_device: > > + pci_disable_device(pdev); > > + > > +err_free_device: > > + pci_set_drvdata(pdev, NULL); > > + > > + /* remove zip_dev from zip_device list, free the zip_device memory */ > > + zip_dev[zip->index] = NULL; > > + kfree(zip); > > + > > + zip_dbg_exit(); > > + return err; > > +} > > [...] > > +static int __init zip_init_module(void) > > +{ > > + int ret; > > + > > + memset(&zip_dev, 0, sizeof(zip_dev)); > > A static variable is already zeroed > > > + > > + zip_msg("%s\n", DRV_NAME); > > + > > + ret = pci_register_driver(&zip_driver); > > + if (ret < 0) { > > + zip_err("ZIP: pci_register_driver() returned %d\n", ret); > > + return ret; > > + } > > + > > + /* Register with the Kernel Crypto Interface */ > > + ret = zip_register_compression_device(); > > + if (ret < 0) { > > + zip_err("ZIP: Kernel Crypto Registration failed\n"); > > + return 1; > > 1 is not a good error code. And you quit without unregistering. > > > + } > > + > > + return ret; > > +} > > + > > +static void __exit zip_cleanup_module(void) > > +{ > > + /* Unregister this driver for pci zip devices */ > > + pci_unregister_driver(&zip_driver); > > + > > + /* Unregister from the kernel crypto interface */ > > + zip_unregister_compression_device(); > > I think you must do the opposite. (unregister crypto first) > > > + > > + pr_info("ThunderX-ZIP driver is removed successfully\n"); > > +} > > + > > +module_init(zip_init_module); > > +module_exit(zip_cleanup_module); > > Why not using module_pci_driver ? > > [...] > > +/** > > + * enum zip_comp_e - ZIP Completion Enumeration, enumerates the values of > > + * ZIP_ZRES_S[COMPCODE]. > > + */ > > +enum zip_comp_e { > > + ZIP_COMP_E_BADCODE = 0x7, > > + ZIP_COMP_E_BADCODE2 = 0x8, > > + ZIP_COMP_E_DTRUNC = 0x2, > > + ZIP_COMP_E_FATAL = 0xb, > > + ZIP_COMP_E_ITRUNC = 0x4, > > + ZIP_COMP_E_NLEN = 0x6, > > + ZIP_COMP_E_NOTDONE = 0x0, > > + ZIP_COMP_E_PARITY = 0xa, > > + ZIP_COMP_E_RBLOCK = 0x5, > > + ZIP_COMP_E_STOP = 0x3, > > + ZIP_COMP_E_SUCCESS = 0x1, > > + ZIP_COMP_E_ZERO_LEN = 0x9, > > + ZIP_COMP_E_ENUM_LAST = 0xc, > > Why not using already declared define ? ZIP_COMP_E_BADCODE = ZIP_BADCODE > > Regards > Corentin Labbe