[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2e00738e-6d17-4ba6-8af4-7e02783b17da@lunn.ch>
Date: Sun, 14 Dec 2025 17:49:43 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Frank Wunderlich <linux@...web.de>
Cc: Felix Fietkau <nbd@....name>, Sean Wang <sean.wang@...iatek.com>,
Lorenzo Bianconi <lorenzo@...nel.org>,
Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
Russell King <linux@...linux.org.uk>,
Frank Wunderlich <frank-w@...lic-files.de>,
Daniel Golle <daniel@...rotopia.org>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org,
Mason Chang <mason-cw.chang@...iatek.com>
Subject: Re: [RFC net-next v3 3/3] net: ethernet: mtk_eth_soc: Add LRO support
> static int mtk_hwlro_rx_init(struct mtk_eth *eth)
> {
> const struct mtk_reg_map *reg_map = eth->soc->reg_map;
> - int i;
> + const struct mtk_soc_data *soc = eth->soc;
> + int i, val;
> u32 ring_ctrl_dw1 = 0, ring_ctrl_dw2 = 0, ring_ctrl_dw3 = 0;
> u32 lro_ctrl_dw0 = 0, lro_ctrl_dw3 = 0;
Reverse Christmas tree. It looks like it was already broken, but you
should not make it worse, and i think you can even fix it here.
> +static int mtk_hwlro_add_ipaddr_idx(struct net_device *dev, u32 ip4dst)
> +{
> + struct mtk_mac *mac = netdev_priv(dev);
> + struct mtk_eth *eth = mac->hw;
> + const struct mtk_reg_map *reg_map = eth->soc->reg_map;
> + u32 reg_val;
> + int i;
More Reverse Christmas tree probes. You will need to move the
assignment to reg_map into the body of the function.
> +#define MTK_PDMA_LRO_CTRL_DW0 (reg_map->pdma.lro_ctrl_dw0)
> +#define MTK_PDMA_LRO_CTRL_DW1 (reg_map->pdma.lro_ctrl_dw0 + 0x04)
> +#define MTK_PDMA_LRO_CTRL_DW2 (reg_map->pdma.lro_ctrl_dw0 + 0x08)
> +#define MTK_PDMA_LRO_CTRL_DW3 (reg_map->pdma.lro_ctrl_dw0 + 0x0c)
Same comment as the previous patch.
Andrew
Powered by blists - more mailing lists