From patchwork Fri Sep 25 14:44:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 1371361 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=nxp.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4ByZSY68k5z9sRf for ; Sat, 26 Sep 2020 00:44:45 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729115AbgIYOon (ORCPT ); Fri, 25 Sep 2020 10:44:43 -0400 Received: from inva021.nxp.com ([92.121.34.21]:46768 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728731AbgIYOok (ORCPT ); Fri, 25 Sep 2020 10:44:40 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 994202005EE; Fri, 25 Sep 2020 16:44:38 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 8D731200604; Fri, 25 Sep 2020 16:44:38 +0200 (CEST) Received: from fsr-ub1864-126.ea.freescale.net (fsr-ub1864-126.ea.freescale.net [10.171.82.212]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 588E32030E; Fri, 25 Sep 2020 16:44:38 +0200 (CEST) From: Ioana Ciornei To: davem@davemloft.net, netdev@vger.kernel.org Cc: Ioana Ciornei Subject: [PATCH net-next 1/3] dpaa2-mac: do not check for both child and parent DTS nodes Date: Fri, 25 Sep 2020 17:44:19 +0300 Message-Id: <20200925144421.7811-2-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200925144421.7811-1-ioana.ciornei@nxp.com> References: <20200925144421.7811-1-ioana.ciornei@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 Signed-off-by: Ioana Ciornei Reviewed-by: Andrew Lunn --- 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; } From patchwork Fri Sep 25 14:44:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 1371358 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=nxp.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4ByZSV5cnWz9sSG for ; Sat, 26 Sep 2020 00:44:42 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729101AbgIYOol (ORCPT ); Fri, 25 Sep 2020 10:44:41 -0400 Received: from inva021.nxp.com ([92.121.34.21]:46784 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728933AbgIYOok (ORCPT ); Fri, 25 Sep 2020 10:44:40 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id D293D20076D; Fri, 25 Sep 2020 16:44:38 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id C6B95200604; Fri, 25 Sep 2020 16:44:38 +0200 (CEST) Received: from fsr-ub1864-126.ea.freescale.net (fsr-ub1864-126.ea.freescale.net [10.171.82.212]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 9B2EB2030E; Fri, 25 Sep 2020 16:44:38 +0200 (CEST) From: Ioana Ciornei To: davem@davemloft.net, netdev@vger.kernel.org Cc: Ioana Ciornei Subject: [PATCH net-next 2/3] dpaa2-eth: no need to check link state right after ndo_open Date: Fri, 25 Sep 2020 17:44:20 +0300 Message-Id: <20200925144421.7811-3-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200925144421.7811-1-ioana.ciornei@nxp.com> References: <20200925144421.7811-1-ioana.ciornei@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- 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); From patchwork Fri Sep 25 14:44:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 1371360 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=nxp.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4ByZSX1Mtsz9sRf for ; Sat, 26 Sep 2020 00:44:44 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729129AbgIYOon (ORCPT ); Fri, 25 Sep 2020 10:44:43 -0400 Received: from inva020.nxp.com ([92.121.34.13]:46416 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729021AbgIYOol (ORCPT ); Fri, 25 Sep 2020 10:44:41 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 2120E1A0921; Fri, 25 Sep 2020 16:44:39 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 1457D1A0917; Fri, 25 Sep 2020 16:44:39 +0200 (CEST) Received: from fsr-ub1864-126.ea.freescale.net (fsr-ub1864-126.ea.freescale.net [10.171.82.212]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id D479A2030E; Fri, 25 Sep 2020 16:44:38 +0200 (CEST) From: Ioana Ciornei To: davem@davemloft.net, netdev@vger.kernel.org Cc: Ionut-robert Aron , Ioana Ciornei Subject: [PATCH net-next 3/3] dpaa2-eth: install a single steering rule when SHARED_FS is enabled Date: Fri, 25 Sep 2020 17:44:21 +0300 Message-Id: <20200925144421.7811-4-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200925144421.7811-1-ioana.ciornei@nxp.com> References: <20200925144421.7811-1-ioana.ciornei@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Ionut-robert Aron 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 Signed-off-by: Ioana Ciornei --- 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,