From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A37D149DE3 for ; Wed, 11 Sep 2024 21:51:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726091468; cv=none; b=PJR0SrXe+h0Ro6MqZCvoKewnh8cCwf/sUsDScZo/ADSR/Ads6wlzgLWhoDU/tEHNwZmL8SeJMAD+J8qgT0bgikyzdwjKN42v10ZcFJUGg8HSpPn0Ahe2jurbbJ+GJegd7O5rAPSR0OfUN40NPjUoGPMp44W8P+/NynyCEZU46wA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726091468; c=relaxed/simple; bh=XEPyG20mV4IFb+tVvh7hoBtM2/Pck7y+SXesyK7wyWw=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=PRajCphoBKkpBxytSu10Yk7MasWekR1xJLSAXZkAr5IoewpsXNMGP6Out2t3vaaMZ2/ZXsybfGYL/6vVM/dgKeEZQZ7gmARgckZ3VE+4mi51eM6t/9RulWH/QOK0BXrhh83qsa07AsUDM9QwQzVr9DXjXdM82BBgxl0DO4TIE78= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=PHZTcNMJ; arc=none smtp.client-ip=209.85.210.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="PHZTcNMJ" Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-719232ade93so230998b3a.2 for ; Wed, 11 Sep 2024 14:51:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1726091466; x=1726696266; darn=vger.kernel.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=PHZTcNMJdvAEUqPqp06VAlu19uwSfVpVP5LduE5tWU59sb0saEhEs+534sH/xA7fdm U8MOxIv0nYRavQcSNrvdwXde4+GQ+W1FC7Dl/Zabh6U0RDwoisyMOakOy33bGNP/kXzY R+jL9Alf/aHGgND+PIvPqc3/tMLNUMRGzpu5Y= 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=ZomJkDCaSD6G3hS84CIAtaKpIyqLpKB3Y1vHTR2XYMxsLrMetQPJ2wDuZPwSbCnU0k b7ihAUpMURgUYFQx42hmX+oJMm2GdeaDo4HqXnTIElJgvzhxZJC66gVz1/NR5c9AWEjj qS7IvQQ0Q37ZqPJ+R3ivhq3d+F6ACa2fT2YE6FGkh355qDVB5FsEGKwfLI/BUi8W4Mp3 2HJ4JdgXhJyuIs7+UiQtNSrNJJZItFtOKIB8ro/0BF/oRXrP7a03+6IbP3Cxpyshr+BF Q/4kwyyZaYtetHsbEwAw0BHkf+lDqgrpnajoC6RZ/9r07dJ2Y38k0oVyPt7BPYpCqG7e 21+Q== X-Forwarded-Encrypted: i=1; AJvYcCWNzbBHK6hpeyABczgH23iwN4q5iS2N/GQWYUV4Xo9rLcTqLoBOBsm6wQQ0LV6VRbDHszuqK5HcG08znAI=@vger.kernel.org X-Gm-Message-State: AOJu0YwwYntBiOE2TXT55jQ7jdKm1Ll0jqgViT+JqaAcECnL3/onrld2 RkuziFG0s45lzPTJ1GfFAgvVIruYnl3NdUlNMCcQ7s87qDVeXEBsEm22X5/FcCzdee5lKe7A7Tq QjVqL47SVmTcKxxAoGcxLGRiLryKFMISW9hHg 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) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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 > >