Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Biju Das <biju.das.jz@bp.renesas.com>
To: Biju Das <biju.das.jz@bp.renesas.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Sergey Shtylyov <s.shtylyov@omprussia.ru>
Cc: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Sergei Shtylyov <sergei.shtylyov@gmail.com>,
	Adam Ford <aford173@gmail.com>, Andrew Lunn <andrew@lunn.ch>,
	Yuusuke Ashizuka <ashiduka@fujitsu.com>,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	netdev <netdev@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	Chris Paterson <Chris.Paterson2@renesas.com>,
	Biju Das <biju.das@bp.renesas.com>,
	Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>
Subject: RE: [PATCH net-next v2 1/8] ravb: Add struct ravb_hw_info to driver data
Date: Tue, 17 Aug 2021 11:24:53 +0000	[thread overview]
Message-ID: <OS0PR01MB5922A841D2C8E38D93A8E95086FE9@OS0PR01MB5922.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <OS0PR01MB5922C336CBB008F9D7DA36B786F99@OS0PR01MB5922.jpnprd01.prod.outlook.com>

Hi all,

> Subject: RE: [PATCH net-next v2 1/8] ravb: Add struct ravb_hw_info to
> driver data
> 
> Hi Geert,
> 
> Thanks for the feedback.
> 
> > Subject: Re: [PATCH net-next v2 1/8] ravb: Add struct ravb_hw_info to
> > driver data
> >
> > Hi Biju,
> >
> > On Thu, Aug 12, 2021 at 9:26 AM Biju Das <biju.das.jz@bp.renesas.com>
> > wrote:
> > > > -----Original Message-----
> > > > On Mon, Aug 2, 2021 at 12:27 PM Biju Das
> > > > <biju.das.jz@bp.renesas.com>
> > > > wrote:
> > > > > 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>
> > > >
> > > > Thanks for your patch!
> > > >
> > > > > --- 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;
> > > >
> > > > Why not "unsigned int"? ...
> > > > This comment applies to a few more subsequent patches.
> > >
> > > To avoid signed and unsigned comparison warnings.
> > >
> > > >
> > > > > +};
> > > > > +
> > > > >  struct ravb_private {
> > > > >         struct net_device *ndev;
> > > > >         struct platform_device *pdev; @@ -1040,6 +1045,8 @@
> > > > > struct ravb_private {
> > > > >         unsigned txcidm:1;              /* TX Clock Internal Delay
> > Mode
> > > > */
> > > > >         unsigned rgmii_override:1;      /* Deprecated rgmii-*id
> > behavior
> > > > */
> > > > >         int num_tx_desc;                /* TX descriptors per
> packet
> > */
> > > >
> > > > ... oh, here's the original culprit.
> > >
> > > Exactly, this the reason.
> > >
> > > Do you want me to change this into unsigned int? Please let me know.
> >
> > Up to you (or the maintainer? ;-)
> >
> > For new fields (in the other patches), I would use unsigned for all
> > unsigned values.  Signed values have more pitfalls related to
> > undefined behavior.
> 
> Sergei, What is your thoughts here? Please let me know.

Here is my plan.

I will split this patch into two as Andrew suggested and 

Then on the second patch will add as info->unaligned_tx as Sergei suggested.

Now the only open point is related to the data type of "int num_tx_desc"
and to align with sh_eth driver I will keep int.

Regards,
Biju

  reply	other threads:[~2021-08-17 11:24 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-02 10:26 [PATCH net-next v2 0/8] Add Gigabit Ethernet driver support Biju Das
2021-08-02 10:26 ` [PATCH net-next v2 1/8] ravb: Add struct ravb_hw_info to driver data Biju Das
2021-08-02 15:02   ` Andrew Lunn
2021-08-02 20:42   ` Sergei Shtylyov
2021-08-03  5:57     ` Biju Das
2021-08-03  6:36       ` Biju Das
2021-08-04 19:27       ` Sergei Shtylyov
2021-08-04 20:27         ` Sergei Shtylyov
2021-08-09 12:06   ` Geert Uytterhoeven
2021-08-12  7:26     ` Biju Das
2021-08-12  7:58       ` Geert Uytterhoeven
2021-08-12  8:13         ` Biju Das
2021-08-17 11:24           ` Biju Das [this message]
2021-08-17 20:11             ` Sergey Shtylyov
2021-08-18  6:29               ` Biju Das
2021-08-18 10:11                 ` Sergey Shtylyov
2021-08-18 10:23                   ` Biju Das
2021-08-02 10:26 ` [PATCH net-next v2 2/8] ravb: Add skb_sz to struct ravb_hw_info Biju Das
2021-08-02 15:08   ` Andrew Lunn
2021-08-02 20:54   ` Sergei Shtylyov
2021-08-03  7:13     ` Biju Das
2021-08-02 10:26 ` [PATCH net-next v2 3/8] ravb: Add num_gstat_queue " Biju Das
2021-08-02 15:09   ` Andrew Lunn
2021-08-03 18:21   ` Sergei Shtylyov
2021-08-03 19:13     ` Biju Das
2021-08-03 19:22       ` Sergei Shtylyov
2021-08-03 19:47         ` Biju Das
2021-08-17 15:08           ` Biju Das
2021-08-02 10:26 ` [PATCH net-next v2 4/8] ravb: Add stats_len " Biju Das
2021-08-03 18:35   ` Sergei Shtylyov
2021-08-03 18:47     ` Biju Das
2021-08-03 19:20       ` Sergei Shtylyov
2021-08-02 10:26 ` [PATCH net-next v2 5/8] ravb: Add gstrings_stats and gstrings_size " Biju Das
2021-08-02 15:11   ` Andrew Lunn
2021-08-04 20:36   ` Sergei Shtylyov
2021-08-02 10:26 ` [PATCH net-next v2 6/8] ravb: Add net_features and net_hw_features " Biju Das
2021-08-02 15:12   ` Andrew Lunn
2021-08-05 19:07   ` Sergei Shtylyov
2021-08-05 19:18     ` Biju Das
2021-08-06 20:20       ` Sergei Shtylyov
2021-08-12  7:35         ` Biju Das
2021-08-06 20:31   ` Sergei Shtylyov
2021-08-02 10:26 ` [PATCH net-next v2 7/8] ravb: Add internal delay hw feature " Biju Das
2021-08-02 15:13   ` Andrew Lunn
2021-08-03 21:06   ` Sergei Shtylyov
2021-08-04  6:19     ` Biju Das
2021-08-03 21:12   ` Sergei Shtylyov
2021-08-04  5:13     ` Biju Das
2021-08-04  9:51       ` Sergey Shtylyov
2021-08-04 10:08         ` Biju Das
2021-08-04 10:34           ` Sergei Shtylyov
2021-08-04 10:20       ` Sergei Shtylyov
2021-08-04 10:32         ` Biju Das
2021-08-02 10:26 ` [PATCH net-next v2 8/8] ravb: Add tx_drop_cntrs " Biju Das
2021-08-02 15:14   ` Andrew Lunn
2021-08-04 20:50   ` Sergei Shtylyov
2021-08-17 15:47     ` Biju Das
2021-08-17 16:30       ` Sergey Shtylyov
2021-08-17 16:33         ` Biju Das

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=OS0PR01MB5922A841D2C8E38D93A8E95086FE9@OS0PR01MB5922.jpnprd01.prod.outlook.com \
    --to=biju.das.jz@bp.renesas.com \
    --cc=Chris.Paterson2@renesas.com \
    --cc=aford173@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=ashiduka@fujitsu.com \
    --cc=biju.das@bp.renesas.com \
    --cc=davem@davemloft.net \
    --cc=geert@linux-m68k.org \
    --cc=kuba@kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=s.shtylyov@omprussia.ru \
    --cc=sergei.shtylyov@gmail.com \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    --subject='RE: [PATCH net-next v2 1/8] ravb: Add struct ravb_hw_info to driver data' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).