net: stmmac: dwmac-imx: set TSO/TBS TX queues default settings
Subsystems (6)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/2 net: stmmac: do not clear TBS enable bit on link up/down
With the dma conf being reallocated on each call to stmmac_open(), any information in there is lost, unless we specifically handle it.
The STMMAC_TBS_EN bit is set when adding an etf qdisc, and the etf qdisc therefore would stop working when link was set down and then back up.
--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +3 -0
@@ -3932,6 +3932,9 @@ static int __stmmac_open(struct net_device *dev, priv->rx_copybreak =STMMAC_RX_COPYBREAK ; buf_sz = dma_conf->dma_buf_sz; +for (int i =0 ; i <MTL_MAX_TX_QUEUES ; i++) +if (priv->dma_conf.tx_queue[i].tbs &STMMAC_TBS_EN ) + dma_conf->tx_queue[i].tbs = priv->dma_conf.tx_queue[i].tbs;memcpy (&priv->dma_conf, dma_conf,sizeof (*dma_conf));stmmac_reset_queues_param (priv);
Signature · 1 line
2.43.0
PATCH 2/2 net: stmmac: dwmac-imx: set TSO/TBS TX queues default settings
In reply to a message not in the archiveTSO and TBS cannot coexist. For now we set i.MX Ethernet QOS controller to use TX queue with TSO and the rest for TBS.
TX queues with TBS can support etf qdisc hw offload.
--- drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c +6 -0
@@ -353,6 +353,12 @@ static int imx_dwmac_probe(struct platform_device *pdev)if (data->flags &STMMAC_FLAG_HWTSTAMP_CORRECT_LATENCY ) plat_dat->flags |=STMMAC_FLAG_HWTSTAMP_CORRECT_LATENCY ; +for (int i =0 ; i < plat_dat->tx_queues_to_use; i++) { +/* Default TX Q0 to use TSO and rest TXQ for TBS */ +if (i >0 ) + plat_dat->tx_queues_cfg[i].tbs_en =1 ; + } + plat_dat->host_dma_width = dwmac->ops->addr_width; plat_dat->init = imx_dwmac_init; plat_dat->exit = imx_dwmac_exit;
Signature · 1 line
2.43.0
Quoted 15 lines · Esben Haabendal
TSO and TBS cannot coexist. For now we set i.MX Ethernet QOS controller to use TX queue with TSO and the rest for TBS.
TX queues with TBS can support etf qdisc hw offload.
Signed-off-by Esben Haabendal <[email protected]>--- drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 6 ++++++ 1 file changed, 6 insertions(+)drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c +0
-0
drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c static int imx_dwmac_probe(struct platform_device *pdev) · line 361
Quoted 9 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c +6
-0@@ -353,6 +353,12 @@ static int imx_dwmac_probe(struct platform_device *pdev)if (data->flags &STMMAC_FLAG_HWTSTAMP_CORRECT_LATENCY ) plat_dat->flags |=STMMAC_FLAG_HWTSTAMP_CORRECT_LATENCY ; +for (int i =0 ; i < plat_dat->tx_queues_to_use; i++) { +/* Default TX Q0 to use TSO and rest TXQ for TBS */ +if (i >0 ) + plat_dat->tx_queues_cfg[i].tbs_en =1 ; + } +
Just wonder why don't you start with i = 1 and remove 'if' completely? Keeping comment in place will make it understandable.
Quoted 3 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c +0
-0plat_dat->host_dma_width = dwmac->ops->addr_width; plat_dat->init = imx_dwmac_init; plat_dat->exit = imx_dwmac_exit;
Quoted 17 lines · Vadim Fedorenko
Quoted 16 lines · Esben Haabendal
TSO and TBS cannot coexist. For now we set i.MX Ethernet QOS controller to use TX queue with TSO and the rest for TBS.
TX queues with TBS can support etf qdisc hw offload.Signed-off-by Esben Haabendal <[email protected]>--- drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 6 ++++++ 1 file changed, 6 insertions(+)drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c +0
-0@@ -353,6 +353,12 @@ static int imx_dwmac_probe(struct platform_device *pdev)if (data->flags &STMMAC_FLAG_HWTSTAMP_CORRECT_LATENCY ) plat_dat->flags |=STMMAC_FLAG_HWTSTAMP_CORRECT_LATENCY ; + for (int i = 0; i < plat_dat->tx_queues_to_use; i++) {
Quoted 8 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c static int imx_dwmac_probe(struct platform_device *pdev) · line 361
Quoted 5 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c +5
-0+/* Default TX Q0 to use TSO and rest TXQ for TBS */ +if (i >0 ) + plat_dat->tx_queues_cfg[i].tbs_en =1 ; + } +Just wonder why don't you start with i = 1 and remove 'if' completely? Keeping comment in place will make it understandable.
No good reason for now. Later on, we might have some setup in the same lop that also applies to Q0. But the init value can be changed at that point.
Quoted 4 lines
Quoted 4 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c +0
-0plat_dat->host_dma_width = dwmac->ops->addr_width; plat_dat->init = imx_dwmac_init; plat_dat->exit = imx_dwmac_exit;
Jakub Kicinski
maintainerdrivers/net/ethernet/stmicro/stmmac/dwmac-imx.c static int imx_dwmac_probe(struct platform_device *pdev) · line 360
Quoted 5 lines · On Thu, 25 Jan 2024 13:34:34 +0100 Esben Haabendal wrote:
drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c +5
-0+for (int i =0 ; i < plat_dat->tx_queues_to_use; i++) { +/* Default TX Q0 to use TSO and rest TXQ for TBS */ +if (i >0 ) + plat_dat->tx_queues_cfg[i].tbs_en =1 ; + }
checkpatch points out this code is indented with spaces. Please use tabs.