From patchwork Thu Jun 11 09:03:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar Kushwaha X-Patchwork-Id: 483016 X-Patchwork-Delegate: yorksun@freescale.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 1DEE814028E for ; Thu, 11 Jun 2015 19:06:04 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A74294B670; Thu, 11 Jun 2015 11:05:28 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ev-D136GP10d; Thu, 11 Jun 2015 11:05:28 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CA22C4B6DC; Thu, 11 Jun 2015 11:05:07 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 38B424B672 for ; Thu, 11 Jun 2015 11:05:01 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iM1xm10M5Qxp for ; Thu, 11 Jun 2015 11:05:01 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0131.outbound.protection.outlook.com [157.56.111.131]) by theia.denx.de (Postfix) with ESMTPS id 0D5B04B6DB for ; Thu, 11 Jun 2015 11:04:37 +0200 (CEST) Received: from CH1PR03CA005.namprd03.prod.outlook.com (10.255.156.150) by BLUPR03MB149.namprd03.prod.outlook.com (10.255.212.17) with Microsoft SMTP Server (TLS) id 15.1.184.17; Thu, 11 Jun 2015 09:04:36 +0000 Received: from BL2FFO11FD016.protection.gbl (10.255.156.132) by CH1PR03CA005.outlook.office365.com (10.255.156.150) with Microsoft SMTP Server (TLS) id 15.1.172.22 via Frontend Transport; Thu, 11 Jun 2015 09:04:35 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD016.mail.protection.outlook.com (10.173.160.224) with Microsoft SMTP Server (TLS) id 15.1.190.9 via Frontend Transport; Thu, 11 Jun 2015 09:04:35 +0000 Received: from b32579-VirtualBox.ap.freescale.net ([10.232.28.97]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id t5B93COp001675; Thu, 11 Jun 2015 02:04:32 -0700 From: Prabhakar Kushwaha To: Date: Thu, 11 Jun 2015 14:33:07 +0530 Message-ID: <1434013388-26605-13-git-send-email-prabhakar@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1434013388-26605-1-git-send-email-prabhakar@freescale.com> References: <1434013388-26605-1-git-send-email-prabhakar@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD016; 1:jmQv4tq8rhLgvUel7rdm9Ce3fTbz8fUQ0HanLfqU6cnfYsfB/owDlGsDiFCrxJGPLTOCDqOGCtHGweQdavU/GQipwWeJuPv+Emkp0bSdc+Qkyl6Y/O5WI1l21afB5ACPQ3Sk9oFmFTYxOSaf2CTw1Ed4NW8VpTuCwNGnNlYy3s0wRN5u1pbR0uHXTquEykQ2dX7OEQyqbw32mcw7a8IOA/xafyEomG5WPJeMNBYyJYs+u6pWXXt4/7+qryj3OVB3A0pi9VF0kp1oSydHVCnd7h6+r4P1Jcdc3/Pq9/1F+SjGKuwvhC5zA+XZNaOE4YAFXTMjIKSGjBgm27j+CXYVLDOeUJK5aCLOC13rM5efRBA= X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(339900001)(189002)(199003)(86362001)(47776003)(105606002)(77156002)(62966003)(450100001)(87936001)(46102003)(36756003)(48376002)(110136002)(107886002)(189998001)(5001960100002)(6806004)(5001920100001)(2950100001)(106466001)(19580395003)(92566002)(33646002)(19580405001)(104016003)(50986999)(76176999)(50466002)(50226001)(229853001)(77096005)(85426001)(2351001)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR03MB149; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB149; 2:PnAgxi43/Z6HhGPEGQjjAiLk65K3SD1XIvTMlFtQI7DWKMOs6b1BN+nbOLWe2nSp; 2:/fJr846WcmIUng8KZK4IwgXIMPvco5RuN8f/ko4a8Rmm0D+xff5djiPnOFg0LfY8ZUm9RGysJgJ/6NOnPusoAwajBYHEaGI3IyVza9SU8zAYn9KnmsuN0MSy0oyPbMc4F+HWFrJGB3HviA31vGe7obObHOBGbqqj6jEjrO7ogXhIJR0PtVcbjEJGTluy7io7h7tfhJsDbNJ7klFqx0QEVLIL4msIGJCic+EF3Z3tmh0=; 6:x+Cs5MJrqPiT/SUdd2suYxl+Lue1TCqMGG7Qs+sJ9jnHSMv3JZLjQNU+h6zQOu8QMMAA+bVw+aMmyVUKOHexfT1IdwWAps0gEZSSZ0NC6iaRiboZaCNgIcunySiDB7aYgx07zTR6JgMl3DfvzKbaOcowJ8CDTWxEsccap2TUDPx0KU/7ZMlQcupNqxlYel14W+UAWckQSH9d/X1UGSrwTIlqd/wV2eaYbFPy4MYxcIKaDeq4fEAC2ZhBEGEf4rC6+g40UCMw6r3iRoOnmSqdlGnbiZSOrLP2L7aS7Tvlxn/7LEiu6u21tTnutUUXIwkmyUyzJ7C0kF68zWVmx1Fxuw==; 3:Luc729Vt00kaJZqFoiL3VRdkotayvIaXlfNFDU5uE+YohcGbtuvhlORXPyWUR60WVYZNKpmpbIFt6CCDowBnREb2cUKqPgabfPDLlnJeBpkS22kSt62qDZGwav6enQ9ertx6ZYq9psc+SDW3PxNh5uVg3hKVdG7RO/HiVyQ+NViCLJu6NF+AqiMkhLS0nLsIt0z7nICfP+w9N6E9GjZRM2f16rfmoHOvhmlryOn8Xe/PwvgjjpsU815uqbly8n8Wc8LzRafQG5zdKr4CpyHkP/mzo/XXz84pE+vlR8noIuw2kyLl3jpycDXCLw/BouyN X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB149; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(520003)(5005006)(3002001); SRVR:BLUPR03MB149; BCL:0; PCL:0; RULEID:; SRVR:BLUPR03MB149; X-Forefront-PRVS: 0604AFA86B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR03MB149; 9:F7AU8mAj2N/pema3edoDnypJxIZXiHfKs5wIVQsVCBG?= =?us-ascii?Q?6/RhkZ1Bm3HkXAjfch1zHJ7vvyCFYHYnLPc5cSQSz7l2L2C3xE3Ebj1FPbJg?= =?us-ascii?Q?GBMfJ0xfoTe2ryqxwJ7KY2PFjCpTLvYIPV6INN8QnUracvEHNapzQOwnif5y?= =?us-ascii?Q?z7LXKAAaoLVeYs3l8lxBsACDNkSGlQmLq1G+DlzyfGilteMHLfoOzFRQseIA?= =?us-ascii?Q?3MMrpJlanK297hirtB/DzoOB0ETq2Qfn1owyPZCG52usbtMe3vq69I6InhaA?= =?us-ascii?Q?JZFJfJf5obQUkWJZngFZRcstLOcMTQ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pFtpdlvRtwU9wJzhAYw/gmC9L5gG94U8AEkTT/y9k3fmmAoBLn5fcQ=; 6:593q5gf5EBKzzs3fSTVLd6nCx+U11RIKfKTF6aPtXDMUanuarJG6YDe78Rs1ScDG X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2015 09:04:35.0770 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB149 Cc: yorksun@freescale.com Subject: [U-Boot] [PATCH 13/14][v2] driver/ldpaa_eth: Avoid TX conf frames X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Polling of TX conf frames is not a mandatory option. Packets can be transferred via WRIOP without TX conf frame. Configure ldpaa_eth driver to use TX path without confirmation frame Signed-off-by: Prabhakar Kushwaha Acked-by: Joe Hershberger --- Changes for v2: Sending as it is for patchset drivers/net/ldpaa_eth/ldpaa_eth.c | 114 ++------------------------------------ drivers/net/ldpaa_eth/ldpaa_eth.h | 1 - 2 files changed, 4 insertions(+), 111 deletions(-) diff --git a/drivers/net/ldpaa_eth/ldpaa_eth.c b/drivers/net/ldpaa_eth/ldpaa_eth.c index adb964c..839e78a 100644 --- a/drivers/net/ldpaa_eth/ldpaa_eth.c +++ b/drivers/net/ldpaa_eth/ldpaa_eth.c @@ -112,7 +112,7 @@ static int ldpaa_eth_pull_dequeue_rx(struct eth_device *dev) debug("No frame delivered\n"); qbman_swp_dqrr_consume(swp, dq); - break; + continue; } fd = ldpaa_dq_fd(dq); @@ -131,98 +131,6 @@ static int ldpaa_eth_pull_dequeue_rx(struct eth_device *dev) return err; } -static void ldpaa_eth_tx_conf(struct ldpaa_eth_priv *priv, - const struct dpaa_fd *fd) -{ - uint64_t fd_addr; - struct ldpaa_fas *fas; - uint32_t status, err; - struct qbman_release_desc releasedesc; - struct qbman_swp *swp = dflt_dpio->sw_portal; - - fd_addr = ldpaa_fd_get_addr(fd); - - - debug("TX Conf frame:data addr=0x%p\n", (u64 *)fd_addr); - - /* Check the status from the Frame Annotation */ - if (fd->simple.frc & LDPAA_FD_FRC_FASV) { - fas = (struct ldpaa_fas *) - ((uint8_t *)(fd_addr) + - priv->buf_layout.private_data_size); - status = le32_to_cpu(fas->status); - if (status & LDPAA_ETH_TXCONF_ERR_MASK) { - printf("TxConf frame error(s): 0x%08x\n", - status & LDPAA_ETH_TXCONF_ERR_MASK); - } - } - - flush_dcache_range(fd_addr, fd_addr + LDPAA_ETH_RX_BUFFER_SIZE); - qbman_release_desc_clear(&releasedesc); - qbman_release_desc_set_bpid(&releasedesc, dflt_dpbp->dpbp_attr.bpid); - do { - /* Release buffer into the QBMAN */ - err = qbman_swp_release(swp, &releasedesc, &fd_addr, 1); - } while (err == -EBUSY); -} - -static int ldpaa_eth_pull_dequeue_tx_conf(struct ldpaa_eth_priv *priv) -{ - const struct ldpaa_dq *dq; - const struct dpaa_fd *fd; - int err = 0; - int i = 5, status; - u32 timeo = (CONFIG_SYS_HZ * 10) / 1000; - u32 time_start; - static struct qbman_pull_desc pulldesc; - struct qbman_swp *swp = dflt_dpio->sw_portal; - - while (--i) { - qbman_pull_desc_clear(&pulldesc); - qbman_pull_desc_set_numframes(&pulldesc, 1); - qbman_pull_desc_set_fq(&pulldesc, priv->tx_conf_fqid); - - err = qbman_swp_pull(swp, &pulldesc); - if (err < 0) { - printf("Dequeue TX conf frames error:0x%08x\n", err); - continue; - } - - time_start = get_timer(0); - - do { - dq = qbman_swp_dqrr_next(swp); - } while (get_timer(time_start) < timeo && !dq); - - if (dq) { - /* Check for valid frame. If not sent a consume - * confirmation to QBMAN otherwise give it to NADK - * application and then send consume confirmation to - * QBMAN. - */ - status = (uint8_t)ldpaa_dq_flags(dq); - if ((status & LDPAA_DQ_STAT_VALIDFRAME) == 0) { - debug("Dequeue TX conf frames:"); - debug("No frame is delivered\n"); - - qbman_swp_dqrr_consume(swp, dq); - break; - } - fd = ldpaa_dq_fd(dq); - - ldpaa_eth_tx_conf(priv, fd); - qbman_swp_dqrr_consume(swp, dq); - break; - } else { - err = -1; - debug("No DQRR entries\n"); - break; - } - } - - return err; -} - static int ldpaa_eth_tx(struct eth_device *net_dev, void *buf, int len) { struct ldpaa_eth_priv *priv = (struct ldpaa_eth_priv *)net_dev->priv; @@ -282,12 +190,6 @@ static int ldpaa_eth_tx(struct eth_device *net_dev, void *buf, int len) if (err < 0) goto error; - mdelay(1); - - err = ldpaa_eth_pull_dequeue_tx_conf(priv); - if (err < 0) - printf("error Tx Conf frame\n"); - return err; error: @@ -305,7 +207,6 @@ static int ldpaa_eth_open(struct eth_device *net_dev, bd_t *bd) { struct ldpaa_eth_priv *priv = (struct ldpaa_eth_priv *)net_dev->priv; struct dpni_queue_attr rx_queue_attr; - struct dpni_tx_flow_attr tx_flow_attr; uint8_t mac_addr[6]; int err; @@ -376,21 +277,11 @@ static int ldpaa_eth_open(struct eth_device *net_dev, bd_t *bd) goto err_qdid; } - err = dpni_get_tx_flow(dflt_mc_io, priv->dpni_handle, priv->tx_flow_id, - &tx_flow_attr); - if (err) { - printf("dpni_get_tx_flow() failed\n"); - goto err_tx_flow; - } - - priv->tx_conf_fqid = tx_flow_attr.conf_err_attr.queue_attr.fqid; - if (!priv->phydev->link) printf("%s: No link.\n", priv->phydev->dev->name); return priv->phydev->link ? 0 : -1; -err_tx_flow: err_qdid: err_rx_flow: dpni_disable(dflt_mc_io, priv->dpni_handle); @@ -657,6 +548,9 @@ static int ldpaa_dpni_bind(struct ldpaa_eth_priv *priv) priv->tx_flow_id = DPNI_NEW_FLOW_ID; memset(&dflt_tx_flow, 0, sizeof(dflt_tx_flow)); + dflt_tx_flow.options = DPNI_TX_FLOW_OPT_ONLY_TX_ERROR; + dflt_tx_flow.conf_err_cfg.use_default_queue = 0; + dflt_tx_flow.conf_err_cfg.errors_only = 1; err = dpni_set_tx_flow(dflt_mc_io, priv->dpni_handle, &priv->tx_flow_id, &dflt_tx_flow); if (err) { diff --git a/drivers/net/ldpaa_eth/ldpaa_eth.h b/drivers/net/ldpaa_eth/ldpaa_eth.h index 3107ab6..b4ef700 100644 --- a/drivers/net/ldpaa_eth/ldpaa_eth.h +++ b/drivers/net/ldpaa_eth/ldpaa_eth.h @@ -128,7 +128,6 @@ struct ldpaa_eth_priv { uint32_t rx_dflt_fqid; uint16_t tx_qdid; - uint32_t tx_conf_fqid; uint16_t tx_flow_id; enum ldpaa_eth_type type; /* 1G or 10G ethernet */