All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Biju Das <biju.das.jz@bp.renesas.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Sergei Shtylyov <sergei.shtylyov@gmail.com>,
	Sergey Shtylyov <s.shtylyov@omprussia.ru>,
	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 v3 3/9] ravb: Add aligned_tx to struct ravb_hw_info
Date: Mon, 23 Aug 2021 11:14:19 +0200	[thread overview]
Message-ID: <CAMuHMdUEeZjfJgpXpO6qcAyuGp64wxyxiuLjUosVcRfG8=2s6w@mail.gmail.com> (raw)
In-Reply-To: <20210818190800.20191-4-biju.das.jz@bp.renesas.com>

Hi Biju,

On Wed, Aug 18, 2021 at 9:08 PM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> R-Car Gen2 needs a 4byte aligned address for the transmission buffer,
> whereas R-Car Gen3 doesn't have any such restriction.
>
> Add aligned_tx to struct ravb_hw_info to select the driver to choose
> between aligned and unaligned tx buffers.
>
> 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, which is now commit 68ca3c923213b908 ("ravb:
Add aligned_tx to struct ravb_hw_info") in net-next.

> --- a/drivers/net/ethernet/renesas/ravb.h
> +++ b/drivers/net/ethernet/renesas/ravb.h
> @@ -990,6 +990,7 @@ enum ravb_chip_id {
>
>  struct ravb_hw_info {
>         enum ravb_chip_id chip_id;
> +       unsigned aligned_tx: 1;
>  };
>
>  struct ravb_private {
> diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
> index b6554e5e13af..dbccf2cd89b2 100644
> --- a/drivers/net/ethernet/renesas/ravb_main.c
> +++ b/drivers/net/ethernet/renesas/ravb_main.c
> @@ -1930,6 +1930,7 @@ static const struct ravb_hw_info ravb_gen3_hw_info = {
>
>  static const struct ravb_hw_info ravb_gen2_hw_info = {
>         .chip_id = RCAR_GEN2,
> +       .aligned_tx = 1,
>  };
>
>  static const struct of_device_id ravb_match_table[] = {
> @@ -2140,7 +2141,7 @@ static int ravb_probe(struct platform_device *pdev)
>         ndev->max_mtu = 2048 - (ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN);
>         ndev->min_mtu = ETH_MIN_MTU;
>
> -       priv->num_tx_desc = info->chip_id == RCAR_GEN2 ?
> +       priv->num_tx_desc = info->aligned_tx ?
>                 NUM_TX_DESC_GEN2 : NUM_TX_DESC_GEN3;

At first look, this change does not seem to match the patch description.
Upon a deeper look, it is correct, as num_tx_desc is also used to
control alignment.

But now NUM_TX_DESC_GEN[23] no longer match their use.
Perhaps they should be renamed, or replaced by hardcoded values,
with a comment?

    /*
     * FIXME: Explain the relationship between alignment and number of buffers
     */
    priv->num_tx_desc = info->aligned_tx ? 2 : 1;

>
>         /* Set function */

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  parent reply	other threads:[~2021-08-23  9:14 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18 19:07 [PATCH net-next v3 0/9] Add Gigabit Ethernet driver support Biju Das
2021-08-18 19:07 ` [PATCH net-next v3 1/9] ravb: Use unsigned int for num_tx_desc variable in struct ravb_private Biju Das
2021-08-19 15:26   ` Sergey Shtylyov
2021-08-18 19:07 ` [PATCH net-next v3 2/9] ravb: Add struct ravb_hw_info to driver data Biju Das
2021-08-19 16:19   ` Sergey Shtylyov
2021-08-19 17:33     ` Biju Das
2021-08-20 18:15       ` Sergey Shtylyov
2021-08-18 19:07 ` [PATCH net-next v3 3/9] ravb: Add aligned_tx to struct ravb_hw_info Biju Das
2021-08-19 15:41   ` Sergei Shtylyov
2021-08-19 15:43   ` Sergey Shtylyov
2021-08-23  9:14   ` Geert Uytterhoeven [this message]
2021-08-23  9:26     ` Biju Das
2021-08-18 19:07 ` [PATCH net-next v3 4/9] ravb: Add max_rx_len " Biju Das
2021-08-19 16:29   ` Sergey Shtylyov
2021-08-18 19:07 ` [PATCH net-next v3 5/9] ravb: Add stats_len " Biju Das
2021-08-19 16:42   ` Sergey Shtylyov
2021-08-18 19:07 ` [PATCH net-next v3 6/9] ravb: Add gstrings_stats and gstrings_size " Biju Das
2021-08-18 19:07 ` [PATCH net-next v3 7/9] ravb: Add net_features and net_hw_features " Biju Das
2021-08-18 19:07 ` [PATCH net-next v3 8/9] ravb: Add internal delay hw feature " Biju Das
2021-08-18 19:08 ` [PATCH net-next v3 9/9] ravb: Add tx_counters " Biju Das
2021-08-19 16:57   ` Sergey Shtylyov
2021-08-19 11:10 ` [PATCH net-next v3 0/9] Add Gigabit Ethernet driver support patchwork-bot+netdevbpf
2021-08-19 15:08   ` Sergey Shtylyov
2021-08-19 15:29     ` Andrew Lunn

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='CAMuHMdUEeZjfJgpXpO6qcAyuGp64wxyxiuLjUosVcRfG8=2s6w@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=Chris.Paterson2@renesas.com \
    --cc=aford173@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=ashiduka@fujitsu.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=biju.das@bp.renesas.com \
    --cc=davem@davemloft.net \
    --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 \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.