Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757315AbcC2PHT (ORCPT ); Tue, 29 Mar 2016 11:07:19 -0400 Received: from mga11.intel.com ([192.55.52.93]:53367 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752701AbcC2PHR convert rfc822-to-8bit (ORCPT ); Tue, 29 Mar 2016 11:07:17 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,411,1455004800"; d="scan'208";a="921064628" From: "Rosen, Rami" To: Netanel Belgazal , "zorik@annapurnalabs.com" , "saeed@annapurnalabs.com" , "alex@annapurnalabs.com" , "msw@amazon.com" , "aliguori@amazon.com" , "davem@davemloft.net" CC: "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" , "antoine.tenart@free-electrons.com" , "Rosen, Rami" Subject: RE: [PATCH] net: ena: Add a driver for Amazon Elastic Network Adapters (ENA) Thread-Topic: [PATCH] net: ena: Add a driver for Amazon Elastic Network Adapters (ENA) Thread-Index: AQHRfqihd9ybpk0wwUWnPgaFIRWW/59wmQgQ Date: Tue, 29 Mar 2016 15:06:28 +0000 Message-ID: <9B0331B6EBBD0E4684FBFAEDA55776F92CBE25FC@HASMSX110.ger.corp.intel.com> References: <1458039006-19956-1-git-send-email-netanel@annapurnalabs.com> In-Reply-To: <1458039006-19956-1-git-send-email-netanel@annapurnalabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYjRjNzhkMGQtYmIxYS00NTMyLWEyZTgtNGNiMzExNjA2NWQyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlQ4TW85STJWVlUreFozQ0M3Ym8rOHRBWHlVSitGVTFXYk5jT2pGXC93UXQ0PSJ9 x-ctpclassification: CTP_IC x-originating-ip: [10.184.70.10] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2128 Lines: 97 Hi, Netanel, +into 5 levels and assignes interrupt delay value to each level. Should be: assigns +The ENA device AQ and AENQ are allocated on probe and freed ontermination. Should be: on termination. + /* commit previously loaded firmare */ Should be: firmware +static int ena_com_hash_key_destroy(struct ena_com_dev *ena_dev) +{ + struct ena_rss *rss = &ena_dev->rss; + + if (rss->hash_key) + dma_free_coherent(ena_dev->dmadev, + sizeof(*rss->hash_key), + rss->hash_key, + rss->hash_key_dma_addr); + rss->hash_key = NULL; + return 0; +} This method always returns 0. +static int ena_com_hash_ctrl_init(struct ena_com_dev *ena_dev) +{ + struct ena_rss *rss = &ena_dev->rss; + + rss->hash_ctrl = dma_alloc_coherent(ena_dev->dmadev, + sizeof(*rss->hash_ctrl), + &rss->hash_ctrl_dma_addr, + GFP_KERNEL | __GFP_ZERO); + + return 0; +} + This method also always returns 0. +static int ena_com_hash_ctrl_destroy(struct ena_com_dev *ena_dev) +{ + struct ena_rss *rss = &ena_dev->rss; + + if (rss->hash_ctrl) + dma_free_coherent(ena_dev->dmadev, + sizeof(*rss->hash_ctrl), + rss->hash_ctrl, + rss->hash_ctrl_dma_addr); + rss->hash_ctrl = NULL; + + return 0; +} + This method also always returns 0. +static int ena_com_indirect_table_destroy(struct ena_com_dev *ena_dev) +{ + struct ena_rss *rss = &ena_dev->rss; + size_t tbl_size = (1 << rss->tbl_log_size) * + sizeof(struct ena_admin_rss_ind_table_entry); + + if (rss->rss_ind_tbl) + dma_free_coherent(ena_dev->dmadev, + tbl_size, + rss->rss_ind_tbl, + rss->rss_ind_tbl_dma_addr); + rss->rss_ind_tbl = NULL; + + if (rss->host_rss_ind_tbl) + devm_kfree(ena_dev->dmadev, rss->host_rss_ind_tbl); + rss->host_rss_ind_tbl = NULL; + + return 0; +} This method also always returns 0. +int ena_com_rss_destroy(struct ena_com_dev *ena_dev) +{ + ena_com_indirect_table_destroy(ena_dev); + ena_com_hash_key_destroy(ena_dev); + ena_com_hash_ctrl_destroy(ena_dev); + + memset(&ena_dev->rss, 0x0, sizeof(ena_dev->rss)); + + return 0; +} This method also always returns 0. Regards, Rami Rosen Intel Corporation