From patchwork Tue Jan 30 15:15:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 126257 Delivered-To: patch@linaro.org Received: by 10.46.84.92 with SMTP id y28csp3452269ljd; Tue, 30 Jan 2018 07:17:21 -0800 (PST) X-Google-Smtp-Source: AH8x2251SAa/X/fqTWIUgkXnOR/cl/xmXY1dVpHOK6299AnOJ4Lezx+CiSGbmqVCYI7+R8xkcZci X-Received: by 10.28.129.212 with SMTP id c203mr20176152wmd.98.1517325441439; Tue, 30 Jan 2018 07:17:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517325441; cv=none; d=google.com; s=arc-20160816; b=hdxrRSnLOpmM8OcMt++P1oBeDIOZygV8Mx1WEsKN3epghluxSrUblh6EZVRoZyzPYj ZdF3zOsApP6v+Sh0c+BS+HUTYgVgwAwp8QMlCsXeqYXW2Kekk3E2+8hB/SqZRDFBAq88 NYSUlxqrt9qR/IPTQdyEffb1Jrxbp6mugL1LUO23PPL2RMmRgc/sdx5FI9HZWrWYJwnL Jga1WH0ErgpTKv11lxkcZjbqo5GkAD9jYQJzqklKnx/qsDj1fbP79bkdwBU6vyyjF562 l6VZRGx/gjHrZmnDH41cKyjuAlxo+83yyNFvXKDNO+BnVeRNCrBE5PyMwwx+tJD8vFjK ZLcA== 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:message-id:date:cc:to:from :dkim-signature:arc-authentication-results; bh=chWiiTTtCelPJC8vokp9rRPzYqTqjPFt2O9yMVYCpGo=; b=U3/p8AlVTc0J4N11U7azafl2qgP0sup1XOJzrrp1yOY7l00nonILSM7ouitUyBybAz DIuV1XYNEQpM2xkMbLBVuWoXCK8LUdavLjHPcHPKeUJTtHyZs602elXupx1rAtPVU+5q lmpBGacNyorrtvq3zFnM3VLTTUAJ7s4Jg0hLHTTIl4GH3i6u3oAT5lwBlYm6YgZpoau9 S0wtQM5LqKD/LfI2kDGNePm5I428GYeDPux15mnijLUgY144ndfs/wXOvi+ey+8+aA1H 0VzFuQ8muaNoGBgosqf2fC7IoHCbNGv7Ua5M1dQMj2l2rwcez5I5eVQCSDN2gBQuLOHk OILg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=mLhEiqJZ; 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 s13si11591325wrf.380.2018.01.30.07.17.21; Tue, 30 Jan 2018 07:17:21 -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=mLhEiqJZ; 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 A0EDE1B63A; Tue, 30 Jan 2018 16:17:20 +0100 (CET) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0062.outbound.protection.outlook.com [104.47.2.62]) by dpdk.org (Postfix) with ESMTP id DA5501B635 for ; Tue, 30 Jan 2018 16:17:19 +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=chWiiTTtCelPJC8vokp9rRPzYqTqjPFt2O9yMVYCpGo=; b=mLhEiqJZRJrugA9jkMryfEyIOY8fo0IMfYyOxDRskyobm6NAVuZz3aIbWW42d6CqWX+TDf/j1p1mhIOZaygSxeXS4YdiPQwyARXAKCQF4QnAz0QxNmMsx2q0xywF+jAcdDD4UIpfNaZcLWmEhH6yUbtP4N0QzK5VbkgH+gfNPUQ= 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 DB3PR04MB0762.eurprd04.prod.outlook.com (2a01:111:e400:9440::25) 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:17:16 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Tue, 30 Jan 2018 20:45:48 +0530 Message-Id: <1517325348-12373-1-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [192.88.169.1] X-ClientProxiedBy: PN1PR0101CA0032.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:c::18) To DB3PR04MB0762.eurprd04.prod.outlook.com (2a01:111:e400:9440::25) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c8b49f04-349c-4fae-1882-08d567f48cc3 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:DB3PR04MB0762; X-Microsoft-Exchange-Diagnostics: 1; DB3PR04MB0762; 3:TR8hvtyk72SyVbocnYKL+sCnI+pcMwRAqxeRE306s2w1bDd9SoEUUmnqPMAE6lGnyjMzg6E0CsBufXlQsb8rHkz+bgVySm4F9oZ+akg5LfgGlr2dnbRF1ATgIwBiwQbE3nadSTYWQY40Fxe6SBItaJTO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8ZCF5fS0ZjrSnLJMMZMLiF0mf901MMx2D10ZPFvPLh0fPnDTnKFE9aDUyK57oLkcTVVoKzX2Mr5tlUJCK2rbxRGslMpxOUhKZPK+Nt16qhLjjRxxE1DOiVraMwYz4JqSpJTX6/oHGBdpsRSYNkFP7t74MrlVmKpgMXFsKLH2tvzlALg4xE9hTQV0; 4:oD7Znuvi8+KpMvfCF7wvr+8G4f+1+bXUOqR0remA9rZOwtgbRzBHR7Tp275l5N//YQ9oaZ0hoVoIteXFOlZFZr0FnHguaiw0pxmrFzIACtb8MwPZ3osEz07qo0Rh4XNrkw3ufeuTevaYnThr3QMEs+KQ3fbiVqUqpvF/NLS/EGUzLYPK/hNZay0DKwCFaLphOx6GsN2NULyQGZBcOoJ6PakxOXDdDfBG4kYwQ5kD5z5gRfw1aOU8fW88DQfX6Y9BloCdZ7TvJbsD3LKMWXvkJnlKcFsNj+ug1MBYy7DQ+4yomg9MZnOgSI5PD2vtyNcpXiy6vi9Yd3Jr/8rGwxgKz/jabF4zEnfLxVEuo2EMXY8= 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)(5005006)(8121501046)(10201501046)(3231101)(944501161)(93006095)(93001095)(3002001)(6055026)(6041288)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:DB3PR04MB0762; BCL:0; PCL:0; RULEID:; SRVR:DB3PR04MB0762; X-Forefront-PRVS: 0568F32D91 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(39860400002)(376002)(39380400002)(396003)(346002)(189003)(199004)(53936002)(50226002)(48376002)(4326008)(5660300001)(8936002)(50466002)(25786009)(186003)(81166006)(386003)(51416003)(6506007)(6666003)(6916009)(6512007)(52116002)(106356001)(59450400001)(2361001)(6486002)(2351001)(81156014)(3846002)(7736002)(68736007)(8676002)(305945005)(16586007)(47776003)(86362001)(6116002)(26005)(105586002)(66066001)(2906002)(478600001)(316002)(36756003)(97736004)(16526019); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR04MB0762; H:bf-netperf1.ap.freescale.net; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; DB3PR04MB0762; 23:Yc7+i5R2wwQhVeJ/+7GqlJA+K1AJS/DAvUwBHefuI?= Ifij+rDtYl1a+tNOmycLfglqbuLHiz7mHS+0X2bVmXcYFDuKSieLVb1xJEagGEPgnv3G4rZU34wkzbL8uCJEoz1J54uEbRM9ZUZRGs8XQ0jfd6HJ+H85tBlxCZJ/UJMCz8sXRK9coZdxJKJJpTQJhkScsF+FAB2+XTbRL57MdlIGBhfOUdGeslse+jZ0puWiu6078IGd5C47o8RMQFbiJAQEEhEDDTj4LqWpChX4aCFf1MM2C/ZJPCKZ0zPMva64SwjNpPRD0iQ7PUA2msUmsGERwK0xJSx0qNIjsqM4mHIAxLpCAwIH64zHnJNdLVHuL7LYtseoMGrl+tEWTmCJTb2BhQM8+QY6gRWRYxN8K6DGiwZ3LMi3EzfysZ96LvobI/W+ywgXJXCGkHp/m1NApyXeE/fNfDqOUCBP6KVv64Qy2dofKTWDNTU9hvj5U86DJQ4zyopur/0iDZGBv5C8gKiKEYTe7wrtmk7zVoN+ML7N5WBxlqVIC1XfAL6PTqQ/fT2N3gHdZoo7PFmZFkQAjavYcAibjZlm10L7dDEYxynbH/0tui44f53lRglFjncQtO1nZjU8tHkhUz+8v/6F3Z90ep2xRu7KxboUq5epHDRfeRd07G4ETptmMrvg4eTgiWHOC79niB7o2CBL5JLb3dUab10ULSEUuopgQx811L93AYwyuM1L27FX1q3uFLWVWcepy+JZ07q8b8ark/kM1Gu1ZAaRnfUTUGJVJfuUczxzwkZUqA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9Q/WbwK2bIBJ4XPSFiuMrzVQcfWqpce1nTLvOeH8DSfgvyqvrzEJVpNFjt0J0m/jxl6s0UlfuYoj5xx3s0dLjTWH8vvMmKkdMn3xQPCRUMHwbUv86uRCWsQP5NoCqPa34U0tnQGn10vqX0LyriMuh12smyA5d4IdvAhClnqtSRgKDmVsJ1arFxwKtUlLE9gNCS09GCcR8zsqrCio1 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2018 15:17:16.7663 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c8b49f04-349c-4fae-1882-08d567f48cc3 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR04MB0762 Subject: [dpdk-dev] [PATCH] 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 --- *This patch is applicable on top of next-net* 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..46d633f 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;