netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] dpaa2-eth: small updates
@ 2020-09-25 14:44 Ioana Ciornei
  2020-09-25 14:44 ` [PATCH net-next 1/3] dpaa2-mac: do not check for both child and parent DTS nodes Ioana Ciornei
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Ioana Ciornei @ 2020-09-25 14:44 UTC (permalink / raw)
  To: davem, netdev; +Cc: Ioana Ciornei

This patch set is just a collection of small updates to the dpaa2-eth
driver.

First, we only need to check the availability of the DTS child node, not
both child and parent node. Then remove a call to
dpaa2_eth_link_state_update() which is now just a leftover and it's not
useful in how are things working now in the PHY integration. Lastly,
modify how the driver is behaving when the the flow steering table is
used between all the traffic classes.

Ioana Ciornei (2):
  dpaa2-mac: do not check for both child and parent DTS nodes
  dpaa2-eth: no need to check link state right after ndo_open

Ionut-robert Aron (1):
  dpaa2-eth: install a single steering rule when SHARED_FS is enabled

 .../net/ethernet/freescale/dpaa2/dpaa2-eth.c  | 25 ++++++++++---------
 .../ethernet/freescale/dpaa2/dpaa2-ethtool.c  |  2 +-
 .../net/ethernet/freescale/dpaa2/dpaa2-mac.c  |  3 +--
 drivers/net/ethernet/freescale/dpaa2/dpni.h   |  4 +++
 4 files changed, 19 insertions(+), 15 deletions(-)

-- 
2.25.1


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

* [PATCH net-next 1/3] dpaa2-mac: do not check for both child and parent DTS nodes
  2020-09-25 14:44 [PATCH net-next 0/3] dpaa2-eth: small updates Ioana Ciornei
@ 2020-09-25 14:44 ` Ioana Ciornei
  2020-09-25 16:31   ` Andrew Lunn
  2020-09-25 14:44 ` [PATCH net-next 2/3] dpaa2-eth: no need to check link state right after ndo_open Ioana Ciornei
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Ioana Ciornei @ 2020-09-25 14:44 UTC (permalink / raw)
  To: davem, netdev; +Cc: Ioana Ciornei

There is no need to check if both the MDIO controller node and its
child node, the PCS device, are available since there is no chance that
the child node would be enabled when the parent it's not.

Suggested-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
---
 drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
index 6ff64dd1cf27..cdd1acd0117e 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
@@ -267,8 +267,7 @@ static int dpaa2_pcs_create(struct dpaa2_mac *mac,
 		return 0;
 	}
 
-	if (!of_device_is_available(node) ||
-	    !of_device_is_available(node->parent)) {
+	if (!of_device_is_available(node)) {
 		netdev_err(mac->net_dev, "pcs-handle node not available\n");
 		return -ENODEV;
 	}
-- 
2.25.1


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

* [PATCH net-next 2/3] dpaa2-eth: no need to check link state right after ndo_open
  2020-09-25 14:44 [PATCH net-next 0/3] dpaa2-eth: small updates Ioana Ciornei
  2020-09-25 14:44 ` [PATCH net-next 1/3] dpaa2-mac: do not check for both child and parent DTS nodes Ioana Ciornei
@ 2020-09-25 14:44 ` Ioana Ciornei
  2020-09-25 14:44 ` [PATCH net-next 3/3] dpaa2-eth: install a single steering rule when SHARED_FS is enabled Ioana Ciornei
  2020-09-26  0:14 ` [PATCH net-next 0/3] dpaa2-eth: small updates David Miller
  3 siblings, 0 replies; 6+ messages in thread
From: Ioana Ciornei @ 2020-09-25 14:44 UTC (permalink / raw)
  To: davem, netdev; +Cc: Ioana Ciornei

The call to dpaa2_eth_link_state_update() is a leftover from the time
when on DPAA2 platforms the PHYs were started at boot time so when an
ifconfig was issued on the associated interface, the link status needed
to be checked directly from the ndo_open() callback.
This is not needed anymore since we are now properly integrated with the
PHY layer thus a link interrupt will come directly from the PHY
eventually without the need to call the sync function.
Fix this up by removing the call to dpaa2_eth_link_state_update().

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
---
 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
index 5bc965186f8c..a29c102b94f5 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
@@ -1700,22 +1700,11 @@ static int dpaa2_eth_open(struct net_device *net_dev)
 		goto enable_err;
 	}
 
-	if (!priv->mac) {
-		/* If the DPMAC object has already processed the link up
-		 * interrupt, we have to learn the link state ourselves.
-		 */
-		err = dpaa2_eth_link_state_update(priv);
-		if (err < 0) {
-			netdev_err(net_dev, "Can't update link state\n");
-			goto link_state_err;
-		}
-	} else {
+	if (priv->mac)
 		phylink_start(priv->mac->phylink);
-	}
 
 	return 0;
 
-link_state_err:
 enable_err:
 	dpaa2_eth_disable_ch_napi(priv);
 	dpaa2_eth_drain_pool(priv);
-- 
2.25.1


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

* [PATCH net-next 3/3] dpaa2-eth: install a single steering rule when SHARED_FS is enabled
  2020-09-25 14:44 [PATCH net-next 0/3] dpaa2-eth: small updates Ioana Ciornei
  2020-09-25 14:44 ` [PATCH net-next 1/3] dpaa2-mac: do not check for both child and parent DTS nodes Ioana Ciornei
  2020-09-25 14:44 ` [PATCH net-next 2/3] dpaa2-eth: no need to check link state right after ndo_open Ioana Ciornei
@ 2020-09-25 14:44 ` Ioana Ciornei
  2020-09-26  0:14 ` [PATCH net-next 0/3] dpaa2-eth: small updates David Miller
  3 siblings, 0 replies; 6+ messages in thread
From: Ioana Ciornei @ 2020-09-25 14:44 UTC (permalink / raw)
  To: davem, netdev; +Cc: Ionut-robert Aron, Ioana Ciornei

From: Ionut-robert Aron <ionut-robert.aron@nxp.com>

When SHARED_FS is enabled on a DPNI object the flow steering tables are
shared between all the traffic classes. Modify the driver so that we
only add a new flow steering entry on the TC#0 when this new option is
enabled.

Signed-off-by: Ionut-robert Aron <ionut-robert.aron@nxp.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
---
 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c     | 12 ++++++++++++
 drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c |  2 +-
 drivers/net/ethernet/freescale/dpaa2/dpni.h          |  4 ++++
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
index a29c102b94f5..5ea309c9867d 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
@@ -3454,6 +3454,12 @@ static int dpaa2_eth_config_hash_key(struct dpaa2_eth_priv *priv, dma_addr_t key
 			dev_err(dev, "dpni_set_rx_hash_dist failed\n");
 			break;
 		}
+
+		/* If the flow steering / hashing key is shared between all
+		 * traffic classes, install it just once
+		 */
+		if (priv->dpni_attrs.options & DPNI_OPT_SHARED_FS)
+			break;
 	}
 
 	return err;
@@ -3480,6 +3486,12 @@ static int dpaa2_eth_config_cls_key(struct dpaa2_eth_priv *priv, dma_addr_t key)
 			dev_err(dev, "dpni_set_rx_fs_dist failed\n");
 			break;
 		}
+
+		/* If the flow steering / hashing key is shared between all
+		 * traffic classes, install it just once
+		 */
+		if (priv->dpni_attrs.options & DPNI_OPT_SHARED_FS)
+			break;
 	}
 
 	return err;
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c
index 11e0c047dbd2..f981a523e13a 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c
@@ -618,7 +618,7 @@ static int dpaa2_eth_do_cls_rule(struct net_device *net_dev,
 			err = dpni_remove_fs_entry(priv->mc_io, 0,
 						   priv->mc_token, i,
 						   &rule_cfg);
-		if (err)
+		if (err || priv->dpni_attrs.options & DPNI_OPT_SHARED_FS)
 			break;
 	}
 
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpni.h b/drivers/net/ethernet/freescale/dpaa2/dpni.h
index 74456a37a997..e7b9e195b534 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpni.h
+++ b/drivers/net/ethernet/freescale/dpaa2/dpni.h
@@ -75,6 +75,10 @@ struct fsl_mc_io;
  * Disables the flow steering table.
  */
 #define DPNI_OPT_NO_FS				0x000020
+/**
+ * Flow steering table is shared between all traffic classes
+ */
+#define DPNI_OPT_SHARED_FS			0x001000
 
 int dpni_open(struct fsl_mc_io	*mc_io,
 	      u32		cmd_flags,
-- 
2.25.1


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

* Re: [PATCH net-next 1/3] dpaa2-mac: do not check for both child and parent DTS nodes
  2020-09-25 14:44 ` [PATCH net-next 1/3] dpaa2-mac: do not check for both child and parent DTS nodes Ioana Ciornei
@ 2020-09-25 16:31   ` Andrew Lunn
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Lunn @ 2020-09-25 16:31 UTC (permalink / raw)
  To: Ioana Ciornei; +Cc: davem, netdev

On Fri, Sep 25, 2020 at 05:44:19PM +0300, Ioana Ciornei wrote:
> There is no need to check if both the MDIO controller node and its
> child node, the PCS device, are available since there is no chance that
> the child node would be enabled when the parent it's not.
> 
> Suggested-by: Andrew Lunn <andrew@lunn.ch>
> Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* Re: [PATCH net-next 0/3] dpaa2-eth: small updates
  2020-09-25 14:44 [PATCH net-next 0/3] dpaa2-eth: small updates Ioana Ciornei
                   ` (2 preceding siblings ...)
  2020-09-25 14:44 ` [PATCH net-next 3/3] dpaa2-eth: install a single steering rule when SHARED_FS is enabled Ioana Ciornei
@ 2020-09-26  0:14 ` David Miller
  3 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2020-09-26  0:14 UTC (permalink / raw)
  To: ioana.ciornei; +Cc: netdev

From: Ioana Ciornei <ioana.ciornei@nxp.com>
Date: Fri, 25 Sep 2020 17:44:18 +0300

> This patch set is just a collection of small updates to the dpaa2-eth
> driver.
> 
> First, we only need to check the availability of the DTS child node, not
> both child and parent node. Then remove a call to
> dpaa2_eth_link_state_update() which is now just a leftover and it's not
> useful in how are things working now in the PHY integration. Lastly,
> modify how the driver is behaving when the the flow steering table is
> used between all the traffic classes.

Series applied.

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

end of thread, other threads:[~2020-09-26  0:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-25 14:44 [PATCH net-next 0/3] dpaa2-eth: small updates Ioana Ciornei
2020-09-25 14:44 ` [PATCH net-next 1/3] dpaa2-mac: do not check for both child and parent DTS nodes Ioana Ciornei
2020-09-25 16:31   ` Andrew Lunn
2020-09-25 14:44 ` [PATCH net-next 2/3] dpaa2-eth: no need to check link state right after ndo_open Ioana Ciornei
2020-09-25 14:44 ` [PATCH net-next 3/3] dpaa2-eth: install a single steering rule when SHARED_FS is enabled Ioana Ciornei
2020-09-26  0:14 ` [PATCH net-next 0/3] dpaa2-eth: small updates David Miller

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).