lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <OS0PR01MB5922A841D2C8E38D93A8E95086FE9@OS0PR01MB5922.jpnprd01.prod.outlook.com>
Date:   Tue, 17 Aug 2021 11:24:53 +0000
From:   Biju Das <biju.das.jz@...renesas.com>
To:     Biju Das <biju.das.jz@...renesas.com>,
        Geert Uytterhoeven <geert@...ux-m68k.org>,
        Sergey Shtylyov <s.shtylyov@...russia.ru>
CC:     "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Sergei Shtylyov <sergei.shtylyov@...il.com>,
        Adam Ford <aford173@...il.com>, Andrew Lunn <andrew@...n.ch>,
        Yuusuke Ashizuka <ashiduka@...itsu.com>,
        Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
        netdev <netdev@...r.kernel.org>,
        Linux-Renesas <linux-renesas-soc@...r.kernel.org>,
        Chris Paterson <Chris.Paterson2@...esas.com>,
        Biju Das <biju.das@...renesas.com>,
        Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@...renesas.com>
Subject: RE: [PATCH net-next v2 1/8] ravb: Add struct ravb_hw_info to driver
 data

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@...renesas.com>
> > wrote:
> > > > -----Original Message-----
> > > > On Mon, Aug 2, 2021 at 12:27 PM Biju Das
> > > > <biju.das.jz@...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@...renesas.com>
> > > > > Reviewed-by: Lad Prabhakar
> > > > > <prabhakar.mahadev-lad.rj@...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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ