diff mbox series

[2/2] net: stmmac: dwmac-imx: set TSO/TBS TX queues default settings

Message ID 5606bb5f0b7566a20bb136b268dae89d22a48898.1706184304.git.esben@geanix.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series [1/2] net: stmmac: do not clear TBS enable bit on link up/down | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1077 this patch: 1077
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 0 of 0 maintainers
netdev/build_clang success Errors and warnings before: 1095 this patch: 1095
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1095 this patch: 1095
netdev/checkpatch fail ERROR: code indent should use tabs where possible WARNING: please, no spaces at the start of a line
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-01-26--00-00 (tests: 518)

Commit Message

Esben Haabendal Jan. 25, 2024, 12:34 p.m. UTC
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 <esben@geanix.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Vadim Fedorenko Jan. 25, 2024, 5:11 p.m. UTC | #1
On 25/01/2024 12:34, Esben Haabendal wrote:
> 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 <esben@geanix.com>
> ---
>   drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
> index 8f730ada71f9..c42e8f972833 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
> @@ -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.

>   	plat_dat->host_dma_width = dwmac->ops->addr_width;
>   	plat_dat->init = imx_dwmac_init;
>   	plat_dat->exit = imx_dwmac_exit;
Esben Haabendal Jan. 25, 2024, 6:31 p.m. UTC | #2
Vadim Fedorenko <vadim.fedorenko@linux.dev> writes:

> On 25/01/2024 12:34, Esben Haabendal wrote:
>> 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 <esben@geanix.com>
>> ---
>>   drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 6 ++++++
>>   1 file changed, 6 insertions(+)
>> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
>> b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
>> index 8f730ada71f9..c42e8f972833 100644
>> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
>> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
>> @@ -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.

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.

>
>>   	plat_dat->host_dma_width = dwmac->ops->addr_width;
>>   	plat_dat->init = imx_dwmac_init;
>>   	plat_dat->exit = imx_dwmac_exit;
Jakub Kicinski Jan. 26, 2024, 1:22 a.m. UTC | #3
On Thu, 25 Jan 2024 13:34:34 +0100 Esben Haabendal wrote:
> +        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.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
index 8f730ada71f9..c42e8f972833 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
@@ -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;