Thread (59 messages) 59 messages, 5 authors, 2021-08-18

RE: [PATCH net-next v2 1/8] ravb: Add struct ravb_hw_info to driver data

From: Biju Das <biju.das.jz@bp.renesas.com>
Date: 2021-08-03 06:36:52
Also in: linux-renesas-soc

Hi Sergei,
Subject: RE: [PATCH net-next v2 1/8] ravb: Add struct ravb_hw_info to
driver data

Hi Sergei,

Thanks for the feedback.
quoted
Subject: Re: [PATCH net-next v2 1/8] ravb: Add struct ravb_hw_info to
driver data

On 8/2/21 1:26 PM, Biju Das wrote:
quoted
The DMAC and EMAC blocks of Gigabit Ethernet IP found on RZ/G2L SoC
are similar to the R-Car Ethernet AVB IP. With a few changes in the
driver we can support both IPs.

Currently a runtime decision based on the chip type is used to
distinguish the HW differences between the SoC families.

The number of TX descriptors for R-Car Gen3 is 1 whereas on R-Car
Gen2 and RZ/G2L it is 2. For cases like this it is better to select
the number of TX descriptors by using a structure with a value,
rather than a runtime decision based on the chip type.

This patch adds the num_tx_desc variable to struct ravb_hw_info and
also replaces the driver data chip type with struct ravb_hw_info by
moving chip type to it.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
v2:
 * Incorporated Andrew and Sergei's review comments for making it
smaller patch
quoted
   and provided detailed description.
---
 drivers/net/ethernet/renesas/ravb.h      |  7 +++++
 drivers/net/ethernet/renesas/ravb_main.c | 38
+++++++++++++++---------
 2 files changed, 31 insertions(+), 14 deletions(-)
diff --git a/drivers/net/ethernet/renesas/ravb.h
b/drivers/net/ethernet/renesas/ravb.h
index 80e62ca2e3d3..cfb972c05b34 100644
--- a/drivers/net/ethernet/renesas/ravb.h
+++ b/drivers/net/ethernet/renesas/ravb.h
@@ -988,6 +988,11 @@ enum ravb_chip_id {
 	RCAR_GEN3,
 };

+struct ravb_hw_info {
+	enum ravb_chip_id chip_id;
+	int num_tx_desc;
   I think this is rather the driver's choice, than the h/w feature...
Perhaps a rename would help with that? :-)
It is consistent with current naming convention used by the driver.
NUM_TX_DESC macro is replaced by num_tx_desc.
      
So the name should be ok. 

Indeed we are agreed to add function pointers to struct ravb_hw_info to avoid another level of indirection.

If the concern is related to duplication of data(ie,priv->num_tx_desc vs info->num_tx_desc)
I have a plan to remove priv->num_tx_desc with info->num_tx_desc  later.

Regards,
Biju



Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help