From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5DB80EE57DB for ; Wed, 11 Sep 2024 21:52:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=atvq8gkU6NvVoNfip7YpdVtjmePPs3eS+0+JBGapmdM=; b=XtDJN2OIoF8UeaO34OSUX3N50F 20fNskm4kSKJbWGsOAVolBj1J5bL0SMKtdPwUqh5tr88xsFASDA1uRKdZc2fAWA0QGCx2IXThpCV3 YRPc4pJm8cB7PJ4OZ5NOoDLEaag73CnQh9KZ4LWWL0+EAqaCjBLX67YyHSW4ZDm+ua6lWIRIHQvX+ T6HMF9e5609FhOKay6N8CSVw+P2hr9eekGJ3ml3jAPExkWMJGKvR6gGEdnuQnCvxuEOQLxJhXxpHA R/uX6MXQe4rmRAhEkX2DTYPwILZWLyz1iuLhoLks23adzrTWprIPM9spq6wlcV2yQY5STd31gHkmq uF1hRA3Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1soVG1-0000000B71M-1jZD; Wed, 11 Sep 2024 21:52:13 +0000 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1soVEy-0000000B6sQ-1p5m for linux-arm-kernel@lists.infradead.org; Wed, 11 Sep 2024 21:51:09 +0000 Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-7db233cef22so67962a12.0 for ; Wed, 11 Sep 2024 14:51:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1726091466; x=1726696266; darn=lists.infradead.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=atvq8gkU6NvVoNfip7YpdVtjmePPs3eS+0+JBGapmdM=; b=PGc82N5i39PmGK8mAAAg3KZzCPk6R1wxPwyZtZH90/UYvN0XD2pGP0EuSYlJSagDGQ 0lJyujXBXmlwKCMxvDCiwglSzrTLgo+FeeuzgOdlCoXCGdYnSJ3mTxjHG6kYH1IblHV5 c//wjYZIFEHpK3PPoz9Bf983efr9DbyhrqRA0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726091466; x=1726696266; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=atvq8gkU6NvVoNfip7YpdVtjmePPs3eS+0+JBGapmdM=; b=jS1I2gEoDtkUqDi2Y1jeo3n0T26m5hhNrLdMdoyr9j/Kvc0WfKAaLy5mVPHEHTe7UJ Yu7hMe7waVeX4jmjGH6sC6ApfmdZLpDy6xZk0EYHGmd09cEwN4RsnMWnUNRyTCu5QF8S tACQYj/zxvNgyKEMKXXXrNzpIN/75dUYIXQqxRj/P7LMHdzh5ysBIqC6y4+mYnfUouWE 1aDw1DNx1BoPC0vuGBifbE0GJgmSTuciZq/603YChb6QzZdBU+mfrRLLVQ2s+k/wsJDa 2rJJ4ibqj7OCrIZb3wl+JEkhxNEYq5NoEnZTUHZsFVZna9uwj9sEX/a6zgHC14oToP4t l9tA== X-Forwarded-Encrypted: i=1; AJvYcCV4/GsKLOUn2Groy5MWjyqfYZco0DeCQewDc/5XxyDlDHzuo8GjFZ+NA2pLGmqWaVKWH9kRH2Wtp24G+t7+OaBH@lists.infradead.org X-Gm-Message-State: AOJu0YzJl3Rj1/3tlxXn58WLW/AXD+yywVghFU9kzsaoPH0oh/buq3J7 OYjE0CRsyQYoL3kA9xlwQ5QEwz5uiEM3V6Vg6Cq8dD9Ii8SRbL1TjujeGlOOGEqlC75ilkqIfkF XRaVTPMUpSdskGYNi0Xhq6M2tNXr3lc1G4I+U X-Google-Smtp-Source: AGHT+IE6AjM9iNIUGGgkdelqISzU9y7VqVsFfHhd7hH+mTrRkBRlRHZFngZR/fbxEJoN18HlE/eBuMsCOSEppeavnRs= X-Received: by 2002:a05:6a00:1990:b0:717:8d52:643 with SMTP id d2e1a72fcca58-7192607f5b4mr1219152b3a.11.1726091466137; Wed, 11 Sep 2024 14:51:06 -0700 (PDT) MIME-Version: 1.0 References: <20240904054815.1341712-1-jitendra.vegiraju@broadcom.com> <20240904054815.1341712-2-jitendra.vegiraju@broadcom.com> <7foqi3vdgc3kvyw5rrnqsqsakgfgcrhw5sihnqwza4okdnh5dd@pdsdjn32ya6u> In-Reply-To: <7foqi3vdgc3kvyw5rrnqsqsakgfgcrhw5sihnqwza4okdnh5dd@pdsdjn32ya6u> From: Jitendra Vegiraju Date: Wed, 11 Sep 2024 14:50:54 -0700 Message-ID: Subject: Re: [PATCH net-next v5 1/5] net: stmmac: Add HDMA mapping for dw25gmac support To: Serge Semin Cc: netdev@vger.kernel.org, alexandre.torgue@foss.st.com, joabreu@synopsys.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, mcoquelin.stm32@gmail.com, bcm-kernel-feedback-list@broadcom.com, richardcochran@gmail.com, ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com, rmk+kernel@armlinux.org.uk, ahalaney@redhat.com, xiaolei.wang@windriver.com, rohan.g.thomas@intel.com, Jianheng.Zhang@synopsys.com, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, bpf@vger.kernel.org, andrew@lunn.ch, linux@armlinux.org.uk, horms@kernel.org, florian.fainelli@broadcom.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240911_145108_499029_F798F690 X-CRM114-Status: GOOD ( 31.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Serge, Thank you for taking the time to review the patches. On Tue, Sep 10, 2024 at 11:37=E2=80=AFAM Serge Semin wrote: > > Hi Jitendra > > On Tue, Sep 03, 2024 at 10:48:11PM -0700, jitendra.vegiraju@broadcom.com = wrote: > > From: Jitendra Vegiraju > > > > Add hdma configuration support in include/linux/stmmac.h file. > > The hdma configuration includes mapping of virtual DMAs to physical DMA= s. > > Define a new data structure stmmac_hdma_cfg to provide the mapping. > > > > Introduce new plat_stmmacenet_data::snps_id,snps_dev_id to allow glue > > drivers to specify synopsys ID and device id respectively. > > These values take precedence over reading from HW register. This facili= ty > > provides a mechanism to use setup function from stmmac core module and = yet > > override MAC.VERSION CSR if the glue driver chooses to do so. > > > > Signed-off-by: Jitendra Vegiraju > > --- > > include/linux/stmmac.h | 48 ++++++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 48 insertions(+) > > > > diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h > > index 338991c08f00..eb8136680a7b 100644 > > --- a/include/linux/stmmac.h > > +++ b/include/linux/stmmac.h > > @@ -89,6 +89,51 @@ struct stmmac_mdio_bus_data { > > bool needs_reset; > > }; > > > > +/* DW25GMAC Hyper-DMA Overview > > + * Hyper-DMA allows support for large number of Virtual DMA(VDMA) > > + * channels using a smaller set of physical DMA channels(PDMA). > > + * This is supported by the mapping of VDMAs to Traffic Class(TC) > > + * and PDMA to TC in each traffic direction as shown below. > > + * > > + * VDMAs Traffic Class PDMA > > + * +--------+ +------+ +-----------+ > > + * |VDMA0 |--------->| TC0 |-------->|PDMA0/TXQ0 | > > + *TX +--------+ |----->+------+ +-----------+ > > + *Host=3D> +--------+ | +------+ +-----------+ =3D> MAC > > + *SW |VDMA1 |---+ | TC1 | +--->|PDMA1/TXQ1 | > > + * +--------+ +------+ | +-----------+ > > + * +--------+ +------+----+ +-----------+ > > + * |VDMA2 |--------->| TC2 |-------->|PDMA2/TXQ1 | > > + * +--------+ +------+ +-----------+ > > + * . . . > > + * +--------+ +------+ +-----------+ > > + * |VDMAn-1 |--------->| TCx-1|-------->|PDMAm/TXQm | > > + * +--------+ +------+ +-----------+ > > + * > > + * +------+ +------+ +------+ > > + * |PDMA0 |--------->| TC0 |-------->|VDMA0 | > > + * +------+ |----->+------+ +------+ > > + *MAC =3D> +------+ | +------+ +------+ > > + *RXQs |PDMA1 |---+ | TC1 | +--->|VDMA1 | =3D> Host > > + * +------+ +------+ | +------+ > > + * . . . > > + */ > > + > > > +/* Hyper-DMA mapping configuration > > + * Traffic Class associated with each VDMA/PDMA mapping > > + * is stored in corresponding array entry. > > + */ > > +struct stmmac_hdma_cfg { > > + u32 tx_vdmas; /* TX VDMA count */ > > + u32 rx_vdmas; /* RX VDMA count */ > > + u32 tx_pdmas; /* TX PDMA count */ > > + u32 rx_pdmas; /* RX PDMA count */ > > + u8 *tvdma_tc; /* Tx VDMA to TC mapping array */ > > + u8 *rvdma_tc; /* Rx VDMA to TC mapping array */ > > + u8 *tpdma_tc; /* Tx PDMA to TC mapping array */ > > + u8 *rpdma_tc; /* Rx PDMA to TC mapping array */ > > +}; > > + > > struct stmmac_dma_cfg { > > int pbl; > > int txpbl; > > @@ -101,6 +146,7 @@ struct stmmac_dma_cfg { > > bool multi_msi_en; > > bool dche; > > bool atds; > > + struct stmmac_hdma_cfg *hdma_cfg; > > Based on what you are implementing the _static_ VDMA-TC-PDMA channels > mapping I really don't see a value of adding all of these data here. > The whole implementation gets to be needlessly overcomplicated. > Moreover AFAICS there are some channels left misconfigured in the > Patch 2 code. Please see my comments there for more details. > I agree, with _static_ VDMA-TC-PDMA channels, maintaining the mapping data appears complicated. The real need comes when adding virtualization (SRIOV) capabilities. I am analyzing your comments in patch2 and will respond after re-evaluation= . > > }; > > > > #define AXI_BLEN 7 > > @@ -303,5 +349,7 @@ struct plat_stmmacenet_data { > > int msi_tx_base_vec; > > const struct dwmac4_addrs *dwmac4_addrs; > > unsigned int flags; > > > + u32 snps_id; > > + u32 snps_dev_id; > > Please move these fields to the head of the structure as the kind of > crucial ones, and convert snps_dev_id to just dev_id. > > snps_id field name was selected based on the VERSION.SNPSVER field > name (see SNPS prefix). Following that logic the VERSION.DEVID field > should be converted to the dev_id name. > Thanks for explaining the thinking behind the field naming. That makes sens= e. I was thinking of it as a prefix for synopsys fields. Will make the change. > -Serge(y) > > > }; > > #endif > > -- > > 2.34.1 > >