linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: [PATCH net-next 1/2] arm64: dts: imx8mp-evk: configure multiple queues on eqos
  2021-12-01  1:47 ` [PATCH net-next 1/2] arm64: dts: imx8mp-evk: configure multiple queues on eqos Xiaoliang Yang
@ 2021-12-01  1:43   ` Joakim Zhang
  2021-12-01  2:45   ` Jakub Kicinski
  1 sibling, 0 replies; 8+ messages in thread
From: Joakim Zhang @ 2021-12-01  1:43 UTC (permalink / raw)
  To: Xiaoliang Yang, davem, netdev, linux-kernel
  Cc: kuba, peppe.cavallaro, alexandre.torgue, joabreu, Yannick Vignon,
	boon.leong.ong, Jose.Abreu, mst, Joao.Pinto, Mingkai Hu, Leo Li,
	Xiaoliang Yang


Hi Xiaoliang,

After enable multiple queues in dts by default, eqos can't boot with NFS, NFS can't be mounted at the end. Can this reproduce at your side?

Best Regards,
Joakim Zhang

> -----Original Message-----
> From: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
> Sent: 2021年12月1日 9:47
> To: davem@davemloft.net; netdev@vger.kernel.org;
> linux-kernel@vger.kernel.org
> Cc: kuba@kernel.org; Joakim Zhang <qiangqing.zhang@nxp.com>;
> peppe.cavallaro@st.com; alexandre.torgue@foss.st.com;
> joabreu@synopsys.com; Yannick Vignon <yannick.vignon@nxp.com>;
> boon.leong.ong@intel.com; Jose.Abreu@synopsys.com; mst@redhat.com;
> Joao.Pinto@synopsys.com; Mingkai Hu <mingkai.hu@nxp.com>; Leo Li
> <leoyang.li@nxp.com>; Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
> Subject: [PATCH net-next 1/2] arm64: dts: imx8mp-evk: configure multiple
> queues on eqos
> 
> Eqos ethernet support five queues on hardware, enable these queues and
> configure the priority of each queue. Uses Strict Priority as scheduling
> algorithms to ensure that the TSN function works.
> 
> Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
> ---
>  arch/arm64/boot/dts/freescale/imx8mp-evk.dts | 41
> ++++++++++++++++++++
>  1 file changed, 41 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts
> b/arch/arm64/boot/dts/freescale/imx8mp-evk.dts
> index 7b99fad6e4d6..1e523b3d122b 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts
> +++ b/arch/arm64/boot/dts/freescale/imx8mp-evk.dts
> @@ -86,6 +86,9 @@
>  	pinctrl-0 = <&pinctrl_eqos>;
>  	phy-mode = "rgmii-id";
>  	phy-handle = <&ethphy0>;
> +	snps,force_thresh_dma_mode;
> +	snps,mtl-tx-config = <&mtl_tx_setup>;
> +	snps,mtl-rx-config = <&mtl_rx_setup>;
>  	status = "okay";
> 
>  	mdio {
> @@ -99,6 +102,44 @@
>  			eee-broken-1000t;
>  		};
>  	};
> +
> +	mtl_tx_setup: tx-queues-config {
> +		snps,tx-queues-to-use = <5>;
> +		queue0 {
> +			snps,priority = <0x0>;
> +		};
> +		queue1 {
> +			snps,priority = <0x1>;
> +		};
> +		queue2 {
> +			snps,priority = <0x2>;
> +		};
> +		queue3 {
> +			snps,priority = <0x3>;
> +		};
> +		queue4 {
> +			snps,priority = <0x4>;
> +		};
> +	};
> +
> +	mtl_rx_setup: rx-queues-config {
> +		snps,rx-queues-to-use = <5>;
> +		queue0 {
> +			snps,priority = <0x0>;
> +		};
> +		queue1 {
> +			snps,priority = <0x1>;
> +		};
> +		queue2 {
> +			snps,priority = <0x2>;
> +		};
> +		queue3 {
> +			snps,priority = <0x3>;
> +		};
> +		queue4 {
> +			snps,priority = <0x4>;
> +		};
> +	};
>  };
> 
>  &fec {
> --
> 2.17.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH net-next 0/2] multiple queues support on imx8mp-evk
@ 2021-12-01  1:47 Xiaoliang Yang
  2021-12-01  1:47 ` [PATCH net-next 1/2] arm64: dts: imx8mp-evk: configure multiple queues on eqos Xiaoliang Yang
  2021-12-01  1:47 ` [PATCH net-next 2/2] net: stmmac: make stmmac-tx-timeout configurable in Kconfig Xiaoliang Yang
  0 siblings, 2 replies; 8+ messages in thread
From: Xiaoliang Yang @ 2021-12-01  1:47 UTC (permalink / raw)
  To: davem, netdev, linux-kernel
  Cc: kuba, qiangqing.zhang, peppe.cavallaro, alexandre.torgue,
	joabreu, yannick.vignon, boon.leong.ong, Jose.Abreu, mst,
	Joao.Pinto, mingkai.hu, leoyang.li, xiaoliang.yang_1

This patch series configures five multiple queues for RX and TX on
imx8mp-evk, and uses Strict Priority as scheduling algorithms.

Make stmmac-tx-timeout configurable so that users can disable it in the
SP queue scheduling algorithm.

Xiaoliang Yang (2):
  arm64: dts: imx8mp-evk: configure multiple queues on eqos
  net: stmmac: make stmmac-tx-timeout configurable in Kconfig

 arch/arm64/boot/dts/freescale/imx8mp-evk.dts  | 41 +++++++++++++++++++
 drivers/net/ethernet/stmicro/stmmac/Kconfig   | 12 ++++++
 .../net/ethernet/stmicro/stmmac/stmmac_main.c |  4 ++
 3 files changed, 57 insertions(+)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH net-next 1/2] arm64: dts: imx8mp-evk: configure multiple queues on eqos
  2021-12-01  1:47 [PATCH net-next 0/2] multiple queues support on imx8mp-evk Xiaoliang Yang
@ 2021-12-01  1:47 ` Xiaoliang Yang
  2021-12-01  1:43   ` Joakim Zhang
  2021-12-01  2:45   ` Jakub Kicinski
  2021-12-01  1:47 ` [PATCH net-next 2/2] net: stmmac: make stmmac-tx-timeout configurable in Kconfig Xiaoliang Yang
  1 sibling, 2 replies; 8+ messages in thread
From: Xiaoliang Yang @ 2021-12-01  1:47 UTC (permalink / raw)
  To: davem, netdev, linux-kernel
  Cc: kuba, qiangqing.zhang, peppe.cavallaro, alexandre.torgue,
	joabreu, yannick.vignon, boon.leong.ong, Jose.Abreu, mst,
	Joao.Pinto, mingkai.hu, leoyang.li, xiaoliang.yang_1

Eqos ethernet support five queues on hardware, enable these queues and
configure the priority of each queue. Uses Strict Priority as scheduling
algorithms to ensure that the TSN function works.

Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
---
 arch/arm64/boot/dts/freescale/imx8mp-evk.dts | 41 ++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts b/arch/arm64/boot/dts/freescale/imx8mp-evk.dts
index 7b99fad6e4d6..1e523b3d122b 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts
+++ b/arch/arm64/boot/dts/freescale/imx8mp-evk.dts
@@ -86,6 +86,9 @@
 	pinctrl-0 = <&pinctrl_eqos>;
 	phy-mode = "rgmii-id";
 	phy-handle = <&ethphy0>;
+	snps,force_thresh_dma_mode;
+	snps,mtl-tx-config = <&mtl_tx_setup>;
+	snps,mtl-rx-config = <&mtl_rx_setup>;
 	status = "okay";
 
 	mdio {
@@ -99,6 +102,44 @@
 			eee-broken-1000t;
 		};
 	};
+
+	mtl_tx_setup: tx-queues-config {
+		snps,tx-queues-to-use = <5>;
+		queue0 {
+			snps,priority = <0x0>;
+		};
+		queue1 {
+			snps,priority = <0x1>;
+		};
+		queue2 {
+			snps,priority = <0x2>;
+		};
+		queue3 {
+			snps,priority = <0x3>;
+		};
+		queue4 {
+			snps,priority = <0x4>;
+		};
+	};
+
+	mtl_rx_setup: rx-queues-config {
+		snps,rx-queues-to-use = <5>;
+		queue0 {
+			snps,priority = <0x0>;
+		};
+		queue1 {
+			snps,priority = <0x1>;
+		};
+		queue2 {
+			snps,priority = <0x2>;
+		};
+		queue3 {
+			snps,priority = <0x3>;
+		};
+		queue4 {
+			snps,priority = <0x4>;
+		};
+	};
 };
 
 &fec {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH net-next 2/2] net: stmmac: make stmmac-tx-timeout configurable in Kconfig
  2021-12-01  1:47 [PATCH net-next 0/2] multiple queues support on imx8mp-evk Xiaoliang Yang
  2021-12-01  1:47 ` [PATCH net-next 1/2] arm64: dts: imx8mp-evk: configure multiple queues on eqos Xiaoliang Yang
@ 2021-12-01  1:47 ` Xiaoliang Yang
  2021-12-02 10:13   ` Heiner Kallweit
  1 sibling, 1 reply; 8+ messages in thread
From: Xiaoliang Yang @ 2021-12-01  1:47 UTC (permalink / raw)
  To: davem, netdev, linux-kernel
  Cc: kuba, qiangqing.zhang, peppe.cavallaro, alexandre.torgue,
	joabreu, yannick.vignon, boon.leong.ong, Jose.Abreu, mst,
	Joao.Pinto, mingkai.hu, leoyang.li, xiaoliang.yang_1

stmmac_tx_timeout() function is called when a queue transmission
timeout. When Strict Priority is used as scheduling algorithms, the
lower priority queue may be blocked by a higher prority queue, which
will lead to tx timeout. We don't want to enable the tx watchdog timeout
in this case. Therefore, this patch make stmmac-tx-timeout configurable.

This patch set the CONFIG_STMMAC_TX_TIMEOUT by default when STMMAC_ETH
is selected. If anyone want to disable the tx watchdog timeout of
stmmac, he can unset the CONFIG_STMMAC_TX_TIMEOUT in menuconfig.

Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
---
 drivers/net/ethernet/stmicro/stmmac/Kconfig       | 12 ++++++++++++
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |  4 ++++
 2 files changed, 16 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig
index 929cfc22cd0c..856c7d056b61 100644
--- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
+++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
@@ -271,4 +271,16 @@ config STMMAC_PCI
 	  If you have a controller with this interface, say Y or M here.
 
 	  If unsure, say N.
+
+config STMMAC_TX_TIMEOUT
+	bool "STMMAC TX timeout support"
+	default STMMAC_ETH
+	depends on STMMAC_ETH
+	help
+	  Support for TX timeout enable on stmmac.
+
+	  This selects the TX watchdog timeout support for stmmac driver. The
+	  feature is enabled by default when STMMAC_ETH is selected. If you
+	  want to disable the TX watchdog timeout feature, say N here.
+
 endif
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 89a6c35e2546..0a712b5d0715 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -5421,6 +5421,7 @@ static int stmmac_napi_poll_rxtx(struct napi_struct *napi, int budget)
 	return min(rxtx_done, budget - 1);
 }
 
+#ifdef CONFIG_STMMAC_TX_TIMEOUT
 /**
  *  stmmac_tx_timeout
  *  @dev : Pointer to net device structure
@@ -5436,6 +5437,7 @@ static void stmmac_tx_timeout(struct net_device *dev, unsigned int txqueue)
 
 	stmmac_global_err(priv);
 }
+#endif
 
 /**
  *  stmmac_set_rx_mode - entry point for multicast addressing
@@ -6632,7 +6634,9 @@ static const struct net_device_ops stmmac_netdev_ops = {
 	.ndo_fix_features = stmmac_fix_features,
 	.ndo_set_features = stmmac_set_features,
 	.ndo_set_rx_mode = stmmac_set_rx_mode,
+#ifdef CONFIG_STMMAC_TX_TIMEOUT
 	.ndo_tx_timeout = stmmac_tx_timeout,
+#endif
 	.ndo_eth_ioctl = stmmac_ioctl,
 	.ndo_setup_tc = stmmac_setup_tc,
 	.ndo_select_queue = stmmac_select_queue,
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH net-next 1/2] arm64: dts: imx8mp-evk: configure multiple queues on eqos
  2021-12-01  1:47 ` [PATCH net-next 1/2] arm64: dts: imx8mp-evk: configure multiple queues on eqos Xiaoliang Yang
  2021-12-01  1:43   ` Joakim Zhang
@ 2021-12-01  2:45   ` Jakub Kicinski
  1 sibling, 0 replies; 8+ messages in thread
From: Jakub Kicinski @ 2021-12-01  2:45 UTC (permalink / raw)
  To: Xiaoliang Yang
  Cc: davem, netdev, linux-kernel, qiangqing.zhang, peppe.cavallaro,
	alexandre.torgue, joabreu, yannick.vignon, boon.leong.ong,
	Jose.Abreu, mst, Joao.Pinto, mingkai.hu, leoyang.li

On Wed,  1 Dec 2021 09:47:04 +0800 Xiaoliang Yang wrote:
> Eqos ethernet support five queues on hardware, enable these queues and
> configure the priority of each queue. Uses Strict Priority as scheduling
> algorithms to ensure that the TSN function works.

I believe you need to CC Rob on DT changes?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net-next 2/2] net: stmmac: make stmmac-tx-timeout configurable in Kconfig
  2021-12-01  1:47 ` [PATCH net-next 2/2] net: stmmac: make stmmac-tx-timeout configurable in Kconfig Xiaoliang Yang
@ 2021-12-02 10:13   ` Heiner Kallweit
  2021-12-02 10:28     ` [EXT] " Xiaoliang Yang
  0 siblings, 1 reply; 8+ messages in thread
From: Heiner Kallweit @ 2021-12-02 10:13 UTC (permalink / raw)
  To: Xiaoliang Yang, davem, netdev, linux-kernel
  Cc: kuba, qiangqing.zhang, peppe.cavallaro, alexandre.torgue,
	joabreu, yannick.vignon, boon.leong.ong, Jose.Abreu, mst,
	Joao.Pinto, mingkai.hu, leoyang.li

On 01.12.2021 02:47, Xiaoliang Yang wrote:
> stmmac_tx_timeout() function is called when a queue transmission
> timeout. When Strict Priority is used as scheduling algorithms, the
> lower priority queue may be blocked by a higher prority queue, which
> will lead to tx timeout. We don't want to enable the tx watchdog timeout
> in this case. Therefore, this patch make stmmac-tx-timeout configurable.
> 
Your patch just disables the timeout handler, the WARN_ONCE() would
still fire. And shouldn't this be a runtime setting rather than a
compile-time setting?

> This patch set the CONFIG_STMMAC_TX_TIMEOUT by default when STMMAC_ETH
> is selected. If anyone want to disable the tx watchdog timeout of
> stmmac, he can unset the CONFIG_STMMAC_TX_TIMEOUT in menuconfig.
> 
> Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
> ---
>  drivers/net/ethernet/stmicro/stmmac/Kconfig       | 12 ++++++++++++
>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |  4 ++++
>  2 files changed, 16 insertions(+)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig
> index 929cfc22cd0c..856c7d056b61 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
> +++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
> @@ -271,4 +271,16 @@ config STMMAC_PCI
>  	  If you have a controller with this interface, say Y or M here.
>  
>  	  If unsure, say N.
> +
> +config STMMAC_TX_TIMEOUT
> +	bool "STMMAC TX timeout support"
> +	default STMMAC_ETH
> +	depends on STMMAC_ETH
> +	help
> +	  Support for TX timeout enable on stmmac.
> +
> +	  This selects the TX watchdog timeout support for stmmac driver. The
> +	  feature is enabled by default when STMMAC_ETH is selected. If you
> +	  want to disable the TX watchdog timeout feature, say N here.
> +
>  endif
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 89a6c35e2546..0a712b5d0715 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -5421,6 +5421,7 @@ static int stmmac_napi_poll_rxtx(struct napi_struct *napi, int budget)
>  	return min(rxtx_done, budget - 1);
>  }
>  
> +#ifdef CONFIG_STMMAC_TX_TIMEOUT
>  /**
>   *  stmmac_tx_timeout
>   *  @dev : Pointer to net device structure
> @@ -5436,6 +5437,7 @@ static void stmmac_tx_timeout(struct net_device *dev, unsigned int txqueue)
>  
>  	stmmac_global_err(priv);
>  }
> +#endif
>  
>  /**
>   *  stmmac_set_rx_mode - entry point for multicast addressing
> @@ -6632,7 +6634,9 @@ static const struct net_device_ops stmmac_netdev_ops = {
>  	.ndo_fix_features = stmmac_fix_features,
>  	.ndo_set_features = stmmac_set_features,
>  	.ndo_set_rx_mode = stmmac_set_rx_mode,
> +#ifdef CONFIG_STMMAC_TX_TIMEOUT
>  	.ndo_tx_timeout = stmmac_tx_timeout,
> +#endif
>  	.ndo_eth_ioctl = stmmac_ioctl,
>  	.ndo_setup_tc = stmmac_setup_tc,
>  	.ndo_select_queue = stmmac_select_queue,
> 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [EXT] Re: [PATCH net-next 2/2] net: stmmac: make stmmac-tx-timeout configurable in Kconfig
  2021-12-02 10:13   ` Heiner Kallweit
@ 2021-12-02 10:28     ` Xiaoliang Yang
  2021-12-02 10:45       ` Heiner Kallweit
  0 siblings, 1 reply; 8+ messages in thread
From: Xiaoliang Yang @ 2021-12-02 10:28 UTC (permalink / raw)
  To: Heiner Kallweit, davem, netdev, linux-kernel
  Cc: kuba, Joakim Zhang, peppe.cavallaro, alexandre.torgue, joabreu,
	Yannick Vignon, boon.leong.ong, Jose.Abreu, mst, Joao.Pinto,
	Mingkai Hu, Leo Li

Hi Heiner,

On Dec 02, 2021 at 16:13:20, Heiner Kallweit wrote:
> > stmmac_tx_timeout() function is called when a queue transmission
> > timeout. When Strict Priority is used as scheduling algorithms, the
> > lower priority queue may be blocked by a higher prority queue, which
> > will lead to tx timeout. We don't want to enable the tx watchdog
> > timeout in this case. Therefore, this patch make stmmac-tx-timeout
> configurable.
> >
> Your patch just disables the timeout handler, the WARN_ONCE() would still fire.
> And shouldn't this be a runtime setting rather than a compile-time setting?
> 
I tried to disable it in stmmac_tx_timeout() at runtime, the WARN_ONCE() will still be called from dev_watchdog() in sch_generic.c. It seems only when the timeout handler is NULL can disable the netdev watchdog up. So I did this in compile-time setting.

Regards,
Xiaoliang

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [EXT] Re: [PATCH net-next 2/2] net: stmmac: make stmmac-tx-timeout configurable in Kconfig
  2021-12-02 10:28     ` [EXT] " Xiaoliang Yang
@ 2021-12-02 10:45       ` Heiner Kallweit
  0 siblings, 0 replies; 8+ messages in thread
From: Heiner Kallweit @ 2021-12-02 10:45 UTC (permalink / raw)
  To: Xiaoliang Yang, davem, netdev, linux-kernel
  Cc: kuba, Joakim Zhang, peppe.cavallaro, alexandre.torgue, joabreu,
	Yannick Vignon, boon.leong.ong, Jose.Abreu, mst, Joao.Pinto,
	Mingkai Hu, Leo Li

On 02.12.2021 11:28, Xiaoliang Yang wrote:
> Hi Heiner,
> 
> On Dec 02, 2021 at 16:13:20, Heiner Kallweit wrote:
>>> stmmac_tx_timeout() function is called when a queue transmission
>>> timeout. When Strict Priority is used as scheduling algorithms, the
>>> lower priority queue may be blocked by a higher prority queue, which
>>> will lead to tx timeout. We don't want to enable the tx watchdog
>>> timeout in this case. Therefore, this patch make stmmac-tx-timeout
>> configurable.
>>>
>> Your patch just disables the timeout handler, the WARN_ONCE() would still fire.
>> And shouldn't this be a runtime setting rather than a compile-time setting?
>>
> I tried to disable it in stmmac_tx_timeout() at runtime, the WARN_ONCE() will still be called from dev_watchdog() in sch_generic.c. It seems only when the timeout handler is NULL can disable the netdev watchdog up. So I did this in compile-time setting.
> 
The issue you're trying to fix is not driver-specific. Therefore the solution
should be added to net core.

> Regards,
> Xiaoliang
> 


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-12-02 10:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-01  1:47 [PATCH net-next 0/2] multiple queues support on imx8mp-evk Xiaoliang Yang
2021-12-01  1:47 ` [PATCH net-next 1/2] arm64: dts: imx8mp-evk: configure multiple queues on eqos Xiaoliang Yang
2021-12-01  1:43   ` Joakim Zhang
2021-12-01  2:45   ` Jakub Kicinski
2021-12-01  1:47 ` [PATCH net-next 2/2] net: stmmac: make stmmac-tx-timeout configurable in Kconfig Xiaoliang Yang
2021-12-02 10:13   ` Heiner Kallweit
2021-12-02 10:28     ` [EXT] " Xiaoliang Yang
2021-12-02 10:45       ` Heiner Kallweit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).