lkml.org 
[lkml]   [2019]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/2] stmmac: introduce flag to dynamically disable TX offload for rockchip devices
From
Date
On 01/04/2019 19:18, Leonidas P. Papadakos wrote:
> From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= <ayufan@ayufan.eu>
>
> Some rockchip boards exhibit an issue where tx checksumming does not work with
> packets larger than 1498.

Is it really a board-level problem? I'm no networking expert, but the
nature of the workaround suggests this is more likely to be some
inherent limitation of the IP block in the SoC, rather than something to
do with how the external pins get wired up. Does anyone have an RK3328
or RK3399 board that provably *does* checksum large packets correctly?

> This is bad for network stability.
>
> The previous approach was using force_thresh_dma_mode in the board dts, which
> does more than we need.

If indeed it is a SoC-level thing (or at least we want to treat it as
such), then couldn't we just hang it off the existing SoC-specific
compatibles in dwmac-rk.c and avoid the need for a new DT property at
all? After all, that's precisely why SoC-specific compatibles are a
thing in the first place.

Robin.

> Signed-off-by: Leonidas P. Papadakos <papadakospan@gmail.com>
> ---
> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++++
> drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 2 ++
> include/linux/stmmac.h | 1 +
> 3 files changed, 7 insertions(+)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 6a2e1031a..4552147e9 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -3660,6 +3660,10 @@ static netdev_features_t stmmac_fix_features(struct net_device *dev,
> if (priv->plat->bugged_jumbo && (dev->mtu > ETH_DATA_LEN))
> features &= ~NETIF_F_CSUM_MASK;
>
> + /* Including very small MTUs of 1498 for Rockchip devices */
> + if (priv->plat->bugged_tx_coe && (dev->mtu > ETH_DATA_LEN - 2))
> + features &= ~NETIF_F_CSUM_MASK;
> +
> /* Disable tso if asked by ethtool */
> if ((priv->plat->tso_en) && (priv->dma_cap.tsoen)) {
> if (features & NETIF_F_TSO)
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> index 3031f2bf1..807cf5826 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> @@ -519,6 +519,8 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac)
> pr_warn("force_sf_dma_mode is ignored if force_thresh_dma_mode is set.");
> }
>
> + plat->bugged_tx_coe = of_property_read_bool(np, "rockchip,bugged_tx_coe");
> +
> of_property_read_u32(np, "snps,ps-speed", &plat->mac_port_sel_speed);
>
> plat->axi = stmmac_axi_setup(pdev);
> diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
> index 4335bd771..60c411f43 100644
> --- a/include/linux/stmmac.h
> +++ b/include/linux/stmmac.h
> @@ -162,6 +162,7 @@ struct plat_stmmacenet_data {
> int pmt;
> int force_sf_dma_mode;
> int force_thresh_dma_mode;
> + int bugged_tx_coe;
> int riwt_off;
> int max_speed;
> int maxmtu;
>

\
 
 \ /
  Last update: 2019-04-01 20:55    [W:0.093 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site