From patchwork Tue Jan 30 15:24:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 126265 Delivered-To: patch@linaro.org Received: by 10.46.84.92 with SMTP id y28csp3460601ljd; Tue, 30 Jan 2018 07:28:18 -0800 (PST) X-Google-Smtp-Source: AH8x2249wAlfj+GQ3GIIf/6+KhMSbpC+rX3aFoHoBNsLTnuvzO1sR1kEtHFEwx8lJLspPrUKKbg7 X-Received: by 10.223.136.19 with SMTP id d19mr13863535wrd.203.1517326098086; Tue, 30 Jan 2018 07:28:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517326098; cv=none; d=google.com; s=arc-20160816; b=iQ32ETMYU16AXP3mfHZD28crFl4pLjmP37YERHIU5irXaf+JD0gNIH7aj/xqlL1Kt0 IllO4HatWBGNHNxA+ECcV+LyTqN5M3bHBX+1ZUvJRt5uYrGo66cvv0qEsMKJ22gCiGEO mmYGzrwR1xcKsQc2k3C/q8RDrgZmbiYIkzjRFpSxp8UmlTju1nuk6akf8MTI13M92I1X lRE0QphabHRyKHtnOPCHIUW/VxxFfqs3H58VDQDcLhNDfaAj5o5zfclfJsrfBZ+4bbuz t9V6PJPbfMgFsrxIsjOqq5J6a4F76l4GKDnehKJC+Sl6Njn9oKEswoM+nV4rQizqVXhM MlAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:dkim-signature:arc-authentication-results; bh=v4Nf0DaWZC8xA0KFkMXDBjKelrnTpbq0s2ZZ/7z81Qc=; b=DQGhuaH+D5NgXZ4a4r3NBlc7/wjSNJFWnKWBZhMlyUPEuRTFO/IbqdEUXcuFBL6jKh Y9HplrFcwXPUYOWcxrwf8QVK+TY5waaW3/7dwmWUe4VFLOhrVzSORCDu7xlxtvHJ0vNX FENpl0Rumx8bhQb8Ayq/r4uSEUwPBdB2aCbtl0Nylvq04KMD5L0l4do7LmqxD+3NRkw1 bgDAD2U0NfkNnvr60KqLj7IMM1nxIYjPeTS3mtY4aXrv5fmCYR+DaKdL86Bk2CIuEv0y lUPLwX+Y5bF1fhR6lPsm0sHiwXKqF1mNkWAArVjAqaTEag8dhQ0a3butZcdbyZX1uRyO /95g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=fZMGaHUh; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id x10si8022536wmf.165.2018.01.30.07.28.17; Tue, 30 Jan 2018 07:28:18 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=fZMGaHUh; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 23C401B6BA; Tue, 30 Jan 2018 16:26:34 +0100 (CET) Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30063.outbound.protection.outlook.com [40.107.3.63]) by dpdk.org (Postfix) with ESMTP id 4BC3F1B64D for ; Tue, 30 Jan 2018 16:25:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=v4Nf0DaWZC8xA0KFkMXDBjKelrnTpbq0s2ZZ/7z81Qc=; b=fZMGaHUhx7xD6ZjJetErKbUB1s+gv5YB5Nj0U9ufSDiKsk7kxmKqOeLviimIKNk8M+ZgzZssJyrPlXe3Sb+M9ANVn9EQ7avpptbcyrE/+4bWxkRkHMiHynhQQUriii4EJj1vYIffRSxZ4leRdGP8pmYjbN79EBsQAgJOqSHyYtE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; Received: from bf-netperf1.ap.freescale.net (192.88.169.1) by AM3PR04MB0758.eurprd04.prod.outlook.com (2a01:111:e400:883c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.14; Tue, 30 Jan 2018 15:25:36 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Tue, 30 Jan 2018 20:54:09 +0530 Message-Id: <1517325849-12790-1-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517325348-12373-1-git-send-email-hemant.agrawal@nxp.com> References: <1517325348-12373-1-git-send-email-hemant.agrawal@nxp.com> MIME-Version: 1.0 X-Originating-IP: [192.88.169.1] X-ClientProxiedBy: HK2PR04CA0045.apcprd04.prod.outlook.com (2603:1096:202:14::13) To AM3PR04MB0758.eurprd04.prod.outlook.com (2a01:111:e400:883c::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 3ccc2a59-df21-4e8c-b076-08d567f5b6f8 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:AM3PR04MB0758; X-Microsoft-Exchange-Diagnostics: 1; AM3PR04MB0758; 3:5vbENKf3tIxVRyINUOon4NS+DzKMfAerG4nSxMazHU7kYq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yeJCiAK9d4PAPoHfEhSpylPtIzLUe+xiPTvb/ch2dcjwdnYof3UYb29qmf+H06aUMiqk5Ju/13F8lqx0+DE9IFYrxXGLKZpB4fkM3Am3E4DBcJbfJQWIOAITaUTMb8NBsx+v0IwXqOuLBL/KiMt/0iXlPb0d/K05PS1sLbZxsaMDUZy92p8U++k36Fv5xG4ZlUWOMopNCspmf3O/x+/blJ9DQVHFZjJVJ0aIT0oyiGfRf/u/Qi/b57hwo6TugQhhvWar1B2yJpQlk98utDIVW4vPPhZmwpR0EOtRd+MuyF; 4:yq2jne5gVwyl+XbniI+6FrWJOiJVPhW01yamnsks/NW9eefnQfyoxeLTtpiUtXD1soOlu6WFU0SUE+H21cIdISkGGJ3ySUuznCW+ZsD77zZW3QcCRpGjvCpyqT4s18Rg+u12E3DUJUdqLna3PTH/rsXHUkoWSsWD+EwEOVUSQXAgXEaKhZ6pFqKPi7Lk2dasYdqrmLQlPNYX3kQU799O84j1WIBIDt4vXz6rSh/O5RRKqG135tysV2McgC6og+jy76pDOFB6fSQYX67xH+8qtrvMLdbQLQLxbKvLa82z8RLC00ItqsGXPMPjNt6OMWKJqMMTgvlSWDxolTUeiy27x7Mz9cgyLOQYme7KgEYEtX4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231101)(944501161)(10201501046)(3002001)(6055026)(6041288)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(6072148)(201708071742011); SRVR:AM3PR04MB0758; BCL:0; PCL:0; RULEID:; SRVR:AM3PR04MB0758; X-Forefront-PRVS: 0568F32D91 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(376002)(39380400002)(39860400002)(396003)(346002)(199004)(189003)(97736004)(3846002)(53936002)(2950100002)(36756003)(52116002)(86362001)(51416003)(316002)(6916009)(47776003)(66066001)(26005)(6512007)(386003)(6506007)(106356001)(2361001)(6666003)(76176011)(59450400001)(7736002)(5660300001)(16526019)(6486002)(305945005)(4326008)(2351001)(186003)(2906002)(48376002)(81156014)(8676002)(81166006)(16586007)(25786009)(6116002)(68736007)(50466002)(478600001)(50226002)(105586002)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM3PR04MB0758; H:bf-netperf1.ap.freescale.net; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM3PR04MB0758; 23:rOY3LQLjL8N2D8CwxVbhGSlMpGyQegi794QgrQU3d?= 9CxTXqufNvabPAyfVE9CRHLAmjvCEYYT8TBxLRyrexupsn6nQ3xJ0L1xkxQNvtqrU20jcHRYGdk59R4sC3eap3xlIA70gOrRA5LnhSjIg88aTNpNhs90p0nz2/b9CadX3RLztfA+Kd2GrFMj5/MLspEu6G77aBZhKKa18ZiIblr39NS7MEuKIrsCfJ/2/3idy+QZRMGh/4uhnAn/zVmAeL2aa3B4cEzIF5nEke92Rs/GbHJLxjUtvUPz7aWQRAA557KHUWDCiNoYxEt3Z36aBWwkd3s3uaBA2fazOAvbEJawEUyG/lQKLs4hitOwsRw8lUJg/NmQg21CnzC6EHbua1tcYf34vl/DVOwxgYX/dz2NSBd79tSW7YXZl5LHc5rCMkI0tqKT2Q+bLeLclpM1tq+X3OKB4xovHNHHXl2vkgywCPm3sX4u6g+T+EvygxCljkF+OFBM+C2Q8FjkXpBF/vl04zgHW3qRsgIlHiwNNXMS9CGli9RoOE335ovmt6e6AP8yz6YN+MXDeBWpj6akjKU44iGFNr6HzPM6nfBNxCotT2JSDtNok7fdnypECWPm99KxEM5bznKqSkjD0CqmqziXGKyhSMonLqd3QFE4w0U6EgGRz9WWdvdGo/jUZEdayz1woKzqH2PPRC35lem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nRHFOb6kCh32jGcXDwF/pmua+mh3KtwOn2U/qFYxdUYIzQ1s7j6/Dbhb7tqs/Fca12cVmMzJLkAjDKatM=; 7:l7ynaFtQVjVX0mmod4iKE5i6uThmwFVenjCNnhs6JW0G9/lgOBMzWFicuIN9B6jbbGbb7lsIR/jLPFFkdp037ydy/IG3iUk8eO20jHBABKAZMKdkjot8raOTeoPSQ6LARwvq3nNuPqq+YuDLYPYRc6f0JPVcbi8n1ehbpf4OhhFDK+0QeGSUoVWgA4ss2rZpRm822Tap6xNpF6UQamBKjPC8lZSf20cuO3+2DIIcCriHCQvWxyirpHNFoJTbVamU SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2018 15:25:36.4380 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3ccc2a59-df21-4e8c-b076-08d567f5b6f8 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR04MB0758 Subject: [dpdk-dev] [PATCH v2] net/dpaa2: fix the err with testpmd in Tx only mode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Fixes: 043b36f621dd ("net/dpaa2: support more than 16 burst size in Rx") Signed-off-by: Hemant Agrawal --- v2: fix checkpatch warning * This patch is applicable over net-next tree* drivers/net/dpaa2/dpaa2_rxtx.c | 126 +++++++++++------------------------------ 1 file changed, 33 insertions(+), 93 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index 3d45669..dc3c3a6 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -473,10 +473,10 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) { /* Function receive frames for a given device and VQ*/ struct dpaa2_queue *dpaa2_q = (struct dpaa2_queue *)queue; - struct qbman_result *dq_storage, *dq_storage1 = 0; + struct qbman_result *dq_storage, *dq_storage1 = NULL; uint32_t fqid = dpaa2_q->fqid; - int ret, num_rx = 0, next_pull = 0, num_pulled, num_to_pull; - uint8_t pending, is_repeat, status; + int ret, num_rx = 0; + uint8_t pending, status; struct qbman_swp *swp; const struct qbman_fd *fd, *next_fd; struct qbman_pull_desc pulldesc; @@ -491,19 +491,6 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) } } swp = DPAA2_PER_LCORE_PORTAL; - - /* if the original request for this q was from another portal */ - if (unlikely(DPAA2_PER_LCORE_DPIO->index != - q_storage->active_dpio_id)) { - if (check_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index)) { - while (!qbman_check_command_complete(get_swp_active_dqs - (DPAA2_PER_LCORE_DPIO->index))) - ; - clear_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index); - } - q_storage->active_dpio_id = DPAA2_PER_LCORE_DPIO->index; - } - if (unlikely(!q_storage->active_dqs)) { q_storage->toggle = 0; dq_storage = q_storage->dq_storage[q_storage->toggle]; @@ -515,27 +502,41 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) qbman_pull_desc_set_fq(&pulldesc, fqid); qbman_pull_desc_set_storage(&pulldesc, dq_storage, (dma_addr_t)(DPAA2_VADDR_TO_IOVA(dq_storage)), 1); + if (check_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index)) { + while (!qbman_check_command_complete( + get_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index))) + ; + clear_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index); + } while (1) { if (qbman_swp_pull(swp, &pulldesc)) { - PMD_RX_LOG(WARNING, - "VDQ command not issued.QBMAN busy\n"); + PMD_RX_LOG(WARNING, "VDQ command is not issued." + "QBMAN is busy\n"); /* Portal was busy, try again */ continue; } break; } q_storage->active_dqs = dq_storage; + q_storage->active_dpio_id = DPAA2_PER_LCORE_DPIO->index; set_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index, dq_storage); } - /* pkt to pull in current pull request */ - num_to_pull = q_storage->last_num_pkts; + dq_storage = q_storage->active_dqs; + rte_prefetch0((void *)((uint64_t)(dq_storage))); + rte_prefetch0((void *)((uint64_t)(dq_storage + 1))); - /* Number of packet requested is more than current pull request */ - if (nb_pkts > num_to_pull) - next_pull = nb_pkts - num_to_pull; + /* Prepare next pull descriptor. This will give space for the + * prefething done on DQRR entries + */ + q_storage->toggle ^= 1; + dq_storage1 = q_storage->dq_storage[q_storage->toggle]; + qbman_pull_desc_clear(&pulldesc); + qbman_pull_desc_set_numframes(&pulldesc, DPAA2_DQRR_RING_SIZE); + qbman_pull_desc_set_fq(&pulldesc, fqid); + qbman_pull_desc_set_storage(&pulldesc, dq_storage1, + (dma_addr_t)(DPAA2_VADDR_TO_IOVA(dq_storage1)), 1); - dq_storage = q_storage->active_dqs; /* Check if the previous issued command is completed. * Also seems like the SWP is shared between the Ethernet Driver * and the SEC driver. @@ -545,45 +546,6 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) if (dq_storage == get_swp_active_dqs(q_storage->active_dpio_id)) clear_swp_active_dqs(q_storage->active_dpio_id); -repeat: - is_repeat = 0; - - /* issue the deq command one more time to get another set of packets */ - if (next_pull) { - q_storage->toggle ^= 1; - dq_storage1 = q_storage->dq_storage[q_storage->toggle]; - qbman_pull_desc_clear(&pulldesc); - - if (next_pull > DPAA2_DQRR_RING_SIZE) { - qbman_pull_desc_set_numframes(&pulldesc, - DPAA2_DQRR_RING_SIZE); - next_pull = next_pull - DPAA2_DQRR_RING_SIZE; - q_storage->last_num_pkts = DPAA2_DQRR_RING_SIZE; - } else { - qbman_pull_desc_set_numframes(&pulldesc, next_pull); - q_storage->last_num_pkts = next_pull; - next_pull = 0; - } - qbman_pull_desc_set_fq(&pulldesc, fqid); - qbman_pull_desc_set_storage(&pulldesc, dq_storage1, - (dma_addr_t)(DPAA2_VADDR_TO_IOVA(dq_storage1)), 1); - while (1) { - if (qbman_swp_pull(swp, &pulldesc)) { - PMD_RX_LOG(WARNING, - "VDQ command not issued.QBMAN busy\n"); - /* Portal was busy, try again */ - continue; - } - break; - } - is_repeat = 1; - q_storage->active_dqs = dq_storage1; - set_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index, dq_storage1); - } - - rte_prefetch0((void *)((uint64_t)(dq_storage + 1))); - - num_pulled = 0; pending = 1; do { @@ -621,36 +583,14 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) dq_storage++; num_rx++; - num_pulled++; } while (pending); - /* Another VDQ request pending and this request returned full */ - if (is_repeat) { - /* all packets pulled from this pull request */ - if (num_pulled == num_to_pull) { - /* pkt to pull in current pull request */ - num_to_pull = q_storage->last_num_pkts; - - dq_storage = dq_storage1; - - while (!qbman_check_command_complete(dq_storage)) - ; - goto repeat; - } else { - /* if this request did not returned all pkts */ - goto next_time; - } + if (check_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index)) { + while (!qbman_check_command_complete( + get_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index))) + ; + clear_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index); } - - q_storage->toggle ^= 1; - dq_storage = q_storage->dq_storage[q_storage->toggle]; - q_storage->last_num_pkts = (nb_pkts > DPAA2_DQRR_RING_SIZE) ? - DPAA2_DQRR_RING_SIZE : nb_pkts; - qbman_pull_desc_clear(&pulldesc); - qbman_pull_desc_set_numframes(&pulldesc, q_storage->last_num_pkts); - qbman_pull_desc_set_fq(&pulldesc, fqid); - qbman_pull_desc_set_storage(&pulldesc, dq_storage, - (dma_addr_t)(DPAA2_VADDR_TO_IOVA(dq_storage)), 1); /* issue a volatile dequeue command for next pull */ while (1) { if (qbman_swp_pull(swp, &pulldesc)) { @@ -660,10 +600,10 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) } break; } - q_storage->active_dqs = dq_storage; - set_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index, dq_storage); + q_storage->active_dqs = dq_storage1; + q_storage->active_dpio_id = DPAA2_PER_LCORE_DPIO->index; + set_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index, dq_storage1); -next_time: dpaa2_q->rx_pkts += num_rx; return num_rx;