[PATCH 1/2 net-next] net: stmmac: fix RX routing function name

Subsystems: networking drivers, stmmac ethernet driver, the rest

STALE3396d

5 messages, 3 authors, 2017-07-05 · open the first message on its own page

[PATCH 1/2 net-next] net: stmmac: fix RX routing function name

From: Joao Pinto <hidden>
Date: 2017-06-08 18:02:57

This patch fixes the RX packet routing function name in dwmac4_core.
It also calls the correct dwmac4_core callback for the routing
configuration purpose.

Signed-off-by: Joao Pinto <redacted>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 6 +++---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
index f233bf8..0df038f 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
@@ -111,7 +111,7 @@ static void dwmac4_tx_queue_priority(struct mac_device_info *hw,
 	writel(value, ioaddr + base_register);
 }
 
-static void dwmac4_tx_queue_routing(struct mac_device_info *hw,
+static void dwmac4_rx_queue_routing(struct mac_device_info *hw,
 				    u8 packet, u32 queue)
 {
 	void __iomem *ioaddr = hw->pcsr;
@@ -676,7 +676,7 @@ static const struct stmmac_ops dwmac4_ops = {
 	.rx_queue_enable = dwmac4_rx_queue_enable,
 	.rx_queue_prio = dwmac4_rx_queue_priority,
 	.tx_queue_prio = dwmac4_tx_queue_priority,
-	.rx_queue_routing = dwmac4_tx_queue_routing,
+	.rx_queue_routing = dwmac4_rx_queue_routing,
 	.prog_mtl_rx_algorithms = dwmac4_prog_mtl_rx_algorithms,
 	.prog_mtl_tx_algorithms = dwmac4_prog_mtl_tx_algorithms,
 	.set_mtl_tx_queue_weight = dwmac4_set_mtl_tx_queue_weight,
@@ -707,7 +707,7 @@ static const struct stmmac_ops dwmac410_ops = {
 	.rx_queue_enable = dwmac4_rx_queue_enable,
 	.rx_queue_prio = dwmac4_rx_queue_priority,
 	.tx_queue_prio = dwmac4_tx_queue_priority,
-	.rx_queue_routing = dwmac4_tx_queue_routing,
+	.rx_queue_routing = dwmac4_rx_queue_routing,
 	.prog_mtl_rx_algorithms = dwmac4_prog_mtl_rx_algorithms,
 	.prog_mtl_tx_algorithms = dwmac4_prog_mtl_tx_algorithms,
 	.set_mtl_tx_queue_weight = dwmac4_set_mtl_tx_queue_weight,
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index f446f36..9ca3a2d 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -2353,7 +2353,7 @@ static void stmmac_mac_config_rx_queues_routing(struct stmmac_priv *priv)
 			continue;
 
 		packet = priv->plat->rx_queues_cfg[queue].pkt_route;
-		priv->hw->mac->rx_queue_prio(priv->hw, packet, queue);
+		priv->hw->mac->rx_queue_routing(priv->hw, packet, queue);
 	}
 }
 
-- 
2.9.3

[PATCH 2/2 net-next] net: stmmac: Improve documentation on AVB parameters

From: Joao Pinto <hidden>
Date: 2017-06-08 18:02:59

This patch fixes the description of the DT AVB parameters and gives
an accurate example. It was also included the base values that were
used to get the example' CBS paremeter values.

Signed-off-by: Joao Pinto <redacted>
---
 Documentation/devicetree/bindings/net/stmmac.txt | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/stmmac.txt b/Documentation/devicetree/bindings/net/stmmac.txt
index c3a7be6..707426d 100644
--- a/Documentation/devicetree/bindings/net/stmmac.txt
+++ b/Documentation/devicetree/bindings/net/stmmac.txt
@@ -109,10 +109,10 @@ Optional properties:
 			  [Attention] Queue 0 is reserved for legacy traffic
 			  and so no AVB is available in this queue.
 		- Configure Credit Base Shaper (if AVB Mode selected):
-			- snps,send_slope: enable Low Power Interface
-			- snps,idle_slope: unlock on WoL
-			- snps,high_credit: max write outstanding req. limit
-			- snps,low_credit: max read outstanding req. limit
+			- snps,send_slope: Send Slope Credit value
+			- snps,idle_slope:  Idle Slope Credit value
+			- snps,high_credit: High Credit value
+			- snps,low_credit: Low Credit value
 		- snps,priority: TX queue priority (Range: 0x0 to 0xF)
 Examples:
 
@@ -143,10 +143,18 @@ Examples:
 
 		queue1 {
 			snps,avb-algorithm;
-			snps,send_slope = <0x1000>;
-			snps,idle_slope = <0x1000>;
-			snps,high_credit = <0x3E800>;
-			snps,low_credit = <0xFFC18000>;
+			/*
+			 *  Example AVB parameters based on:
+			 *   Allocated Bandwidth: 40%
+			 *   Maximum Frame size: 1000 bytes
+			 *   Maximum Interference size: 1500 bytes
+			 *   Port Transmit Rate: 8
+			 *   Scaling Factor: 1024
+			 */
+			snps,idle_slope = <0xCCC>;
+			snps,send_slope = <0x1333>;
+			snps,high_credit = <0x4B0000>;
+			snps,low_credit = <0xFFB50000>;
 			snps,priority = <0x1>;
 		};
 	};
-- 
2.9.3

Re: [PATCH 1/2 net-next] net: stmmac: fix RX routing function name

From: David Miller <davem@davemloft.net>
Date: 2017-06-08 23:30:59

A patch series should always have a proper "[PATCH 0/N] ..." header posting
explaining what the patch series is doing at a high level, how it is doing
it, and why it is doing it that way.

Thank you.

Re: [PATCH 2/2 net-next] net: stmmac: Improve documentation on AVB parameters

From: Giuseppe CAVALLARO <hidden>
Date: 2017-06-09 07:10:41

Hi Joao

On 6/8/2017 8:02 PM, Joao Pinto wrote:
quoted hunk
This patch fixes the description of the DT AVB parameters and gives
an accurate example. It was also included the base values that were
used to get the example' CBS paremeter values.

Signed-off-by: Joao Pinto <redacted>
---
  Documentation/devicetree/bindings/net/stmmac.txt | 24 ++++++++++++++++--------
  1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/stmmac.txt b/Documentation/devicetree/bindings/net/stmmac.txt
index c3a7be6..707426d 100644
--- a/Documentation/devicetree/bindings/net/stmmac.txt
+++ b/Documentation/devicetree/bindings/net/stmmac.txt
@@ -109,10 +109,10 @@ Optional properties:
  			  [Attention] Queue 0 is reserved for legacy traffic
  			  and so no AVB is available in this queue.
  		- Configure Credit Base Shaper (if AVB Mode selected):
-			- snps,send_slope: enable Low Power Interface
-			- snps,idle_slope: unlock on WoL
-			- snps,high_credit: max write outstanding req. limit
-			- snps,low_credit: max read outstanding req. limit
+			- snps,send_slope: Send Slope Credit value
+			- snps,idle_slope:  Idle Slope Credit value
+			- snps,high_credit: High Credit value
+			- snps,low_credit: Low Credit value
  		- snps,priority: TX queue priority (Range: 0x0 to 0xF)
  Examples:
  
@@ -143,10 +143,18 @@ Examples:
  
  		queue1 {
  			snps,avb-algorithm;
-			snps,send_slope = <0x1000>;
-			snps,idle_slope = <0x1000>;
-			snps,high_credit = <0x3E800>;
-			snps,low_credit = <0xFFC18000>;
+			/*
+			 *  Example AVB parameters based on:
+			 *   Allocated Bandwidth: 40%
+			 *   Maximum Frame size: 1000 bytes
+			 *   Maximum Interference size: 1500 bytes
+			 *   Port Transmit Rate: 8
+			 *   Scaling Factor: 1024
+			 */
+			snps,idle_slope = <0xCCC>;
+			snps,send_slope = <0x1333>;
+			snps,high_credit = <0x4B0000>;
Thanks for having taken care about this changes, please, as required, add a cover-letter
and give more information about these values that can be tuned by user and, for example,
the snps,high_credit could be as default = 0xbe4000 that is a reasonable value because
comes from 1522 * 8 * 1024 and LOW credit is the two complement.
                      ^^^^^
                    frame size ---> maximum is 16

Regards
Peppe
quoted hunk
+			snps,low_credit = <0xFFB50000>;
  			snps,priority = <0x1>;
  		};
  	};

Re: [PATCH 2/2 net-next] net: stmmac: Improve documentation on AVB parameters

From: Joao Pinto <hidden>
Date: 2017-07-05 10:34:10

Hi Peppe,

Às 8:10 AM de 6/9/2017, Giuseppe CAVALLARO escreveu:
Hi Joao

On 6/8/2017 8:02 PM, Joao Pinto wrote:
quoted
This patch fixes the description of the DT AVB parameters and gives
an accurate example. It was also included the base values that were
used to get the example' CBS paremeter values.

Signed-off-by: Joao Pinto <redacted>
---
  Documentation/devicetree/bindings/net/stmmac.txt | 24 ++++++++++++++++--------
  1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/stmmac.txt
b/Documentation/devicetree/bindings/net/stmmac.txt
index c3a7be6..707426d 100644
--- a/Documentation/devicetree/bindings/net/stmmac.txt
+++ b/Documentation/devicetree/bindings/net/stmmac.txt
@@ -109,10 +109,10 @@ Optional properties:
                [Attention] Queue 0 is reserved for legacy traffic
                and so no AVB is available in this queue.
          - Configure Credit Base Shaper (if AVB Mode selected):
-            - snps,send_slope: enable Low Power Interface
-            - snps,idle_slope: unlock on WoL
-            - snps,high_credit: max write outstanding req. limit
-            - snps,low_credit: max read outstanding req. limit
+            - snps,send_slope: Send Slope Credit value
+            - snps,idle_slope:  Idle Slope Credit value
+            - snps,high_credit: High Credit value
+            - snps,low_credit: Low Credit value
          - snps,priority: TX queue priority (Range: 0x0 to 0xF)
  Examples:
  @@ -143,10 +143,18 @@ Examples:
            queue1 {
              snps,avb-algorithm;
-            snps,send_slope = <0x1000>;
-            snps,idle_slope = <0x1000>;
-            snps,high_credit = <0x3E800>;
-            snps,low_credit = <0xFFC18000>;
+            /*
+             *  Example AVB parameters based on:
+             *   Allocated Bandwidth: 40%
+             *   Maximum Frame size: 1000 bytes
+             *   Maximum Interference size: 1500 bytes
+             *   Port Transmit Rate: 8
+             *   Scaling Factor: 1024
+             */
+            snps,idle_slope = <0xCCC>;
+            snps,send_slope = <0x1333>;
+            snps,high_credit = <0x4B0000>;
Thanks for having taken care about this changes, please, as required, add a
cover-letter
and give more information about these values that can be tuned by user and, for
example,
the snps,high_credit could be as default = 0xbe4000 that is a reasonable value
because
comes from 1522 * 8 * 1024 and LOW credit is the two complement.
                      ^^^^^
                    frame size ---> maximum is 16
I calculate the hi credit this way:

  HiCredit = BW / 100 * MaxInterferenceSize * 8 * Scaling

Can I assume that you are considering 100% bandwidth for this example channel?
If so, it is not correct, since the maximum bandwidth should be 75%, leaving at
least 25% for default channel 0 (I think this is assured in the hardware).

Thanks,
Joao
Regards
Peppe
quoted
+            snps,low_credit = <0xFFB50000>;
              snps,priority = <0x1>;
          };
      };
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help