From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::234; helo=mail-wm0-x234.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2E4F521F3B3FF for ; Sat, 28 Oct 2017 14:22:14 -0700 (PDT) Received: by mail-wm0-x234.google.com with SMTP id p75so8988086wmg.3 for ; Sat, 28 Oct 2017 14:26:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=H6C5sWgHE7faYgkbZxzTYPS+N7S/MZk7i5M/3sEcj6E=; b=LnU0QzqgsROl2yAY7Njmg7K6rA/sj9L0kLVXUp66280tEN7xD8osChyjG3LGU2jkoi sijkqpexOU7TuxYjuogXpV8OP9hoC451M6YJBDVDFLBWc+4rszuUVec6x5qmaayQ9n1Y oZxW037Ay0jC7Fse9IW3Jpts5GX5NXvwjAsH0= 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:in-reply-to:user-agent; bh=H6C5sWgHE7faYgkbZxzTYPS+N7S/MZk7i5M/3sEcj6E=; b=fcINaLZ7GgyP3Rfwk72Y8eVRInGT29xx/MPR8DnI7s1wR3yMdp/UCj7whmIcrc3rhF gMVDM+nRD0xF5UQ/cppsvIfZUo1lr3Rs5zq2TdVWjZEaam7ZaRZpDDPiq7Ojm9BX6Skn HWX4BT/GWgYyIAq1D8GkjJPjwjF448Ovgr0/FLY7Xy/VgwzsoENOnBgHJHHJhf7OAPxS CgbhS4ypEONy/kA9tXizmmddYT4srJlfNAl+P0E9ImBPh0iJdjJkBtdLnTyQc8ZSMgC9 IInb9r5y7MdF0woqpJuriA3tO7IIB/uarphHgpGSjyLsgFoiNYHNVOkO5vcB+iwnLgaO 9kaw== X-Gm-Message-State: AMCzsaXj3XuQbfBbwlGQdCJ04Px6vL7AaH29dZqX37fhPwijZ/OuCmUz 8gETNIuRsoZ9/W1F9dY5mcYapA== X-Google-Smtp-Source: ABhQp+TZMbJqnA3OoQ7ntbmytAAwxNJeAY6EZ6olKy7kpTjo/2pX4rDsMbnIAC2oax8yWaC1ILfKxQ== X-Received: by 10.28.214.134 with SMTP id n128mr220536wmg.59.1509225961637; Sat, 28 Oct 2017 14:26:01 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id j125sm593340wmf.24.2017.10.28.14.25.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 28 Oct 2017 14:25:59 -0700 (PDT) Date: Sat, 28 Oct 2017 22:25:57 +0100 From: Leif Lindholm To: Ard Biesheuvel Cc: "edk2-devel@lists.01.org" , =?utf-8?B?UGlwYXQv44Oh44K/44Ov44OL44OD44OI44Od44OzIOODlOODkeODg+ODiA==?= , Masahisa Kojima , Masami Hiramatsu Message-ID: <20171028212557.ot2srhoerybpyce2@bivouac.eciton.net> References: <20170908182315.9591-1-ard.biesheuvel@linaro.org> <20170908182315.9591-9-ard.biesheuvel@linaro.org> <20170911161201.y3lhr3rq5vz433nz@bivouac.eciton.net> MIME-Version: 1.0 In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [PATCH edk2-platforms 08/14] Silicon/Socionext: add driver for NETSEC network controller X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Oct 2017 21:22:15 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Oct 28, 2017 at 02:06:42PM +0100, Ard Biesheuvel wrote: > On 11 September 2017 at 17:12, Leif Lindholm wrote: > > On Fri, Sep 08, 2017 at 07:23:09PM +0100, Ard Biesheuvel wrote: > >> This adds the NetSecDxe driver provided by Socionext, but reworked > >> extensively to improve compliance with the SimpleNetworkProtocol API, > >> and to avoid uncached allocations for streaming DMA. > >> > >> Contributed-under: TianoCore Contribution Agreement 1.1 > >> Signed-off-by: Ard Biesheuvel > >> --- > >> Silicon/Socionext/Synquacer/Drivers/Net/NetsecDxe/NetsecDxe.c | 1000 ++++++++++++++ > >> Silicon/Socionext/Synquacer/Drivers/Net/NetsecDxe/NetsecDxe.dec | 47 + > >> Silicon/Socionext/Synquacer/Drivers/Net/NetsecDxe/NetsecDxe.h | 88 ++ > >> Silicon/Socionext/Synquacer/Drivers/Net/NetsecDxe/NetsecDxe.inf | 69 + > >> Silicon/Socionext/Synquacer/Drivers/Net/NetsecDxe/netsec_for_uefi/netsec_sdk/include/ogma_api.h | 736 ++++++++++ > >> Silicon/Socionext/Synquacer/Drivers/Net/NetsecDxe/netsec_for_uefi/netsec_sdk/include/ogma_basic_type.h | 45 + > >> Silicon/Socionext/Synquacer/Drivers/Net/NetsecDxe/netsec_for_uefi/netsec_sdk/include/ogma_version.h | 24 + > >> Silicon/Socionext/Synquacer/Drivers/Net/NetsecDxe/netsec_for_uefi/netsec_sdk/src/ogma_basic_access.c | 88 ++ > >> Silicon/Socionext/Synquacer/Drivers/Net/NetsecDxe/netsec_for_uefi/netsec_sdk/src/ogma_basic_access.h | 52 + > >> Silicon/Socionext/Synquacer/Drivers/Net/NetsecDxe/netsec_for_uefi/netsec_sdk/src/ogma_desc_ring_access.c | 1391 +++++++++++++++++++ > >> Silicon/Socionext/Synquacer/Drivers/Net/NetsecDxe/netsec_for_uefi/netsec_sdk/src/ogma_desc_ring_access_internal.h | 111 ++ > >> Silicon/Socionext/Synquacer/Drivers/Net/NetsecDxe/netsec_for_uefi/netsec_sdk/src/ogma_gmac_access.c | 1454 ++++++++++++++++++++ > >> Silicon/Socionext/Synquacer/Drivers/Net/NetsecDxe/netsec_for_uefi/netsec_sdk/src/ogma_internal.h | 210 +++ > >> Silicon/Socionext/Synquacer/Drivers/Net/NetsecDxe/netsec_for_uefi/netsec_sdk/src/ogma_misc.c | 1385 +++++++++++++++++++ > >> Silicon/Socionext/Synquacer/Drivers/Net/NetsecDxe/netsec_for_uefi/netsec_sdk/src/ogma_misc_internal.h | 38 + > >> Silicon/Socionext/Synquacer/Drivers/Net/NetsecDxe/netsec_for_uefi/netsec_sdk/src/ogma_reg.h | 219 +++ > >> Silicon/Socionext/Synquacer/Drivers/Net/NetsecDxe/netsec_for_uefi/netsec_sdk/src/ogma_reg_f_gmac_4mt.h | 222 +++ > >> Silicon/Socionext/Synquacer/Drivers/Net/NetsecDxe/netsec_for_uefi/netsec_sdk/src/ogma_reg_netsec.h | 368 +++++ > >> Silicon/Socionext/Synquacer/Drivers/Net/NetsecDxe/netsec_for_uefi/ogma_config.h | 25 + > >> Silicon/Socionext/Synquacer/Drivers/Net/NetsecDxe/netsec_for_uefi/pfdep.h | 265 ++++ > >> Silicon/Socionext/Synquacer/Drivers/Net/NetsecDxe/netsec_for_uefi/pfdep_uefi.c | 176 +++ > >> 21 files changed, 8013 insertions(+) > >> > >> diff --git a/Silicon/Socionext/Synquacer/Drivers/Net/NetsecDxe/NetsecDxe.c b/Silicon/Socionext/Synquacer/Drivers/Net/NetsecDxe/NetsecDxe.c > >> new file mode 100644 > >> index 000000000000..7c3f12362f14 > >> --- /dev/null > >> +++ b/Silicon/Socionext/Synquacer/Drivers/Net/NetsecDxe/NetsecDxe.c > >> @@ -0,0 +1,1000 @@ > >> +/** @file > >> + > >> + Copyright (c) 2016 Socionext Inc. All rights reserved.
> >> + Copyright (c) 2017, Linaro, Ltd. All rights reserved.
> >> + > >> + This program and the accompanying materials > >> + are licensed and made available under the terms and conditions of the BSD License > >> + which accompanies this distribution. The full text of the license may be found at > >> + http://opensource.org/licenses/bsd-license.php > >> + > >> + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, > >> + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. > >> + > >> +**/ > >> + > >> +#include > >> +#include > >> +#include > >> +#include > >> +#include > >> +#include > > > > Sorted alphabetically, please? > > > >> + > >> +#include "NetsecDxe.h" > >> +#include "netsec_for_uefi/pfdep.h" > > > > Hmm, could that be folded into NetsecDxe.h? > > > > Yes, but I would have to modify all the 'platform independent' source > files, and not having to modify them is kind of the point. > ... I was actually referring to just the #include statement. But part of the reason I suggested that was that I was hoping to reduce the amount on non-conforming style. Further reading though the rest of the file showed this to be a drop in the ocean really. > >> + > >> + ogma_disable_desc_ring_irq (LanDriver->Handle, OGMA_DESC_RING_ID_NRM_TX, > >> + OGMA_CH_IRQ_REG_EMPTY); > >> + > >> + // ##### configure_mac > > > > In general, it feels like each of these comment headers indicate a > > good place to break a block out into a helper function. > > > > Meh. This function is not complex at all, it just does a bunch of > steps in sequence. Don't see the point really. > ... It's more a question of overviewability without familiarity with the underlying implementation. But it's a preference rather than anything stronger. > Apologies for snipping the context - my edit window became intolerably > slow due to the size of the email. I /think/ I incorporated all other > feedback you gave to this patch. Yes, I think so. / Leif