From patchwork Wed Dec 13 12:05:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 121739 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5382247qgn; Wed, 13 Dec 2017 04:07:09 -0800 (PST) X-Google-Smtp-Source: ACJfBoux3Ku9VdveyW0NVj2NbAz22i1dYDopG7pWa43rcKxJbBv1xNN+5MW7Q9RfcH1Jw9ye+LQy X-Received: by 10.28.7.200 with SMTP id 191mr1666459wmh.4.1513166829088; Wed, 13 Dec 2017 04:07:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513166829; cv=none; d=google.com; s=arc-20160816; b=Pfe5k4awgcxfGt2NIgW9WD5UqDrJYqT4KftAvVPrdOhVUjlPBabSjVzaE7qVW4d9J9 0aViyQsZ6ziKQ+Z1YK0mHoipkQmeNiXdOOvM7LnNy65BrMmhYNkF6jutkUQRAullrtDv OejgRmd8hoa4Kf1sl8x81Hz1GfAsA6ngbFDkTNn8vDnMf0txsUsV06DIUXQZ0NpbcaTm iULPAyZvTDPsnO7AjX5YE1zflZaH3j2CSUGaS8A6FRAagTKJD/4xPfw4aB0HroIz0Zap n/dcaHdMrqKRM5Tf19rIvVDYR6OR9llsJdihmKy9enbWQQMHKl0I5OaGuz/pEsp+hPN1 OVIA== 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:arc-authentication-results; bh=1lwIoBpMo2uLqz5Kn2gV3M9xyFKwIqFF5SJEA1A+5eI=; b=WeuYJhnHjpM1D7z16nDpzHPpHQCEKQ+7wpI004TjluFsALMeVPOWd9W1XjM2mJgC86 aDa7yTtitR6TM1zrP/58efgjIRNgzy3BoYAmQ0uyJppUJ6TXFuuuztDyYHoZEj0JQPBX UziJCBVT+j7BYWJ+aqrEuLrvcn9YuN2gVMzQQai0Gm4o/sRTexboeBnZLHTf5HNUgaAQ B1fdFGRBI5KBDzl6iHdTMoXRUeyMAo2FnXliHX9N+s7LWJnUo0kuiiJTRNdM353ey3rA piyOqda20oU0ocf6rxvA+9Qzk5yA7eC2SA1iOAO6YzKxmB20Kj1mQ1IJLiNvAqUaNcJE w1dw== ARC-Authentication-Results: i=1; mx.google.com; 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 i6si1211581wmg.66.2017.12.13.04.07.08; Wed, 13 Dec 2017 04:07:09 -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; 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 4A447325B; Wed, 13 Dec 2017 13:07:03 +0100 (CET) Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0050.outbound.protection.outlook.com [104.47.33.50]) by dpdk.org (Postfix) with ESMTP id 27D322030; Wed, 13 Dec 2017 13:07:00 +0100 (CET) Received: from BN3PR03CA0070.namprd03.prod.outlook.com (10.167.1.158) by CY4PR03MB2694.namprd03.prod.outlook.com (10.173.43.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 12:06:59 +0000 Received: from BY2FFO11FD046.protection.gbl (2a01:111:f400:7c0c::163) by BN3PR03CA0070.outlook.office365.com (2a01:111:e400:7a4d::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Wed, 13 Dec 2017 12:06:59 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.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 BY2FFO11FD046.mail.protection.outlook.com (10.1.15.170) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Wed, 13 Dec 2017 12:06:52 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vBDC6t9L008652; Wed, 13 Dec 2017 05:06:57 -0700 From: Hemant Agrawal To: CC: , Date: Wed, 13 Dec 2017 17:35:42 +0530 Message-ID: <1513166759-13466-2-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131576404127857712; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(7966004)(376002)(39860400002)(346002)(39380400002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(4326008)(6916009)(8936002)(53936002)(76176011)(305945005)(2950100002)(68736007)(356003)(50226002)(81156014)(5660300001)(51416003)(6666003)(85426001)(81166006)(97736004)(77096006)(47776003)(105606002)(106466001)(86362001)(8676002)(54906003)(2906002)(2351001)(16586007)(498600001)(50466002)(36756003)(48376002)(104016004)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2694; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD046; 1:ZM54NT3xEy/iIyAXsABzzs/41noiGdZKU7vpH1SnkPwtp7BdWLP57/9I/IhAOLepspQovlLl/+KAM1ssN1UvUNdR5CP1F36bqfL2DiOi002h6S5KSmeYngTJkQJkdTtI MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 40bef9e2-b075-49aa-3c30-08d54221ff54 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:CY4PR03MB2694; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2694; 3:fHK3bucp3VFDL0GTiUwUaT9ahppVa8A4+txRcgkBaihfzVCE5LQXotaOqY9nJbPmf4GRa7tiLw97i2t1Swpbz7NhQQLV5GcAhFDJ2+m+r+h0ap9A5g4Z6Uz65mrRPTxBIIgw0FH5BCaFTqAwM1trlf+pra9uoDiW5D6PikyF6iEelawRnntHqLr/wk554Ja67i1VQB+Xy9mT+gJJUDsWBYlSwygUcTYTbWhJWfJOlwG5YzoA4/eBcqUk1/l9IyE30hHq5UkjF/PkJy5AWNZIvoopFFRkJlJCjF5C7//eA4jIjyvx4ytYjpAW7t8gfBIE13IwKlvc6Uoq0qfjc/PRKmKG2uI49jxaC6TbnX9RYcU=; 25:mNtdD8B4DDZcNJH8/F9/rj7ydgbe0V1n63HVbhKlEHl0pDBrqg5T6xRK6R5nfvDpO1PE0TWwKwwbBFaUUX0K+evmpzdTfI0bM85+Qshj8Dkp9pjbmcdJ+BHhxds6Ld/t9xMh6bp2J6D9WScCGwTU2FA2cX1BuzQ+72V9RgYvXXiTc8tW+c9uqoqj3c1N0RCGg1PGI8h/yMwNfgS4qx97dBkyb02X7Z6aSq/GM3RXVKntOsHsl68xzHqrT8FgTqbB0xxX0BlVR01U45wCzUHmTwTc7tDSFfNjlnz9VXqS37BnV+Ip2rimjm3rVYv2c2EpPx3UGIXIiI3/tYJjBnHToQ== X-MS-TrafficTypeDiagnostic: CY4PR03MB2694: X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2694; 31:xdnXmS/ebpV3OP2uoVFvfqEHULBi8JNlRNq4CrxvIKCk0ZBReUJjDF8P/UHUUZd8vBmghSEHmH1VZQ6mlXuWVupa9/gtP7lyfwOwELZ7/UqSXJe3HSJBMGW0V5rI8r4+jrqYwrKNA/S+KeEUuzUTfqjH7jAWxrIAJfDRDFHw+2Q31gwA/QkRr+m8oy5ks4Knfu/hu46z3CXTfszTAb+MAxyC7/HVeK3f1RwfnlORyFk=; 4:+ynXv1EjpgKmZDIEFlqcor9K8ZvxSgYHId4ipf22HdXwALl+we3HHaZ18z46ek6CDKjL6wPbjEpanK+58FmbOkyV0r0I0jOQQ7oQvh0xLb/HuuTui7ixsco/Uc4bzIATM7XBAlL02yTdL2OaMETMO3FttV4zpQXmmxeMBE609zBO5bbw9DupGp1BNNA7i2+eykMKlaJqY4iR7NI9T4dd+LNfdD8pM4ySvVguD5Hqi5Q5T961WHcjeU66T6P9m0j+A3DC+wap8x4w/1OLRUZkAbcoDm56ZWtmT0fNPubMVzkyUKwl+3F9H2hO6NOG4F1i X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(3231023)(10201501046)(93006095)(93001095)(3002001)(6055026)(6096035)(20161123561025)(20161123565025)(20161123559100)(20161123556025)(20161123563025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(201708071742011); SRVR:CY4PR03MB2694; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CY4PR03MB2694; X-Forefront-PRVS: 052017CAF1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR03MB2694; 23:pWUarzTHqiuzv3oCmJPJdu+G54qZnTH1hU5j/exHL?= 0/thWhCj7Yv4xAeL4r4UcohxnDTDJzeX7hK8y7GSvfAyo8MJo+sJ9/Bz6nwbG4aQWwlet58v5iQdM1cZrGiRz6k54Vg4dDR0OrL5N70OTkRnvVSBEC6SbBvrbB8SZ87+rLOsjjH6eiBwYg7EXKh7hn7sXAeswTFVvOn/pWPwFigKf7eNwpJn0a60Jw4RjD7GXuJWRdYWdMic+WH/FWYe5YNkyX4lSiIO0zQJkCg8hj2Yb0r+J/Ze1/Gbqlr6upY/VEU6DfsGfV0GwC6NANenHR4fxlbdTHpGx5N/PZEcgrWTsDYWtwbFt9FvYFO/1x/RFv3hyWGU9eAqWobVcHtWC+TUiumCiWM1UsE6PP5Wht3KsbfGFMDawt0FWdTM7c1wf/V59QxnC+XZkGXpqAjEvof+3Qb8qQE5vvHWjbhfHfpBkYTBUeSN0p/mW0hcf3MN/0tkPnIlXSHQ1SExURpB/qRRiweLvSOPUycugZdq5auR/fcwHx+J91ZsOw4x0SiZvtL6n+WPJ5w10VcxiimuPlDqsoA0guu5qxBGqOMjdkndzO/D8IizJ3eTiYAIjugOvegmFW4fQUoO9mT6Qsv8u8vSx7qsM8RWP0cDqtPInWvTwFuP3tWDbp2CvxHTPglB+uhfMgb2es4fr+c8/m2sfgfPDm5aGLJ+tl6pMO49nsjEbynM9LS7eLGeaIf5VAsZxcRo+BLLhgGBt8eoinWW9ngtwruZF+o01RRkSfXaT2cWPv+xvudeP7mefNfvPsQI/rNa9xnnS81nWMeFlOOOmCU6nfDV2SBlGoJh2yVO2Yf31yX8tZYC71v3UPssHipcIjmb5PYW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dnyrh4XOSu9f571/aO9QY28Ok1h12V0APUsJ1e5rdIpu5D8RQgLS2FYb3lG5PJVX+ApPs57DpcHqVl1Roa SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 12:06:52.5673 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 40bef9e2-b075-49aa-3c30-08d54221ff54 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR03MB2694 Subject: [dpdk-dev] [PATCH 01/18] net/dpaa: fix coverity reported issues 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: 05ba55bc2b1a ("net/dpaa: add packet dump for debugging") Fixes: 37f9b54bd3cf ("net/dpaa: support Tx and Rx queue setup") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_ethdev.c | 6 +++--- drivers/net/dpaa/dpaa_rxtx.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index cf5a2ec..3023302 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -723,7 +723,7 @@ static int dpaa_fc_set_default(struct dpaa_if *dpaa_intf) static int dpaa_rx_queue_init(struct qman_fq *fq, uint32_t fqid) { - struct qm_mcc_initfq opts; + struct qm_mcc_initfq opts = {0}; int ret; PMD_INIT_FUNC_TRACE(); @@ -769,7 +769,7 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, static int dpaa_tx_queue_init(struct qman_fq *fq, struct fman_if *fman_intf) { - struct qm_mcc_initfq opts; + struct qm_mcc_initfq opts = {0}; int ret; PMD_INIT_FUNC_TRACE(); @@ -800,7 +800,7 @@ static int dpaa_tx_queue_init(struct qman_fq *fq, /* Initialise a DEBUG FQ ([rt]x_error, rx_default). */ static int dpaa_debug_queue_init(struct qman_fq *fq, uint32_t fqid) { - struct qm_mcc_initfq opts; + struct qm_mcc_initfq opts = {0}; int ret; PMD_INIT_FUNC_TRACE(); diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 41e57f2..771e141 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -665,7 +665,7 @@ tx_on_external_pool(struct qman_fq *txq, struct rte_mbuf *mbuf, return 1; } - DPAA_MBUF_TO_CONTIG_FD(mbuf, fd_arr, dpaa_intf->bp_info->bpid); + DPAA_MBUF_TO_CONTIG_FD(dmable_mbuf, fd_arr, dpaa_intf->bp_info->bpid); return 0; } From patchwork Wed Dec 13 12:05:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 121740 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5382445qgn; Wed, 13 Dec 2017 04:07:18 -0800 (PST) X-Google-Smtp-Source: ACJfBovacm1i64TNIYQwHPPzvRHq/Cu/v1HiOPtctVqESULXjn5ADwH9wD1+rU0DSXb1Za+G+fIj X-Received: by 10.28.59.69 with SMTP id i66mr1847865wma.130.1513166838488; Wed, 13 Dec 2017 04:07:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513166838; cv=none; d=google.com; s=arc-20160816; b=g6QOsjFVP3qD7FAnF+YddDzJ2hYJJjKumYP7Ru48HH+0EnHEE6mh/uqwhsyFSTivfH 0y0YSQLvaG79dG+Ed9wh2scH6LTXQHkPWks5C3suYtcbC9a4zn/ZijWLd61gPleANTzR DJnwFqKS54qaHMkbA24Q7KRrueKp02wfi4axVHduWy7WWk2tAyOifdvTmbcrlytoauhh kJaIN7ii3hTT1v5Cx6lYGO6BZ12K6zKKHaPqzCSdlrB9FtRbUGpjUDClraLrvvvnRYvD ej4wHD8JQdwJ1PMYpIRQAVpx2ZuKbi+foGuFNYkrft8AhrPsf+5+WNGEGmuY1tbCW90f piJw== 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:arc-authentication-results; bh=O2thAKx+knAi86TUyXH32xqQZX3Y2TZPYkzRhcUB6yY=; b=l5pXHkaVGdl63KV+WCGKz2vyxz8qAVG2vOfsz8TBt6ZorUBmS+lG+CYTFCOD81TJ2d xMw/wr3jHOFaEFlIx8s40D5vOvHil4D1Alj1KD7o5UBEfw51OEeDawa6KE1kGFbUe0iR DKlidxEGcxpax8rJ7oHBm1gvwv6D/hPh3HeW9GSvZLY7WEGaAatPXXlwf28OrShmzO0A IGj9Ptm3YiwvxWthiJIolLWm3oT0stS7jV+0Q7X9B0Q5Gpxl5+fbwlSwbEBXTdTeSj6E L5h4e1MK2kgRALXpiuDSNglY3QoD+njKt4niPKowNRkHjS0vnOR1imwQnKYFgxBNvPNe xE1g== ARC-Authentication-Results: i=1; mx.google.com; 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 j127si1285778wma.251.2017.12.13.04.07.18; Wed, 13 Dec 2017 04:07: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; 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 91A9D7D06; Wed, 13 Dec 2017 13:07:04 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0065.outbound.protection.outlook.com [104.47.36.65]) by dpdk.org (Postfix) with ESMTP id 45FA12E83; Wed, 13 Dec 2017 13:07:03 +0100 (CET) Received: from BN3PR03CA0078.namprd03.prod.outlook.com (10.167.1.166) by DM5PR03MB2699.namprd03.prod.outlook.com (10.168.197.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 12:07:01 +0000 Received: from BN1AFFO11FD010.protection.gbl (2a01:111:f400:7c10::167) by BN3PR03CA0078.outlook.office365.com (2a01:111:e400:7a4d::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Wed, 13 Dec 2017 12:07:01 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.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 BN1AFFO11FD010.mail.protection.outlook.com (10.58.52.70) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Wed, 13 Dec 2017 12:06:54 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vBDC6t9M008652; Wed, 13 Dec 2017 05:06:59 -0700 From: Hemant Agrawal To: CC: , Ashish Jain , Date: Wed, 13 Dec 2017 17:35:43 +0530 Message-ID: <1513166759-13466-3-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131576404146219374; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(346002)(376002)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(51416003)(2351001)(77096006)(6666003)(76176011)(68736007)(356003)(16586007)(86362001)(2906002)(305945005)(575784001)(316002)(6916009)(81156014)(81166006)(8656006)(2950100002)(8936002)(8676002)(50226002)(4326008)(97736004)(104016004)(47776003)(5660300001)(498600001)(50466002)(85426001)(106466001)(53936002)(36756003)(105606002)(54906003)(48376002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB2699; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD010; 1:aovIC4f7H6y+OGb0WLJrxWAknHNIv/m/iz/+79s76yUgLfiIq9nbkEptsTn5uQowB3zj/N7HPsbUB697SVqBqB9x+4AgJukKtv8Jf0fgTsQpzgIzDLV5oObUIMIoUxPH MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 61550e0c-26f1-473d-696e-08d54222006c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:DM5PR03MB2699; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2699; 3:UEpYrrr8KbIBby76FRXeTwJAYq6IHZWAl0fde2+N8bgPuikoUZAZtoYAnBMcibey1kmjh8wJZxKK07oU98T3wNp//tXtNDqBVwtDZ3htrAB7S4ySQ0ljtryoRAdPW4AlybOmCvL2Q9qytMjZObyVuuGvmDXwfDvmb1Yz1EOyiRXsrlnajqFcOMCsaxrzgMQtMQzbbvTCCSwVyqi6K66MqwRDgULDNTI6LeczKVKT9TAlUiPG3Or3yQO2cFYAx8cdjVoqyaLQgw08PLldnSjmhuaDkWLw6t5n0DcDIDs6nJ5MHonJwYJUuTsGQMwW4OLTIbvPn7jQwlLeQoYLlLrARQ4eWgHuCtLpWe0GVKQbX3E=; 25:DqOlv+rIJj6qbokdRXyXz1/nVGrk1xbPo+bwsDHEJ60zeDCTxoQNjrxn9NqwyPzM5pzV+FbYpXmD0wvK6sYdXq8VuJ+kOS/nL+C8oYR1NZPVVigbICzqvW9bnqShtpkfuMnt0VzLo5yIoPeMon0AjNS8NWX7JNSQZc/AdzEm1plGN03wyDDLIAqS+v0B9YpEdyUw0ysldl/dhI+QXr8b0YIec8t6CYMhivHoK6oidOxWv/UUNDZozyMl36PUL94QRxAXyGaBLIVk2VlEeJffdMoehziMYouiMP/YS0xqac3P853IuE8QpDs/05d85pf+MWKdEx+Q+j3VcOGdjt5VzA== X-MS-TrafficTypeDiagnostic: DM5PR03MB2699: X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2699; 31:fuv/TzLEB6xK8Toa8R035A37o3dCn8oEitklsplhy0OuOprE362ZXNv5YOBb6cLFEELlJyjC34wVKfD8/G1jGYfdw0bvncA6qRow0eriYIYgyItJlXH2Qgv9+gqhic6Ge3q1zN591WdjuZiwVn0UtXMKAj8QbzIMYgix32JJwUwEwltfCdMXDzkU6O29Rp9tBTHUt3cONysU0XSrEBNVR85vZGpVWyiPHeDdRWCASQE=; 4:jZ3CTCGAzh9+aWV7fsFD2jwYcQ/OA3EkQwe6o5q5VuucBjf+wFuAa1onHXiPWSbgPJ8mf3FtnSfsZvEysMiwB1rpTyWqGHFOMM7nlzTP9p5MODrKh4hchCyZZfgQuJbiSzVP6/eK7uVkePkHhJgEuVX0BdqkIxZpXhHDPa2rjlYj+TY0q/Miu2aWKPEbP0kB9c6Prymj4H0Zfq0zZeWrOsaJwaGmSoBjhrQTRKchH4eMgrZyUEB5Vgj8LSUMlpp3lA34gPGrfmAErA47wDipNv74oX0OLVQtK37J1e+KOMpgUR799/9YBdY0l6myjzPh X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(3231023)(10201501046)(93006095)(93001095)(3002001)(6055026)(6096035)(20161123561025)(20161123565025)(20161123559100)(20161123556025)(20161123563025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(201708071742011); SRVR:DM5PR03MB2699; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:DM5PR03MB2699; X-Forefront-PRVS: 052017CAF1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB2699; 23:Ajts0tnfaTYq/eAvfcJoWy6IfNJ/J+L1ioJ9g47B+?= mmlXWY5Zk1sth/YZlePL5iNGRyUu54TyTFrhBPU+iWO8hAaISH3ZzddpMJ2mhNj3Bv4pHwJeVsf6OhGeKoRePMBCp3lk6buPQcBX4PfIq5ygMSiIwAuGs1QtaOGXQ0vBBPwBiFptkGN0YQcsXI9+6v/kCOXDd2eDrJXNiOKVRscawLUVleZ5dbMTYWkWcjBvm2c0y6S9KFk6fblJ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ApiX6Vl5gEXVJVIwHWGyj6OCE4Mlrth5lTusRV9a/QRlOR8kCLBHqc9WFH2z47pKOmlaU7xW1jU8W+NfVGHuLvGINRK7LZpZKDmQVIhbJLGhOoqda8yCPe6tc/aBaBUpDXR3lEyDXfBT7x19WYXMwsoHQ5fRfH7ceNuiA5hp8PnIVGXiyVjFJ5kJIAbyLk=; 5:T16iY/NZBWm/xzC5BB+A8ausN6RqzuoGbJlevZtIa/Z40N/hXVxGdMVcUGEQxZ8Y2t+6cq2VgF9m/hIIDb6Nfm96pZQQSKhho2XY+4dxZKja6B5g6mrcfI6SfnTs10g3kJRPxUI9IKNd+cFz9Fier8GzANRQXnW0Dgd36KGvqL4=; 24:oloPwH5lxBmL3FR8rfFj4WbmbdXB0PD1rply4b4uPcGmDl7yjbiF0JIJJJa78ac1v1dwWlN8QD+I+cckOtY2oQ13BlT1DH2FqIOpOFvcl/4=; 7:nM93mYM3EPaQ9e2/y5p183jTPXUByOFnQxeJPx6uJ1Xh2Z6ZRyX4V7Cp9D77PaCKz1bRn9zgNG6gCQEzkW+G0Ab0isSH/luGhBvmhE3WLsXEeOtqKJiitvcKPTfijEuA833SRsNKT6ZOvhEu+cpI7erUUEB96V9w5chAyBmQJKWno1ldpXeNNuOqTAy5tyHMuI2bRa+pOPp82qoGsbga6pfRHHK0di56HJcoevxIzPxK16YBz3ol5YI4sVQU5Piy SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 12:06:54.4503 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 61550e0c-26f1-473d-696e-08d54222006c X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB2699 Subject: [dpdk-dev] [PATCH 02/18] net/dpaa: fix the mbuf packet type if zero 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" From: Ashish Jain Populate the mbuf field packet_type which is required for calculating checksum while transmitting frames Fixes: 8cffdcbe85aa ("net/dpaa: support scattered Rx") Cc: stable@dpdk.org Signed-off-by: Ashish Jain Signed-off-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_rxtx.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) -- 2.7.4 diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 771e141..c0cfec9 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -58,6 +58,7 @@ #include #include #include +#include #include "dpaa_ethdev.h" #include "dpaa_rxtx.h" @@ -504,6 +505,15 @@ dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf, fd->opaque_addr = 0; if (mbuf->ol_flags & DPAA_TX_CKSUM_OFFLOAD_MASK) { + if (!mbuf->packet_type) { + struct rte_net_hdr_lens hdr_lens; + + mbuf->packet_type = rte_net_get_ptype(mbuf, &hdr_lens, + RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK + | RTE_PTYPE_L4_MASK); + mbuf->l2_len = hdr_lens.l2_len; + mbuf->l3_len = hdr_lens.l3_len; + } if (temp->data_off < DEFAULT_TX_ICEOF + sizeof(struct dpaa_eth_parse_results_t)) temp->data_off = DEFAULT_TX_ICEOF @@ -611,6 +621,15 @@ tx_on_dpaa_pool_unsegmented(struct rte_mbuf *mbuf, } if (mbuf->ol_flags & DPAA_TX_CKSUM_OFFLOAD_MASK) { + if (!mbuf->packet_type) { + struct rte_net_hdr_lens hdr_lens; + + mbuf->packet_type = rte_net_get_ptype(mbuf, &hdr_lens, + RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK + | RTE_PTYPE_L4_MASK); + mbuf->l2_len = hdr_lens.l2_len; + mbuf->l3_len = hdr_lens.l3_len; + } if (mbuf->data_off < (DEFAULT_TX_ICEOF + sizeof(struct dpaa_eth_parse_results_t))) { DPAA_DP_LOG(DEBUG, "Checksum offload Err: " From patchwork Wed Dec 13 12:05:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 121741 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5382712qgn; Wed, 13 Dec 2017 04:07:31 -0800 (PST) X-Google-Smtp-Source: ACJfBotIqNgysRQcvumGy4Uyd9pscXyFd8cbjaHx9sKQbswEhRYQoqRIrERB5y47qpYdEuy7yVXt X-Received: by 10.28.215.71 with SMTP id o68mr1677919wmg.105.1513166851634; Wed, 13 Dec 2017 04:07:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513166851; cv=none; d=google.com; s=arc-20160816; b=Mgm/UIk5NikHlxnEqnIg5ft3Zu4v+PhRvKGcXwiYKI+FfKH22RowFpKEPbY72WTQFY MTvC1RzHCJg1wiqyqWzOuUNgAgYB4GYAzaT4R/4+p0PN61AHwodPHR8ZgBfJyX68gBcs YINbZ21FPXfp63miQcymN6vvHvXHWdkL7Oe/89MLRwNNhYEgN5t+DH7mQcxSxGBelQz/ uF2nyegUSSvSbNlTktotVae79zvVmbN/LwOiKg8IUYqo4gaYLzDZW1Og3ZjjL3STbspZ FVvpXYv5IErsk2kW1BYyanhnKB8g2DQkgLmDMuicOcVKZXTA7mQo9exFsiZscZC2HLQv Bt2w== 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:arc-authentication-results; bh=/cIQnOzpL1Vk07NH31xxdlP41BYi9MiQhOSjIKva0Ro=; b=Ty9QCoZYlpLwdKsXH/USNaT86jDGV7WqVFSAC1agjLA+/v0gzp8jmhR0mUrQ9u85g/ fj0x9CO3i7QD0HH+UhTfscDRRySuKjoAC5VpaoiNERsNRfsDPWW1j7kop51VdRxb/fTg jM68qE7ZpslWQgj06wQz6ZxaO0OM2I56O/Uq9RtgC9VUZTxzQufOXmLCaE/gO81FxKm3 ViFZRVEV8ukHKc8AJk6bSjOHwlzthQBvm1xRpiQ+lPpf7eiAQr30IPHOFsF+wLkrNjvf 4ndXFUhuTBi4m+86PHrVSkxvT6JLV8F42q3jJVp+cBAOv56M2tvtJggLGoGDLD6gNmSI EN8A== ARC-Authentication-Results: i=1; mx.google.com; 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 j29si1381067wre.435.2017.12.13.04.07.31; Wed, 13 Dec 2017 04:07:31 -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; 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 0D074199B3; Wed, 13 Dec 2017 13:07:07 +0100 (CET) Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0057.outbound.protection.outlook.com [104.47.33.57]) by dpdk.org (Postfix) with ESMTP id 09A647D4A; Wed, 13 Dec 2017 13:07:04 +0100 (CET) Received: from BLUPR0301CA0029.namprd03.prod.outlook.com (10.162.113.167) by MWHPR03MB2701.namprd03.prod.outlook.com (10.168.207.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 12:07:03 +0000 Received: from BY2FFO11OLC002.protection.gbl (2a01:111:f400:7c0c::116) by BLUPR0301CA0029.outlook.office365.com (2a01:111:e400:5259::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Wed, 13 Dec 2017 12:07:03 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.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 BY2FFO11OLC002.mail.protection.outlook.com (10.1.15.178) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Wed, 13 Dec 2017 12:06:56 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vBDC6t9N008652; Wed, 13 Dec 2017 05:07:01 -0700 From: Hemant Agrawal To: CC: , Date: Wed, 13 Dec 2017 17:35:44 +0530 Message-ID: <1513166759-13466-4-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131576404164736677; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(7966004)(336005)(376002)(346002)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(6916009)(6666003)(8676002)(316002)(77096006)(5660300001)(54906003)(81156014)(16586007)(575784001)(4326008)(81166006)(47776003)(305945005)(50466002)(86362001)(53936002)(2950100002)(48376002)(51416003)(50226002)(2906002)(498600001)(356003)(2351001)(85426001)(97736004)(105606002)(8936002)(76176011)(68736007)(36756003)(106466001)(104016004); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2701; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC002; 1:sLZX0ojEkk0PWHUZarZedAy1Jsib7lbuGDnLQhq3lBshVUyUNtGRHytqWvVrO45JqOCn4BuTztNdeXGOxjj1EBFBTB8zQ0kHTLdUVX0HRhDN7gTQPfXCB55cHnts7Tdh MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 03a559d0-83f2-4d2c-9546-08d542220184 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:MWHPR03MB2701; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2701; 3:HlyqdZ9cfSfah+3o8kyFVrd9v5+HlIHUWuR88f9NK+xac970Lp/R9witlBjV+8tK6RhgEznOqqIQnwvSeGV54PzYH6OtTSEGHLANUTe0Ih0oZErfriWe5oGE25Zw+moTooa1zARBwIh5IaArNwaZknLeNXtXBrMdaZae9iIBGGnX40jTHwRkf8Yzy0Din/bOKZz04Munr1wyKwGaCydm+MV/v1zV7dtybczeZ2N0Gib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O5xi4Rll/+L3GB6S X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231023)(3002001)(10201501046)(6055026)(6096035)(20161123559100)(20161123561025)(20161123563025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123565025)(20161123556025)(201708071742011); SRVR:MWHPR03MB2701; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:MWHPR03MB2701; X-Forefront-PRVS: 052017CAF1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB2701; 23:e+PAnDQcE8ftggw4fy73LS/o2COZ2XxbVY26eeGgR?= lxgqphmzxlfPlwvXHXqtiTgY+mcWG3UM5i66ardJQ8hzWnC7rd14QJi5+2W5CYyQ208oq9gDuWnGc8nMP5zQ546N8Wafd9Jnv3+tQ0AgL5JQB+nyRaxqfacqUi3i8CZOxFPTnEWy8qtNYhGInlb1D3ASkOtJs6OMSYTiB7lnql7H4cXion4ADhHYKVqtFFO2uQNVrmfvTjdRhRUK4KEphd9GIUAbH+HsqWra56WrAQ9mzH1UGwKUnePGFcMvDTXdCB69UQMYKjj7bLOhlJdP/vLQREmHvMGgkClP/cqGAG9fLgeXgZtg+lfqRmxuzJc3gY6/iIfjVPxgXVVOFsp1trSAOHSE6upodsFXmcfLJkm7+DPiCv7+OAvtBIE9uakPotOI9tlw0CIS99cbUupWeJDO49PmCrSAe9MHGz419WELsg5HgDaYeVYaQjz9neKLZTdbuZXQJNvxRpAakD0nps0cKpeMC4PnUXZBU+uAtM8EbDdelBn1sgeX54e1XF1oCkVj5/AdfbhzLphreY7cm5Z+bJEcWuaysH9z4hH4s5uYivizFs/OCx7Ir6p6u7IMXP2P+6cKSzeaRku/LhYPX+mP78RhxlWhwalZiU3Na6MLT4fCS+ZDlV76FClCIFXwNTPYoQdxFPqE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G9cZs2JijPIttJl91BiVXIezcHk9zJKc=; 7:5z5zVFKTDCsoaq27X4xn6EKaphCv+nid2h5fYrxpIcyBmt4PeyBReu+x6mqAkyliktMKXp//53/XzKhhXtZ9OMfvcgXxoNLUkggSxnNLTfzChGpRdG6wqOSRwZfe5tSWs1EvPQA8R5J1+8KF1T7rYifBG91w5l5NIQXnyQUEc6o0dRlGYSXTz1GD6Bt941hyXfn6tD5KWQctvTRJ7UzQ/MXPtMz3Rc69/ULlnEhxN3DLnNPtwOPn3VFpGUyVPfh5 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 12:06:56.2708 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 03a559d0-83f2-4d2c-9546-08d542220184 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR03MB2701 Subject: [dpdk-dev] [PATCH 03/18] net/dpaa: fix FW version code 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" fix the soc id path and missing fclose Fixes: cf0fab1d2ca5 ("net/dpaa: support firmware version get API") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_ethdev.c | 14 +++++--------- drivers/net/dpaa/dpaa_ethdev.h | 2 +- 2 files changed, 6 insertions(+), 10 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 3023302..29678c5 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -212,19 +212,15 @@ dpaa_fw_version_get(struct rte_eth_dev *dev __rte_unused, DPAA_PMD_ERR("Unable to open SoC device"); return -ENOTSUP; /* Not supported on this infra */ } - - ret = fscanf(svr_file, "svr:%x", &svr_ver); - if (ret <= 0) { + if (fscanf(svr_file, "svr:%x", &svr_ver) <= 0) DPAA_PMD_ERR("Unable to read SoC device"); - return -ENOTSUP; /* Not supported on this infra */ - } - ret = snprintf(fw_version, fw_size, - "svr:%x-fman-v%x", - svr_ver, - fman_ip_rev); + fclose(svr_file); + ret = snprintf(fw_version, fw_size, "SVR:%x-fman-v%x", + svr_ver, fman_ip_rev); ret += 1; /* add the size of '\0' */ + if (fw_size < (uint32_t)ret) return ret; else diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index 5457d61..ec5ae13 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -46,7 +46,7 @@ /* DPAA SoC identifier; If this is not available, it can be concluded * that board is non-DPAA. Single slot is currently supported. */ -#define DPAA_SOC_ID_FILE "sys/devices/soc0/soc_id" +#define DPAA_SOC_ID_FILE "/sys/devices/soc0/soc_id" #define DPAA_MBUF_HW_ANNOTATION 64 #define DPAA_FD_PTA_SIZE 64 From patchwork Wed Dec 13 12:05:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 121742 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5382898qgn; Wed, 13 Dec 2017 04:07:43 -0800 (PST) X-Google-Smtp-Source: ACJfBosATeMhA0LFe4xU1jguxl1Mp7F2IibZEfRwh0h0kG1xUJBENuK1u+S+7t2urAx1m9HUqb2W X-Received: by 10.28.153.210 with SMTP id b201mr2014450wme.2.1513166863071; Wed, 13 Dec 2017 04:07:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513166863; cv=none; d=google.com; s=arc-20160816; b=x/oj6C6SU1elY9ITcXqK+M4GgyWkIJAayP5U6883aJa6TQIffgN4DcpJxZMD839BbY r3y5l7eaduiElgZIIHID3DU/ydnG/AnOKpeMoZYxVPO9X7cRnDSwXPdeXLEtMJhJW9Ro HNLAUUxgHpEoiP/U/oXfAY2MN9GL4y46Ymp6Q7GObpMYY0wT7dPG2bsoydh2IKERT68U XFoHuPKgXS+ZVQ7L7r1aprCW7Y+nKSNesUoKItWK6vXNDlEgM8rB30n0Fb+B84rIlqip X3b1VBRIQ4a2UG/AOhq19c4BFIBBbaoeYWygv1bRLrnA6CHLzCFLAdz2DqhlmlXqs/Xm Zung== 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:arc-authentication-results; bh=olNuW4OkH1heAlGR1AMCEVf5ImZId1MorA9RKGCvACM=; b=alQCt0p+zIw7+nHb3fN0UeezT5ruw7CTaiOf6/Qk1sVAef5bYQT5KQR2ajLNQl6XNy Ax+on5ng/LOXDhGc4/ux+I0L6BABLh28f49XjuCKUltfdN63AONpbrbuU32wdNF0UPSU Yykc9gi02UYERSKwit57HiGooFibOBmX1S366w5dWq+jZ6Z2Zj5x589LdSXxVquAfEjC dIilU3J6jzQB51RvqbNP0uRUAf7fN00q//RuJOr1M15F9nFkP271mHx63x0th8JBOjFU +niRcc7H1w3BSCISamk41VsPed4VG/mk8MMKX7CdnjORphY6dqVBBvukHWs1igaqPIrp WGNg== ARC-Authentication-Results: i=1; mx.google.com; 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 y71si1344193wrb.505.2017.12.13.04.07.42; Wed, 13 Dec 2017 04:07:43 -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; 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 3BE099B6B; Wed, 13 Dec 2017 13:07:09 +0100 (CET) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0079.outbound.protection.outlook.com [104.47.37.79]) by dpdk.org (Postfix) with ESMTP id A01CE293B for ; Wed, 13 Dec 2017 13:07:06 +0100 (CET) Received: from BLUPR0301CA0034.namprd03.prod.outlook.com (10.162.113.172) by MWHPR03MB2702.namprd03.prod.outlook.com (10.168.207.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 12:07:05 +0000 Received: from BN1BFFO11FD012.protection.gbl (2a01:111:f400:7c10::1:184) by BLUPR0301CA0034.outlook.office365.com (2a01:111:e400:5259::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Wed, 13 Dec 2017 12:07:04 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; intel.com; dkim=none (message not signed) header.d=none; intel.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.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 BN1BFFO11FD012.mail.protection.outlook.com (10.58.144.75) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Wed, 13 Dec 2017 12:06:57 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vBDC6t9O008652; Wed, 13 Dec 2017 05:07:03 -0700 From: Hemant Agrawal To: CC: Date: Wed, 13 Dec 2017 17:35:45 +0530 Message-ID: <1513166759-13466-5-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131576404178894808; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(346002)(39380400002)(39860400002)(376002)(2980300002)(1110001)(1109001)(339900001)(3190300001)(199004)(189003)(2950100002)(68736007)(51416003)(15650500001)(356003)(85426001)(97736004)(59450400001)(76176011)(104016004)(6666003)(6916009)(2906002)(86362001)(5660300001)(4326008)(47776003)(53936002)(2351001)(106466001)(105606002)(50466002)(316002)(36756003)(50226002)(77096006)(48376002)(8936002)(8676002)(81156014)(305945005)(81166006)(498600001)(16586007); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2702; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD012; 1:UgQUQ1xy/Jw8Accgk+CUFicsS+tBSTLpwzC/ztbsUDIlSqpLpRB/HYOt0A6m1F0J1m14cmnnWrj+RSqkYwm8aM6/mV2cMFEsAjR4q9EjtdyZB7r5cCkx30C29DY8J8e3 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 35374a82-ed48-4eb5-ffd8-08d54222025e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:MWHPR03MB2702; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2702; 3:X3DOGgv4wBXS+Zy5Q5OVzkSdzl+w60qF2wS76V3GxMoOp/oS2N6vB7RbzsD/MJV4BOw0ME8B2OWKnfy9vULyKYzWgSM6LFQc0GfzPs6T09dyLzJxmVA06aCb3+gZ85idlL2bxT6IzL8o6VKLLS4BXUD+cy9JY0orT76N5NbvkJ+WtVpUHgcpv3JuTWElk7VT2Wl2AN+anPfNa3DOUs1I96mf9ViO+xxUO3AVaiug2NQ8bqiTqMf/rGw7UQFumeulwr+Ol4oKth7M4gMHcRzfw+PI7W/Ub4ruBMo/Tr9pb/9Yy+ffP3hWl2JtCCj1J1gSPZVgKcVuYAzjQNjsBBYpYXZweuQ/iwFZMzDKGy70wIw=; 25:+/zuq/c40l7kPVRYGc+vT2GEbviFFLC0JpiWeRUY9TV+CTNcDYP/QlCrDrazD/hqFMxKVEsrOc6/OHbF6ojgUQdeb3P/mAPG82B7SRvM9XhhbQUoZYOdg32U+z/CtX9XdBFCRGiJAr+2hqibdMxyKSVIrhZAmmoutGsZqqMKtsVrpNnDXwTK0AvkkLs/mfdjJHxyUsAUhPPExQ1rLuF3n/rhMbeEpb0V23ut2VtRX6nGeLb3Fq3W0NmJ/MKkYyQFFB6Q5MPsI7LKw67X2EG/wVqQjw4b3PHNt7AB+kRYl+OJFzSmuwjhOFgEe1kRwgsD30mecgnzCCeAeJGAjsvfOQ== X-MS-TrafficTypeDiagnostic: MWHPR03MB2702: X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2702; 31:lRTlqFnmaLTrTnFyUNTu7mBLeHLD0YRD7RHYNeVWr8s2sEqbtRmJVfFGt9vkSipNlmsjq/J1wKH3BgK1Ez0waAbJjnFR5mg2TTbHA+R4ydk2y2JmP2WUJouASdI9LvH4ETaPld09MPsioKCb9TTzuK80HYK1twAOJUieAoBmo1EcGJCqhKnP3k6hX+pTt1KbbzdWhJbKzf5p/LCnQx1Zqs9YJr0lgqZXBDwGwrTsk7M=; 4:pQ9QHrv7lumhhpiGohDehY1j1zwxkC4ivvNKWCc+7gu78MMt+ywjDbPBpX3ZValRHq4gh4TMi3y5U/flmFMwmhKFsUwkgw7iCqg2ISJX715D5A+CG8VDyT8rZaNNIbfELELLVyKJp7F6vNmcEwJTVJNeEE6BujsyuXM2Hr92IRqkzs8bWS3p5RYoIcWKwIaQ58xrD6HtrjRw7y5U4D2pk0M24fTcWz2nBtE27UuVv/UkS5YJFP/48suZLVYKs5MFpw18kWMEkVh5E/aALAq9DS5BAidxHwEO4hgUI7JQa1C7ffDDtm/wO+ehbPjnIAea8XCW5zlpgEQpGGvTO9sTPuQuP2uu+mGq6NCz4FUNULY= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231023)(10201501046)(3002001)(6055026)(6096035)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123559100)(20161123556025)(20161123565025)(20161123563025)(20161123561025)(201708071742011); SRVR:MWHPR03MB2702; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:MWHPR03MB2702; X-Forefront-PRVS: 052017CAF1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB2702; 23:3sG7o0AL4P+GSBeXYi9rY2mijAPxWx/jtU/yvedAP?= 4BhFAKlYhbnAIyzHjbhTVJOHHT1xv/tHwcRnyQf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jAQ5DeMIBxIbC9yifRXgAhzbnuM0j9EreWDU98q02wI6q2PP2ba8KW0CcYZ+XZ0rdYCPynV6DAzV1JxDlvefVx/Q/CJtuNtEKdxBLcan0r3HmFyz6HWghI0u+zElMqa0ZslbqjsreIxA83ZmgkD3YREH26LFarlyKqTaoJfOAIZfuLHO3KCo7rl/DrEu/IsUKF3dhbFktwnGl5XsYoGoK0DztrThgIr5k5KMW81o0pkI3SBovlpEJp0dxmeoTC6b3HrZmrCUCBJEVRbzi+2jTcSI74lt+0rbvVJLIQ69GrZiVrNYwYMVCKllqeuQLBZl+kbE5sRwjW9OfPc=; 5:mS3dbAV3zyCqYJG9ECCShcfEXAAN7UFQ6IJzFuYDehrxeGOFDzwg9Dc0pv69uMR8XjRomRHDjl9Yes4umj5/bPh9AFiXpjzzuGddnbx9MBz120rQMvQ/CfH4HdaCHoXETky1JstKOF4waltejD7iTsGY319+z3RLYo2Ziu1VETA=; 24:GrgH5PdAyWGjqQV+itf/p/X3vQwxZ0wHKubfYUCoRnLMLeURvuf0dEp4+lkVGTZ2aic0FBJ9KxTOFnwqQMl5sXgqgwXrkJuu4CB8l0jek/0=; 7:xQ42pPtNYW/QfgrkN/Xx489UpzdNleZHeOCIzi1CbzNEDGoUvgV/N582cCy5f+S2VbbW8P5RDFgD4R496kfVlNuMcSk+IbdPyc2KZLfT9AEWWOzZfiJHfsUEs/+DtoX1vwqfg8wgf1xNTMpshh+6TjqbheATTM+jX+HBF04/l3A1TcQ7klt0g2fMyR4yA91798aJJBUvKkYF0ZHDtm8TTDMFQEbLTUvRFjo/6qGEeVk7nXBnimdKGBmyd44YZMAP SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 12:06:57.7178 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 35374a82-ed48-4eb5-ffd8-08d54222025e X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR03MB2702 Subject: [dpdk-dev] [PATCH 04/18] bus/dpaa: update platform soc value register routines 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" This patch update the logic and expose the soc value register, so that it can be used by other modules as well. Signed-off-by: Hemant Agrawal --- drivers/bus/dpaa/dpaa_bus.c | 12 ++++++++++++ drivers/bus/dpaa/rte_bus_dpaa_version.map | 8 ++++++++ drivers/bus/dpaa/rte_dpaa_bus.h | 11 +++++++++++ drivers/net/dpaa/dpaa_ethdev.c | 4 +++- drivers/net/dpaa/dpaa_ethdev.h | 5 ----- 5 files changed, 34 insertions(+), 6 deletions(-) -- 2.7.4 diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index 1cc8c89..f1bc62a 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -77,6 +77,8 @@ struct netcfg_info *dpaa_netcfg; /* define a variable to hold the portal_key, once created.*/ pthread_key_t dpaa_portal_key; +unsigned int dpaa_svr_family; + RTE_DEFINE_PER_LCORE(bool, _dpaa_io); static inline void @@ -443,6 +445,8 @@ rte_dpaa_bus_probe(void) int ret = -1; struct rte_dpaa_device *dev; struct rte_dpaa_driver *drv; + FILE *svr_file = NULL; + unsigned int svr_ver; BUS_INIT_FUNC_TRACE(); @@ -462,6 +466,14 @@ rte_dpaa_bus_probe(void) break; } } + + svr_file = fopen(DPAA_SOC_ID_FILE, "r"); + if (svr_file) { + if (fscanf(svr_file, "svr:%x", &svr_ver) > 0) + dpaa_svr_family = svr_ver & SVR_MASK; + fclose(svr_file); + } + return 0; } diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index fb9d532..eeeb458 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -64,3 +64,11 @@ DPDK_17.11 { local: *; }; + +DPDK_18.02 { + global: + + dpaa_svr_family; + + local: *; +} DPDK_17.11; diff --git a/drivers/bus/dpaa/rte_dpaa_bus.h b/drivers/bus/dpaa/rte_dpaa_bus.h index eafc944..40caf72 100644 --- a/drivers/bus/dpaa/rte_dpaa_bus.h +++ b/drivers/bus/dpaa/rte_dpaa_bus.h @@ -46,6 +46,17 @@ #define DEV_TO_DPAA_DEVICE(ptr) \ container_of(ptr, struct rte_dpaa_device, device) +/* DPAA SoC identifier; If this is not available, it can be concluded + * that board is non-DPAA. Single slot is currently supported. + */ +#define DPAA_SOC_ID_FILE "/sys/devices/soc0/soc_id" + +#define SVR_LS1043A_FAMILY 0x87920000 +#define SVR_LS1046A_FAMILY 0x87070000 +#define SVR_MASK 0xffff0000 + +extern unsigned int dpaa_svr_family; + struct rte_dpaa_device; struct rte_dpaa_driver; diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 29678c5..4ad9afc 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -212,7 +212,9 @@ dpaa_fw_version_get(struct rte_eth_dev *dev __rte_unused, DPAA_PMD_ERR("Unable to open SoC device"); return -ENOTSUP; /* Not supported on this infra */ } - if (fscanf(svr_file, "svr:%x", &svr_ver) <= 0) + if (fscanf(svr_file, "svr:%x", &svr_ver) > 0) + dpaa_svr_family = svr_ver & SVR_MASK; + else DPAA_PMD_ERR("Unable to read SoC device"); fclose(svr_file); diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index ec5ae13..3f06d63 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -43,11 +43,6 @@ #include #include -/* DPAA SoC identifier; If this is not available, it can be concluded - * that board is non-DPAA. Single slot is currently supported. - */ -#define DPAA_SOC_ID_FILE "/sys/devices/soc0/soc_id" - #define DPAA_MBUF_HW_ANNOTATION 64 #define DPAA_FD_PTA_SIZE 64 From patchwork Wed Dec 13 12:05:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 121743 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5383157qgn; Wed, 13 Dec 2017 04:07:55 -0800 (PST) X-Google-Smtp-Source: ACJfBovdpOXOzpawxVQPPd9nPqhZgEWwoP89o1TO5gJNt1bJK1gkLu1p6TAtW6TvFx947LdJU3Vd X-Received: by 10.28.35.80 with SMTP id j77mr1844264wmj.109.1513166875744; Wed, 13 Dec 2017 04:07:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513166875; cv=none; d=google.com; s=arc-20160816; b=zj4qUUunFAlUpM2yli5JbNxwPEvvhC90krO7pZBLTlDPPmhxBX/NMt3H4zyMTwtVOM V3ClOvpq5Ki1u3/+YAn6yNQbYLxm5I4zbFZf5SjE7CkRcMdWaaofxEi+MuBpFEi41Zcu ZW9N5Ugz74gferkNbRvD8anNbC/Bz/4oEfj6VlbgZwM7KZXLzCFVWTDxZZiq8qk4y5QJ XqOWT1NCFDT8F8S9Ynx/qe0dntuqkFzObO7rwCEqpFK4D6puTXW+G/iZTuliHAVv6loZ 0yOs7SvnO2DkS23ECz9BLaxfpY0gTxl8XwdyufhkaEiV10Rmt56wbVYmXcr0GaaY4bpo 1arw== 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:arc-authentication-results; bh=J3E/ZANoNrfIxA1N9fQprDPtUOKR/lA+CQUcokRml/0=; b=Q7oQxwBcg3C2lkX8wBy+RAEAQZYip2yPNGRZUvYYT48qtNx6mR942F6H8qTJ3dQfDS V1WSZBNlQw31jP29hWxWE8eI9RgNyyAzqoyE9q3Bs4cZyneJ/gpS/BMxA2ksB6AmMxmm JEQo1a0e3gifYiPho1xI0opGx/7nux4wXrv+HItVH2ulCi+JOKdM4G3PLeXJvIckKE3h wBQTq7Nf5Yb1qA0TuPAegMkkPjxS6NKPHnoNklntGS21cAQAWbGylFgvs/QnP+vImO+5 J3NXP+zvSyVSjtaClX5Xzwdn3QY12tJ74+eE2qdqyiyNs7NBOH3fD/sxi8STvSG8xt2f xRGA== ARC-Authentication-Results: i=1; mx.google.com; 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 l6si1342385wmh.51.2017.12.13.04.07.55; Wed, 13 Dec 2017 04:07:55 -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; 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 664337D4A; Wed, 13 Dec 2017 13:07:12 +0100 (CET) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0073.outbound.protection.outlook.com [104.47.37.73]) by dpdk.org (Postfix) with ESMTP id A67501AEF3 for ; Wed, 13 Dec 2017 13:07:08 +0100 (CET) Received: from MWHPR03CA0044.namprd03.prod.outlook.com (10.174.173.161) by CO2PR03MB2359.namprd03.prod.outlook.com (10.166.93.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 12:07:07 +0000 Received: from BN1AFFO11FD030.protection.gbl (2a01:111:f400:7c10::148) by MWHPR03CA0044.outlook.office365.com (2603:10b6:301:3b::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Wed, 13 Dec 2017 12:07:06 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.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 BN1AFFO11FD030.mail.protection.outlook.com (10.58.52.168) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Wed, 13 Dec 2017 12:06:59 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vBDC6t9P008652; Wed, 13 Dec 2017 05:07:04 -0700 From: Hemant Agrawal To: CC: , Ashish Jain Date: Wed, 13 Dec 2017 17:35:46 +0530 Message-ID: <1513166759-13466-6-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131576404199057827; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(7966004)(39860400002)(39380400002)(376002)(346002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(76176011)(104016004)(106466001)(50226002)(77096006)(5660300001)(68736007)(51416003)(4326008)(2906002)(8656006)(105606002)(2351001)(356003)(498600001)(85426001)(86362001)(6916009)(316002)(36756003)(97736004)(305945005)(50466002)(81156014)(53936002)(54906003)(81166006)(6666003)(16586007)(48376002)(8936002)(47776003)(2950100002)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR03MB2359; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD030; 1:2ksAiXTuKWgJxqoZ4maxlhY0cLi4irIIkKRVcxXEKeLEi/Hi4iJW2cfqJoRg6lZDEPLI/nj6BqeWNWKNd+9fsVc9YLczAITMnSUuWURUHPNtoPFTZbZ7aodPZ5cTXnko MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 80d61de6-fc90-45e7-a9a3-08d542220392 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:CO2PR03MB2359; X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2359; 3:ouI+QIl5WwSz+v/UqZAAVIJ7sL+D6zbIqZwBp+jsjbBTZFNV4yUedyFnY/wZwzeyMyVF6o2vOQ/ayIIjifH4MNPSePlV3i2D8rmQR8mMk044VZbsfju4cHQW3bvapc1xn+tSp5XUqs2sWP1hVxMtSz4OjER/zhY1kfH35SoZZ+Ve36Leqck9N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YtV4VLYqgQxy58J7XDD53zNOvubO/4y2OLov+lrZd3CsjCG1JVif8qYamgwXg1JTwzQSIuB3CDkNn/K1+Imn X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231023)(93006095)(93001095)(6055026)(6096035)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123561025)(20161123559100)(20161123565025)(20161123556025)(20161123563025)(201708071742011); SRVR:CO2PR03MB2359; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CO2PR03MB2359; X-Forefront-PRVS: 052017CAF1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR03MB2359; 23:mTvVhonv0J6Oub2HtUZTdDCKMIXqYIoR/5plMFnaI?= 8lftG7FzActY/F2u3XGFWHk2BNk86XFCWyUBvwZNgI3vmArbwTfxc1/L4mOCBni5UsLqVFBRjaP7KRdEuhd+8oB3K6Vwa+vKrKJKCqz1YWzcUCce8LI8Pu4Nf2JJa9+duXS3//CZS16I4EpsjhTAnJooWVm7l9huYqK5PyzONm1i5W16fIo7TiRcUkvkMQrfGdA5EaQI/8AG50HOEhBSUKaTA2xq4RGz5YEyJDZk4pi3YTk+qk0+rZaIxFXOFOqn3tjtvzvHvXWjZ+zAWgDtB37ZE2kuyy9iClkQg1sngqzPgPVc3pESblVaMcPYggqSTcummjGn3TOimBx1Nw4BdapyqEzVRT7LOeaASeYBHonVhfQJsQBGO14viOuEtFdGnDcJPbrQDpE2uEfy1xpGQO/LyOq4GrvkuSVrEDUA1TUsKXa3ao7mwPSLEpCT4hX2Rwe6E4FmHmbZaDRWPi4mYazfQIeBgNznKFaTA4JPUqykvqsRSqVqSqKL/GUDKhrpjbp/jbBxfaZKYAU1nM/XEukqJWV+I/tjhn0hgN9ricLVyU1xkoaIMvSPnqpGzNijEa+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M5Gct2FdGFh47oTg0IEAku4xmHhquYgT9qMFN+sKcebUPC78m9tHQrpNXL863uaIIwIVN5Q=; 7:jcNgU+n2n4j2nty+JPeTuQEVHdYH9K6iyGYG0lwluN7hQVfuHWpqzbTsJVJsHCzJgqA3B3Y9jwRPjhpJRkRc6e6HG6MURFU4OYzJVh7BejqdBV8Q5L6YMV+mBFnEgj8qA6L5EucfrX+RShPWGvDSiUHKW0hUAkJv7UKYaXlElgbYV54mAKg+RT2vATPvbXebt5q363P9VInodbPEJHeANf7O6kjrPmwv8TtJSlEsyBGQGQI9aj/S7DujX2Ap7VXq SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 12:06:59.7341 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 80d61de6-fc90-45e7-a9a3-08d542220392 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR03MB2359 Subject: [dpdk-dev] [PATCH 05/18] net/dpaa: set the correct frame size in device MTU 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" From: Ashish Jain Setting correct frame size in dpaa_dev_mtu_set api call. Also setting correct max frame size in hardware in dev_configure for jumbo frames Signed-off-by: Ashish Jain Acked-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_ethdev.c | 20 +++++++++++++------- drivers/net/dpaa/dpaa_ethdev.h | 4 ++++ 2 files changed, 17 insertions(+), 7 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 4ad9afc..adcc219 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -111,19 +111,21 @@ static int dpaa_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) { struct dpaa_if *dpaa_intf = dev->data->dev_private; + uint32_t frame_size = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + + VLAN_TAG_SIZE; PMD_INIT_FUNC_TRACE(); - if (mtu < ETHER_MIN_MTU) + if ((mtu < ETHER_MIN_MTU) || (frame_size > DPAA_MAX_RX_PKT_LEN)) return -EINVAL; - if (mtu > ETHER_MAX_LEN) + if (frame_size > ETHER_MAX_LEN) dev->data->dev_conf.rxmode.jumbo_frame = 1; else dev->data->dev_conf.rxmode.jumbo_frame = 0; - dev->data->dev_conf.rxmode.max_rx_pkt_len = mtu; + dev->data->dev_conf.rxmode.max_rx_pkt_len = frame_size; - fman_if_set_maxfrm(dpaa_intf->fif, mtu); + fman_if_set_maxfrm(dpaa_intf->fif, frame_size); return 0; } @@ -131,15 +133,19 @@ dpaa_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) static int dpaa_eth_dev_configure(struct rte_eth_dev *dev __rte_unused) { + struct dpaa_if *dpaa_intf = dev->data->dev_private; + PMD_INIT_FUNC_TRACE(); if (dev->data->dev_conf.rxmode.jumbo_frame == 1) { if (dev->data->dev_conf.rxmode.max_rx_pkt_len <= - DPAA_MAX_RX_PKT_LEN) - return dpaa_mtu_set(dev, + DPAA_MAX_RX_PKT_LEN) { + fman_if_set_maxfrm(dpaa_intf->fif, dev->data->dev_conf.rxmode.max_rx_pkt_len); - else + return 0; + } else { return -1; + } } return 0; } diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index 3f06d63..ef726d3 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -71,6 +71,10 @@ /*Maximum number of slots available in TX ring*/ #define MAX_TX_RING_SLOTS 8 +#ifndef VLAN_TAG_SIZE +#define VLAN_TAG_SIZE 4 /** < Vlan Header Length */ +#endif + /* PCD frame queues */ #define DPAA_PCD_FQID_START 0x400 #define DPAA_PCD_FQID_MULTIPLIER 0x100 From patchwork Wed Dec 13 12:05:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 121744 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5383339qgn; Wed, 13 Dec 2017 04:08:05 -0800 (PST) X-Google-Smtp-Source: ACJfBov2BhAiweU43XoMQKP5DCZM0axeDCR8uANF+FouB16/lAkphNYwRSPfgNMk7ZhH11e5Oj1M X-Received: by 10.223.133.198 with SMTP id 6mr2091282wru.199.1513166885577; Wed, 13 Dec 2017 04:08:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513166885; cv=none; d=google.com; s=arc-20160816; b=CpPSuPLHWe65LBYSJIqzpZtR4Su/SKFSWvEMlTToE0XKLkV4nMXc7MLgyXGwVdk4bH mWnBma6cemydYKLX5sDX4TOqBTy7Aj6lmMZJR6ILB+ibO+Y/Jld4u15X7B/GbJubW0ed qx5rzFxlYOeMRoRtXnJWfLDlraXN1uYg77M1fItuF0VOovMmGrXbTHp6M//iQUzrdh+p ucB+q0/FYFis3JWQV5Ql7KTbLreCtIPPPlV/XSpDET7bGlZzASzTBqsUe09EzUzloNdp PXApa47QknW8SoS/3eOsrTSjMUNqX2FOongzR/p/T6pM0ZuHcSNmBub73dyTUK1b3Y/e SyEQ== 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:arc-authentication-results; bh=wjOE1DQcz5ZyDrJ3oIpAwporrP1ZcWMPXp1WPe8rSI0=; b=cVMSzfXvKSD3/5Fd+XckNZXO5kA3IKoAigs+zOctGXJdeMb4YqjvvK3EyGXizqT3XW VORQkQqP94gia3rdFwIQc3V6llU2OSC3Dw+sfI+dgQ4zGwc84qzOKe5lchR7lOd8T03D IDnO8rlIbM6pS+b4HSo3/PqAhrGcnHl9uMNZsBAGvYhTMHnuosSarWLyoHiE2USLAWFw UrF+KvQVVMqoJ3cFapwGQ2X7JS7VAAQkFjXSwEWxFxkK0vlUqfih4DU832/4SWtj072L vNm0fabOjHHY1T2/4bT+QkH3HuCIKaKuQM+ozCwOcdo4CUaR968BXOpgHUA4tQ804YOa tnSA== ARC-Authentication-Results: i=1; mx.google.com; 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 o126si1361206wmg.247.2017.12.13.04.08.05; Wed, 13 Dec 2017 04:08:05 -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; 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 7EE1E1B159; Wed, 13 Dec 2017 13:07:13 +0100 (CET) Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0049.outbound.protection.outlook.com [104.47.38.49]) by dpdk.org (Postfix) with ESMTP id B01831AEF5 for ; Wed, 13 Dec 2017 13:07:09 +0100 (CET) Received: from BN6PR03CA0088.namprd03.prod.outlook.com (10.164.122.154) by MWHPR03MB2704.namprd03.prod.outlook.com (10.168.207.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 12:07:08 +0000 Received: from BN1AFFO11FD008.protection.gbl (2a01:111:f400:7c10::112) by BN6PR03CA0088.outlook.office365.com (2603:10b6:405:6f::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Wed, 13 Dec 2017 12:07:08 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; intel.com; dkim=none (message not signed) header.d=none; intel.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.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 BN1AFFO11FD008.mail.protection.outlook.com (10.58.52.68) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Wed, 13 Dec 2017 12:07:01 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vBDC6t9Q008652; Wed, 13 Dec 2017 05:07:06 -0700 From: Hemant Agrawal To: CC: Date: Wed, 13 Dec 2017 17:35:47 +0530 Message-ID: <1513166759-13466-7-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131576404216294117; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(39380400002)(376002)(39860400002)(346002)(2980300002)(1109001)(1110001)(339900001)(3190300001)(189003)(199004)(2351001)(77096006)(106466001)(36756003)(2906002)(105606002)(53936002)(76176011)(86362001)(50226002)(8936002)(50466002)(48376002)(59450400001)(47776003)(305945005)(16586007)(85426001)(5660300001)(81166006)(81156014)(356003)(68736007)(498600001)(51416003)(6666003)(97736004)(316002)(8676002)(2950100002)(104016004)(4326008)(6916009); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2704; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD008; 1:d0j6LwrFug3phdgTT1HSD85e0CpdaafwNprHVm2+ovniOFU0x4A8iCsrMtxSSNWwsVm3zoOau1say6w4dMDFigii/dA2b9GiNYkMx4xgh5KyZ8F/RUlMgshGxc++qW9Y MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 745d40a8-0179-479c-aae5-08d542220499 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:MWHPR03MB2704; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2704; 3:/nLrU2hDtY9wZ7t9TmsADT2RplUCToCeyOcGYUhGSVDEiIp3twozLU9U94qO2QGGvDji8vNKOTadSXPXI5AiB5UbsWqTeSBpxhzMNiWwddU0RCzosis7BLUs7Y9/f2tdDFU5NF6A725I0jJ2fumu50V5O22X7H4ieUpxaBHcr4Z6iaAyR0pI2BUpbdSjxF8/nCsgpCDJtaPFNgNsho7la6pvXVpuFR5gf7xh5wMdJBcC6WXQCH1zcmK9kjxdFD2Xn26Bt1mTx0v2aPk3QUS6sRt7b95H//Y4Zg02yUtUGQ99tpThUgQGtxgPATBNfC6umZqy9sBwECMG9w+pdWnVqCgFxxPtd+5GLHaeHCsK2+o=; 25:kkXc3CDM9toxNMuUVTikiuURJyxPpEXTljia8rawwcWKHxl5zkUoz7dOq8b/LIvFFWsG567pvGpoeCob0Oks1L0HV1Mc7ImVBOSDDGaWOwyVbi6rGgXpnpu81U/m4yBN8ejaX5iF2JkLOUVRv1zubDnCc7An9d75Zk6rkZR6LpgEJYDAysUSpiVPysi3TCVEbY/QErVMrJzxzlVWbqM6+QRzBNQDL3VV/dZCrFAoh78nCaIHszLSELKOo9zt6W+iQPX0vi/wIrB2hviNJN6/u2YbBfgv8M7rrDqmWF9v8TO2/rnoUeEcbhGCndym73byqLxKxQ/gmBTWmgWSSAL5YRghqFOQwAnb8BOe7mGOHF8= X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR03MB2704: X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2704; 31:jLii7r0xY6cBy0C65AsgZSDhV/GodSEbPRlpwp0JRzoLsmfdlGW1vcRV1SY31vlQTfEvA7TD/IWiqHVDxgwnM604q81/i1jLsJlf93a3zgaUgNI0XX0FdTo2/o8muW50hNDtxPLaO8BpC6LxDm6DVjeZ9l9E74KNTDaTeblCoPMMQk5OkPfxOMI2ThMwt5uAQA+jQ4m4PjT/fVRj/vU8tns0TqZK8YZIatppOB3c+bk=; 4:IZiNaZ3/wedUSvt7XKgd0BGACL2zcxc2svplhydom36vX1ZwRrdSh6IaXqNVDsCH2xn/AwGD1jVurecS4TH9OJll/zExJCeRtLhhhY/HL+ZRJhRLZSoPD79vJEjOuhYlJGfYLT4Nqs1wRyKr4+8dGyFr4u8daS9K9FiwZI1mGmobcogD2BCn7zVPo/T+71FS7ndQUhPQzTIQ9t7OIrhGx88CrBMtvEZZvdg7bz8xE6ixNiuLbtA115l3dTW2YOR66FHMhd3iy8Q2D1yu0jKtG7uEYkww7dTOkOq6v4Kb5oKYM7fkYvkB1tZlYPT02iAqzTV58PNiF2/irnacqb++Ow== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(788757137089); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231023)(6055026)(6096035)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123561025)(20161123559100)(20161123556025)(20161123565025)(20161123563025)(201708071742011); SRVR:MWHPR03MB2704; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:MWHPR03MB2704; X-Forefront-PRVS: 052017CAF1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB2704; 23:UKIrdaP36bjsV9r0ZS2huoLjE5+TYt2pNGsfgi7Fs?= leLq1K8PO/an9BKtn3MOHMqGEX6Kp6Wi0NZhvmbY/lAS8An4aPbOInitD9gUbV9GZ+19ULwbnDFYXOo4QO1j/qfbmZoI07LQ9Ou6Ecu+knnTRdnK/sm4LJA0a7kOGAxLlmFx50zSBwnGCZ0mC4TnIfBA78tuSF8EekqWGXCSKPqL8W3X55sPOWqvk2rbzmCSQjtCjNE/CfsNNw9+pNiTAFtpIdw09sVZRXepEG2KDIZxZf7nlr4g3qdo7MJJWBMvaNrD1VnDNBGe5qF7Qn3IV9vuD8eO03Mr8N6gdSU8yblcd1kqlvRLDLyFaTnAOR2ZDZeu/fdf5ConA3H4Lx4wxqCRUJKQjPYkMbnEoX2DOiOq5IAfYi69g5Cc0KKJnJ5vRWr7K91GQFwDdQSFMYlYqt06reQ6b0dYvIbgRullUwrX2Q8KzUZCQFfGRRuikmaE8bC2SCfy7NEMo6dfMW10xwH9k11cDNmXa4G6MFUVf6L9qgLXVp9VXeQIkH462UwolF9YGfWzZqJEoPFeZq4Z57TEnwlZ0JGa0rCz0DBydjhOQcYG16yCekJ7e2MYXawPdy52GsZKYuJo+bMC6gfo4EpKxf9yT0aJzu78Ahl7t+djAs0CUNfP/uh//2s6b6vCi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MkdFOK++LlfhCANIjy4=; 7:LCwDJTBCYCFuqL5ED7InDkxS7oRC68dmSB4DupnvrEBUwUHcXAmyKqJF+rgGQ8CJp2n5rTxbgEV5jf3l/o6l3Km64eGax4lzXy6BtMTtb/gFg1I8Qr5Wvf2EEEyf8CUo+x0pHiJyd737kMcy0btEx4FowAlgDQB6drL9GAl1l134lA1E58reaNwQf+Alre6h9hy2DP/KdIFPmG0smGeT+WEDzkZu3UwTXHLXY/fx7c7xVNgMXmgMq04TRjm3f00x SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 12:07:01.4578 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 745d40a8-0179-479c-aae5-08d542220499 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR03MB2704 Subject: [dpdk-dev] [PATCH 06/18] net/dpaa: add frame count based tail drop with CGR 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" Replace the byte based tail queue congestion support with frame count based congestion groups. It can easily map to number of RX descriptors for a queue. Signed-off-by: Hemant Agrawal --- drivers/bus/dpaa/rte_bus_dpaa_version.map | 5 ++ drivers/net/dpaa/dpaa_ethdev.c | 98 +++++++++++++++++++++++++++---- drivers/net/dpaa/dpaa_ethdev.h | 8 +-- 3 files changed, 97 insertions(+), 14 deletions(-) -- 2.7.4 diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index eeeb458..f412362 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -69,6 +69,11 @@ DPDK_18.02 { global: dpaa_svr_family; + qman_alloc_cgrid_range; + qman_create_cgr; + qman_delete_cgr; + qman_modify_cgr; + qman_release_cgrid_range; local: *; } DPDK_17.11; diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index adcc219..6482998 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -73,6 +73,9 @@ /* Keep track of whether QMAN and BMAN have been globally initialized */ static int is_global_init; +/* Per FQ Taildrop in frame count */ +static unsigned int td_threshold = CGR_RX_PERFQ_THRESH; + struct rte_dpaa_xstats_name_off { char name[RTE_ETH_XSTATS_NAME_SIZE]; uint32_t offset; @@ -447,12 +450,13 @@ static void dpaa_eth_multicast_disable(struct rte_eth_dev *dev) static int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, - uint16_t nb_desc __rte_unused, + uint16_t nb_desc, unsigned int socket_id __rte_unused, const struct rte_eth_rxconf *rx_conf __rte_unused, struct rte_mempool *mp) { struct dpaa_if *dpaa_intf = dev->data->dev_private; + struct qman_fq *rxq = &dpaa_intf->rx_queues[queue_idx]; PMD_INIT_FUNC_TRACE(); @@ -488,7 +492,23 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, dpaa_intf->name, fd_offset, fman_if_get_fdoff(dpaa_intf->fif)); } - dev->data->rx_queues[queue_idx] = &dpaa_intf->rx_queues[queue_idx]; + + dev->data->rx_queues[queue_idx] = rxq; + + /* configure the CGR size as per the desc size */ + if (dpaa_intf->cgr_rx) { + struct qm_mcc_initcgr cgr_opts = {0}; + int ret; + + /* Enable tail drop with cgr on this queue */ + qm_cgr_cs_thres_set64(&cgr_opts.cgr.cs_thres, nb_desc, 0); + ret = qman_modify_cgr(dpaa_intf->cgr_rx, 0, &cgr_opts); + if (ret) { + DPAA_PMD_WARN( + "rx taildrop modify fail on fqid %d (ret=%d)", + rxq->fqid, ret); + } + } return 0; } @@ -724,11 +744,21 @@ static int dpaa_fc_set_default(struct dpaa_if *dpaa_intf) } /* Initialise an Rx FQ */ -static int dpaa_rx_queue_init(struct qman_fq *fq, +static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx, uint32_t fqid) { struct qm_mcc_initfq opts = {0}; int ret; + u32 flags = 0; + struct qm_mcc_initcgr cgr_opts = { + .we_mask = QM_CGR_WE_CS_THRES | + QM_CGR_WE_CSTD_EN | + QM_CGR_WE_MODE, + .cgr = { + .cstd_en = QM_CGR_EN, + .mode = QMAN_CGR_MODE_FRAME + } + }; PMD_INIT_FUNC_TRACE(); @@ -758,12 +788,24 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, opts.fqd.context_a.stashing.data_cl = DPAA_IF_RX_DATA_STASH; opts.fqd.context_a.stashing.context_cl = DPAA_IF_RX_CONTEXT_STASH; - /*Enable tail drop */ - opts.we_mask = opts.we_mask | QM_INITFQ_WE_TDTHRESH; - opts.fqd.fq_ctrl = opts.fqd.fq_ctrl | QM_FQCTRL_TDE; - qm_fqd_taildrop_set(&opts.fqd.td, CONG_THRESHOLD_RX_Q, 1); - - ret = qman_init_fq(fq, 0, &opts); + if (cgr_rx) { + /* Enable tail drop with cgr on this queue */ + qm_cgr_cs_thres_set64(&cgr_opts.cgr.cs_thres, td_threshold, 0); + cgr_rx->cb = NULL; + ret = qman_create_cgr(cgr_rx, QMAN_CGR_FLAG_USE_INIT, + &cgr_opts); + if (ret) { + DPAA_PMD_WARN( + "rx taildrop init fail on rx fqid %d (ret=%d)", + fqid, ret); + goto without_cgr; + } + opts.we_mask |= QM_INITFQ_WE_CGID; + opts.fqd.cgid = cgr_rx->cgrid; + opts.fqd.fq_ctrl |= QM_FQCTRL_CGE; + } +without_cgr: + ret = qman_init_fq(fq, flags, &opts); if (ret) DPAA_PMD_ERR("init rx fqid %d failed with ret: %d", fqid, ret); return ret; @@ -845,6 +887,7 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) struct fm_eth_port_cfg *cfg; struct fman_if *fman_intf; struct fman_if_bpool *bp, *tmp_bp; + uint32_t cgrid[DPAA_MAX_NUM_PCD_QUEUES]; PMD_INIT_FUNC_TRACE(); @@ -881,10 +924,31 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) dpaa_intf->rx_queues = rte_zmalloc(NULL, sizeof(struct qman_fq) * num_rx_fqs, MAX_CACHELINE); + + /* If congestion control is enabled globally*/ + if (td_threshold) { + dpaa_intf->cgr_rx = rte_zmalloc(NULL, + sizeof(struct qman_cgr) * num_rx_fqs, MAX_CACHELINE); + + ret = qman_alloc_cgrid_range(&cgrid[0], num_rx_fqs, 1, 0); + if (ret != num_rx_fqs) { + DPAA_PMD_WARN("insufficient CGRIDs available"); + return -EINVAL; + } + } else { + dpaa_intf->cgr_rx = NULL; + } + for (loop = 0; loop < num_rx_fqs; loop++) { fqid = DPAA_PCD_FQID_START + dpaa_intf->ifid * DPAA_PCD_FQID_MULTIPLIER + loop; - ret = dpaa_rx_queue_init(&dpaa_intf->rx_queues[loop], fqid); + + if (dpaa_intf->cgr_rx) + dpaa_intf->cgr_rx[loop].cgrid = cgrid[loop]; + + ret = dpaa_rx_queue_init(&dpaa_intf->rx_queues[loop], + dpaa_intf->cgr_rx ? &dpaa_intf->cgr_rx[loop] : NULL, + fqid); if (ret) return ret; dpaa_intf->rx_queues[loop].dpaa_intf = dpaa_intf; @@ -939,6 +1003,7 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) DPAA_PMD_ERR("Failed to allocate %d bytes needed to " "store MAC addresses", ETHER_ADDR_LEN * DPAA_MAX_MAC_FILTER); + rte_free(dpaa_intf->cgr_rx); rte_free(dpaa_intf->rx_queues); rte_free(dpaa_intf->tx_queues); dpaa_intf->rx_queues = NULL; @@ -977,6 +1042,7 @@ static int dpaa_dev_uninit(struct rte_eth_dev *dev) { struct dpaa_if *dpaa_intf = dev->data->dev_private; + int loop; PMD_INIT_FUNC_TRACE(); @@ -994,6 +1060,18 @@ dpaa_dev_uninit(struct rte_eth_dev *dev) if (dpaa_intf->fc_conf) rte_free(dpaa_intf->fc_conf); + /* Release RX congestion Groups */ + if (dpaa_intf->cgr_rx) { + for (loop = 0; loop < dpaa_intf->nb_rx_queues; loop++) + qman_delete_cgr(&dpaa_intf->cgr_rx[loop]); + + qman_release_cgrid_range(dpaa_intf->cgr_rx[loop].cgrid, + dpaa_intf->nb_rx_queues); + } + + rte_free(dpaa_intf->cgr_rx); + dpaa_intf->cgr_rx = NULL; + rte_free(dpaa_intf->rx_queues); dpaa_intf->rx_queues = NULL; diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index ef726d3..b26e411 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -60,10 +60,8 @@ #define DPAA_MIN_RX_BUF_SIZE 512 #define DPAA_MAX_RX_PKT_LEN 10240 -/* RX queue tail drop threshold - * currently considering 32 KB packets. - */ -#define CONG_THRESHOLD_RX_Q (32 * 1024) +/* RX queue tail drop threshold (CGR Based) in frame count */ +#define CGR_RX_PERFQ_THRESH 256 /*max mac filter for memac(8) including primary mac addr*/ #define DPAA_MAX_MAC_FILTER (MEMAC_NUM_OF_PADDRS + 1) @@ -79,6 +77,7 @@ #define DPAA_PCD_FQID_START 0x400 #define DPAA_PCD_FQID_MULTIPLIER 0x100 #define DPAA_DEFAULT_NUM_PCD_QUEUES 1 +#define DPAA_MAX_NUM_PCD_QUEUES 32 #define DPAA_IF_TX_PRIORITY 3 #define DPAA_IF_RX_PRIORITY 4 @@ -128,6 +127,7 @@ struct dpaa_if { char *name; const struct fm_eth_port_cfg *cfg; struct qman_fq *rx_queues; + struct qman_cgr *cgr_rx; struct qman_fq *tx_queues; struct qman_fq debug_queues[2]; uint16_t nb_rx_queues; From patchwork Wed Dec 13 12:05:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 121745 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5383553qgn; Wed, 13 Dec 2017 04:08:18 -0800 (PST) X-Google-Smtp-Source: ACJfBov3Cj1TthYS9tKbq70k82anXyVuchzw3ulc0r8YK5efJnd6Gy8WD/7iM+p8XejcqebQoXXk X-Received: by 10.223.164.218 with SMTP id h26mr1704293wrb.271.1513166898059; Wed, 13 Dec 2017 04:08:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513166898; cv=none; d=google.com; s=arc-20160816; b=ygQINaIUabAVDT18VICSziKqZPed7JrNlXRuhH9ZvNWv1GuJc3mYBdKyEeqfT0OhDC J08ta92NVgXmnRwZEwVlRhAAEYjaycccnfAabAPs0SAjKkBJJL6Is4BpkduGlC1bah7i VobpM3h3gMjcpwnEdonrKKB6Dm/03RfrArspTiVOmFzyU2rso1A3z0yevxPv+7Ae61Vh PVDzelxP4Kc9YctfdDH9OjkET765496WvEARmX/25dZnQzJhX13o3Af8la85yl0CD8aE 2HZKCBwQGKAdYWQcnr9Dcpc0p+2azfKnwKjVsJZSpcueyzj5e814Iz+zTwVw5ZS7oqI9 j6bw== 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:arc-authentication-results; bh=kzL25zPOtJI73n5wxi3IdY6GWEiuWgBkShQmcrmM5YI=; b=QjQohtE4rWeZUp0il7N6fM9Eld2BRvBRnnwpGvKNZ/fVkk5Pkd0e988Tj9xpl3GeVL 7BhT0iSzAEGuhhS7wXDyqUVz2moEYPb14/SMEMbUuZqXGyRVRCazcpJiAPGDiFp1Hcag f9GwRm3CTfY4Wf56q2BFzP6RGkvLPcAeZh20ijnWa8xXEZiTTKYfRQ6bwE9PNBwDrW7c DCOdbxUBGSjaTH9M5hsjgl/J16dvmrYrybm3lRXPH9Qo3bwE+h3TiGakdeV/+p1xHEHN T85zwXu3mDOyfBCIknlUGrV5KerXQnnUPkUafS27rAhicqN/6l1/njbK/StHnnWkzHL9 qEEA== ARC-Authentication-Results: i=1; mx.google.com; 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 e191si1365725wma.186.2017.12.13.04.08.17; Wed, 13 Dec 2017 04:08: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; 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 9F6B71B193; Wed, 13 Dec 2017 13:07:15 +0100 (CET) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0042.outbound.protection.outlook.com [104.47.37.42]) by dpdk.org (Postfix) with ESMTP id 938247D05 for ; Wed, 13 Dec 2017 13:07:11 +0100 (CET) Received: from BLUPR0301CA0027.namprd03.prod.outlook.com (10.162.113.165) by CO2PR03MB2360.namprd03.prod.outlook.com (10.166.93.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 12:07:10 +0000 Received: from BN1AFFO11FD018.protection.gbl (2a01:111:f400:7c10::166) by BLUPR0301CA0027.outlook.office365.com (2a01:111:e400:5259::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Wed, 13 Dec 2017 12:07:10 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.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 BN1AFFO11FD018.mail.protection.outlook.com (10.58.52.78) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Wed, 13 Dec 2017 12:07:03 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vBDC6t9R008652; Wed, 13 Dec 2017 05:07:08 -0700 From: Hemant Agrawal To: CC: , Nipun Gupta Date: Wed, 13 Dec 2017 17:35:48 +0530 Message-ID: <1513166759-13466-8-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131576404231966064; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(7966004)(376002)(346002)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(316002)(6916009)(16586007)(36756003)(77096006)(2351001)(50466002)(54906003)(106466001)(105606002)(2906002)(81156014)(6666003)(81166006)(356003)(97736004)(47776003)(48376002)(2950100002)(50226002)(68736007)(8656006)(5660300001)(4326008)(76176011)(85426001)(51416003)(8936002)(8676002)(53936002)(498600001)(305945005)(104016004)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR03MB2360; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD018; 1:qpVOhQ9dLeBgb/F+GfMACTXi9+mJ8aS4V/T8bxPzr4ZB+BNk5sk7PygVuRevPyNV09+2k4Gtr7LFZUSZfEbgz+83K+T0UHu3p8G/5zi1PdKyZwqilTdvLcOABlFLRj4l MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 49c78db8-7e22-41c7-cd70-08d542220588 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:CO2PR03MB2360; X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2360; 3:hfZ1CmrBMWXFVehs4wH0qpWU7z9bvYDud74hKYiAxVAZP0WKd3HpVp5jD8QPOa39ykGt47421LeFTWw0J+ySen4XVXTcpaAvoq/kRgye3Lq4VEoS1bN+vtoT59u2ZqNQMLzEoxZ0T1calu3PiMMetmX4HQ1Xum413e3LRds3BZ4L1bx8KpoFgjPthpyVHHnQ12GPlyH/3bxFnXzsuBv8OWquKhrj4pRNZ+ZR0WQylHMxgWHmPl78lc5h0S/qG6I3CX7pq+mvr3XcD58zTwQwZtbhwysN6dXBqMrkphx4mM4+1ylMJd7e8i1FMurKtRNa9M/yAmOVvJpQboA4NzvNMKUpMNZmyUZtOEfbs3kyP04=; 25:nqWuxrWKqcnIOF57N29Idu2rpvzAa/EsKFIhchi7VjlxUf8rlHWiRAG6dK/LSPYuC1kEDj93qwKtf77XGJ/I6F1djbkvxEKO9vNAqHlRikY6ERXDETWPNed1m6ux8HbBQccyUz6yfEU8McYF9/vSc37YUSamj5SohKhfen+jJFXRkgt5iVLsJM/+b2isFrnOVFOsjH3t51tSSPP7xXEJE6sENca/cOn+lcKJW2im9gjugwOSvAeNJfpKVrpKnkxMJSfFdjzWCAkrEnS9RFWhQ0qW75YKd/GMXFCfbjtpfWI1tzupp1nL/kf1DogqPv2zDLKKwnVUVdkErnn/VFhGGI/4h/sKjcTwASbV24HlmiI= X-MS-TrafficTypeDiagnostic: CO2PR03MB2360: X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2360; 31:l2noMG/q471LtJOS7f6LCnTWIj823e5t1mt71FBaSouPcrMIQ2fbLWMDdzm7CBm+j1bUosl4uxJnO3IoJw9c/qvOnaGkj/uZ5fUSuSaKYJIF5LDoe17PR+plV98ykDuTsI6l4eXWW+KSAtXtU8H3rUE+KNSnRdvFLp6O861qNhz4sF5LyZaHvQfDYEuWMUDRb4hDH+zEP313k7XqpiF2qpLGWOVlZA7W0bhMii2+81M=; 4:GKcaO1FJJH5zdEmcc4XI/vcGpEf6JswXIjZSgjpIUOwqfEj2tokE0APB5zcUPUflzxbCTWnyqdgis26iUOPPOKAiqxZXt05FhiAcrBtkL6SF8EV0b0VvGj0Iz7mW/at87Y1ZjE8x5SXFm5iKrOL9LIpH9NtdO/Q5Qt37D+g2Xb15vLQUPzcBHZFw4kmYPCOn/ModBUomS9mvK3NnlFXRiJ7Z6hZ4pm8zqwp6RU5iKgLGKum2XI1gOEY6CzltQoDJ0pXiRsNm0dRJqnW1Qv7+EGBo2hlBV7NTkOY/8Q7UeD3QiFpgQmqJIXX6TozC7SLXgtxwYNw+dbTOabcvttwRlXw1gXTMZeuUcJ36lHhiZPI= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(10201501046)(3002001)(3231023)(93006095)(93001095)(6055026)(6096035)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123561025)(20161123559100)(20161123565025)(20161123556025)(20161123563025)(201708071742011); SRVR:CO2PR03MB2360; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CO2PR03MB2360; X-Forefront-PRVS: 052017CAF1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR03MB2360; 23:+OAEEjCepS9mcmNmAuirwRFpHG8Bvb7I7atuuV66+?= deHcftBEHuOVupmaw6Doj0bP11XOVWbvE6r7tG1LYXFSIXuEvMdwMVOU9WxoZ7roncZwv3lfmWaZawaNjgYVQdmkHy35veeXJygVSRk2ttySrJaK2AzZhToptFG6JZVA1rDvBNLWB/RAcqQXCBv+BB893erpRqvicPLpHR531XrC8U1nqXI10zLZz/511/Iz9ePnhxKMx/yHd5rQhcenkhbfxl9OFSQbEW+3gcEgz+G8N4m9Ns1ItXaH/D/nCf8TQ2GLTAqjmWOOfv/DSV5GImAVzzVejoqTrp9plcD90DO+v1KWWeS+U2bZ+7B+4umj1K9zi/GrXgcMEmElbwtXVBX9FvUkC+6DnxtefUb/LLIG3XXKfPPOWJb7aHzp/5VrEhHqaPkaJkEXRdtj3tADXJgelFrA8fszBhh/Cmoej+R9fu0YI7/7/oaQlmjK6KqHMEV/RciMJ19W6yuIdDX1nrjW1RWsTflgpr+QFp87u89KMCcORQoMJIPpdsQDLcVbj8Lci2zvQboHn9HdVFWHZcdS3JAjnMzqO4cORyK/LBJwRWskRzIIGbxYoCp6Np6YgR9AwnqlGoE3f8PHumZlAniK6bHubUJ4+7pcPo6YOi7b2SUdGsZEMFv7uIE/t5jr1lvntfNa4OmH9xG8ikDFf0Wnzq9fwfgcQi3QXJwkhjl3ojnNz6GcqMerTZcSV2db6vL08lMZdXrV+nPhTlvqK+m3mbEY3D9O1/VZ4Gq2aagKj4IKsWbI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qdh1URSudaTYYfwZzruNpAonvl7k3gwtbPa6tZRNLlNKw22JUpsXc66kxdM3uN8F/qlTk68F3n4V7dLi1lyN2poCG9/wuYfmw84Gvd59qdlzijvWyud8a7K/GpyizvfKSoareGv9AA7RxnW3tOQtyNUYbmHIBXWn SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 12:07:03.0250 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 49c78db8-7e22-41c7-cd70-08d542220588 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR03MB2360 Subject: [dpdk-dev] [PATCH 07/18] bus/dpaa: optimize the qman HW stashing settings 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" From: Nipun Gupta The settings are tuned for performance. Signed-off-by: Nipun Gupta Acked-by: Hemant Agrawal --- drivers/bus/dpaa/base/qbman/qman.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index 87fec60..77e4eeb 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -40,6 +40,7 @@ #include "qman.h" #include +#include /* Compilation constants */ #define DQRR_MAXFILL 15 @@ -532,7 +533,12 @@ struct qman_portal *qman_create_portal( p = &portal->p; - portal->use_eqcr_ci_stashing = ((qman_ip_rev >= QMAN_REV30) ? 1 : 0); + if (dpaa_svr_family == SVR_LS1043A_FAMILY) + portal->use_eqcr_ci_stashing = 3; + else + portal->use_eqcr_ci_stashing = + ((qman_ip_rev >= QMAN_REV30) ? 1 : 0); + /* * prep the low-level portal struct with the mapped addresses from the * config, everything that follows depends on it and "config" is more @@ -545,7 +551,7 @@ struct qman_portal *qman_create_portal( * and stash with high-than-DQRR priority. */ if (qm_eqcr_init(p, qm_eqcr_pvb, - portal->use_eqcr_ci_stashing ? 3 : 0, 1)) { + portal->use_eqcr_ci_stashing, 1)) { pr_err("Qman EQCR initialisation failed\n"); goto fail_eqcr; } From patchwork Wed Dec 13 12:05:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 121746 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5383776qgn; Wed, 13 Dec 2017 04:08:30 -0800 (PST) X-Google-Smtp-Source: ACJfBosC8ccd3C4Z4sj2tJAagsFqrRkAS/yOKEKvNXNc0acW3BlpMqYcDsQfQE1eNfospfBv+CTp X-Received: by 10.28.109.6 with SMTP id i6mr1746165wmc.108.1513166910273; Wed, 13 Dec 2017 04:08:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513166910; cv=none; d=google.com; s=arc-20160816; b=UmPW+wlJAeH8bSkUiBa7NXQ0tUbbbrQZfCl28MC8taYMU5u2T+TiMol1cEePQsHbl0 IhLDuu3k/71TqiZwNq26QRCthQPgh7AooWbNBVAJQZ2lVumMfD+TQBHdrxOxLEqQm8Ir /gaxE5m/YHvO+OIoLS1KpZZ/VDuQxowWSBoCUeg12T/iidPnJXk3NBRGpzbLRvFJ4k27 XR3B78DTZOw7SKgzmDKCiG/VvQYwDL9Wmx/oAEi4jhVAF2cWhdn6tes4hLHzlKNg6xbb OZf9HJhIiElhYLI2olpeQU+RR2fY3n/1e+aVSlhr5tUljlnrSVKkoXXYuf+Lwld7KOw+ iN0g== 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:arc-authentication-results; bh=tVl2msmFxrbAdjDEE3hPV4aw4zmsuYmxm7tlXmAKnTA=; b=hI/1M23HzmB0NU/ANLCg4b1o1Yy3We7I7Hea8IJPvMMG7bb/HewnVgv7BL/k2W8PHv H4+k++hw9V+92mdN7GUlO4ObjreQwwStIPK4ZCCwgaNQdIAxKww7IXlpiyZ8qF+HGBsu 8nhvmc9cZSc9zeuk+V+xc227Ymclnx5+gu0xko8kUtX2GiJx17E5dAtj1jB4WvH/FLk4 hh4k0gIrxGEHTnkuz65UlhBWlk9ni3JEngJI16pBLsmFFxcV/0FJrfj0vFX4N/2xXdLk UNkQ5fztQ+CmfoxxHP5YKDCuRRdgC56rk2ii5txNtuPW44JH7fM0NlIPCY/Ul1caLU/M G7jg== ARC-Authentication-Results: i=1; mx.google.com; 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 31si1321887wrw.465.2017.12.13.04.08.30; Wed, 13 Dec 2017 04:08:30 -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; 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 805981B19C; Wed, 13 Dec 2017 13:07:16 +0100 (CET) Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0085.outbound.protection.outlook.com [104.47.40.85]) by dpdk.org (Postfix) with ESMTP id D28111B18C for ; Wed, 13 Dec 2017 13:07:13 +0100 (CET) Received: from BN3PR03CA0112.namprd03.prod.outlook.com (10.174.66.30) by BN3PR03MB2355.namprd03.prod.outlook.com (10.166.74.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 12:07:12 +0000 Received: from BY2FFO11FD008.protection.gbl (2a01:111:f400:7c0c::103) by BN3PR03CA0112.outlook.office365.com (2603:10b6:400:4::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Wed, 13 Dec 2017 12:07:12 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.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 BY2FFO11FD008.mail.protection.outlook.com (10.1.14.159) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Wed, 13 Dec 2017 12:07:04 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vBDC6t9S008652; Wed, 13 Dec 2017 05:07:10 -0700 From: Hemant Agrawal To: CC: , Nipun Gupta Date: Wed, 13 Dec 2017 17:35:49 +0530 Message-ID: <1513166759-13466-9-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131576404250725125; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(7966004)(346002)(39860400002)(39380400002)(376002)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(48376002)(305945005)(356003)(106466001)(50466002)(81166006)(53936002)(81156014)(105606002)(2351001)(54906003)(76176011)(59450400001)(85426001)(51416003)(5660300001)(8676002)(8936002)(316002)(97736004)(498600001)(16586007)(2906002)(50226002)(68736007)(4326008)(8656006)(6916009)(2950100002)(47776003)(6666003)(86362001)(36756003)(77096006)(104016004); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB2355; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD008; 1:9SgMSzQKrItn4oC1cQV80TMs30ZHIdHV1c/J1LS0L2URdsmxwCzdJvF6QHIw9vW1hTtGbpjTTIJlX9642sJod8Vt1gRVbIAwRaz7moZ+pJXXzcg+XHFcVWvgTRFm5LIu MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a38773db-0e38-4f2c-0b05-08d5422206a7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:BN3PR03MB2355; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2355; 3:Ivno5am1W2rugg2K8VHRieJTkEEe/9nFSKRDfPjXcs9ob4iutWDKD1X3+vOCRAF+fui6JGQ9LhhO3z42Ey3Voq4hJ5e7CF285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/nwP4X1pKKg3L6GehtE6GY6ib0PARHN0uWlU9KTZESP0s/GwiNZ9f0+0rlIjrv5vfR458WFW3hk2AOmghA/bK0ZADbH7utvgw1YA1VtUiWGnZ20RGJlMuJN0Qa2Wmwd5zJ/rGeKHskfIg6uDfb7Z8TawZ+/XWMVVZihIKmzSIioD2OyiMKyfB6qekjQA7BZgp8OB4 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231023)(10201501046)(3002001)(6055026)(6096035)(20161123565025)(20161123563025)(20161123561025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123556025)(20161123559100)(201708071742011); SRVR:BN3PR03MB2355; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BN3PR03MB2355; X-Forefront-PRVS: 052017CAF1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR03MB2355; 23:K2MRXX0Vv38XAYdTidOr9rMKUSLAOGY3zVS4oVNwF?= om1CdBdCMpGLt53a9wleJDGWQedLGbHkr+98/Nh+GtAbRs+wMMyHum+VoCUBYu+eTvnZOk4fRjAeVIrIoJy7IC/T6EuBC8fLCYGiIT+fe8v+9QIxzuROzgBx2OqPVadA7nixy0tK+H8PXIZO033uguR5BLaNy7kU1YVYwbJwYldM2ca6GedkzEvJ7vDw4VgI1kKPEpIw8UG/VN0mqlqvNMmN5lAq4YWWow30M9XesDXYedSK4okn8fOnGTeh8kQY+YPidp2vOhcFr+OIEK1BDI/qtqLoS9387Pbz39QJS3FjxskrdZcb5gGwc/le02a1OLCl9//kDQ7AsRw6iTiEC/v1NyZAdvRnmXdiuZ9H8lxe/4GwvT8SylUh190q0WYVfDE1OaBe9H2Gpu5mSZPBa15GVQnaiLUPc6zL0Z2FF6lOVNvOPR7gu9wptoZrFb2eGa2WsriG4ThVATJK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caOdq9w634sYIwy9LRxYNNPI+oyFSIsvPDvg4NZH/KXjvQjkNn9Ds102nmaNxRz6ejV72IvGQetd94GsQODxbiyizWJfQrxxEr1ADcWmSAtrlzqbHTVH9WUEtOcoRqXTmVGPhu5yMRchwpozVwKlq+nQ=; 24:4VgpUfori/0oiOFOBq028SaovM/EiYXbCyYRwIFXQXRwdIIDZPG8in8ezy1SbPTtWnQ7wwh4EBYD42HkEQtltscSG33jFzIoTYHha4OJwKA=; 7:mJbqCNEFcAKNm2u1uv2fz/eSICXnn8p8bfWgdRYf/QhenzaKLlIYg7IMiEIJ5Xw3D7tNzXDXg4nESMTGbUykEvxdtR2T0dMsJVNjq4UecP7M6CG+rufdLgR/THQRrcQuedLgLv/zWopu1fkaT8MBJRpaaW7YmVel3E5i4DeijigWGH0B8438OONNiqTlrClFkf0vk+eoYV5RVE79pC7Fc7OhO3f40qcE6Uf8L3YlzzDtaVDSaHm+PbJx/zYoVPOC SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 12:07:04.8697 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a38773db-0e38-4f2c-0b05-08d5422206a7 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR03MB2355 Subject: [dpdk-dev] [PATCH 08/18] bus/dpaa: optimize the endianness conversions 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" From: Nipun Gupta Signed-off-by: Nipun Gupta Acked-by: Hemant Agrawal --- drivers/bus/dpaa/base/qbman/qman.c | 7 ++++--- drivers/bus/dpaa/include/fsl_qman.h | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index 77e4eeb..400d920 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -935,7 +935,7 @@ static inline unsigned int __poll_portal_fast(struct qman_portal *p, do { qm_dqrr_pvb_update(&p->p); dq = qm_dqrr_current(&p->p); - if (!dq) + if (unlikely(!dq)) break; #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ /* If running on an LE system the fields of the @@ -1194,6 +1194,7 @@ int qman_create_fq(u32 fqid, u32 flags, struct qman_fq *fq) } spin_lock_init(&fq->fqlock); fq->fqid = fqid; + fq->fqid_le = cpu_to_be32(fqid); fq->flags = flags; fq->state = qman_fq_state_oos; fq->cgr_groupid = 0; @@ -1981,7 +1982,7 @@ int qman_enqueue(struct qman_fq *fq, const struct qm_fd *fd, u32 flags) int qman_enqueue_multi(struct qman_fq *fq, const struct qm_fd *fd, - int frames_to_send) + int frames_to_send) { struct qman_portal *p = get_affine_portal(); struct qm_portal *portal = &p->p; @@ -2003,7 +2004,7 @@ int qman_enqueue_multi(struct qman_fq *fq, /* try to send as many frames as possible */ while (eqcr->available && frames_to_send--) { - eq->fqid = cpu_to_be32(fq->fqid); + eq->fqid = fq->fqid_le; #ifdef CONFIG_FSL_QMAN_FQ_LOOKUP eq->tag = cpu_to_be32(fq->key); #else diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h index eedfd7e..ebcfa43 100644 --- a/drivers/bus/dpaa/include/fsl_qman.h +++ b/drivers/bus/dpaa/include/fsl_qman.h @@ -1230,6 +1230,8 @@ struct qman_fq { */ spinlock_t fqlock; u32 fqid; + u32 fqid_le; + /* DPDK Interface */ void *dpaa_intf; From patchwork Wed Dec 13 12:05:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 121747 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5384141qgn; Wed, 13 Dec 2017 04:08:46 -0800 (PST) X-Google-Smtp-Source: ACJfBos06cGswzjkh7XXlzMaszhvDWatXzKhv03j192cjIpvzQFBafE9gJM29omh5b8nQt0Y5Pme X-Received: by 10.223.199.70 with SMTP id b6mr2251757wrh.25.1513166926063; Wed, 13 Dec 2017 04:08:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513166926; cv=none; d=google.com; s=arc-20160816; b=eTegUk7huoMWu8pkKfLAJsw6nQ0cpHWF/zrKvp0qJ8avd57+uZa4df0LvNmKwmR6Q4 ZzsxUMy0o8072qWICR3IhohJdDQ74LHzZu/MG6mCY0N5dnWcbV7Zs5UAnNPzTtsJOqCw BI/jfm/n5UWjjKqiQem7OfntB8dMfepbjVrLz2LvOhxovFmWn5TDqGX0wMOjVepTljMw JquBPUCZB6aOzNCS4JN2bnR1VVhCyAToITbm6bYbqS1LL6H6z6lqVeVGcxDSdB2Wd663 yt0xe6pQO/dVRnHXBZymIRmy57cAN/hpYHisCciN4hoc28sjeTu+iRk8UQdHFaf89civ WJzw== 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:arc-authentication-results; bh=mlOvF94rf8MjlqGmKX2ah08VIwnBT1lQ30jcnxpcP/E=; b=nXvCynjsBZyzWiiOPhygHK54mmmEkmNEbzaLztwPSq/HrY/V7Eko0NJp+dvNGGeOZ2 ces9ePY0krbOZPs9ZFVc/lWl0l8gtnu28U9XwGdpObPVY1ivdSIA7qdF0eKcv/M8304H zr4HDWQrV+YcGWUCjqlt8/REAJcNUvRYQlD1oopxyBp3N3l5mA6/PxWnX/qg708Vezsz G4dGGmV7kesy08di0f/3yGZdRjpi1wWkZTY06Doo1dbVGXWj6MLdnAQxJqQoeZql5uca 1e/De74d+Y66FgkBWzcjnsgEkSxeilTzeFWhemARidxn9hCsaWp873oTHekeZ15Xcqma Glhw== ARC-Authentication-Results: i=1; mx.google.com; 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 q14si1284955wrd.153.2017.12.13.04.08.45; Wed, 13 Dec 2017 04:08:46 -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; 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 435E21B1A0; Wed, 13 Dec 2017 13:07:19 +0100 (CET) Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0061.outbound.protection.outlook.com [104.47.42.61]) by dpdk.org (Postfix) with ESMTP id ABCF71B195 for ; Wed, 13 Dec 2017 13:07:15 +0100 (CET) Received: from BN3PR03CA0098.namprd03.prod.outlook.com (10.174.66.16) by DM5PR03MB2697.namprd03.prod.outlook.com (10.168.197.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 12:07:14 +0000 Received: from BL2FFO11FD005.protection.gbl (2a01:111:f400:7c09::123) by BN3PR03CA0098.outlook.office365.com (2603:10b6:400:4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Wed, 13 Dec 2017 12:07:13 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; intel.com; dkim=none (message not signed) header.d=none; intel.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.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 BL2FFO11FD005.mail.protection.outlook.com (10.173.161.1) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Wed, 13 Dec 2017 12:07:06 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vBDC6t9T008652; Wed, 13 Dec 2017 05:07:11 -0700 From: Hemant Agrawal To: CC: Date: Wed, 13 Dec 2017 17:35:50 +0530 Message-ID: <1513166759-13466-10-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131576404264597916; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(376002)(346002)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(3190300001)(189003)(199004)(86362001)(2906002)(81166006)(305945005)(356003)(5660300001)(36756003)(498600001)(81156014)(6666003)(76176011)(316002)(6916009)(16586007)(2950100002)(8676002)(4326008)(105606002)(2351001)(68736007)(51416003)(575784001)(8936002)(106466001)(50226002)(77096006)(50466002)(85426001)(59450400001)(104016004)(97736004)(48376002)(47776003)(53936002)(21314002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB2697; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD005; 1:RDw0QLowUKF4SiFXdVKIq3BsIfNiIz5LFl1XkNz2HaSjznyWzMFtvdjcbPpdXMDYsn1aVIknGuJq3vb3z0Qb36zGABQk32R5B2NzIkBYjj8CzQZfmfr4Duo+5xwxzr0g MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b3efe9df-2fe0-4e1a-583b-08d542220778 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:DM5PR03MB2697; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2697; 3:eeR2FL6UzgVr9l+5EzVW6cHguhtOx5K4nuQLKVmeavXbGvNIKPSFb58jkpHwJspE6j3O8lFbv72EHugCCEqgWeg8X8UaR2MvR7L+72d/dEuEAtiRabllm/6c4P6egCIrHclZtz7xKdcrGBB4ANf80tHFp8euQ+81mk9V6uJbkIscF3oDT5y1RX/uuArN8qhbGl0gTYmux3PLNNyj0o0HMF50LCQUf+rpFnldMfZt50GOb9JX8k9g7829hFYdbW/CijvSuZbUsxlpp+NLeXQfHvNijDFGs1aOHtcIEB6DXyofxobMgkrEpNk9TBz76wu09nAMY+LH5mjmmD/8W/EqOYU+dQ/Vy72AhHAv8Tc2Mx0=; 25:LYKb4O+R9vnaetSKc214ASIGR3bRciwekq0IYCmp6fSmP6Fp2oa7rCdb/I0lXWyqUwtD9aPGi2Q+jjzbVC88Ub6fPjS6tMFmZ2cFEJMRLkEIXLkpkpr+7cFuy8mdkmOTcsCh2gOhaoB+uUts6bP6EhXBKWeKA/H8XWmBqz2pHO1UJtQ2cfYj/VFlU5Ao2Bu4Mq1z/YcCYrRX498/VXjROH9xbACjU8fcqpjmx9kM/MDmDLXNNTSXRJRgZXr3Vtg0KFVC4HSaznhIgVdvmqJvtJFKvoAYfC6qM32xu4bOK1smMbNS2I31ysJhKWzZ72WDEgqm0JcLF1nRLZwK49IjRVDeiSj+S99dkNcLJRcJmow= X-MS-TrafficTypeDiagnostic: DM5PR03MB2697: X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2697; 31:X3esc9sOJmmUJsQi1Rr+vtrbI2DOLU9pKj0qCUO/KSgoaaaNwPkSjBIercJtZyH4z86F140wWzkDVb+YYpK0EpRXoEv5hi10mvTKXlREizatJqFCDQ198irOFzLztMLdM7iGV9JAbGKM+GdLZesBUk0N5PXKrrXXTN4JvKEhHXwSyq1ev2jVDlOC1HFemAKRKlI+2JaRm7qWQVh4oEv3W0zjAXYzOzo/5l0dUfqnHSY=; 4:w25WI2izxj4k0HBa0hvLJczXJSb8XBWcsz29n3LPVRCiddauE49eDTsQIacfV9KDcuzhvQnZ0BTJ1Gwig6Gz/oEtTzhoZKWW5EcSlRF9h/0i1tDlwj1JsQvM2H+E2yes6rjbvQFhuU/41/WXzbzmxNJiPZAql9O0GC5bGGDxyr09MJT34KiwFYUYmp8j5kD6j4SvTnc61JHQoBKzqHNgXCCEUmVbRglCMem6OTxfhBiq2KJVjf0pJ4w322K+k5Z+hhWZqM1NBmwF5c2hxpgdCmo+doIuK+EqtZzdcY0eYG6sH9edTShBDump3Z97E/qX0ZtqseHRCHK9u15+w9xLSvQMGO5gIzn3R3oQAUOpo+F2hX9rX2YOLJ8W8sllvNVB X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(227817650892897)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231023)(93006095)(93001095)(6055026)(6096035)(20161123561025)(20161123565025)(20161123559100)(20161123556025)(20161123563025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(201708071742011); SRVR:DM5PR03MB2697; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:DM5PR03MB2697; X-Forefront-PRVS: 052017CAF1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB2697; 23:7/I+jhL1Lt/F1sb1GZGR2cUW8KA//MNG5L+yh3WEk?= VAbXrtupr/J6va4W7WafoQ/XET7vliDhTn2RZdeLTyWa27Zccv5p52t2qNQulWODOiGGfB+nU2VdAdSe2dtlO+niTxU3SewTkKnwNiWeqlnrbEa/gFnnu3x4Rbehicul5Lq/nO2xeKTfxKA7mye/JXf5JQsW8Uf5borZV04Tl0N1yBD9oQVDGODwZoN83iDfHynoBukOIXXtAwVUJsfBzEWSpM57rzx6uBSBjojxu3Mc760WGzu/ff/1sc++IgjkRxYMHspgB4sTD4LF8IAE0pr9xbiCV1E1ztv3BWlXT82//d7/bR/XwRxolBOBamNEeBjOr/s0mjla2UAspRKWLRdmp7orWN4qR7/F0qEoA+lUSMlR91QFaFyMECFBJGJRKjLfWvr9zQUoozOBbKDBZa92GIFc89XjAbzJPlJDxlv1IPvpKuv45OtZ+CcI9luibd5/8oTxRWGBbqKpYcGuRKVHMjhbIgQjYA5GsG+04xPHlhPdzlOM4jI8RVLwZ5w7V45B1QxjGEWCliuEc9GARGh80WCeNCuhMugWWywaYWly/SO03qIGzoFh9X6Wh4sPbL32TJM0VrKz1+WFD/YF9r3J3d9N3yrvJOT0RMt4HmxvrnV8Vmv5mB41nI6sHqMfm0oEX1sMSrD5djXe/pjf054YsT8yZh1oD6vIjoKgOi03OmbmzawUt/5lEBKOFJ4klsu2AsRJBWbes3twRrAY3rRmvR5slBGYotcukhqzyxoc1v1Pze1FSO3PPtkSwhPvrAW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uKCPu365mdB6yTHofAd/7e82uBwBZZFYcGQiVgAMsC/YVpnaPeEquMCk/oO9wVbXL7pBMipIdmuOrPSc5KUh+gVAh65l99gGgSpS3o0mjKQsJDSYVvsg629gTaUxqnmX9WoORZl0EN0lQR/7I7liPAQiyJ5wYqxYByQrtPi9kqEHeE9sJPCHdYjYPwC SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 12:07:06.2881 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b3efe9df-2fe0-4e1a-583b-08d542220778 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB2697 Subject: [dpdk-dev] [PATCH 09/18] bus/dpaa: add support to create dynamic HW portal 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" HW portal is a processing context in DPAA. This patch allow creation of a queue specific HW portal context. Signed-off-by: Hemant Agrawal --- drivers/bus/dpaa/base/qbman/qman.c | 69 ++++++++++++-- drivers/bus/dpaa/base/qbman/qman_driver.c | 153 +++++++++++++++++++++++++----- drivers/bus/dpaa/base/qbman/qman_priv.h | 6 +- drivers/bus/dpaa/dpaa_bus.c | 31 +++++- drivers/bus/dpaa/include/fsl_qman.h | 25 ++--- drivers/bus/dpaa/include/fsl_usd.h | 4 + drivers/bus/dpaa/include/process.h | 11 ++- drivers/bus/dpaa/rte_bus_dpaa_version.map | 2 + drivers/bus/dpaa/rte_dpaa_bus.h | 4 + 9 files changed, 252 insertions(+), 53 deletions(-) -- 2.7.4 diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index 400d920..6ae4bb3 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -650,11 +650,52 @@ struct qman_portal *qman_create_portal( return NULL; } +#define MAX_GLOBAL_PORTLAS 8 +static struct qman_portal global_portals[MAX_GLOBAL_PORTLAS]; +static int global_portals_used[MAX_GLOBAL_PORTLAS]; + +static struct qman_portal * +qman_alloc_global_portal(void) +{ + unsigned int i; + + for (i = 0; i < MAX_GLOBAL_PORTLAS; i++) { + if (global_portals_used[i] == 0) { + global_portals_used[i] = 1; + return &global_portals[i]; + } + } + pr_err("No portal available (%x)\n", MAX_GLOBAL_PORTLAS); + + return NULL; +} + +static int +qman_free_global_portal(struct qman_portal *portal) +{ + unsigned int i; + + for (i = 0; i < MAX_GLOBAL_PORTLAS; i++) { + if (&global_portals[i] == portal) { + global_portals_used[i] = 0; + return 0; + } + } + return -1; +} + struct qman_portal *qman_create_affine_portal(const struct qm_portal_config *c, - const struct qman_cgrs *cgrs) + const struct qman_cgrs *cgrs, + int alloc) { struct qman_portal *res; - struct qman_portal *portal = get_affine_portal(); + struct qman_portal *portal; + + if (alloc) + portal = qman_alloc_global_portal(); + else + portal = get_affine_portal(); + /* A criteria for calling this function (from qman_driver.c) is that * we're already affine to the cpu and won't schedule onto another cpu. */ @@ -704,13 +745,18 @@ void qman_destroy_portal(struct qman_portal *qm) spin_lock_destroy(&qm->cgr_lock); } -const struct qm_portal_config *qman_destroy_affine_portal(void) +const struct qm_portal_config * +qman_destroy_affine_portal(struct qman_portal *qp) { /* We don't want to redirect if we're a slave, use "raw" */ - struct qman_portal *qm = get_affine_portal(); + struct qman_portal *qm; const struct qm_portal_config *pcfg; int cpu; + if (qp == NULL) + qm = get_affine_portal(); + else + qm = qp; pcfg = qm->config; cpu = pcfg->cpu; @@ -719,6 +765,9 @@ const struct qm_portal_config *qman_destroy_affine_portal(void) spin_lock(&affine_mask_lock); CPU_CLR(cpu, &affine_mask); spin_unlock(&affine_mask_lock); + + qman_free_global_portal(qm); + return pcfg; } @@ -1125,27 +1174,27 @@ void qman_start_dequeues(void) qm_dqrr_set_maxfill(&p->p, DQRR_MAXFILL); } -void qman_static_dequeue_add(u32 pools) +void qman_static_dequeue_add(u32 pools, struct qman_portal *qp) { - struct qman_portal *p = get_affine_portal(); + struct qman_portal *p = qp ? qp : get_affine_portal(); pools &= p->config->pools; p->sdqcr |= pools; qm_dqrr_sdqcr_set(&p->p, p->sdqcr); } -void qman_static_dequeue_del(u32 pools) +void qman_static_dequeue_del(u32 pools, struct qman_portal *qp) { - struct qman_portal *p = get_affine_portal(); + struct qman_portal *p = qp ? qp : get_affine_portal(); pools &= p->config->pools; p->sdqcr &= ~pools; qm_dqrr_sdqcr_set(&p->p, p->sdqcr); } -u32 qman_static_dequeue_get(void) +u32 qman_static_dequeue_get(struct qman_portal *qp) { - struct qman_portal *p = get_affine_portal(); + struct qman_portal *p = qp ? qp : get_affine_portal(); return p->sdqcr; } diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/base/qbman/qman_driver.c index 7a68896..f5d4b37 100644 --- a/drivers/bus/dpaa/base/qbman/qman_driver.c +++ b/drivers/bus/dpaa/base/qbman/qman_driver.c @@ -57,8 +57,8 @@ void *qman_ccsr_map; /* The qman clock frequency */ u32 qman_clk; -static __thread int fd = -1; -static __thread struct qm_portal_config pcfg; +static __thread int qmfd = -1; +static __thread struct qm_portal_config qpcfg; static __thread struct dpaa_ioctl_portal_map map = { .type = dpaa_portal_qman }; @@ -77,16 +77,16 @@ static int fsl_qman_portal_init(uint32_t index, int is_shared) error(0, ret, "pthread_getaffinity_np()"); return ret; } - pcfg.cpu = -1; + qpcfg.cpu = -1; for (loop = 0; loop < CPU_SETSIZE; loop++) if (CPU_ISSET(loop, &cpuset)) { - if (pcfg.cpu != -1) { + if (qpcfg.cpu != -1) { pr_err("Thread is not affine to 1 cpu\n"); return -EINVAL; } - pcfg.cpu = loop; + qpcfg.cpu = loop; } - if (pcfg.cpu == -1) { + if (qpcfg.cpu == -1) { pr_err("Bug in getaffinity handling!\n"); return -EINVAL; } @@ -98,36 +98,36 @@ static int fsl_qman_portal_init(uint32_t index, int is_shared) error(0, ret, "process_portal_map()"); return ret; } - pcfg.channel = map.channel; - pcfg.pools = map.pools; - pcfg.index = map.index; + qpcfg.channel = map.channel; + qpcfg.pools = map.pools; + qpcfg.index = map.index; /* Make the portal's cache-[enabled|inhibited] regions */ - pcfg.addr_virt[DPAA_PORTAL_CE] = map.addr.cena; - pcfg.addr_virt[DPAA_PORTAL_CI] = map.addr.cinh; + qpcfg.addr_virt[DPAA_PORTAL_CE] = map.addr.cena; + qpcfg.addr_virt[DPAA_PORTAL_CI] = map.addr.cinh; - fd = open(QMAN_PORTAL_IRQ_PATH, O_RDONLY); - if (fd == -1) { + qmfd = open(QMAN_PORTAL_IRQ_PATH, O_RDONLY); + if (qmfd == -1) { pr_err("QMan irq init failed\n"); process_portal_unmap(&map.addr); return -EBUSY; } - pcfg.is_shared = is_shared; - pcfg.node = NULL; - pcfg.irq = fd; + qpcfg.is_shared = is_shared; + qpcfg.node = NULL; + qpcfg.irq = qmfd; - portal = qman_create_affine_portal(&pcfg, NULL); + portal = qman_create_affine_portal(&qpcfg, NULL, 0); if (!portal) { pr_err("Qman portal initialisation failed (%d)\n", - pcfg.cpu); + qpcfg.cpu); process_portal_unmap(&map.addr); return -EBUSY; } irq_map.type = dpaa_portal_qman; irq_map.portal_cinh = map.addr.cinh; - process_portal_irq_map(fd, &irq_map); + process_portal_irq_map(qmfd, &irq_map); return 0; } @@ -136,10 +136,10 @@ static int fsl_qman_portal_finish(void) __maybe_unused const struct qm_portal_config *cfg; int ret; - process_portal_irq_unmap(fd); + process_portal_irq_unmap(qmfd); - cfg = qman_destroy_affine_portal(); - DPAA_BUG_ON(cfg != &pcfg); + cfg = qman_destroy_affine_portal(NULL); + DPAA_BUG_ON(cfg != &qpcfg); ret = process_portal_unmap(&map.addr); if (ret) error(0, ret, "process_portal_unmap()"); @@ -161,14 +161,119 @@ int qman_thread_finish(void) void qman_thread_irq(void) { - qbman_invoke_irq(pcfg.irq); + qbman_invoke_irq(qpcfg.irq); /* Now we need to uninhibit interrupts. This is the only code outside * the regular portal driver that manipulates any portal register, so * rather than breaking that encapsulation I am simply hard-coding the * offset to the inhibit register here. */ - out_be32(pcfg.addr_virt[DPAA_PORTAL_CI] + 0xe0c, 0); + out_be32(qpcfg.addr_virt[DPAA_PORTAL_CI] + 0xe0c, 0); +} + +struct qman_portal *fsl_qman_portal_create(void) +{ + cpu_set_t cpuset; + struct qman_portal *res; + + struct qm_portal_config *q_pcfg; + int loop, ret; + struct dpaa_ioctl_irq_map irq_map; + struct dpaa_ioctl_portal_map q_map = {0}; + int q_fd; + + q_pcfg = kzalloc((sizeof(struct qm_portal_config)), 0); + if (!q_pcfg) { + error(0, -1, "q_pcfg kzalloc failed"); + return NULL; + } + + /* Verify the thread's cpu-affinity */ + ret = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), + &cpuset); + if (ret) { + error(0, ret, "pthread_getaffinity_np()"); + return NULL; + } + + q_pcfg->cpu = -1; + for (loop = 0; loop < CPU_SETSIZE; loop++) + if (CPU_ISSET(loop, &cpuset)) { + if (q_pcfg->cpu != -1) { + pr_err("Thread is not affine to 1 cpu\n"); + return NULL; + } + q_pcfg->cpu = loop; + } + if (q_pcfg->cpu == -1) { + pr_err("Bug in getaffinity handling!\n"); + return NULL; + } + + /* Allocate and map a qman portal */ + q_map.type = dpaa_portal_qman; + q_map.index = QBMAN_ANY_PORTAL_IDX; + ret = process_portal_map(&q_map); + if (ret) { + error(0, ret, "process_portal_map()"); + return NULL; + } + q_pcfg->channel = q_map.channel; + q_pcfg->pools = q_map.pools; + q_pcfg->index = q_map.index; + + /* Make the portal's cache-[enabled|inhibited] regions */ + q_pcfg->addr_virt[DPAA_PORTAL_CE] = q_map.addr.cena; + q_pcfg->addr_virt[DPAA_PORTAL_CI] = q_map.addr.cinh; + + q_fd = open(QMAN_PORTAL_IRQ_PATH, O_RDONLY); + if (q_fd == -1) { + pr_err("QMan irq init failed\n"); + goto err1; + } + + q_pcfg->irq = q_fd; + + res = qman_create_affine_portal(q_pcfg, NULL, true); + if (!res) { + pr_err("Qman portal initialisation failed (%d)\n", + q_pcfg->cpu); + goto err2; + } + + irq_map.type = dpaa_portal_qman; + irq_map.portal_cinh = q_map.addr.cinh; + process_portal_irq_map(q_fd, &irq_map); + + return res; +err2: + close(q_fd); +err1: + process_portal_unmap(&q_map.addr); + return NULL; +} + +int fsl_qman_portal_destroy(struct qman_portal *qp) +{ + const struct qm_portal_config *cfg; + struct dpaa_portal_map addr; + int ret; + + cfg = qman_destroy_affine_portal(qp); + kfree(qp); + + process_portal_irq_unmap(cfg->irq); + + addr.cena = cfg->addr_virt[DPAA_PORTAL_CE]; + addr.cinh = cfg->addr_virt[DPAA_PORTAL_CI]; + + ret = process_portal_unmap(&addr); + if (ret) + pr_err("process_portal_unmap() (%d)\n", ret); + + kfree((void *)cfg); + + return ret; } int qman_global_init(void) diff --git a/drivers/bus/dpaa/base/qbman/qman_priv.h b/drivers/bus/dpaa/base/qbman/qman_priv.h index 3e1d7f9..e78d90b 100644 --- a/drivers/bus/dpaa/base/qbman/qman_priv.h +++ b/drivers/bus/dpaa/base/qbman/qman_priv.h @@ -179,8 +179,10 @@ int qm_get_wpm(int *wpm); struct qman_portal *qman_create_affine_portal( const struct qm_portal_config *config, - const struct qman_cgrs *cgrs); -const struct qm_portal_config *qman_destroy_affine_portal(void); + const struct qman_cgrs *cgrs, + int alloc); +const struct qm_portal_config * +qman_destroy_affine_portal(struct qman_portal *q); struct qm_portal_config *qm_get_unused_portal(void); struct qm_portal_config *qm_get_unused_portal_idx(uint32_t idx); diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index f1bc62a..8d74643 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -290,8 +290,7 @@ _dpaa_portal_init(void *arg) * rte_dpaa_portal_init - Wrapper over _dpaa_portal_init with thread level check * XXX Complete this */ -int -rte_dpaa_portal_init(void *arg) +int rte_dpaa_portal_init(void *arg) { if (unlikely(!RTE_PER_LCORE(_dpaa_io))) return _dpaa_portal_init(arg); @@ -299,6 +298,34 @@ rte_dpaa_portal_init(void *arg) return 0; } +int +rte_dpaa_portal_fq_init(void *arg, struct qman_fq *fq) +{ + /* Affine above created portal with channel*/ + u32 sdqcr; + struct qman_portal *qp; + + if (unlikely(!RTE_PER_LCORE(_dpaa_io))) + _dpaa_portal_init(arg); + + /* Initialise qman specific portals */ + qp = fsl_qman_portal_create(); + if (!qp) { + DPAA_BUS_LOG(ERR, "Unable to alloc fq portal"); + return -1; + } + fq->qp = qp; + sdqcr = QM_SDQCR_CHANNELS_POOL_CONV(fq->ch_id); + qman_static_dequeue_add(sdqcr, qp); + + return 0; +} + +int rte_dpaa_portal_fq_close(struct qman_fq *fq) +{ + return fsl_qman_portal_destroy(fq->qp); +} + void dpaa_portal_finish(void *arg) { diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h index ebcfa43..c5aef2d 100644 --- a/drivers/bus/dpaa/include/fsl_qman.h +++ b/drivers/bus/dpaa/include/fsl_qman.h @@ -1223,21 +1223,24 @@ struct qman_fq_cb { struct qman_fq { /* Caller of qman_create_fq() provides these demux callbacks */ struct qman_fq_cb cb; - /* - * These are internal to the driver, don't touch. In particular, they - * may change, be removed, or extended (so you shouldn't rely on - * sizeof(qman_fq) being a constant). - */ - spinlock_t fqlock; - u32 fqid; + u32 fqid_le; + u16 ch_id; + u8 cgr_groupid; + u8 is_static; /* DPDK Interface */ void *dpaa_intf; + /* affined portal in case of static queue */ + struct qman_portal *qp; + volatile unsigned long flags; + enum qman_fq_state state; - int cgr_groupid; + u32 fqid; + spinlock_t fqlock; + struct rb_node node; #ifdef CONFIG_FSL_QMAN_FQ_LOOKUP u32 key; @@ -1416,7 +1419,7 @@ void qman_start_dequeues(void); * (SDQCR). The requested pools are limited to those the portal has dequeue * access to. */ -void qman_static_dequeue_add(u32 pools); +void qman_static_dequeue_add(u32 pools, struct qman_portal *qm); /** * qman_static_dequeue_del - Remove pool channels from the portal SDQCR @@ -1426,7 +1429,7 @@ void qman_static_dequeue_add(u32 pools); * register (SDQCR). The requested pools are limited to those the portal has * dequeue access to. */ -void qman_static_dequeue_del(u32 pools); +void qman_static_dequeue_del(u32 pools, struct qman_portal *qp); /** * qman_static_dequeue_get - return the portal's current SDQCR @@ -1435,7 +1438,7 @@ void qman_static_dequeue_del(u32 pools); * entire register is returned, so if only the currently-enabled pool channels * are desired, mask the return value with QM_SDQCR_CHANNELS_POOL_MASK. */ -u32 qman_static_dequeue_get(void); +u32 qman_static_dequeue_get(struct qman_portal *qp); /** * qman_dca - Perform a Discrete Consumption Acknowledgment diff --git a/drivers/bus/dpaa/include/fsl_usd.h b/drivers/bus/dpaa/include/fsl_usd.h index a3243af..038a89d 100644 --- a/drivers/bus/dpaa/include/fsl_usd.h +++ b/drivers/bus/dpaa/include/fsl_usd.h @@ -100,6 +100,10 @@ void bman_thread_irq(void); int qman_global_init(void); int bman_global_init(void); +/* Direct portal create and destroy */ +struct qman_portal *fsl_qman_portal_create(void); +int fsl_qman_portal_destroy(struct qman_portal *qp); + #ifdef __cplusplus } #endif diff --git a/drivers/bus/dpaa/include/process.h b/drivers/bus/dpaa/include/process.h index 989ddcd..352e949 100644 --- a/drivers/bus/dpaa/include/process.h +++ b/drivers/bus/dpaa/include/process.h @@ -72,6 +72,11 @@ enum dpaa_portal_type { dpaa_portal_bman, }; +struct dpaa_portal_map { + void *cinh; + void *cena; +}; + struct dpaa_ioctl_portal_map { /* Input parameter, is a qman or bman portal required. */ enum dpaa_portal_type type; @@ -83,10 +88,8 @@ struct dpaa_ioctl_portal_map { /* Return value if the map succeeds, this gives the mapped * cache-inhibited (cinh) and cache-enabled (cena) addresses. */ - struct dpaa_portal_map { - void *cinh; - void *cena; - } addr; + struct dpaa_portal_map addr; + /* Qman-specific return values */ u16 channel; uint32_t pools; diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index f412362..4e3afda 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -74,6 +74,8 @@ DPDK_18.02 { qman_delete_cgr; qman_modify_cgr; qman_release_cgrid_range; + rte_dpaa_portal_fq_close; + rte_dpaa_portal_fq_init; local: *; } DPDK_17.11; diff --git a/drivers/bus/dpaa/rte_dpaa_bus.h b/drivers/bus/dpaa/rte_dpaa_bus.h index 40caf72..b0f7d48 100644 --- a/drivers/bus/dpaa/rte_dpaa_bus.h +++ b/drivers/bus/dpaa/rte_dpaa_bus.h @@ -162,6 +162,10 @@ void rte_dpaa_driver_unregister(struct rte_dpaa_driver *driver); */ int rte_dpaa_portal_init(void *arg); +int rte_dpaa_portal_fq_init(void *arg, struct qman_fq *fq); + +int rte_dpaa_portal_fq_close(struct qman_fq *fq); + /** * Cleanup a DPAA Portal */ From patchwork Wed Dec 13 12:05:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 121748 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5384338qgn; Wed, 13 Dec 2017 04:08:55 -0800 (PST) X-Google-Smtp-Source: ACJfBotYNm2QDhnzTnNiMkh6VHX/BIupLRY9zH7GSiUCRmG1U8YCps1XcJpmLVBuzNCKQGIZ22V4 X-Received: by 10.28.165.130 with SMTP id o124mr1985678wme.88.1513166935182; Wed, 13 Dec 2017 04:08:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513166935; cv=none; d=google.com; s=arc-20160816; b=z62OHBhvzoq6ktCVGvt8PhX6cfbJlfGwo2WRHXWPpblcbzjU5zLluJMLjOInoi3zy9 G0OyLKILyAubTBk5IAWXCp/L/tCaMsO8PXpsRRA4F0Mhv2AI3FkSkrOVmH9JzWFf+Cls H0bRQdbnCunU4V46TFlbyIdSQqBkBGbY1idyOPfKFCL/kJtQOkNW7sEekAJe0MBnGWus z97SWGZpxPblPIYp3d3QhGyMNxMxdVhwa+OQOU8KSIvOsUNbTa45dJi/bhzqXnDQzA4g wOjXFiolP8h3/s17i6oU5bHTYQ0gV/w5f1rNC5AzJXFIjA+PfgAEoUhE7th8h4AYsg5k oo3Q== 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:arc-authentication-results; bh=IXfWK6SgKk1R0jjb43JqOWUsal3uFVKcqJi2ecKQ42o=; b=VB3CQlx09Fa/ev8QWpcZN9ofI0vlgZeo/8dYy14UPoFZN5XAq4YwXCTRNd9ZH0275x 58idbAuqhgV38ZzZvV3nCMNvgOZw5NInlUVJlY1rbW8jhUfysq6mT+OgJB5oMtqkkbqH fz5X5cZ7lqC4rVIxjFvjAGOeUkA6pEJJ61/nPePX1sbYJapAAYHQNIwI9bsaKFHhKBgU 5oQflf0GKQxCDboyh0fyB3QU+82BR785zGmT0egrahHMHqd+r55pK8UKSAZGmyVCmB5D HYyC1SExdiJ42Pcz8YdP3YFr9CjPuhz0bjihAx11MQYoIy2Ils9vkoguqcmgGr3YDDX5 w50w== ARC-Authentication-Results: i=1; mx.google.com; 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 h131si1300641wmf.196.2017.12.13.04.08.54; Wed, 13 Dec 2017 04:08:55 -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; 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 6D54D1B1B5; Wed, 13 Dec 2017 13:07:20 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0051.outbound.protection.outlook.com [104.47.36.51]) by dpdk.org (Postfix) with ESMTP id 15E141B195 for ; Wed, 13 Dec 2017 13:07:17 +0100 (CET) Received: from MWHPR03CA0047.namprd03.prod.outlook.com (10.174.173.164) by CY1PR03MB2362.namprd03.prod.outlook.com (10.166.207.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 12:07:15 +0000 Received: from BN1AFFO11FD016.protection.gbl (2a01:111:f400:7c10::120) by MWHPR03CA0047.outlook.office365.com (2603:10b6:301:3b::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Wed, 13 Dec 2017 12:07:15 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.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 BN1AFFO11FD016.mail.protection.outlook.com (10.58.52.76) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Wed, 13 Dec 2017 12:07:08 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vBDC6t9U008652; Wed, 13 Dec 2017 05:07:13 -0700 From: Hemant Agrawal To: CC: , Nipun Gupta Date: Wed, 13 Dec 2017 17:35:51 +0530 Message-ID: <1513166759-13466-11-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131576404283269314; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(7966004)(336005)(346002)(376002)(39380400002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(199004)(189003)(51234002)(47776003)(106466001)(575784001)(104016004)(2351001)(105606002)(86362001)(8936002)(5660300001)(8676002)(50226002)(68736007)(81156014)(356003)(81166006)(305945005)(54906003)(50466002)(85426001)(48376002)(36756003)(2950100002)(498600001)(316002)(4326008)(6916009)(16586007)(6666003)(77096006)(53936002)(97736004)(51416003)(76176011)(2906002)(8656006); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2362; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD016; 1:0P9TDr/kS0ltvW1euIuj4fh3n80ZDrwtVeboK6D/FRIGRHEQqjlOanmW+q/jnRlhOLVmwvTDp+8iheTffmQWQGn7o03ztt0sXy+VhF7SJVuP0SHxPueEsQVhBDeQPM8K MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1419a9f5-7267-45ba-a0c2-08d542220897 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:CY1PR03MB2362; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2362; 3:KcnX9n118nrFtHZbKXr5V2s4rfIHdBWRJ7d197FKqZDXYSC3rlKISrw6EzHQ174w7Py/n4UXrieF3VqNJwiuoyuV+V8TjMTXONL97KD+EaWXSGaavsJOUj4IB6D+iXvsj48US8IMBJ+bbkkGKRXmyzOC22L0bqm5ltBCKgNtUjXM0xRdvoIsRC23X+9CpS7w7rDHlQHzil3g2x6/T5iVsZrBcptaubxeaRdG7w/gkZ847A2w3xYKlKMev98gvVlcOv1zsJpvmwcNJN3vINcj1Y6rncm2z7xUB/7XcQFSl5Okyd9I2lSwwRA5WiPee+3GCPxFHEDdlxVqpzapZ3q3NkOgHev2v1caPPrPHWgbSe0=; 25:Z7AXRsWcT+X0PROTrhlFI7mupux9XZG0dTN0iFZP2jVFHiw/m5/oNUQ8GIip/68FBCDhzeYYlclzMiucL6tSSH8u0m4L5l5zGO7Md3KQbkNHX1ujAY2jqG3bCmZXvSSnA8sZimWXvBenCBtYhQ5vMnKRFowzrl3WNwpk53TZJd02jaYxqZLzB6NRTQ7rn5gf8lvT8qyRSLsqlDhevoz6GnEUbDnWKMf1iT6fkFwBw2sjWX1HYybL33s5Dseny9m8fK2IsN4tuhzCyd3WfImyfN3exm8PskRtQH59zsGrtiD9ywEXy3kRmpN6LNc69QtikUuiaBtmpI6bBlPfJLSilVFo2FOvzGMg6RGvcSwbfDY= X-MS-TrafficTypeDiagnostic: CY1PR03MB2362: X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2362; 31:cCwjZu54HNh6KEbERU2PZGDNXLUScb8fmUqf2KZPYrAleGcROZW2EWNiD/EWMURwB6EXQRaXxwsR4fAqUbIYFjPQ5KMGmG8ZzjsTx607hSEd1YJtISWD2PaFhJQbFsaKGzuigNGfCTbm0CFpCHOc0U1FMpiOm/dyfoVAAbw8NpQU8iLlujtE4OCWGud1YS6e4uiHgQY4dXk4dzp08C7pXv/JdrdMn6sJ4C2cfP1Ui24=; 4:F4sLayz1rZA3KXUOjqLVDRuNA+nLrhdx0emw1U1urZM50lzB5aWL9INDNawIPlV0U7ZfLk4Lg0KU+b4niifjKRHyL7tfKmN+frS1RlGs+y3hTXmOI0qofC9UrGJMQmrNANWWTJSJ2uUW2B7J8bN12LBc/G0fWVrP6/WSlM8Po+4AK62HrsyWKLqM1u6hbacwCMpnolIOMKrxb6wYWPLdAQu8IP6VTJaXN3yhOfL5cDeM7ORjckw42Nk8O+DkpsHouojEN4tf+o9B6NvICWXDJNnJMjZPYltL0Ube6PkQsu0q/GgrDStXFpk3A5DJ7PU7 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(3231023)(3002001)(93006095)(93001095)(10201501046)(6055026)(6096035)(20161123556025)(20161123561025)(20161123559100)(20161123565025)(20161123563025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(201708071742011); SRVR:CY1PR03MB2362; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CY1PR03MB2362; X-Forefront-PRVS: 052017CAF1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2362; 23:WG/pFBQPLu+i7k/TXmXAxUWgj4NINzEpZslk0ZQhS?= g7reVVIWS1VIYdpJuqhRWQ2THM5ZMPrMTI4rYLOY4ccWsWxtvWBz3Io1t3rRs7kpweWCJtCPLwi6s4Kk4yRms98vBKglzHGaCXsNTzyrN68Ajc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Z3+MF+hSk8j9KVAJQTVqNmZPIc28aGHpx7jGrtPUV9NWIfdy7FPyVLNSPsZzBPqbEKUR5sa4zLUGMpqw3XGaF1O4OZP0HWrO/YWUamJUfqX44HzZn7+Zp8Ib69WkVDKqEYt6Rt23VATr3kzJ3oaYdFM3jzZkrPyGbaWZmmygQF8K4wuHinaADfxcDbmvAgL+2bjeDJe1QpzMJOFYrYILeVByjln0i6Arn6fqkeOeUOA7TMrDi6QhR5EmF7o9lMNS4CR/mUhGBDYyF1ck5FP219SBac2ekoXJah6fCMHglEKSw40TEuyAlSXytTvuWA=; 5:aMPbFxiBcsOXuKNJI4dgbAH/sxmLHRnl9OdcLDnV6aaLwh65IV5RLGvn6gaGeepdTazD/QZ+cRi39mlg54DQQHvkEh6PG7tEo+IU1986fwx6PZED7JtZbkGRCyOpz9VjGFqWRvbhfzKbFsJtM856cG6EIah0HF4zuVTddjKcVDs=; 24:WW3o5iQUXfQWK6iF1W4Gn+X7sB0zsZJoDg0ixNlsG7CMATg6tCP8OxZ9wENduyErwvCONNi2ZEgW0rS6RqrIsgfclVBiqySLaSqqPVflbiQ=; 7:3gDvjbMDFGoo6E54nd615tnXvUvGoGdhr/rrRr+aqdRXup3GGy0vSxBcQowCbTe6aK0Hm1hQ2d33/EM85ITryIGrMnV3ttgDSOKeqw1Tlxm9QLD9Z4hqYo8XI9VrTlbdxfPdIQIfDYyBb1zkWD5q3ZcrpWlYZmC7saRbSzyj0KanrJtbFxBfWdfD1ZXI/etsN02NdsK24VLakHZB0Kz4KrlGtWtDI+U81El+PU5C10PlHC52yWNJdZawa8AkpB2J SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 12:07:08.1553 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1419a9f5-7267-45ba-a0c2-08d542220897 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB2362 Subject: [dpdk-dev] [PATCH 10/18] net/dpaa: change Tx HW budget to 7 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" From: Nipun Gupta change the TX budget to 7 to sync best with the hw. Signed-off-by: Nipun Gupta Acked-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_ethdev.h | 2 +- drivers/net/dpaa/dpaa_rxtx.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index b26e411..95d745e 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -67,7 +67,7 @@ #define DPAA_MAX_MAC_FILTER (MEMAC_NUM_OF_PADDRS + 1) /*Maximum number of slots available in TX ring*/ -#define MAX_TX_RING_SLOTS 8 +#define DPAA_TX_BURST_SIZE 7 #ifndef VLAN_TAG_SIZE #define VLAN_TAG_SIZE 4 /** < Vlan Header Length */ diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index c0cfec9..1b0ca9a 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -695,7 +695,7 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) struct rte_mbuf *mbuf, *mi = NULL; struct rte_mempool *mp; struct dpaa_bp_info *bp_info; - struct qm_fd fd_arr[MAX_TX_RING_SLOTS]; + struct qm_fd fd_arr[DPAA_TX_BURST_SIZE]; uint32_t frames_to_send, loop, i = 0; uint16_t state; int ret; @@ -709,7 +709,8 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) DPAA_DP_LOG(DEBUG, "Transmitting %d buffers on queue: %p", nb_bufs, q); while (nb_bufs) { - frames_to_send = (nb_bufs >> 3) ? MAX_TX_RING_SLOTS : nb_bufs; + frames_to_send = (nb_bufs > DPAA_TX_BURST_SIZE) ? + DPAA_TX_BURST_SIZE : nb_bufs; for (loop = 0; loop < frames_to_send; loop++, i++) { mbuf = bufs[i]; if (RTE_MBUF_DIRECT(mbuf)) { From patchwork Wed Dec 13 12:05:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 121749 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5384672qgn; Wed, 13 Dec 2017 04:09:11 -0800 (PST) X-Google-Smtp-Source: ACJfBoutDEP4iOmEtNsyJaLGQsuQ6Sz3CPMrSzbDU9Jg8c0O3c2pscrrsJtSF+OWtajhCsLEZ2sY X-Received: by 10.28.0.193 with SMTP id 184mr1916492wma.58.1513166950925; Wed, 13 Dec 2017 04:09:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513166950; cv=none; d=google.com; s=arc-20160816; b=WXmjqefxhjumxjYxefqY0aD6qw8Ad/W3HI+KydF+ti+qNNvyBjV021X1tatI8N8tII uiCZSNtnbuOGwHJqFsNgrywbdW+6O2WsrMpzTmRSpOI+c5LmwvXfywm0RMY8EDdgH412 fwbWrn10BO20R8/I/LsY2lxEfe0DqwytFMUJf0sr/IVPXbqcgC2ulBBWLthJhFH/wHc2 sB1VF2aSif3z4f0DfdnLIg6+03pvWoZF/EtH/JTSfSXNknpO3t98tZlgSOZlFBpf/FW/ X4MYY67U+yRZyi2k7k53ke0b3JBP7k2Cw+OBG20qNOsyotrxAxwOJ/b5rU2dSgm2UKTH 3E9w== 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:arc-authentication-results; bh=MkWCF758WHnegRax+4jrhvMH5PPo9iEyhQMlHn5z26E=; b=IFTu4eEPrp6YWDnDNAaBZMUepsbIEURp3Ez0AtL6xkdQRn+rfu0St0/DAJfBwiLE5M KGg/ZFxCnHysZA0ZtJvJQaNNXOTyQN3WwLYJAByJSXvGUqEMAnmF4smY1Le8jhu8LBM/ 6ywZn1TaazU604gZz51+2RJ4vRlSyokJTHzPShiPT7ztgux4kbCf7oDZ1dait0VI1HOb X0lJ40Fzlfpe2JSYe/kHXKuvPxNMcivc/y5jPOY/2hzFVOvvH0rzwuhQzYeZ5SS0Ocmd eVyMadJaptuBXJZpFC8Jc9TjafQ6CE4sEH9EcwJ32VBq5TVoOvl/fodjVLA/YAcqnMa8 BcYA== ARC-Authentication-Results: i=1; mx.google.com; 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 s70si1290456wrc.489.2017.12.13.04.09.10; Wed, 13 Dec 2017 04:09:10 -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; 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 E5CDB1B1BD; Wed, 13 Dec 2017 13:07:23 +0100 (CET) Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0053.outbound.protection.outlook.com [104.47.40.53]) by dpdk.org (Postfix) with ESMTP id AAADB7CE2 for ; Wed, 13 Dec 2017 13:07:18 +0100 (CET) Received: from MWHPR03CA0016.namprd03.prod.outlook.com (10.175.133.154) by MWHPR03MB2703.namprd03.prod.outlook.com (10.168.207.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 12:07:17 +0000 Received: from BN1AFFO11FD025.protection.gbl (2a01:111:f400:7c10::151) by MWHPR03CA0016.outlook.office365.com (2603:10b6:300:117::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Wed, 13 Dec 2017 12:07:17 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.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 BN1AFFO11FD025.mail.protection.outlook.com (10.58.52.85) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Wed, 13 Dec 2017 12:07:10 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vBDC6t9V008652; Wed, 13 Dec 2017 05:07:15 -0700 From: Hemant Agrawal To: CC: , Nipun Gupta Date: Wed, 13 Dec 2017 17:35:52 +0530 Message-ID: <1513166759-13466-12-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131576404304122778; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(7966004)(336005)(376002)(346002)(39860400002)(39380400002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(51234002)(81156014)(85426001)(36756003)(2906002)(81166006)(4326008)(77096006)(356003)(50466002)(16586007)(104016004)(316002)(8676002)(305945005)(575784001)(86362001)(54906003)(53936002)(48376002)(68736007)(8936002)(2351001)(97736004)(76176011)(8656006)(47776003)(106466001)(5660300001)(2950100002)(51416003)(50226002)(6666003)(498600001)(6916009)(105606002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2703; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD025; 1:qaEg+9/P1r0zeTrezG6GRNGnJxi5+7/snt51Uu3tcMEFcm+AlQDS/twIIYpVs+UyM58L8w9eY+DrACDduZUFPlfzHfCc5YUaOwrAm5dsafJMtmd+jAuajkQkMQCvdnH4 MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: df650bed-5bfe-472a-d39a-08d5422209d5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:MWHPR03MB2703; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2703; 3:+Dn9KVZsx1wdLBEEsn0m/tTPfEaxyqzWnDUs565QsJQA3t1RvowX1UrQ7vNw0oY9x/MMNUn/ehKx9QDrppMEUnYiHrKJD9o8zWj4lacV/SWr1XCRHV0SxncK9BQLAndxvhC7WzI+2O2O1ishQQttZvJqJ6H5g3LuzT5uoJf5SGEJgyeFkxUTcvOFqrxT3goltHMy0gnppB79VSV+ixyluiBEEjoYIk+5fQOi1CV/yijtuaKA8sYfhrJ/QJjW0se4Ik9IyoRUCrnyiBKib0+/EXIqa4tWeiHNmk8mdy6ZFcn0T8e4qkTMzSnP3/9XWOYgZ0EKTaPJovF+NIUM8FmeJjhbJrOAEoaBKgg8rVmKQh0=; 25:p0e5V8cIlYNj7uPKzINU/a4ijScMgUtJgSy4rcyciEhbNo934iuFYNKOCd5yKq11Wb28ct1exXjLMQ8o7SKP3uc/A/rUigwLFzoqr/FEukBOdAHqhGs99riBplfo5hJwELiT8aixqAk/NGyBeeBalzghrLPbk1i96GtRTHAFT5vmEMVfEKswmOkW3EGQdNd6Gl0W4NS/UiZ1nYKNwu5kMW/aJzoKuCOLlsjALtShvcjhi0of/aJ97jKEi+uU88oMxhgMe+RoEHo61oNjKUAjRuN/+BMCGkK3LKqrMkvpWNWUelHX4ekjcpCtiUAB+wDPOnFaVCTStgw7Uwj6o5Z8cQ== X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR03MB2703: X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2703; 31:il6MLcVLMuMpEJ5UV+dG7viEjujAfun8X2TWTsmD4k16ywlserZIuQOcm+nWphyxq3saUag/+G08FVihmMaukpcl+iFqDwfM5XZ9MDcv/I1wa17aQcoQ+gODFnsoV26k64bPGH133F+glcdSvsCpz89AzbWm57kXFsPdSA6t4D68WSmp2zLsyy3J7D6ovxQpqP3oC5oPf8nJNA1eRllDaJ/kAwzbnB/9pQJUGbYKP1Q=; 4:ekpfzePhZmr7dtxnsYMPLIacCJhtU1NaGalZeNxJduWZuTy7ODhHolxRxsaU9f8HWiPIbuW4PIL4uySBNweTstmJYoq2nORFTgahM7k4ziKvqh7QnJ/cidR+KnaLjgqvJUan2s1Y77GzEsRrWkCS3XHUIjP4cdxgGL6k717YKze9CdYkaeQr40Tac6Shm8KJGnb+KNyqs9ZhuqWfgFqlOA2w9w8lJMESyZkbC9edbNLzSEgzcfuvr9nu6L0FITFX5wgZQXQHtW+Yf7Fa1BoY5QWI5Gb3j7rgCOQpDdfS+1zUMHdRS7g/ImaIf+PM4BRE X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231023)(3002001)(10201501046)(6055026)(6096035)(20161123559100)(20161123561025)(20161123563025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123565025)(20161123556025)(201708071742011); SRVR:MWHPR03MB2703; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:MWHPR03MB2703; X-Forefront-PRVS: 052017CAF1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB2703; 23:HCo6SG42ihlU1VUN6kUiAmjtuhnDBI1GSze0fGJqK?= azsAfPlUv1d+YU7O7b/KvwYDY7tz3eKDsf0iDt6jNM6kFchQOVBGguG3L1ngxdu6gC8lj4Od2UQiJjIZglNoniURbb28k3mSe6c6Kgh4J2KH//sG7uCznkHOpSKawUAx3C5QIB+9bZx/NssdWmceSpyAil66SAG7CXM9ytejsR5x6aH7H5lCJ71Vsgu48O1Q7fwzqMVCnmF/HV5TpS7VnJa1OKBzIP2YCQtqeyT4Xe36shZoXfnkbGs355oJ5N5ge4fmWbLqUZ+TLIUevE0mA0jceGf1J9x95xoyuN6y0ezbGx8a5L2wQPxnApNqAP39Qum5xRo1+/ZNPfDKdg7iRjRGP+bGSHpZdnZmKtC/PEWzXDiPPp6AN0//YXWDdAipCInJ+F3Wdrrme/alxeXbtHOAnPR70iaW/A5pzZl3JeYpbB9u249ZkAxTpfSxtgvJCkdHWTFQJWpH1o/40xN2z8M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gjeTRDCjo+Y/ZQJ/81/2lkt9C3ce5We63kv4dsMS/JRV17e7MtxUut2PzkRQxa1nYOts7oG694jHFDfzoXJ5QW911CEOCTun3u8C47WLOFr1JM2SMwRMgJFjQC6ok9/TZHaMbsH6I=; 24:KgTO9g+gN+y2nnTetiCx0rPTgu10d6Vdy2II0E9STFhZtvhrnM0jqA/aiWa/qvrzXZmHQYw/nk5hiNFqS7SBLeFaikl+hpTPr7x2GtZNhlc=; 7:ocusHvBbBV6oWU13MR/1mXOoNYi4xdcXLOBgBMJ0DJDGUnaC+gxbJ/BkwmaLIiVwrb6wp1KdqHn6o+i/HGpyuVFrlhbAVtkx54Abolwe4SVzfDdFUnG7S+NyXmMJceS/18WCa5QJ0F78oTfCjvXB3xCTcYppA3np1Vk4dai8CWStdFM2M0NNrsGZEZLcQ1rkcUNKcDEhrf9eEthYe0VLqUUtsifWHWLhsJHYyDj6u8ns2ZM7xJf6Ci9shkNvXoPM SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 12:07:10.2406 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: df650bed-5bfe-472a-d39a-08d5422209d5 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR03MB2703 Subject: [dpdk-dev] [PATCH 11/18] net/dpaa: optimize the Tx burst 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" From: Nipun Gupta Optimize it for best case. Create a function for TX offloads to be used in multiple legs. Signed-off-by: Nipun Gupta Acked-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_rxtx.c | 73 ++++++++++++++++++++++++++++---------------- 1 file changed, 46 insertions(+), 27 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 1b0ca9a..33cc412 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -298,6 +298,30 @@ static inline void dpaa_checksum_offload(struct rte_mbuf *mbuf, fd->cmd = DPAA_FD_CMD_RPD | DPAA_FD_CMD_DTC; } +static inline void +dpaa_unsegmented_checksum(struct rte_mbuf *mbuf, struct qm_fd *fd_arr) +{ + if (!mbuf->packet_type) { + struct rte_net_hdr_lens hdr_lens; + + mbuf->packet_type = rte_net_get_ptype(mbuf, &hdr_lens, + RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK + | RTE_PTYPE_L4_MASK); + mbuf->l2_len = hdr_lens.l2_len; + mbuf->l3_len = hdr_lens.l3_len; + } + if (mbuf->data_off < (DEFAULT_TX_ICEOF + + sizeof(struct dpaa_eth_parse_results_t))) { + DPAA_DP_LOG(DEBUG, "Checksum offload Err: " + "Not enough Headroom " + "space for correct Checksum offload." + "So Calculating checksum in Software."); + dpaa_checksum(mbuf); + } else { + dpaa_checksum_offload(mbuf, fd_arr, mbuf->buf_addr); + } +} + struct rte_mbuf * dpaa_eth_sg_to_mbuf(struct qm_fd *fd, uint32_t ifid) { @@ -620,27 +644,8 @@ tx_on_dpaa_pool_unsegmented(struct rte_mbuf *mbuf, rte_pktmbuf_free(mbuf); } - if (mbuf->ol_flags & DPAA_TX_CKSUM_OFFLOAD_MASK) { - if (!mbuf->packet_type) { - struct rte_net_hdr_lens hdr_lens; - - mbuf->packet_type = rte_net_get_ptype(mbuf, &hdr_lens, - RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK - | RTE_PTYPE_L4_MASK); - mbuf->l2_len = hdr_lens.l2_len; - mbuf->l3_len = hdr_lens.l3_len; - } - if (mbuf->data_off < (DEFAULT_TX_ICEOF + - sizeof(struct dpaa_eth_parse_results_t))) { - DPAA_DP_LOG(DEBUG, "Checksum offload Err: " - "Not enough Headroom " - "space for correct Checksum offload." - "So Calculating checksum in Software."); - dpaa_checksum(mbuf); - } else { - dpaa_checksum_offload(mbuf, fd_arr, mbuf->buf_addr); - } - } + if (mbuf->ol_flags & DPAA_TX_CKSUM_OFFLOAD_MASK) + dpaa_unsegmented_checksum(mbuf, fd_arr); } /* Handle all mbufs on dpaa BMAN managed pool */ @@ -696,7 +701,7 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) struct rte_mempool *mp; struct dpaa_bp_info *bp_info; struct qm_fd fd_arr[DPAA_TX_BURST_SIZE]; - uint32_t frames_to_send, loop, i = 0; + uint32_t frames_to_send, loop, sent = 0; uint16_t state; int ret; @@ -711,10 +716,23 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) while (nb_bufs) { frames_to_send = (nb_bufs > DPAA_TX_BURST_SIZE) ? DPAA_TX_BURST_SIZE : nb_bufs; - for (loop = 0; loop < frames_to_send; loop++, i++) { - mbuf = bufs[i]; - if (RTE_MBUF_DIRECT(mbuf)) { + for (loop = 0; loop < frames_to_send; loop++) { + mbuf = *(bufs++); + if (likely(RTE_MBUF_DIRECT(mbuf))) { mp = mbuf->pool; + bp_info = DPAA_MEMPOOL_TO_POOL_INFO(mp); + if (likely(mp->ops_index == + bp_info->dpaa_ops_index && + mbuf->nb_segs == 1 && + rte_mbuf_refcnt_read(mbuf) == 1)) { + DPAA_MBUF_TO_CONTIG_FD(mbuf, + &fd_arr[loop], bp_info->bpid); + if (mbuf->ol_flags & + DPAA_TX_CKSUM_OFFLOAD_MASK) + dpaa_unsegmented_checksum(mbuf, + &fd_arr[loop]); + continue; + } } else { mi = rte_mbuf_from_indirect(mbuf); mp = mi->pool; @@ -755,11 +773,12 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) frames_to_send - loop); } nb_bufs -= frames_to_send; + sent += frames_to_send; } - DPAA_DP_LOG(DEBUG, "Transmitted %d buffers on queue: %p", i, q); + DPAA_DP_LOG(DEBUG, "Transmitted %d buffers on queue: %p", sent, q); - return i; + return sent; } uint16_t dpaa_eth_tx_drop_all(void *q __rte_unused, From patchwork Wed Dec 13 12:05:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 121750 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5384912qgn; Wed, 13 Dec 2017 04:09:21 -0800 (PST) X-Google-Smtp-Source: ACJfBovBfcOHfvaODPtj3Q4qTca3+4EwGZUKqzg2xjFp1KVhR6hzYemSksF9M7EaVhELcq2JVN/L X-Received: by 10.223.146.167 with SMTP id 36mr2048495wrn.102.1513166960986; Wed, 13 Dec 2017 04:09:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513166960; cv=none; d=google.com; s=arc-20160816; b=RzAK+ZeUL4J+HgNYGPTwKz93mri6i/7vMFQHawY6mmIEyNFkApjBmacwJbl7mKxNCK /w4Q+L6aGDls3pR42U0kI+gTvJQeJUBDqltWz2K24S+pox3HgKD7b96/KM0xTi9kme7w mbWwfEqPt/DxzftoiCDSrmiWec4OPJ8NSxHWSg5ej/aYd4dQVDFYDDcOz1+todxX1swM auSABD6lW5bK8ASdZTC+I/SX/vu8fa/PZb26B4HGvJB6SeaZeiLQmuKIDU6e0O7Fs4fy scbpEMZjQ7LUaP27qa5IC6WXjaUL7oupGw110rycGKQQoneYo0xLcNsvI3GklVHEfSMU PkHw== 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:arc-authentication-results; bh=m6/1jF2/OmdGg0jYhBjBJUQGilx3bSobzEqRQ0Pm/MM=; b=z2L3AFt9Sz0DU2h+b2O0LF8tYIjg1XgySHH9W5YHRb2BUmblMae3pKA7TzeSyBhS9Y DYq7lz/qrqc+SXSVWHmpQzf+b9M9L1ZFAifWHlr+eoD2GgMzkZ9HwTtukS1sDS+PXkft 9dmhUhaFlExHasn0H18FbKmGuOAAdhz08WPkrtI/kvcAeycBWZ8GD+hWjUJsn+RySKeF 145Up7dYnoQOPgamG6/MNME+A5DrNdDiCqJGnu8x30yVGs8JAwQYo27EyS/Ecl+cMbko 8XYWQXS0tAfEifgmFHbWwu7bf6mghZacqk2BeuW2duqQaF4Nscf9RjK/Cb27omfE+KqF wB1Q== ARC-Authentication-Results: i=1; mx.google.com; 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 x109si1390492wrb.430.2017.12.13.04.09.20; Wed, 13 Dec 2017 04:09:20 -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; 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 480601B1C4; Wed, 13 Dec 2017 13:07:25 +0100 (CET) Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0046.outbound.protection.outlook.com [104.47.41.46]) by dpdk.org (Postfix) with ESMTP id CC5871B1B9 for ; Wed, 13 Dec 2017 13:07:20 +0100 (CET) Received: from BLUPR0301CA0011.namprd03.prod.outlook.com (10.162.113.149) by BN3PR03MB2354.namprd03.prod.outlook.com (10.166.74.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 12:07:19 +0000 Received: from BY2FFO11FD029.protection.gbl (2a01:111:f400:7c0c::167) by BLUPR0301CA0011.outlook.office365.com (2a01:111:e400:5259::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Wed, 13 Dec 2017 12:07:19 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.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 BY2FFO11FD029.mail.protection.outlook.com (10.1.14.212) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Wed, 13 Dec 2017 12:07:12 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vBDC6t9W008652; Wed, 13 Dec 2017 05:07:17 -0700 From: Hemant Agrawal To: CC: , Nipun Gupta Date: Wed, 13 Dec 2017 17:35:53 +0530 Message-ID: <1513166759-13466-13-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131576404323532363; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(39380400002)(39860400002)(346002)(376002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(54906003)(2906002)(86362001)(76176011)(316002)(2351001)(106466001)(105606002)(16586007)(50226002)(47776003)(8656006)(8936002)(59450400001)(77096006)(85426001)(51416003)(81166006)(48376002)(50466002)(68736007)(36756003)(104016004)(5660300001)(498600001)(6666003)(81156014)(97736004)(305945005)(53936002)(4326008)(356003)(2950100002)(6916009)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB2354; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD029; 1:YykogDFfvd7Vzwhn7A1rVIr7PK8KceWQ0nYVcFJBCcn9qtkQwDADzasXyxDu3kJkFUGagr49WIR1cqBo3W48cxfZMuCO2w8OjdhFEjqDTSlFnRiF6FYM4PcVqjm2jcDt MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 62dc33ff-1357-4ea8-fe4b-08d542220afd X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:BN3PR03MB2354; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2354; 3:cv8SlTcRr30p265MBnRpPEZC3IJ0hPn/CO8rNvUaKrMfD9EjZzfna6si3ygXMHLHSqhMsv16s88XAyE6seq0X9T7VSdAhWwFyfYAEgq2MRfBccrtUR6UjgJxsPU79mGRlJWnr8DaLpY4laXnoStqtaGAECqK3EZDbC4nzE28kSnBmImCODn1K9RjR7M71LwQg0hLfR4d521vkfUZuMLe688qz2RMmuUNe1XtLPhFWq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43Q92D3R7dxnatBWJnWVK1MifLb4wj6iFLEH6bWTWjRLbpPLB7RZ6 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231023)(93006095)(93001095)(6055026)(6096035)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123559100)(20161123556025)(20161123563025)(20161123565025)(20161123561025)(201708071742011); SRVR:BN3PR03MB2354; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BN3PR03MB2354; X-Forefront-PRVS: 052017CAF1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR03MB2354; 23:uidcoZ0WteZUierC/4fXl5zv6DEUfXSaRByi5J+yG?= EmYi6CnLsUZJnD9lFxNyfwU2t+tl649MYcp5AIZGUa5fkhmXNcTm9J9qJpW5XYxUUEd9hWEn4llKyzUx1cVzdhTVSpSW0mNS5NYGKBI8D9PIl2zACHQD3HfYHUk7MVPGxOayoxBH7cCdeTG6yfJfk4WkLNNoNyoc8ptKVSo13Vo9/Hhu/DZymhlJmkUV8O9LFdyYLF/h3hPG7aV6kVgYEg5W9buMDzB+ML9xOFP6TlWORWOXmEW0g5D0pSXG6QaQUheHOAZsWNewZPVVlSKVP4Lzb+kIfHL7TdRM8b0Le/MDUkJHHnoIyNybA6RtLBpLfFXnTJ5X71oNyT2jtHnhVA6749OkQX4s8X5PHzfBDxFqIRoOihGCHmzFLdhJyqXlADIPxgW0vxrXWlNNRu4ny9CDm34D8DIBZrk39V9CGExQ9gfVMD2+u0dUXqV/TPJxnT0z5uv5Gy3F8bXhsaSMi0xxpXK5Z+Kf5V8fMi+owoY/riOFUM0KjuvkZ4Px4cpDZPNw+IVO7raU24gfyqAolBovmr0qKIN2OrzC7aRW2d0NgWlqbucmvJhRRI3Bfz5ciX76/qoEkBcXUne/iO6tKB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t/uSDfh6IQYC+0xdCwyZprhDZglQ0DizBBqJdU3ktcBaqFh5bhAoHFkxUtgHghSFcSSEpiE=; 7:TGBeaZXDsWX7TWUDNFZ94es4H9tFYlZNDRu1Z61qOluJSiPaUYmaDMhPpj+fTYo2H2qQX4qSq+eFs/xC4PC8bOvj+JBR+5azLEP8XPcUL9MsBrchiLcgvccWrUsWhozpvAHjjmRbqEfCBB54Enk+AGyrpf/yg8StXD/h7z2APTM3oJLqVELSqFtp3c2z8vHrwOMXnq9AXHZfB7k+2IhXhpkfB9dm0GtQ42LeJm/Z9AkWBQvnJ16mBlTZe1X0eiQF SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 12:07:12.1504 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 62dc33ff-1357-4ea8-fe4b-08d542220afd X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR03MB2354 Subject: [dpdk-dev] [PATCH 12/18] net/dpaa: optimize Rx path 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" From: Nipun Gupta Signed-off-by: Nipun Gupta Signed-off-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_rxtx.c | 48 ++++++++++++++++++++------------------------ drivers/net/dpaa/dpaa_rxtx.h | 2 +- 2 files changed, 23 insertions(+), 27 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 33cc412..2609953 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -123,12 +123,6 @@ static inline void dpaa_eth_packet_info(struct rte_mbuf *m, DPAA_DP_LOG(DEBUG, " Parsing mbuf: %p with annotations: %p", m, annot); switch (prs) { - case DPAA_PKT_TYPE_NONE: - m->packet_type = 0; - break; - case DPAA_PKT_TYPE_ETHER: - m->packet_type = RTE_PTYPE_L2_ETHER; - break; case DPAA_PKT_TYPE_IPV4: m->packet_type = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV4; @@ -137,6 +131,9 @@ static inline void dpaa_eth_packet_info(struct rte_mbuf *m, m->packet_type = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV6; break; + case DPAA_PKT_TYPE_ETHER: + m->packet_type = RTE_PTYPE_L2_ETHER; + break; case DPAA_PKT_TYPE_IPV4_FRAG: case DPAA_PKT_TYPE_IPV4_FRAG_UDP: case DPAA_PKT_TYPE_IPV4_FRAG_TCP: @@ -199,6 +196,9 @@ static inline void dpaa_eth_packet_info(struct rte_mbuf *m, m->packet_type = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_SCTP; break; + case DPAA_PKT_TYPE_NONE: + m->packet_type = 0; + break; /* More switch cases can be added */ default: dpaa_slow_parsing(m, prs); @@ -209,12 +209,11 @@ static inline void dpaa_eth_packet_info(struct rte_mbuf *m, << DPAA_PKT_L3_LEN_SHIFT; /* Set the hash values */ - m->hash.rss = (uint32_t)(rte_be_to_cpu_64(annot->hash)); - m->ol_flags = PKT_RX_RSS_HASH; + m->hash.rss = (uint32_t)(annot->hash); /* All packets with Bad checksum are dropped by interface (and * corresponding notification issued to RX error queues). */ - m->ol_flags |= PKT_RX_IP_CKSUM_GOOD; + m->ol_flags = PKT_RX_RSS_HASH | PKT_RX_IP_CKSUM_GOOD; /* Check if Vlan is present */ if (prs & DPAA_PARSE_VLAN_MASK) @@ -323,7 +322,7 @@ dpaa_unsegmented_checksum(struct rte_mbuf *mbuf, struct qm_fd *fd_arr) } struct rte_mbuf * -dpaa_eth_sg_to_mbuf(struct qm_fd *fd, uint32_t ifid) +dpaa_eth_sg_to_mbuf(const struct qm_fd *fd, uint32_t ifid) { struct dpaa_bp_info *bp_info = DPAA_BPID_TO_POOL_INFO(fd->bpid); struct rte_mbuf *first_seg, *prev_seg, *cur_seg, *temp; @@ -381,34 +380,31 @@ dpaa_eth_sg_to_mbuf(struct qm_fd *fd, uint32_t ifid) return first_seg; } -static inline struct rte_mbuf *dpaa_eth_fd_to_mbuf(struct qm_fd *fd, - uint32_t ifid) +static inline struct rte_mbuf * +dpaa_eth_fd_to_mbuf(const struct qm_fd *fd, uint32_t ifid) { - struct dpaa_bp_info *bp_info = DPAA_BPID_TO_POOL_INFO(fd->bpid); struct rte_mbuf *mbuf; - void *ptr; + struct dpaa_bp_info *bp_info = DPAA_BPID_TO_POOL_INFO(fd->bpid); + void *ptr = rte_dpaa_mem_ptov(qm_fd_addr(fd)); uint8_t format = (fd->opaque & DPAA_FD_FORMAT_MASK) >> DPAA_FD_FORMAT_SHIFT; - uint16_t offset = - (fd->opaque & DPAA_FD_OFFSET_MASK) >> DPAA_FD_OFFSET_SHIFT; - uint32_t length = fd->opaque & DPAA_FD_LENGTH_MASK; + uint16_t offset; + uint32_t length; DPAA_DP_LOG(DEBUG, " FD--->MBUF"); if (unlikely(format == qm_fd_sg)) return dpaa_eth_sg_to_mbuf(fd, ifid); + rte_prefetch0((void *)((uint8_t *)ptr + DEFAULT_RX_ICEOF)); + + offset = (fd->opaque & DPAA_FD_OFFSET_MASK) >> DPAA_FD_OFFSET_SHIFT; + length = fd->opaque & DPAA_FD_LENGTH_MASK; + /* Ignoring case when format != qm_fd_contig */ dpaa_display_frame(fd); - ptr = rte_dpaa_mem_ptov(fd->addr); - /* Ignoring case when ptr would be NULL. That is only possible incase - * of a corrupted packet - */ mbuf = (struct rte_mbuf *)((char *)ptr - bp_info->meta_data_size); - /* Prefetch the Parse results and packet data to L1 */ - rte_prefetch0((void *)((uint8_t *)ptr + DEFAULT_RX_ICEOF)); - rte_prefetch0((void *)((uint8_t *)ptr + offset)); mbuf->data_off = offset; mbuf->data_len = length; @@ -488,11 +484,11 @@ static struct rte_mbuf *dpaa_get_dmable_mbuf(struct rte_mbuf *mbuf, if (!dpaa_mbuf) return NULL; - memcpy((uint8_t *)(dpaa_mbuf->buf_addr) + mbuf->data_off, (void *) + memcpy((uint8_t *)(dpaa_mbuf->buf_addr) + RTE_PKTMBUF_HEADROOM, (void *) ((uint8_t *)(mbuf->buf_addr) + mbuf->data_off), mbuf->pkt_len); /* Copy only the required fields */ - dpaa_mbuf->data_off = mbuf->data_off; + dpaa_mbuf->data_off = RTE_PKTMBUF_HEADROOM; dpaa_mbuf->pkt_len = mbuf->pkt_len; dpaa_mbuf->ol_flags = mbuf->ol_flags; dpaa_mbuf->packet_type = mbuf->packet_type; diff --git a/drivers/net/dpaa/dpaa_rxtx.h b/drivers/net/dpaa/dpaa_rxtx.h index 2ffc4ff..b434b6d 100644 --- a/drivers/net/dpaa/dpaa_rxtx.h +++ b/drivers/net/dpaa/dpaa_rxtx.h @@ -288,7 +288,7 @@ uint16_t dpaa_eth_tx_drop_all(void *q __rte_unused, struct rte_mbuf **bufs __rte_unused, uint16_t nb_bufs __rte_unused); -struct rte_mbuf *dpaa_eth_sg_to_mbuf(struct qm_fd *fd, uint32_t ifid); +struct rte_mbuf *dpaa_eth_sg_to_mbuf(const struct qm_fd *fd, uint32_t ifid); int dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf, struct qm_fd *fd, From patchwork Wed Dec 13 12:05:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 121751 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5385127qgn; Wed, 13 Dec 2017 04:09:32 -0800 (PST) X-Google-Smtp-Source: ACJfBot3T3gbOpK+osbzCxsD+aOqb+KtrEOt0V5P891XV3cCcajMR4P7g9yl6GMb4yxbDDB08lsE X-Received: by 10.223.153.20 with SMTP id x20mr1963742wrb.219.1513166972475; Wed, 13 Dec 2017 04:09:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513166972; cv=none; d=google.com; s=arc-20160816; b=CdFV8I5KHPX/TNLlG4V9VB0Bw/sduVWtq38sFDAGNKQKg5Sh+/Cm/WqcTSgp+N2V9F lAoA/C3JcS/3o2oncTBa8E5MomBEN3gpbIOw+ebgAz5EK1E9c3MZrVSL4mbcdWIQ4KSz JefIXxQvk+Wu9dtbnbKx+6I3JM0AVVWTpOjciGu21/vemdzPGZ7437yLnJWd+/RGLtdo RWmg3QeYEGfeXl55xMC9+0s1p42jcSPI0R3itpUuFvnE3VQM9T+31rxIskVFdOwpVUEx zxkWBhWHGMjMxbprPr5rJns8hYMF24RMpnOTr7ueAeslyLOXTMMb/b78JGTwS0gIylaN KFbw== 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:arc-authentication-results; bh=bJdV1Foxs8FrIR3CpiLRxuoQa3BNAN6r7Id1qZXh8ro=; b=r9T0ND3SgdtfWE4piaslkqlD5e7RDlQ8DDuJD27Yk58i3u5G3hu66am2pDprTs9EpX PAHfAfzZb6fWLYk4vwBSnHpuxDAMv+tbcrna2P3WUSOdOXSwp/7qDeXN4i/YIVU/r3Tm W3kzE2hKS2whrKJXnxrXBFQ0+/beynanWBKXUO/kHj8PSPLNYZpCL6xjwO5pLHAdFlC/ vp7x2JVh9zOFkGgSA5xuQk0xU2mUvJD8QBP3CI05g4PoaOFyASltqrdrFqSPmqLnWXjJ L05Q90FDCRb6vOOpcsVjddbBacVZxtQ7oV1ObNj0xDDL1DozeJVBl2m/ncxIFTn3d8n5 7dxg== ARC-Authentication-Results: i=1; mx.google.com; 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 j17si1256055wrb.367.2017.12.13.04.09.32; Wed, 13 Dec 2017 04:09:32 -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; 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 8C28B1B1CE; Wed, 13 Dec 2017 13:07:26 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0067.outbound.protection.outlook.com [104.47.36.67]) by dpdk.org (Postfix) with ESMTP id C41B91B1BD for ; Wed, 13 Dec 2017 13:07:22 +0100 (CET) Received: from MWHPR03CA0014.namprd03.prod.outlook.com (10.175.133.152) by DM5PR03MB2699.namprd03.prod.outlook.com (10.168.197.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 12:07:21 +0000 Received: from BN1BFFO11FD041.protection.gbl (2a01:111:f400:7c10::1:135) by MWHPR03CA0014.outlook.office365.com (2603:10b6:300:117::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Wed, 13 Dec 2017 12:07:20 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; intel.com; dkim=none (message not signed) header.d=none; intel.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.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 BN1BFFO11FD041.mail.protection.outlook.com (10.58.144.104) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Wed, 13 Dec 2017 12:07:13 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vBDC6t9X008652; Wed, 13 Dec 2017 05:07:18 -0700 From: Hemant Agrawal To: CC: Date: Wed, 13 Dec 2017 17:35:54 +0530 Message-ID: <1513166759-13466-14-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131576404338362196; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(39860400002)(346002)(39380400002)(376002)(2980300002)(1109001)(1110001)(339900001)(3190300001)(199004)(189003)(5660300001)(47776003)(104016004)(97736004)(50466002)(498600001)(50226002)(8676002)(4326008)(59450400001)(105606002)(36756003)(48376002)(85426001)(106466001)(53936002)(77096006)(2351001)(51416003)(68736007)(76176011)(6666003)(81156014)(6916009)(316002)(81166006)(2950100002)(8936002)(16586007)(356003)(2906002)(305945005)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB2699; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD041; 1:a8AzLUSWa8yjmV2bCjlxMcqHT8bPxuAn/oX09h8yzP54+VLnQGa6CJ3ELm0JDUCD9f/KkFCEZfWHmRn48A5xIyiU1UWA5Kzp4FvugIzRXy5ZiT19vJy3vcuHqnIoYPp1 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4994a872-19df-4d9d-4754-08d542220be0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:DM5PR03MB2699; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2699; 3:4NWfE3+ojI8iemRF+8eg6c3J1sJ7cQeZzE7vEw0rNLqqbUttBYNNC5Nr9dByw2CumoJGIQZDaLuW5DYYrrKx4yj1iNHrinS27CVBSkgkgbxN65iX80S2zVsKDDoFZWWPsz/YmfHD2WGxnp1wZZ231NvBxs+vPwcWzTgYGxch+4tGL2W2HahwFoUvX1bbc9OttI3hObrEtpbui3goEFmPNni3qw858/y434akRgLEDjJYxwZp5jynSVGMUsIR0X+OZEnVDIk8kdhm2uY4vGIATJlnukkCR1pWVvwCLCc/aIqG3ll/7dEsFc9ExRymX5/BTeQcpU+9/S1ASIlXY03A4tr+1Xzbuzh2O8PabltPdrE=; 25:jKFy7vA1rjDP1XOV7V4NAt2AggFkst2ZcUcM0RkYRkuLAHURKOkV4Jnu4PihoKSFS192shvwhHlpw7xMtK2JtYcc5/KsKYeSTtLMWmT3J8GptEzUxRioypdx9vyNIQxOOTL+H+4SdkICRPri+dQ8qXP1ucm6qMnPd6roVvrfCKA9wkiAiZmhj4Hh6VAA9Q6JEVb6oTpz1g3M5Lsgq2CUw6INmouhwZk1ps6GcmaGDsc2iV4mWX4MWx/pxkkSKt9eH/aDlWkz9qfQZbW+h7R3dWThK/tHJp8WWpQ6/LM/7tEwf9gt3GaRwf7iI06KXVbcAfOuGEWcIvDow9XbZQI9sA== X-MS-TrafficTypeDiagnostic: DM5PR03MB2699: X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2699; 31:J52gWVv0jIdATH2wtyoWFlSOa4I4ia6BfZsmCCj68mmY/Acl407V91KBLd8RIHyzqdTki0nAz0x9bS5m7Cfm4hWm3ORtYg+rqvRFVdTpdejjTS2ct7Ui+k/p1xUKniq16LOBdJ92U/1cVPpsFKhCVEozJ37ZH67lWhsnBHaSGDH640mOGL1BZwELnI4GkB3X88XVo3HwLwquexRgUwU0RfWiLz3ordmZTCtl6hRY6OY=; 4:krm03hxJHbV+doM4bQnHYhmrXlz+ExCIqrnpXp/et87LAcUsxD/tGyUt5ZXRbkhBq23zeKqi3HVjEAgL33vrbTtC3yzyqlLTjf0fEEJsIyoD83aSDvmTNvbMSZI3WeT0T6r+431LOkUCPKHZOP2XuPZbfRE2lmmZbpIMymgHctfHi/wtukpgBIXT6QuJMc6Cs4MXwwMJp/r1lQaxezgAc1DxvCuskVhTptc47ZFnqB9jfg37u5FkzF4w7wCJorsS1OId2LWBgA6LHHuixULq5n2aLqmMBUUcdsgBa6nt+NDbMzuoEqLZ4aWynjt1UH7O X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(3231023)(10201501046)(93006095)(93001095)(3002001)(6055026)(6096035)(20161123561025)(20161123565025)(20161123559100)(20161123556025)(20161123563025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(201708071742011); SRVR:DM5PR03MB2699; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:DM5PR03MB2699; X-Forefront-PRVS: 052017CAF1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB2699; 23:pvs9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X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2699; 6:fjM6NBtgxq64TwkUSZ/WYQUjfQLixKn53j6gFhbCpzAspaurD/t7NIUadphIMOrN9ZcGq0IK7N3HDIKEckKTls0CDsW6n3HV+oWqn0AfzfMIMRnKgJnXmhkARz+hGWc3rTy29k9MYFt+r7kFDA67q20MjH+Uk/eM5uiwpS5lqOvdwZdCrW1hYwYZa2u25cm5LF0yXpwlUI6gV8RtpcnpJ6TZPLuWBrfVsDLFgF7Ih+TuDBUrFsjySx+o+0OUkYSK4Cz1D9HRr/1LFyHw2vgOOprsEfeqpiWZ+4HEk1qtpADa4dEz0Adtfc8vWuJhr6TF1Sf5XTT+DWPcGmsBn3qi1Cjut6we3iQN7f4pQMvBF/4=; 5:V8O+ZcuH/IXdZa+Ie9FkkE7LkHwg7QriDrFgEDJFwmtjOBs25SSXfOUBL30vXT+TIBi3LbyNq/G6HlbxagwucbkK7L/igyYQ42NxI+dS4+VXbPxgJ2CSIxGHAUIZQgY+Wat6jnzGKjY8W9PE3PZaCrns/4xNM9YwNpX4a6VnBAw=; 24:ot1VFgr/bOomryawFtc+ljTd3AWrHIEXEeM6+CxtoufoJNgtmUyR4nBiJByxebpv/1Y09NOPHEGjU09lkiC3jGlIuTrGwYA4BVOYnlH6o3Q=; 7:cspbx84hXrMnHURF+MzGb4cw4WcLFKwuWYK7MXfad9Ttg9k+KhnQXadLrr5yI2Cl9SN7XHEx4E3yda+lKO4XwIbyMx+ukhakcqpBU2OZ+XXbibrvO20zrd2UkcXHxqcWJIBej4MxwTQ/QFkzuIhdNLQ/MeANUKoiOpJfEzFdWRafJxzuvbgZ8KX6n5OLuFMusroLNYvHtZxFB0+/C+Q65+px3ecRzrRvJoU1w6NCW3PLG+2sVnsSXuJR3tDeufde SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 12:07:13.6646 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4994a872-19df-4d9d-4754-08d542220be0 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB2699 Subject: [dpdk-dev] [PATCH 13/18] bus/dpaa: query queue frame count support 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" Signed-off-by: Hemant Agrawal --- drivers/bus/dpaa/base/qbman/qman.c | 22 ++++++++++++++++++++++ drivers/bus/dpaa/include/fsl_qman.h | 7 +++++++ drivers/bus/dpaa/rte_bus_dpaa_version.map | 1 + 3 files changed, 30 insertions(+) -- 2.7.4 diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index 6ae4bb3..b2f82a3 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -1750,6 +1750,28 @@ int qman_query_fq_np(struct qman_fq *fq, struct qm_mcr_queryfq_np *np) return 0; } +int qman_query_fq_frm_cnt(struct qman_fq *fq, u32 *frm_cnt) +{ + struct qm_mc_command *mcc; + struct qm_mc_result *mcr; + struct qman_portal *p = get_affine_portal(); + + mcc = qm_mc_start(&p->p); + mcc->queryfq.fqid = cpu_to_be32(fq->fqid); + qm_mc_commit(&p->p, QM_MCC_VERB_QUERYFQ_NP); + while (!(mcr = qm_mc_result(&p->p))) + cpu_relax(); + DPAA_ASSERT((mcr->verb & QM_MCR_VERB_MASK) == QM_MCR_VERB_QUERYFQ_NP); + + if (mcr->result == QM_MCR_RESULT_OK) + *frm_cnt = be24_to_cpu(mcr->queryfq_np.frm_cnt); + else if (mcr->result == QM_MCR_RESULT_ERR_FQID) + return -ERANGE; + else if (mcr->result != QM_MCR_RESULT_OK) + return -EIO; + return 0; +} + int qman_query_wq(u8 query_dedicated, struct qm_mcr_querywq *wq) { struct qm_mc_command *mcc; diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h index c5aef2d..9090b63 100644 --- a/drivers/bus/dpaa/include/fsl_qman.h +++ b/drivers/bus/dpaa/include/fsl_qman.h @@ -1649,6 +1649,13 @@ int qman_query_fq_has_pkts(struct qman_fq *fq); int qman_query_fq_np(struct qman_fq *fq, struct qm_mcr_queryfq_np *np); /** + * qman_query_fq_frmcnt - Queries fq frame count + * @fq: the frame queue object to be queried + * @frm_cnt: number of frames in the queue + */ +int qman_query_fq_frm_cnt(struct qman_fq *fq, u32 *frm_cnt); + +/** * qman_query_wq - Queries work queue lengths * @query_dedicated: If non-zero, query length of WQs in the channel dedicated * to this software portal. Otherwise, query length of WQs in a diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index 4e3afda..212c75f 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -73,6 +73,7 @@ DPDK_18.02 { qman_create_cgr; qman_delete_cgr; qman_modify_cgr; + qman_query_fq_frm_cnt; qman_release_cgrid_range; rte_dpaa_portal_fq_close; rte_dpaa_portal_fq_init; From patchwork Wed Dec 13 12:05:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 121752 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5385376qgn; Wed, 13 Dec 2017 04:09:45 -0800 (PST) X-Google-Smtp-Source: ACJfBotqafGfdbZir6+m9E1OWCqB9lRHbtAZirCxTs9/anBJkPXiAIria+1hLlGYCuo6wGPhEg13 X-Received: by 10.223.171.202 with SMTP id s68mr2128317wrc.13.1513166985637; Wed, 13 Dec 2017 04:09:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513166985; cv=none; d=google.com; s=arc-20160816; b=elsvURudg6Tf4sgqgJMRZm6rZ3lDTe1oL4MbYGVpiOGl4A3pTfDeRl88L+zmiEL5mv dgaDKCpl15NCLQLMTL7OzFqmsrYKy3LQiN2qUHg1MFrux5jQDXUe4h6c344APvTpjBTI Jr+sTaTtuOOTab2WsA1OISvr8XpYsXr/vwiyR39/ixy9aooSq/MBLUxE7RkazSdqp7yc +58jcWl+SOt5k8t3a3NtE1QKf93UKecOOBjZtDPZIfT+ahI6V896uuGFWB9f9ajdcJxJ Dx9uGyOK03iPr627FXVoFKSByPgP3sHM9CyO/DF6+vrE6Z50VF/13nieHHAbj5aw0cIk Ta7w== 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:arc-authentication-results; bh=jKFOezgXJguVsasfFy1vYYI4KOXxHBPUz0FhxznFAeU=; b=MXFr3fCSfzpNYHZvO3amV5rFPVe9TGikN1mg8SK3HzUrI487KK0jIh9SzO5EtbohFm qBHJKPuThynGQ2GLS71BzefJf+dU36i/qGmsEmHn1ug6KhWRekrPqFbvIt7y+tYaA3ev o/DYtoXBU90z7PpPQDTWAicLvek/tQ2J7XITsAVcLQBz5mToqxsSVP60+J6n2ADGqcQu nq5bVyInQJtNU1C1LbIdGPzzGwfQOpr12ewgRRgySki62Amiu8a3Lp+vyRnj8Jhc8HWS b680NCwEgNsvaRnGEDS2PW3cdH+UqOXUDNf5bwJ5JYOt1ReDmSXo+O4Kh2DI9S3j9L97 7Biw== ARC-Authentication-Results: i=1; mx.google.com; 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 89si1211539wri.18.2017.12.13.04.09.45; Wed, 13 Dec 2017 04:09:45 -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; 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 10B691B1F2; Wed, 13 Dec 2017 13:07:29 +0100 (CET) Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0070.outbound.protection.outlook.com [104.47.41.70]) by dpdk.org (Postfix) with ESMTP id EDFC61B1C1 for ; Wed, 13 Dec 2017 13:07:23 +0100 (CET) Received: from CY4PR03CA0100.namprd03.prod.outlook.com (10.171.242.169) by BN3PR03MB2354.namprd03.prod.outlook.com (10.166.74.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 12:07:22 +0000 Received: from BL2FFO11FD056.protection.gbl (2a01:111:f400:7c09::100) by CY4PR03CA0100.outlook.office365.com (2603:10b6:910:4d::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Wed, 13 Dec 2017 12:07:22 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; intel.com; dkim=none (message not signed) header.d=none; intel.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.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 BL2FFO11FD056.mail.protection.outlook.com (10.173.161.184) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Wed, 13 Dec 2017 12:07:15 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vBDC6t9Y008652; Wed, 13 Dec 2017 05:07:20 -0700 From: Hemant Agrawal To: CC: Date: Wed, 13 Dec 2017 17:35:55 +0530 Message-ID: <1513166759-13466-15-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131576404355099437; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(39380400002)(39860400002)(346002)(376002)(2980300002)(1109001)(1110001)(339900001)(3190300001)(189003)(199004)(2906002)(86362001)(76176011)(316002)(2351001)(106466001)(105606002)(16586007)(50226002)(47776003)(8936002)(77096006)(85426001)(51416003)(81166006)(48376002)(50466002)(68736007)(36756003)(104016004)(5660300001)(498600001)(6666003)(81156014)(97736004)(305945005)(53936002)(4326008)(356003)(2950100002)(6916009)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB2354; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD056; 1:GiZ+4adqmFbaSa6EZWLRus2rJyYAjZJOZflrwCqjMR87tmBSenKblJQ5Urq1ky5zIrPRz5/I/CVHWC9BFZXta50QYj+pfxXbS6FhZi6cKANWR3rPHC33y7x5F56fz2gQ MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a8cbe870-f068-457b-ab2d-08d542220cdf X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:BN3PR03MB2354; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2354; 3:+3UIOMYnFj4q9XHA3bskYMxWPo2LzgZwrBJUTKBwcamyS2xAJX+0HW6OkBndetqlo5v5+zn5bIDE4dDy1eYdeDL6Ld4v4wq5NS9CjRnmpiAXTm7yoN3GIdVAfTWnAxxwncAuuHn9n3nHFBWlRochIzgW0IByhjhAsnoQcwTEn+KlCC8nN+S42l7r6aNexSkXOhCueVez7SglS7hzF3SZIcPsCH1UH5TN3gvXWcQH0yidFawN77kHV9F+oPSouRBpPFd2ffB7VfXDblrZyCxHubS093GiRzpPD3vyuxg20IwTn2W2k4tR1LWml110AEwLbqpgGz+fWGt87frs+lPBPTwmRXiXLOzdxPPf03uaxgE=; 25:9JCGtJT9N6F3k2FMQholkovCARVr5z/Fqp2MHEY+43VTOucZrPJcGJEq8duivt7qxmQZbnNY6LlUUMFgfB/TS86+eEWXg0z+UxpxwGfPDxqA0773opWLm9SdmMJTzaswFaSm5ANIWAJqHpnjdbpog/enBdbbWOB/hCaljIyYaNXW2S4xFbv2AYvH7MWkT7WB95TS5MxxCZv+Jk86xHcr0o7QfeQrRB8qIniY8+uLUwrRGJCbN5pQPQ2NG/s1bH2/Xgcb3hCanu6wPYsAJXzSfJe4aKWnchQL2r/r7qL7sIvIQHvrn63PIa/noeUfw4gSeu+nzdxqWkUxLrgAG7nhWQ== X-MS-TrafficTypeDiagnostic: BN3PR03MB2354: X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2354; 31:cR7dNBg0rbK8mbeGp9CBJ4O0mEq5aPWLWLz3hZDvjsYGTOyKO4uo+KTn3/v+DXMwfwgH2C4h6HQ6VAWuquxdeI9ueoun6fyLqTRUtgoJKmjptWIAoAtHGwzFOwlHP+S3Ug4SRlAGMGxrUas96TJBJBeFayN+WiYHCZpHSplT/xlLzw/A+DCWFpzGs63L1uokXNm5cwLRtF7phKdWVxdTcausZqLn3c+MRCzvOPfcVdY=; 4:etUCH1QGj2Q7FbdrLjDqTGfK3WqYjR8qqI+By9vhbABvRFyXq9sQnNWlYeeqXOizxxblnIyFFJ34tTfOpg0HZ7xmylkLZk4E2oNcAqzEXbYFphw8iFYy5rR7LZJU9X3MORCBuWxKJkoVrs1GT92pU3fAWSylBaerDlxAXTZKzMrHtMK4mDXzdqp8jCbe5bMovmv/7r+5OAC8dTyRcYZ60dwhJyWxjE81WmbKDW5SFDp9nhf/wYM8+dxVOI+E6q6G+soDSATUjdse7QxAz/jUmA+l0N6l23VlX+OqcKawrVRCIbWZtU4I+H1iyjyiHN8y X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231023)(93006095)(93001095)(6055026)(6096035)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123559100)(20161123556025)(20161123563025)(20161123565025)(20161123561025)(201708071742011); SRVR:BN3PR03MB2354; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BN3PR03MB2354; X-Forefront-PRVS: 052017CAF1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR03MB2354; 23:NHMmzSvM5tf3yYurUjgfXXvJyZKd3ttr1czYiQz5x?= NJS79CpDMubQacvFtp4GAR/HNJpSri9a2PqI6LIAy6WK+SQuphG9ypWwust08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VaNGO9v4DckWwFJXOKmDb+jK+W6u+gKed3dA7KXrVamTHc8rb5FkpYRfw88QK2iLTe+Msf4tqDIaLkNu7UZ8B0b4XpK7SpMNNXUl0xgT2QfPEnk+eD8lzEBFuy+w3VqB2eZsFigt1zvvi2e0u7G7sEdKXuqKd6I5bNzbgmB6ZRTsNc+6KSPGP4GV4wzlXn3/rS2CMyshqxbz0KfUVQOZJA2CG69tyNvKNVGo/ralY4HCAFv/pHhiaH+rAzCxzI3kJ3id8gk5Mk4ym4f9G/XM=; 5:WRqSHpLWLWAl1PYoN8GMLkn99qy14PVGGmspmHNnngdRTIsG1ssodei16q4GE74clEPqRD/6ppFNJyDtM3ZXfdVXSFf+0b/eDhE4MVMPK8XJS9uJrjfjgBp2Yiycs1fnMZmHPSh8765I81ymoACTD/7O7Jhl5dOnMmn6D97mTqk=; 24:Dqy8BsqDH6wblrBaFIbnSJOrvNU3C5DgfVZTUcYlw/RP7Y5WN6nxnFO9jUdqWMTG61NEpnmg8+CyPRh4q6txT4Y9uDSELXvpfRlly4c8Nl0=; 7:5i2KJFa7q5C6zw5Je5V0UwLw+Yioycgup7xQC1jNQE9tYRRXnM6nZUD04Ddc1+xkQGE9cdX4NbnLNOFVvKIy4RZ2dX72yHjH/KHz49xjUMz+jC81WjbTQsSfbAPIMQ6NzLAHcAJp8uDcXt88EiVW3feFOEMbOKgslbU13AiTY+2n/6FWRS4a3CBOAc30bRXQaylKKckVhvL4n9AJsdDgi3nmF7MHtLBGZQzYQXLLJgjGRke+s5bFU3tRfGOm1pdS SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 12:07:15.3539 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a8cbe870-f068-457b-ab2d-08d542220cdf X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR03MB2354 Subject: [dpdk-dev] [PATCH 14/18] net/dpaa: add Rx queue count support 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" Signed-off-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_ethdev.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) -- 2.7.4 diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 6482998..53b8c87 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -539,6 +539,22 @@ static void dpaa_eth_tx_queue_release(void *txq __rte_unused) PMD_INIT_FUNC_TRACE(); } +static uint32_t +dpaa_dev_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id) +{ + struct dpaa_if *dpaa_intf = dev->data->dev_private; + struct qman_fq *rxq = &dpaa_intf->rx_queues[rx_queue_id]; + u32 frm_cnt = 0; + + PMD_INIT_FUNC_TRACE(); + + if (qman_query_fq_frm_cnt(rxq, &frm_cnt) == 0) { + RTE_LOG(DEBUG, PMD, "RX frame count for q(%d) is %u\n", + rx_queue_id, frm_cnt); + } + return frm_cnt; +} + static int dpaa_link_down(struct rte_eth_dev *dev) { PMD_INIT_FUNC_TRACE(); @@ -690,6 +706,7 @@ static struct eth_dev_ops dpaa_devops = { .tx_queue_setup = dpaa_eth_tx_queue_setup, .rx_queue_release = dpaa_eth_rx_queue_release, .tx_queue_release = dpaa_eth_tx_queue_release, + .rx_queue_count = dpaa_dev_rx_queue_count, .flow_ctrl_get = dpaa_flow_ctrl_get, .flow_ctrl_set = dpaa_flow_ctrl_set, From patchwork Wed Dec 13 12:05:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 121753 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5385582qgn; Wed, 13 Dec 2017 04:09:56 -0800 (PST) X-Google-Smtp-Source: ACJfBotc7KDmJQOnp4Aamxq+OYj82HLvCdapJ3CndodJXN70uqDCwSHY2uBsAHQ4cRWUKtH1uJqo X-Received: by 10.28.8.212 with SMTP id 203mr1724634wmi.8.1513166996053; Wed, 13 Dec 2017 04:09:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513166996; cv=none; d=google.com; s=arc-20160816; b=p5X4LduFZX52+Ih/5V/B1yb0+oIkGEDYQjXOaVny2dMGGm8ukJSJIp/aas7xBq8G7H gsDCX40tKPsyy+4PchVeU+SSnp/2CPco1tZwb+uA5/ejRAKo/y4dP7f4B3AKChrPUM9S ZLLzD4UN8UvgAyuRw8rjX1+EF21kkQ/KjCO4BadCHSeIsGv0MXC6WLeiyPZyISmQtLMY a2HV0uNI78v62c8wmfg1c4FisQKvDY2/GzziOrBaUB/EZI2T49f1E3Ey3oC5i7M9IKDT uy6jdXBHJRNiSStYRklZ4CgRaFbdivq2Nkchc4TCZyLKVXldVjn4cCMaEzZgaw4TAyQE GrFA== 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:arc-authentication-results; bh=W65+OEiPAuRCrXTQJjzZoTIfbQURt971xOIg2YN9PTA=; b=TOUxEHb4skV9m1flOpPteX0ZAaNThr+AhZ3KS0zKb42Hw0HxWUWWbA+6B8zJkh5IiE WWOeWEMBw9wVftti6BmXWsfb5icuhjW/l+ZzSO4y7kTfiL97HQyhkqtDVLjrxqaOfILf fsfDKyWnwJrx3mFRI+VoKBfsnvITa6lRE6GCRpmqd67xye/P+XkshTyzgtHmDrxXGDCC ft1Aiku1BpiTuhodVW6b0PrqgWF4wu5HwwOQfnAdR0ddmPMW/50rHo9rUt2VHE8btdDd XwW2ZobXmDbAIkbbAtt8ML1t8ynBOJyauKRPM6TxYNZ/FmpoEam75CqCTE1rOPxUibz5 xmdQ== ARC-Authentication-Results: i=1; mx.google.com; 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 p17si1308220wrf.94.2017.12.13.04.09.55; Wed, 13 Dec 2017 04:09:56 -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; 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 4AF0A1B1FD; Wed, 13 Dec 2017 13:07:30 +0100 (CET) Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0043.outbound.protection.outlook.com [104.47.33.43]) by dpdk.org (Postfix) with ESMTP id C0A5F1B1CE for ; Wed, 13 Dec 2017 13:07:25 +0100 (CET) Received: from MWHPR03CA0002.namprd03.prod.outlook.com (2603:10b6:300:117::12) by SN2PR03MB2368.namprd03.prod.outlook.com (2603:10b6:804:e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 12:07:24 +0000 Received: from BN1BFFO11FD020.protection.gbl (2a01:111:f400:7c10::1:135) by MWHPR03CA0002.outlook.office365.com (2603:10b6:300:117::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Wed, 13 Dec 2017 12:07:24 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; intel.com; dkim=none (message not signed) header.d=none; intel.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.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 BN1BFFO11FD020.mail.protection.outlook.com (10.58.144.83) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Wed, 13 Dec 2017 12:07:16 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vBDC6t9Z008652; Wed, 13 Dec 2017 05:07:22 -0700 From: Hemant Agrawal To: CC: Date: Wed, 13 Dec 2017 17:35:56 +0530 Message-ID: <1513166759-13466-16-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131576404367771606; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(376002)(39380400002)(346002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(3190300001)(189003)(199004)(498600001)(104016004)(53936002)(105606002)(356003)(2351001)(68736007)(4326008)(305945005)(106466001)(2906002)(5660300001)(97736004)(77096006)(81156014)(81166006)(8676002)(6916009)(6666003)(2950100002)(50226002)(51416003)(36756003)(76176011)(16586007)(8936002)(86362001)(316002)(50466002)(47776003)(48376002)(85426001)(59450400001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2368; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD020; 1:9ZUGMuG+905y60y+7c6eGDSlx1JJvrPpPMMfTwzboE7oLipIbVI6EOSs6jpBMAifmZhqJL+wcYsPmxxCvOGJhMEZRcdKscq+QdsXf/E9Z0toE8eu/Qyn7IiFT+G1P/o/ MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 72f51f28-a185-4e3d-07d6-08d542220da1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4628075)(201703131517081)(2017052603307); SRVR:SN2PR03MB2368; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2368; 3:lA+xyQRQWRCniZKF81ww7CKrx2hjCVFWSkRyQsxAe+jo8kRLbvbXt29kinuJeWyymvBrhhbdZ95+ZXH1YKOpsmKCbrDBmt2j2+sl1ug5bROH0jPRHeJljPTYJxLPdFczn3bdDE9NDfVofJApj8s4noXuJja27zQKMduTu8dbk02Upi1MCWuy2uO2E1m0yb6v2m/T4obXmAzQuXYuxLwAjOPvKi9V6FjvMSvy0Sm5ku/V3GWhVT5KbkkzihRq9rFm5txiDfRbWUENcaFGEvymfJg3nIbnGaHVikYf/d7OV2ygvLqrfJmqNSjfPVxmITJPJ32ANjfpAIPbYKbA+q6AVaP2k6wdrY+zJMtVn4i09UY=; 25:ZST0F0s9omAdbqzvksJ6i2QXMUDvFbc/7ZnRmy9FpS6MPu8meGYtQJHMwTNFUV48T4FhjDqrwEPS3XuZufaSl5TSm54gE+REF9YkRVTbNX7WS5ba1DLCr+6hVF6bd3UgMtalyd1Rh0X1fRFCFm2ZVJlRc4Ado5HeLZiynaRkCCefOEKc9n5n9UFhHPHisAND3i1Cdc4Umg+HyTcgHPE9nQiB985/63+/DP5Cu0/gFE1yONJV7MIl3l/4MJWFKkRpk+Vh1PEsCt+HfHMT4OECBgrI/sBAJ2FgvEJ5TqFP31PPrNqKOxiwrRKNz6qRbGGPdlLGinVcBgc2+trV4QgU4Q== X-MS-TrafficTypeDiagnostic: SN2PR03MB2368: X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2368; 31:cNTXJcY/cYyJkgjr0kXstTpnqX1CP/EwOaXeUFrfYQmiiofbBZOH91yW+Wk4UwGv8FCA1jOMr7Sz9M73fki2OYtiJivcEdJMjFez8RZBVByuNxAiNsH4rN4A2Omefwwh0ePrzpfi2Jia+4bzINeP5xaqzd3laMC0jnuCKoxuMPGYj9czy5E2xZtyL85DyiD1PZw1e/c55psfnAAZxmvfuvRGuBY9MIAmooVwxVpJXj0=; 4:MqvFMXjzFnAJf28dbAG2KbTZQaIW+LkgQB8CfC9wn++EBFz6go3CJLgnXJkEaTZbMCSPLKTn7xHyVAbM3A5QM7CTKDhQbJS1E2BYIogVC0L3KYUVaCKKcqzpVQSq1atbqedzSQw8wxLS2URU53z6SWR3uDBMM0SC+12V7scoD9H9i+xcc9WH0Eg2Ca7TGnPUDSu9022Bseew2pJK+XygPyuvaMxsAk/ZMXU0ADTltibL5GOO0T3U+kd/tOSlO29MxqSCEWbZ2Z//DI5nlzKe8s2Qb9V+ACBrCVI1p9/tYkvaiHoPY7DPWwAUQ+Yv3fiS X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(3231023)(10201501046)(6055026)(6096035)(20161123559100)(20161123565025)(20161123561025)(20161123556025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123563025)(201708071742011); SRVR:SN2PR03MB2368; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:SN2PR03MB2368; X-Forefront-PRVS: 052017CAF1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2368; 23:xClYG4OeFcqtFvkEOdYDTWCEyx0wlv1ZluTuYhcQW?= s6DjbZYZysnEL4hb/Rvi/3dxbivlbSXxT0V3LxcFzVZxkwrJ5LFWJh3OPdQz5cp2P6miHLl/iBs8aAjqw7Kz5MQD7yQGS7eWs9D+XSZGhgNWiAemASWTPh/S/tMsnTtf/wuJmxmPZbdDiRR1Fx6XE4hTgiORu1mniXZR2Xlpe1NUZLB+OvMdmtD0AHlUjOULhX+BfPkyTZMTPYLXgQGuYui8fO3vKemH/FPivXUfPI+BWXA/YrGIFJ+fLj4u5wNcClCVcjXF57U8t46PeXviGWjoALM8EVdKIhkq+vQ22huHVJJ8Az4JBvSXk6OX5B59hR6I1V4YhL6j1X3tVWzsDx+T5V/1TPnGmqkjW/ATbOqbMdMwrZENI5TnaSI4fFwKdjdK9C7NjwRqjKrA2vMDb7tIET4vq/O8Xbi3HJQohAS4f1KdQ3obGpLZ9Mh5C2biLyuH94VB49w1+VJCgIXFb7CVlv4u8wKj8ak1c4XvACkOefqE2E630DvUkYiSCp3VdwfOwVUhceeqynjU50qglvuIvhS2aPtvfUkcp8iTYpeJo+xGI/xVyWRtBbs5Nwt0+1dTFgMww/YNhLFFq8qtGjguuFkhycBENFPLO0iLv82cC+roZja8o1otEkycTGEUM3MTlTEAyDxWlI4AcR/9x306EFMF86IVkgqYC8o3QoJuVIvaqCClONgMZ3ifWd0pV+araRhYCrxdqEPE3tYCEZKf9gdmy4Wv80GZTk3lHi10+wMKDdifJ+2UDgdb9Fa43AuU1vKuQMRT+ObNEWKfKE65qMpB+eeqQq22UF6bGiMBem1podQ+CR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WGc6K3qg9Dc48BTKeRMrKSQcjckwU6K80DKFYi6e5BRE/GlIINsf/4Dp91HU0LxzokjwWaTNifqJtP5PIn58tCa3D0/afZ+HlPCia+ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 12:07:16.6055 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 72f51f28-a185-4e3d-07d6-08d542220da1 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR03MB2368 Subject: [dpdk-dev] [PATCH 15/18] net/dpaa: add support for loopback API 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" Signed-off-by: Hemant Agrawal --- drivers/net/dpaa/Makefile | 3 +++ drivers/net/dpaa/dpaa_ethdev.c | 42 +++++++++++++++++++++++++++++++ drivers/net/dpaa/rte_pmd_dpaa.h | 37 +++++++++++++++++++++++++++ drivers/net/dpaa/rte_pmd_dpaa_version.map | 8 ++++++ 4 files changed, 90 insertions(+) create mode 100644 drivers/net/dpaa/rte_pmd_dpaa.h -- 2.7.4 diff --git a/drivers/net/dpaa/Makefile b/drivers/net/dpaa/Makefile index 171686e..a99d1ee 100644 --- a/drivers/net/dpaa/Makefile +++ b/drivers/net/dpaa/Makefile @@ -60,4 +60,7 @@ LDLIBS += -lrte_mempool_dpaa LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs +# install this header file +SYMLINK-$(CONFIG_RTE_LIBRTE_DPAA_PMD)-include := rte_pmd_dpaa.h + include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 53b8c87..fcba929 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -64,6 +64,7 @@ #include #include +#include #include #include @@ -110,6 +111,8 @@ static const struct rte_dpaa_xstats_name_off dpaa_xstats_strings[] = { offsetof(struct dpaa_if_stats, tund)}, }; +static struct rte_dpaa_driver rte_dpaa_pmd; + static int dpaa_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) { @@ -733,6 +736,45 @@ static struct eth_dev_ops dpaa_devops = { .fw_version_get = dpaa_fw_version_get, }; +static bool +is_device_supported(struct rte_eth_dev *dev, struct rte_dpaa_driver *drv) +{ + if (strcmp(dev->device->driver->name, + drv->driver.name)) + return false; + + return true; +} + +static bool +is_dpaa_supported(struct rte_eth_dev *dev) +{ + return is_device_supported(dev, &rte_dpaa_pmd); +} + +int +rte_pmd_dpaa_set_tx_loopback(uint8_t port, uint8_t on) +{ + struct rte_eth_dev *dev; + struct dpaa_if *dpaa_intf; + + RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); + + dev = &rte_eth_devices[port]; + + if (!is_dpaa_supported(dev)) + return -ENOTSUP; + + dpaa_intf = dev->data->dev_private; + + if (on) + fman_if_loopback_enable(dpaa_intf->fif); + else + fman_if_loopback_disable(dpaa_intf->fif); + + return 0; +} + static int dpaa_fc_set_default(struct dpaa_if *dpaa_intf) { struct rte_eth_fc_conf *fc_conf; diff --git a/drivers/net/dpaa/rte_pmd_dpaa.h b/drivers/net/dpaa/rte_pmd_dpaa.h new file mode 100644 index 0000000..4464dd4 --- /dev/null +++ b/drivers/net/dpaa/rte_pmd_dpaa.h @@ -0,0 +1,37 @@ +/*- + * Copyright 2017 NXP. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef _PMD_DPAA_H_ +#define _PMD_DPAA_H_ + +/** + * @file rte_pmd_dpaa.h + * + * dpaa PMD specific functions. + * + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice + * + */ + +#include + +/** + * Enable/Disable TX loopback + * + * @param port + * The port identifier of the Ethernet device. + * @param on + * 1 - Enable TX loopback. + * 0 - Disable TX loopback. + * @return + * - (0) if successful. + * - (-ENODEV) if *port* invalid. + * - (-EINVAL) if bad parameter. + */ +int rte_pmd_dpaa_set_tx_loopback(uint8_t port, + uint8_t on); + +#endif /* _PMD_DPAA_H_ */ diff --git a/drivers/net/dpaa/rte_pmd_dpaa_version.map b/drivers/net/dpaa/rte_pmd_dpaa_version.map index a70bd19..d76acbd 100644 --- a/drivers/net/dpaa/rte_pmd_dpaa_version.map +++ b/drivers/net/dpaa/rte_pmd_dpaa_version.map @@ -2,3 +2,11 @@ DPDK_17.11 { local: *; }; + +DPDK_18.02 { + global: + + rte_pmd_dpaa_set_tx_loopback; + + local: *; +} DPDK_17.11; From patchwork Wed Dec 13 12:05:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 121754 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5385814qgn; Wed, 13 Dec 2017 04:10:06 -0800 (PST) X-Google-Smtp-Source: ACJfBov0H4KfhDe3BWG0M7TFWfHQr7W/4B3BKCaWxI8uJESf9+6LbtqTRkmnNuqycLARxXRQkzeN X-Received: by 10.28.129.77 with SMTP id c74mr1811263wmd.124.1513167006824; Wed, 13 Dec 2017 04:10:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513167006; cv=none; d=google.com; s=arc-20160816; b=ej+kvudYdGs9k3BlxwprQirTOifBxYRKsWiFPCZHKgrei45sKQQ5datCheziEEHiX5 Meh5FoFzRL0O4f+M1K8fDyI4oZLH2k3k4AVGXNYE5j5kDM4s7hB5eMXQfL9iCgrAUgDl A9gy1gS+N0qGS/aB28Iv1cjekxpm5ZWMXdHcznH4uKra9eCWv9mRgB64aHjiqdeqV8ee ElhVvMZK654ebHT8gS7ZEwtQh9K2yfxmIzLYD7Ya5ic3pmp+/7OwxiI+75ZgA3Sh88Fw VbNISd4Mx7NUfw0qFWUKRBDX6dDrrs/Xf/kpJbhQ76Jc8VFpMA3Z5pb52VnaW/YoFDg1 T+jw== 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:arc-authentication-results; bh=0NNmS17SGI72GUEHs9Qgo9E78P5EITZyzlqG/GU24SU=; b=VvTOGzqeoIPU6+xqDqiJdSP+tdsrIhZwS3nJSipkmY6/LO22hBjf7+ogERoG4qvKtH Xo7pKHCoj6hnDL1eTk19a2ckEu4AI8v/MBJQUeVsR64l1tvgPMiRNsYj2CwmXRg5PkOd SZj/7rsx4DGKYzykQ8U0AelZ/HNC9GGz2M5cLxzY+lnXHeNCVuGsJ824VK2wc8oSACR8 LgHv4h/yhvIPTm1wa3fXVpHG0SssekKXGwIwu9RI+EZFcYViifHef9CJTTmihPe3QUHd pjjmUoAJP6Dsm5FXFJRuMQ8d+3Qv+YAb4JGdZtMQ8f7TzO8WX1pmSctbMfR2gaeS+zhN V21w== ARC-Authentication-Results: i=1; mx.google.com; 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 a136si1342484wmd.169.2017.12.13.04.10.06; Wed, 13 Dec 2017 04:10:06 -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; 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 8CB101B202; Wed, 13 Dec 2017 13:07:31 +0100 (CET) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0070.outbound.protection.outlook.com [104.47.37.70]) by dpdk.org (Postfix) with ESMTP id 704771B1F0 for ; Wed, 13 Dec 2017 13:07:27 +0100 (CET) Received: from BN3PR03CA0076.namprd03.prod.outlook.com (10.167.1.164) by DM5PR03MB2699.namprd03.prod.outlook.com (10.168.197.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 12:07:26 +0000 Received: from BN1BFFO11FD029.protection.gbl (2a01:111:f400:7c10::1:189) by BN3PR03CA0076.outlook.office365.com (2a01:111:e400:7a4d::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Wed, 13 Dec 2017 12:07:25 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; intel.com; dkim=none (message not signed) header.d=none; intel.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.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 BN1BFFO11FD029.mail.protection.outlook.com (10.58.144.92) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Wed, 13 Dec 2017 12:07:18 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vBDC6t9a008652; Wed, 13 Dec 2017 05:07:23 -0700 From: Hemant Agrawal To: CC: Date: Wed, 13 Dec 2017 17:35:57 +0530 Message-ID: <1513166759-13466-17-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131576404383721562; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(39860400002)(346002)(39380400002)(376002)(2980300002)(1109001)(1110001)(339900001)(3190300001)(199004)(189003)(5660300001)(47776003)(104016004)(97736004)(50466002)(498600001)(50226002)(8676002)(4326008)(105606002)(36756003)(48376002)(85426001)(106466001)(53936002)(77096006)(2351001)(51416003)(68736007)(76176011)(6666003)(81156014)(6916009)(316002)(81166006)(2950100002)(8936002)(16586007)(356003)(2906002)(305945005)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB2699; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD029; 1:Jp+NIwBrmXcU42vd/kOSlB72eHgE5faObjAZfLzwOX/KHSlvUP+s09n6FJ2yEG1M0qar9hleE/iLfvWEJzvEbwXUo1vDdC9lvnSFBkYwsoS7VIasgIfOJF4mkZwvO5/4 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ee7537a2-39dc-4ab0-685a-08d542220e94 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:DM5PR03MB2699; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2699; 3:NW1qpQzCNKs9xRMhYzbuWn7T6tW27C0KSaFH/+YWt72I47piEm6n9lTAeOoZwpm7S3hN8oyxjrQUTa+mICXyzprDzrd7xGH3jpQIwx5g9sh1W4rFGSi3Fv6NAKjPu1k2ysQVUaSNC1KKyXp+xEvnGujHovzPUfXlII4C1DCSGaol1y6kOI75+rV7oUWh8kku75h7ZFzgJGT5O+3PBKDSC7p3zaK+mXUx4BeOq8bdE4mOsKax8GZTR/FrgCdWOgXIQ6UyQ5Ks2lshPKjuHEGfLc3iq+KsAkWgPwHPoLAmPcYEVkv0d4qGYjSnkAhABsrObnqN/zLwqL5p46mXFnyMQt20Rfkc5P1lK4tQLoOR6VM=; 25:Ijx/lETCm4CtO4y7lxBOOehlPF94OLugTubu9S+vnmoY6L0LN9D3ReE94BfOH6vV7gABl10TaUFLqciyZmpwHT6OvmjHvf13POXnrjGnFQUaPt3uGscgQMj5V2u+NxDX14bYuO2EArwrfADmkNNZ/CKxoqTJ2vrLMRZA5Ib6O1p130gmpBH8eiKDE/vguWUVRKUk8157fOGuu8BTHpKn4XFlXFImhlyWp2YoCAsafq/5BWpx0LY3pabV69ujlUyp8tf8BRdXpSLX53gWh5JmnPkgwMySQhHnaLq92e/0djKKFlofYpERUQYprL4bKU0s/PP0SP1ZKe8Onu6jRhNBGw== X-MS-TrafficTypeDiagnostic: DM5PR03MB2699: X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2699; 31:mJXU8Qy/P9TVunvoczFEPKsChNaa+/Nb4GpDtWohjE+qugDfvWExinCtACHlsjY7k82R+TlXpK/ZjGo56v/zSYQ9U0eUTuChw2Ota0BbPHToNPzjQ0wfW6en2wYrD5WgIE8xgnHe2wPvinZDzp07NAo2ors7TdKx1vhsWT5OdQgLz7AS+NFWERKPBjPPFkg4uxHKYh1cGJDb6fqFNB3bIBETi3hXQzSJCZHZLK9jyeA=; 4:5Kvy0rfaEI7T7NaJq6cqXIlFQoyagYqjlrY0whA9La2alm5OJREryEBfrmaHP+2EGOoCS+H7hjS8mgFjv2zs5doD1DzetNMmEpKAxAJ5EC5KNGsh/ZJOYXxDB4dpUyGc7zJbASxUGsFDslBZD9d9Ua4IAhPWRP2CaeQ4eGqekM04k+Gcnh3bU26OEG0JrSeamd5v1yJ+ys/TKksE2fUMPxzOqJf7n74g6DombyFiZDTtwCReL2dLKMI6dY5hLyxhQsBmedXR7L7UlDBCAt3WCjiP5/i0zjzhgllTtf4NzoMIP+OHKycYvWnVueUJV8kb X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(3231023)(10201501046)(93006095)(93001095)(3002001)(6055026)(6096035)(20161123561025)(20161123565025)(20161123559100)(20161123556025)(20161123563025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(201708071742011); SRVR:DM5PR03MB2699; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:DM5PR03MB2699; X-Forefront-PRVS: 052017CAF1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB2699; 23:W6t8NTSrHoY5OHz33Ly3Up0DOj7gzrAf7UuJGFQQn?= BrhXZ40y6f4NvbNGozRI4ATxMTAcGDU+v6DpUHkE9UVnmlOmpiRf0SA3jihHzGv1L5nHYxBq8twLuywlGZtjEIJIjxzvE9eMIQVlOyANPYZSx4KeF2GY2oy9qYMhuYFnwAvfMyAQ+JHfn3rB1CxMMnKOukarcjO6Jl+MIjkK3108RjhY6Kt+CNU5wwRlZAQvqP1J7cSRaLt6eHzGywhoSpq3XtwOevSwhhuRtsY7MG4HFSfPntbHNlXwXwa6ji0lwahRAYoY+Kxmi+UUhD6dxbh5I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QeqE/bMaS68a5cAxFtPIl7nH96ItmJQCDKnIEfkyOW1yzVDuzc8Hfxo347gI0I=; 5:ntwenlEHYFqilxxX/YQm1nMRpPWk7uJsih0tSvpIp1nMKQ+TnHbOC3jRUmBnrPl4dnLPt3cdeDkbOiDI1HcWWkJjXuTmKrktyAo+qFQyGU32BPp5GyW9hHrxhq5eYVLl5Uvgp0I3Z2g6yABNohljGKGbwgHKzH0kkHDebch7AMc=; 24:dq6KfKjS2A8rrZ8oCSVeKALsuyywmymmSkcpq7zz1EpJQVNBxYqZOXM136h/Um60s+QGctrwupRsWK5FdW8gk2KthMGPXODu4lN5Stjvcp4=; 7:HXtMGTXJTuJZXvCI7jz5kZ8J3/aZX42GtrdPhjI24i7p71ORnk1YU/ivMJbwdMoZyYgRpBcNDJ7EBNs5BNOhKLfehxsMiT+OzAr6TiDvG/rTt02LH/fFPul0PWc0MS0Q+aLKRRHDFDn6yqktJ6E0Zne/aj/0leADvb48lL0RslzphGBoweEJl1ctRG4SOdNCbosHCh6I30/hyV1tLzr4yEe8STl5Kvv0lyD9xgWIMVYbDCiYd1KcYvIYqS+CikGu SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 12:07:18.2005 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ee7537a2-39dc-4ab0-685a-08d542220e94 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB2699 Subject: [dpdk-dev] [PATCH 16/18] app/testpmd: add support for loopback config for dpaa 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" Signed-off-by: Hemant Agrawal --- app/test-pmd/Makefile | 4 ++++ app/test-pmd/cmdline.c | 7 +++++++ 2 files changed, 11 insertions(+) -- 2.7.4 diff --git a/app/test-pmd/Makefile b/app/test-pmd/Makefile index d21308f..f60449b 100644 --- a/app/test-pmd/Makefile +++ b/app/test-pmd/Makefile @@ -71,6 +71,10 @@ ifeq ($(CONFIG_RTE_LIBRTE_PMD_BOND),y) LDLIBS += -lrte_pmd_bond endif +ifeq ($(CONFIG_RTE_LIBRTE_DPAA_PMD),y) +LDLIBS += -lrte_pmd_dpaa +endif + ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y) LDLIBS += -lrte_pmd_ixgbe endif diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index f71d963..32096aa 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -89,6 +89,9 @@ #include #include #endif +#ifdef RTE_LIBRTE_DPAA_PMD +#include +#endif #ifdef RTE_LIBRTE_IXGBE_PMD #include #endif @@ -12620,6 +12623,10 @@ cmd_set_tx_loopback_parsed( if (ret == -ENOTSUP) ret = rte_pmd_bnxt_set_tx_loopback(res->port_id, is_on); #endif +#ifdef RTE_LIBRTE_DPAA_PMD + if (ret == -ENOTSUP) + ret = rte_pmd_dpaa_set_tx_loopback(res->port_id, is_on); +#endif switch (ret) { case 0: From patchwork Wed Dec 13 12:05:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 121755 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5386039qgn; Wed, 13 Dec 2017 04:10:18 -0800 (PST) X-Google-Smtp-Source: ACJfBot0UnHpfloLdiTHcmlzWjWnph1V0rvRLuObmqDQ9ZZDPoDQzsMhM8PovO4qVlUEY+MG5hKk X-Received: by 10.28.51.133 with SMTP id z127mr1987219wmz.84.1513167018531; Wed, 13 Dec 2017 04:10:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513167018; cv=none; d=google.com; s=arc-20160816; b=csSaj5uQUzmm4v0rXJRRPPaE5A+eMtCZhkg65AAK7rk24JDGIrudiCqNwnRw3MdEil p5EdTTzXaZ1CCsVyQ4Ji9hNjLUW1S3Fndu8SvBE0MElW5IlL4ZlGoHa+9WNl2S3ndkoc KpQ8bC6jKURIUi2b6lC4e+rCJwv9jJgLODLB0H61X2pmnucmRxhKKZfMj57vymUGDLw1 3mwx45aruxnKW0c9Sw0h75wCUGrKFxiRrnWcvbYbIMjqYWA2Rjt5DHX7C8bKNZrnRWMI Yc5vm49povAotFi9ipHibf3Ykx1bAJWbRexaJQLuGDcimfqLUC0kqpXrXCenIV9KV1vI zZiQ== 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:arc-authentication-results; bh=+eJOhBxgJ49JqqKeBAta9+iETatbVVnTFitvWaxNs6E=; b=IthL3D71eyA6O//40Dx7C/NHyOd90p6AECjwjMenX1vJXkfuoxdyQ56QjlucR2o8IC om6wM4xbmB+ZApZyQxg0v1XvmqJUMEe3rTAsvfIO33p3ibyDJATb9T+jwXv4ZTznCSxT fiw9VFiIGgdf1s6DPt+eAYDtbgxshs9P+At7wbbMvlXvafxkR61GHdDPiZLs1OUz+rIE 8UL8VIwbVkNHaWgTjnhaGlziBnSqy37c9D72gEzqiKQCrs06I0BgfsOTOB1/rFqyiEOO akLmgy0yUT6W0Ic86v5uBKbmbucTOcHO/Ma1oUIhhtElKOgQkoT8P44zN/4fWhQfJQkW JOzw== ARC-Authentication-Results: i=1; mx.google.com; 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 200si1428628wmw.71.2017.12.13.04.10.18; Wed, 13 Dec 2017 04:10: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; 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 BA3201B20D; Wed, 13 Dec 2017 13:07:33 +0100 (CET) Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0055.outbound.protection.outlook.com [104.47.40.55]) by dpdk.org (Postfix) with ESMTP id B65681B18C for ; Wed, 13 Dec 2017 13:07:28 +0100 (CET) Received: from CY1PR03CA0017.namprd03.prod.outlook.com (10.174.128.27) by BN3PR03MB2355.namprd03.prod.outlook.com (10.166.74.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 12:07:27 +0000 Received: from BL2FFO11OLC010.protection.gbl (2a01:111:f400:7c09::100) by CY1PR03CA0017.outlook.office365.com (2603:10b6:600::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Wed, 13 Dec 2017 12:07:27 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.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 BL2FFO11OLC010.mail.protection.outlook.com (10.173.160.154) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Wed, 13 Dec 2017 12:07:20 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vBDC6t9b008652; Wed, 13 Dec 2017 05:07:25 -0700 From: Hemant Agrawal To: CC: , Sunil Kumar Kori Date: Wed, 13 Dec 2017 17:35:58 +0530 Message-ID: <1513166759-13466-18-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131576404406132824; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(7966004)(346002)(39860400002)(39380400002)(376002)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(48376002)(305945005)(356003)(106466001)(50466002)(81166006)(53936002)(81156014)(105606002)(2351001)(54906003)(76176011)(59450400001)(85426001)(51416003)(5660300001)(8676002)(8936002)(316002)(97736004)(498600001)(16586007)(2906002)(50226002)(68736007)(4326008)(8656006)(6916009)(2950100002)(47776003)(6666003)(86362001)(36756003)(575784001)(77096006)(104016004); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB2355; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC010; 1:Wl30ieBi2h0eucV2MmINkQq5J3wzgXmHZhdqcYlUJmGuTn2yjkJLN38L1hjUTxznmn2Ss9uPJlXsGdw9N+cusVd/qKtWrtH/WBBuQ7QcrVENiVnY5c6Hr5CGy62qRuO9 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a7b6e905-dc86-4b36-6058-08d542220fea X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:BN3PR03MB2355; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2355; 3:CuSJ5gYJS1u1w9TLcIM8JNfjbUmwdovSEJKMkKI8uAEBFLq83KJEBoSlPfIu4Bx6tAXuWo5kp2rlE+babeKiyhFuzkWXjHH2QxrCb3HTo4Xjzp7ypygo25EYe7IB/1oJg+zvSvdClF6SDORahEaN8I4Xwdh71bUYPT10hxHf7zbuQOgg/t04DFjXms0L2W8fb6ct8cqhhZyo0dfDz80ENtFx+KOGeu+nOPA2CRWC+FScwl5u5zSEcgC1FBF4c7ZSiTKM4VXhQf6hBQUms/fZJ9/V1ZhVUzVxGR/e2/8st4/wkh2oU9K1uRBqqyU2Bv/rKpgHqCh2NEzRK8XOvwtkjaocjzVd7+vpaaibOgcPFIY=; 25:dpNuCWVlU3NhfttDvjZkdnaAZd6VTTfENq/GEtHDL1fNeFbIjBIYwbjhLOON/LOcGw6dLCkYAIJNyrQw+hHOhcQgenspsR5OvodnyxP7ZC5zFL65ZjOsUAIawi9Gjqak+3mpyPiUp+jYAIybypsTNfi4kRwdUrkSh5szygYRM7fcq1z8qDZHxKmIp4iKWZrPtCuvl8S9CBN0wI5vHWVDySGEhYFUHySk7cOEJW2Dc7CGbVlbjMOxXFBgnwPdQI52OYEjFlSfQZVRoDKKEu0gRADLoZkBpGtRE/y2iKr0WMngkg2o8piGyPWgDxr4hY7YdezolDer70Br6RUPgxQth6wschL31lPkoo9Sybc7upo= X-MS-TrafficTypeDiagnostic: BN3PR03MB2355: X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2355; 31:h2NhaS69TSQ1RpSXFGVnGKn3reZFTayT0UH3nwFg/2Gz0geKWtIDnNbBVWFjEwLjfaZARZ/qul8O8C8EnX5UjFtcX1te0bXGSDMDb0rifkTc+O0mKa1OKCLCJGT08IH1/xvZG82g4MHJQ7/DFTWVMGTbYdiLytm1yqe1rol6y/KphLyLmBGgsACDkXImN3mEskEOKZe2bLE5X9ZJCgclUJ8nDkHaAhDrhG2ohaMtATs=; 4:aFy6U7AUpPuPGE0F/B/V0fIKdu/c+PRAlqU1kL8w18NNi5hYPwNK6qfRV4eoGZ6r8t54iSafB22Cd3D9emqcfeLqz4iIq2bbRoR9v0h93gZCqP56TgUh6sl20LCsDTHXTmzjiYh2hGxBEiSTckZ+zhGpdjUI6kyFDPUEHDpYcw6EaxPhnLZpdOlBR2iwHyicxcWlKzbPO6+2fWqKGVJ1Mg71dMyzOBFvj+tG6CHoF8LbwJz3gU6VQ47OZkkqpHHcp2QzUCuyEznI23nURcdCkq32hZuF8NYFDHVOSdWIjGAvYYdlHV5xUwNvD4Lhsjos X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231023)(10201501046)(3002001)(6055026)(6096035)(20161123565025)(20161123563025)(20161123561025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123556025)(20161123559100)(201708071742011); SRVR:BN3PR03MB2355; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BN3PR03MB2355; X-Forefront-PRVS: 052017CAF1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR03MB2355; 23:SldFxU9tgRf+QzGDpI/39C4Wiz/ics94lb9gmjl/5?= qVe8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6lJ0NiRILjm8T9jn7HlZ2vJ X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2355; 6:+1haLk65qqXPJhq2EVDIJxG3D4wsMDE10zcOQ6HLP6aWyxVNRJHhmCn+WLv7ZwWd3HwRue2qhH9zUr/NhpSOyAHbw6/+Eytij0kuEi54IjB4e4RD0K632wdH0JQvS1j5Mrh4uD+uwXYMwg2PhfGWpivpSYFma26JmL2RuTbSecFM/QHfpnqMt/YRVKzaQEwUUs51zjGbRCoxxGr+RsRe8MSPf7FE4X+xivgy7vIH/rKaDlAwchiqui/rXxRUsuWTcs1wfpD3A7AhcO8PMl3OzDQbu1aKrz0Pg+O+BsL8lrtniweGjii03gI2HPJDw7sT1nLY6vjRe/jW5ReJ/ZLNhhx5OqyluDNuSo05CpcheVU=; 5:y3weM3oNF1OMtX9TuAQDs7M6+3fdPSTpA9rD0EM+xxu7gRGkVy45vRVpIfGwTJ8XVJa/A3LqaHj9zC1qSoVYyQbeXDi2lNFDs3wb2lxwDLuYcma17F4zh2AXD435RVe5poANd5NidpFTcFrib9m9WYYnP1aGY5EaSXUjZXLsTi4=; 24:6j1laC6vgLd9fbbL7qGL/4ZKr3p+LhotzR7eAmzdmNTcEyNcDLitHzwrOx66uGCx5g0HDMhtlnWoEtfoaUnP/E2CtGLgixhnFzq3jjwiuwM=; 7:64IqJfJObN/8z/nfYCEps/neuFsZSOdrXO5naKUq76N3DD1dOoGwCgvplDawkp8k/1qFzhZO1gCmxrRy1m1uQdOhL8bJupLCuLX6piSoiaIUCeLHzUbyIVNmOo/QmznK0yGV4SO7hysTYQLt5D2m56RX8EmiJvDMhnKfH012J/hCh4lIzDKtO9qOaOmeIO4wfg0/KJz9dCBDrdh17AndF4PxcFiWLyEepphb6d0lcIadv9wyvs1shedlxigAcIqJ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 12:07:20.4574 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a7b6e905-dc86-4b36-6058-08d542220fea X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR03MB2355 Subject: [dpdk-dev] [PATCH 17/18] bus/dpaa: add support for static queues 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" DPAA hardware support two kinds of queues: 1. Pull mode queue - where one needs to regularly pull the packets. 2. Push mode queue - where the hw pushes the packet to queue. These are high performance queues, but limitd in number. This patch add the driver support for push m de queues. Signed-off-by: Sunil Kumar Kori Signed-off-by: Hemant Agrawal --- drivers/bus/dpaa/base/qbman/qman.c | 64 +++++++++++++++++++++++++++++++ drivers/bus/dpaa/base/qbman/qman.h | 4 +- drivers/bus/dpaa/include/fsl_qman.h | 10 +++++ drivers/bus/dpaa/rte_bus_dpaa_version.map | 2 + 4 files changed, 78 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index b2f82a3..42d509d 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -1080,6 +1080,70 @@ u16 qman_affine_channel(int cpu) return affine_channels[cpu]; } +unsigned int qman_portal_poll_rx(unsigned int poll_limit, + void **bufs, + struct qman_portal *p) +{ + const struct qm_dqrr_entry *dq; + struct qman_fq *fq; + enum qman_cb_dqrr_result res; + unsigned int limit = 0; +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ + struct qm_dqrr_entry *shadow; +#endif + unsigned int rx_number = 0; + + do { + qm_dqrr_pvb_update(&p->p); + dq = qm_dqrr_current(&p->p); + if (unlikely(!dq)) + break; +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ + /* If running on an LE system the fields of the + * dequeue entry must be swapper. Because the + * QMan HW will ignore writes the DQRR entry is + * copied and the index stored within the copy + */ + shadow = &p->shadow_dqrr[DQRR_PTR2IDX(dq)]; + *shadow = *dq; + dq = shadow; + shadow->fqid = be32_to_cpu(shadow->fqid); + shadow->contextB = be32_to_cpu(shadow->contextB); + shadow->seqnum = be16_to_cpu(shadow->seqnum); + hw_fd_to_cpu(&shadow->fd); +#endif + + /* SDQCR: context_b points to the FQ */ +#ifdef CONFIG_FSL_QMAN_FQ_LOOKUP + fq = get_fq_table_entry(dq->contextB); +#else + fq = (void *)(uintptr_t)dq->contextB; +#endif + /* Now let the callback do its stuff */ + res = fq->cb.dqrr_dpdk_cb(NULL, p, fq, dq, &bufs[rx_number]); + rx_number++; + /* Interpret 'dq' from a driver perspective. */ + /* + * Parking isn't possible unless HELDACTIVE was set. NB, + * FORCEELIGIBLE implies HELDACTIVE, so we only need to + * check for HELDACTIVE to cover both. + */ + DPAA_ASSERT((dq->stat & QM_DQRR_STAT_FQ_HELDACTIVE) || + (res != qman_cb_dqrr_park)); + qm_dqrr_cdc_consume_1ptr(&p->p, dq, res == qman_cb_dqrr_park); + /* Move forward */ + qm_dqrr_next(&p->p); + /* + * Entry processed and consumed, increment our counter. The + * callback can request that we exit after consuming the + * entry, and we also exit if we reach our processing limit, + * so loop back only if neither of these conditions is met. + */ + } while (likely(++limit < poll_limit)); + + return limit; +} + struct qm_dqrr_entry *qman_dequeue(struct qman_fq *fq) { struct qman_portal *p = get_affine_portal(); diff --git a/drivers/bus/dpaa/base/qbman/qman.h b/drivers/bus/dpaa/base/qbman/qman.h index 2c0f694..999e429 100644 --- a/drivers/bus/dpaa/base/qbman/qman.h +++ b/drivers/bus/dpaa/base/qbman/qman.h @@ -187,7 +187,7 @@ struct qm_eqcr { }; struct qm_dqrr { - const struct qm_dqrr_entry *ring, *cursor; + struct qm_dqrr_entry *ring, *cursor; u8 pi, ci, fill, ithresh, vbit; #ifdef RTE_LIBRTE_DPAA_HWDEBUG enum qm_dqrr_dmode dmode; @@ -460,7 +460,7 @@ static inline u8 DQRR_PTR2IDX(const struct qm_dqrr_entry *e) return ((uintptr_t)e >> 6) & (QM_DQRR_SIZE - 1); } -static inline const struct qm_dqrr_entry *DQRR_INC( +static inline struct qm_dqrr_entry *DQRR_INC( const struct qm_dqrr_entry *e) { return DQRR_CARRYCLEAR(e + 1); diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h index 9090b63..7ec07ee 100644 --- a/drivers/bus/dpaa/include/fsl_qman.h +++ b/drivers/bus/dpaa/include/fsl_qman.h @@ -1157,6 +1157,12 @@ typedef enum qman_cb_dqrr_result (*qman_cb_dqrr)(struct qman_portal *qm, struct qman_fq *fq, const struct qm_dqrr_entry *dqrr); +typedef enum qman_cb_dqrr_result (*qman_dpdk_cb_dqrr)(void *event, + struct qman_portal *qm, + struct qman_fq *fq, + const struct qm_dqrr_entry *dqrr, + void **bd); + /* * This callback type is used when handling ERNs, FQRNs and FQRLs via MR. They * are always consumed after the callback returns. @@ -1215,6 +1221,7 @@ enum qman_fq_state { */ struct qman_fq_cb { + qman_dpdk_cb_dqrr dqrr_dpdk_cb; /* for dequeued frames */ qman_cb_dqrr dqrr; /* for dequeued frames */ qman_cb_mr ern; /* for s/w ERNs */ qman_cb_mr fqs; /* frame-queue state changes*/ @@ -1332,6 +1339,9 @@ int qman_get_portal_index(void); */ u16 qman_affine_channel(int cpu); +unsigned int qman_portal_poll_rx(unsigned int poll_limit, + void **bufs, struct qman_portal *q); + /** * qman_set_vdq - Issue a volatile dequeue command * @fq: Frame Queue on which the volatile dequeue command is issued diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index 212c75f..460cfbf 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -70,9 +70,11 @@ DPDK_18.02 { dpaa_svr_family; qman_alloc_cgrid_range; + qman_alloc_pool_range; qman_create_cgr; qman_delete_cgr; qman_modify_cgr; + qman_portal_poll_rx; qman_query_fq_frm_cnt; qman_release_cgrid_range; rte_dpaa_portal_fq_close; From patchwork Wed Dec 13 12:05:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 121756 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5386231qgn; Wed, 13 Dec 2017 04:10:27 -0800 (PST) X-Google-Smtp-Source: ACJfBotYM54Mtdld+hwhI2Ox9PEzulR1DS8luEmuFSMzchhoKtULeP6YrMZbB5fgGsN7Zq4EZlPK X-Received: by 10.28.96.195 with SMTP id u186mr1690328wmb.121.1513167027601; Wed, 13 Dec 2017 04:10:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513167027; cv=none; d=google.com; s=arc-20160816; b=GydCXqoV5GesPmb+aNspMf/hFgzPwMeQmHBUVKUfzR6lle+IM7aAeQbcnMcfeM42aF A/ANdADIIV+ZsnJEWTvHqkj1izHgohgO5KNLgIEpghfBff0d3mbBIwfBjhgh6XJPt3/N Jk3Yb7xLbacX/fc/nqa07SNKWNrQ+UvNY8FzFnwhCuaoTxTGEBUE822eSBG/APWlc/oC pBDNPySCc1o0UZAy1VyyuVmc+uMVB9PVntETo/0SvixG8mHARj3G3nhXcpnq1yXd8ngi 5Eak20icYYYg4tmbMjpf+A3DHJR7qDVU+Z+pOWRgtV9RRSe6ajoV2VrfLslhHkIAbajG +tqQ== 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:arc-authentication-results; bh=gz5BIzG9ynerqilhy1cUgqmFu4BomVvQySnqpcR7kvg=; b=C6ayUKt2dXG6jwpDadZOkqJz7pMmeUKxlupcUi+sAMHbp0oDG7cc4G7gxTRnnh06V0 su8kfHp5HgBLVQhHa4IyIMZO0UA093pXKaMIScZAvICJFOATab7G8e/f/Cn1nKuGNmJH h5qhsl+DXYGL3j2rQnM8K9aRNKpIc13lk8lwsn5zNiozaqzY2XfxlzqCsPaqYyAYuwaT STGvUCZ+V98gKJxnmQ13PaiT9/yvjW+GOBDgWXGRcSupCswdqEw66nAni3mFlyRp3tJ/ Yc7pR00DSQHTPNwS4WfMWRw3O+xm8CdHYFqOf93BxMahD0FM5fsutTVyRQ/zMOuD5KmP a8zg== ARC-Authentication-Results: i=1; mx.google.com; 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 k20si1344788wmh.272.2017.12.13.04.10.27; Wed, 13 Dec 2017 04:10:27 -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; 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 A8B0B1B212; Wed, 13 Dec 2017 13:07:34 +0100 (CET) Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0081.outbound.protection.outlook.com [104.47.33.81]) by dpdk.org (Postfix) with ESMTP id 53D811B1FE for ; Wed, 13 Dec 2017 13:07:30 +0100 (CET) Received: from BN6PR03CA0085.namprd03.prod.outlook.com (2603:10b6:405:6f::23) by SN2PR03MB2368.namprd03.prod.outlook.com (2603:10b6:804:e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 12:07:29 +0000 Received: from BL2FFO11OLC013.protection.gbl (2a01:111:f400:7c09::180) by BN6PR03CA0085.outlook.office365.com (2603:10b6:405:6f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Wed, 13 Dec 2017 12:07:29 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.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 BL2FFO11OLC013.mail.protection.outlook.com (10.173.160.161) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Wed, 13 Dec 2017 12:07:22 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vBDC6t9c008652; Wed, 13 Dec 2017 05:07:27 -0700 From: Hemant Agrawal To: CC: , Sunil Kumar Kori , Nipun Gupta Date: Wed, 13 Dec 2017 17:35:59 +0530 Message-ID: <1513166759-13466-19-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131576404423818116; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(376002)(39380400002)(346002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(498600001)(104016004)(53936002)(8656006)(105606002)(356003)(2351001)(68736007)(4326008)(305945005)(106466001)(2906002)(5660300001)(97736004)(77096006)(81156014)(81166006)(8676002)(6916009)(6666003)(2950100002)(50226002)(51416003)(36756003)(76176011)(16586007)(8936002)(575784001)(54906003)(86362001)(316002)(50466002)(47776003)(48376002)(85426001)(59450400001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2368; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC013; 1:jMep2y7pMkusuOlC3Qb0KkOvuoQaKOyz59XfjtxPmpHStQs+dec9DFLIv3OEEeM1nr7d8l6OUWb4bERZoc6RCXU0SMMQ3U7LwDbsCgS3PCN1NioXWnV7OG1/q6ms587m MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 66aa29a2-845d-40d6-3b84-08d5422210f8 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4628075)(201703131517081)(2017052603307); SRVR:SN2PR03MB2368; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2368; 3:TNL/P+IyosN/FUQWbnSeuU4JUZCGAHK9DwhCn7WNyVtGq1E4G3knxKhFjbhqdnMdnETcbW/LudX8UZpHoC2qw+RwfX1XLjZdVBAC7qRba1L9qdaWenGyborj0esh4X+uiEWlldWP6Hb8k5RmxFXW7fLy26vLIyQpt6Oy0Uppfwgs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q/wMcbsJ3Nv4kguOh0VUD8/PEl8RblblCy98ZyNJJOExLYxLfMbJ8BIE9qupytXNd/aRzj4hPpISuxtS5//XZ5oPPMpyH3DjbjtUGGkQHQ7G82lDtwqz5f8rRZcE/nwR0JwHS2IRRZSwR7twv+QRB/FaeQEP38KIL3z7nlJMS7c3GTOO/NwJahc X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(227817650892897)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(3231023)(10201501046)(6055026)(6096035)(20161123559100)(20161123565025)(20161123561025)(20161123556025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123563025)(201708071742011); SRVR:SN2PR03MB2368; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:SN2PR03MB2368; X-Forefront-PRVS: 052017CAF1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2368; 23:oURrUCzmG+hiD3yi8JEtVcyHMyZoB4Uz6ZxAlWXiP?= fSkOfjpEZzOez8zlVjEqDk8k7hMOm3hgHrE79JzBCrD7fugK4XLJGVjd/9nfq9j9u9uMXo994DZozNgaJnlMDdzMkDrPICa5bermEvavxmKmgBWIjjt6j7qzrmubaJ/UzFRkl3eGtZRFrXflwX7Md5hVwL3XLfrDj1sB+7JgpJWTV0QlCRQHgJt8usyi/S16zFJ7WdpjayrMUnPNliUGlxGXjwVoH/NWzVkHYFzXEyqU9L31TUVRv5Q+id2JfBqRWV3QElPLdYCcbppqLDWKzzqV7y4eWtWGVudpELbq+ANGZouYhftwN5WV3H6WqHitVWgJMOwk/kXqCK+nbIsaT5tLTa13NLA8xsa3DpsihLt7D7L64ZmcAdUlYxZhqYm6IKvsLt1q0bvyFya8Oo8KH7feiT72f9/jC0+4dovTGZ7A0iZTypdkCQjOyx1YqYZ1DTYyDFImhobmmjzzF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iX5i14zxwjuxqhWmklLg1LypqI4TJnoAmOW+n9cXLLxVJPLP8VRwKgvhO9smRJCvUS59AAM0iBfHRDbD638/E6Xi44wdQmAxRWxdjYHhsxROs=; 24:aRe46KnbJNdSbovoTbeSdE+wNXPeELNoMa5pAlsSmlwpXT8kq97Xgm/0ZWbxIdrHTqQnkDIjz2MOzQsDT4dBYgSbbXnbIAY8n/nSeWlRhRM=; 7:iXZPjacetEPO7vi64B8INTskbBXxfJW+QTfQUzFhLVVf0GM9OhPfexkPE+s3yq6sn/tByau0EDMJRxade9kF2eeVmg/8zIbjaPuB8wuQUK4tut5F2M9MNLBWDFoa5aiYTpN8rdwkth2moGB3+QRnSd44QTu6y+9DyvSmUFiYK902pskMcAvvP8QbqzgPDdw9rgUTBAEbAAuN4sFSMQRKoNkdctB8hNR1p4wYFJsqucXqzhEDB3+8sIPTRI44Wc1l SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 12:07:22.2102 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 66aa29a2-845d-40d6-3b84-08d5422210f8 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR03MB2368 Subject: [dpdk-dev] [PATCH 18/18] net/dpaa: integrate the support of push mode in PMD 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" Signed-off-by: Sunil Kumar Kori Signed-off-by: Hemant Agrawal Signed-off-by: Nipun Gupta --- doc/guides/nics/dpaa.rst | 11 ++++++++ drivers/net/dpaa/dpaa_ethdev.c | 62 ++++++++++++++++++++++++++++++++++++++---- drivers/net/dpaa/dpaa_ethdev.h | 2 +- drivers/net/dpaa/dpaa_rxtx.c | 34 +++++++++++++++++++++++ drivers/net/dpaa/dpaa_rxtx.h | 5 ++++ 5 files changed, 107 insertions(+), 7 deletions(-) -- 2.7.4 diff --git a/doc/guides/nics/dpaa.rst b/doc/guides/nics/dpaa.rst index d331c05..7b6a0b1 100644 --- a/doc/guides/nics/dpaa.rst +++ b/doc/guides/nics/dpaa.rst @@ -315,6 +315,17 @@ state during application initialization: In case the application is configured to use lesser number of queues than configured above, it might result in packet loss (because of distribution). +- ``DPAA_NUM_PUSH_QUEUES`` (default 4) + + This defines the number of High performance queues to be used for ethdev Rx. + These queues use one private HW portal per queue configured, so they are + limited in the system. The first configured ethdev queues will be + automatically be assigned from the these high perf PUSH queues. Any queue + configuration beyond that will be standard Rx queues. The application can + choose to change their number if HW portals are limited. + The valid values are from '0' to '4'. The valuse shall be set to '0' if the + application want to use eventdev with DPAA device. + Driver compilation and testing ------------------------------ diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index fcba929..7798994 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -73,6 +73,14 @@ /* Keep track of whether QMAN and BMAN have been globally initialized */ static int is_global_init; +/* At present we only allow up to 4 push mode queues - as each of this queue + * need dedicated portal and we are short of portals. + */ +#define DPAA_MAX_PUSH_MODE_QUEUE 4 + +static int dpaa_push_mode_max_queue = DPAA_MAX_PUSH_MODE_QUEUE; +static int dpaa_push_queue_idx; /* Queue index which are in push mode*/ + /* Per FQ Taildrop in frame count */ static unsigned int td_threshold = CGR_RX_PERFQ_THRESH; @@ -460,6 +468,9 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, { struct dpaa_if *dpaa_intf = dev->data->dev_private; struct qman_fq *rxq = &dpaa_intf->rx_queues[queue_idx]; + struct qm_mcc_initfq opts = {0}; + u32 flags = 0; + int ret; PMD_INIT_FUNC_TRACE(); @@ -495,7 +506,41 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, dpaa_intf->name, fd_offset, fman_if_get_fdoff(dpaa_intf->fif)); } - + /* checking if push mode only, no error check for now */ + if (dpaa_push_mode_max_queue > dpaa_push_queue_idx) { + dpaa_push_queue_idx++; + opts.we_mask = QM_INITFQ_WE_FQCTRL | QM_INITFQ_WE_CONTEXTA; + opts.fqd.fq_ctrl = QM_FQCTRL_AVOIDBLOCK | + QM_FQCTRL_CTXASTASHING | + QM_FQCTRL_PREFERINCACHE; + opts.fqd.context_a.stashing.exclusive = 0; + opts.fqd.context_a.stashing.data_cl = DPAA_IF_RX_DATA_STASH; + opts.fqd.context_a.stashing.context_cl = + DPAA_IF_RX_CONTEXT_STASH; + if (dpaa_svr_family != SVR_LS1046A_FAMILY) + opts.fqd.context_a.stashing.annotation_cl = + DPAA_IF_RX_ANNOTATION_STASH; + + /*Create a channel and associate given queue with the channel*/ + qman_alloc_pool_range((u32 *)&rxq->ch_id, 1, 1, 0); + opts.we_mask = opts.we_mask | QM_INITFQ_WE_DESTWQ; + opts.fqd.dest.channel = rxq->ch_id; + opts.fqd.dest.wq = DPAA_IF_RX_PRIORITY; + flags = QMAN_INITFQ_FLAG_SCHED; + + /* Configure tail drop */ + if (dpaa_intf->cgr_rx) { + opts.we_mask |= QM_INITFQ_WE_CGID; + opts.fqd.cgid = dpaa_intf->cgr_rx[queue_idx].cgrid; + opts.fqd.fq_ctrl |= QM_FQCTRL_CGE; + } + ret = qman_init_fq(rxq, flags, &opts); + if (ret) + DPAA_PMD_ERR("Channel/Queue association failed. fqid %d" + " ret: %d", rxq->fqid, ret); + rxq->cb.dqrr_dpdk_cb = dpaa_rx_cb; + rxq->is_static = true; + } dev->data->rx_queues[queue_idx] = rxq; /* configure the CGR size as per the desc size */ @@ -835,11 +880,8 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx, fqid, ret); return ret; } - - opts.we_mask = QM_INITFQ_WE_DESTWQ | QM_INITFQ_WE_FQCTRL | - QM_INITFQ_WE_CONTEXTA; - - opts.fqd.dest.wq = DPAA_IF_RX_PRIORITY; + fq->is_static = false; + opts.we_mask = QM_INITFQ_WE_FQCTRL | QM_INITFQ_WE_CONTEXTA; opts.fqd.fq_ctrl = QM_FQCTRL_AVOIDBLOCK | QM_FQCTRL_CTXASTASHING | QM_FQCTRL_PREFERINCACHE; opts.fqd.context_a.stashing.exclusive = 0; @@ -973,6 +1015,14 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) else num_rx_fqs = DPAA_DEFAULT_NUM_PCD_QUEUES; + /* Number of High perf push mode queues. */ + if (getenv("DPAA_NUM_PUSH_QUEUES")) { + dpaa_push_mode_max_queue = + atoi(getenv("DPAA_NUM_PUSH_QUEUES")); + if (dpaa_push_mode_max_queue > DPAA_MAX_PUSH_MODE_QUEUE) + dpaa_push_mode_max_queue = DPAA_MAX_PUSH_MODE_QUEUE; + } + /* Each device can not have more than DPAA_PCD_FQID_MULTIPLIER RX * queues. */ diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index 95d745e..c0a8430 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -80,7 +80,7 @@ #define DPAA_MAX_NUM_PCD_QUEUES 32 #define DPAA_IF_TX_PRIORITY 3 -#define DPAA_IF_RX_PRIORITY 4 +#define DPAA_IF_RX_PRIORITY 0 #define DPAA_IF_DEBUG_PRIORITY 7 #define DPAA_IF_RX_ANNOTATION_STASH 1 diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 2609953..088fbe1 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -420,6 +420,37 @@ dpaa_eth_fd_to_mbuf(const struct qm_fd *fd, uint32_t ifid) return mbuf; } +enum qman_cb_dqrr_result dpaa_rx_cb(void *event __always_unused, + struct qman_portal *qm __always_unused, + struct qman_fq *fq, + const struct qm_dqrr_entry *dqrr, + void **bufs) +{ + const struct qm_fd *fd = &dqrr->fd; + + *bufs = dpaa_eth_fd_to_mbuf(fd, + ((struct dpaa_if *)fq->dpaa_intf)->ifid); + return qman_cb_dqrr_consume; +} + +static uint16_t +dpaa_eth_queue_portal_rx(struct qman_fq *fq, + struct rte_mbuf **bufs, + uint16_t nb_bufs) +{ + int ret; + + if (unlikely(fq->qp == NULL)) { + ret = rte_dpaa_portal_fq_init((void *)0, fq); + if (ret) { + DPAA_PMD_ERR("Failure in affining portal %d", ret); + return 0; + } + } + + return qman_portal_poll_rx(nb_bufs, (void **)bufs, fq->qp); +} + uint16_t dpaa_eth_queue_rx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) @@ -429,6 +460,9 @@ uint16_t dpaa_eth_queue_rx(void *q, uint32_t num_rx = 0, ifid = ((struct dpaa_if *)fq->dpaa_intf)->ifid; int ret; + if (likely(fq->is_static)) + return dpaa_eth_queue_portal_rx(fq, bufs, nb_bufs); + ret = rte_dpaa_portal_init((void *)0); if (ret) { DPAA_PMD_ERR("Failure in affining portal"); diff --git a/drivers/net/dpaa/dpaa_rxtx.h b/drivers/net/dpaa/dpaa_rxtx.h index b434b6d..de65ebc 100644 --- a/drivers/net/dpaa/dpaa_rxtx.h +++ b/drivers/net/dpaa/dpaa_rxtx.h @@ -294,4 +294,9 @@ int dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf, struct qm_fd *fd, uint32_t bpid); +enum qman_cb_dqrr_result dpaa_rx_cb(void *event, + struct qman_portal *qm, + struct qman_fq *fq, + const struct qm_dqrr_entry *dqrr, + void **bd); #endif