From patchwork Fri Oct 12 10:04:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreyansh Jain X-Patchwork-Id: 148733 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp537861lji; Fri, 12 Oct 2018 03:05:54 -0700 (PDT) X-Google-Smtp-Source: ACcGV63ON07BEYyNsDtLxnQZ3Sx2e0QdF9kq7Bbn/jDQegf8YNdg9bgZmp/h0zpvznd4AX4wwWF4 X-Received: by 2002:a1c:9e93:: with SMTP id h141-v6mr4929319wme.56.1539338753981; Fri, 12 Oct 2018 03:05:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539338753; cv=none; d=google.com; s=arc-20160816; b=Gtaoxks94+rCBiaI+nH7hp1LWxqerxyoM9PQIiE68zDsvxdh8W+uY/XMBDmzYogvjZ vStpjbfy25kWde4afrehZoxn9zfUwqHMQmWk3uJG8/0us4cIBUEiWMCEwNeEGbkHRkNt hrbfCdGxEcFh9mkKKnldssX7VBn8pOH/2+mCSGWqlbQ6rwQ8ClhoY4YJwqa/Bymyel6Q PS02HAJR5Q2ikjXZgqCr/tg+GJUNFhDS3aBqgzol6QI7ICGloZVCcNKuHEhCHGbk3lzB 8Ygx6+iLr6lR0nEuW2KbALbFp1bUc4jAE4pPuAGi8nb/e82JtTPXQ1/VYnrnCIcXtAW7 zGcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:dkim-signature; bh=t7IuKBNiEzu1lfkOiLjpIRNyuf3igIa8JGtdweN+ikc=; b=y8VeM89orbsMnRkR8XTYEcjrf1GgGZZzmLJL4SbUaqkB8eXjqUDNvSjjVtgpi3kOkY frkXI1hMhdZW9d9/MgOb9ZiXEcQ8hWInhcxoHc2WMgCmlwGvqmmL93cytxm8nlFLkDuD 3xQEEJvpX4MjzHZ0G+2N/A0KKea7r9BPck7W5NBqNbzGikcJK2V5AkOyR5QKWSmWRc2X DS7+et5g93PSvRsZ2nvTDI0rkhBHrQeI34fBPVHzpgaAeZPuJGrS5ZRcKKdiHFyttxA9 QEzrj6PxcG5Dtmsz10ikhzESm1Onmx/FqWN4YtGAdopSjZ7W+adNLwLL45vKk62jUQO8 mq3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=dwszcfYn; 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 a12-v6si692270wri.399.2018.10.12.03.05.53; Fri, 12 Oct 2018 03:05:53 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=dwszcfYn; 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 89AF41B479; Fri, 12 Oct 2018 12:05:45 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0055.outbound.protection.outlook.com [104.47.0.55]) by dpdk.org (Postfix) with ESMTP id D0AA21B134; Fri, 12 Oct 2018 12:05:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=t7IuKBNiEzu1lfkOiLjpIRNyuf3igIa8JGtdweN+ikc=; b=dwszcfYnZA4rUuIcQ9+fAqiIeAdURN9b/Hlp/uQUPXkq2q0gPkYFs16OZswaalNuM0lF5YUV7wBV9eqnvAXrdvcDVTqNUnQ2dO8zanKcOzpy2Q+gMYkZaz8iWVezrNt3A2pXJmAfJgkKSWPWb5MoFUIDRTNZv+ojOfTBXSX+ja0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.25; Fri, 12 Oct 2018 10:05:40 +0000 From: Shreyansh Jain To: thomas@monjalon.net Cc: ferruh.yigit@intel.com, dev@dpdk.org, Nipun Gupta , stable@dpdk.org Date: Fri, 12 Oct 2018 15:34:12 +0530 Message-Id: <20181012100426.29349-2-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181012100426.29349-1-shreyansh.jain@nxp.com> References: <20180926180440.31726-1-shreyansh.jain@nxp.com> <20181012100426.29349-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BMXPR01CA0004.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::14) To AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 07f8a592-8eb8-410c-3f8a-08d6302a44aa X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB4676; X-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S2ovEa4N3qXKiQAi/U3rJkdnB+DO1402aj1w0Vjk8xjN6Y2FWNlS+QBQZED03pzaLQsrDADJZKAZG5Fj3PVR+Wniaoowvzp8QSF8ULAZk/Ph+dM//2eMLzLLz4YnZojVsn5O72bGkG8QTQ71ut7DZnkBo1hDz7NPGgZCr6owusT4bu2F4wFVKFmGeGD4xlj/KwnmWcJuE5nNa/ODUVm8eWPTBtyTeH+7gtjP3AmSlU6eoqtjJenaT8A246IJc6TpHa0WwfeovZz1yGnOpe5YOMUdH56q9RvlrU9+LTKfQvIJBrMOMdeZwg7L8TV5F6XhZcZJbKIamUXEmpu7qI2vx0zpjLimHlBRoGBe2MdpAG6naIdHqlDHHPvOdQS+xd695i1W; 4:mTuCcE+S5MPUbx83EU3J7lEKT9eerRAhVb3CrcSOqL+/kHcVJADCEmFVc/Ud2gevdA58kHk9WMtOIMS2ynzBt7gYKm+qslkSIUeR8JxEzOkjs+Nu1l9+0IHW80rxPaugUts0neRDGYcXzJ0sQudjzceCmcoVo05Yit1l26TeAJiZMg8HzEiyc/iN2vEU5P1dMmOcuJS9e+KhrR19tWEjjejfSi4U7sFUoFlXUNlG0uHZhtaP2WDvt9h0o2VcrJ2jOCEGdO2wbUhOu8654lxv0JvuV+yW0NIz9t5JmIJxo2RrMJ7ITr35R/7jn/Bze4Hp X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:AM0PR04MB4676; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4676; X-Forefront-PRVS: 0823A5777B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(346002)(366004)(136003)(39860400002)(199004)(189003)(2906002)(52116002)(16526019)(14444005)(53936002)(8676002)(478600001)(186003)(386003)(446003)(105586002)(7736002)(106356001)(6512007)(6116002)(86362001)(3846002)(81156014)(50226002)(68736007)(1076002)(47776003)(5660300001)(6506007)(8936002)(78486009)(36756003)(316002)(26005)(66066001)(6666004)(25786009)(55236004)(81166006)(11346002)(48376002)(76176011)(44832011)(2361001)(956004)(51416003)(2616005)(97736004)(1006002)(50466002)(486006)(476003)(305945005)(16586007)(6916009)(4326008)(6486002)(2351001)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4676; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR04MB4676; 23:FlkRiu0eEkdrmKm7a6kRQKuwM/mF0hgCh4gwmR8vQ?= ztjh8QV/zKeCd7R0OOy6zQSa7FlBNWen59vveWI2wG9yOV7cBYgHbpnN/v9n5Sv0xCse4HKL1T2cZTrM2bqnjzzBSI7MyUlvtE8tmnJqNMbYapx3BUob77Z2pYx0p1P6xuBvN3Pxmby9EEG0KFzGLnKGoyZRXMu9BpZj+1WoV4eLe5H3Yvne6pjlAFPdyOJ0PcS3Dd9ulBz89Bi9wXJbhn79BZkNm5NYzyzQiJ2GtHCmjHNQj1+ss6Qd3xil74zqZ3gLTwWn5xfSByuFColjhVX79uuhs0gD6g7lp7wrlbP4WpTXHtWUP+KdCTSCkU4gsUE9mSToT7L+6WrssKlzn7NTB8ngleow8VvCYOCUK4WqJM5jY5TqLRXN4RNkBu0S6b7wRwSUVv6+Im1TQsp3zgzOxqC5OZNefyylxV4x7D7u3MGX777GfJ01FTmjzvWJjidIUU4WWypI1rlm2A6fJx1RxBn6mkooOX07E9+w5MKEZsE/OHTAYHI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VDUVYw4ei3eT SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2018 10:05:40.6813 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 07f8a592-8eb8-410c-3f8a-08d6302a44aa X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4676 Subject: [dpdk-dev] [PATCH v3 01/15] net/dpaa2: fix IOVA conversion for congestion memory 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 code was incorrectly using the Virtual mode, whent the IOVA mode was set as Physical. Fixes: 5ae1edff6895 ("dpaa2: prepare for 32-bit build") Cc: stable@dpdk.org Signed-off-by: Nipun Gupta --- drivers/net/dpaa2/dpaa2_ethdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 880034fcf..9ae326023 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -568,7 +568,8 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev, */ cong_notif_cfg.threshold_exit = CONG_EXIT_TX_THRESHOLD; cong_notif_cfg.message_ctx = 0; - cong_notif_cfg.message_iova = (size_t)dpaa2_q->cscn; + cong_notif_cfg.message_iova = + (size_t)DPAA2_VADDR_TO_IOVA(dpaa2_q->cscn); cong_notif_cfg.dest_cfg.dest_type = DPNI_DEST_NONE; cong_notif_cfg.notification_mode = DPNI_CONG_OPT_WRITE_MEM_ON_ENTER | From patchwork Fri Oct 12 10:04:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreyansh Jain X-Patchwork-Id: 148734 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp538007lji; Fri, 12 Oct 2018 03:06:02 -0700 (PDT) X-Google-Smtp-Source: ACcGV63emaNSxYBmW20/knB6nnOxvb7epCe3B7DjrQwiL5GmOAYkFLu+rL5PV+cB0vdOU1vYDDcj X-Received: by 2002:a1c:540d:: with SMTP id i13-v6mr4800699wmb.149.1539338762769; Fri, 12 Oct 2018 03:06:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539338762; cv=none; d=google.com; s=arc-20160816; b=Sz/gcFvBELLDIXV5ZFVAnER/mPHgyShvTtlE/igeyxantxqfowVL4IUoSywsLXdeSK RtwCEnwo1jqsA7bterbg0G0UW7nmWLd5xR2PSf77OlxBWGxQzJnc0fVoJgEJG3JuqT1Y WMfRnSS/FVHrV4JbJlLzsv9BRSZSAz5NinV11ODbWUFA/iO7Rg+PtVLxwC+npyqJOENa vJntHTL/oQcUTmW5ToIiNC+g5Dy+F+K31TeRVaxOYYE2rn4TL+7nwGil4FXa51VH6NKc tJbX0BfL9hWFZjmmEGaTNjyho1jByIh91ocTsIlkHjv7bS4ElDDRayQqL1oGXa013L10 tyjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:dkim-signature; bh=9QgRpA2SAJ+0jmc2ZigcXa4UUp243AuUa6L+ZRZ8YTo=; b=MsyuDhtOqcRJI726VhLXYvg7RF7oNQ1Ev1vCDgXeO7CqT14KGXcA/DR+hSr2JLtF1R KWDnY6saZ8aY+q8m6eahT6Ni3JmBJys0EZY25QaRZ9fV4sc2Mrz0qM35nh36l3sXWuiJ KL2JPG4+hY4NA0pSvcY40EL/cGBqqLdr5KsvyLLik50c1ignT+nzFkB+u30Ice737NmS S3zDbe6ASbGb9V5MsKG2XYYHukdl4X51KBGuq0xz3+7tDs04eHLmBNKx2BprHXxUsJQQ M/TBEX5OK0gU7sJ+QozMFsGc75gSBk953UptCZzZcZjWI93FnkoDPLr7UWc8U5Tk7MqS xa2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=c1tFnPFI; 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 b13-v6si835935wmg.68.2018.10.12.03.06.02; Fri, 12 Oct 2018 03:06:02 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=c1tFnPFI; 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 7B3F11B19E; Fri, 12 Oct 2018 12:05:48 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00041.outbound.protection.outlook.com [40.107.0.41]) by dpdk.org (Postfix) with ESMTP id 7C40B1B452; Fri, 12 Oct 2018 12:05:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9QgRpA2SAJ+0jmc2ZigcXa4UUp243AuUa6L+ZRZ8YTo=; b=c1tFnPFIx1OA60gO7dz3Bjz0Nvsnl3RtAyybsopVlCOE2F4wxK5uH+dRd94EmDRm701WYRxCZ1qPsHfDPOStScbxCkSHjF8hYERnZ24ZHq/eIQHNAKOJcG0PvZ2Hb8/f94hU4SeTYShkSI0JRnw5IP6QtmrKDFtuuABDeBkaPlM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.25; Fri, 12 Oct 2018 10:05:42 +0000 From: Shreyansh Jain To: thomas@monjalon.net Cc: ferruh.yigit@intel.com, dev@dpdk.org, Hemant Agrawal , stable@dpdk.org Date: Fri, 12 Oct 2018 15:34:13 +0530 Message-Id: <20181012100426.29349-3-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181012100426.29349-1-shreyansh.jain@nxp.com> References: <20180926180440.31726-1-shreyansh.jain@nxp.com> <20181012100426.29349-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BMXPR01CA0004.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::14) To AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 92a38e82-1739-4a2b-91f5-08d6302a45a7 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB4676; X-Microsoft-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nPWxcy12NlhsmXpXYck2SdNCouvBFeB2+rynSVfzBPCSJzZdaOHrOWeYIGgojXNgy3W/k/aNjoY2tZ/EvzrISnkl6yCMaypmo/D0vh+IRlF29wfJrpnvfdn2aXYjYf/j7fD+w+hNCc3x/FBL48L7YBudTndvNpBYX0z4nVIkYHJ/ApNm2opfy/D1KaXCoRIVvGBOIr2eH6kbOwoHXcTgY1vq3LqBobD0Vidn7RCFDBH2omtk1Jp3qvGyLNVO3ML3h2ccdIWjEqbELXIyzSgTv5utap6inJTKz+yxQRxaXAJal2SvOHc8V8kzda2Tqpd1BD1mRsbVb20NRWmofnTiXjX+efQK+vf2EEXPSFbc6PLaPkN8R4d9V0y7UUtfHBH+dEkqY75R9qf/; 4:D/Z2xAxn7JBfSgY/RvmInEVhbXUESD5Q1iKNsJ74VKy9okGxOihIkvaXNf7EbzJIy4JQ8XtnSVAV9YUju9GSPzUwLSAtkNit07EjO/RMPcBcPA3G3lR5Lt+pV5cbdv8jzqOVMw+JVGJklcEKFPEcDDmBpzXm66K3Vx1yYy9FtYFEdYzJmGjX6qo+6UubOYCGvzizsDx7PqwZsrroiWccnNFQukpskqLvjUA4raRUoWFCfcGx9KeYrsOQZFYde1HXlSaEFR011f9BIAUd+wERRqwB5MEFQVGdVCugVwZIFnoxQgy89N8ah7cxxC1w+k53 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:AM0PR04MB4676; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4676; X-Forefront-PRVS: 0823A5777B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(346002)(366004)(136003)(39860400002)(199004)(189003)(45074003)(2906002)(52116002)(16526019)(14444005)(53936002)(8676002)(478600001)(186003)(386003)(446003)(105586002)(7736002)(106356001)(6512007)(6116002)(86362001)(3846002)(81156014)(50226002)(68736007)(1076002)(47776003)(5660300001)(6506007)(8936002)(78486009)(36756003)(316002)(26005)(66066001)(6666004)(25786009)(55236004)(81166006)(11346002)(48376002)(76176011)(44832011)(2361001)(956004)(51416003)(2616005)(97736004)(1006002)(50466002)(486006)(476003)(305945005)(16586007)(6916009)(4326008)(6486002)(2351001)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4676; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR04MB4676; 23:Rw80Ki7cTctaf/9nTClUSVT5VW6RAyxrFJoCh/Fle?= wAxk+yMJO70IzpsOUXS3J88Whr/IihuPyLTv7b3y8D3gjfhK04iRppecJBEWsSidNtW4ovpbUjNJs0+JcW7oaANBubdbh/CfhcMx6X2ZeDG+8LsloG2xalzrFCOvlY+ThAHqYuPoNU2XRE3EPfHiAbBC9UcSAthuTokwzc23IwQOEB8jtAGM+8mi5EY3tuI/3pcc6p2M5ReFPZ4bD9A0GYcreVahDl2pTSI1Bw9qst2rfokKwirpiOocm47yzzKV+mhNwZ8Q3CS0Op1PG7YyKWrG+YmhgoZz7DUThjHHmXBKPjKW74Zr5pRa6CUqNjDVfOvjsCKgZ98CDaN1yLk38wjSqI2jKvd2NTSsSjFGMif/JeHksJtuH806KcBJCNrPAddUwzGo2uGF83hpyPkqWU1Q1q2HFcFwovPdH2idYSKAQx42UwoZ8behAyq97bTPnS2XyUxP6OfUGz7EGCMU+NeINGGaweM8u6o2kP1V5h6BDVV8P9DI6zOsFm7UGv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/XHVruPdVjJ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2018 10:05:42.3395 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 92a38e82-1739-4a2b-91f5-08d6302a45a7 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4676 Subject: [dpdk-dev] [PATCH v3 02/15] net/dpaa2: fix VLAN filter enablement 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: Hemant Agrawal Enable the VLAN filters only when requested in rx offload. Fixes: 0ebce6129bc6 ("net/dpaa2: support new ethdev offload APIs") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_ethdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 9ae326023..bfe78c051 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -405,7 +405,8 @@ dpaa2_eth_dev_configure(struct rte_eth_dev *dev) } } - dpaa2_vlan_offload_set(dev, ETH_VLAN_FILTER_MASK); + if (rx_offloads & DEV_RX_OFFLOAD_VLAN_FILTER) + dpaa2_vlan_offload_set(dev, ETH_VLAN_FILTER_MASK); /* update the current status */ dpaa2_dev_link_update(dev, 0); From patchwork Fri Oct 12 10:04:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreyansh Jain X-Patchwork-Id: 148735 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp538159lji; Fri, 12 Oct 2018 03:06:11 -0700 (PDT) X-Google-Smtp-Source: ACcGV61DYuFjyVcLLj4sVQiIoCo+L5l22K9ibxKPiUXaWWi3D6GFDXkbeGcwXjgorWiDUR+Vgo+m X-Received: by 2002:adf:fb4b:: with SMTP id c11-v6mr4519662wrs.117.1539338771154; Fri, 12 Oct 2018 03:06:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539338771; cv=none; d=google.com; s=arc-20160816; b=tdzNBzhvPLUitSfPlAFwLAVZ4lwXvQue+59QB8wD3y2jxOocOvU/alP3cC+m17pabd mHeYkeimymtBELcNEVierrg7hFETGiyIP8L56h4XFR8HZ76AzC+G4dxsKmTGcFq7bDXT fQsHWqVjuYH2guJAhSsg6eme1rtXzF8y9VbiKGgJdS1vqRq8as5eXH7x19Ykov1zmWrH T30eiAr3uUlTlWSmAlzI4BKpBzOPql8zwzuX6i4kJBmZBdB/GJmVKK1TTzq0+pjfi2rW 7kxNI8W8n6yM1BStthPtvoEXjqdG4JdPxoQba7c/YvbXapxcjm1Gm8ACvpTjJiod5WJX mXcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:dkim-signature; bh=p+dxcqbm9ptWYCNxaXsKol4nKdfOPwDiMGjUBiD/SOw=; b=C7tZiUJlpF/Gd8O1u5G3OTxOHWNxRHDyYxS3zTNiviS2KQj02lD2IrIrOlb5OejkvE 0v/Gnah/1C48LKdSmGiYIQVm1RWN2pnzn+PE+bms6R1tW7+JCsr5tvoTzwNmaXLhxmPX 5Vg7Aq/hlzljmfyRtT/YjbvVO47BrnivLc6pKCEyxTFOCxhmcGTJ6jtoOB3Y7Xf0D3QY nT9dRxgBgIp88lc93GTglZVQmTv0K2Z7u4mkvsPRE6B7+/vH6PfaNxATT1uOtD12g+Q8 AoWFdy807aTlh3li8T1tKVIRjG5Y6VrrLxgRSf8oMrup3wfjRPT4j/0P86bODeZC+m1y ejlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=Hl7G5+eY; 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 m63-v6si891468wmh.6.2018.10.12.03.06.10; Fri, 12 Oct 2018 03:06:11 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=Hl7G5+eY; 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 D5EA41B48D; Fri, 12 Oct 2018 12:05:50 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00055.outbound.protection.outlook.com [40.107.0.55]) by dpdk.org (Postfix) with ESMTP id 91CB01B47E for ; Fri, 12 Oct 2018 12:05:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=p+dxcqbm9ptWYCNxaXsKol4nKdfOPwDiMGjUBiD/SOw=; b=Hl7G5+eYt3QsArN99DBLX9eR96qCvIocV43yz8ykyQ8Ie5PAXbz+XdZXrklyezBSWSvo9DeZ4YiD7PtkMQ8sE/JPXpCXOlf4NkOeFfD49QJ/KgIBcQR/n35dc+2NU1zxmhHQIdqdGrkTb+5UUIq/xEQkUtDRwQJQnu2Q0svElBQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.25; Fri, 12 Oct 2018 10:05:44 +0000 From: Shreyansh Jain To: thomas@monjalon.net Cc: ferruh.yigit@intel.com, dev@dpdk.org, Hemant Agrawal Date: Fri, 12 Oct 2018 15:34:14 +0530 Message-Id: <20181012100426.29349-4-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181012100426.29349-1-shreyansh.jain@nxp.com> References: <20180926180440.31726-1-shreyansh.jain@nxp.com> <20181012100426.29349-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BMXPR01CA0004.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::14) To AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 93807e98-95a1-4f69-00df-08d6302a468c X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB4676; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4676; 3:qjb4xo5rXYtxsH1+2dquL+bMbRy9Z7zWPFasWPH/A8WdoncmN+pU2JH0avzTXQ8LaVUgGioi5csiS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sUm3iNshhvQt4tweORNDploBzEB15nzkhvu2YCyWW0p6ybFtbuICtsD2eWHnn8QbCkmCCr1lYrSfMlu66RAziJoqVuNYbjud7BC0Sx5aOBjqIgyIw4un6i+AmG2vodVxw1FJXDxGcCan3oRUqwy+UXyu6OS4amXUynOdmLLuIYtAHKs+mnbIQzzjDUkwDMe1etGDk3VxbKJF+hxFD0FtWz/CGbvlL/VEwWaJfqrUeCbSSV+6SG7M5jETNAViWUAxabTt3; 4:lN5rY/fDsdc+L6I1usXqoCmTZey9M54GU4b538En9MQCP+QW1wY/CSYmyGD3vyzr0MPlsAUvFAuApMFuEp9XQ4W99eK+VeK/WCPj8HkY1CUgzubtSwDzXVinWipGS2v7yEydVPiNuxdnfwZ7xclikaNZ6PtC6LoAU7sLe5dmwWeaJfnza0I7Quhqs8hJfWuyYPjRXNGQ3fcV3AnEPSonrwPBQW/1iYFWKrXy45HJSqmRo/7j6DdTzc56JfT2nXT1eGoBKWlA7DOTr3Knw5313i1cPHvRbS6Bhk2WbeRByUNku464/KpxehLt/wD1LTxS0XDf8hTwssZZzDCYcCQI81gaU7ftB0ETcXMXkLTzPfA= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:AM0PR04MB4676; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4676; X-Forefront-PRVS: 0823A5777B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(346002)(366004)(136003)(39860400002)(199004)(189003)(2906002)(52116002)(16526019)(14444005)(53936002)(8676002)(478600001)(186003)(386003)(446003)(105586002)(7736002)(106356001)(6512007)(6116002)(86362001)(3846002)(575784001)(81156014)(50226002)(68736007)(1076002)(47776003)(5660300001)(6506007)(8936002)(78486009)(36756003)(316002)(26005)(66066001)(53946003)(6666004)(25786009)(55236004)(81166006)(11346002)(48376002)(76176011)(44832011)(2361001)(956004)(51416003)(2616005)(97736004)(1006002)(50466002)(4744004)(486006)(476003)(305945005)(16586007)(6916009)(4326008)(6486002)(2351001)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4676; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR04MB4676; 23:ir4Gubqkk5+TzqOZm4yirT8lHlFFQU8TciSzgh/9G?= V5oSmBfcle6+6FZbMqn1qnkpEfRWZDYoUqhnF7XsBNSJzyzZg8UI9OfmzSDX5zQHsVmpZwWAB0qpWgGoSlhUefmi/burLHMsLifucV29Vq0AeTSasZainSPtGbBgq+ymY+OrE7brFWmMFf+hRAjGv13Xuw9eNG11QhYCJkdOFzKWjXelLZ5VImkpK7ja1Y6ohOcLPeNrTIVwnC5CaKz7SIhUoW3zScWwpaUb/7Ygqmo/T0d7jvs2rGs9SWbZdyCr1wRB5nXQ6mjVf4jGyf6aaJ75JZjtGswKt9ATAY2FJIZ1JlH07fbYrCf0WMjxZNsrn7ZLPGvbv8Mw3+EPr6De8fKVVNYf92ENtxhYAG8hAEes48KYrPUEpqdU0AUFBw7yiLqlnWYrFz6B4lYLqF6YP5vVmzLgSKOzYP6PhLAB2KCGpC8I/qVTAE4c1rMiCORomWJVrRHRZ4l/w4EDzJ/ZviqzY/9f/ottHvbQSYnVXaee/F3vrtVDwWMQETut+Z3dl78i1Apo5iWBzInybz6/lkeHWbmPQZMbGanxxuqzUjpZNcgpGejsSN5K9c4dAVf7y39t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iagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2018 10:05:44.0006 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 93807e98-95a1-4f69-00df-08d6302a468c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4676 Subject: [dpdk-dev] [PATCH v3 03/15] bus/fslmc: upgrade mc FW APIs to 10.10.0 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: Hemant Agrawal This patch add the support for new Management Complex Firmware version to 10.1x.x. One of the main changes in the APIs ordered queue. The fslmc bus lib ABI will need to be bumped to reflect the MC FW API and structure changes. This will also result in bumping of ABI verion of all dependent libs as they internally use the MC FW APIs and structures. Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/mc/dpbp.c | 10 + drivers/bus/fslmc/mc/dpci.c | 197 ++++++++++++++++++++ drivers/bus/fslmc/mc/dpcon.c | 30 +++ drivers/bus/fslmc/mc/dpdmai.c | 14 ++ drivers/bus/fslmc/mc/dpio.c | 9 + drivers/bus/fslmc/mc/fsl_dpbp.h | 1 + drivers/bus/fslmc/mc/fsl_dpbp_cmd.h | 16 +- drivers/bus/fslmc/mc/fsl_dpci.h | 47 ++++- drivers/bus/fslmc/mc/fsl_dpci_cmd.h | 62 +++++- drivers/bus/fslmc/mc/fsl_dpcon.h | 19 ++ drivers/bus/fslmc/mc/fsl_dpdmai.h | 5 + drivers/bus/fslmc/mc/fsl_dpdmai_cmd.h | 20 +- drivers/bus/fslmc/mc/fsl_dpmng.h | 2 +- drivers/bus/fslmc/mc/fsl_dpopr.h | 85 +++++++++ drivers/bus/fslmc/rte_bus_fslmc_version.map | 10 + drivers/crypto/dpaa2_sec/Makefile | 2 +- drivers/crypto/dpaa2_sec/meson.build | 2 + drivers/event/dpaa2/Makefile | 2 +- drivers/event/dpaa2/meson.build | 2 + drivers/mempool/dpaa2/Makefile | 2 +- drivers/mempool/dpaa2/meson.build | 2 + drivers/net/dpaa2/Makefile | 2 +- drivers/net/dpaa2/meson.build | 2 + drivers/raw/dpaa2_cmdif/Makefile | 2 +- drivers/raw/dpaa2_cmdif/meson.build | 2 + drivers/raw/dpaa2_qdma/Makefile | 2 +- drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 14 +- drivers/raw/dpaa2_qdma/dpaa2_qdma.h | 6 +- drivers/raw/dpaa2_qdma/meson.build | 2 + 29 files changed, 538 insertions(+), 33 deletions(-) create mode 100644 drivers/bus/fslmc/mc/fsl_dpopr.h -- 2.17.1 diff --git a/drivers/bus/fslmc/mc/dpbp.c b/drivers/bus/fslmc/mc/dpbp.c index 0215d22da..d9103409c 100644 --- a/drivers/bus/fslmc/mc/dpbp.c +++ b/drivers/bus/fslmc/mc/dpbp.c @@ -248,6 +248,16 @@ int dpbp_reset(struct fsl_mc_io *mc_io, /* send command to mc*/ return mc_send_command(mc_io, &cmd); } +/** + * dpbp_get_attributes - Retrieve DPBP attributes. + * + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPBP object + * @attr: Returned object's attributes + * + * Return: '0' on Success; Error code otherwise. + */ int dpbp_get_attributes(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, diff --git a/drivers/bus/fslmc/mc/dpci.c b/drivers/bus/fslmc/mc/dpci.c index ff366bfa9..95edae9d9 100644 --- a/drivers/bus/fslmc/mc/dpci.c +++ b/drivers/bus/fslmc/mc/dpci.c @@ -265,6 +265,15 @@ int dpci_reset(struct fsl_mc_io *mc_io, return mc_send_command(mc_io, &cmd); } +/** + * dpci_get_attributes() - Retrieve DPCI attributes. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPCI object + * @attr: Returned object's attributes + * + * Return: '0' on Success; Error code otherwise. + */ int dpci_get_attributes(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, @@ -292,6 +301,94 @@ int dpci_get_attributes(struct fsl_mc_io *mc_io, return 0; } +/** + * dpci_get_peer_attributes() - Retrieve peer DPCI attributes. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPCI object + * @attr: Returned peer attributes + * + * Return: '0' on Success; Error code otherwise. + */ +int dpci_get_peer_attributes(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + struct dpci_peer_attr *attr) +{ + struct dpci_rsp_get_peer_attr *rsp_params; + struct mc_command cmd = { 0 }; + int err; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPCI_CMDID_GET_PEER_ATTR, + cmd_flags, + token); + + /* send command to mc*/ + err = mc_send_command(mc_io, &cmd); + if (err) + return err; + + /* retrieve response parameters */ + rsp_params = (struct dpci_rsp_get_peer_attr *)cmd.params; + attr->peer_id = le32_to_cpu(rsp_params->id); + attr->num_of_priorities = rsp_params->num_of_priorities; + + return 0; +} + +/** + * dpci_get_link_state() - Retrieve the DPCI link state. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPCI object + * @up: Returned link state; returns '1' if link is up, '0' otherwise + * + * DPCI can be connected to another DPCI, together they + * create a 'link'. In order to use the DPCI Tx and Rx queues, + * both objects must be enabled. + * + * Return: '0' on Success; Error code otherwise. + */ +int dpci_get_link_state(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + int *up) +{ + struct dpci_rsp_get_link_state *rsp_params; + struct mc_command cmd = { 0 }; + int err; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPCI_CMDID_GET_LINK_STATE, + cmd_flags, + token); + + /* send command to mc*/ + err = mc_send_command(mc_io, &cmd); + if (err) + return err; + + /* retrieve response parameters */ + rsp_params = (struct dpci_rsp_get_link_state *)cmd.params; + *up = dpci_get_field(rsp_params->up, UP); + + return 0; +} + +/** + * dpci_set_rx_queue() - Set Rx queue configuration + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPCI object + * @priority: Select the queue relative to number of + * priorities configured at DPCI creation; use + * DPCI_ALL_QUEUES to configure all Rx queues + * identically. + * @cfg: Rx queue configuration + * + * Return: '0' on Success; Error code otherwise. + */ int dpci_set_rx_queue(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, @@ -314,6 +411,9 @@ int dpci_set_rx_queue(struct fsl_mc_io *mc_io, dpci_set_field(cmd_params->dest_type, DEST_TYPE, cfg->dest_cfg.dest_type); + dpci_set_field(cmd_params->dest_type, + ORDER_PRESERVATION, + cfg->order_preservation_en); /* send command to mc*/ return mc_send_command(mc_io, &cmd); @@ -438,3 +538,100 @@ int dpci_get_api_version(struct fsl_mc_io *mc_io, return 0; } + +/** + * dpci_set_opr() - Set Order Restoration configuration. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPCI object + * @index: The queue index + * @options: Configuration mode options + * can be OPR_OPT_CREATE or OPR_OPT_RETIRE + * @cfg: Configuration options for the OPR + * + * Return: '0' on Success; Error code otherwise. + */ +int dpci_set_opr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t index, + uint8_t options, + struct opr_cfg *cfg) +{ + struct dpci_cmd_set_opr *cmd_params; + struct mc_command cmd = { 0 }; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPCI_CMDID_SET_OPR, + cmd_flags, + token); + cmd_params = (struct dpci_cmd_set_opr *)cmd.params; + cmd_params->index = index; + cmd_params->options = options; + cmd_params->oloe = cfg->oloe; + cmd_params->oeane = cfg->oeane; + cmd_params->olws = cfg->olws; + cmd_params->oa = cfg->oa; + cmd_params->oprrws = cfg->oprrws; + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +/** + * dpci_get_opr() - Retrieve Order Restoration config and query. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPCI object + * @index: The queue index + * @cfg: Returned OPR configuration + * @qry: Returned OPR query + * + * Return: '0' on Success; Error code otherwise. + */ +int dpci_get_opr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t index, + struct opr_cfg *cfg, + struct opr_qry *qry) +{ + struct dpci_rsp_get_opr *rsp_params; + struct dpci_cmd_get_opr *cmd_params; + struct mc_command cmd = { 0 }; + int err; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPCI_CMDID_GET_OPR, + cmd_flags, + token); + cmd_params = (struct dpci_cmd_get_opr *)cmd.params; + cmd_params->index = index; + + /* send command to mc*/ + err = mc_send_command(mc_io, &cmd); + if (err) + return err; + + /* retrieve response parameters */ + rsp_params = (struct dpci_rsp_get_opr *)cmd.params; + cfg->oloe = rsp_params->oloe; + cfg->oeane = rsp_params->oeane; + cfg->olws = rsp_params->olws; + cfg->oa = rsp_params->oa; + cfg->oprrws = rsp_params->oprrws; + qry->rip = dpci_get_field(rsp_params->flags, RIP); + qry->enable = dpci_get_field(rsp_params->flags, OPR_ENABLE); + qry->nesn = le16_to_cpu(rsp_params->nesn); + qry->ndsn = le16_to_cpu(rsp_params->ndsn); + qry->ea_tseq = le16_to_cpu(rsp_params->ea_tseq); + qry->tseq_nlis = dpci_get_field(rsp_params->tseq_nlis, TSEQ_NLIS); + qry->ea_hseq = le16_to_cpu(rsp_params->ea_hseq); + qry->hseq_nlis = dpci_get_field(rsp_params->hseq_nlis, HSEQ_NLIS); + qry->ea_hptr = le16_to_cpu(rsp_params->ea_hptr); + qry->ea_tptr = le16_to_cpu(rsp_params->ea_tptr); + qry->opr_vid = le16_to_cpu(rsp_params->opr_vid); + qry->opr_id = le16_to_cpu(rsp_params->opr_id); + + return 0; +} diff --git a/drivers/bus/fslmc/mc/dpcon.c b/drivers/bus/fslmc/mc/dpcon.c index 3f6e04b97..92bd26512 100644 --- a/drivers/bus/fslmc/mc/dpcon.c +++ b/drivers/bus/fslmc/mc/dpcon.c @@ -295,6 +295,36 @@ int dpcon_get_attributes(struct fsl_mc_io *mc_io, return 0; } +/** + * dpcon_set_notification() - Set DPCON notification destination + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPCON object + * @cfg: Notification parameters + * + * Return: '0' on Success; Error code otherwise + */ +int dpcon_set_notification(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + struct dpcon_notification_cfg *cfg) +{ + struct dpcon_cmd_set_notification *dpcon_cmd; + struct mc_command cmd = { 0 }; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPCON_CMDID_SET_NOTIFICATION, + cmd_flags, + token); + dpcon_cmd = (struct dpcon_cmd_set_notification *)cmd.params; + dpcon_cmd->dpio_id = cpu_to_le32(cfg->dpio_id); + dpcon_cmd->priority = cfg->priority; + dpcon_cmd->user_ctx = cpu_to_le64(cfg->user_ctx); + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + /** * dpcon_get_api_version - Get Data Path Concentrator API version * @mc_io: Pointer to MC portal's DPCON object diff --git a/drivers/bus/fslmc/mc/dpdmai.c b/drivers/bus/fslmc/mc/dpdmai.c index 528889df3..dcb9d516a 100644 --- a/drivers/bus/fslmc/mc/dpdmai.c +++ b/drivers/bus/fslmc/mc/dpdmai.c @@ -113,6 +113,7 @@ int dpdmai_create(struct fsl_mc_io *mc_io, cmd_flags, dprc_token); cmd_params = (struct dpdmai_cmd_create *)cmd.params; + cmd_params->num_queues = cfg->num_queues; cmd_params->priorities[0] = cfg->priorities[0]; cmd_params->priorities[1] = cfg->priorities[1]; @@ -297,6 +298,7 @@ int dpdmai_get_attributes(struct fsl_mc_io *mc_io, rsp_params = (struct dpdmai_rsp_get_attr *)cmd.params; attr->id = le32_to_cpu(rsp_params->id); attr->num_of_priorities = rsp_params->num_of_priorities; + attr->num_of_queues = rsp_params->num_of_queues; return 0; } @@ -306,6 +308,8 @@ int dpdmai_get_attributes(struct fsl_mc_io *mc_io, * @mc_io: Pointer to MC portal's I/O object * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPDMAI object + * @queue_idx: Rx queue index. Accepted values are form 0 to num_queues + * parameter provided in dpdmai_create * @priority: Select the queue relative to number of * priorities configured at DPDMAI creation; use * DPDMAI_ALL_QUEUES to configure all Rx queues @@ -317,6 +321,7 @@ int dpdmai_get_attributes(struct fsl_mc_io *mc_io, int dpdmai_set_rx_queue(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, + uint8_t queue_idx, uint8_t priority, const struct dpdmai_rx_queue_cfg *cfg) { @@ -331,6 +336,7 @@ int dpdmai_set_rx_queue(struct fsl_mc_io *mc_io, cmd_params->dest_id = cpu_to_le32(cfg->dest_cfg.dest_id); cmd_params->dest_priority = cfg->dest_cfg.priority; cmd_params->priority = priority; + cmd_params->queue_idx = queue_idx; cmd_params->user_ctx = cpu_to_le64(cfg->user_ctx); cmd_params->options = cpu_to_le32(cfg->options); dpdmai_set_field(cmd_params->dest_type, @@ -346,6 +352,8 @@ int dpdmai_set_rx_queue(struct fsl_mc_io *mc_io, * @mc_io: Pointer to MC portal's I/O object * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPDMAI object + * @queue_idx: Rx queue index. Accepted values are form 0 to num_queues + * parameter provided in dpdmai_create * @priority: Select the queue relative to number of * priorities configured at DPDMAI creation * @attr: Returned Rx queue attributes @@ -355,6 +363,7 @@ int dpdmai_set_rx_queue(struct fsl_mc_io *mc_io, int dpdmai_get_rx_queue(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, + uint8_t queue_idx, uint8_t priority, struct dpdmai_rx_queue_attr *attr) { @@ -369,6 +378,7 @@ int dpdmai_get_rx_queue(struct fsl_mc_io *mc_io, token); cmd_params = (struct dpdmai_cmd_get_queue *)cmd.params; cmd_params->priority = priority; + cmd_params->queue_idx = queue_idx; /* send command to mc*/ err = mc_send_command(mc_io, &cmd); @@ -392,6 +402,8 @@ int dpdmai_get_rx_queue(struct fsl_mc_io *mc_io, * @mc_io: Pointer to MC portal's I/O object * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPDMAI object + * @queue_idx: Tx queue index. Accepted values are form 0 to num_queues + * parameter provided in dpdmai_create * @priority: Select the queue relative to number of * priorities configured at DPDMAI creation * @attr: Returned Tx queue attributes @@ -401,6 +413,7 @@ int dpdmai_get_rx_queue(struct fsl_mc_io *mc_io, int dpdmai_get_tx_queue(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, + uint8_t queue_idx, uint8_t priority, struct dpdmai_tx_queue_attr *attr) { @@ -415,6 +428,7 @@ int dpdmai_get_tx_queue(struct fsl_mc_io *mc_io, token); cmd_params = (struct dpdmai_cmd_get_queue *)cmd.params; cmd_params->priority = priority; + cmd_params->queue_idx = queue_idx; /* send command to mc*/ err = mc_send_command(mc_io, &cmd); diff --git a/drivers/bus/fslmc/mc/dpio.c b/drivers/bus/fslmc/mc/dpio.c index 966277cc6..a3382ed14 100644 --- a/drivers/bus/fslmc/mc/dpio.c +++ b/drivers/bus/fslmc/mc/dpio.c @@ -268,6 +268,15 @@ int dpio_reset(struct fsl_mc_io *mc_io, return mc_send_command(mc_io, &cmd); } +/** + * dpio_get_attributes() - Retrieve DPIO attributes + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPIO object + * @attr: Returned object's attributes + * + * Return: '0' on Success; Error code otherwise + */ int dpio_get_attributes(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, diff --git a/drivers/bus/fslmc/mc/fsl_dpbp.h b/drivers/bus/fslmc/mc/fsl_dpbp.h index 111836261..9d405b42c 100644 --- a/drivers/bus/fslmc/mc/fsl_dpbp.h +++ b/drivers/bus/fslmc/mc/fsl_dpbp.h @@ -82,6 +82,7 @@ int dpbp_get_attributes(struct fsl_mc_io *mc_io, /** * BPSCN write will attempt to allocate into a cache (coherent write) */ +#define DPBP_NOTIF_OPT_COHERENT_WRITE 0x00000001 int dpbp_get_api_version(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t *major_ver, diff --git a/drivers/bus/fslmc/mc/fsl_dpbp_cmd.h b/drivers/bus/fslmc/mc/fsl_dpbp_cmd.h index 18402cedf..55c9fc9b4 100644 --- a/drivers/bus/fslmc/mc/fsl_dpbp_cmd.h +++ b/drivers/bus/fslmc/mc/fsl_dpbp_cmd.h @@ -9,13 +9,15 @@ /* DPBP Version */ #define DPBP_VER_MAJOR 3 -#define DPBP_VER_MINOR 3 +#define DPBP_VER_MINOR 4 /* Command versioning */ #define DPBP_CMD_BASE_VERSION 1 +#define DPBP_CMD_VERSION_2 2 #define DPBP_CMD_ID_OFFSET 4 #define DPBP_CMD(id) ((id << DPBP_CMD_ID_OFFSET) | DPBP_CMD_BASE_VERSION) +#define DPBP_CMD_V2(id) ((id << DPBP_CMD_ID_OFFSET) | DPBP_CMD_VERSION_2) /* Command IDs */ #define DPBP_CMDID_CLOSE DPBP_CMD(0x800) @@ -37,8 +39,8 @@ #define DPBP_CMDID_GET_IRQ_STATUS DPBP_CMD(0x016) #define DPBP_CMDID_CLEAR_IRQ_STATUS DPBP_CMD(0x017) -#define DPBP_CMDID_SET_NOTIFICATIONS DPBP_CMD(0x1b0) -#define DPBP_CMDID_GET_NOTIFICATIONS DPBP_CMD(0x1b1) +#define DPBP_CMDID_SET_NOTIFICATIONS DPBP_CMD_V2(0x1b0) +#define DPBP_CMDID_GET_NOTIFICATIONS DPBP_CMD_V2(0x1b1) #define DPBP_CMDID_GET_FREE_BUFFERS_NUM DPBP_CMD(0x1b2) @@ -68,8 +70,8 @@ struct dpbp_cmd_set_notifications { uint32_t depletion_exit; uint32_t surplus_entry; uint32_t surplus_exit; - uint16_t options; - uint16_t pad[3]; + uint32_t options; + uint16_t pad[2]; uint64_t message_ctx; uint64_t message_iova; }; @@ -79,8 +81,8 @@ struct dpbp_rsp_get_notifications { uint32_t depletion_exit; uint32_t surplus_entry; uint32_t surplus_exit; - uint16_t options; - uint16_t pad[3]; + uint32_t options; + uint16_t pad[2]; uint64_t message_ctx; uint64_t message_iova; }; diff --git a/drivers/bus/fslmc/mc/fsl_dpci.h b/drivers/bus/fslmc/mc/fsl_dpci.h index f69ed3f33..9af9097e5 100644 --- a/drivers/bus/fslmc/mc/fsl_dpci.h +++ b/drivers/bus/fslmc/mc/fsl_dpci.h @@ -6,6 +6,8 @@ #ifndef __FSL_DPCI_H #define __FSL_DPCI_H +#include + /* Data Path Communication Interface API * Contains initialization APIs and runtime control APIs for DPCI */ @@ -17,7 +19,7 @@ struct fsl_mc_io; /** * Maximum number of Tx/Rx priorities per DPCI object */ -#define DPCI_PRIO_NUM 2 +#define DPCI_PRIO_NUM 4 /** * Indicates an invalid frame queue @@ -106,6 +108,27 @@ int dpci_get_attributes(struct fsl_mc_io *mc_io, uint16_t token, struct dpci_attr *attr); +/** + * struct dpci_peer_attr - Structure representing the peer DPCI attributes + * @peer_id: DPCI peer id; if no peer is connected returns (-1) + * @num_of_priorities: The pper's number of receive priorities; determines the + * number of transmit priorities for the local DPCI object + */ +struct dpci_peer_attr { + int peer_id; + uint8_t num_of_priorities; +}; + +int dpci_get_peer_attributes(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + struct dpci_peer_attr *attr); + +int dpci_get_link_state(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + int *up); + /** * enum dpci_dest - DPCI destination types * @DPCI_DEST_NONE: Unassigned destination; The queue is set in parked mode @@ -153,6 +176,11 @@ struct dpci_dest_cfg { */ #define DPCI_QUEUE_OPT_DEST 0x00000002 +/** + * Set the queue to hold active mode. + */ +#define DPCI_QUEUE_OPT_HOLD_ACTIVE 0x00000004 + /** * struct dpci_rx_queue_cfg - Structure representing RX queue configuration * @options: Flags representing the suggested modifications to the queue; @@ -163,11 +191,14 @@ struct dpci_dest_cfg { * 'options' * @dest_cfg: Queue destination parameters; * valid only if 'DPCI_QUEUE_OPT_DEST' is contained in 'options' + * @order_preservation_en: order preservation configuration for the rx queue + * valid only if 'DPCI_QUEUE_OPT_HOLD_ACTIVE' is contained in 'options' */ struct dpci_rx_queue_cfg { uint32_t options; uint64_t user_ctx; struct dpci_dest_cfg dest_cfg; + int order_preservation_en; }; int dpci_set_rx_queue(struct fsl_mc_io *mc_io, @@ -217,4 +248,18 @@ int dpci_get_api_version(struct fsl_mc_io *mc_io, uint16_t *major_ver, uint16_t *minor_ver); +int dpci_set_opr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t index, + uint8_t options, + struct opr_cfg *cfg); + +int dpci_get_opr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t index, + struct opr_cfg *cfg, + struct opr_qry *qry); + #endif /* __FSL_DPCI_H */ diff --git a/drivers/bus/fslmc/mc/fsl_dpci_cmd.h b/drivers/bus/fslmc/mc/fsl_dpci_cmd.h index 634248ac0..92b85a820 100644 --- a/drivers/bus/fslmc/mc/fsl_dpci_cmd.h +++ b/drivers/bus/fslmc/mc/fsl_dpci_cmd.h @@ -8,7 +8,7 @@ /* DPCI Version */ #define DPCI_VER_MAJOR 3 -#define DPCI_VER_MINOR 3 +#define DPCI_VER_MINOR 4 #define DPCI_CMD_BASE_VERSION 1 #define DPCI_CMD_BASE_VERSION_V2 2 @@ -35,6 +35,8 @@ #define DPCI_CMDID_GET_PEER_ATTR DPCI_CMD_V1(0x0e2) #define DPCI_CMDID_GET_RX_QUEUE DPCI_CMD_V1(0x0e3) #define DPCI_CMDID_GET_TX_QUEUE DPCI_CMD_V1(0x0e4) +#define DPCI_CMDID_SET_OPR DPCI_CMD_V1(0x0e5) +#define DPCI_CMDID_GET_OPR DPCI_CMD_V1(0x0e6) /* Macros for accessing command fields smaller than 1byte */ #define DPCI_MASK(field) \ @@ -90,6 +92,8 @@ struct dpci_rsp_get_link_state { #define DPCI_DEST_TYPE_SHIFT 0 #define DPCI_DEST_TYPE_SIZE 4 +#define DPCI_ORDER_PRESERVATION_SHIFT 4 +#define DPCI_ORDER_PRESERVATION_SIZE 1 struct dpci_cmd_set_rx_queue { uint32_t dest_id; @@ -128,5 +132,61 @@ struct dpci_rsp_get_api_version { uint16_t minor; }; +struct dpci_cmd_set_opr { + uint16_t pad0; + uint8_t index; + uint8_t options; + uint8_t pad1[7]; + uint8_t oloe; + uint8_t oeane; + uint8_t olws; + uint8_t oa; + uint8_t oprrws; +}; + +struct dpci_cmd_get_opr { + uint16_t pad; + uint8_t index; +}; + +#define DPCI_RIP_SHIFT 0 +#define DPCI_RIP_SIZE 1 +#define DPCI_OPR_ENABLE_SHIFT 1 +#define DPCI_OPR_ENABLE_SIZE 1 +#define DPCI_TSEQ_NLIS_SHIFT 0 +#define DPCI_TSEQ_NLIS_SIZE 1 +#define DPCI_HSEQ_NLIS_SHIFT 0 +#define DPCI_HSEQ_NLIS_SIZE 1 + +struct dpci_rsp_get_opr { + uint64_t pad0; + /* from LSB: rip:1 enable:1 */ + uint8_t flags; + uint16_t pad1; + uint8_t oloe; + uint8_t oeane; + uint8_t olws; + uint8_t oa; + uint8_t oprrws; + uint16_t nesn; + uint16_t pad8; + uint16_t ndsn; + uint16_t pad2; + uint16_t ea_tseq; + /* only the LSB */ + uint8_t tseq_nlis; + uint8_t pad3; + uint16_t ea_hseq; + /* only the LSB */ + uint8_t hseq_nlis; + uint8_t pad4; + uint16_t ea_hptr; + uint16_t pad5; + uint16_t ea_tptr; + uint16_t pad6; + uint16_t opr_vid; + uint16_t pad7; + uint16_t opr_id; +}; #pragma pack(pop) #endif /* _FSL_DPCI_CMD_H */ diff --git a/drivers/bus/fslmc/mc/fsl_dpcon.h b/drivers/bus/fslmc/mc/fsl_dpcon.h index 36dd5f3c1..fc0430dc1 100644 --- a/drivers/bus/fslmc/mc/fsl_dpcon.h +++ b/drivers/bus/fslmc/mc/fsl_dpcon.h @@ -81,6 +81,25 @@ int dpcon_get_attributes(struct fsl_mc_io *mc_io, uint16_t token, struct dpcon_attr *attr); +/** + * struct dpcon_notification_cfg - Structure representing notification params + * @dpio_id: DPIO object ID; must be configured with a notification channel; + * to disable notifications set it to 'DPCON_INVALID_DPIO_ID'; + * @priority: Priority selection within the DPIO channel; valid values + * are 0-7, depending on the number of priorities in that channel + * @user_ctx: User context value provided with each CDAN message + */ +struct dpcon_notification_cfg { + int dpio_id; + uint8_t priority; + uint64_t user_ctx; +}; + +int dpcon_set_notification(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + struct dpcon_notification_cfg *cfg); + int dpcon_get_api_version(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t *major_ver, diff --git a/drivers/bus/fslmc/mc/fsl_dpdmai.h b/drivers/bus/fslmc/mc/fsl_dpdmai.h index 03e46ec14..40469cc13 100644 --- a/drivers/bus/fslmc/mc/fsl_dpdmai.h +++ b/drivers/bus/fslmc/mc/fsl_dpdmai.h @@ -39,6 +39,7 @@ int dpdmai_close(struct fsl_mc_io *mc_io, * should be configured with 0 */ struct dpdmai_cfg { + uint8_t num_queues; uint8_t priorities[DPDMAI_PRIO_NUM]; }; @@ -78,6 +79,7 @@ int dpdmai_reset(struct fsl_mc_io *mc_io, struct dpdmai_attr { int id; uint8_t num_of_priorities; + uint8_t num_of_queues; }; int dpdmai_get_attributes(struct fsl_mc_io *mc_io, @@ -149,6 +151,7 @@ struct dpdmai_rx_queue_cfg { int dpdmai_set_rx_queue(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, + uint8_t queue_idx, uint8_t priority, const struct dpdmai_rx_queue_cfg *cfg); @@ -168,6 +171,7 @@ struct dpdmai_rx_queue_attr { int dpdmai_get_rx_queue(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, + uint8_t queue_idx, uint8_t priority, struct dpdmai_rx_queue_attr *attr); @@ -183,6 +187,7 @@ struct dpdmai_tx_queue_attr { int dpdmai_get_tx_queue(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, + uint8_t queue_idx, uint8_t priority, struct dpdmai_tx_queue_attr *attr); diff --git a/drivers/bus/fslmc/mc/fsl_dpdmai_cmd.h b/drivers/bus/fslmc/mc/fsl_dpdmai_cmd.h index 618e19eae..7e122de4e 100644 --- a/drivers/bus/fslmc/mc/fsl_dpdmai_cmd.h +++ b/drivers/bus/fslmc/mc/fsl_dpdmai_cmd.h @@ -7,30 +7,32 @@ /* DPDMAI Version */ #define DPDMAI_VER_MAJOR 3 -#define DPDMAI_VER_MINOR 2 +#define DPDMAI_VER_MINOR 3 /* Command versioning */ #define DPDMAI_CMD_BASE_VERSION 1 +#define DPDMAI_CMD_VERSION_2 2 #define DPDMAI_CMD_ID_OFFSET 4 #define DPDMAI_CMD(id) ((id << DPDMAI_CMD_ID_OFFSET) | DPDMAI_CMD_BASE_VERSION) +#define DPDMAI_CMD_V2(id) ((id << DPDMAI_CMD_ID_OFFSET) | DPDMAI_CMD_VERSION_2) /* Command IDs */ #define DPDMAI_CMDID_CLOSE DPDMAI_CMD(0x800) #define DPDMAI_CMDID_OPEN DPDMAI_CMD(0x80E) -#define DPDMAI_CMDID_CREATE DPDMAI_CMD(0x90E) +#define DPDMAI_CMDID_CREATE DPDMAI_CMD_V2(0x90E) #define DPDMAI_CMDID_DESTROY DPDMAI_CMD(0x98E) #define DPDMAI_CMDID_GET_API_VERSION DPDMAI_CMD(0xa0E) #define DPDMAI_CMDID_ENABLE DPDMAI_CMD(0x002) #define DPDMAI_CMDID_DISABLE DPDMAI_CMD(0x003) -#define DPDMAI_CMDID_GET_ATTR DPDMAI_CMD(0x004) +#define DPDMAI_CMDID_GET_ATTR DPDMAI_CMD_V2(0x004) #define DPDMAI_CMDID_RESET DPDMAI_CMD(0x005) #define DPDMAI_CMDID_IS_ENABLED DPDMAI_CMD(0x006) -#define DPDMAI_CMDID_SET_RX_QUEUE DPDMAI_CMD(0x1A0) -#define DPDMAI_CMDID_GET_RX_QUEUE DPDMAI_CMD(0x1A1) -#define DPDMAI_CMDID_GET_TX_QUEUE DPDMAI_CMD(0x1A2) +#define DPDMAI_CMDID_SET_RX_QUEUE DPDMAI_CMD_V2(0x1A0) +#define DPDMAI_CMDID_GET_RX_QUEUE DPDMAI_CMD_V2(0x1A1) +#define DPDMAI_CMDID_GET_TX_QUEUE DPDMAI_CMD_V2(0x1A2) /* Macros for accessing command fields smaller than 1byte */ #define DPDMAI_MASK(field) \ @@ -47,7 +49,7 @@ struct dpdmai_cmd_open { }; struct dpdmai_cmd_create { - uint8_t pad; + uint8_t num_queues; uint8_t priorities[2]; }; @@ -66,6 +68,7 @@ struct dpdmai_rsp_is_enabled { struct dpdmai_rsp_get_attr { uint32_t id; uint8_t num_of_priorities; + uint8_t num_of_queues; }; #define DPDMAI_DEST_TYPE_SHIFT 0 @@ -77,7 +80,7 @@ struct dpdmai_cmd_set_rx_queue { uint8_t priority; /* from LSB: dest_type:4 */ uint8_t dest_type; - uint8_t pad; + uint8_t queue_idx; uint64_t user_ctx; uint32_t options; }; @@ -85,6 +88,7 @@ struct dpdmai_cmd_set_rx_queue { struct dpdmai_cmd_get_queue { uint8_t pad[5]; uint8_t priority; + uint8_t queue_idx; }; struct dpdmai_rsp_get_rx_queue { diff --git a/drivers/bus/fslmc/mc/fsl_dpmng.h b/drivers/bus/fslmc/mc/fsl_dpmng.h index afaf9b711..8559bef87 100644 --- a/drivers/bus/fslmc/mc/fsl_dpmng.h +++ b/drivers/bus/fslmc/mc/fsl_dpmng.h @@ -18,7 +18,7 @@ struct fsl_mc_io; * Management Complex firmware version information */ #define MC_VER_MAJOR 10 -#define MC_VER_MINOR 3 +#define MC_VER_MINOR 10 /** * struct mc_version diff --git a/drivers/bus/fslmc/mc/fsl_dpopr.h b/drivers/bus/fslmc/mc/fsl_dpopr.h new file mode 100644 index 000000000..fd727e011 --- /dev/null +++ b/drivers/bus/fslmc/mc/fsl_dpopr.h @@ -0,0 +1,85 @@ +/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) + * + * Copyright 2013-2015 Freescale Semiconductor Inc. + * Copyright 2018 NXP + * + */ +#ifndef __FSL_DPOPR_H_ +#define __FSL_DPOPR_H_ + +/** @addtogroup dpopr Data Path Order Restoration API + * Contains initialization APIs and runtime APIs for the Order Restoration + * @{ + */ + +/** Order Restoration properties */ + +/** + * Create a new Order Point Record option + */ +#define OPR_OPT_CREATE 0x1 +/** + * Retire an existing Order Point Record option + */ +#define OPR_OPT_RETIRE 0x2 + +/** + * struct opr_cfg - Structure representing OPR configuration + * @oprrws: Order point record (OPR) restoration window size (0 to 5) + * 0 - Window size is 32 frames. + * 1 - Window size is 64 frames. + * 2 - Window size is 128 frames. + * 3 - Window size is 256 frames. + * 4 - Window size is 512 frames. + * 5 - Window size is 1024 frames. + *@oa: OPR auto advance NESN window size (0 disabled, 1 enabled) + *@olws: OPR acceptable late arrival window size (0 to 3) + * 0 - Disabled. Late arrivals are always rejected. + * 1 - Window size is 32 frames. + * 2 - Window size is the same as the OPR restoration + * window size configured in the OPRRWS field. + * 3 - Window size is 8192 frames. + * Late arrivals are always accepted. + *@oeane: Order restoration list (ORL) resource exhaustion + * advance NESN enable (0 disabled, 1 enabled) + *@oloe: OPR loose ordering enable (0 disabled, 1 enabled) + */ +struct opr_cfg { + uint8_t oprrws; + uint8_t oa; + uint8_t olws; + uint8_t oeane; + uint8_t oloe; +}; + +/** + * struct opr_qry - Structure representing OPR configuration + * @enable: Enabled state + * @rip: Retirement In Progress + * @ndsn: Next dispensed sequence number + * @nesn: Next expected sequence number + * @ea_hseq: Early arrival head sequence number + * @hseq_nlis: HSEQ not last in sequence + * @ea_tseq: Early arrival tail sequence number + * @tseq_nlis: TSEQ not last in sequence + * @ea_tptr: Early arrival tail pointer + * @ea_hptr: Early arrival head pointer + * @opr_id: Order Point Record ID + * @opr_vid: Order Point Record Virtual ID + */ +struct opr_qry { + char enable; + char rip; + uint16_t ndsn; + uint16_t nesn; + uint16_t ea_hseq; + char hseq_nlis; + uint16_t ea_tseq; + char tseq_nlis; + uint16_t ea_tptr; + uint16_t ea_hptr; + uint16_t opr_id; + uint16_t opr_vid; +}; + +#endif /* __FSL_DPOPR_H_ */ diff --git a/drivers/bus/fslmc/rte_bus_fslmc_version.map b/drivers/bus/fslmc/rte_bus_fslmc_version.map index b4a881704..8717373dd 100644 --- a/drivers/bus/fslmc/rte_bus_fslmc_version.map +++ b/drivers/bus/fslmc/rte_bus_fslmc_version.map @@ -117,3 +117,13 @@ DPDK_18.05 { rte_dpaa2_memsegs; } DPDK_18.02; + +DPDK_18.11 { + global: + + dpci_get_link_state; + dpci_get_opr; + dpci_get_peer_attributes; + dpci_set_opr; + +} DPDK_18.05; diff --git a/drivers/crypto/dpaa2_sec/Makefile b/drivers/crypto/dpaa2_sec/Makefile index da3d8f84f..a61be49db 100644 --- a/drivers/crypto/dpaa2_sec/Makefile +++ b/drivers/crypto/dpaa2_sec/Makefile @@ -41,7 +41,7 @@ CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal EXPORT_MAP := rte_pmd_dpaa2_sec_version.map # library version -LIBABIVER := 1 +LIBABIVER := 2 # library source files SRCS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC) += dpaa2_sec_dpseci.c diff --git a/drivers/crypto/dpaa2_sec/meson.build b/drivers/crypto/dpaa2_sec/meson.build index 01afc5877..8fa4827ed 100644 --- a/drivers/crypto/dpaa2_sec/meson.build +++ b/drivers/crypto/dpaa2_sec/meson.build @@ -1,6 +1,8 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright 2018 NXP +version = 2 + if host_machine.system() != 'linux' build = false endif diff --git a/drivers/event/dpaa2/Makefile b/drivers/event/dpaa2/Makefile index 5e1a63200..3f85dd2be 100644 --- a/drivers/event/dpaa2/Makefile +++ b/drivers/event/dpaa2/Makefile @@ -27,7 +27,7 @@ CFLAGS += -I$(RTE_SDK)/drivers/net/dpaa2/mc # versioning export map EXPORT_MAP := rte_pmd_dpaa2_event_version.map -LIBABIVER := 1 +LIBABIVER := 2 # depends on fslmc bus which uses experimental API CFLAGS += -DALLOW_EXPERIMENTAL_API diff --git a/drivers/event/dpaa2/meson.build b/drivers/event/dpaa2/meson.build index de7a46155..c46b39e9d 100644 --- a/drivers/event/dpaa2/meson.build +++ b/drivers/event/dpaa2/meson.build @@ -1,6 +1,8 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright 2018 NXP +version = 2 + if host_machine.system() != 'linux' build = false endif diff --git a/drivers/mempool/dpaa2/Makefile b/drivers/mempool/dpaa2/Makefile index 9e4c87d79..4996a2cd1 100644 --- a/drivers/mempool/dpaa2/Makefile +++ b/drivers/mempool/dpaa2/Makefile @@ -19,7 +19,7 @@ CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal EXPORT_MAP := rte_mempool_dpaa2_version.map # Lbrary version -LIBABIVER := 1 +LIBABIVER := 2 # depends on fslmc bus which uses experimental API CFLAGS += -DALLOW_EXPERIMENTAL_API diff --git a/drivers/mempool/dpaa2/meson.build b/drivers/mempool/dpaa2/meson.build index 90bab6069..6b6ead617 100644 --- a/drivers/mempool/dpaa2/meson.build +++ b/drivers/mempool/dpaa2/meson.build @@ -1,6 +1,8 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright 2018 NXP +version = 2 + if host_machine.system() != 'linux' build = false endif diff --git a/drivers/net/dpaa2/Makefile b/drivers/net/dpaa2/Makefile index 9b0b14331..1d46f7f25 100644 --- a/drivers/net/dpaa2/Makefile +++ b/drivers/net/dpaa2/Makefile @@ -25,7 +25,7 @@ CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal EXPORT_MAP := rte_pmd_dpaa2_version.map # library version -LIBABIVER := 1 +LIBABIVER := 2 # depends on fslmc bus which uses experimental API CFLAGS += -DALLOW_EXPERIMENTAL_API diff --git a/drivers/net/dpaa2/meson.build b/drivers/net/dpaa2/meson.build index 213f0d72f..b34595258 100644 --- a/drivers/net/dpaa2/meson.build +++ b/drivers/net/dpaa2/meson.build @@ -1,6 +1,8 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright 2018 NXP +version = 2 + if host_machine.system() != 'linux' build = false endif diff --git a/drivers/raw/dpaa2_cmdif/Makefile b/drivers/raw/dpaa2_cmdif/Makefile index 9b863dda2..0dbe5c821 100644 --- a/drivers/raw/dpaa2_cmdif/Makefile +++ b/drivers/raw/dpaa2_cmdif/Makefile @@ -24,7 +24,7 @@ LDLIBS += -lrte_rawdev EXPORT_MAP := rte_pmd_dpaa2_cmdif_version.map -LIBABIVER := 1 +LIBABIVER := 2 # # all source are stored in SRCS-y diff --git a/drivers/raw/dpaa2_cmdif/meson.build b/drivers/raw/dpaa2_cmdif/meson.build index 1d146872e..37bb24a1b 100644 --- a/drivers/raw/dpaa2_cmdif/meson.build +++ b/drivers/raw/dpaa2_cmdif/meson.build @@ -1,6 +1,8 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright 2018 NXP +version = 2 + build = dpdk_conf.has('RTE_LIBRTE_DPAA2_MEMPOOL') deps += ['rawdev', 'mempool_dpaa2', 'bus_vdev'] sources = files('dpaa2_cmdif.c') diff --git a/drivers/raw/dpaa2_qdma/Makefile b/drivers/raw/dpaa2_qdma/Makefile index d88809ead..645220772 100644 --- a/drivers/raw/dpaa2_qdma/Makefile +++ b/drivers/raw/dpaa2_qdma/Makefile @@ -25,7 +25,7 @@ LDLIBS += -lrte_ring EXPORT_MAP := rte_pmd_dpaa2_qdma_version.map -LIBABIVER := 1 +LIBABIVER := 2 # # all source are stored in SRCS-y diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c index 2787d3028..44503331e 100644 --- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c +++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c @@ -805,7 +805,7 @@ dpaa2_dpdmai_dev_uninit(struct rte_rawdev *rawdev) DPAA2_QDMA_ERR("dmdmai disable failed"); /* Set up the DQRR storage for Rx */ - for (i = 0; i < DPDMAI_PRIO_NUM; i++) { + for (i = 0; i < dpdmai_dev->num_queues; i++) { struct dpaa2_queue *rxq = &(dpdmai_dev->rx_queue[i]); if (rxq->q_storage) { @@ -856,17 +856,17 @@ dpaa2_dpdmai_dev_init(struct rte_rawdev *rawdev, int dpdmai_id) ret); goto init_err; } - dpdmai_dev->num_queues = attr.num_of_priorities; + dpdmai_dev->num_queues = attr.num_of_queues; /* Set up Rx Queues */ - for (i = 0; i < attr.num_of_priorities; i++) { + for (i = 0; i < dpdmai_dev->num_queues; i++) { struct dpaa2_queue *rxq; memset(&rx_queue_cfg, 0, sizeof(struct dpdmai_rx_queue_cfg)); ret = dpdmai_set_rx_queue(&dpdmai_dev->dpdmai, CMD_PRI_LOW, dpdmai_dev->token, - i, &rx_queue_cfg); + i, 0, &rx_queue_cfg); if (ret) { DPAA2_QDMA_ERR("Setting Rx queue failed with err: %d", ret); @@ -893,9 +893,9 @@ dpaa2_dpdmai_dev_init(struct rte_rawdev *rawdev, int dpdmai_id) } /* Get Rx and Tx queues FQID's */ - for (i = 0; i < DPDMAI_PRIO_NUM; i++) { + for (i = 0; i < dpdmai_dev->num_queues; i++) { ret = dpdmai_get_rx_queue(&dpdmai_dev->dpdmai, CMD_PRI_LOW, - dpdmai_dev->token, i, &rx_attr); + dpdmai_dev->token, i, 0, &rx_attr); if (ret) { DPAA2_QDMA_ERR("Reading device failed with err: %d", ret); @@ -904,7 +904,7 @@ dpaa2_dpdmai_dev_init(struct rte_rawdev *rawdev, int dpdmai_id) dpdmai_dev->rx_queue[i].fqid = rx_attr.fqid; ret = dpdmai_get_tx_queue(&dpdmai_dev->dpdmai, CMD_PRI_LOW, - dpdmai_dev->token, i, &tx_attr); + dpdmai_dev->token, i, 0, &tx_attr); if (ret) { DPAA2_QDMA_ERR("Reading device failed with err: %d", ret); diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.h b/drivers/raw/dpaa2_qdma/dpaa2_qdma.h index c6a057806..0cbe90255 100644 --- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.h +++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.h @@ -11,6 +11,8 @@ struct qdma_io_meta; #define DPAA2_QDMA_MAX_FLE 3 #define DPAA2_QDMA_MAX_SDD 2 +#define DPAA2_DPDMAI_MAX_QUEUES 8 + /** FLE pool size: 3 Frame list + 2 source/destination descriptor */ #define QDMA_FLE_POOL_SIZE (sizeof(struct qdma_io_meta) + \ sizeof(struct qbman_fle) * DPAA2_QDMA_MAX_FLE + \ @@ -142,9 +144,9 @@ struct dpaa2_dpdmai_dev { /** Number of queue in this DPDMAI device */ uint8_t num_queues; /** RX queues */ - struct dpaa2_queue rx_queue[DPDMAI_PRIO_NUM]; + struct dpaa2_queue rx_queue[DPAA2_DPDMAI_MAX_QUEUES]; /** TX queues */ - struct dpaa2_queue tx_queue[DPDMAI_PRIO_NUM]; + struct dpaa2_queue tx_queue[DPAA2_DPDMAI_MAX_QUEUES]; }; #endif /* __DPAA2_QDMA_H__ */ diff --git a/drivers/raw/dpaa2_qdma/meson.build b/drivers/raw/dpaa2_qdma/meson.build index b6a081f11..2a4b69c16 100644 --- a/drivers/raw/dpaa2_qdma/meson.build +++ b/drivers/raw/dpaa2_qdma/meson.build @@ -1,6 +1,8 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright 2018 NXP +version = 2 + build = dpdk_conf.has('RTE_LIBRTE_DPAA2_MEMPOOL') deps += ['rawdev', 'mempool_dpaa2', 'ring'] sources = files('dpaa2_qdma.c') From patchwork Fri Oct 12 10:04:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreyansh Jain X-Patchwork-Id: 148736 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp538422lji; Fri, 12 Oct 2018 03:06:23 -0700 (PDT) X-Google-Smtp-Source: ACcGV6121umA0o1TR+H4ENVw9L1Sp3LyboExChdFYK4pJer/rQLxF6nemV5QBwsyW/T/CwCVJyuR X-Received: by 2002:a5d:5501:: with SMTP id b1-v6mr4468339wrv.228.1539338783677; Fri, 12 Oct 2018 03:06:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539338783; cv=none; d=google.com; s=arc-20160816; b=XzKdjVNGBuEoxGUs7+hEbJ1g3v0BK8p1t1V6Z66l8NKQNdg1gIuN4XZN1N/9O4x85X IjojIsvJ19wEksYAz9AcuC61E8b1wrvLfAlsKriF1jUsHnZ7uQerOkSFjoI9j/NoruNB dXTjEf2fJojPoxjMO1sqMLMUCRnfTMK0wAEbrj9Yu/SAlSL4C9TBU98rlIqaYPk8NNmw o6ADZx/AJn5FzjHZ3yT2xuToEJsOdbHgNvei0OsOkLX8wvKj0gCv5BWzn/I+hNG6FHWK AXHpSV73ySmpkLAekjDfWiile/ajBFFcDFrUjwCsBGLu686a/ZWlGE7/x5omiAGM2o3w V8vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:dkim-signature; bh=xvOIhLMwzMVBijrF9LB9GW/POPKZYN7Om2mEvIySQFc=; b=c6gde1l+1lmB98Ze9lZJGnuSC3c5ovJ5jef0Y5J7vIwsHlBGcho4SnbcnwvHGstkcd DuhP8rUuPOOFtMyNu8+ZrnFLENCqK2v76LDxFdh5HMLLN6YhNRUXYaFnWsbB9OVn6cLQ ohgysqOd7msAPfwJMsGhFFseaMAc8MVDpo74sRAnhbWsMY8aUDZ65VNyrWbMzyZgMOTx XN6a+1QSr8jfumOOBLjKnvznVY0Idv/gNcjNg+IStK0YIW0NteoQ/xavQq2XdAdriQ5b DmAwAsqw7pDyR5rh/Kt3vN7X2L2JfSFTbCmTJrnHBQ7wp/iYmaMXkORKotkMS+ll3vFe qFxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=xSuER5zO; 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 v188-v6si854380wmg.63.2018.10.12.03.06.23; Fri, 12 Oct 2018 03:06:23 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=xSuER5zO; 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 CC5A31B499; Fri, 12 Oct 2018 12:05:53 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00058.outbound.protection.outlook.com [40.107.0.58]) by dpdk.org (Postfix) with ESMTP id F08B91B481 for ; Fri, 12 Oct 2018 12:05:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xvOIhLMwzMVBijrF9LB9GW/POPKZYN7Om2mEvIySQFc=; b=xSuER5zONFQxmQMLBMwHFiVSPEzRXYQHlyUs6jRxleYPmScFs+BbvxUVwNqWjPBqAxF0uD7GTF1Jy2qfHyFb1sEuLDIK3Ho0mVie2PIHxzqymdWskiBU7L4aLFr9C4sTKTq1QuC2BOkr3xDtoiwizVVcVWMCv80KPRDIepXFPeg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.25; Fri, 12 Oct 2018 10:05:45 +0000 From: Shreyansh Jain To: thomas@monjalon.net Cc: ferruh.yigit@intel.com, dev@dpdk.org, Hemant Agrawal Date: Fri, 12 Oct 2018 15:34:15 +0530 Message-Id: <20181012100426.29349-5-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181012100426.29349-1-shreyansh.jain@nxp.com> References: <20180926180440.31726-1-shreyansh.jain@nxp.com> <20181012100426.29349-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BMXPR01CA0004.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::14) To AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2888f251-3412-457f-b619-08d6302a4774 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB4676; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4676; 3:SCwO2L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k6UB7GDFkjcfIt5zD7wZaEigg+wSAyIZ27Mh4tn/Pg4WBvh8y+lj+sh0ExF4/Yr2LoVXjq3aSf5E1alBqO7FvG9FO1nMjIblxwixo9VYSkekfVueZ4Z8ve1E56z/qI6m2ejW6My97nAdBl3dw8PWWPQI6dpSvLQzEKralsqaGvaVkRyp9PrmFrdloADEggBb99qFgFAgmq3hTFQQRQ5a8cucx2P1acIxzIz6ZnmOoWhRLU19vu2b0439N/v9USwHs6OB+ybJuQzqjzVYVevaa5zQmANXppOvAMR5H0kAhPsh31Y/UYidXk50S6ncSHtnUXm/s9989uTP9zpCxRjYSqK; 4:JB6UPdxO/AHTESrsDZ/tsyIhaCUdeJDbA9l0q0GvKxjncYHTjtgAcp+TND7ao9i0196PKxmpay/YCbmIXlkKoiFwVLqS51qFC8vGH/Y31Yo96NYvr4zk0+Vhdp16vc2tms5vVK6+DxYIgH2z49Xsnqpenx9DpIogUQ1dNkda21PAmMPbWzvi4XT7x6nrACVzcp7WBd5XK1Hmjttn1YxmH0XO6Je8bDadNmCSrf1jtFLSU9G3CpEtADNXOOqm8ipiPbaejj1FU8tIduOZccJX4F6J0tZb/YRJ/PzKTPOet7WChG/NHTFAbNGh8LQ82x0UysYaRYOzgIVh/IhgWO8LTdSseEN16KdUhl6AIorkmu0= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:AM0PR04MB4676; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4676; X-Forefront-PRVS: 0823A5777B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(346002)(366004)(136003)(39860400002)(199004)(189003)(2906002)(52116002)(16526019)(14444005)(53936002)(8676002)(478600001)(186003)(386003)(446003)(105586002)(7736002)(106356001)(6512007)(6116002)(86362001)(3846002)(575784001)(81156014)(50226002)(68736007)(1076002)(47776003)(5660300001)(6506007)(8936002)(78486009)(36756003)(316002)(26005)(66066001)(53946003)(6666004)(25786009)(55236004)(81166006)(11346002)(48376002)(76176011)(44832011)(2361001)(956004)(51416003)(2616005)(97736004)(1006002)(50466002)(4744004)(486006)(476003)(305945005)(16586007)(6916009)(4326008)(6486002)(2351001)(110426005)(579004); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4676; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR04MB4676; 23:SHDwa4Cue7cGFvGjwbRhE+AxjXUJf4a50bLIQCFjH?= 3T/UUKa/zgS2UECedfHaaP++KNK1Y5xKx/WpK5c1rSnodt8pDiUGfR0LA4p7jonvxbMAdvjMKS2HnhnYgWB6oFSczZsYJKN1WqutfZxzNJKqEqEG0RhzlmkyYOaam1jCl06WF6v0wEhBRbw2btpsoupGJtryFsLZ+S506kOtC0PA0nMN3sD9jvy4mtP8H3YgPuxeilj1NTRoSsFPaJ0IG5qXiIV2OKGKHsEtuSx6KpkscMlDbwk70XGEuF4v5X3fnoE5qFNThxWym4u1vaSpG+qVO1Zehb6zEuErwEgB9/aVXCc9Uw2/6d0DsLGS8bp2bEGVwSJCkyXnTf9jk/dzp//iLbpgaxKxPg7NnaksNNenyO+BjBw3heQmtC92HdFEwT0z556scNkbavcpBQ61oFttZpGrNjZBOl4Eaq2aX1tyRAoP/ekNff08wl2Yv/voM98D4bmdhkd86WDTGYKgv5Vh2bvVTf2bzJLdv0jP/y6iCzfrAfifN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c+JZ+Aq9BxVZDaB/S8oPq2dOUW539tRkT1fwMfL/JD5b/a+Xv/yZfMEIVmteERiRkQw3+/ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2018 10:05:45.5117 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2888f251-3412-457f-b619-08d6302a4774 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4676 Subject: [dpdk-dev] [PATCH v3 04/15] net/dpaa2: upgrade dpni to mc FW APIs to 10.10.0 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: Hemant Agrawal New feature includes ordering support and link related enhancements Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/mc/dpni.c | 134 +++++++++- drivers/net/dpaa2/mc/fsl_dpkg.h | 71 ++---- drivers/net/dpaa2/mc/fsl_dpni.h | 378 ++++++++++++++++------------ drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 87 ++++++- drivers/net/dpaa2/mc/fsl_net.h | 2 +- 5 files changed, 460 insertions(+), 212 deletions(-) -- 2.17.1 diff --git a/drivers/net/dpaa2/mc/dpni.c b/drivers/net/dpaa2/mc/dpni.c index 9f228169a..44b5604d3 100644 --- a/drivers/net/dpaa2/mc/dpni.c +++ b/drivers/net/dpaa2/mc/dpni.c @@ -121,6 +121,7 @@ int dpni_create(struct fsl_mc_io *mc_io, cmd_params->num_queues = cfg->num_queues; cmd_params->num_tcs = cfg->num_tcs; cmd_params->mac_filter_entries = cfg->mac_filter_entries; + cmd_params->num_rx_tcs = cfg->num_rx_tcs; cmd_params->vlan_filter_entries = cfg->vlan_filter_entries; cmd_params->qos_entries = cfg->qos_entries; cmd_params->fs_entries = cpu_to_le16(cfg->fs_entries); @@ -664,9 +665,14 @@ int dpni_get_buffer_layout(struct fsl_mc_io *mc_io, /* retrieve response parameters */ rsp_params = (struct dpni_rsp_get_buffer_layout *)cmd.params; - layout->pass_timestamp = dpni_get_field(rsp_params->flags, PASS_TS); - layout->pass_parser_result = dpni_get_field(rsp_params->flags, PASS_PR); - layout->pass_frame_status = dpni_get_field(rsp_params->flags, PASS_FS); + layout->pass_timestamp = + (int)dpni_get_field(rsp_params->flags, PASS_TS); + layout->pass_parser_result = + (int)dpni_get_field(rsp_params->flags, PASS_PR); + layout->pass_frame_status = + (int)dpni_get_field(rsp_params->flags, PASS_FS); + layout->pass_sw_opaque = + (int)dpni_get_field(rsp_params->flags, PASS_SWO); layout->private_data_size = le16_to_cpu(rsp_params->private_data_size); layout->data_align = le16_to_cpu(rsp_params->data_align); layout->data_head_room = le16_to_cpu(rsp_params->head_room); @@ -702,10 +708,11 @@ int dpni_set_buffer_layout(struct fsl_mc_io *mc_io, token); cmd_params = (struct dpni_cmd_set_buffer_layout *)cmd.params; cmd_params->qtype = qtype; - cmd_params->options = cpu_to_le16(layout->options); + cmd_params->options = cpu_to_le16((uint16_t)layout->options); dpni_set_field(cmd_params->flags, PASS_TS, layout->pass_timestamp); dpni_set_field(cmd_params->flags, PASS_PR, layout->pass_parser_result); dpni_set_field(cmd_params->flags, PASS_FS, layout->pass_frame_status); + dpni_set_field(cmd_params->flags, PASS_SWO, layout->pass_sw_opaque); cmd_params->private_data_size = cpu_to_le16(layout->private_data_size); cmd_params->data_align = cpu_to_le16(layout->data_align); cmd_params->head_room = cpu_to_le16(layout->data_head_room); @@ -893,6 +900,7 @@ int dpni_set_link_cfg(struct fsl_mc_io *mc_io, cmd_params = (struct dpni_cmd_set_link_cfg *)cmd.params; cmd_params->rate = cpu_to_le32(cfg->rate); cmd_params->options = cpu_to_le64(cfg->options); + cmd_params->advertising = cpu_to_le64(cfg->advertising); /* send command to mc*/ return mc_send_command(mc_io, &cmd); @@ -929,8 +937,11 @@ int dpni_get_link_state(struct fsl_mc_io *mc_io, /* retrieve response parameters */ rsp_params = (struct dpni_rsp_get_link_state *)cmd.params; state->up = dpni_get_field(rsp_params->flags, LINK_STATE); + state->state_valid = dpni_get_field(rsp_params->flags, STATE_VALID); state->rate = le32_to_cpu(rsp_params->rate); state->options = le64_to_cpu(rsp_params->options); + state->supported = le64_to_cpu(rsp_params->supported); + state->advertising = le64_to_cpu(rsp_params->advertising); return 0; } @@ -1471,6 +1482,9 @@ int dpni_set_rx_tc_dist(struct fsl_mc_io *mc_io, dpni_set_field(cmd_params->keep_hash_key, KEEP_HASH_KEY, cfg->fs_cfg.keep_hash_key); + dpni_set_field(cmd_params->keep_hash_key, + KEEP_ENTRIES, + cfg->fs_cfg.keep_entries); /* send command to mc*/ return mc_send_command(mc_io, &cmd); @@ -1764,8 +1778,8 @@ int dpni_get_queue(struct fsl_mc_io *mc_io, * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPNI object * @page: Selects the statistics page to retrieve, see - * DPNI_GET_STATISTICS output. Pages are numbered 0 to 2. - * @param: Custom parameter for some pages used to select + * DPNI_GET_STATISTICS output. Pages are numbered 0 to 3. + * @param: Custom parameter for some pages used to select * a certain statistic source, for example the TC. * @stat: Structure containing the statistics * @@ -1941,3 +1955,111 @@ int dpni_get_taildrop(struct fsl_mc_io *mc_io, return 0; } + +/** + * dpni_set_opr() - Set Order Restoration configuration. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @tc: Traffic class, in range 0 to NUM_TCS - 1 + * @index: Selects the specific queue out of the set allocated + * for the same TC. Value must be in range 0 to + * NUM_QUEUES - 1 + * @options: Configuration mode options + * can be OPR_OPT_CREATE or OPR_OPT_RETIRE + * @cfg: Configuration options for the OPR + * + * Return: '0' on Success; Error code otherwise. + */ +int dpni_set_opr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t tc, + uint8_t index, + uint8_t options, + struct opr_cfg *cfg) +{ + struct dpni_cmd_set_opr *cmd_params; + struct mc_command cmd = { 0 }; + + /* prepare command */ + cmd.header = mc_encode_cmd_header( + DPNI_CMDID_SET_OPR, + cmd_flags, + token); + cmd_params = (struct dpni_cmd_set_opr *)cmd.params; + cmd_params->tc_id = tc; + cmd_params->index = index; + cmd_params->options = options; + cmd_params->oloe = cfg->oloe; + cmd_params->oeane = cfg->oeane; + cmd_params->olws = cfg->olws; + cmd_params->oa = cfg->oa; + cmd_params->oprrws = cfg->oprrws; + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +/** + * dpni_get_opr() - Retrieve Order Restoration config and query. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @tc: Traffic class, in range 0 to NUM_TCS - 1 + * @index: Selects the specific queue out of the set allocated + * for the same TC. Value must be in range 0 to + * NUM_QUEUES - 1 + * @cfg: Returned OPR configuration + * @qry: Returned OPR query + * + * Return: '0' on Success; Error code otherwise. + */ +int dpni_get_opr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t tc, + uint8_t index, + struct opr_cfg *cfg, + struct opr_qry *qry) +{ + struct dpni_rsp_get_opr *rsp_params; + struct dpni_cmd_get_opr *cmd_params; + struct mc_command cmd = { 0 }; + int err; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_OPR, + cmd_flags, + token); + cmd_params = (struct dpni_cmd_get_opr *)cmd.params; + cmd_params->index = index; + cmd_params->tc_id = tc; + + /* send command to mc*/ + err = mc_send_command(mc_io, &cmd); + if (err) + return err; + + /* retrieve response parameters */ + rsp_params = (struct dpni_rsp_get_opr *)cmd.params; + cfg->oloe = rsp_params->oloe; + cfg->oeane = rsp_params->oeane; + cfg->olws = rsp_params->olws; + cfg->oa = rsp_params->oa; + cfg->oprrws = rsp_params->oprrws; + qry->rip = dpni_get_field(rsp_params->flags, RIP); + qry->enable = dpni_get_field(rsp_params->flags, OPR_ENABLE); + qry->nesn = le16_to_cpu(rsp_params->nesn); + qry->ndsn = le16_to_cpu(rsp_params->ndsn); + qry->ea_tseq = le16_to_cpu(rsp_params->ea_tseq); + qry->tseq_nlis = dpni_get_field(rsp_params->tseq_nlis, TSEQ_NLIS); + qry->ea_hseq = le16_to_cpu(rsp_params->ea_hseq); + qry->hseq_nlis = dpni_get_field(rsp_params->hseq_nlis, HSEQ_NLIS); + qry->ea_hptr = le16_to_cpu(rsp_params->ea_hptr); + qry->ea_tptr = le16_to_cpu(rsp_params->ea_tptr); + qry->opr_vid = le16_to_cpu(rsp_params->opr_vid); + qry->opr_id = le16_to_cpu(rsp_params->opr_id); + + return 0; +} diff --git a/drivers/net/dpaa2/mc/fsl_dpkg.h b/drivers/net/dpaa2/mc/fsl_dpkg.h index 4de70f307..02fe8d50e 100644 --- a/drivers/net/dpaa2/mc/fsl_dpkg.h +++ b/drivers/net/dpaa2/mc/fsl_dpkg.h @@ -71,45 +71,41 @@ struct dpkg_mask { /** * struct dpkg_extract - A structure for defining a single extraction * @type: Determines how the union below is interpreted: - * DPKG_EXTRACT_FROM_HDR: selects 'from_hdr'; - * DPKG_EXTRACT_FROM_DATA: selects 'from_data'; - * DPKG_EXTRACT_FROM_PARSE: selects 'from_parse' + * DPKG_EXTRACT_FROM_HDR: selects 'from_hdr'; + * DPKG_EXTRACT_FROM_DATA: selects 'from_data'; + * DPKG_EXTRACT_FROM_PARSE: selects 'from_parse' * @extract: Selects extraction method + * @extract.from_hdr: Used when 'type = DPKG_EXTRACT_FROM_HDR' + * @extract.from_data: Used when 'type = DPKG_EXTRACT_FROM_DATA' + * @extract.from_parse: Used when 'type = DPKG_EXTRACT_FROM_PARSE' + * @extract.from_hdr.prot: Any of the supported headers + * @extract.from_hdr.type: Defines the type of header extraction: + * DPKG_FROM_HDR: use size & offset below; + * DPKG_FROM_FIELD: use field, size and offset below; + * DPKG_FULL_FIELD: use field below + * @extract.from_hdr.field: One of the supported fields (NH_FLD_) + * @extract.from_hdr.size: Size in bytes + * @extract.from_hdr.offset: Byte offset + * @extract.from_hdr.hdr_index: Clear for cases not listed below; + * Used for protocols that may have more than a single + * header, 0 indicates an outer header; + * Supported protocols (possible values): + * NET_PROT_VLAN (0, HDR_INDEX_LAST); + * NET_PROT_MPLS (0, 1, HDR_INDEX_LAST); + * NET_PROT_IP(0, HDR_INDEX_LAST); + * NET_PROT_IPv4(0, HDR_INDEX_LAST); + * NET_PROT_IPv6(0, HDR_INDEX_LAST); + * @extract.from_data.size: Size in bytes + * @extract.from_data.offset: Byte offset + * @extract.from_parse.size: Size in bytes + * @extract.from_parse.offset: Byte offset * @num_of_byte_masks: Defines the number of valid entries in the array below; * This is also the number of bytes to be used as masks * @masks: Masks parameters */ struct dpkg_extract { enum dpkg_extract_type type; - /** - * union extract - Selects extraction method - * @from_hdr - Used when 'type = DPKG_EXTRACT_FROM_HDR' - * @from_data - Used when 'type = DPKG_EXTRACT_FROM_DATA' - * @from_parse - Used when 'type = DPKG_EXTRACT_FROM_PARSE' - */ union { - /** - * struct from_hdr - Used when 'type = DPKG_EXTRACT_FROM_HDR' - * @prot: Any of the supported headers - * @type: Defines the type of header extraction: - * DPKG_FROM_HDR: use size & offset below; - * DPKG_FROM_FIELD: use field, size and offset below; - * DPKG_FULL_FIELD: use field below - * @field: One of the supported fields (NH_FLD_) - * - * @size: Size in bytes - * @offset: Byte offset - * @hdr_index: Clear for cases not listed below; - * Used for protocols that may have more than a single - * header, 0 indicates an outer header; - * Supported protocols (possible values): - * NET_PROT_VLAN (0, HDR_INDEX_LAST); - * NET_PROT_MPLS (0, 1, HDR_INDEX_LAST); - * NET_PROT_IP(0, HDR_INDEX_LAST); - * NET_PROT_IPv4(0, HDR_INDEX_LAST); - * NET_PROT_IPv6(0, HDR_INDEX_LAST); - */ - struct { enum net_prot prot; enum dpkg_extract_from_hdr_type type; @@ -118,23 +114,10 @@ struct dpkg_extract { uint8_t offset; uint8_t hdr_index; } from_hdr; - /** - * struct from_data - * Used when 'type = DPKG_EXTRACT_FROM_DATA' - * @size: Size in bytes - * @offset: Byte offset - */ struct { uint8_t size; uint8_t offset; } from_data; - - /** - * struct from_parse - * Used when 'type = DPKG_EXTRACT_FROM_PARSE' - * @size: Size in bytes - * @offset: Byte offset - */ struct { uint8_t size; uint8_t offset; diff --git a/drivers/net/dpaa2/mc/fsl_dpni.h b/drivers/net/dpaa2/mc/fsl_dpni.h index f0edcd270..de1bcb5bf 100644 --- a/drivers/net/dpaa2/mc/fsl_dpni.h +++ b/drivers/net/dpaa2/mc/fsl_dpni.h @@ -8,6 +8,7 @@ #define __FSL_DPNI_H #include +#include struct fsl_mc_io; @@ -77,6 +78,20 @@ struct fsl_mc_io; */ #define DPNI_OPT_NO_FS 0x000020 +/** + * Enable the Order Restoration support + */ +#define DPNI_OPT_HAS_OPR 0x000040 + +/** + * Order Point Records are shared for the entire TC + */ +#define DPNI_OPT_OPR_PER_TC 0x000080 +/** + * All Tx traffic classes will use a single sender (ignore num_queueus for tx) + */ +#define DPNI_OPT_SINGLE_SENDER 0x000100 + int dpni_open(struct fsl_mc_io *mc_io, uint32_t cmd_flags, int dpni_id, @@ -88,71 +103,74 @@ int dpni_close(struct fsl_mc_io *mc_io, /** * struct dpni_cfg - Structure representing DPNI configuration - * @mac_addr: Primary MAC address - * @adv: Advanced parameters; default is all zeros; - * use this structure to change default settings + * @options: Any combination of the following options: + * DPNI_OPT_TX_FRM_RELEASE + * DPNI_OPT_NO_MAC_FILTER + * DPNI_OPT_HAS_POLICING + * DPNI_OPT_SHARED_CONGESTION + * DPNI_OPT_HAS_KEY_MASKING + * DPNI_OPT_NO_FS + * DPNI_OPT_SINGLE_SENDER + * @fs_entries: Number of entries in the flow steering table. + * This table is used to select the ingress queue for + * ingress traffic, targeting a GPP core or another. + * In addition it can be used to discard traffic that + * matches the set rule. It is either an exact match table + * or a TCAM table, depending on DPNI_OPT_ HAS_KEY_MASKING + * bit in OPTIONS field. This field is ignored if + * DPNI_OPT_NO_FS bit is set in OPTIONS field. Otherwise, + * value 0 defaults to 64. Maximum supported value is 1024. + * Note that the total number of entries is limited on the + * SoC to as low as 512 entries if TCAM is used. + * @vlan_filter_entries: Number of entries in the VLAN address filtering + * table. This is an exact match table used to filter + * ingress traffic based on VLAN IDs. Value 0 disables VLAN + * filtering. Maximum supported value is 16. + * @mac_filter_entries: Number of entries in the MAC address filtering + * table. This is an exact match table and allows both + * unicast and multicast entries. The primary MAC address + * of the network interface is not part of this table, + * this contains only entries in addition to it. This + * field is ignored if DPNI_OPT_ NO_MAC_FILTER is set in + * OPTIONS field. Otherwise, value 0 defaults to 80. + * Maximum supported value is 80. + * @num_queues: Number of Tx and Rx queues used for traffic + * distribution. This is orthogonal to QoS and is only + * used to distribute traffic to multiple GPP cores. + * This configuration affects the number of Tx queues + * (logical FQs, all associated with a single CEETM queue), + * Rx queues and Tx confirmation queues, if applicable. + * Value 0 defaults to one queue. Maximum supported value + * is 8. + * @num_tcs: Number of traffic classes (TCs), reserved for the DPNI. + * TCs can have different priority levels for the purpose + * of Tx scheduling (see DPNI_SET_TX_PRIORITIES), different + * BPs (DPNI_ SET_POOLS), policers. There are dedicated QM + * queues for traffic classes (including class queues on + * Tx). Value 0 defaults to one TC. Maximum supported value + * is 16. There are maximum 16 TCs for Tx and 8 TCs for Rx. + * When num_tcs>8 Tx will use this value but Rx will have + * only 8 traffic classes. + * @num_rx_tcs: if set to other value than zero represents number + * of TCs used for Rx. Maximum value is 8. If set to zero the + * number of Rx TCs will be initialized with the value provided + * in num_tcs parameter. + * @qos_entries: Number of entries in the QoS classification table. This + * table is used to select the TC for ingress traffic. It + * is either an exact match or a TCAM table, depending on + * DPNI_OPT_ HAS_KEY_MASKING bit in OPTIONS field. This + * field is ignored if the DPNI has a single TC. Otherwise, + * a value of 0 defaults to 64. Maximum supported value + * is 64. */ struct dpni_cfg { - /** - * @options: Any combination of the following options: - * DPNI_OPT_TX_FRM_RELEASE - * DPNI_OPT_NO_MAC_FILTER - * DPNI_OPT_HAS_POLICING - * DPNI_OPT_SHARED_CONGESTION - * DPNI_OPT_HAS_KEY_MASKING - * DPNI_OPT_NO_FS - * @fs_entries: Number of entries in the flow steering table. - * This table is used to select the ingress queue for - * ingress traffic, targeting a GPP core or another. - * In addition it can be used to discard traffic that - * matches the set rule. It is either an exact match table - * or a TCAM table, depending on DPNI_OPT_ HAS_KEY_MASKING - * bit in OPTIONS field. This field is ignored if - * DPNI_OPT_NO_FS bit is set in OPTIONS field. Otherwise, - * value 0 defaults to 64. Maximum supported value is 1024. - * Note that the total number of entries is limited on the - * SoC to as low as 512 entries if TCAM is used. - * @vlan_filter_entries: Number of entries in the VLAN address filtering - * table. This is an exact match table used to filter - * ingress traffic based on VLAN IDs. Value 0 disables VLAN - * filtering. Maximum supported value is 16. - * @mac_filter_entries: Number of entries in the MAC address filtering - * table. This is an exact match table and allows both - * unicast and multicast entries. The primary MAC address - * of the network interface is not part of this table, - * this contains only entries in addition to it. This - * field is ignored if DPNI_OPT_ NO_MAC_FILTER is set in - * OPTIONS field. Otherwise, value 0 defaults to 80. - * Maximum supported value is 80. - * @num_queues: Number of Tx and Rx queues used for traffic - * distribution. This is orthogonal to QoS and is only - * used to distribute traffic to multiple GPP cores. - * This configuration affects the number of Tx queues - * (logical FQs, all associated with a single CEETM queue), - * Rx queues and Tx confirmation queues, if applicable. - * Value 0 defaults to one queue. Maximum supported value - * is 8. - * @num_tcs: Number of traffic classes (TCs), reserved for the DPNI. - * TCs can have different priority levels for the purpose - * of Tx scheduling (see DPNI_SET_TX_SELECTION), different - * BPs (DPNI_ SET_POOLS), policers. There are dedicated QM - * queues for traffic classes (including class queues on - * Tx). Value 0 defaults to one TC. Maximum supported value - * is 8. - * @qos_entries: Number of entries in the QoS classification table. This - * table is used to select the TC for ingress traffic. It - * is either an exact match or a TCAM table, depending on - * DPNI_OPT_ HAS_KEY_MASKING bit in OPTIONS field. This - * field is ignored if the DPNI has a single TC. Otherwise, - * a value of 0 defaults to 64. Maximum supported value - * is 64. - */ uint32_t options; uint16_t fs_entries; uint8_t vlan_filter_entries; uint8_t mac_filter_entries; uint8_t num_queues; uint8_t num_tcs; + uint8_t num_rx_tcs; uint8_t qos_entries; }; @@ -172,17 +190,14 @@ int dpni_destroy(struct fsl_mc_io *mc_io, * @num_dpbp: Number of DPBPs * @pools: Array of buffer pools parameters; The number of valid entries * must match 'num_dpbp' value + * @pools.dpbp_id: DPBP object ID + * @pools.priority: Priority mask that indicates TC's used with this buffer. + * I set to 0x00 MC will assume value 0xff. + * @pools.buffer_size: Buffer size + * @pools.backup_pool: Backup pool */ struct dpni_pools_cfg { uint8_t num_dpbp; - /** - * struct pools - Buffer pools parameters - * @dpbp_id: DPBP object ID - * @priority: priority mask that indicates TC's used with this buffer. - * I set to 0x00 MC will assume value 0xff. - * @buffer_size: Buffer size - * @backup_pool: Backup pool - */ struct { int dpbp_id; uint8_t priority_mask; @@ -296,6 +311,8 @@ int dpni_clear_irq_status(struct fsl_mc_io *mc_io, * variants, * - 0x422 - WRIOP version 1.1.2, used on LS1088 and * variants. + * - 0xC00 - WRIOP version 3.0.0, used on LX2160 and + * variants. */ struct dpni_attr { uint32_t options; @@ -320,6 +337,13 @@ int dpni_get_attributes(struct fsl_mc_io *mc_io, * DPNI errors */ +/** + * Discard error. When set all discarded frames in wriop will be enqueued to + * error queue. To be used in dpni_set_errors_behavior() only if error_action + * parameter is set to DPNI_ERROR_ACTION_SEND_TO_ERROR_QUEUE. + */ +#define DPNI_ERROR_DISC 0x80000000 + /** * Extract out of frame header error */ @@ -408,6 +432,10 @@ int dpni_set_errors_behavior(struct fsl_mc_io *mc_io, * Select to modify the data-tail-room setting */ #define DPNI_BUF_LAYOUT_OPT_DATA_TAIL_ROOM 0x00000040 +/** + * Select to modify the sw-opaque value setting + */ +#define DPNI_BUF_LAYOUT_OPT_SW_OPAQUE 0x00000080 /** * struct dpni_buffer_layout - Structure representing DPNI buffer layout @@ -427,6 +455,7 @@ struct dpni_buffer_layout { int pass_timestamp; int pass_parser_result; int pass_frame_status; + int pass_sw_opaque; uint16_t private_data_size; uint16_t data_align; uint16_t data_head_room; @@ -501,16 +530,48 @@ int dpni_get_tx_data_offset(struct fsl_mc_io *mc_io, #define DPNI_STATISTICS_CNT 7 +/** + * union dpni_statistics - Union describing the DPNI statistics + * @page_0: Page_0 statistics structure + * @page_0.ingress_all_frames: Ingress frame count + * @page_0.ingress_all_bytes: Ingress byte count + * @page_0.ingress_multicast_frames: Ingress multicast frame count + * @page_0.ingress_multicast_bytes: Ingress multicast byte count + * @page_0.ingress_broadcast_frames: Ingress broadcast frame count + * @page_0.ingress_broadcast_bytes: Ingress broadcast byte count + * @page_1: Page_1 statistics structure + * @page_1.egress_all_frames: Egress frame count + * @page_1.egress_all_bytes: Egress byte count + * @page_1.egress_multicast_frames: Egress multicast frame count + * @page_1.egress_multicast_bytes: Egress multicast byte count + * @page_1.egress_broadcast_frames: Egress broadcast frame count + * @page_1.egress_broadcast_bytes: Egress broadcast byte count + * @page_2: Page_2 statistics structure + * @page_2.ingress_filtered_frames: Ingress filtered frame count + * @page_2.ingress_discarded_frames: Ingress discarded frame count + * @page_2.ingress_nobuffer_discards: Ingress discarded frame count due to + * lack of buffers + * @page_2.egress_discarded_frames: Egress discarded frame count + * @page_2.egress_confirmed_frames: Egress confirmed frame count + * @page_3: Page_3 statistics structure with values for the selected TC + * @page_3.ceetm_dequeue_bytes: Cumulative count of the number of bytes dequeued + * @page_3.ceetm_dequeue_frames: Cumulative count of the number of frames + * dequeued + * @page_3.ceetm_reject_bytes: Cumulative count of the number of bytes in all + * frames whose enqueue was rejected + * @page_3.ceetm_reject_frames: Cumulative count of all frame enqueues rejected + * @page_4: congestion point drops for seleted TC + * @page_4.cgr_reject_frames: number of rejected frames due to congestion point + * @page_4.cgr_reject_bytes: number of rejected bytes due to congestion point + * @page_5: policer statistics per TC + * @page_5.policer_cnt_red: NUmber of red colored frames + * @page_5.policer_cnt_yellow: number of yellow colored frames + * @page_5.policer_cnt_green: number of green colored frames + * @page_5.policer_cnt_re_red: number of recolored red frames + * @page_5.policer_cnt_re_yellow: number of recolored yellow frames + * @raw: raw statistics structure, used to index counters + */ union dpni_statistics { - /** - * struct page_0 - Page_0 statistics structure - * @ingress_all_frames: Ingress frame count - * @ingress_all_bytes: Ingress byte count - * @ingress_multicast_frames: Ingress multicast frame count - * @ingress_multicast_bytes: Ingress multicast byte count - * @ingress_broadcast_frames: Ingress broadcast frame count - * @ingress_broadcast_bytes: Ingress broadcast byte count - */ struct { uint64_t ingress_all_frames; uint64_t ingress_all_bytes; @@ -519,15 +580,6 @@ union dpni_statistics { uint64_t ingress_broadcast_frames; uint64_t ingress_broadcast_bytes; } page_0; - /** - * struct page_1 - Page_1 statistics structure - * @egress_all_frames: Egress frame count - * @egress_all_bytes: Egress byte count - * @egress_multicast_frames: Egress multicast frame count - * @egress_multicast_bytes: Egress multicast byte count - * @egress_broadcast_frames: Egress broadcast frame count - * @egress_broadcast_bytes: Egress broadcast byte count - */ struct { uint64_t egress_all_frames; uint64_t egress_all_bytes; @@ -536,15 +588,6 @@ union dpni_statistics { uint64_t egress_broadcast_frames; uint64_t egress_broadcast_bytes; } page_1; - /** - * struct page_2 - Page_2 statistics structure - * @ingress_filtered_frames: Ingress filtered frame count - * @ingress_discarded_frames: Ingress discarded frame count - * @ingress_nobuffer_discards: Ingress discarded frame count due to - * lack of buffers - * @egress_discarded_frames: Egress discarded frame count - * @egress_confirmed_frames: Egress confirmed frame count - */ struct { uint64_t ingress_filtered_frames; uint64_t ingress_discarded_frames; @@ -552,26 +595,23 @@ union dpni_statistics { uint64_t egress_discarded_frames; uint64_t egress_confirmed_frames; } page_2; - /** - * struct page_3 - Page_3 statistics structure with values for the - * selected TC - * @ceetm_dequeue_bytes: Cumulative count of the number of bytes - * dequeued - * @ceetm_dequeue_frames: Cumulative count of the number of frames - * dequeued - * @ceetm_reject_bytes: Cumulative count of the number of bytes in all - * frames whose enqueue was rejected - * @ceetm_reject_frames: Cumulative count of all frame enqueues rejected - */ struct { uint64_t ceetm_dequeue_bytes; uint64_t ceetm_dequeue_frames; uint64_t ceetm_reject_bytes; uint64_t ceetm_reject_frames; } page_3; - /** - * struct raw - raw statistics structure, used to index counters - */ + struct { + uint64_t cgr_reject_frames; + uint64_t cgr_reject_bytes; + } page_4; + struct { + uint64_t policer_cnt_red; + uint64_t policer_cnt_yellow; + uint64_t policer_cnt_green; + uint64_t policer_cnt_re_red; + uint64_t policer_cnt_re_yellow; + } page_5; struct { uint64_t counter[DPNI_STATISTICS_CNT]; } raw; @@ -602,10 +642,12 @@ union dpni_statistics { * struct - Structure representing DPNI link configuration * @rate: Rate * @options: Mask of available options; use 'DPNI_LINK_OPT_' values + * @advertising: Speeds that are advertised for autoneg (bitmap) */ struct dpni_link_cfg { uint32_t rate; uint64_t options; + uint64_t advertising; }; int dpni_set_link_cfg(struct fsl_mc_io *mc_io, @@ -618,11 +660,17 @@ int dpni_set_link_cfg(struct fsl_mc_io *mc_io, * @rate: Rate * @options: Mask of available options; use 'DPNI_LINK_OPT_' values * @up: Link state; '0' for down, '1' for up + * @state_valid: Ignore/Update the state of the link + * @supported: Speeds capability of the phy (bitmap) + * @advertising: Speeds that are advertised for autoneg (bitmap) */ struct dpni_link_state { uint32_t rate; uint64_t options; int up; + int state_valid; + uint64_t supported; + uint64_t advertising; }; int dpni_get_link_state(struct fsl_mc_io *mc_io, @@ -750,11 +798,20 @@ enum dpni_fs_miss_action { * struct dpni_fs_tbl_cfg - Flow Steering table configuration * @miss_action: Miss action selection * @default_flow_id: Used when 'miss_action = DPNI_FS_MISS_EXPLICIT_FLOWID' + * @keep_hash_key: used only when miss_action is set to DPNI_FS_MISS_HASH. When + * set to one unclassified frames will be distributed according to previous + * used hash key. If set to zero hash key will be replaced with the key + * provided for flow steering. + * @keep_entries: if set to one command will not delete the entries that already + * exist into FS table. Use this option with caution: if the table + * entries are not compatible with the distribution key the packets + * will not be classified properly. */ struct dpni_fs_tbl_cfg { enum dpni_fs_miss_action miss_action; uint16_t default_flow_id; char keep_hash_key; + uint8_t keep_entries; }; /** @@ -915,34 +972,52 @@ int dpni_get_congestion_notification(struct fsl_mc_io *mc_io, /** * struct dpni_queue - Queue structure - * @user_context: User data, presented to the user along with any frames - * from this queue. Not relevant for Tx queues. + * @destination - Destination structure + * @destination.id: ID of the destination, only relevant if DEST_TYPE is > 0. + * Identifies either a DPIO or a DPCON object. + * Not relevant for Tx queues. + * @destination.type: May be one of the following: + * 0 - No destination, queue can be manually + * queried, but will not push traffic or + * notifications to a DPIO; + * 1 - The destination is a DPIO. When traffic + * becomes available in the queue a FQDAN + * (FQ data available notification) will be + * generated to selected DPIO; + * 2 - The destination is a DPCON. The queue is + * associated with a DPCON object for the + * purpose of scheduling between multiple + * queues. The DPCON may be independently + * configured to generate notifications. + * Not relevant for Tx queues. + * @destination.hold_active: Hold active, maintains a queue scheduled for longer + * in a DPIO during dequeue to reduce spread of traffic. + * Only relevant if queues are + * not affined to a single DPIO. + * @user_context: User data, presented to the user along with any frames + * from this queue. Not relevant for Tx queues. + * @flc: FD FLow Context structure + * @flc.value: Default FLC value for traffic dequeued from + * this queue. Please check description of FD + * structure for more information. + * Note that FLC values set using dpni_add_fs_entry, + * if any, take precedence over values per queue. + * @flc.stash_control: Boolean, indicates whether the 6 lowest + * - significant bits are used for stash control. + * significant bits are used for stash control. If set, the 6 + * least significant bits in value are interpreted as follows: + * - bits 0-1: indicates the number of 64 byte units of context + * that are stashed. FLC value is interpreted as a memory address + * in this case, excluding the 6 LS bits. + * - bits 2-3: indicates the number of 64 byte units of frame + * annotation to be stashed. Annotation is placed at FD[ADDR]. + * - bits 4-5: indicates the number of 64 byte units of frame + * data to be stashed. Frame data is placed at FD[ADDR] + + * FD[OFFSET]. + * For more details check the Frame Descriptor section in the + * hardware documentation. */ struct dpni_queue { - /** - * struct destination - Destination structure - * @id: ID of the destination, only relevant if DEST_TYPE is > 0. - * Identifies either a DPIO or a DPCON object. - * Not relevant for Tx queues. - * @type: May be one of the following: - * 0 - No destination, queue can be manually - * queried, but will not push traffic or - * notifications to a DPIO; - * 1 - The destination is a DPIO. When traffic - * becomes available in the queue a FQDAN - * (FQ data available notification) will be - * generated to selected DPIO; - * 2 - The destination is a DPCON. The queue is - * associated with a DPCON object for the - * purpose of scheduling between multiple - * queues. The DPCON may be independently - * configured to generate notifications. - * Not relevant for Tx queues. - * @hold_active: Hold active, maintains a queue scheduled for longer - * in a DPIO during dequeue to reduce spread of traffic. - * Only relevant if queues are - * not affined to a single DPIO. - */ struct { uint16_t id; enum dpni_dest type; @@ -950,28 +1025,6 @@ struct dpni_queue { uint8_t priority; } destination; uint64_t user_context; - /** - * struct flc - FD FLow Context structure - * @value: Default FLC value for traffic dequeued from - * this queue. Please check description of FD - * structure for more information. - * Note that FLC values set using dpni_add_fs_entry, - * if any, take precedence over values per queue. - * @stash_control: Boolean, indicates whether the 6 lowest - * - significant bits are used for stash control. - * significant bits are used for stash control. If set, the 6 - * least significant bits in value are interpreted as follows: - * - bits 0-1: indicates the number of 64 byte units of context - * that are stashed. FLC value is interpreted as a memory address - * in this case, excluding the 6 LS bits. - * - bits 2-3: indicates the number of 64 byte units of frame - * annotation to be stashed. Annotation is placed at FD[ADDR]. - * - bits 4-5: indicates the number of 64 byte units of frame - * data to be stashed. Frame data is placed at FD[ADDR] + - * FD[OFFSET]. - * For more details check the Frame Descriptor section in the - * hardware documentation. - */ struct { uint64_t value; char stash_control; @@ -1132,4 +1185,21 @@ int dpni_get_taildrop(struct fsl_mc_io *mc_io, uint8_t tc, uint8_t q_index, struct dpni_taildrop *taildrop); + +int dpni_set_opr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t tc, + uint8_t index, + uint8_t options, + struct opr_cfg *cfg); + +int dpni_get_opr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t tc, + uint8_t index, + struct opr_cfg *cfg, + struct opr_qry *qry); + #endif /* __FSL_DPNI_H */ diff --git a/drivers/net/dpaa2/mc/fsl_dpni_cmd.h b/drivers/net/dpaa2/mc/fsl_dpni_cmd.h index eb3e99878..3df5bcf1f 100644 --- a/drivers/net/dpaa2/mc/fsl_dpni_cmd.h +++ b/drivers/net/dpaa2/mc/fsl_dpni_cmd.h @@ -9,19 +9,21 @@ /* DPNI Version */ #define DPNI_VER_MAJOR 7 -#define DPNI_VER_MINOR 3 +#define DPNI_VER_MINOR 8 #define DPNI_CMD_BASE_VERSION 1 #define DPNI_CMD_VERSION_2 2 +#define DPNI_CMD_VERSION_3 3 #define DPNI_CMD_ID_OFFSET 4 #define DPNI_CMD(id) (((id) << DPNI_CMD_ID_OFFSET) | DPNI_CMD_BASE_VERSION) #define DPNI_CMD_V2(id) (((id) << DPNI_CMD_ID_OFFSET) | DPNI_CMD_VERSION_2) +#define DPNI_CMD_V3(id) (((id) << DPNI_CMD_ID_OFFSET) | DPNI_CMD_VERSION_3) /* Command IDs */ #define DPNI_CMDID_OPEN DPNI_CMD(0x801) #define DPNI_CMDID_CLOSE DPNI_CMD(0x800) -#define DPNI_CMDID_CREATE DPNI_CMD(0x901) +#define DPNI_CMDID_CREATE DPNI_CMD_V2(0x901) #define DPNI_CMDID_DESTROY DPNI_CMD(0x981) #define DPNI_CMDID_GET_API_VERSION DPNI_CMD(0xa01) @@ -44,10 +46,10 @@ #define DPNI_CMDID_GET_QDID DPNI_CMD(0x210) #define DPNI_CMDID_GET_SP_INFO DPNI_CMD(0x211) #define DPNI_CMDID_GET_TX_DATA_OFFSET DPNI_CMD(0x212) -#define DPNI_CMDID_GET_LINK_STATE DPNI_CMD(0x215) +#define DPNI_CMDID_GET_LINK_STATE DPNI_CMD_V2(0x215) #define DPNI_CMDID_SET_MAX_FRAME_LENGTH DPNI_CMD(0x216) #define DPNI_CMDID_GET_MAX_FRAME_LENGTH DPNI_CMD(0x217) -#define DPNI_CMDID_SET_LINK_CFG DPNI_CMD(0x21A) +#define DPNI_CMDID_SET_LINK_CFG DPNI_CMD_V2(0x21A) #define DPNI_CMDID_SET_TX_SHAPING DPNI_CMD_V2(0x21B) #define DPNI_CMDID_SET_MCAST_PROMISC DPNI_CMD(0x220) @@ -65,7 +67,7 @@ #define DPNI_CMDID_REMOVE_VLAN_ID DPNI_CMD(0x232) #define DPNI_CMDID_CLR_VLAN_FILTERS DPNI_CMD(0x233) -#define DPNI_CMDID_SET_RX_TC_DIST DPNI_CMD_V2(0x235) +#define DPNI_CMDID_SET_RX_TC_DIST DPNI_CMD_V3(0x235) #define DPNI_CMDID_GET_STATISTICS DPNI_CMD_V2(0x25D) #define DPNI_CMDID_RESET_STATISTICS DPNI_CMD(0x25E) @@ -76,8 +78,8 @@ #define DPNI_CMDID_GET_PORT_MAC_ADDR DPNI_CMD(0x263) -#define DPNI_CMDID_GET_BUFFER_LAYOUT DPNI_CMD(0x264) -#define DPNI_CMDID_SET_BUFFER_LAYOUT DPNI_CMD(0x265) +#define DPNI_CMDID_GET_BUFFER_LAYOUT DPNI_CMD_V2(0x264) +#define DPNI_CMDID_SET_BUFFER_LAYOUT DPNI_CMD_V2(0x265) #define DPNI_CMDID_SET_CONGESTION_NOTIFICATION DPNI_CMD(0x267) #define DPNI_CMDID_GET_CONGESTION_NOTIFICATION DPNI_CMD(0x268) @@ -87,6 +89,8 @@ #define DPNI_CMDID_SET_OFFLOAD DPNI_CMD(0x26C) #define DPNI_CMDID_SET_TX_CONFIRMATION_MODE DPNI_CMD(0x266) #define DPNI_CMDID_GET_TX_CONFIRMATION_MODE DPNI_CMD(0x26D) +#define DPNI_CMDID_SET_OPR DPNI_CMD(0x26e) +#define DPNI_CMDID_GET_OPR DPNI_CMD(0x26f) /* Macros for accessing command fields smaller than 1byte */ #define DPNI_MASK(field) \ @@ -113,6 +117,7 @@ struct dpni_cmd_create { uint8_t qos_entries; uint8_t pad3; uint16_t fs_entries; + uint8_t num_rx_tcs; }; struct dpni_cmd_destroy { @@ -228,6 +233,8 @@ struct dpni_cmd_set_errors_behavior { #define DPNI_PASS_PR_SIZE 1 #define DPNI_PASS_FS_SHIFT 2 #define DPNI_PASS_FS_SIZE 1 +#define DPNI_PASS_SWO_SHIFT 3 +#define DPNI_PASS_SWO_SIZE 1 struct dpni_cmd_get_buffer_layout { uint8_t qtype; @@ -307,10 +314,13 @@ struct dpni_cmd_set_link_cfg { uint32_t rate; uint32_t pad1; uint64_t options; + uint64_t advertising; }; #define DPNI_LINK_STATE_SHIFT 0 #define DPNI_LINK_STATE_SIZE 1 +#define DPNI_STATE_VALID_SHIFT 1 +#define DPNI_STATE_VALID_SIZE 1 struct dpni_rsp_get_link_state { uint32_t pad0; @@ -320,6 +330,8 @@ struct dpni_rsp_get_link_state { uint32_t rate; uint32_t pad2; uint64_t options; + uint64_t supported; + uint64_t advertising; }; struct dpni_cmd_set_max_frame_length { @@ -415,6 +427,8 @@ struct dpni_cmd_set_tx_priorities { #define DPNI_MISS_ACTION_SIZE 4 #define DPNI_KEEP_HASH_KEY_SHIFT 7 #define DPNI_KEEP_HASH_KEY_SIZE 1 +#define DPNI_KEEP_ENTRIES_SHIFT 6 +#define DPNI_KEEP_ENTRIES_SIZE 1 struct dpni_cmd_set_rx_tc_dist { uint16_t dist_size; @@ -601,5 +615,64 @@ struct dpni_rsp_get_congestion_notification { uint32_t threshold_exit; }; +struct dpni_cmd_set_opr { + uint8_t pad0; + uint8_t tc_id; + uint8_t index; + uint8_t options; + uint8_t pad1[7]; + uint8_t oloe; + uint8_t oeane; + uint8_t olws; + uint8_t oa; + uint8_t oprrws; +}; + +struct dpni_cmd_get_opr { + uint8_t pad; + uint8_t tc_id; + uint8_t index; +}; + +#define DPNI_RIP_SHIFT 0 +#define DPNI_RIP_SIZE 1 +#define DPNI_OPR_ENABLE_SHIFT 1 +#define DPNI_OPR_ENABLE_SIZE 1 +#define DPNI_TSEQ_NLIS_SHIFT 0 +#define DPNI_TSEQ_NLIS_SIZE 1 +#define DPNI_HSEQ_NLIS_SHIFT 0 +#define DPNI_HSEQ_NLIS_SIZE 1 + +struct dpni_rsp_get_opr { + uint64_t pad0; + /* from LSB: rip:1 enable:1 */ + uint8_t flags; + uint16_t pad1; + uint8_t oloe; + uint8_t oeane; + uint8_t olws; + uint8_t oa; + uint8_t oprrws; + uint16_t nesn; + uint16_t pad8; + uint16_t ndsn; + uint16_t pad2; + uint16_t ea_tseq; + /* only the LSB */ + uint8_t tseq_nlis; + uint8_t pad3; + uint16_t ea_hseq; + /* only the LSB */ + uint8_t hseq_nlis; + uint8_t pad4; + uint16_t ea_hptr; + uint16_t pad5; + uint16_t ea_tptr; + uint16_t pad6; + uint16_t opr_vid; + uint16_t pad7; + uint16_t opr_id; +}; + #pragma pack(pop) #endif /* _FSL_DPNI_CMD_H */ diff --git a/drivers/net/dpaa2/mc/fsl_net.h b/drivers/net/dpaa2/mc/fsl_net.h index 964870ba9..0dc0131bb 100644 --- a/drivers/net/dpaa2/mc/fsl_net.h +++ b/drivers/net/dpaa2/mc/fsl_net.h @@ -180,7 +180,7 @@ #define NH_FLD_SCTP_CHUNK_DATA_STREAM_SQN (NH_FLD_SCTP_CHUNK_DATA_TYPE << 5) #define NH_FLD_SCTP_CHUNK_DATA_PAYLOAD_PID (NH_FLD_SCTP_CHUNK_DATA_TYPE << 6) #define NH_FLD_SCTP_CHUNK_DATA_UNORDERED (NH_FLD_SCTP_CHUNK_DATA_TYPE << 7) -#define NH_FLD_SCTP_CHUNK_DATA_BEGGINNING (NH_FLD_SCTP_CHUNK_DATA_TYPE << 8) +#define NH_FLD_SCTP_CHUNK_DATA_BEGGINING (NH_FLD_SCTP_CHUNK_DATA_TYPE << 8) #define NH_FLD_SCTP_CHUNK_DATA_END (NH_FLD_SCTP_CHUNK_DATA_TYPE << 9) #define NH_FLD_SCTP_CHUNK_DATA_ALL_FIELDS \ ((NH_FLD_SCTP_CHUNK_DATA_TYPE << 10) - 1) From patchwork Fri Oct 12 10:04:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreyansh Jain X-Patchwork-Id: 148737 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp538568lji; Fri, 12 Oct 2018 03:06:32 -0700 (PDT) X-Google-Smtp-Source: ACcGV62bxi5doGL64ORmryE4N0h0eiw14r6B47dRc6VKTvYLmdauBFLUGMbReKN+RNrbve1RKpz2 X-Received: by 2002:a1c:1804:: with SMTP id 4-v6mr4397304wmy.29.1539338791945; Fri, 12 Oct 2018 03:06:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539338791; cv=none; d=google.com; s=arc-20160816; b=BQlLkA48nmet7CJUGVhO8eUpM6y5hwA/hxuCRGw3Uv20MedIomOnLIGln1oDODkcQX mYZsXVlKivFKXfS6RkpAevJBqXKHg9r1Hu0SnYnB+rH1uDVxI4YNUCjkl1pClBoI7nDd dCtFinSXuqmQryWFDK38KbhdtXyeflqhaWuGfkuCXHmeBMMFrptqi4/8UybLPyAsTq17 /3sCJOGMznRnXaBjySn+RTA5jnFsk5TRe6tQYYt0ouuQvezROWarPQwU3yVrahq4gGpT rN7ruVw62pw2kP8WEm6V57X0SyYd1T+uZqfjce7/1/E/sGYjGeZP/VUYSZf6TX4z627b Z5gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:dkim-signature; bh=oikYUy7yV/D/FyN65Hze+pfr/k7EdWSiO8VvQ63u1LE=; b=WLpo/FqIsGPLB0PBqQSAbq2eZjhILWuCLjox3e6D9w9iAwyUfVeEp5kvN/e5i5uPle APy37VeLWaXXnY51RUzz+IS1pq9H/j7eo6S80wcuqqrNvmoiH71YMop9YfokaKtMsOse aLwqvv2U3YA0TEyvUs0ysoCvfOVI9ObPH6fCyEIEpn++wKllqKkEK4EiedzqdvZ/dukh xleiljM47O/VGi1w/XpEa447AfGb9pXD126cupFX5ZqCgaiwiFQJLu43pNrMKgqbjiNY /TYsRm0hk0RV2H/H/uC9teM/EwyKfyar8T+R9DTkXrYK4l7gzcZ+ia8O+sWSjq6MAvAY aZcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=pj3LUA25; 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 35-v6si707446wra.136.2018.10.12.03.06.31; Fri, 12 Oct 2018 03:06:31 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=pj3LUA25; 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 B11C01B49D; Fri, 12 Oct 2018 12:05:55 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00044.outbound.protection.outlook.com [40.107.0.44]) by dpdk.org (Postfix) with ESMTP id C3E861B48B for ; Fri, 12 Oct 2018 12:05:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oikYUy7yV/D/FyN65Hze+pfr/k7EdWSiO8VvQ63u1LE=; b=pj3LUA25MHPO6ty/6SUZR8aOqylsoqSWEEdqRfIkrNb2KPApVT4RCr8iAgrBp0gVbjvGklnbsxVLn2rGS4l5nvqKoewVPIykQ5ECYH26M2vgJ6BzvhHMMtz2QHUuLM/v2bmLODsZwEQP1dK2Yrpa/VTPWRPPaLcvGGMtHvdLMaY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.25; Fri, 12 Oct 2018 10:05:46 +0000 From: Shreyansh Jain To: thomas@monjalon.net Cc: ferruh.yigit@intel.com, dev@dpdk.org, Hemant Agrawal Date: Fri, 12 Oct 2018 15:34:16 +0530 Message-Id: <20181012100426.29349-6-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181012100426.29349-1-shreyansh.jain@nxp.com> References: <20180926180440.31726-1-shreyansh.jain@nxp.com> <20181012100426.29349-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BMXPR01CA0004.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::14) To AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3e155389-e3c5-415f-06e0-08d6302a484a X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB4676; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB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sy+ADSVcXJUpsju30053hQYmF8roc+dvewu44Fpk7tp7eSzp2kWTF9Qk/bgl7WhfyEvws3zEYdadXVqqQWCSBf6IAazRt0KXRM6DFRl/sGqi9+aKA1MOxCs/6YrHC8DIDTTzkED9CPDjOzSk51DYkDWUGuDE8UZRE8/jEIw+oe2R22rCi/mTdzWz8Uz7Humn3VmxjSDmIin7Hy9B0pSRTwXb7vTDfm4xsR8Q+UYQpyVmItp52hsBSyvEfeQkhtSravBaAWVu96IQyTuojvWJAWpkHIGJFrATrAqk5VhGRTUl2ttGSDyzKi+e5NAeGOVeKV94EbX8DtfnBjAD83qc/6Xhd8rpV4v9ENeA9ojAHaK; 4:AUfGsKfKn6ANCBV/M68Zr6bk/R31VQBBAW5zUh3JVYwEUbwhfT2zbNpBh8oKLB0B2UFXxjxAGNiYQzsVL1xINdGZvjGu4xtg/cbT5KdZudjNUl6F6d1FqfOaOy5BXAEWGMRLxfTQDAmHHqik4S7lfzA5oG50aaXtoobZINHcoOTlUNLnCSKR7p5e0FiuwekQYA0nbCsyDiOWHbBWKrJ0Eq03UK8iBYdBQN7TfmRYJMt1+dvGQlF3HdNVKLiMkE9mJXd5wRxnp104A7vsx2RZYw+6akb8HbpI9c6gDix69aohftAuEMZcTH6oNJaN2BsLl+qmZyT9EW7kuMvLGOnRbOEPE1JJTjlgFirMBtK0VzY= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:AM0PR04MB4676; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4676; X-Forefront-PRVS: 0823A5777B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(346002)(366004)(136003)(39860400002)(199004)(189003)(2906002)(52116002)(16526019)(14444005)(53936002)(8676002)(478600001)(186003)(386003)(446003)(105586002)(7736002)(106356001)(6512007)(6116002)(86362001)(3846002)(575784001)(81156014)(50226002)(68736007)(1076002)(47776003)(5660300001)(6506007)(8936002)(78486009)(36756003)(316002)(26005)(66066001)(6666004)(25786009)(55236004)(81166006)(11346002)(48376002)(76176011)(44832011)(2361001)(956004)(51416003)(2616005)(97736004)(1006002)(50466002)(4744004)(486006)(476003)(305945005)(16586007)(6916009)(4326008)(6486002)(2351001)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4676; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR04MB4676; 23:KKQpMV9RG0SG9MXrmaw48Ht/h09PFi/ZcwNiITcSj?= SE2gTSJBB3GQjxT0ys9WJhMfT1SvzR1p3sUgOaz5T66I5omaCdX8Q5wmIperfBaV9whMva35PT5pm5CUTbIz2tIvhtHMCn4nrRn0iZpwxAMmU71LwNhcftbKVyRCT+6bg9XTGwqC8dgcM/EAw0GpjCwOJ1TE3a3dfpDdN3ncbCuhONMgD6j7K5qFpPxbtlxTdvzp0B+Lcxxv7xaL8+XI7wJAs1sFJVuipDqDv0gK2qybwR7aWqsFyaOipdUcBJbFt3r3CHGsFz2F6p2wrTT3F/Jep7mCrZuYIMLvsksd4H0fqdweL+m2IR5kKcM8WpzlecL6ZuRD0FR+CkVfgXre7Kp3bIOoN8PXRvOo9qQHFbIGyDGk/nExpqEyBqDhl4WKfYjy12zm/9DjuFg+eM/RWVgbDx9eLlOfbDHkjh02Jgg42PEr4nNbw3CQV7HzmOsCogN/P+IQFz0iL+JW0wztwW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OGOwwrDHj5E3N80UiPFgpXo1Fdtg19egVBI2QultPimvaVs9mGy6zY/Wcb5Jtb5Ha SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2018 10:05:46.9247 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3e155389-e3c5-415f-06e0-08d6302a484a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4676 Subject: [dpdk-dev] [PATCH v3 05/15] crypto/dpaa2_sec: upgarde mc FW APIs to 10.10.0 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: Hemant Agrawal This also brings in support to configure the queues for order restoration. Signed-off-by: Hemant Agrawal --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 1 + drivers/crypto/dpaa2_sec/mc/dpseci.c | 128 ++++++++++++++++++- drivers/crypto/dpaa2_sec/mc/fsl_dpseci.h | 25 +++- drivers/crypto/dpaa2_sec/mc/fsl_dpseci_cmd.h | 73 ++++++++++- 4 files changed, 218 insertions(+), 9 deletions(-) -- 2.17.1 diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 265a8e41a..ee95c2b7c 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include diff --git a/drivers/crypto/dpaa2_sec/mc/dpseci.c b/drivers/crypto/dpaa2_sec/mc/dpseci.c index de8ca970c..87e0defdc 100644 --- a/drivers/crypto/dpaa2_sec/mc/dpseci.c +++ b/drivers/crypto/dpaa2_sec/mc/dpseci.c @@ -6,6 +6,7 @@ */ #include #include +#include #include #include @@ -116,11 +117,13 @@ int dpseci_create(struct fsl_mc_io *mc_io, cmd_flags, dprc_token); cmd_params = (struct dpseci_cmd_create *)cmd.params; - for (i = 0; i < DPSECI_PRIO_NUM; i++) + for (i = 0; i < 8; i++) cmd_params->priorities[i] = cfg->priorities[i]; + for (i = 0; i < 8; i++) + cmd_params->priorities2[i] = cfg->priorities[8 + i]; cmd_params->num_tx_queues = cfg->num_tx_queues; cmd_params->num_rx_queues = cfg->num_rx_queues; - cmd_params->options = cfg->options; + cmd_params->options = cpu_to_le32(cfg->options); /* send command to mc*/ err = mc_send_command(mc_io, &cmd); @@ -302,7 +305,7 @@ int dpseci_get_attributes(struct fsl_mc_io *mc_io, /* retrieve response parameters */ rsp_params = (struct dpseci_rsp_get_attr *)cmd.params; attr->id = le32_to_cpu(rsp_params->id); - attr->options = rsp_params->options; + attr->options = le32_to_cpu(rsp_params->options); attr->num_tx_queues = rsp_params->num_tx_queues; attr->num_rx_queues = rsp_params->num_rx_queues; @@ -490,6 +493,8 @@ int dpseci_get_sec_attr(struct fsl_mc_io *mc_io, attr->arc4_acc_num = rsp_params->arc4_acc_num; attr->des_acc_num = rsp_params->des_acc_num; attr->aes_acc_num = rsp_params->aes_acc_num; + attr->ccha_acc_num = rsp_params->ccha_acc_num; + attr->ptha_acc_num = rsp_params->ptha_acc_num; return 0; } @@ -569,6 +574,113 @@ int dpseci_get_api_version(struct fsl_mc_io *mc_io, return 0; } +/** + * dpseci_set_opr() - Set Order Restoration configuration. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPSECI object + * @index: The queue index + * @options: Configuration mode options + * can be OPR_OPT_CREATE or OPR_OPT_RETIRE + * @cfg: Configuration options for the OPR + * + * Return: '0' on Success; Error code otherwise. + */ +int dpseci_set_opr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t index, + uint8_t options, + struct opr_cfg *cfg) +{ + struct dpseci_cmd_set_opr *cmd_params; + struct mc_command cmd = { 0 }; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPSECI_CMDID_SET_OPR, + cmd_flags, + token); + cmd_params = (struct dpseci_cmd_set_opr *)cmd.params; + cmd_params->index = index; + cmd_params->options = options; + cmd_params->oloe = cfg->oloe; + cmd_params->oeane = cfg->oeane; + cmd_params->olws = cfg->olws; + cmd_params->oa = cfg->oa; + cmd_params->oprrws = cfg->oprrws; + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +/** + * dpseci_get_opr() - Retrieve Order Restoration config and query. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPSECI object + * @index: The queue index + * @cfg: Returned OPR configuration + * @qry: Returned OPR query + * + * Return: '0' on Success; Error code otherwise. + */ +int dpseci_get_opr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t index, + struct opr_cfg *cfg, + struct opr_qry *qry) +{ + struct dpseci_rsp_get_opr *rsp_params; + struct dpseci_cmd_get_opr *cmd_params; + struct mc_command cmd = { 0 }; + int err; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPSECI_CMDID_GET_OPR, + cmd_flags, + token); + cmd_params = (struct dpseci_cmd_get_opr *)cmd.params; + cmd_params->index = index; + + /* send command to mc*/ + err = mc_send_command(mc_io, &cmd); + if (err) + return err; + + /* retrieve response parameters */ + rsp_params = (struct dpseci_rsp_get_opr *)cmd.params; + cfg->oloe = rsp_params->oloe; + cfg->oeane = rsp_params->oeane; + cfg->olws = rsp_params->olws; + cfg->oa = rsp_params->oa; + cfg->oprrws = rsp_params->oprrws; + qry->rip = dpseci_get_field(rsp_params->flags, RIP); + qry->enable = dpseci_get_field(rsp_params->flags, OPR_ENABLE); + qry->nesn = le16_to_cpu(rsp_params->nesn); + qry->ndsn = le16_to_cpu(rsp_params->ndsn); + qry->ea_tseq = le16_to_cpu(rsp_params->ea_tseq); + qry->tseq_nlis = dpseci_get_field(rsp_params->tseq_nlis, TSEQ_NLIS); + qry->ea_hseq = le16_to_cpu(rsp_params->ea_hseq); + qry->hseq_nlis = dpseci_get_field(rsp_params->hseq_nlis, HSEQ_NLIS); + qry->ea_hptr = le16_to_cpu(rsp_params->ea_hptr); + qry->ea_tptr = le16_to_cpu(rsp_params->ea_tptr); + qry->opr_vid = le16_to_cpu(rsp_params->opr_vid); + qry->opr_id = le16_to_cpu(rsp_params->opr_id); + + return 0; +} + +/** + * dpseci_set_congestion_notification() - Set congestion group + * notification configuration + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPSECI object + * @cfg: congestion notification configuration + * + * Return: '0' on success, error code otherwise + */ int dpseci_set_congestion_notification( struct fsl_mc_io *mc_io, uint32_t cmd_flags, @@ -604,6 +716,16 @@ int dpseci_set_congestion_notification( return mc_send_command(mc_io, &cmd); } +/** + * dpseci_get_congestion_notification() - Get congestion group + * notification configuration + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPSECI object + * @cfg: congestion notification configuration + * + * Return: '0' on success, error code otherwise + */ int dpseci_get_congestion_notification( struct fsl_mc_io *mc_io, uint32_t cmd_flags, diff --git a/drivers/crypto/dpaa2_sec/mc/fsl_dpseci.h b/drivers/crypto/dpaa2_sec/mc/fsl_dpseci.h index 12ac005ad..279e8f4d4 100644 --- a/drivers/crypto/dpaa2_sec/mc/fsl_dpseci.h +++ b/drivers/crypto/dpaa2_sec/mc/fsl_dpseci.h @@ -20,7 +20,7 @@ struct fsl_mc_io; /** * Maximum number of Tx/Rx priorities per DPSECI object */ -#define DPSECI_PRIO_NUM 8 +#define DPSECI_MAX_QUEUE_NUM 16 /** * All queues considered; see dpseci_set_rx_queue() @@ -58,7 +58,7 @@ struct dpseci_cfg { uint32_t options; uint8_t num_tx_queues; uint8_t num_rx_queues; - uint8_t priorities[DPSECI_PRIO_NUM]; + uint8_t priorities[DPSECI_MAX_QUEUE_NUM]; }; int dpseci_create(struct fsl_mc_io *mc_io, @@ -259,6 +259,10 @@ int dpseci_get_tx_queue(struct fsl_mc_io *mc_io, * implemented in this version of SEC. * @aes_acc_num: The number of copies of the AES module that are * implemented in this version of SEC. + * @ccha_acc_num: The number of copies of the ChaCha20 module that are + * implemented in this version of SEC. + * @ptha_acc_num: The number of copies of the Poly1305 module that are + * implemented in this version of SEC. **/ struct dpseci_sec_attr { @@ -279,6 +283,8 @@ struct dpseci_sec_attr { uint8_t arc4_acc_num; uint8_t des_acc_num; uint8_t aes_acc_num; + uint8_t ccha_acc_num; + uint8_t ptha_acc_num; }; int dpseci_get_sec_attr(struct fsl_mc_io *mc_io, @@ -316,6 +322,21 @@ int dpseci_get_api_version(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t *major_ver, uint16_t *minor_ver); + +int dpseci_set_opr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t index, + uint8_t options, + struct opr_cfg *cfg); + +int dpseci_get_opr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t index, + struct opr_cfg *cfg, + struct opr_qry *qry); + /** * enum dpseci_congestion_unit - DPSECI congestion units * @DPSECI_CONGESTION_UNIT_BYTES: bytes units diff --git a/drivers/crypto/dpaa2_sec/mc/fsl_dpseci_cmd.h b/drivers/crypto/dpaa2_sec/mc/fsl_dpseci_cmd.h index 26cef0f73..af3518a0f 100644 --- a/drivers/crypto/dpaa2_sec/mc/fsl_dpseci_cmd.h +++ b/drivers/crypto/dpaa2_sec/mc/fsl_dpseci_cmd.h @@ -9,22 +9,25 @@ /* DPSECI Version */ #define DPSECI_VER_MAJOR 5 -#define DPSECI_VER_MINOR 1 +#define DPSECI_VER_MINOR 3 /* Command versioning */ #define DPSECI_CMD_BASE_VERSION 1 #define DPSECI_CMD_BASE_VERSION_V2 2 +#define DPSECI_CMD_BASE_VERSION_V3 3 #define DPSECI_CMD_ID_OFFSET 4 #define DPSECI_CMD_V1(id) \ ((id << DPSECI_CMD_ID_OFFSET) | DPSECI_CMD_BASE_VERSION) #define DPSECI_CMD_V2(id) \ ((id << DPSECI_CMD_ID_OFFSET) | DPSECI_CMD_BASE_VERSION_V2) +#define DPSECI_CMD_V3(id) \ + ((id << DPSECI_CMD_ID_OFFSET) | DPSECI_CMD_BASE_VERSION_V3) /* Command IDs */ #define DPSECI_CMDID_CLOSE DPSECI_CMD_V1(0x800) #define DPSECI_CMDID_OPEN DPSECI_CMD_V1(0x809) -#define DPSECI_CMDID_CREATE DPSECI_CMD_V2(0x909) +#define DPSECI_CMDID_CREATE DPSECI_CMD_V3(0x909) #define DPSECI_CMDID_DESTROY DPSECI_CMD_V1(0x989) #define DPSECI_CMDID_GET_API_VERSION DPSECI_CMD_V1(0xa09) @@ -37,9 +40,10 @@ #define DPSECI_CMDID_SET_RX_QUEUE DPSECI_CMD_V1(0x194) #define DPSECI_CMDID_GET_RX_QUEUE DPSECI_CMD_V1(0x196) #define DPSECI_CMDID_GET_TX_QUEUE DPSECI_CMD_V1(0x197) -#define DPSECI_CMDID_GET_SEC_ATTR DPSECI_CMD_V1(0x198) +#define DPSECI_CMDID_GET_SEC_ATTR DPSECI_CMD_V2(0x198) #define DPSECI_CMDID_GET_SEC_COUNTERS DPSECI_CMD_V1(0x199) - +#define DPSECI_CMDID_SET_OPR DPSECI_CMD_V1(0x19A) +#define DPSECI_CMDID_GET_OPR DPSECI_CMD_V1(0x19B) #define DPSECI_CMDID_SET_CONGESTION_NOTIFICATION DPSECI_CMD_V1(0x170) #define DPSECI_CMDID_GET_CONGESTION_NOTIFICATION DPSECI_CMD_V1(0x171) @@ -63,6 +67,8 @@ struct dpseci_cmd_create { uint8_t num_rx_queues; uint8_t pad[6]; uint32_t options; + uint32_t pad2; + uint8_t priorities2[8]; }; struct dpseci_cmd_destroy { @@ -152,6 +158,8 @@ struct dpseci_rsp_get_sec_attr { uint8_t arc4_acc_num; uint8_t des_acc_num; uint8_t aes_acc_num; + uint8_t ccha_acc_num; + uint8_t ptha_acc_num; }; struct dpseci_rsp_get_sec_counters { @@ -169,6 +177,63 @@ struct dpseci_rsp_get_api_version { uint16_t minor; }; +struct dpseci_cmd_set_opr { + uint16_t pad0; + uint8_t index; + uint8_t options; + uint8_t pad1[7]; + uint8_t oloe; + uint8_t oeane; + uint8_t olws; + uint8_t oa; + uint8_t oprrws; +}; + +struct dpseci_cmd_get_opr { + uint16_t pad; + uint8_t index; +}; + +#define DPSECI_RIP_SHIFT 0 +#define DPSECI_RIP_SIZE 1 +#define DPSECI_OPR_ENABLE_SHIFT 1 +#define DPSECI_OPR_ENABLE_SIZE 1 +#define DPSECI_TSEQ_NLIS_SHIFT 0 +#define DPSECI_TSEQ_NLIS_SIZE 1 +#define DPSECI_HSEQ_NLIS_SHIFT 0 +#define DPSECI_HSEQ_NLIS_SIZE 1 + +struct dpseci_rsp_get_opr { + uint64_t pad0; + /* from LSB: rip:1 enable:1 */ + uint8_t flags; + uint16_t pad1; + uint8_t oloe; + uint8_t oeane; + uint8_t olws; + uint8_t oa; + uint8_t oprrws; + uint16_t nesn; + uint16_t pad8; + uint16_t ndsn; + uint16_t pad2; + uint16_t ea_tseq; + /* only the LSB */ + uint8_t tseq_nlis; + uint8_t pad3; + uint16_t ea_hseq; + /* only the LSB */ + uint8_t hseq_nlis; + uint8_t pad4; + uint16_t ea_hptr; + uint16_t pad5; + uint16_t ea_tptr; + uint16_t pad6; + uint16_t opr_vid; + uint16_t pad7; + uint16_t opr_id; +}; + #define DPSECI_DEST_TYPE_SHIFT 0 #define DPSECI_DEST_TYPE_SIZE 4 #define DPSECI_CG_UNITS_SHIFT 4 From patchwork Fri Oct 12 10:04:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreyansh Jain X-Patchwork-Id: 148738 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp538742lji; Fri, 12 Oct 2018 03:06:43 -0700 (PDT) X-Google-Smtp-Source: ACcGV60tgZ3dyQ/VFFNlMAu9dXmxF/sFE5XsF0oA/5biZhnR2SqzEfGMJ4EQQM4LxdQ4HJYN3m+e X-Received: by 2002:adf:b188:: with SMTP id q8-v6mr4703281wra.95.1539338803526; Fri, 12 Oct 2018 03:06:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539338803; cv=none; d=google.com; s=arc-20160816; b=ujwkxW1afsX9HIUJKi8Za0T/7L/6U4iRQCxQqMV56WbjqtG1KxCrUCuXF/C2NraAZz iI70ocF+VVQILmAndMHi0kzGE4BgIsP8PhYO3QVfyIq1prV+kgdUeQ0S0LQQCOrvQ/AV ilKs5CIyVKO8ou4VNonVw11OxW0U/HKwfPRvrZqiAbe4UQLYISCVuaS9YDMSWplZXU5Q wPcpz1OtNzw6CmxazyEzkThNQSRaCelCHGB4gGLB9etPTCbHx2aOxy9imYJxRlSoC6kc kaFrXKD4DrB32VQddhLtUaCoOI40ZyR90WeR4a8ql+paeNsUmseg5x0QMHZMmGdBr5PX 0+vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:dkim-signature; bh=fTZRD4+9djlCsRR0A6oL9cdo8TPAalnxkq70Eg9KXjY=; b=EdP2nERs18XfhVw208eZwTdDglDtorJVG6Nvuo8WS6xw8hql/uJ3PLH90E/opSOPxr yvOThZEvIxvjcZd2lFtJ3/8Bjc4LJlad7rJGwqKYDmpVg6HsWUBi2FEUaZ+QH5TmXBnu qHgVHYC6nRr5zNOCk0T89QhwVzi6uJECtZx10BxvlvBBA8Wr53c+AiJeOcUAwUr506pY q1oTwGOC+zPQ7MFtEeX8i/xjW51WMiBu5RAGnxF51DaUrLfOJ6A8Tz1qazbg8cTX1oHY Vqmql/hRN2Xoc9forxmW8MJotsnnmI6GTLqnsML5P67XPMGN44PeU5JA4bke33dxBLnU Jvow== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=PwrKvgjq; 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 h2-v6si814220wmg.55.2018.10.12.03.06.43; Fri, 12 Oct 2018 03:06:43 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=PwrKvgjq; 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 E0C971B4AB; Fri, 12 Oct 2018 12:05:58 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0076.outbound.protection.outlook.com [104.47.0.76]) by dpdk.org (Postfix) with ESMTP id 5C5DF1B492 for ; Fri, 12 Oct 2018 12:05:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fTZRD4+9djlCsRR0A6oL9cdo8TPAalnxkq70Eg9KXjY=; b=PwrKvgjq+42Zd4Who90epJa6QftyUGA6T+571NwSef7ozGnzoizxThS0gTkhND4B9W6Y8+ZJ831d89G4v8VkHt1TNROI42U9hToV5RvFQOyu08tKQ66tK5Z8AGATTYTiaMIfEYuBMtL4hAK14JTbmc9rnzfDvOTAVWxVBVDCyHU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.25; Fri, 12 Oct 2018 10:05:48 +0000 From: Shreyansh Jain To: thomas@monjalon.net Cc: ferruh.yigit@intel.com, dev@dpdk.org, Nipun Gupta , Youri Querry , Roy Pledge Date: Fri, 12 Oct 2018 15:34:17 +0530 Message-Id: <20181012100426.29349-7-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181012100426.29349-1-shreyansh.jain@nxp.com> References: <20180926180440.31726-1-shreyansh.jain@nxp.com> <20181012100426.29349-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BMXPR01CA0004.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::14) To AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: eb7215de-d6df-47ba-e40d-08d6302a4946 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB4676; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4676; 3:tkOZp0yCfvZjiECCWP+X2MRkbZoJgy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VcIczkwfxw3c5ILqLiLfRxAxHj9To0SYXF3tqmC9LXZeLfQ8ET/tJ3VPChu3Ck9GGCNRRzRIVgbNxr2NWym1u4QXrHS/RB/JKz4VIxuvxPO6yLwkcOP/lJovuw6+6JugjLgdlYFZp59YcIENsN90AKuMSuuTbyipjhG5he9mp6qWES+IsU6KSEG2HF/K5TrT70qk+QUFsImYOkNEXwHG/6+MQTiyPyxy9b/orI2XcYYAPTQCvTKU7Is4SJGk6G2/G10GEXoF6RHsJvWSYdhzqqG3n0nWwtEqyaMXWBDk6cCvIrjx2DwF39OSSxWY; 4:GY9rsEvlW5gpIPm48BLNz6IT0B2CX3P6xXlUHb6H0xbsyDl5C4d68LQr5Wkm1smyPNJvF1IJDY522EgdYTysBiFRcd9OpDVH01iazvytlqw8j4IZDWwKFEw+BxtvfAfdSxGZjPk+4gveNypqI+MQQh/0jhjHvTw6MlBC04qBj0pBG4qdVlep+/KcHCnjOB7vUkNsgt8IvNYKOXJb+GlOfQyVVmkpyAS4cbaMNUD3vxhlCtNiljyIdPNkOvFp5PYHnAsLBY9yu7ydpV79XmliOZoSoI2y0YvQV/5PIvuYUH9PwYIk02wjqbJaI2G3HDk8LIZbUa0XhVXsS3bvD2el06eGj6jA1Eq4/WSRdPhv3mxobPt6OFVOhCgjoNbdRvJo X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(227817650892897)(185117386973197)(275809806118684); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:AM0PR04MB4676; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4676; X-Forefront-PRVS: 0823A5777B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(346002)(366004)(136003)(39860400002)(199004)(189003)(2906002)(52116002)(16526019)(14444005)(53936002)(8676002)(478600001)(186003)(386003)(446003)(105586002)(7736002)(106356001)(6512007)(6116002)(86362001)(3846002)(575784001)(81156014)(50226002)(68736007)(1076002)(47776003)(5660300001)(6506007)(8936002)(78486009)(36756003)(316002)(26005)(66066001)(53946003)(6666004)(25786009)(55236004)(16200700003)(81166006)(11346002)(48376002)(76176011)(44832011)(2361001)(956004)(51416003)(2616005)(97736004)(1006002)(50466002)(4744004)(486006)(476003)(305945005)(16586007)(6916009)(4326008)(6486002)(54906003)(2351001)(110426005)(579004)(559001)(569006); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4676; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR04MB4676; 23:Q7D8iDD9/rH7fd4+l0KHt93iRX82Gb9rCI12uKTYf?= 8CD5sVVqJ3Vz4HwXy9+4ZGFk9eGKBDyE8YuGTY0yZ2kexJdokItjrPijsBDLgwYE5EOzlToLdWD049kzDjQMz5ImpixdV6sM7mFn2/NJVu20TdKsL+CqxDlg8cDcg+RjrzLnW9AJq6RQk0B98j9VilFyS/7DoGcCgem5d51BFvDZ0lfUdkmrQ2lTinYIBeW8bknepPXspAnejNHCh9aZfe4kSmpUpCTwCxhoEkJJqR4YybbvwHgqb4DnWXubEm4wUvFLey6KZFLTnBjS/dNOWFLku9rY7xz03YMBRr0pckH9kB8uEmi3NC6Val9436QHeQ/FEQR7eUlvAk3p8o6q0Eeru6r7Dj+EDgnGELzmEjWH/tc64b+3YCf2ph8rde7OWCaVK5LKG5A/wyuf5zl2FBMwNXIYRQIT1x/5txrDdMrSIX+WyMJxiaHeiLzeinapKsj0a8uD7lKWGIBoFBtl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eLJhvGoiHrR9bcIO51r5KzIzg3pMTc4F9N21i4UYmIY6YnIv0pV8azSwL21zSGx9rEGh3XgAbnBN5a5CRurjfcyhgQ03acn9+5J+vomg3GrlojpoNUDvC2SutIhqMeFd4D7Dz6kHC0tHAKkppmP5xlj6xIRZOnfjVSzVw1j4gnIHgMda2MYGlItNa/Ubl+KnUSnCj SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2018 10:05:48.2527 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eb7215de-d6df-47ba-e40d-08d6302a4946 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4676 Subject: [dpdk-dev] [PATCH v3 06/15] bus/fslmc: support memory backed portals with QBMAN 5.0 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 This new mode is available in LX2160 platform. The code dynamically detect the underlying qbman version and choose the mode at runtime. Signed-off-by: Youri Querry Signed-off-by: Roy Pledge Signed-off-by: Nipun Gupta --- drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 180 ++--- drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 4 + drivers/bus/fslmc/qbman/include/compat.h | 3 +- .../fslmc/qbman/include/fsl_qbman_portal.h | 33 +- drivers/bus/fslmc/qbman/qbman_portal.c | 764 +++++++++++++++--- drivers/bus/fslmc/qbman/qbman_portal.h | 30 +- drivers/bus/fslmc/qbman/qbman_sys.h | 100 ++- drivers/bus/fslmc/qbman/qbman_sys_decl.h | 4 + 8 files changed, 868 insertions(+), 250 deletions(-) -- 2.17.1 diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c index 99f70be1c..76f80b951 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved. - * Copyright 2016 NXP + * Copyright 2016-2018 NXP * */ #include @@ -177,68 +177,6 @@ static int dpaa2_dpio_intr_init(struct dpaa2_dpio_dev *dpio_dev) } #endif -static int -configure_dpio_qbman_swp(struct dpaa2_dpio_dev *dpio_dev) -{ - struct qbman_swp_desc p_des; - struct dpio_attr attr; - - dpio_dev->dpio = malloc(sizeof(struct fsl_mc_io)); - if (!dpio_dev->dpio) { - DPAA2_BUS_ERR("Memory allocation failure"); - return -1; - } - - dpio_dev->dpio->regs = dpio_dev->mc_portal; - if (dpio_open(dpio_dev->dpio, CMD_PRI_LOW, dpio_dev->hw_id, - &dpio_dev->token)) { - DPAA2_BUS_ERR("Failed to allocate IO space"); - free(dpio_dev->dpio); - return -1; - } - - if (dpio_reset(dpio_dev->dpio, CMD_PRI_LOW, dpio_dev->token)) { - DPAA2_BUS_ERR("Failed to reset dpio"); - dpio_close(dpio_dev->dpio, CMD_PRI_LOW, dpio_dev->token); - free(dpio_dev->dpio); - return -1; - } - - if (dpio_enable(dpio_dev->dpio, CMD_PRI_LOW, dpio_dev->token)) { - DPAA2_BUS_ERR("Failed to Enable dpio"); - dpio_close(dpio_dev->dpio, CMD_PRI_LOW, dpio_dev->token); - free(dpio_dev->dpio); - return -1; - } - - if (dpio_get_attributes(dpio_dev->dpio, CMD_PRI_LOW, - dpio_dev->token, &attr)) { - DPAA2_BUS_ERR("DPIO Get attribute failed"); - dpio_disable(dpio_dev->dpio, CMD_PRI_LOW, dpio_dev->token); - dpio_close(dpio_dev->dpio, CMD_PRI_LOW, dpio_dev->token); - free(dpio_dev->dpio); - return -1; - } - - /* Configure & setup SW portal */ - p_des.block = NULL; - p_des.idx = attr.qbman_portal_id; - p_des.cena_bar = (void *)(dpio_dev->qbman_portal_ce_paddr); - p_des.cinh_bar = (void *)(dpio_dev->qbman_portal_ci_paddr); - p_des.irq = -1; - p_des.qman_version = attr.qbman_version; - - dpio_dev->sw_portal = qbman_swp_init(&p_des); - if (dpio_dev->sw_portal == NULL) { - DPAA2_BUS_ERR("QBMan SW Portal Init failed"); - dpio_close(dpio_dev->dpio, CMD_PRI_LOW, dpio_dev->token); - free(dpio_dev->dpio); - return -1; - } - - return 0; -} - static int dpaa2_configure_stashing(struct dpaa2_dpio_dev *dpio_dev, int cpu_id) { @@ -402,15 +340,17 @@ dpaa2_create_dpio_device(int vdev_fd, struct vfio_device_info *obj_info, int object_id) { - struct dpaa2_dpio_dev *dpio_dev; + struct dpaa2_dpio_dev *dpio_dev = NULL; struct vfio_region_info reg_info = { .argsz = sizeof(reg_info)}; + struct qbman_swp_desc p_des; + struct dpio_attr attr; if (obj_info->num_regions < NUM_DPIO_REGIONS) { DPAA2_BUS_ERR("Not sufficient number of DPIO regions"); return -1; } - dpio_dev = rte_malloc(NULL, sizeof(struct dpaa2_dpio_dev), + dpio_dev = rte_zmalloc(NULL, sizeof(struct dpaa2_dpio_dev), RTE_CACHE_LINE_SIZE); if (!dpio_dev) { DPAA2_BUS_ERR("Memory allocation failed for DPIO Device"); @@ -423,45 +363,33 @@ dpaa2_create_dpio_device(int vdev_fd, /* Using single portal for all devices */ dpio_dev->mc_portal = rte_mcp_ptr_list[MC_PORTAL_INDEX]; - reg_info.index = 0; - if (ioctl(vdev_fd, VFIO_DEVICE_GET_REGION_INFO, ®_info)) { - DPAA2_BUS_ERR("vfio: error getting region info"); - rte_free(dpio_dev); - return -1; + dpio_dev->dpio = malloc(sizeof(struct fsl_mc_io)); + if (!dpio_dev->dpio) { + DPAA2_BUS_ERR("Memory allocation failure"); + goto err; } - dpio_dev->ce_size = reg_info.size; - dpio_dev->qbman_portal_ce_paddr = (size_t)mmap(NULL, reg_info.size, - PROT_WRITE | PROT_READ, MAP_SHARED, - vdev_fd, reg_info.offset); - - reg_info.index = 1; - if (ioctl(vdev_fd, VFIO_DEVICE_GET_REGION_INFO, ®_info)) { - DPAA2_BUS_ERR("vfio: error getting region info"); - rte_free(dpio_dev); - return -1; + dpio_dev->dpio->regs = dpio_dev->mc_portal; + if (dpio_open(dpio_dev->dpio, CMD_PRI_LOW, dpio_dev->hw_id, + &dpio_dev->token)) { + DPAA2_BUS_ERR("Failed to allocate IO space"); + goto err; } - dpio_dev->ci_size = reg_info.size; - dpio_dev->qbman_portal_ci_paddr = (size_t)mmap(NULL, reg_info.size, - PROT_WRITE | PROT_READ, MAP_SHARED, - vdev_fd, reg_info.offset); - - if (configure_dpio_qbman_swp(dpio_dev)) { - DPAA2_BUS_ERR( - "Fail to configure the dpio qbman portal for %d", - dpio_dev->hw_id); - rte_free(dpio_dev); - return -1; + if (dpio_reset(dpio_dev->dpio, CMD_PRI_LOW, dpio_dev->token)) { + DPAA2_BUS_ERR("Failed to reset dpio"); + goto err; } - io_space_count++; - dpio_dev->index = io_space_count; + if (dpio_enable(dpio_dev->dpio, CMD_PRI_LOW, dpio_dev->token)) { + DPAA2_BUS_ERR("Failed to Enable dpio"); + goto err; + } - if (rte_dpaa2_vfio_setup_intr(&dpio_dev->intr_handle, vdev_fd, 1)) { - DPAA2_BUS_ERR("Fail to setup interrupt for %d", - dpio_dev->hw_id); - rte_free(dpio_dev); + if (dpio_get_attributes(dpio_dev->dpio, CMD_PRI_LOW, + dpio_dev->token, &attr)) { + DPAA2_BUS_ERR("DPIO Get attribute failed"); + goto err; } /* find the SoC type for the first time */ @@ -483,9 +411,67 @@ dpaa2_create_dpio_device(int vdev_fd, dpaa2_svr_family = (mc_plat_info.svr & 0xffff0000); } + if (dpaa2_svr_family == SVR_LX2160A) + reg_info.index = DPAA2_SWP_CENA_MEM_REGION; + else + reg_info.index = DPAA2_SWP_CENA_REGION; + + if (ioctl(vdev_fd, VFIO_DEVICE_GET_REGION_INFO, ®_info)) { + DPAA2_BUS_ERR("vfio: error getting region info"); + goto err; + } + + dpio_dev->ce_size = reg_info.size; + dpio_dev->qbman_portal_ce_paddr = (size_t)mmap(NULL, reg_info.size, + PROT_WRITE | PROT_READ, MAP_SHARED, + vdev_fd, reg_info.offset); + + reg_info.index = DPAA2_SWP_CINH_REGION; + if (ioctl(vdev_fd, VFIO_DEVICE_GET_REGION_INFO, ®_info)) { + DPAA2_BUS_ERR("vfio: error getting region info"); + goto err; + } + + dpio_dev->ci_size = reg_info.size; + dpio_dev->qbman_portal_ci_paddr = (size_t)mmap(NULL, reg_info.size, + PROT_WRITE | PROT_READ, MAP_SHARED, + vdev_fd, reg_info.offset); + + /* Configure & setup SW portal */ + p_des.block = NULL; + p_des.idx = attr.qbman_portal_id; + p_des.cena_bar = (void *)(dpio_dev->qbman_portal_ce_paddr); + p_des.cinh_bar = (void *)(dpio_dev->qbman_portal_ci_paddr); + p_des.irq = -1; + p_des.qman_version = attr.qbman_version; + + dpio_dev->sw_portal = qbman_swp_init(&p_des); + if (dpio_dev->sw_portal == NULL) { + DPAA2_BUS_ERR("QBMan SW Portal Init failed"); + goto err; + } + + io_space_count++; + dpio_dev->index = io_space_count; + + if (rte_dpaa2_vfio_setup_intr(&dpio_dev->intr_handle, vdev_fd, 1)) { + DPAA2_BUS_ERR("Fail to setup interrupt for %d", + dpio_dev->hw_id); + goto err; + } + TAILQ_INSERT_TAIL(&dpio_dev_list, dpio_dev, next); return 0; + +err: + if (dpio_dev->dpio) { + dpio_disable(dpio_dev->dpio, CMD_PRI_LOW, dpio_dev->token); + dpio_close(dpio_dev->dpio, CMD_PRI_LOW, dpio_dev->token); + free(dpio_dev->dpio); + } + rte_free(dpio_dev); + return -1; } void diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h index 820759360..f2eebe65d 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h @@ -37,6 +37,10 @@ #define DPAA2_DQRR_RING_SIZE 16 /** > 16) >> 16)) - #define __iomem #define __raw_readb(p) (*(const volatile unsigned char *)(p)) #define __raw_readl(p) (*(const volatile unsigned int *)(p)) #define __raw_writel(v, p) {*(volatile unsigned int *)(p) = (v); } +#define dma_wmb() rte_smp_mb() + #define atomic_t rte_atomic32_t #define atomic_read(v) rte_atomic32_read(v) #define atomic_set(v, i) rte_atomic32_set(v, i) diff --git a/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h b/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h index 3e63db3ab..10c72e048 100644 --- a/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h +++ b/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h @@ -42,6 +42,15 @@ struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d); */ void qbman_swp_finish(struct qbman_swp *p); +/** + * qbman_swp_invalidate() - Invalidate the cache enabled area of the QBMan + * portal. This is required to be called if a portal moved to another core + * because the QBMan portal area is non coherent + * @p: the qbman_swp object to be invalidated + * + */ +void qbman_swp_invalidate(struct qbman_swp *p); + /** * qbman_swp_get_desc() - Get the descriptor of the given portal object. * @p: the given portal object. @@ -172,7 +181,7 @@ void qbman_swp_interrupt_set_inhibit(struct qbman_swp *p, int inhibit); /** * struct qbman_result - structure for qbman dequeue response and/or * notification. - * @donot_manipulate_directly: the 16 32bit data to represent the whole + * @dont_manipulate_directly: the 16 32bit data to represent the whole * possible qbman dequeue result. */ struct qbman_result { @@ -262,7 +271,7 @@ void qbman_swp_push_set(struct qbman_swp *s, uint8_t channel_idx, int enable); */ struct qbman_pull_desc { union { - uint32_t donot_manipulate_directly[16]; + uint32_t dont_manipulate_directly[16]; struct pull { uint8_t verb; uint8_t numf; @@ -355,6 +364,14 @@ void qbman_pull_desc_set_wq(struct qbman_pull_desc *d, uint32_t wqid, void qbman_pull_desc_set_channel(struct qbman_pull_desc *d, uint32_t chid, enum qbman_pull_type_e dct); +/** + * qbman_pull_desc_set_rad() - Decide whether reschedule the fq after dequeue + * + * @rad: 1 = Reschedule the FQ after dequeue. + * 0 = Allow the FQ to remain active after dequeue. + */ +void qbman_pull_desc_set_rad(struct qbman_pull_desc *d, int rad); + /** * qbman_swp_pull() - Issue the pull dequeue command * @s: the software portal object. @@ -775,7 +792,7 @@ uint64_t qbman_result_cgcu_icnt(const struct qbman_result *scn); /* struct qbman_eq_desc - structure of enqueue descriptor */ struct qbman_eq_desc { union { - uint32_t donot_manipulate_directly[8]; + uint32_t dont_manipulate_directly[8]; struct eq { uint8_t verb; uint8_t dca; @@ -796,11 +813,11 @@ struct qbman_eq_desc { /** * struct qbman_eq_response - structure of enqueue response - * @donot_manipulate_directly: the 16 32bit data to represent the whole + * @dont_manipulate_directly: the 16 32bit data to represent the whole * enqueue response. */ struct qbman_eq_response { - uint32_t donot_manipulate_directly[16]; + uint32_t dont_manipulate_directly[16]; }; /** @@ -958,6 +975,7 @@ int qbman_swp_enqueue(struct qbman_swp *s, const struct qbman_eq_desc *d, * @s: the software portal used for enqueue. * @d: the enqueue descriptor. * @fd: the frame descriptor to be enqueued. + * @flags: bit-mask of QBMAN_ENQUEUE_FLAG_*** options * @num_frames: the number of the frames to be enqueued. * * Return the number of enqueued frames, -EBUSY if the EQCR is not ready. @@ -973,7 +991,6 @@ int qbman_swp_enqueue_multiple(struct qbman_swp *s, * @s: the software portal used for enqueue. * @d: the enqueue descriptor. * @fd: the frame descriptor to be enqueued. - * @flags: bit-mask of QBMAN_ENQUEUE_FLAG_*** options * @num_frames: the number of the frames to be enqueued. * * Return the number of enqueued frames, -EBUSY if the EQCR is not ready. @@ -998,12 +1015,12 @@ int qbman_swp_enqueue_thresh(struct qbman_swp *s, unsigned int thresh); /*******************/ /** * struct qbman_release_desc - The structure for buffer release descriptor - * @donot_manipulate_directly: the 32bit data to represent the whole + * @dont_manipulate_directly: the 32bit data to represent the whole * possible settings of qbman release descriptor. */ struct qbman_release_desc { union { - uint32_t donot_manipulate_directly[16]; + uint32_t dont_manipulate_directly[16]; struct br { uint8_t verb; uint8_t reserved; diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c b/drivers/bus/fslmc/qbman/qbman_portal.c index 071450052..3380e54f5 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.c +++ b/drivers/bus/fslmc/qbman/qbman_portal.c @@ -1,39 +1,17 @@ /* SPDX-License-Identifier: BSD-3-Clause * * Copyright (C) 2014-2016 Freescale Semiconductor, Inc. + * Copyright 2018 NXP * */ +#include "qbman_sys.h" #include "qbman_portal.h" /* QBMan portal management command codes */ #define QBMAN_MC_ACQUIRE 0x30 #define QBMAN_WQCHAN_CONFIGURE 0x46 -/* CINH register offsets */ -#define QBMAN_CINH_SWP_EQCR_PI 0x800 -#define QBMAN_CINH_SWP_EQCR_CI 0x840 -#define QBMAN_CINH_SWP_EQAR 0x8c0 -#define QBMAN_CINH_SWP_DQPI 0xa00 -#define QBMAN_CINH_SWP_DCAP 0xac0 -#define QBMAN_CINH_SWP_SDQCR 0xb00 -#define QBMAN_CINH_SWP_RAR 0xcc0 -#define QBMAN_CINH_SWP_ISR 0xe00 -#define QBMAN_CINH_SWP_IER 0xe40 -#define QBMAN_CINH_SWP_ISDR 0xe80 -#define QBMAN_CINH_SWP_IIR 0xec0 -#define QBMAN_CINH_SWP_DQRR_ITR 0xa80 -#define QBMAN_CINH_SWP_ITPR 0xf40 - -/* CENA register offsets */ -#define QBMAN_CENA_SWP_EQCR(n) (0x000 + ((uint32_t)(n) << 6)) -#define QBMAN_CENA_SWP_DQRR(n) (0x200 + ((uint32_t)(n) << 6)) -#define QBMAN_CENA_SWP_RCR(n) (0x400 + ((uint32_t)(n) << 6)) -#define QBMAN_CENA_SWP_CR 0x600 -#define QBMAN_CENA_SWP_RR(vb) (0x700 + ((uint32_t)(vb) >> 1)) -#define QBMAN_CENA_SWP_VDQCR 0x780 -#define QBMAN_CENA_SWP_EQCR_CI 0x840 - /* Reverse mapping of QBMAN_CENA_SWP_DQRR() */ #define QBMAN_IDX_FROM_DQRR(p) (((unsigned long)p & 0x1ff) >> 6) @@ -83,6 +61,102 @@ enum qbman_sdqcr_fc { #define MAX_QBMAN_PORTALS 64 static struct qbman_swp *portal_idx_map[MAX_QBMAN_PORTALS]; +/* Internal Function declaration */ +static int +qbman_swp_enqueue_array_mode_direct(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd); +static int +qbman_swp_enqueue_array_mode_mem_back(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd); + +static int +qbman_swp_enqueue_ring_mode_direct(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd); +static int +qbman_swp_enqueue_ring_mode_mem_back(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd); + +static int +qbman_swp_enqueue_multiple_direct(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd, + uint32_t *flags, + int num_frames); +static int +qbman_swp_enqueue_multiple_mem_back(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd, + uint32_t *flags, + int num_frames); + +static int +qbman_swp_enqueue_multiple_desc_direct(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd, + int num_frames); +static int +qbman_swp_enqueue_multiple_desc_mem_back(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd, + int num_frames); + +static int +qbman_swp_pull_direct(struct qbman_swp *s, struct qbman_pull_desc *d); +static int +qbman_swp_pull_mem_back(struct qbman_swp *s, struct qbman_pull_desc *d); + +const struct qbman_result *qbman_swp_dqrr_next_direct(struct qbman_swp *s); +const struct qbman_result *qbman_swp_dqrr_next_mem_back(struct qbman_swp *s); + +static int +qbman_swp_release_direct(struct qbman_swp *s, + const struct qbman_release_desc *d, + const uint64_t *buffers, unsigned int num_buffers); +static int +qbman_swp_release_mem_back(struct qbman_swp *s, + const struct qbman_release_desc *d, + const uint64_t *buffers, unsigned int num_buffers); + +/* Function pointers */ +static int (*qbman_swp_enqueue_array_mode_ptr)(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd) + = qbman_swp_enqueue_array_mode_direct; + +static int (*qbman_swp_enqueue_ring_mode_ptr)(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd) + = qbman_swp_enqueue_ring_mode_direct; + +static int (*qbman_swp_enqueue_multiple_ptr)(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd, + uint32_t *flags, + int num_frames) + = qbman_swp_enqueue_multiple_direct; + +static int (*qbman_swp_enqueue_multiple_desc_ptr)(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd, + int num_frames) + = qbman_swp_enqueue_multiple_desc_direct; + +static int (*qbman_swp_pull_ptr)(struct qbman_swp *s, + struct qbman_pull_desc *d) + = qbman_swp_pull_direct; + +const struct qbman_result *(*qbman_swp_dqrr_next_ptr)(struct qbman_swp *s) + = qbman_swp_dqrr_next_direct; + +static int (*qbman_swp_release_ptr)(struct qbman_swp *s, + const struct qbman_release_desc *d, + const uint64_t *buffers, unsigned int num_buffers) + = qbman_swp_release_direct; + /*********************************/ /* Portal constructor/destructor */ /*********************************/ @@ -104,25 +178,30 @@ struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d) { int ret; uint32_t eqcr_pi; + uint32_t mask_size; struct qbman_swp *p = malloc(sizeof(*p)); if (!p) return NULL; + + memset(p, 0, sizeof(struct qbman_swp)); + p->desc = *d; #ifdef QBMAN_CHECKING p->mc.check = swp_mc_can_start; #endif p->mc.valid_bit = QB_VALID_BIT; - p->sdq = 0; p->sdq |= qbman_sdqcr_dct_prio_ics << QB_SDQCR_DCT_SHIFT; p->sdq |= qbman_sdqcr_fc_up_to_3 << QB_SDQCR_FC_SHIFT; p->sdq |= QMAN_SDQCR_TOKEN << QB_SDQCR_TOK_SHIFT; + if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000) + p->mr.valid_bit = QB_VALID_BIT; atomic_set(&p->vdq.busy, 1); p->vdq.valid_bit = QB_VALID_BIT; - p->dqrr.next_idx = 0; p->dqrr.valid_bit = QB_VALID_BIT; - if ((p->desc.qman_version & 0xFFFF0000) < QMAN_REV_4100) { + qman_version = p->desc.qman_version; + if ((qman_version & 0xFFFF0000) < QMAN_REV_4100) { p->dqrr.dqrr_size = 4; p->dqrr.reset_bug = 1; } else { @@ -136,18 +215,54 @@ struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d) pr_err("qbman_swp_sys_init() failed %d\n", ret); return NULL; } + + /* Verify that the DQRRPI is 0 - if it is not the portal isn't + * in default state which is an error + */ + if (qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_DQPI) & 0xF) { + pr_err("qbman DQRR PI is not zero, portal is not clean\n"); + free(p); + return NULL; + } + /* SDQCR needs to be initialized to 0 when no channels are * being dequeued from or else the QMan HW will indicate an * error. The values that were calculated above will be * applied when dequeues from a specific channel are enabled. */ qbman_cinh_write(&p->sys, QBMAN_CINH_SWP_SDQCR, 0); + + p->eqcr.pi_ring_size = 8; + if ((qman_version & 0xFFFF0000) >= QMAN_REV_5000) { + p->eqcr.pi_ring_size = 32; + qbman_swp_enqueue_array_mode_ptr = + qbman_swp_enqueue_array_mode_mem_back; + qbman_swp_enqueue_ring_mode_ptr = + qbman_swp_enqueue_ring_mode_mem_back; + qbman_swp_enqueue_multiple_ptr = + qbman_swp_enqueue_multiple_mem_back; + qbman_swp_enqueue_multiple_desc_ptr = + qbman_swp_enqueue_multiple_desc_mem_back; + qbman_swp_pull_ptr = qbman_swp_pull_mem_back; + qbman_swp_dqrr_next_ptr = qbman_swp_dqrr_next_mem_back; + qbman_swp_release_ptr = qbman_swp_release_mem_back; + } + + for (mask_size = p->eqcr.pi_ring_size; mask_size > 0; mask_size >>= 1) + p->eqcr.pi_mask = (p->eqcr.pi_mask<<1) + 1; eqcr_pi = qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_EQCR_PI); - p->eqcr.pi = eqcr_pi & 0xF; + p->eqcr.pi = eqcr_pi & p->eqcr.pi_mask; p->eqcr.pi_vb = eqcr_pi & QB_VALID_BIT; - p->eqcr.ci = qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_EQCR_CI) & 0xF; - p->eqcr.available = QBMAN_EQCR_SIZE - qm_cyc_diff(QBMAN_EQCR_SIZE, - p->eqcr.ci, p->eqcr.pi); + if ((p->desc.qman_version & QMAN_REV_MASK) < QMAN_REV_5000) + p->eqcr.ci = qbman_cinh_read(&p->sys, + QBMAN_CINH_SWP_EQCR_CI) & p->eqcr.pi_mask; + else + p->eqcr.ci = qbman_cinh_read(&p->sys, + QBMAN_CINH_SWP_EQCR_PI) & p->eqcr.pi_mask; + p->eqcr.available = p->eqcr.pi_ring_size - + qm_cyc_diff(p->eqcr.pi_ring_size, + p->eqcr.ci & (p->eqcr.pi_mask<<1), + p->eqcr.pi & (p->eqcr.pi_mask<<1)); portal_idx_map[p->desc.idx] = p; return p; @@ -229,7 +344,8 @@ int qbman_swp_interrupt_get_inhibit(struct qbman_swp *p) void qbman_swp_interrupt_set_inhibit(struct qbman_swp *p, int inhibit) { - qbman_cinh_write(&p->sys, QBMAN_CINH_SWP_IIR, inhibit ? 0xffffffff : 0); + qbman_cinh_write(&p->sys, QBMAN_CINH_SWP_IIR, + inhibit ? 0xffffffff : 0); } /***********************/ @@ -246,7 +362,10 @@ void *qbman_swp_mc_start(struct qbman_swp *p) #ifdef QBMAN_CHECKING QBMAN_BUG_ON(p->mc.check != swp_mc_can_start); #endif - ret = qbman_cena_write_start(&p->sys, QBMAN_CENA_SWP_CR); + if ((p->desc.qman_version & QMAN_REV_MASK) < QMAN_REV_5000) + ret = qbman_cena_write_start(&p->sys, QBMAN_CENA_SWP_CR); + else + ret = qbman_cena_write_start(&p->sys, QBMAN_CENA_SWP_CR_MEM); #ifdef QBMAN_CHECKING if (!ret) p->mc.check = swp_mc_can_submit; @@ -266,8 +385,17 @@ void qbman_swp_mc_submit(struct qbman_swp *p, void *cmd, uint8_t cmd_verb) * caller wants to OR but has forgotten to do so. */ QBMAN_BUG_ON((*v & cmd_verb) != *v); - *v = cmd_verb | p->mc.valid_bit; - qbman_cena_write_complete(&p->sys, QBMAN_CENA_SWP_CR, cmd); + if ((p->desc.qman_version & QMAN_REV_MASK) < QMAN_REV_5000) { + dma_wmb(); + *v = cmd_verb | p->mc.valid_bit; + qbman_cena_write_complete(&p->sys, QBMAN_CENA_SWP_CR, cmd); + clean(cmd); + } else { + *v = cmd_verb | p->mr.valid_bit; + qbman_cena_write_complete(&p->sys, QBMAN_CENA_SWP_CR_MEM, cmd); + dma_wmb(); + qbman_cinh_write(&p->sys, QBMAN_CINH_SWP_CR_RT, QMAN_RT_MODE); + } #ifdef QBMAN_CHECKING p->mc.check = swp_mc_can_poll; #endif @@ -279,17 +407,34 @@ void *qbman_swp_mc_result(struct qbman_swp *p) #ifdef QBMAN_CHECKING QBMAN_BUG_ON(p->mc.check != swp_mc_can_poll); #endif - qbman_cena_invalidate_prefetch(&p->sys, - QBMAN_CENA_SWP_RR(p->mc.valid_bit)); - ret = qbman_cena_read(&p->sys, QBMAN_CENA_SWP_RR(p->mc.valid_bit)); - /* Remove the valid-bit - command completed if the rest is non-zero */ - verb = ret[0] & ~QB_VALID_BIT; - if (!verb) - return NULL; + if ((p->desc.qman_version & QMAN_REV_MASK) < QMAN_REV_5000) { + qbman_cena_invalidate_prefetch(&p->sys, + QBMAN_CENA_SWP_RR(p->mc.valid_bit)); + ret = qbman_cena_read(&p->sys, + QBMAN_CENA_SWP_RR(p->mc.valid_bit)); + /* Remove the valid-bit - + * command completed iff the rest is non-zero + */ + verb = ret[0] & ~QB_VALID_BIT; + if (!verb) + return NULL; + p->mc.valid_bit ^= QB_VALID_BIT; + } else { + ret = qbman_cena_read(&p->sys, QBMAN_CENA_SWP_RR_MEM); + /* Command completed if the valid bit is toggled */ + if (p->mr.valid_bit != (ret[0] & QB_VALID_BIT)) + return NULL; + /* Remove the valid-bit - + * command completed iff the rest is non-zero + */ + verb = ret[0] & ~QB_VALID_BIT; + if (!verb) + return NULL; + p->mr.valid_bit ^= QB_VALID_BIT; + } #ifdef QBMAN_CHECKING p->mc.check = swp_mc_can_start; #endif - p->mc.valid_bit ^= QB_VALID_BIT; return ret; } @@ -417,13 +562,26 @@ void qbman_eq_desc_set_dca(struct qbman_eq_desc *d, int enable, } } -#define EQAR_IDX(eqar) ((eqar) & 0x7) +#define EQAR_IDX(eqar) ((eqar) & 0x1f) #define EQAR_VB(eqar) ((eqar) & 0x80) #define EQAR_SUCCESS(eqar) ((eqar) & 0x100) -static int qbman_swp_enqueue_array_mode(struct qbman_swp *s, - const struct qbman_eq_desc *d, - const struct qbman_fd *fd) +static inline void qbman_write_eqcr_am_rt_register(struct qbman_swp *p, + uint8_t idx) +{ + if (idx < 16) + qbman_cinh_write(&p->sys, QBMAN_CINH_SWP_EQCR_AM_RT + idx * 4, + QMAN_RT_MODE); + else + qbman_cinh_write(&p->sys, QBMAN_CINH_SWP_EQCR_AM_RT2 + + (idx - 16) * 4, + QMAN_RT_MODE); +} + + +static int qbman_swp_enqueue_array_mode_direct(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd) { uint32_t *p; const uint32_t *cl = qb_cl(d); @@ -433,39 +591,69 @@ static int qbman_swp_enqueue_array_mode(struct qbman_swp *s, if (!EQAR_SUCCESS(eqar)) return -EBUSY; p = qbman_cena_write_start_wo_shadow(&s->sys, - QBMAN_CENA_SWP_EQCR(EQAR_IDX(eqar))); + QBMAN_CENA_SWP_EQCR(EQAR_IDX(eqar))); memcpy(&p[1], &cl[1], 28); memcpy(&p[8], fd, sizeof(*fd)); + /* Set the verb byte, have to substitute in the valid-bit */ - lwsync(); + dma_wmb(); p[0] = cl[0] | EQAR_VB(eqar); qbman_cena_write_complete_wo_shadow(&s->sys, - QBMAN_CENA_SWP_EQCR(EQAR_IDX(eqar))); + QBMAN_CENA_SWP_EQCR(EQAR_IDX(eqar))); return 0; } +static int qbman_swp_enqueue_array_mode_mem_back(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd) +{ + uint32_t *p; + const uint32_t *cl = qb_cl(d); + uint32_t eqar = qbman_cinh_read(&s->sys, QBMAN_CINH_SWP_EQAR); -static int qbman_swp_enqueue_ring_mode(struct qbman_swp *s, - const struct qbman_eq_desc *d, - const struct qbman_fd *fd) + pr_debug("EQAR=%08x\n", eqar); + if (!EQAR_SUCCESS(eqar)) + return -EBUSY; + p = qbman_cena_write_start_wo_shadow(&s->sys, + QBMAN_CENA_SWP_EQCR(EQAR_IDX(eqar))); + memcpy(&p[1], &cl[1], 28); + memcpy(&p[8], fd, sizeof(*fd)); + + /* Set the verb byte, have to substitute in the valid-bit */ + p[0] = cl[0] | EQAR_VB(eqar); + dma_wmb(); + qbman_write_eqcr_am_rt_register(s, EQAR_IDX(eqar)); + return 0; +} + +static inline int qbman_swp_enqueue_array_mode(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd) +{ + return qbman_swp_enqueue_array_mode_ptr(s, d, fd); +} + +static int qbman_swp_enqueue_ring_mode_direct(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd) { uint32_t *p; const uint32_t *cl = qb_cl(d); - uint32_t eqcr_ci; - uint8_t diff; + uint32_t eqcr_ci, full_mask, half_mask; + half_mask = (s->eqcr.pi_mask>>1); + full_mask = s->eqcr.pi_mask; if (!s->eqcr.available) { eqcr_ci = s->eqcr.ci; s->eqcr.ci = qbman_cena_read_reg(&s->sys, - QBMAN_CENA_SWP_EQCR_CI) & 0xF; - diff = qm_cyc_diff(QBMAN_EQCR_SIZE, - eqcr_ci, s->eqcr.ci); - s->eqcr.available += diff; - if (!diff) + QBMAN_CENA_SWP_EQCR_CI) & full_mask; + s->eqcr.available = qm_cyc_diff(s->eqcr.pi_ring_size, + eqcr_ci, s->eqcr.ci); + if (!s->eqcr.available) return -EBUSY; } p = qbman_cena_write_start_wo_shadow(&s->sys, - QBMAN_CENA_SWP_EQCR(s->eqcr.pi & 7)); + QBMAN_CENA_SWP_EQCR(s->eqcr.pi & half_mask)); memcpy(&p[1], &cl[1], 28); memcpy(&p[8], fd, sizeof(*fd)); lwsync(); @@ -473,16 +661,61 @@ static int qbman_swp_enqueue_ring_mode(struct qbman_swp *s, /* Set the verb byte, have to substitute in the valid-bit */ p[0] = cl[0] | s->eqcr.pi_vb; qbman_cena_write_complete_wo_shadow(&s->sys, - QBMAN_CENA_SWP_EQCR(s->eqcr.pi & 7)); + QBMAN_CENA_SWP_EQCR(s->eqcr.pi & half_mask)); s->eqcr.pi++; - s->eqcr.pi &= 0xF; + s->eqcr.pi &= full_mask; s->eqcr.available--; - if (!(s->eqcr.pi & 7)) + if (!(s->eqcr.pi & half_mask)) s->eqcr.pi_vb ^= QB_VALID_BIT; return 0; } +static int qbman_swp_enqueue_ring_mode_mem_back(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd) +{ + uint32_t *p; + const uint32_t *cl = qb_cl(d); + uint32_t eqcr_ci, full_mask, half_mask; + + half_mask = (s->eqcr.pi_mask>>1); + full_mask = s->eqcr.pi_mask; + if (!s->eqcr.available) { + eqcr_ci = s->eqcr.ci; + s->eqcr.ci = qbman_cinh_read(&s->sys, + QBMAN_CENA_SWP_EQCR_CI) & full_mask; + s->eqcr.available = qm_cyc_diff(s->eqcr.pi_ring_size, + eqcr_ci, s->eqcr.ci); + if (!s->eqcr.available) + return -EBUSY; + } + + p = qbman_cena_write_start_wo_shadow(&s->sys, + QBMAN_CENA_SWP_EQCR(s->eqcr.pi & half_mask)); + memcpy(&p[1], &cl[1], 28); + memcpy(&p[8], fd, sizeof(*fd)); + + /* Set the verb byte, have to substitute in the valid-bit */ + p[0] = cl[0] | s->eqcr.pi_vb; + s->eqcr.pi++; + s->eqcr.pi &= full_mask; + s->eqcr.available--; + if (!(s->eqcr.pi & half_mask)) + s->eqcr.pi_vb ^= QB_VALID_BIT; + dma_wmb(); + qbman_cinh_write(&s->sys, QBMAN_CINH_SWP_EQCR_PI, + (QB_RT_BIT)|(s->eqcr.pi)|s->eqcr.pi_vb); + return 0; +} + +static int qbman_swp_enqueue_ring_mode(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd) +{ + return qbman_swp_enqueue_ring_mode_ptr(s, d, fd); +} + int qbman_swp_enqueue(struct qbman_swp *s, const struct qbman_eq_desc *d, const struct qbman_fd *fd) { @@ -492,27 +725,27 @@ int qbman_swp_enqueue(struct qbman_swp *s, const struct qbman_eq_desc *d, return qbman_swp_enqueue_ring_mode(s, d, fd); } -int qbman_swp_enqueue_multiple(struct qbman_swp *s, - const struct qbman_eq_desc *d, - const struct qbman_fd *fd, - uint32_t *flags, - int num_frames) +static int qbman_swp_enqueue_multiple_direct(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd, + uint32_t *flags, + int num_frames) { - uint32_t *p; + uint32_t *p = NULL; const uint32_t *cl = qb_cl(d); - uint32_t eqcr_ci, eqcr_pi; - uint8_t diff; + uint32_t eqcr_ci, eqcr_pi, half_mask, full_mask; int i, num_enqueued = 0; uint64_t addr_cena; + half_mask = (s->eqcr.pi_mask>>1); + full_mask = s->eqcr.pi_mask; if (!s->eqcr.available) { eqcr_ci = s->eqcr.ci; s->eqcr.ci = qbman_cena_read_reg(&s->sys, - QBMAN_CENA_SWP_EQCR_CI) & 0xF; - diff = qm_cyc_diff(QBMAN_EQCR_SIZE, - eqcr_ci, s->eqcr.ci); - s->eqcr.available += diff; - if (!diff) + QBMAN_CENA_SWP_EQCR_CI) & full_mask; + s->eqcr.available = qm_cyc_diff(s->eqcr.pi_ring_size, + eqcr_ci, s->eqcr.ci); + if (!s->eqcr.available) return 0; } @@ -523,11 +756,10 @@ int qbman_swp_enqueue_multiple(struct qbman_swp *s, /* Fill in the EQCR ring */ for (i = 0; i < num_enqueued; i++) { p = qbman_cena_write_start_wo_shadow(&s->sys, - QBMAN_CENA_SWP_EQCR(eqcr_pi & 7)); + QBMAN_CENA_SWP_EQCR(eqcr_pi & half_mask)); memcpy(&p[1], &cl[1], 28); memcpy(&p[8], &fd[i], sizeof(*fd)); eqcr_pi++; - eqcr_pi &= 0xF; } lwsync(); @@ -536,7 +768,7 @@ int qbman_swp_enqueue_multiple(struct qbman_swp *s, eqcr_pi = s->eqcr.pi; for (i = 0; i < num_enqueued; i++) { p = qbman_cena_write_start_wo_shadow(&s->sys, - QBMAN_CENA_SWP_EQCR(eqcr_pi & 7)); + QBMAN_CENA_SWP_EQCR(eqcr_pi & half_mask)); p[0] = cl[0] | s->eqcr.pi_vb; if (flags && (flags[i] & QBMAN_ENQUEUE_FLAG_DCA)) { struct qbman_eq_desc *d = (struct qbman_eq_desc *)p; @@ -545,8 +777,7 @@ int qbman_swp_enqueue_multiple(struct qbman_swp *s, ((flags[i]) & QBMAN_EQCR_DCA_IDXMASK); } eqcr_pi++; - eqcr_pi &= 0xF; - if (!(eqcr_pi & 7)) + if (!(eqcr_pi & half_mask)) s->eqcr.pi_vb ^= QB_VALID_BIT; } @@ -554,35 +785,104 @@ int qbman_swp_enqueue_multiple(struct qbman_swp *s, eqcr_pi = s->eqcr.pi; addr_cena = (size_t)s->sys.addr_cena; for (i = 0; i < num_enqueued; i++) { - dcbf((addr_cena + QBMAN_CENA_SWP_EQCR(eqcr_pi & 7))); + dcbf((uintptr_t)(addr_cena + + QBMAN_CENA_SWP_EQCR(eqcr_pi & half_mask))); eqcr_pi++; - eqcr_pi &= 0xF; } - s->eqcr.pi = eqcr_pi; + s->eqcr.pi = eqcr_pi & full_mask; return num_enqueued; } -int qbman_swp_enqueue_multiple_desc(struct qbman_swp *s, - const struct qbman_eq_desc *d, - const struct qbman_fd *fd, - int num_frames) +static int qbman_swp_enqueue_multiple_mem_back(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd, + uint32_t *flags, + int num_frames) +{ + uint32_t *p = NULL; + const uint32_t *cl = qb_cl(d); + uint32_t eqcr_ci, eqcr_pi, half_mask, full_mask; + int i, num_enqueued = 0; + + half_mask = (s->eqcr.pi_mask>>1); + full_mask = s->eqcr.pi_mask; + if (!s->eqcr.available) { + eqcr_ci = s->eqcr.ci; + s->eqcr.ci = qbman_cinh_read(&s->sys, + QBMAN_CENA_SWP_EQCR_CI) & full_mask; + s->eqcr.available = qm_cyc_diff(s->eqcr.pi_ring_size, + eqcr_ci, s->eqcr.ci); + if (!s->eqcr.available) + return 0; + } + + eqcr_pi = s->eqcr.pi; + num_enqueued = (s->eqcr.available < num_frames) ? + s->eqcr.available : num_frames; + s->eqcr.available -= num_enqueued; + /* Fill in the EQCR ring */ + for (i = 0; i < num_enqueued; i++) { + p = qbman_cena_write_start_wo_shadow(&s->sys, + QBMAN_CENA_SWP_EQCR(eqcr_pi & half_mask)); + memcpy(&p[1], &cl[1], 28); + memcpy(&p[8], &fd[i], sizeof(*fd)); + eqcr_pi++; + } + + /* Set the verb byte, have to substitute in the valid-bit */ + eqcr_pi = s->eqcr.pi; + for (i = 0; i < num_enqueued; i++) { + p = qbman_cena_write_start_wo_shadow(&s->sys, + QBMAN_CENA_SWP_EQCR(eqcr_pi & half_mask)); + p[0] = cl[0] | s->eqcr.pi_vb; + if (flags && (flags[i] & QBMAN_ENQUEUE_FLAG_DCA)) { + struct qbman_eq_desc *d = (struct qbman_eq_desc *)p; + + d->eq.dca = (1 << QB_ENQUEUE_CMD_DCA_EN_SHIFT) | + ((flags[i]) & QBMAN_EQCR_DCA_IDXMASK); + } + eqcr_pi++; + if (!(eqcr_pi & half_mask)) + s->eqcr.pi_vb ^= QB_VALID_BIT; + } + s->eqcr.pi = eqcr_pi & full_mask; + + dma_wmb(); + qbman_cinh_write(&s->sys, QBMAN_CINH_SWP_EQCR_PI, + (QB_RT_BIT)|(s->eqcr.pi)|s->eqcr.pi_vb); + return num_enqueued; +} + +inline int qbman_swp_enqueue_multiple(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd, + uint32_t *flags, + int num_frames) +{ + return qbman_swp_enqueue_multiple_ptr(s, d, fd, flags, num_frames); +} + +static int qbman_swp_enqueue_multiple_desc_direct(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd, + int num_frames) { uint32_t *p; const uint32_t *cl; - uint32_t eqcr_ci, eqcr_pi; - uint8_t diff; + uint32_t eqcr_ci, eqcr_pi, half_mask, full_mask; int i, num_enqueued = 0; uint64_t addr_cena; + half_mask = (s->eqcr.pi_mask>>1); + full_mask = s->eqcr.pi_mask; if (!s->eqcr.available) { eqcr_ci = s->eqcr.ci; s->eqcr.ci = qbman_cena_read_reg(&s->sys, - QBMAN_CENA_SWP_EQCR_CI) & 0xF; - diff = qm_cyc_diff(QBMAN_EQCR_SIZE, - eqcr_ci, s->eqcr.ci); - s->eqcr.available += diff; - if (!diff) + QBMAN_CENA_SWP_EQCR_CI) & full_mask; + s->eqcr.available = qm_cyc_diff(s->eqcr.pi_ring_size, + eqcr_ci, s->eqcr.ci); + if (!s->eqcr.available) return 0; } @@ -593,12 +893,11 @@ int qbman_swp_enqueue_multiple_desc(struct qbman_swp *s, /* Fill in the EQCR ring */ for (i = 0; i < num_enqueued; i++) { p = qbman_cena_write_start_wo_shadow(&s->sys, - QBMAN_CENA_SWP_EQCR(eqcr_pi & 7)); + QBMAN_CENA_SWP_EQCR(eqcr_pi & half_mask)); cl = qb_cl(&d[i]); memcpy(&p[1], &cl[1], 28); memcpy(&p[8], &fd[i], sizeof(*fd)); eqcr_pi++; - eqcr_pi &= 0xF; } lwsync(); @@ -607,12 +906,11 @@ int qbman_swp_enqueue_multiple_desc(struct qbman_swp *s, eqcr_pi = s->eqcr.pi; for (i = 0; i < num_enqueued; i++) { p = qbman_cena_write_start_wo_shadow(&s->sys, - QBMAN_CENA_SWP_EQCR(eqcr_pi & 7)); + QBMAN_CENA_SWP_EQCR(eqcr_pi & half_mask)); cl = qb_cl(&d[i]); p[0] = cl[0] | s->eqcr.pi_vb; eqcr_pi++; - eqcr_pi &= 0xF; - if (!(eqcr_pi & 7)) + if (!(eqcr_pi & half_mask)) s->eqcr.pi_vb ^= QB_VALID_BIT; } @@ -620,14 +918,78 @@ int qbman_swp_enqueue_multiple_desc(struct qbman_swp *s, eqcr_pi = s->eqcr.pi; addr_cena = (size_t)s->sys.addr_cena; for (i = 0; i < num_enqueued; i++) { - dcbf((addr_cena + QBMAN_CENA_SWP_EQCR(eqcr_pi & 7))); + dcbf((uintptr_t)(addr_cena + + QBMAN_CENA_SWP_EQCR(eqcr_pi & half_mask))); + eqcr_pi++; + } + s->eqcr.pi = eqcr_pi & full_mask; + + return num_enqueued; +} + +static int qbman_swp_enqueue_multiple_desc_mem_back(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd, + int num_frames) +{ + uint32_t *p; + const uint32_t *cl; + uint32_t eqcr_ci, eqcr_pi, half_mask, full_mask; + int i, num_enqueued = 0; + + half_mask = (s->eqcr.pi_mask>>1); + full_mask = s->eqcr.pi_mask; + if (!s->eqcr.available) { + eqcr_ci = s->eqcr.ci; + s->eqcr.ci = qbman_cinh_read(&s->sys, + QBMAN_CENA_SWP_EQCR_CI) & full_mask; + s->eqcr.available = qm_cyc_diff(s->eqcr.pi_ring_size, + eqcr_ci, s->eqcr.ci); + if (!s->eqcr.available) + return 0; + } + + eqcr_pi = s->eqcr.pi; + num_enqueued = (s->eqcr.available < num_frames) ? + s->eqcr.available : num_frames; + s->eqcr.available -= num_enqueued; + /* Fill in the EQCR ring */ + for (i = 0; i < num_enqueued; i++) { + p = qbman_cena_write_start_wo_shadow(&s->sys, + QBMAN_CENA_SWP_EQCR(eqcr_pi & half_mask)); + cl = qb_cl(&d[i]); + memcpy(&p[1], &cl[1], 28); + memcpy(&p[8], &fd[i], sizeof(*fd)); + eqcr_pi++; + } + + /* Set the verb byte, have to substitute in the valid-bit */ + eqcr_pi = s->eqcr.pi; + for (i = 0; i < num_enqueued; i++) { + p = qbman_cena_write_start_wo_shadow(&s->sys, + QBMAN_CENA_SWP_EQCR(eqcr_pi & half_mask)); + cl = qb_cl(&d[i]); + p[0] = cl[0] | s->eqcr.pi_vb; eqcr_pi++; - eqcr_pi &= 0xF; + if (!(eqcr_pi & half_mask)) + s->eqcr.pi_vb ^= QB_VALID_BIT; } - s->eqcr.pi = eqcr_pi; + + s->eqcr.pi = eqcr_pi & full_mask; + + dma_wmb(); + qbman_cinh_write(&s->sys, QBMAN_CINH_SWP_EQCR_PI, + (QB_RT_BIT)|(s->eqcr.pi)|s->eqcr.pi_vb); return num_enqueued; } +inline int qbman_swp_enqueue_multiple_desc(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd, + int num_frames) +{ + return qbman_swp_enqueue_multiple_desc_ptr(s, d, fd, num_frames); +} /*************************/ /* Static (push) dequeue */ @@ -670,6 +1032,7 @@ void qbman_swp_push_set(struct qbman_swp *s, uint8_t channel_idx, int enable) #define QB_VDQCR_VERB_DT_SHIFT 2 #define QB_VDQCR_VERB_RLS_SHIFT 4 #define QB_VDQCR_VERB_WAE_SHIFT 5 +#define QB_VDQCR_VERB_RAD_SHIFT 6 enum qb_pull_dt_e { qb_pull_dt_channel, @@ -702,7 +1065,8 @@ void qbman_pull_desc_set_storage(struct qbman_pull_desc *d, d->pull.rsp_addr = storage_phys; } -void qbman_pull_desc_set_numframes(struct qbman_pull_desc *d, uint8_t numframes) +void qbman_pull_desc_set_numframes(struct qbman_pull_desc *d, + uint8_t numframes) { d->pull.numf = numframes - 1; } @@ -735,7 +1099,20 @@ void qbman_pull_desc_set_channel(struct qbman_pull_desc *d, uint32_t chid, d->pull.dq_src = chid; } -int qbman_swp_pull(struct qbman_swp *s, struct qbman_pull_desc *d) +void qbman_pull_desc_set_rad(struct qbman_pull_desc *d, int rad) +{ + if (d->pull.verb & (1 << QB_VDQCR_VERB_RLS_SHIFT)) { + if (rad) + d->pull.verb |= 1 << QB_VDQCR_VERB_RAD_SHIFT; + else + d->pull.verb &= ~(1 << QB_VDQCR_VERB_RAD_SHIFT); + } else { + printf("The RAD feature is not valid when RLS = 0\n"); + } +} + +static int qbman_swp_pull_direct(struct qbman_swp *s, + struct qbman_pull_desc *d) { uint32_t *p; uint32_t *cl = qb_cl(d); @@ -759,6 +1136,36 @@ int qbman_swp_pull(struct qbman_swp *s, struct qbman_pull_desc *d) return 0; } +static int qbman_swp_pull_mem_back(struct qbman_swp *s, + struct qbman_pull_desc *d) +{ + uint32_t *p; + uint32_t *cl = qb_cl(d); + + if (!atomic_dec_and_test(&s->vdq.busy)) { + atomic_inc(&s->vdq.busy); + return -EBUSY; + } + + d->pull.tok = s->sys.idx + 1; + s->vdq.storage = (void *)(size_t)d->pull.rsp_addr_virt; + p = qbman_cena_write_start_wo_shadow(&s->sys, QBMAN_CENA_SWP_VDQCR_MEM); + memcpy(&p[1], &cl[1], 12); + + /* Set the verb byte, have to substitute in the valid-bit */ + p[0] = cl[0] | s->vdq.valid_bit; + s->vdq.valid_bit ^= QB_VALID_BIT; + dma_wmb(); + qbman_cinh_write(&s->sys, QBMAN_CINH_SWP_VDQCR_RT, QMAN_RT_MODE); + + return 0; +} + +inline int qbman_swp_pull(struct qbman_swp *s, struct qbman_pull_desc *d) +{ + return qbman_swp_pull_ptr(s, d); +} + /****************/ /* Polling DQRR */ /****************/ @@ -791,7 +1198,12 @@ void qbman_swp_prefetch_dqrr_next(struct qbman_swp *s) * only once, so repeated calls can return a sequence of DQRR entries, without * requiring they be consumed immediately or in any particular order. */ -const struct qbman_result *qbman_swp_dqrr_next(struct qbman_swp *s) +inline const struct qbman_result *qbman_swp_dqrr_next(struct qbman_swp *s) +{ + return qbman_swp_dqrr_next_ptr(s); +} + +const struct qbman_result *qbman_swp_dqrr_next_direct(struct qbman_swp *s) { uint32_t verb; uint32_t response_verb; @@ -801,7 +1213,7 @@ const struct qbman_result *qbman_swp_dqrr_next(struct qbman_swp *s) /* Before using valid-bit to detect if something is there, we have to * handle the case of the DQRR reset bug... */ - if (unlikely(s->dqrr.reset_bug)) { + if (s->dqrr.reset_bug) { /* We pick up new entries by cache-inhibited producer index, * which means that a non-coherent mapping would require us to * invalidate and read *only* once that PI has indicated that @@ -833,7 +1245,8 @@ const struct qbman_result *qbman_swp_dqrr_next(struct qbman_swp *s) QBMAN_CENA_SWP_DQRR(s->dqrr.next_idx)); } p = qbman_cena_read_wo_shadow(&s->sys, - QBMAN_CENA_SWP_DQRR(s->dqrr.next_idx)); + QBMAN_CENA_SWP_DQRR(s->dqrr.next_idx)); + verb = p->dq.verb; /* If the valid-bit isn't of the expected polarity, nothing there. Note, @@ -867,11 +1280,54 @@ const struct qbman_result *qbman_swp_dqrr_next(struct qbman_swp *s) return p; } +const struct qbman_result *qbman_swp_dqrr_next_mem_back(struct qbman_swp *s) +{ + uint32_t verb; + uint32_t response_verb; + uint32_t flags; + const struct qbman_result *p; + + p = qbman_cena_read_wo_shadow(&s->sys, + QBMAN_CENA_SWP_DQRR_MEM(s->dqrr.next_idx)); + + verb = p->dq.verb; + + /* If the valid-bit isn't of the expected polarity, nothing there. Note, + * in the DQRR reset bug workaround, we shouldn't need to skip these + * check, because we've already determined that a new entry is available + * and we've invalidated the cacheline before reading it, so the + * valid-bit behaviour is repaired and should tell us what we already + * knew from reading PI. + */ + if ((verb & QB_VALID_BIT) != s->dqrr.valid_bit) + return NULL; + + /* There's something there. Move "next_idx" attention to the next ring + * entry (and prefetch it) before returning what we found. + */ + s->dqrr.next_idx++; + if (s->dqrr.next_idx == s->dqrr.dqrr_size) { + s->dqrr.next_idx = 0; + s->dqrr.valid_bit ^= QB_VALID_BIT; + } + /* If this is the final response to a volatile dequeue command + * indicate that the vdq is no longer busy + */ + flags = p->dq.stat; + response_verb = verb & QBMAN_RESPONSE_VERB_MASK; + if ((response_verb == QBMAN_RESULT_DQ) && + (flags & QBMAN_DQ_STAT_VOLATILE) && + (flags & QBMAN_DQ_STAT_EXPIRED)) + atomic_inc(&s->vdq.busy); + return p; +} + /* Consume DQRR entries previously returned from qbman_swp_dqrr_next(). */ void qbman_swp_dqrr_consume(struct qbman_swp *s, const struct qbman_result *dq) { - qbman_cinh_write(&s->sys, QBMAN_CINH_SWP_DCAP, QBMAN_IDX_FROM_DQRR(dq)); + qbman_cinh_write(&s->sys, + QBMAN_CINH_SWP_DCAP, QBMAN_IDX_FROM_DQRR(dq)); } /* Consume DQRR entries previously returned from qbman_swp_dqrr_next(). */ @@ -884,6 +1340,7 @@ void qbman_swp_dqrr_idx_consume(struct qbman_swp *s, /*********************************/ /* Polling user-provided storage */ /*********************************/ + int qbman_result_has_new_result(struct qbman_swp *s, struct qbman_result *dq) { @@ -898,11 +1355,11 @@ int qbman_result_has_new_result(struct qbman_swp *s, ((struct qbman_result *)dq)->dq.tok = 0; /* - * VDQCR "no longer busy" hook - not quite the same as DQRR, because the - * fact "VDQCR" shows busy doesn't mean that we hold the result that - * makes it available. Eg. we may be looking at our 10th dequeue result, - * having released VDQCR after the 1st result and it is now busy due to - * some other command! + * VDQCR "no longer busy" hook - not quite the same as DQRR, because + * the fact "VDQCR" shows busy doesn't mean that we hold the result + * that makes it available. Eg. we may be looking at our 10th dequeue + * result, having released VDQCR after the 1st result and it is now + * busy due to some other command! */ if (s->vdq.storage == dq) { s->vdq.storage = NULL; @@ -936,11 +1393,11 @@ int qbman_check_command_complete(struct qbman_result *dq) s = portal_idx_map[dq->dq.tok - 1]; /* - * VDQCR "no longer busy" hook - not quite the same as DQRR, because the - * fact "VDQCR" shows busy doesn't mean that we hold the result that - * makes it available. Eg. we may be looking at our 10th dequeue result, - * having released VDQCR after the 1st result and it is now busy due to - * some other command! + * VDQCR "no longer busy" hook - not quite the same as DQRR, because + * the fact "VDQCR" shows busy doesn't mean that we hold the result + * that makes it available. Eg. we may be looking at our 10th dequeue + * result, having released VDQCR after the 1st result and it is now + * busy due to some other command! */ if (s->vdq.storage == dq) { s->vdq.storage = NULL; @@ -1142,8 +1599,10 @@ void qbman_release_desc_set_rcdi(struct qbman_release_desc *d, int enable) #define RAR_VB(rar) ((rar) & 0x80) #define RAR_SUCCESS(rar) ((rar) & 0x100) -int qbman_swp_release(struct qbman_swp *s, const struct qbman_release_desc *d, - const uint64_t *buffers, unsigned int num_buffers) +static int qbman_swp_release_direct(struct qbman_swp *s, + const struct qbman_release_desc *d, + const uint64_t *buffers, + unsigned int num_buffers) { uint32_t *p; const uint32_t *cl = qb_cl(d); @@ -1157,22 +1616,63 @@ int qbman_swp_release(struct qbman_swp *s, const struct qbman_release_desc *d, /* Start the release command */ p = qbman_cena_write_start_wo_shadow(&s->sys, - QBMAN_CENA_SWP_RCR(RAR_IDX(rar))); + QBMAN_CENA_SWP_RCR(RAR_IDX(rar))); /* Copy the caller's buffer pointers to the command */ u64_to_le32_copy(&p[2], buffers, num_buffers); - /* Set the verb byte, have to substitute in the valid-bit and the number - * of buffers. + /* Set the verb byte, have to substitute in the valid-bit and the + * number of buffers. */ lwsync(); p[0] = cl[0] | RAR_VB(rar) | num_buffers; qbman_cena_write_complete_wo_shadow(&s->sys, - QBMAN_CENA_SWP_RCR(RAR_IDX(rar))); + QBMAN_CENA_SWP_RCR(RAR_IDX(rar))); return 0; } +static int qbman_swp_release_mem_back(struct qbman_swp *s, + const struct qbman_release_desc *d, + const uint64_t *buffers, + unsigned int num_buffers) +{ + uint32_t *p; + const uint32_t *cl = qb_cl(d); + uint32_t rar = qbman_cinh_read(&s->sys, QBMAN_CINH_SWP_RAR); + + pr_debug("RAR=%08x\n", rar); + if (!RAR_SUCCESS(rar)) + return -EBUSY; + + QBMAN_BUG_ON(!num_buffers || (num_buffers > 7)); + + /* Start the release command */ + p = qbman_cena_write_start_wo_shadow(&s->sys, + QBMAN_CENA_SWP_RCR_MEM(RAR_IDX(rar))); + + /* Copy the caller's buffer pointers to the command */ + u64_to_le32_copy(&p[2], buffers, num_buffers); + + /* Set the verb byte, have to substitute in the valid-bit and the + * number of buffers. + */ + p[0] = cl[0] | RAR_VB(rar) | num_buffers; + lwsync(); + qbman_cinh_write(&s->sys, QBMAN_CINH_SWP_RCR_AM_RT + + RAR_IDX(rar) * 4, QMAN_RT_MODE); + + return 0; +} + +inline int qbman_swp_release(struct qbman_swp *s, + const struct qbman_release_desc *d, + const uint64_t *buffers, + unsigned int num_buffers) +{ + return qbman_swp_release_ptr(s, d, buffers, num_buffers); +} + /*******************/ /* Buffer acquires */ /*******************/ @@ -1214,7 +1714,7 @@ int qbman_swp_acquire(struct qbman_swp *s, uint16_t bpid, uint64_t *buffers, /* Complete the management command */ r = qbman_swp_mc_complete(s, p, QBMAN_MC_ACQUIRE); - if (unlikely(!r)) { + if (!r) { pr_err("qbman: acquire from BPID %d failed, no response\n", bpid); return -EIO; @@ -1224,7 +1724,7 @@ int qbman_swp_acquire(struct qbman_swp *s, uint16_t bpid, uint64_t *buffers, QBMAN_BUG_ON((r->verb & QBMAN_RESPONSE_VERB_MASK) != QBMAN_MC_ACQUIRE); /* Determine success or failure */ - if (unlikely(r->rslt != QBMAN_MC_RSLT_OK)) { + if (r->rslt != QBMAN_MC_RSLT_OK) { pr_err("Acquire buffers from BPID 0x%x failed, code=0x%02x\n", bpid, r->rslt); return -EIO; @@ -1271,7 +1771,7 @@ static int qbman_swp_alt_fq_state(struct qbman_swp *s, uint32_t fqid, /* Complete the management command */ r = qbman_swp_mc_complete(s, p, alt_fq_verb); - if (unlikely(!r)) { + if (!r) { pr_err("qbman: mgmt cmd failed, no response (verb=0x%x)\n", alt_fq_verb); return -EIO; @@ -1281,7 +1781,7 @@ static int qbman_swp_alt_fq_state(struct qbman_swp *s, uint32_t fqid, QBMAN_BUG_ON((r->verb & QBMAN_RESPONSE_VERB_MASK) != alt_fq_verb); /* Determine success or failure */ - if (unlikely(r->rslt != QBMAN_MC_RSLT_OK)) { + if (r->rslt != QBMAN_MC_RSLT_OK) { pr_err("ALT FQID %d failed: verb = 0x%08x, code = 0x%02x\n", fqid, alt_fq_verb, r->rslt); return -EIO; @@ -1362,7 +1862,7 @@ static int qbman_swp_CDAN_set(struct qbman_swp *s, uint16_t channelid, /* Complete the management command */ r = qbman_swp_mc_complete(s, p, QBMAN_WQCHAN_CONFIGURE); - if (unlikely(!r)) { + if (!r) { pr_err("qbman: wqchan config failed, no response\n"); return -EIO; } @@ -1372,7 +1872,7 @@ static int qbman_swp_CDAN_set(struct qbman_swp *s, uint16_t channelid, != QBMAN_WQCHAN_CONFIGURE); /* Determine success or failure */ - if (unlikely(r->rslt != QBMAN_MC_RSLT_OK)) { + if (r->rslt != QBMAN_MC_RSLT_OK) { pr_err("CDAN cQID %d failed: code = 0x%02x\n", channelid, r->rslt); return -EIO; diff --git a/drivers/bus/fslmc/qbman/qbman_portal.h b/drivers/bus/fslmc/qbman/qbman_portal.h index dbea22a1b..3b0fc540b 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.h +++ b/drivers/bus/fslmc/qbman/qbman_portal.h @@ -1,12 +1,17 @@ /* SPDX-License-Identifier: BSD-3-Clause * * Copyright (C) 2014-2016 Freescale Semiconductor, Inc. + * Copyright 2018 NXP * */ +#ifndef _QBMAN_PORTAL_H_ +#define _QBMAN_PORTAL_H_ + #include "qbman_sys.h" #include +uint32_t qman_version; #define QMAN_REV_4000 0x04000000 #define QMAN_REV_4100 0x04010000 #define QMAN_REV_4101 0x04010001 @@ -14,13 +19,14 @@ /* All QBMan command and result structures use this "valid bit" encoding */ #define QB_VALID_BIT ((uint32_t)0x80) +/* All QBMan command use this "Read trigger bit" encoding */ +#define QB_RT_BIT ((uint32_t)0x100) + /* Management command result codes */ #define QBMAN_MC_RSLT_OK 0xf0 /* QBMan DQRR size is set at runtime in qbman_portal.c */ -#define QBMAN_EQCR_SIZE 8 - static inline uint8_t qm_cyc_diff(uint8_t ringsize, uint8_t first, uint8_t last) { @@ -51,6 +57,10 @@ struct qbman_swp { #endif uint32_t valid_bit; /* 0x00 or 0x80 */ } mc; + /* Management response */ + struct { + uint32_t valid_bit; /* 0x00 or 0x80 */ + } mr; /* Push dequeues */ uint32_t sdq; /* Volatile dequeues */ @@ -87,6 +97,8 @@ struct qbman_swp { struct { uint32_t pi; uint32_t pi_vb; + uint32_t pi_ring_size; + uint32_t pi_mask; uint32_t ci; int available; } eqcr; @@ -141,4 +153,16 @@ static inline void *qbman_swp_mc_complete(struct qbman_swp *swp, void *cmd, * an inline) is necessary to work with different descriptor types and to work * correctly with const and non-const inputs (and similarly-qualified outputs). */ -#define qb_cl(d) (&(d)->donot_manipulate_directly[0]) +#define qb_cl(d) (&(d)->dont_manipulate_directly[0]) + +#ifdef RTE_ARCH_ARM64 + #define clean(p) \ + { asm volatile("dc cvac, %0;" : : "r" (p) : "memory"); } + #define invalidate(p) \ + { asm volatile("dc ivac, %0" : : "r"(p) : "memory"); } +#else + #define clean(p) + #define invalidate(p) +#endif + +#endif diff --git a/drivers/bus/fslmc/qbman/qbman_sys.h b/drivers/bus/fslmc/qbman/qbman_sys.h index 2bd33ea56..d41af8358 100644 --- a/drivers/bus/fslmc/qbman/qbman_sys.h +++ b/drivers/bus/fslmc/qbman/qbman_sys.h @@ -18,11 +18,51 @@ * *not* to provide linux compatibility. */ +#ifndef _QBMAN_SYS_H_ +#define _QBMAN_SYS_H_ + #include "qbman_sys_decl.h" #define CENA_WRITE_ENABLE 0 #define CINH_WRITE_ENABLE 1 +/* CINH register offsets */ +#define QBMAN_CINH_SWP_EQCR_PI 0x800 +#define QBMAN_CINH_SWP_EQCR_CI 0x840 +#define QBMAN_CINH_SWP_EQAR 0x8c0 +#define QBMAN_CINH_SWP_CR_RT 0x900 +#define QBMAN_CINH_SWP_VDQCR_RT 0x940 +#define QBMAN_CINH_SWP_EQCR_AM_RT 0x980 +#define QBMAN_CINH_SWP_RCR_AM_RT 0x9c0 +#define QBMAN_CINH_SWP_DQPI 0xa00 +#define QBMAN_CINH_SWP_DQRR_ITR 0xa80 +#define QBMAN_CINH_SWP_DCAP 0xac0 +#define QBMAN_CINH_SWP_SDQCR 0xb00 +#define QBMAN_CINH_SWP_EQCR_AM_RT2 0xb40 +#define QBMAN_CINH_SWP_RCR_PI 0xc00 +#define QBMAN_CINH_SWP_RAR 0xcc0 +#define QBMAN_CINH_SWP_ISR 0xe00 +#define QBMAN_CINH_SWP_IER 0xe40 +#define QBMAN_CINH_SWP_ISDR 0xe80 +#define QBMAN_CINH_SWP_IIR 0xec0 +#define QBMAN_CINH_SWP_ITPR 0xf40 + +/* CENA register offsets */ +#define QBMAN_CENA_SWP_EQCR(n) (0x000 + ((uint32_t)(n) << 6)) +#define QBMAN_CENA_SWP_DQRR(n) (0x200 + ((uint32_t)(n) << 6)) +#define QBMAN_CENA_SWP_RCR(n) (0x400 + ((uint32_t)(n) << 6)) +#define QBMAN_CENA_SWP_CR 0x600 +#define QBMAN_CENA_SWP_RR(vb) (0x700 + ((uint32_t)(vb) >> 1)) +#define QBMAN_CENA_SWP_VDQCR 0x780 +#define QBMAN_CENA_SWP_EQCR_CI 0x840 + +/* CENA register offsets in memory-backed mode */ +#define QBMAN_CENA_SWP_DQRR_MEM(n) (0x800 + ((uint32_t)(n) << 6)) +#define QBMAN_CENA_SWP_RCR_MEM(n) (0x1400 + ((uint32_t)(n) << 6)) +#define QBMAN_CENA_SWP_CR_MEM 0x1600 +#define QBMAN_CENA_SWP_RR_MEM 0x1680 +#define QBMAN_CENA_SWP_VDQCR_MEM 0x1780 + /* Debugging assists */ static inline void __hexdump(unsigned long start, unsigned long end, unsigned long p, size_t sz, const unsigned char *c) @@ -125,8 +165,8 @@ struct qbman_swp_sys { * place-holder. */ uint8_t *cena; - uint8_t __iomem *addr_cena; - uint8_t __iomem *addr_cinh; + uint8_t *addr_cena; + uint8_t *addr_cinh; uint32_t idx; enum qbman_eqcr_mode eqcr_mode; }; @@ -292,13 +332,16 @@ static inline void qbman_cena_prefetch(struct qbman_swp_sys *s, * qbman_portal.c. So use of it is declared locally here. */ #define QBMAN_CINH_SWP_CFG 0xd00 -#define QBMAN_CINH_SWP_CFG 0xd00 + #define SWP_CFG_DQRR_MF_SHIFT 20 #define SWP_CFG_EST_SHIFT 16 +#define SWP_CFG_CPBS_SHIFT 15 #define SWP_CFG_WN_SHIFT 14 #define SWP_CFG_RPM_SHIFT 12 #define SWP_CFG_DCM_SHIFT 10 #define SWP_CFG_EPM_SHIFT 8 +#define SWP_CFG_VPM_SHIFT 7 +#define SWP_CFG_CPM_SHIFT 6 #define SWP_CFG_SD_SHIFT 5 #define SWP_CFG_SP_SHIFT 4 #define SWP_CFG_SE_SHIFT 3 @@ -329,11 +372,20 @@ static inline uint32_t qbman_set_swp_cfg(uint8_t max_fill, uint8_t wn, return reg; } +#define QMAN_RT_MODE 0x00000100 + +#define QMAN_REV_4000 0x04000000 +#define QMAN_REV_4100 0x04010000 +#define QMAN_REV_4101 0x04010001 +#define QMAN_REV_5000 0x05000000 +#define QMAN_REV_MASK 0xffff0000 + static inline int qbman_swp_sys_init(struct qbman_swp_sys *s, const struct qbman_swp_desc *d, uint8_t dqrr_size) { uint32_t reg; + int i; #ifdef RTE_ARCH_64 uint8_t wn = CENA_WRITE_ENABLE; #else @@ -343,7 +395,7 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s, s->addr_cena = d->cena_bar; s->addr_cinh = d->cinh_bar; s->idx = (uint32_t)d->idx; - s->cena = malloc(4096); + s->cena = malloc(64*1024); if (!s->cena) { pr_err("Could not allocate page for cena shadow\n"); return -1; @@ -358,12 +410,34 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s, reg = qbman_cinh_read(s, QBMAN_CINH_SWP_CFG); QBMAN_BUG_ON(reg); #endif + if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000) + memset(s->addr_cena, 0, 64*1024); + else { + /* Invalidate the portal memory. + * This ensures no stale cache lines + */ + for (i = 0; i < 0x1000; i += 64) + dccivac(s->addr_cena + i); + } + if (s->eqcr_mode == qman_eqcr_vb_array) - reg = qbman_set_swp_cfg(dqrr_size, wn, 0, 3, 2, 3, 1, 1, 1, 1, - 1, 1); - else - reg = qbman_set_swp_cfg(dqrr_size, wn, 1, 3, 2, 2, 1, 1, 1, 1, - 1, 1); + reg = qbman_set_swp_cfg(dqrr_size, wn, + 0, 3, 2, 3, 1, 1, 1, 1, 1, 1); + else { + if ((d->qman_version & QMAN_REV_MASK) < QMAN_REV_5000) + reg = qbman_set_swp_cfg(dqrr_size, wn, + 1, 3, 2, 2, 1, 1, 1, 1, 1, 1); + else + reg = qbman_set_swp_cfg(dqrr_size, wn, + 1, 3, 2, 0, 1, 1, 1, 1, 1, 1); + } + + if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000) { + reg |= 1 << SWP_CFG_CPBS_SHIFT | /* memory-backed mode */ + 1 << SWP_CFG_VPM_SHIFT | /* VDQCR read triggered mode */ + 1 << SWP_CFG_CPM_SHIFT; /* CR read triggered mode */ + } + qbman_cinh_write(s, QBMAN_CINH_SWP_CFG, reg); reg = qbman_cinh_read(s, QBMAN_CINH_SWP_CFG); if (!reg) { @@ -371,6 +445,12 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s, free(s->cena); return -1; } + + if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000) { + qbman_cinh_write(s, QBMAN_CINH_SWP_EQCR_PI, QMAN_RT_MODE); + qbman_cinh_write(s, QBMAN_CINH_SWP_RCR_PI, QMAN_RT_MODE); + } + return 0; } @@ -378,3 +458,5 @@ static inline void qbman_swp_sys_finish(struct qbman_swp_sys *s) { free(s->cena); } + +#endif /* _QBMAN_SYS_H_ */ diff --git a/drivers/bus/fslmc/qbman/qbman_sys_decl.h b/drivers/bus/fslmc/qbman/qbman_sys_decl.h index fa6977fee..a29f5b469 100644 --- a/drivers/bus/fslmc/qbman/qbman_sys_decl.h +++ b/drivers/bus/fslmc/qbman/qbman_sys_decl.h @@ -3,6 +3,9 @@ * Copyright (C) 2014-2016 Freescale Semiconductor, Inc. * */ +#ifndef _QBMAN_SYS_DECL_H_ +#define _QBMAN_SYS_DECL_H_ + #include #include @@ -51,3 +54,4 @@ static inline void prefetch_for_store(void *p) RTE_SET_USED(p); } #endif +#endif /* _QBMAN_SYS_DECL_H_ */ From patchwork Fri Oct 12 10:04:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreyansh Jain X-Patchwork-Id: 148739 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp538895lji; Fri, 12 Oct 2018 03:06:53 -0700 (PDT) X-Google-Smtp-Source: ACcGV62GnDYQoTNQd6XNt5zcZsZ72H6DI84/4mxKdw3BNojT2KGQiM4WiFHUBRmsuEP3QGy+WdBA X-Received: by 2002:adf:e752:: with SMTP id c18-v6mr5090685wrn.143.1539338813503; Fri, 12 Oct 2018 03:06:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539338813; cv=none; d=google.com; s=arc-20160816; b=nD1tt0UBJgRitSqVJpZ/GmiD4kr6WA19r2D5Nd12LejI36SUaMjbgsjYkOp61p9EBR Mf9kcIgAJHG9tr0QYSeR5Cb7DU/DyNNin6fBwOo4Lhw2mE2mjnIIpYrUXMQdEwM+a9gG zJFVtT+kv0aqJD4bwakfkcLeRAiY9AXF+HB1ZhbktmFsswhQilCVihp40e+CA8bggNWQ 0JeUMQXV1Lu/JAq4zC2GOZHDEMxrgIpTYDShm5fU0HZV2mzOq+LynGabfjHqV9gHcvAh rvE4LkVPwoba3BVFyIHsfqC1mCGuyr7O2XXTZxYsDGQYNB5mNiRFa9d5J9R7YEuoQLNv 9pJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:dkim-signature; bh=HQWu4qsM4Te95aDN5peAC3n8udnwNJ0TmDUSUSmbGuU=; b=JDgr/+LFEVhlwkEuAKtYu0RK1MZ60ai9YuqDtKbMBmCfiDMg5sD2c3SvjrBNJpaK3c BabS/gJW00XYimihUgpIC8/amS3xr3E0l/onONft8kiAMUJisX1tm5nab+HG8+h4dB9N /oQmA1ZgFD0tsyPGPko5JuSVr+jgSiGanytTgfkZb8q9nJFjrEbJSV9qWv5PGE7OPIo8 wlKN6UH8ICrCKB1krrn1DYbuaSkjEE+x32KspDsvBvyE0OzpbD9UVvYWhlRxr8ffudFx hmvzPkM1v8cmay1TL45zf84iEeAbOoZ6v1PBdai7D7guk4ql1G+utKrOgzscgr8Wjzmi /MJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=XxfdOBaA; 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 c188-v6si897619wmh.70.2018.10.12.03.06.53; Fri, 12 Oct 2018 03:06:53 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=XxfdOBaA; 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 E50431B4B2; Fri, 12 Oct 2018 12:06:00 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0079.outbound.protection.outlook.com [104.47.0.79]) by dpdk.org (Postfix) with ESMTP id 223A81B480 for ; Fri, 12 Oct 2018 12:05:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HQWu4qsM4Te95aDN5peAC3n8udnwNJ0TmDUSUSmbGuU=; b=XxfdOBaAM2rJTmTEPWfkcz1MHwrpBXtnPBlNc+S8k1C8QiYCakDXUCNpoEdR8wniouDrZpOJnLyXcbGNYVLVgoNudlmOqb4pEVO7b8p7T/Rhw0br5z35ITCW8TdxZK3UYOvnZXs8/UOPiWgnSDl0kmRwWYEK5xRmP3OB6QPy9Qk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.25; Fri, 12 Oct 2018 10:05:50 +0000 From: Shreyansh Jain To: thomas@monjalon.net Cc: ferruh.yigit@intel.com, dev@dpdk.org, Nipun Gupta Date: Fri, 12 Oct 2018 15:34:18 +0530 Message-Id: <20181012100426.29349-8-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181012100426.29349-1-shreyansh.jain@nxp.com> References: <20180926180440.31726-1-shreyansh.jain@nxp.com> <20181012100426.29349-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BMXPR01CA0004.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::14) To AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c8c16f80-a9a2-44c5-52ea-08d6302a4a2b X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB4676; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4676; 3:elNmdSv4dAbySx0ae0EnNLDo6FfLbF+YVtQk4C2tb6cBcgmqjIS8lQJ+Gh2JdUnad3wETm05Dhp0nnGkEov9c7FwwetT/gBfrMBtix5iqQpaHL2SOBVGhwmX6VUXblqXsEZsc0yxg7FOLHcTo3PkJ/gs+2TjC/l6uI0/WWrl7S1zXupDSXNBec1+yTX/FwzhhEv0DD4LBp1hdNoIiQJ+HnT4vMG+8dI5YcHnljUY6e+v1GCXSfn41hyy6wwfb1eM; 25:lKT/T8YC6VOQR0ckXmJWF+3tp+87/LU/5ax2bcs7UyF3l5htH5oFbyJJ+uSlleSY0BGo2o6U/WUNs1WRv6MItg5+heGd3nI1l0zsucXs6xy7lq+I+eljNUdUDjFaXfVe7GO9DGhUYpB9DXdGiEQGguPn+85WbYiQuGD1KkVRGJJxR87NZoVFciEHDyQbAvscVMM4/8JG4ophPt5sUxxgPnAYDazElgSuBZa/GvRVmZ5i9ELylcGX+GaEm7gvctx9SezaNEg3h/uYFVMtyoCjExY35plNzOkvsH1FGDntJc6hjjqKYXsXlXhItpY7zBE0kRNJw9JfrZs6oSf63L9Vhg==; 31:Yr0A/1Wb3F5YkTehAY1ZqDQ4saXTntL/jP6RLfpaIvtWAY3WhWmQxaiDRnXWVg5IPB/VZMqaXhjgm2fz9jJjoJTx6anMUsp92bzkzJPIU4+DBBu+S7sH8zRNtfMwLmF2aZHYGXDmKOtuW8tASwfZv6T/RFqNitB0wcWWLzkrlxktnb9GmNxvi0UNBGQIS0JZp9BRAvIOcb/2O1aboSUwTFb+GZwPL7qSvFqjz+YLano= X-MS-TrafficTypeDiagnostic: AM0PR04MB4676: X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4676; 20:TnhjeRw4PQQEcjCMpHDdRs+Dj4EsKzjovwKAVwJNdbrze2JdNDACSwJxGkqA+ivbc9yVxwtZkcDLacZwL4CH8EoX6GQntZnjXCNKvkkqMsBjHlN42Vd7D4t23HskmVMzg0Axg1RYGaXsmnieCDUnRuLF/j7KMJtqxg+WtfB0tf/kzXjF0P3oY0j0VrFt0acXkOOh3/hVNsDgDwlgPH9GVdTDWiTb3MjATI7qvQkUFAH98wPMlaHEKxtJz4Szc1GxJaM8V3p2Bz3SEWtk+7QG0+zQmvY3ypxCtEntq0TJRSobjSiBJl4mc2zmtaYE80RxfftB/uXar1RYz2FcAlpZpkRRbf9R8qxUB65dKCdHSREG695nGTgJNMq5RJuXtxmHxExgQalirKd9QSQQIYCznEkyJpHFZn6ZX1pGn1b/5pa8GVMu/z2ebfyL/3i/dnqmmXMHxOxKCv/26pQrZcpGi5Ijon8t7P6vfj6J72qzcBhzXFkH1tE+I70rxp7asXJy; 4:GF0/U+Irdxq2n6+boSgOin7xe95Aj5qURCzw4hmZ5Hw4u1zG6rLPgGwI57CEWAGGo+UnwLRhPNdbV/OM294fWvzo7fSce6FrAN+1QtMukDu85Jx963GwjDmVQCMaB83C54WXbGj6DlidaMRmCv1GF2Camx7dpq5sLk62vpsKynlajPzB/v8wcZUEz1E502g8ZSOqbdOt+C0kpFxbSSOg2zOBQJv32SOQw19M7Cbhg0WPSf0TlbwqKq90QcL+w5PSjlbbdhsB7BoOx98ip/UzQHbG15/1nJOkjKnZYP3Ovp6bpXAnVtCNu2xF5CCG6b86lttaJPhaeAu4EpQnRy1BOeNEMAXjextNbPldIswL618= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:AM0PR04MB4676; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4676; X-Forefront-PRVS: 0823A5777B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(346002)(366004)(136003)(39860400002)(199004)(189003)(2906002)(52116002)(16526019)(14444005)(53936002)(8676002)(478600001)(186003)(386003)(446003)(105586002)(7736002)(106356001)(6512007)(6116002)(86362001)(3846002)(81156014)(50226002)(68736007)(1076002)(47776003)(5660300001)(6506007)(8936002)(78486009)(36756003)(316002)(26005)(66066001)(6666004)(25786009)(55236004)(81166006)(11346002)(48376002)(76176011)(44832011)(2361001)(956004)(51416003)(2616005)(97736004)(1006002)(50466002)(486006)(476003)(305945005)(16586007)(6916009)(4326008)(6486002)(2351001)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4676; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR04MB4676; 23:SkdHJHwW48RoV9UFf1Z5Ti2mS3rUaQaBGtqVkxqKD?= PSRgzrDWq2eLG42exCnzpj0NKbqy8bLiI640Js2Fp0RmzFDj8GI/9dq1dh2CrS+21uMR/2Mfm2sZPs/YkDGNVLi/0n7KH+jsMI70uXl5kNDtaadv6Fpebi3RwvC27bWyZTzyMDr8mF3d0n3NDXBvpoiv6AAa6wblIxz4zA93L8dDvXZnmDukN7KE5ppfui1mePEXQWCTZ2neKOILssIiW1si0mOk/4NzEbCaZfRludZPtRio4N0fcRwEryOUM4rQWaSsIwkfSrBKX5Vz2rHoiJNWxkJdF9qnTadl3CHsxr7S9FDDP/b4KdpU0dPsNSKjJHlJobStDv4uKx277hS3K9odq9oqlHedLG2qsb6P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D9QfqxFtcgkWeMKXENRW1gZ8GBS0kSd9SdyVpeyi2MAw2cZ74auvTazxJ/9QPfckSebUozdJRBq7JfP2t5nfZQuMk6pE9O+KLNMjmHXb6kcJvnaU8V8fKdLQhXx6A SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2018 10:05:50.0759 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c8c16f80-a9a2-44c5-52ea-08d6302a4a2b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4676 Subject: [dpdk-dev] [PATCH v3 07/15] bus/fslmc: support 32 enq and deq for LX2 platform 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 LX2 can support upto 32 frames in one hw pull request. Signed-off-by: Nipun Gupta --- drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 17 ++++++++++++++-- drivers/bus/fslmc/portal/dpaa2_hw_dpio.h | 4 ++++ drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 22 ++++++++++++++++----- drivers/bus/fslmc/rte_bus_fslmc_version.map | 2 ++ drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 7 ++++--- drivers/event/dpaa2/dpaa2_eventdev.c | 4 ++-- drivers/net/dpaa2/dpaa2_rxtx.c | 8 ++++---- 7 files changed, 48 insertions(+), 16 deletions(-) -- 2.17.1 diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c index 76f80b951..ce0699842 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c @@ -53,6 +53,11 @@ static uint32_t io_space_count; /* Variable to store DPAA2 platform type */ uint32_t dpaa2_svr_family; +/* Variable to store DPAA2 DQRR size */ +uint8_t dpaa2_dqrr_size; +/* Variable to store DPAA2 EQCR size */ +uint8_t dpaa2_eqcr_size; + /*Stashing Macros default for LS208x*/ static int dpaa2_core_cluster_base = 0x04; static int dpaa2_cluster_sz = 2; @@ -125,7 +130,7 @@ static void dpaa2_affine_dpio_intr_to_respective_core(int32_t dpio_id) cpu_mask, token); ret = system(command); if (ret < 0) - DPAA2_BUS_WARN( + DPAA2_BUS_DEBUG( "Failed to affine interrupts on respective core"); else DPAA2_BUS_DEBUG(" %s command is executed", command); @@ -409,6 +414,14 @@ dpaa2_create_dpio_device(int vdev_fd, DPAA2_BUS_DEBUG("LX2160 Platform Detected"); } dpaa2_svr_family = (mc_plat_info.svr & 0xffff0000); + + if (dpaa2_svr_family == SVR_LX2160A) { + dpaa2_dqrr_size = DPAA2_LX2_DQRR_RING_SIZE; + dpaa2_eqcr_size = DPAA2_LX2_EQCR_RING_SIZE; + } else { + dpaa2_dqrr_size = DPAA2_DQRR_RING_SIZE; + dpaa2_eqcr_size = DPAA2_EQCR_RING_SIZE; + } } if (dpaa2_svr_family == SVR_LX2160A) @@ -492,7 +505,7 @@ dpaa2_alloc_dq_storage(struct queue_storage_info_t *q_storage) for (i = 0; i < NUM_DQS_PER_QUEUE; i++) { q_storage->dq_storage[i] = rte_malloc(NULL, - DPAA2_DQRR_RING_SIZE * sizeof(struct qbman_result), + dpaa2_dqrr_size * sizeof(struct qbman_result), RTE_CACHE_LINE_SIZE); if (!q_storage->dq_storage[i]) goto fail; diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h index d593eea74..462501a2e 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h @@ -30,6 +30,10 @@ RTE_DECLARE_PER_LCORE(struct dpaa2_io_portal_t, _dpaa2_io); /* Variable to store DPAA2 platform type */ extern uint32_t dpaa2_svr_family; +/* Variable to store DPAA2 DQRR size */ +extern uint8_t dpaa2_dqrr_size; +/* Variable to store DPAA2 EQCR size */ +extern uint8_t dpaa2_eqcr_size; extern struct dpaa2_io_portal_t dpaa2_io_portal[RTE_MAX_LCORE]; diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h index f2eebe65d..ec8f42806 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved. - * Copyright 2016 NXP + * Copyright 2016-2018 NXP * */ @@ -31,11 +31,23 @@ #define VLAN_TAG_SIZE 4 /** < Vlan Header Length */ #endif -#define MAX_TX_RING_SLOTS 8 - /** > 3) = 8 for LS2/LS2 */ +#define DPAA2_EQCR_SHIFT 3 +/* EQCR shift to get EQCR size for LX2 (2 >> 5) = 32 for LX2 */ +#define DPAA2_LX2_EQCR_SHIFT 5 #define DPAA2_SWP_CENA_REGION 0 #define DPAA2_SWP_CINH_REGION 1 diff --git a/drivers/bus/fslmc/rte_bus_fslmc_version.map b/drivers/bus/fslmc/rte_bus_fslmc_version.map index 8717373dd..dcc4e082e 100644 --- a/drivers/bus/fslmc/rte_bus_fslmc_version.map +++ b/drivers/bus/fslmc/rte_bus_fslmc_version.map @@ -121,6 +121,8 @@ DPDK_18.05 { DPDK_18.11 { global: + dpaa2_dqrr_size; + dpaa2_eqcr_size; dpci_get_link_state; dpci_get_opr; dpci_get_peer_attributes; diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index ee95c2b7c..3e51b9e3f 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -1237,7 +1237,8 @@ dpaa2_sec_enqueue_burst(void *qp, struct rte_crypto_op **ops, swp = DPAA2_PER_LCORE_PORTAL; while (nb_ops) { - frames_to_send = (nb_ops >> 3) ? MAX_TX_RING_SLOTS : nb_ops; + frames_to_send = (nb_ops > dpaa2_eqcr_size) ? + dpaa2_eqcr_size : nb_ops; for (loop = 0; loop < frames_to_send; loop++) { /*Clear the unused FD fields before sending*/ @@ -1396,8 +1397,8 @@ dpaa2_sec_dequeue_burst(void *qp, struct rte_crypto_op **ops, qbman_pull_desc_clear(&pulldesc); qbman_pull_desc_set_numframes(&pulldesc, - (nb_ops > DPAA2_DQRR_RING_SIZE) ? - DPAA2_DQRR_RING_SIZE : nb_ops); + (nb_ops > dpaa2_dqrr_size) ? + dpaa2_dqrr_size : nb_ops); qbman_pull_desc_set_fq(&pulldesc, fqid); qbman_pull_desc_set_storage(&pulldesc, dq_storage, (dma_addr_t)DPAA2_VADDR_TO_IOVA(dq_storage), diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c index 24df8d7f3..d9a33a266 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -109,8 +109,8 @@ dpaa2_eventdev_enqueue_burst(void *port, const struct rte_event ev[], evq_info = &dpaa2_portal->evq_info[queue_id]; while (nb_events) { - frames_to_send = (nb_events >> 3) ? - MAX_TX_RING_SLOTS : nb_events; + frames_to_send = (nb_events > dpaa2_eqcr_size) ? + dpaa2_eqcr_size : nb_events; for (loop = 0; loop < frames_to_send; loop++) { const struct rte_event *event = &ev[num_tx + loop]; diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index ef109a621..89cfd2929 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved. - * Copyright 2016 NXP + * Copyright 2016-2018 NXP * */ @@ -476,8 +476,7 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) } } swp = DPAA2_PER_LCORE_ETHRX_PORTAL; - pull_size = (nb_pkts > DPAA2_DQRR_RING_SIZE) ? - DPAA2_DQRR_RING_SIZE : nb_pkts; + pull_size = (nb_pkts > dpaa2_dqrr_size) ? dpaa2_dqrr_size : nb_pkts; if (unlikely(!q_storage->active_dqs)) { q_storage->toggle = 0; dq_storage = q_storage->dq_storage[q_storage->toggle]; @@ -699,7 +698,8 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) goto skip_tx; } - frames_to_send = (nb_pkts >> 3) ? MAX_TX_RING_SLOTS : nb_pkts; + frames_to_send = (nb_pkts > dpaa2_eqcr_size) ? + dpaa2_eqcr_size : nb_pkts; for (loop = 0; loop < frames_to_send; loop++) { if ((*bufs)->seqn) { From patchwork Fri Oct 12 10:04:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreyansh Jain X-Patchwork-Id: 148740 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp539051lji; Fri, 12 Oct 2018 03:07:02 -0700 (PDT) X-Google-Smtp-Source: ACcGV612Coqz/Mf6MKKiatCq3MLYB344kcWuvK0CFsKpuoc6dSAq6UAex7yxAeoBhPKebuDNQiKB X-Received: by 2002:a1c:2846:: with SMTP id o67-v6mr4503021wmo.60.1539338822080; Fri, 12 Oct 2018 03:07:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539338822; cv=none; d=google.com; s=arc-20160816; b=dobMYQJLrOneuqOwQvtDARdC+lDAqDrT+fZ+MF+oeGhUd9ZW9U37OLYEuRvMszin3C AtuLPIqb+OR0zg6Egh0Gp67T+CzeXLJXdzbkPvTKuBP1AvmHGGyTq6CoG2N5fmKw4Qn8 6f9NHOKeUZfe0NxtJvFCSUqIG97rnCRbnP/KgGajYraX9OCrAf/4A6f8CPC51gDiksJC Uv/mkU4crEyeL78le7f8mhbNmu9RmHxjk80kYaafCBDjw7Sc255feepGYaeg29OOQLzT BC4oeGvCIp8RJsfkXHpS7MmIXwtrWjgOzCnMWiG2ainKTWgjHngKpcq5/dEoXHbIJhU3 b8cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:dkim-signature; bh=lSlO6MBEWsHdPA0rw0rrk62VnA9doBzHz/4LKFWRiMI=; b=aL1ScSs/NneQI9gNrXIDrSdoGsMKuQxb1l8LsFkRRUlL5PHxElGRl6pVlfmREkXH9E fkxcC+x09PjFQ6QUzWhxryqHoaL7qHw5VLPOLSoz3ehjAAcVUCpUH4E0eh5Zyn8CX7PU FgSBjWy72ATjVnIExvTYxzyDc4XIKtTvhTjOh8VExqsRO8gc1hHoAGL1ArIhdkG/g79f EMYTASdQgzNCrJPf6Zp0excu7A/ejlxcqr7xIV2jl6uFkBGfxxkEZCxBkKbvA8n0YlAL skTjsS1AIzoxi/zpqIpXbEs46J6iU1qvqRVRzavL0sc+bCh/Hs7C5DzNR35yXMxJGIty r60w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=Tb8ntd0d; 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 q21-v6si808137wmq.104.2018.10.12.03.07.01; Fri, 12 Oct 2018 03:07:02 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=Tb8ntd0d; 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 35FE81B4BB; Fri, 12 Oct 2018 12:06:03 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0081.outbound.protection.outlook.com [104.47.0.81]) by dpdk.org (Postfix) with ESMTP id 867161B484 for ; Fri, 12 Oct 2018 12:05:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lSlO6MBEWsHdPA0rw0rrk62VnA9doBzHz/4LKFWRiMI=; b=Tb8ntd0dMrvjyfT7avXc9/Np1heIZKVNhCz+TYARP76qOFxSclNCld/Z7eLsPmzIfKWnzDQk6tffNAK08JkrVw0iTyWMaIvrSZYR+w1XyTDAAE3I+G+lKdti2ElNzKPGGXVsIDRRCtJmyi4ab45tycJusO0uszOqrlnsrNdwoPA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.25; Fri, 12 Oct 2018 10:05:51 +0000 From: Shreyansh Jain To: thomas@monjalon.net Cc: ferruh.yigit@intel.com, dev@dpdk.org, Nipun Gupta Date: Fri, 12 Oct 2018 15:34:19 +0530 Message-Id: <20181012100426.29349-9-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181012100426.29349-1-shreyansh.jain@nxp.com> References: <20180926180440.31726-1-shreyansh.jain@nxp.com> <20181012100426.29349-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BMXPR01CA0004.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::14) To AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a3f79cb7-63bf-4260-3497-08d6302a4b07 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB4676; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4676; 3:ZGpRXvKLpp3eEKTOcDgi8X2JdC+0uGsPUyv14mcV/nTikLMpc7wdN1y8V8/1/1j1UCDS2q5t5GnNWShK3xk9fij7/hMM/OZQa6qS24/Cch3//P4xDbleOv/wRc17oLPvgzkadoeJt43aUFWejDm4gyT1ukBswLmU6RFxFhgV0A4kqfWse+erGhxOwMM4Omn/L5eAH41wnLvfLbRWjXWQjnib/ZPJhb8fMM6O0pKgl4nh94ZfyuzKpH6rD75DIRu/; 25:ZqWjLldmcMjWwiaBAfuTnxNBRdg6fbu4YE5rtdEAC4o0aYwLsgexop2ua8LNMKkJ44PCq3q+JTeYpOBxapGkziYekmEecdLLOCJ1RnXhSFM6IJ2yTA8l/z30kkoXMnCAHCgqjHG/gBy+cpqG2/4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7nh3LkwAnx/9rbadacq4azo4WaHSz5g9jbCetnrPIR1tuvMHBqS7Jx//b968AmkMR1IRyqORA6pyhZQXDDPOJfvkp9byBT6hxdFPX5qZT/LDmhJ/WX/9BUNKYN9++b6KKwyaeDYGFZm0ePCfCjbeWqNzvwjE17QTK/YuvuJ+OAi6i9jXI+6QMpoTEennUrlmHw2kRNiJbBs0BIR/x4l1AXegYp6ZSo5Bz5oDuZUaP7D+xzwj/2dk2gvAz8EOE57AaE/nM2Ez+EZ2C75MvDfu0 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:AM0PR04MB4676; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4676; X-Forefront-PRVS: 0823A5777B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(346002)(366004)(136003)(39860400002)(199004)(189003)(2906002)(52116002)(16526019)(14444005)(53936002)(8676002)(478600001)(186003)(386003)(446003)(105586002)(7736002)(106356001)(6512007)(6116002)(86362001)(3846002)(81156014)(50226002)(68736007)(1076002)(47776003)(5660300001)(6506007)(8936002)(78486009)(36756003)(316002)(26005)(66066001)(6666004)(25786009)(55236004)(81166006)(11346002)(48376002)(76176011)(44832011)(2361001)(956004)(51416003)(2616005)(97736004)(1006002)(50466002)(486006)(476003)(305945005)(16586007)(6916009)(4326008)(6486002)(2351001)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4676; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR04MB4676; 23:NV/4T1G5D3FcszzyDAd0WGBVnri2MeeKe+Ov1GCVF?= 1xl+GbFyn+ga0RXtla0HtdNjpv22HN52lhkbXGA+26dnRB15PUn3UtUrdRJvxoqhHlrmwUCWpqI+9KWZM0+34NxbCsXKK3puERXYpjS3fsijZqG8mndBNhewFtGPtrhCxpiW8dug6CX0u6YYlXWdUWQTMNayhggZLNJtG3pZHOWXXF/hqWp/V1tk876er9Ff+K6K0rNpfqLTlUKMu6TZzrYCEQORiAS5u6saGcrhKgfYzUlvNwu5ED6QzCT2nOzzmU3DeE1bgLz/GEZVgPH6PqANmx5OIY5JKS5/sGUjAp6GNJzFH9O8xOOVHqGKIUiNkj8K8cYWMRaTiZxWmYPsf+ameUdGF5sOEBjp36JWwl+1ANZWKIDvO9Ky2tN6UHspYvr0DsISsLcFenF2Swc9Ih2ThYuYYkjq5WIfonQxtjZHo0jYBwRzvToIQPnFOkhZRqxsL+Wr7CqlCzFJjLytMrX81AW8uAjupT6Hwy1r4LkZz6+69ms0N0lbOYdx6fi17EtcdmUpKsZ+baXWZ59uIjvTGdmOBh1LLa8LQL9Jtsy8tQ2HvQ3Gk/nFcHnH551lcgaB/w0SaDg2yJBhCG5nsa/4GeRNJ80frCnPL9kPZxv8I1lpEbhig9Yo7uImUfr3Hwev+7t5+GT5uJfVg1HRxDsKlhrxvbF1duq6kozjHNRlZU+Ap1aSsGuU1l1NimY0bCasFlWTuncv2RCRD4ipAKnZ0w3LPX43+3MJvprhqCtvZ8CYKkOmRaVQjDlyxgjydqowEVLMM2/RDwgTTIGQuAeQjr4itsAVDmES+3puV5Qo2E9RgE1i6b6C9zr48HMrkx87utohKFBWaOXWTflstLT7qkvT8qn+RxxZ2n8T6/bMd+gLwKdvjNyrNivoouAlWJ4XneINPAvZb7LJuO436TudKBNProjq+LPL348mJdBnFIjDooXWk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AtvTSUudqJdqTqKmrhRyDBHIogxOHScHHj3YkgA4VFYaYm/qNxFu/EiGprvNZ8wRhlXco5W5PRO72n/yp6bfujiOPj5ln3BIgM2cpZh/7DwbmW5x+S3megtfdbiHHXwUfCkNyvMCzXTM9g4GYpGvmLEV9baPfZjZt1sfyUSrxIWxC9kbCB5kEQukoWSH4jB9BKkWzkQ==; 5:j4lI7tpz70MI1VY31GBcTBwHJ1v+fq38Po9vI/8mcOpJ3bzTnZ4XHHEITfjl2F3+aHGIQqsVblxjfdoLH54byUzghqGRmq+cOLBJ79IRXGrwuiN1BuvH2ZC1oe6aHrTHK5EKNFZEp5tIqrKRayEye9J3wcsWfsnG1VqLcW7POLc=; 7:1F4aYm28izz/hf9Ho4kBlHp42BBguKyFB1u+/A5XFU9JupDODvROvcDI7lGiA/WhkD/ca014O0dv+UdBJnVlm+ISWOuhK/UzSdfKOnLgurbVcP2Bb0M4rL359riJIdhbqikEJU9DuwRfAVmIg6USSI/ZUqtUkV0LYSLNwpEh3OH6oFRs6rcNFgOTsmcoMxl+h/5+tr1LVA1709LeDsUHK8lpA8GDgYeEnGF4iZ2FNMuWULNSE6v7XTzIicu/QInY SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2018 10:05:51.5200 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a3f79cb7-63bf-4260-3497-08d6302a4b07 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4676 Subject: [dpdk-dev] [PATCH v3 08/15] bus/fslmc: disable annotation prefetch for LX2 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 In case of LX2 we get parse result summary in FD. We do not need to prefetch and read the annotation to fetch the parse results. Signed-off-by: Nipun Gupta --- drivers/net/dpaa2/dpaa2_rxtx.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index 89cfd2929..953fed2ad 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -554,10 +554,12 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) } fd = qbman_result_DQ_fd(dq_storage); - next_fd = qbman_result_DQ_fd(dq_storage + 1); - /* Prefetch Annotation address for the parse results */ - rte_prefetch0((void *)(size_t)(DPAA2_GET_FD_ADDR(next_fd) - + DPAA2_FD_PTA_SIZE + 16)); + if (dpaa2_svr_family != SVR_LX2160A) { + next_fd = qbman_result_DQ_fd(dq_storage + 1); + /* Prefetch Annotation address for the parse results */ + rte_prefetch0((void *)(size_t)(DPAA2_GET_FD_ADDR( + next_fd) + DPAA2_FD_PTA_SIZE + 16)); + } if (unlikely(DPAA2_FD_GET_FORMAT(fd) == qbman_fd_sg)) bufs[num_rx] = eth_sg_fd_to_mbuf(fd); From patchwork Fri Oct 12 10:04:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreyansh Jain X-Patchwork-Id: 148741 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp539509lji; Fri, 12 Oct 2018 03:07:27 -0700 (PDT) X-Google-Smtp-Source: ACcGV62qmRP83sakzF/g+QbqRKg/C4QbDoayJ42/t3M1CsUf3sducl+HNGkpkAC1Yx1h6636yqHQ X-Received: by 2002:adf:ab13:: with SMTP id q19-v6mr4519173wrc.62.1539338847293; Fri, 12 Oct 2018 03:07:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539338847; cv=none; d=google.com; s=arc-20160816; b=E7KMHTrZqHgqnQdq2taWg/Z3N05mWVPWgGS8uxUZJhqnzBMoP8FB54C4bJ1zDA3K1r jrJ7R+MjEQIoGFVNtu9p4DIVUfnM0VDkJOu+LGhtV0MU87yv7pDX9ZmLBadSQI+Of03g vVlxYVFNZEeq/iircDUynI4amfFMfYtLNyB1rQm6izlxXEr6m/GsmUV3IeLNFLAOu1ZQ WqaWPit+BtBSYl47KjIGid3ekQwJcMfH3m/n7LUAXV9eVfNd36diG6/oxCFb9OjGaD4t vMN/a4/LXj9jotW4r2WsKlHQ/aF6avOClJ8qdVIa9WrvuhltKjFzvhWF7tgWwbn6MNlv DWLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:dkim-signature; bh=8zVCgvIu7lDpKj0bKI2U1+MqA8q8o15++o9eZg69/3c=; b=NL+Zq0vvDPJBrxkYLERtj7SqqzzSaf7OZFONh3qUbzJZVKN+NkfC3ym0X85G9HSAQB xy18lHWvOioMpj+U3GIsNNSOC7cl/oO1bEXoG59wxH9JDfbxiuNjPARYAfCwbnAq69bk sU9g+4oJB1Q9AJb7AA0UFLB+x2btmJMIZeB0bB5n1h+ThpklA5kALwG76aJh8pN8EkLZ AUFsdyMD0tRUYjizjr1eCmY8SZZqm4UvL/XhF5h+cY3rPx1024ehDNZK9gYgWTnRcsup pH3Mr89HhbR5bWvwMW1RatJkMUvCociNMwYfJMCJGChHQbxgYp0eXDRb7RPZDOzcmnNI 66aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=HbtjCI5E; 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 j18-v6si707430wrm.257.2018.10.12.03.07.27; Fri, 12 Oct 2018 03:07:27 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=HbtjCI5E; 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 7B73A1B4EB; Fri, 12 Oct 2018 12:06:10 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0062.outbound.protection.outlook.com [104.47.0.62]) by dpdk.org (Postfix) with ESMTP id A8ED91B4A5 for ; Fri, 12 Oct 2018 12:05:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8zVCgvIu7lDpKj0bKI2U1+MqA8q8o15++o9eZg69/3c=; b=HbtjCI5EXaRPScaEg9dYlIfypt2wkGCu2c0TBvoSaZTJkKlZ9KRIdWZ6WZJmJCP0g5yndQ9LbD5esF8IODTB5bnW6/JC3ICOCLvxDFBs3BjNoLe4pYkFNgUcjYxg6ZrScJm9IwMY54ERoxQ4YbE3ctn3m58HVg3jLG3wQOz3Ktg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.25; Fri, 12 Oct 2018 10:05:55 +0000 From: Shreyansh Jain To: thomas@monjalon.net Cc: ferruh.yigit@intel.com, dev@dpdk.org, Hemant Agrawal Date: Fri, 12 Oct 2018 15:34:22 +0530 Message-Id: <20181012100426.29349-12-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181012100426.29349-1-shreyansh.jain@nxp.com> References: <20180926180440.31726-1-shreyansh.jain@nxp.com> <20181012100426.29349-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BMXPR01CA0004.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::14) To AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e1ebd885-5ce6-423d-e91e-08d6302a4d92 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB4676; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4676; 3:4YdAZI5ByZOcJ7jP9r2TvUxEOS2bgD6Ei1ygQCQVsRTtGNvjWU6G2ltMalMf/KebRBWpYxGswpcAlggHG0WrFq3KeeFa2n3G4dIRJv8itro6Fzh6MooUp2bOegA05hHAhmWmkHELFvUvwoNZqwbJqVEu8GzWrmos9KiuJPxJqVbpFwNqeWb/WD6x9zPA9ifDyQu2pIo6cnZHfp7ERX1Vlrpo7J0uAVh//TLbvuaJcwJcl2ZD9zopk5uo74Y+Ai36; 25:yadInET07CD4R7Rld4nZVWtvDevQ3GSpawx0uos1rW4sfgVrRCnBNie5B/73TD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nkfoEmZy1UxzwPnMaS8zrEdmpBg; 4:uHx4ak01KL3VzSswbiDq0I0KMb5wrl4O9n7cVof+Bg9qX46gytNp8KwkKG9x6bvFivoDcY7NzI49BPCwmjXQRUPY77Dl/vf0Ku21PHX3o6ghAhvAL/9ilIkzLIiEAsN8N1C3AeyyyJ0Bx26x7+HK2ipDyRBP45wUzi0izqD4dJfNy4tPlEAkyY2Dl5D4Memnv2BYcl0ZCIhN5T+zFHQTCYEMSQVSGB785xHS/25owRco4qQyTO3vw0o8T3MxQutlIJgTuHzXbIebtHzwBzPUiOVOCWXq0XcCKba4+oiypGdRpmkc61cUcN489Cz0QYwn X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:AM0PR04MB4676; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4676; X-Forefront-PRVS: 0823A5777B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(346002)(366004)(136003)(39860400002)(199004)(189003)(2906002)(52116002)(16526019)(53936002)(8676002)(478600001)(186003)(386003)(446003)(105586002)(7736002)(106356001)(6512007)(6116002)(86362001)(3846002)(81156014)(50226002)(68736007)(1076002)(47776003)(5660300001)(6506007)(8936002)(78486009)(36756003)(316002)(26005)(66066001)(6666004)(25786009)(55236004)(81166006)(11346002)(48376002)(76176011)(44832011)(2361001)(956004)(51416003)(2616005)(97736004)(1006002)(50466002)(486006)(476003)(305945005)(16586007)(6916009)(4326008)(6486002)(2351001)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4676; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR04MB4676; 23:XWUqyO674qJGUAUcWUXkTeI9pijy2O7pp4Vc4m0vK?= AQ5X1/muBCp/IHcU9I+E/8fDTuEsAgkVWrmVJM8HE6YV7P3jSJyMBiz6HnMc7uFvDJI2uKl73chNfUnr5pmWm+tiGXtsKq9Pnoc2cK2qwi1Npm53AzhO17ff3877hlWSIw0+GUjnEQN/teMK0BX5PXhp0q5i47p/BXaa/0N7DU7vgPNK9dvp/uHZI37yVJ4/41DrBaKdBiQoZrSq06TdzfXEnfF4wk/jZpcVAVzhJernVT7onw/WV6UuRMzXGzDL56Kp5wj6fcqddh593SX9b4yiMr/8U4p7tsnLXHStdVuWcwtw7LG7uoqlHu+g2daJSoDVY/C9dffRfu2aWx91XYvxBLC++zq/9ksVcyZrulZfzH+jyDxl1GEJIOzsiw/TD0J1/AfSEGh54M6DlIKE9eIwVjKYC6pbo4ZtqfwnegoeMMLNlvR76A0VDGYpTpWOwpaXrBdDOTMB6GZWyIDdC25S/s5eB4MXTJPHjK1xmVk8McRo6xJhbPF4eY+ihOsUZmOe/cCOsCNWM4419yhXoGHnEigBJo0CbFROCsAsDcOp59BEq96r1HB5c/5streP86YsY9nW3FWUiiiLL5qLmB+0/AkBgcbmLaB05ag8CY9JY/cRnLeFNo/IFZBLS1W+pl/j4S+2ug7DZgJLnpsm5zsBu1Xxflb2Y3a1NgEelNvAsCreDvmg+hdLw2/zoqgwDGA7BXJhZ6t4ME/2j5eYPYuxjfSViOFLNcdHCcCfxEiEjH4/wWOuRPeFGOPWK6TxfpmJjMHdelUGpGwNPV1OSbnxtIFmKgDOg43SbzHSq4aZR/roQORMT6vV1+jrQzzP24ua46dtTjiO3Iq6AxME1maAZJrnxEQM1j6yxhwBHUu3TlQQ6AET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O8Dch2cxpLyZ31t2A7y/VdfG9DnHQgddvxLG0uGlvI4tgs9BKUETsZ9dOgmOAldmrPDCEmY7Auphl63frs2oYPXjZNvvVsGW/QdcknyEroNV7ZeHz4fO+VvaqvXQ/PRf7g/nab5+U6ZfvEnos9VMc1hCVp7T1A3pALNDCf2VoyB7XGSe5rUKoe84qLUNWpXmABxrCZKpI3NLDAyrRvsQ2FG3OZTudORIBbg5rCUqvdxoqBAQ==; 5:709/8Fgh4iogCvFtRIcRNL2FCdGBjDrjKFgaSuh11YJAX13tZkAX5buX0ShZDVOVx+PKsODH+Go1YWptoTIEUk3PU0lAaOp0gvBNUqivtbUUXmbRRAltGADDXIW80s1x7UuHRPDmpOtFHQygG5hRsVoojpB1YiopfZE1qd0bVoQ=; 7:CR+ug9kUGqWh9j7+CDQDlBh1CU/t9tMNvxmjVI8rWHnfeL2dbtDxH+0/cClUV8aaiwtxlxEzijUKb+CRvmchhBch35AuiyRTLfKYAhB402iWxrK/Ylf+PsKMketAn3Hrp1awiB8iEeylWfWn6bbmnMvPzI8yw6J3wsZX+vSpMrIFBpUYsJ/NQ288eoUINUxMAx4VZqkGzuNynY9Tc2A+o47pL33q/ZkYRY/36c/K3Dg15ZXRlo16l2VgoPvFhrjf SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2018 10:05:55.7870 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e1ebd885-5ce6-423d-e91e-08d6302a4d92 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4676 Subject: [dpdk-dev] [PATCH v3 11/15] net/dpaa2: update RSS value in mbuf for lx2 platform 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: Hemant Agrawal This patch copies the flc based hw provided hash results to the mbuf rss field for lx2 platform only. Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_rxtx.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index 953fed2ad..e96e84871 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -34,8 +34,10 @@ } while (0) static inline void __attribute__((hot)) -dpaa2_dev_rx_parse_frc(struct rte_mbuf *m, uint16_t frc) +dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd) { + uint16_t frc = DPAA2_GET_FD_FRC_PARSE_SUM(fd); + DPAA2_PMD_DP_DEBUG("frc = 0x%x\t", frc); m->packet_type = RTE_PTYPE_UNKNOWN; @@ -100,6 +102,8 @@ dpaa2_dev_rx_parse_frc(struct rte_mbuf *m, uint16_t frc) default: m->packet_type = RTE_PTYPE_UNKNOWN; } + m->hash.rss = fd->simple.flc_hi; + m->ol_flags |= PKT_RX_RSS_HASH; } static inline uint32_t __attribute__((hot)) @@ -236,8 +240,7 @@ eth_sg_fd_to_mbuf(const struct qbman_fd *fd) first_seg->nb_segs = 1; first_seg->next = NULL; if (dpaa2_svr_family == SVR_LX2160A) - dpaa2_dev_rx_parse_frc(first_seg, - DPAA2_GET_FD_FRC_PARSE_SUM(fd)); + dpaa2_dev_rx_parse_new(first_seg, fd); else first_seg->packet_type = dpaa2_dev_rx_parse(first_seg, (void *)((size_t)DPAA2_IOVA_TO_VADDR(DPAA2_GET_FD_ADDR(fd)) @@ -293,7 +296,7 @@ eth_fd_to_mbuf(const struct qbman_fd *fd) */ if (dpaa2_svr_family == SVR_LX2160A) - dpaa2_dev_rx_parse_frc(mbuf, DPAA2_GET_FD_FRC_PARSE_SUM(fd)); + dpaa2_dev_rx_parse_new(mbuf, fd); else mbuf->packet_type = dpaa2_dev_rx_parse(mbuf, (void *)((size_t)DPAA2_IOVA_TO_VADDR(DPAA2_GET_FD_ADDR(fd)) From patchwork Fri Oct 12 10:04:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreyansh Jain X-Patchwork-Id: 148742 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp539660lji; Fri, 12 Oct 2018 03:07:36 -0700 (PDT) X-Google-Smtp-Source: ACcGV63FdAJCqnraxjm1VBshDAi7DoTD4OX0pVvT3tjnxSeGJWYcEORICNkj7fyZsVZaKXnduSRm X-Received: by 2002:adf:da43:: with SMTP id r3-v6mr4788705wrl.221.1539338856627; Fri, 12 Oct 2018 03:07:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539338856; cv=none; d=google.com; s=arc-20160816; b=Teivba5ur5ySKAO4RYQmoLmcMYTCGkeflY3JZ5yq0iVO94SoeqihDIIkfvRJIcIbLR ly1U9uH0wXfgxVQQZeJnCJJJ6pIB3Txy09wt41re77WsX3ZzhaO6cEp+ZYfsfyn83E1o pS9UucUdHdo1gQGGpDke2jqyxWZDn3eILKJblmra0m01/my9aw03Iyvv20n9kW6/Y9Ep mXhl218Ub4VoNzMZWj5wji4+/XyrSpf6ntaWUtAiSRF6xvfoN130y7s7mOyfhWNv2ttG 2o5zYA5Bo5Q0pOqWnr8axei7YKOSOtASrfRaLeL5srECi4+aD7huzDvmQjOVetGdd83P gFJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:dkim-signature; bh=qTif6LBovk9VlLMg6A/8mS+uHsrXCaDtZ9DESMA/N1s=; b=ieLcWvQ0v+AyOVzT1HAxTrTXjqR2zQmLVpnUo4OMG6ccL5EmKlVMOWxEVqoYuC4swW jk6c/rfdKyJEQQyCLH/HwrGyTtJMMj3v1OkLbY4j6exF0ctsmwll7Ed3r8JjT7gAQp2Y Wy6XDJRHZd+z/FDXHOCL6Qkrxb+riRUHRZHaZtQzUQMGKdY9mOpw/JE4JaxaQdPrAx39 kZ9m+wEcCbKKKSP54w4se0d3KJu/AEtf+bTWcZ2P1jBkV3jq5+smnRlK/l1lmt1VzG5g NKQVZW1HQEoN6WW0dXoztrGk3dkDDxXIS1QrLxpy65oaX6Mg4RA2Qn0OhH7YlrkV3MOs N61A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=pg5O3Hxc; 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 c7-v6si661118wrm.117.2018.10.12.03.07.36; Fri, 12 Oct 2018 03:07:36 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=pg5O3Hxc; 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 F04EE1B4F9; Fri, 12 Oct 2018 12:06:11 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0059.outbound.protection.outlook.com [104.47.0.59]) by dpdk.org (Postfix) with ESMTP id 0CF521B4AE for ; Fri, 12 Oct 2018 12:05:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qTif6LBovk9VlLMg6A/8mS+uHsrXCaDtZ9DESMA/N1s=; b=pg5O3HxcMChdjFpjT0L1Dn7tXmIaNnxa7CCPp/vQerjv35RHengZdrUuwuUNqs41mJvZRhThAxBh3z+bR68KirpvuxsCQUfPkh+ZG0Jq4oDRXL7WK13Z3y43aSH9KBZ/G9m7cjYdZV0dfaAZstgOI4c0Jiwuy+m66/U/Z3xkmM4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.25; Fri, 12 Oct 2018 10:05:57 +0000 From: Shreyansh Jain To: thomas@monjalon.net Cc: ferruh.yigit@intel.com, dev@dpdk.org, Hemant Agrawal Date: Fri, 12 Oct 2018 15:34:23 +0530 Message-Id: <20181012100426.29349-13-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181012100426.29349-1-shreyansh.jain@nxp.com> References: <20180926180440.31726-1-shreyansh.jain@nxp.com> <20181012100426.29349-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BMXPR01CA0004.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::14) To AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 88dd9b99-342c-4e09-ef8e-08d6302a4e65 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB4676; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4676; 3:QvGo5SJwW5kEYMvFjnDaawpJ0atnypPBYvmI7yPAO6Sp2HCT4P1RxYZXLnYyhF6tiXSOTnv6JzCrCl5MoDIGRQ2wIFrtjoTglLKsCXDcxY6HHgvBQmUSlynGsM+O5i99SX1veXhnXogeqzL39PnJmI0LBm8ucDcXzvVngpzIuuHmY4/usbhHaKjd/Hrm4p5kURXLk+4zbPCB968VCmM6+Wj1N2iDD87JBaBKbgAEvqTMQKtxP9MtLEz6isCFrFxS; 25:olIjCDyPgqjSCbsicJ8HPpFYkGftt6wbsrLR0TAkim47/NDioM7kXWB/P0GWtT8bEwgEDSv7lp/DYNI/4matvZJiwONYxLadh5qOV7snCSkMVSFNL4I4sVKd9QPStk8pFOW+suzHboqWoK5AbK6TvJoJgPRoznxm3UIkFJz2y8VxFt/Pa2OdNcTdyd9nrkqEgi7nuiIjk1EEJEj68Xb4mIS+3MBPQ+Kg5XA8pFRqMT+82ORfN7TiXNjSx100B8oX4QKp3JSV7lT9XVsT2ceG4AJWxKdES6HcW8gHbHviROYdD+F4JI7zzOKEBF8EaHQbSH+OSotKBJArgUU0hFzztQ==; 31:KpWdxF1rKRmGqkSGQNcfKfdtlbPWcjQWudHiDXAXtfMZ3haPy4AdHOBr7ibY2iQLTUQFEfbzPfY3P07EjN4+l9eBxClmqlLZPjoc0T4B03qp7ntgFeceSttsvRY+oTKFvWW4q0+DCgSG4smrpSfe3/7YEEmwMx63/ExV6zPXpdyOAIT+/B2QMPNC/7lR3why0IHdIgWzzp7/xV35oirIrg2XM+4DF2TC8lNx6qezXhc= X-MS-TrafficTypeDiagnostic: AM0PR04MB4676: X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4676; 20:iodtQ6SvdDpw/nlciZ47M69hfXNJfJfop+EYGQFO7jUUc9/SfVJE2sJxbgtpLmB7scCJFljAq5s5pRqUODeEOvfs0LGfNAiAonkY4V8ApJoyoj5B19wXKLtAFgO02U78ViazTo3j0gfMeDu4r0TP0MaWfgDg4dzyQyqnnuUFC+mm7im4iacKVK3okbPSwigejb1JxTQqkl+YBZLC/xMJL1fqIZucSd1HrnagQe31Vxk3+vnJ60aLA4J+v58gbIu/YY+hABdnP4kVUnOIwBMA2QC+15vY6xIiuLIjHUYdEGRjuY2gTevzmGHRojLJ7UA1YE2QrH5EeAHbcwPNwvkga5btwCkOzHt0lCUojowOWqQq49Xc4QWeny07DkNhCTjnPPo1+Z7e6ltnT7CSWcnTfczOv2Gx7sAyGnPL5wzwejdTiAr405LeqQvdD4Ii9vQ1QRnECFzeDjLiaT21tdVHLYsm9Z0PL+2QMv20AssF9hI8yXX0LFR6/yBS52HIyfsT; 4:R6a7qxBBJfDf4/bn7dkH20jGJ4ODMrjW0SL6IpnWgd0NMQbJlHwir+2GVmNqFdhKmSCXqlA3WZk3PoicBKhhoSHCcHiY7wf/VN3QO7w3VQeZunJ9zIE6EOXSsgUqs8P7PUhy7065Vi/VRitbZL8btMMJ1SPyD9DDG7a0lJ5TV7U/gR+yEa7/jNThA4PuH9l9PaaT8JyeTvgAFgHW2yP/rEQHEivCLpdHgm+4oKoSnVc5I62sn4ob1swrafEm6wOFceNAVOxb1mVYdd1ZZe+FMrGvdX+Vmg+7n1L8Z74tRZoddYLIYrF3A5hxFxDxUQ2uMclv4KNR29WAHg+8Lqkayk8BJWUqxTT7kFIJKriytSE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:AM0PR04MB4676; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4676; X-Forefront-PRVS: 0823A5777B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(346002)(366004)(136003)(39860400002)(199004)(189003)(2906002)(52116002)(16526019)(53936002)(8676002)(478600001)(186003)(386003)(446003)(105586002)(7736002)(106356001)(6512007)(6116002)(86362001)(3846002)(81156014)(50226002)(68736007)(1076002)(47776003)(5660300001)(6506007)(8936002)(78486009)(36756003)(316002)(26005)(66066001)(6666004)(25786009)(55236004)(81166006)(11346002)(48376002)(76176011)(44832011)(2361001)(956004)(51416003)(2616005)(97736004)(1006002)(50466002)(486006)(476003)(305945005)(16586007)(6916009)(4326008)(6486002)(2351001)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4676; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR04MB4676; 23:zEhkvUO5w6EI1bUpz0pG5adJupYhHg/2dfhbqBNna?= YMeEh5xLx6kd0uAIM088hG66Kh++S+SV4WVuk9EhNY8ueZj8RKS/E16tWhcvRxQtl6RXegJ8bRHY+KtNvSCMelcMIIfQ/X9LaMhzSgxeZtpSn/665BR1qKMVfoz2L2ubO4fZ/Y5hWz/gv2n6cuPmpE14z2T7xY1Qv+7GuDtRjeAbqR2tmtffvnPyn3WU1zZy7ixygJoE7Y/3BtaDXykuEXGVBCHIp6toYWaj4C3Mvod7mn/b7HDAAtmKnAV1dswaDQRj0nc3vjhuIw4xsPrABoUfVvzpMVbPznA1ubukBf1IJRC15qUEQLuzMA5uUUFTyIdAaHqKfJPxTl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T/Rl7YsHCrVFUf0BZsRS2TapjgGyxH4ChiLnLjkkl0OgZL8V3UJFrLrF1CzGpwYPN2Tn3klSItSEjFlssc6s/hRiXuhpQXsE4gOUiCVDf2KN4uiBg33nrnnqFxSj9di4FeCBsIpvyj SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2018 10:05:57.1719 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 88dd9b99-342c-4e09-ef8e-08d6302a4e65 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4676 Subject: [dpdk-dev] [PATCH v3 12/15] net/dpaa2: optimize the fd reset in Tx 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: Hemant Agrawal various field of FD structure was getting reset in scattered fashion. This patch align them in single macro. Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 6 ++++++ drivers/net/dpaa2/dpaa2_rxtx.c | 8 +++----- 2 files changed, 9 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h index ec8f42806..2129b9154 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h @@ -209,6 +209,12 @@ enum qbman_fd_format { #define DPAA2_RESET_FD_CTRL(fd) ((fd)->simple.ctrl = 0) #define DPAA2_SET_FD_ASAL(fd, asal) ((fd)->simple.ctrl |= (asal << 16)) + +#define DPAA2_RESET_FD_FLC(fd) do { \ + (fd)->simple.flc_lo = 0; \ + (fd)->simple.flc_hi = 0; \ +} while (0) + #define DPAA2_SET_FD_FLC(fd, addr) do { \ (fd)->simple.flc_lo = lower_32_bits((size_t)(addr)); \ (fd)->simple.flc_hi = upper_32_bits((uint64_t)(addr)); \ diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index e96e84871..fcd48b389 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -30,7 +30,9 @@ DPAA2_SET_FD_LEN(_fd, _mbuf->data_len); \ DPAA2_SET_ONLY_FD_BPID(_fd, _bpid); \ DPAA2_SET_FD_OFFSET(_fd, _mbuf->data_off); \ - DPAA2_SET_FD_ASAL(_fd, DPAA2_ASAL_VAL); \ + DPAA2_SET_FD_FRC(_fd, 0); \ + DPAA2_RESET_FD_CTRL(_fd); \ + DPAA2_RESET_FD_FLC(_fd); \ } while (0) static inline void __attribute__((hot)) @@ -689,7 +691,6 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) /*Prepare enqueue descriptor*/ qbman_eq_desc_clear(&eqdesc); qbman_eq_desc_set_no_orp(&eqdesc, DPAA2_EQ_RESP_ERR_FQ); - qbman_eq_desc_set_response(&eqdesc, 0, 0); qbman_eq_desc_set_qd(&eqdesc, priv->qdid, dpaa2_q->flow_id, dpaa2_q->tc_index); /*Clear the unused FD fields before sending*/ @@ -717,9 +718,6 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) (*bufs)->seqn = DPAA2_INVALID_MBUF_SEQN; } - fd_arr[loop].simple.frc = 0; - DPAA2_RESET_FD_CTRL((&fd_arr[loop])); - DPAA2_SET_FD_FLC((&fd_arr[loop]), (size_t)NULL); if (likely(RTE_MBUF_DIRECT(*bufs))) { mp = (*bufs)->pool; /* Check the basic scenario and set From patchwork Fri Oct 12 10:04:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreyansh Jain X-Patchwork-Id: 148743 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp539762lji; Fri, 12 Oct 2018 03:07:43 -0700 (PDT) X-Google-Smtp-Source: ACcGV62v3kdCtmQQ7+ULEuc+GGTBfsgx4oNGkhlDdNSYoOA1JUEI0FOwXzNATcVTN2IgbxuqIIQM X-Received: by 2002:a7b:c1d9:: with SMTP id a25-v6mr4614389wmj.55.1539338863417; Fri, 12 Oct 2018 03:07:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539338863; cv=none; d=google.com; s=arc-20160816; b=HBmFC9GPJ5QVG4rXtAiuFiI7fMB8CEawGgv6ItfULo7goLNHvaGx0OajRavjYFr+fx ImbOtNmbPYabKHXwbJhc2NQQppgY0uV1zX5aKH+xyracvaeYY3QzLf4I/erF+gN4gJop eoDUQi5/bPtwpBNT4u4Vi7fa6jWTwlQMCJf3/i9SP2ZO4ftPI5MzLn76qKQQYqpCfTme RiOQKKlGS08YVgOdiuyivRMAJ06bJDZ0rZAArI1gLiKp16S5OeBPbfWTjNniPAtCT6mX yrNDLgWe4JJi4MGJ2CRNTUfsrwpfn1a8kowOKHC6r+aj/6LX8Zz2pF68cV1mhQqKzhu2 SiKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:dkim-signature; bh=3OZvGU2BXLRjr4ecjfH4vNn1maYnOc2QjSCQT27MGyk=; b=vTBond9IwQrPNlvjz8fFX6fFMCD17BgmAfe3Mj28ee6KsmB9JhNBhmS1K5hq90dxkq KlWWDClQ6TboUfjPNMZ82LmArh65WtpnH7FhXEf5/ZmDxERxexL4opAqQGsoVfFrT79O QKxqk/9IId/RA3Ny7+Dl7EQDPz02pyn2SshR9RuAA+4EqW25yczhKyS04z1NeuMoeHI2 RtND1ha0XkDIviPB5VEbFQ9cWdvt++lnO6YEkBt3biiJwFJ+8nffdjH5Df//ysyCGhCu aAVly4p7efH68XJmmbrgrTktUuuRS19bpTgOL13Aj6t5cTnHDTDEBUigilk6k5JW7zSr rTyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=CqBtoTTh; 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 n2-v6si646683wrx.302.2018.10.12.03.07.43; Fri, 12 Oct 2018 03:07:43 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=CqBtoTTh; 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 247421B504; Fri, 12 Oct 2018 12:06:13 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00083.outbound.protection.outlook.com [40.107.0.83]) by dpdk.org (Postfix) with ESMTP id 49CEB1B4B1 for ; Fri, 12 Oct 2018 12:06:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3OZvGU2BXLRjr4ecjfH4vNn1maYnOc2QjSCQT27MGyk=; b=CqBtoTThf9MOmyr7Q/fXIU7w1ohMMVXgMtPg1nGU/RVCjTDJgwy23TcWtmZEruQr9txYYfhFIfoMB1tgFic3Q94rpUxJcrN7iV9MYT6umPlTGXCHwiRgRsGp5l5BcVIoz0RTFIUVeCvupQ9GLRKEEujlK3nJbcTYKUx/VulCNnQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.25; Fri, 12 Oct 2018 10:05:58 +0000 From: Shreyansh Jain To: thomas@monjalon.net Cc: ferruh.yigit@intel.com, dev@dpdk.org, Hemant Agrawal Date: Fri, 12 Oct 2018 15:34:24 +0530 Message-Id: <20181012100426.29349-14-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181012100426.29349-1-shreyansh.jain@nxp.com> References: <20180926180440.31726-1-shreyansh.jain@nxp.com> <20181012100426.29349-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BMXPR01CA0004.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::14) To AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 93f727ac-6369-41f1-e831-08d6302a4f35 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB4676; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4676; 3:6iA6xFj5hjXP61b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qKGmEh9nozjKIMyim8w83pTVhXS2obJNeKhAbUwxLaGjFaLqpQDdcddVMkTqIClAdARry09leN+eJ4MAdv3xyKc0lPZ6Nsawy1nUYywCghKNnteivDkCr8St1F98PO9a3bcUN6QpAZEaTq1oWCi8l3LmAFrQCP68a8RxtLqjeemD43MnRnFKYFaGfJomeh6TAbNLkz9ohVviWUPNVPfJt55JfZ5vFgtPjqzMTKFQn9YJWfUncQos358rn2ylk6ztW0BdYwVi77a5qHrRrAc89YN1ObUUIbg3xCzjvin8XZqhQ2GO33lAzhyxxk2k8AMwN7PiVtwqcGwnd49AtQ7qCgE4; 4:lKpevTpAC/TGdhlGUPSv9FMttYxvwYQL4e3vFObSVxCZYGx17MfFfKE2TDDsa9q3G9aE0RE9zBUEMNCh1zXm/jshR6Pe+V0uIObliqi+bnLcJYu0m2eL7FGCX67riuAmZgawgd7mjHMvnhUGv613QKWfxB+OnxSuvukQsMYt75D4rXHSGBU1V2ZWallr0/ImrwRFXoUEFnUbXYFBiUXyrqzFxi2y96C5URw/JhfkVjjHVOGio9S3aQygEVyFcqCh3l5w13zzQYQ7RArSLfWV0aCzfsuBBMLHYDY189hz6uy+tmDjM/c2P1rVxvYabY9D X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:AM0PR04MB4676; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4676; X-Forefront-PRVS: 0823A5777B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(346002)(366004)(136003)(39860400002)(199004)(189003)(2906002)(52116002)(16526019)(14444005)(53936002)(8676002)(478600001)(186003)(386003)(446003)(105586002)(7736002)(106356001)(6512007)(6116002)(86362001)(3846002)(81156014)(50226002)(68736007)(1076002)(47776003)(5660300001)(6506007)(8936002)(78486009)(36756003)(316002)(26005)(66066001)(6666004)(25786009)(55236004)(81166006)(11346002)(48376002)(76176011)(44832011)(2361001)(956004)(51416003)(2616005)(97736004)(1006002)(50466002)(486006)(476003)(305945005)(16586007)(6916009)(4326008)(6486002)(2351001)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4676; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR04MB4676; 23:gT42yylq4VXhh4PedDZJnon2eCoinvWCrytE496Ry?= sTBqCs3IJLUJVmGwjfw/pjAmbfTxK9H+xWJv847zibhczTnx4kakyQO3/jCFmUd+Kukm2OpFe3N0Zuk8Feo+EXOmBA5uuFL0b48m1UY24Rmq30gZy+LLS72Qq1DV2jhfHc81/ey+VgXNN5/BMmSW/VC2dOBRrzm5U8yvQ779JvAmERCGWaVn8BYaTpInk6buYq0eWN67keBsQLBKLGfbHi7iOdc6jvZoGeHkJg6nmaGWzlK2EIbfmvfQSgeM5Wsy43tb1PKaK4jRMmlS5+OXsUPqnMYfKIUVHVrvhq/iLnmAMUVBSjv9Efuc2qnCLCWeLuNrclxyw1vA6b5x6cfhEOUmZJvsp9YHtSHkonr2/DbrXlPXasZZwYsD7P1SkupwQWClu2g6eTIH3M027j7HLEsqGYD7RoBFKQiaxAus5Fv3iP2JUQMF1zoPdnpQXjoYbNWPCHjEaJ8Qyvde0eyeNyEby4EsQfbe+dEsG1irUCWzHMnjBdL4XvTUEDj2TeXmf0Vk2e7R+nYyXCM2Z5HnzgEqOY3VH4+ax7unD0OiLRwRYMqZQT9Cy9iFiLXyQ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exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2018 10:05:58.5369 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 93f727ac-6369-41f1-e831-08d6302a4f35 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4676 Subject: [dpdk-dev] [PATCH v3 13/15] net/dpaa2: enhance the queue memory cleanup 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" From: Hemant Agrawal Earlier the tx queue data was getting cleaned up in close while rest of the functionality was in un-init. Now a new func is created to free queue memory. Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_ethdev.c | 56 ++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 24 deletions(-) -- 2.17.1 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 46fa38f4a..27ae4740e 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -291,6 +291,35 @@ dpaa2_alloc_rx_tx_queues(struct rte_eth_dev *dev) return -1; } +static void +dpaa2_free_rx_tx_queues(struct rte_eth_dev *dev) +{ + struct dpaa2_dev_priv *priv = dev->data->dev_private; + struct dpaa2_queue *dpaa2_q; + int i; + + PMD_INIT_FUNC_TRACE(); + + /* Queue allocation base */ + if (priv->rx_vq[0]) { + /* cleaning up queue storage */ + for (i = 0; i < priv->nb_rx_queues; i++) { + dpaa2_q = (struct dpaa2_queue *)priv->rx_vq[i]; + if (dpaa2_q->q_storage) + rte_free(dpaa2_q->q_storage); + } + /* cleanup tx queue cscn */ + for (i = 0; i < priv->nb_tx_queues; i++) { + dpaa2_q = (struct dpaa2_queue *)priv->tx_vq[i]; + if (!dpaa2_q->cscn) + rte_free(dpaa2_q->cscn); + } + /*free memory for all queues (RX+TX) */ + rte_free(priv->rx_vq[0]); + priv->rx_vq[0] = NULL; + } +} + static int dpaa2_eth_dev_configure(struct rte_eth_dev *dev) { @@ -868,23 +897,13 @@ dpaa2_dev_stop(struct rte_eth_dev *dev) static void dpaa2_dev_close(struct rte_eth_dev *dev) { - struct rte_eth_dev_data *data = dev->data; struct dpaa2_dev_priv *priv = dev->data->dev_private; struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; - int i, ret; + int ret; struct rte_eth_link link; - struct dpaa2_queue *dpaa2_q; PMD_INIT_FUNC_TRACE(); - for (i = 0; i < data->nb_tx_queues; i++) { - dpaa2_q = (struct dpaa2_queue *)data->tx_queues[i]; - if (!dpaa2_q->cscn) { - rte_free(dpaa2_q->cscn); - dpaa2_q->cscn = NULL; - } - } - /* Clean the device first */ ret = dpni_reset(dpni, CMD_PRI_LOW, priv->token); if (ret) { @@ -2027,8 +2046,7 @@ dpaa2_dev_uninit(struct rte_eth_dev *eth_dev) { struct dpaa2_dev_priv *priv = eth_dev->data->dev_private; struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; - int i, ret; - struct dpaa2_queue *dpaa2_q; + int ret; PMD_INIT_FUNC_TRACE(); @@ -2042,17 +2060,7 @@ dpaa2_dev_uninit(struct rte_eth_dev *eth_dev) dpaa2_dev_close(eth_dev); - if (priv->rx_vq[0]) { - /* cleaning up queue storage */ - for (i = 0; i < priv->nb_rx_queues; i++) { - dpaa2_q = (struct dpaa2_queue *)priv->rx_vq[i]; - if (dpaa2_q->q_storage) - rte_free(dpaa2_q->q_storage); - } - /*free the all queue memory */ - rte_free(priv->rx_vq[0]); - priv->rx_vq[0] = NULL; - } + dpaa2_free_rx_tx_queues(eth_dev); /* free memory for storing MAC addresses */ if (eth_dev->data->mac_addrs) { From patchwork Fri Oct 12 10:04:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreyansh Jain X-Patchwork-Id: 148744 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp539898lji; Fri, 12 Oct 2018 03:07:50 -0700 (PDT) X-Google-Smtp-Source: ACcGV61lua0zS6ow1ffqXdmwvpyvWDbRH7xZsy475HOLVGMoE3QTr5pDTBRJ52apqEmXifKBjt7o X-Received: by 2002:a1c:d0c8:: with SMTP id h191-v6mr3215341wmg.74.1539338870877; Fri, 12 Oct 2018 03:07:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539338870; cv=none; d=google.com; s=arc-20160816; b=pRdu0cq9/cvjz1I4x9kSs3I6tpcstGkrwZRt3LNnzwygUpqH9PBUFkEEFaSxCq1sZG nroTixfT50jtwUxNG3wqvJpLZLE52eZ5wKveW4anx4Yoi3SMT/L4FFgRI0elzLKtyRW9 evw5fgTqn57iYMRUqRVRW5Pts68Gbz7c/XnGfmKAkqlXD2y/B4Lb/msjBnx2TjSBkNsT LvPZfiAWpGrum1XK43f47Mk9BPhOAOAAJWDIODHBGvowUrZcIGN83YpyihaquqrK8xpM TMcj3blE70AT7NJjUE6nARwSObZ9l8YybTLYCYK7PKov9feF1fZdi1HQiJzMV9PDFEkZ fptQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:dkim-signature; bh=+UIbJks+YvdIkGtgSGUGw0KA3rkbgOmJAUxPhm6hjYE=; b=D3l7ZneOD5Vyn5+shVtJPwF06o5EWZqakBAWJa6wLhpqGNTNdVx1iNG3+V2TTH8//w MCVGviFMkH67ikcWzlUBLDf6dXFqCtpPjNjqiJeycZq2jh7vdP0CYrJLfS8Q9L5vjWA3 Xk95gpYxmbqnxIA/KcUbgUQOus2JOkIe0yUBXI7z0aa7acF7Zvr/ZmuK7zn7i+VolGnf O/ZT9QqRo71BXqiY2Zyv+RCBCelYwDgL6+bzSyf9V3dDyPESa+hO607YXXbxM62eBqU/ 5zqF45loUlISsMPK+MMtNqLUVtUdfHR+B8Tq3q9r9UIF+S7cs5ms7uW8rSMoHqbqYAqC 26XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=I7bHpuvp; 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 r13-v6si683087wrt.313.2018.10.12.03.07.50; Fri, 12 Oct 2018 03:07:50 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=I7bHpuvp; 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 4D6B21B510; Fri, 12 Oct 2018 12:06:14 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00078.outbound.protection.outlook.com [40.107.0.78]) by dpdk.org (Postfix) with ESMTP id BFD1D1B4AE for ; Fri, 12 Oct 2018 12:06:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+UIbJks+YvdIkGtgSGUGw0KA3rkbgOmJAUxPhm6hjYE=; b=I7bHpuvpA+lU5KTC4mzN9QVa8M5/LwbW8oEZalhGQrS8D7vJLuFVXh/xoKyjot5ca7BwzcYdx+PgF3w4AiXqz3nuCrBLJrQhGZiOkO0zXhkM9S7l8mzPpEiWMbX7csPHyB7kfJTIbvpdiTc6zJjeL1QLPhRB8eiiLueaqgbQ7UA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.25; Fri, 12 Oct 2018 10:05:59 +0000 From: Shreyansh Jain To: thomas@monjalon.net Cc: ferruh.yigit@intel.com, dev@dpdk.org, Hemant Agrawal Date: Fri, 12 Oct 2018 15:34:25 +0530 Message-Id: <20181012100426.29349-15-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181012100426.29349-1-shreyansh.jain@nxp.com> References: <20180926180440.31726-1-shreyansh.jain@nxp.com> <20181012100426.29349-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BMXPR01CA0004.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::14) To AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5bea2dc3-5860-4b3b-d559-08d6302a500b X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB4676; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4676; 3:JJSm9aHUdD5Ar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I0TvMGg/iNR8PmiB5utLj3Ked24ljycLV1xS8DOKbfkR3A124RjveVXTxcsIibT3TMnFcnUBg5h1ASNHp+N7IhjNQJiJYZF+hM2D9cMSMu+qBjAN5iBMzeVST2krxg6TzNw32fO4RLHiCFr8QLcrzDz6zz8KyFyhqz7B4G9V4o7ZMD0+KFkPYOFkAxbiU2vovaVex+0mF1U8kt17EPqjXMXfK9iMREr8aKu2tpJcq0h11sTty1amXhuLhzPtyPrjn1sq2S+A8OzlMqIqhH/dOTudu+gkhuoEgP57LxLidG/f9IikoEtKJkcMbbqUFo33n4UpUFcki; 4:P2/EqJV1GkTSULXBBvxnnWRSVMSDJCgTHzv9slcuLFMhLFlpVG04jLWUTL5QpginufdMzzILaeByN2BFAm37V9JwS9YPjxqvwBs8gge+/mIxu/PCppCxvNKqfdyI0bGPl/5Z0MaHg73hK+iC9Rw2/YTOjSguquG7+7Ker+zE+HioflMXMHzR5Dz1LvhJDBrthQ108bqBCAiwyiI3JXM0QeUmgNHg298L/WQFcYCJMvJUxl2tsabbc/StDtnSZEamB4HfYIRtgqERHXaUu5C+BJ1aKIld6jEIycchlvK/QkYUmX0trz9O5sIHaopF1S0q X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:AM0PR04MB4676; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4676; X-Forefront-PRVS: 0823A5777B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(346002)(366004)(136003)(39860400002)(199004)(189003)(2906002)(52116002)(16526019)(14444005)(53936002)(8676002)(478600001)(186003)(386003)(446003)(105586002)(7736002)(106356001)(6512007)(6116002)(86362001)(3846002)(81156014)(50226002)(68736007)(1076002)(47776003)(5660300001)(6506007)(8936002)(78486009)(36756003)(316002)(26005)(66066001)(6666004)(25786009)(55236004)(81166006)(11346002)(48376002)(76176011)(44832011)(2361001)(956004)(51416003)(2616005)(97736004)(1006002)(50466002)(486006)(476003)(305945005)(16586007)(6916009)(4326008)(6486002)(217873002)(2351001)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4676; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR04MB4676; 23:8svN5dYPzEb+VzNGUR/gGkrq/6Fy9UAu13DF12VYR?= CVzE55aKFwTdJWnJ8vykeN6wo/5x77Z0ncdC/fciVUBFLGjrXRNegQTVzb0tfEQRC7RufRqb1aM+K3NycG1MDcKXpmHivRcHh7+3mukBL/YLyIzpuVvwtyi3RdKPSsSB5t9AbVea4kfmbVgfWksAXLM7LkKAAcU7YKkQ6+ZUORy7kJo9jeQ08eE+/HomVzbFPsDUiI33KO06b2//t/RHZNQUmf1d5Huq1TyCD24PYNg4h+FLBYibHX8cLAvHqIQtxqnBYCfbLfsZLhdgrFmDqk1ZNGEbOqyd91kQp5TsH8qPU9qgpgcfeu5TZpGMusnkBmO4sDJmxYcfsO78pxM9ZrqhW8k9vou0yMh+7EPatHMt8bI7xyM7Ph+eoyme+bsyGqWa5DdA3r29Mbx4MghrwbR8OyiTseDhDgkwW0pQ2qdhWIPjBwQqvdqMUGqmMrBPESf9hHx8xYQGX49yNsQlkCdc1PsGEoSUusv5b7VdlSb+KrU40qNJsMW5pC/X7pBr9SMnYEZo+oR3+tt1wJLWP1hJlW/jEa2HzwqgnB4dFrJ6CXi6GedDrhdtgVqGZOTaj5Gq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bFex/OMQ8T2JydzpfWvhD6msqyhfqRRs3dQk138VS6y/krTzuFA8Z9YArc0= X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4676; 6:DjF7WM5I272cKI0IGfS5zTXMR9A7zS+durjKxBjO3/WE52D+51SLxbEt/QGQF0qcM4PLUb0hgsIvWeL3AGfDJz3curnaHbYAdJ9O7xDzMPtmMGTcDpHKdj5Go/InchKGMNdWCBBpH+vsi+DE2Wg3p2VZZrkBmoCebMDlkXqnNKZIy1ERdexZIz67C/KaddZt651XYKFEeUAnCT6p9623vu25D2mB9jIitLlEyaDzKTULTON7waISddlTwHZApP8kmmG2DiFGc5EvTVMa1c+jRW0snSkjva04sHSfslpK20QyvrhlrgGwzNlWJ1j5rSr4jbAyN4Mdl9Yk1CiPdSibmE3y9uxxOq+h8RBmj5c0pv05i4uCmxPerbJxClAYvCz7ghx5sxrCXBszo+Cy80f/HpfFDeN1Nzd10NYyzhgaVVZExR3XnvHShZIb/cpfmIZGzSiYsaNinh8PjzbdGCHNNg==; 5:6nXIKHHP0QIEmzr8aLPZ26uZC0gT7XYOSRVnVKUUqH/n55hduw/YjTgJwKBziVSpKlizoPa4P6PsYaWOQTKoi9W9FwdZcjh5ZF0zzpVrwqR0kXxAiY7x4LbI/m4QW2xSDtvf0xuXYsQuG/brcIixxO53WOD9mrYfah3RPSDYf48=; 7:vc3LQZlQNYioEPfHGrKvaST6aSggPeiAgn9ohc4oWFzNeS9gpB+P6qdKhwpSuWRDzoOsUB/XyMHUIOt1S++bhqN1YdtNRPlceIopXV2OQmW6rhxXmYJ1dgwU1NCUuBsy/GLJph26dnmaoDlDa+POp1eMGeeQwb4/QahDE/G6p95nC33/HMA3IS8+HykQQ0mEEnwhH8fJaDP0ZXhIS7+jzEqZON1ticfz4POZGHJP+nYZBJOpRKfIZWFRzclua8wx SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2018 10:05:59.9319 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5bea2dc3-5860-4b3b-d559-08d6302a500b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4676 Subject: [dpdk-dev] [PATCH v3 14/15] net/dpaa2: support MBUF VLAN tci population from HW parser 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: Hemant Agrawal This patch adds the support to update the mbuf vlan tci field from the HW parse results in annotation area. Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/base/dpaa2_hw_dpni_annot.h | 40 ++++++++++++++ drivers/net/dpaa2/dpaa2_rxtx.c | 55 +++++++++++++------- 2 files changed, 75 insertions(+), 20 deletions(-) -- 2.17.1 diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni_annot.h b/drivers/net/dpaa2/base/dpaa2_hw_dpni_annot.h index 779cdf2b2..adb730b71 100644 --- a/drivers/net/dpaa2/base/dpaa2_hw_dpni_annot.h +++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni_annot.h @@ -213,6 +213,46 @@ struct dpaa2_annot_hdr { #define DPAA2_L3_IPv6_UDP (L3_IPV6_1_PRESENT | L3_IPV6_1_UNICAST | \ L3_PROTO_UDP_PRESENT | L4_UNKNOWN_PROTOCOL) +/** + * Macros to get values in word5 + */ +#define SHIM_OFFSET_1(var) ((uint64_t)(var) & 0xFF00000000000000) +#define SHIM_OFFSET_2(var) ((uint64_t)(var) & 0x00FF000000000000) +#define IP_PID_OFFSET(var) ((uint64_t)(var) & 0x0000FF0000000000) +#define ETH_OFFSET(var) ((uint64_t)(var) & 0x000000FF00000000) +#define LLC_SNAP_OFFSET(var) ((uint64_t)(var) & 0x00000000FF000000) +#define VLAN_TCI_OFFSET_1(var) ((uint64_t)(var) & 0x0000000000FF0000) +#define VLAN_TCI_OFFSET_N(var) ((uint64_t)(var) & 0x000000000000FF00) +#define LAST_ETYPE_OFFSET(var) ((uint64_t)(var) & 0x00000000000000FF) + +/** + * Macros to get values in word6 + */ +#define PPPOE_OFFSET(var) ((uint64_t)(var) & 0xFF00000000000000) +#define MPLS_OFFSET_1(var) ((uint64_t)(var) & 0x00FF000000000000) +#define MPLS_OFFSET_N(var) ((uint64_t)(var) & 0x0000FF0000000000) +#define ARP_OR_IP_OFFSET_1(var) ((uint64_t)(var) & 0x000000FF00000000) +#define IP_N_OR_MIN_ENCAP_OFFSET(var) ((uint64_t)(var) & 0x00000000FF000000) +#define GRE_OFFSET(var) ((uint64_t)(var) & 0x0000000000FF0000) +#define L4_OFFSET(var) ((uint64_t)(var) & 0x000000000000FF00) +#define GTP_OR_ESP_OR_IPSEC_OFFSET(var) ((uint64_t)(var) & 0x00000000000000FF) + +/** + * Macros to get values in word7 + */ +#define IPV6_ROUTING_HDR_OFFSET_1(var) ((uint64_t)(var) & 0xFF00000000000000) +#define IPV6_ROUTING_HDR_OFFSET_2(var) ((uint64_t)(var) & 0x00FF000000000000) +#define NEXT_HDR_OFFSET(var) ((uint64_t)(var) & 0x0000FF0000000000) +#define IPV6_FRAG_OFFSET(var) ((uint64_t)(var) & 0x000000FF00000000) +#define GROSS_RUNNING_SUM(var) ((uint64_t)(var) & 0x00000000FFFF0000) +#define RUNNING_SUM(var) ((uint64_t)(var) & 0x000000000000FFFF) + +/** + * Macros to get values in word8 + */ +#define PARSE_ERROR_CODE(var) ((uint64_t)(var) & 0xFF00000000000000) +#define SOFT_PARSING_CONTEXT(var) ((uint64_t)(var) & 0x00FFFFFFFFFFFFFF) + /* Debug frame, otherwise supposed to be discarded */ #define DPAA2_ETH_FAS_DISC 0x80000000 /* MACSEC frame */ diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index fcd48b389..bc8b9ff89 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -25,6 +25,10 @@ #include "dpaa2_ethdev.h" #include "base/dpaa2_hw_dpni_annot.h" +static inline uint32_t __attribute__((hot)) +dpaa2_dev_rx_parse_slow(struct rte_mbuf *mbuf, + struct dpaa2_annot_hdr *annotation); + #define DPAA2_MBUF_TO_CONTIG_FD(_mbuf, _fd, _bpid) do { \ DPAA2_SET_FD_ADDR(_fd, DPAA2_MBUF_VADDR_TO_IOVA(_mbuf)); \ DPAA2_SET_FD_LEN(_fd, _mbuf->data_len); \ @@ -40,8 +44,6 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd) { uint16_t frc = DPAA2_GET_FD_FRC_PARSE_SUM(fd); - DPAA2_PMD_DP_DEBUG("frc = 0x%x\t", frc); - m->packet_type = RTE_PTYPE_UNKNOWN; switch (frc) { case DPAA2_PKT_TYPE_ETHER: @@ -95,31 +97,45 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd) m->packet_type = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_ICMP; break; - case DPAA2_PKT_TYPE_VLAN_1: - case DPAA2_PKT_TYPE_VLAN_2: - m->ol_flags |= PKT_RX_VLAN; - break; - /* More switch cases can be added */ - /* TODO: Add handling for checksum error check from FRC */ default: - m->packet_type = RTE_PTYPE_UNKNOWN; + m->packet_type = dpaa2_dev_rx_parse_slow(m, + (void *)((size_t)DPAA2_IOVA_TO_VADDR(DPAA2_GET_FD_ADDR(fd)) + + DPAA2_FD_PTA_SIZE)); } m->hash.rss = fd->simple.flc_hi; m->ol_flags |= PKT_RX_RSS_HASH; } static inline uint32_t __attribute__((hot)) -dpaa2_dev_rx_parse_slow(struct dpaa2_annot_hdr *annotation) +dpaa2_dev_rx_parse_slow(struct rte_mbuf *mbuf, + struct dpaa2_annot_hdr *annotation) { uint32_t pkt_type = RTE_PTYPE_UNKNOWN; + uint16_t *vlan_tci; + + DPAA2_PMD_DP_DEBUG("(slow parse)annotation(3)=0x%" PRIx64 "\t" + "(4)=0x%" PRIx64 "\t", + annotation->word3, annotation->word4); + + if (BIT_ISSET_AT_POS(annotation->word3, L2_VLAN_1_PRESENT)) { + vlan_tci = rte_pktmbuf_mtod_offset(mbuf, uint16_t *, + (VLAN_TCI_OFFSET_1(annotation->word5) >> 16)); + mbuf->vlan_tci = rte_be_to_cpu_16(*vlan_tci); + mbuf->ol_flags |= PKT_RX_VLAN; + pkt_type |= RTE_PTYPE_L2_ETHER_VLAN; + } else if (BIT_ISSET_AT_POS(annotation->word3, L2_VLAN_N_PRESENT)) { + vlan_tci = rte_pktmbuf_mtod_offset(mbuf, uint16_t *, + (VLAN_TCI_OFFSET_1(annotation->word5) >> 16)); + mbuf->vlan_tci = rte_be_to_cpu_16(*vlan_tci); + mbuf->ol_flags |= PKT_RX_VLAN | PKT_RX_QINQ; + pkt_type |= RTE_PTYPE_L2_ETHER_QINQ; + } - DPAA2_PMD_DP_DEBUG("(slow parse) Annotation = 0x%" PRIx64 "\t", - annotation->word4); if (BIT_ISSET_AT_POS(annotation->word3, L2_ARP_PRESENT)) { - pkt_type = RTE_PTYPE_L2_ETHER_ARP; + pkt_type |= RTE_PTYPE_L2_ETHER_ARP; goto parse_done; } else if (BIT_ISSET_AT_POS(annotation->word3, L2_ETH_MAC_PRESENT)) { - pkt_type = RTE_PTYPE_L2_ETHER; + pkt_type |= RTE_PTYPE_L2_ETHER; } else { goto parse_done; } @@ -179,16 +195,15 @@ dpaa2_dev_rx_parse(struct rte_mbuf *mbuf, void *hw_annot_addr) DPAA2_PMD_DP_DEBUG("(fast parse) Annotation = 0x%" PRIx64 "\t", annotation->word4); - /* Check offloads first */ - if (BIT_ISSET_AT_POS(annotation->word3, - L2_VLAN_1_PRESENT | L2_VLAN_N_PRESENT)) - mbuf->ol_flags |= PKT_RX_VLAN; - if (BIT_ISSET_AT_POS(annotation->word8, DPAA2_ETH_FAS_L3CE)) mbuf->ol_flags |= PKT_RX_IP_CKSUM_BAD; else if (BIT_ISSET_AT_POS(annotation->word8, DPAA2_ETH_FAS_L4CE)) mbuf->ol_flags |= PKT_RX_L4_CKSUM_BAD; + /* Check detailed parsing requirement */ + if (annotation->word3 & 0x7FFFFC3FFFF) + return dpaa2_dev_rx_parse_slow(mbuf, annotation); + /* Return some common types from parse processing */ switch (annotation->word4) { case DPAA2_L3_IPv4: @@ -211,7 +226,7 @@ dpaa2_dev_rx_parse(struct rte_mbuf *mbuf, void *hw_annot_addr) break; } - return dpaa2_dev_rx_parse_slow(annotation); + return dpaa2_dev_rx_parse_slow(mbuf, annotation); } static inline struct rte_mbuf *__attribute__((hot)) From patchwork Fri Oct 12 10:04:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreyansh Jain X-Patchwork-Id: 148745 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp540001lji; Fri, 12 Oct 2018 03:07:56 -0700 (PDT) X-Google-Smtp-Source: ACcGV62m43shN+aIaWmYEx80XKbjtQHVY+RYIQPf4BDMcaUyzBi9egloPNffP6aDVpC3l54zfh60 X-Received: by 2002:adf:8909:: with SMTP id s9-v6mr4735332wrs.309.1539338876494; Fri, 12 Oct 2018 03:07:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539338876; cv=none; d=google.com; s=arc-20160816; b=Wa4UMWSZrZDgnDDEkITf2zFGYhP0vqJkudj33Q2Pf050RhPtDOzzttzoVoZagkImsY Xpdg3+JL9Qz4iKo74Akr9gGQf3lYnXct7lP7SacF7P5K4kV/YzxdzlOlLD0HyOzfw5r4 q+nofAJ4EM9g/W0/4Bs70qiLKRYjmv1Hlldl2j4xkTniEandivfdfC7KSnSZupjJm25m ejklqpZJkmX3UJgFzmXQT9tWCqLIyd42TPjVHiW9WW0tGxUrvSefmzDkzaJe65mZlQL+ g3yjQfru2ZvlWI3W8zm+tUsZtg2MPnbC7VyeNqAB7DmKyKE2MTYpG4uOyZdhO8DYNqsY KGVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:dkim-signature; bh=vXZCySwQ9DK6AlstYfLeEq6bfkEBCmpQPt4ORCCClNE=; b=DXTswPFiJGKrtQ3cyZhZRn+jBr4QgTImWmYINhW8DzhuvQBq711UAE/2+TJZwe8gcL sq1oix9TlwdFv3Ya5OKYPql11mp7pSxaaLXkx86SpuTdmAGVk3MC/Nwb85hmZvtQCPM+ aEHCylGTGwTDqLkiOSNjUrLR9zkjEjaacuBDG2rVZolcirw6Xes2htzUNywwOOrlSP/m KYqNaI4LabPpgaiasvK/UoxrM8kiccJLFJa/osWnW0dkGs0vDtxVwLZtvDmAkiExNr3E N8H806FxomW3jK246I3HjOfYX3UyN3VX8Y3HIkJP6bXfeV8sj5TFZ2AiTgMC4+bL61uQ KcEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=K53dEJAy; 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 h190-v6si919046wma.160.2018.10.12.03.07.56; Fri, 12 Oct 2018 03:07:56 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=K53dEJAy; 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 846A51B519; Fri, 12 Oct 2018 12:06:15 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00082.outbound.protection.outlook.com [40.107.0.82]) by dpdk.org (Postfix) with ESMTP id 2B6A21B4A3 for ; Fri, 12 Oct 2018 12:06:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vXZCySwQ9DK6AlstYfLeEq6bfkEBCmpQPt4ORCCClNE=; b=K53dEJAyvEHDju/KgH711wajlwi6LkJuzTvoNAKqZAYKdQEWk8JW3mCrGp1j6glXha19O9D3I0XN/oK0exVmiTxrBtxtMyreL7Nch6EOZrQWP5abntNU1Oe2cVN96Vb9BQElUmkwXRHmzAImULFAc3v6A5l4jGD0sxi90uEdjBg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.25; Fri, 12 Oct 2018 10:06:01 +0000 From: Shreyansh Jain To: thomas@monjalon.net Cc: ferruh.yigit@intel.com, dev@dpdk.org, Hemant Agrawal Date: Fri, 12 Oct 2018 15:34:26 +0530 Message-Id: <20181012100426.29349-16-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181012100426.29349-1-shreyansh.jain@nxp.com> References: <20180926180440.31726-1-shreyansh.jain@nxp.com> <20181012100426.29349-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BMXPR01CA0004.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::14) To AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ac851fae-d147-4d45-06f7-08d6302a50dd X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB4676; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4676; 3:A3waOLZ43weLa+6PPeKYYpbt+LtNhJVtC4EOsgVtvBpw8klnbMubtVPNDEx5WI13iWzjgDoOQ2euaF7PmOhGaSBLMRf3w+yKcZRguE36uPJPyIjTnCoA4CTV9+w+VW3Ug88ZECf2g44kHmkojIosjV8iGvKUxHgUQvLRQyDa4DHVp9qaksW0agbm9OCgSOMLcroUnrUBDekHciXIQq07h2aimT5uvsFJ5HgPMJt+WnGT2fU7Y00U9EQyXtLM880P; 25:3tofZlEB2q8Au3pbGtL64rH7ZBf3F1iyTHtAO1ITYYFcmOl8bOhW+fEw/VrW1NkAjrt1SIMGSgpJOqkpFLdJRs85dNeyjwsworIhdfnk18BBkw+rZURLZU3r4WWNSmtx9RAQ2fufYzO3AIEJhwybQELiiZGQkHI/luRmbPUI0CkCPbWk/vs2R2KT57GR0R6s+ThhLnG4YA3Ml0D+TfenLUz9YcaT0rlg/ATOZHQ6Hvbj3kXeAWHWCJRMK1XAqxQM3frpfY3BS0SX8/2MCaFRMHryzDWmQyyot2HpVzFhrGzogC4tjZCxHkQFCFey4JG8dH5zETxui6UBGaAs/ys4WQ==; 31:feJSaPrCWydBddYgM2Rd2xHtvmw3DvFl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33bTvqd556Ghy1+6ku4z1ANr4VIqKL3 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:AM0PR04MB4676; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4676; X-Forefront-PRVS: 0823A5777B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(346002)(366004)(136003)(39860400002)(199004)(189003)(2906002)(52116002)(16526019)(53936002)(8676002)(478600001)(186003)(386003)(446003)(105586002)(7736002)(106356001)(6512007)(6116002)(86362001)(3846002)(81156014)(50226002)(68736007)(1076002)(47776003)(5660300001)(6506007)(8936002)(78486009)(36756003)(316002)(26005)(66066001)(6666004)(25786009)(55236004)(81166006)(11346002)(48376002)(76176011)(44832011)(2361001)(956004)(51416003)(2616005)(97736004)(1006002)(50466002)(486006)(476003)(305945005)(16586007)(6916009)(4326008)(6486002)(2351001)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4676; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR04MB4676; 23:1oqrX49OHx76fqT+fmj7uxQ0I7bVrNOJ/P1IYCX7n?= zUtAQA7KLkCOfY7JCHjKGTl7oyAp3rgWfYai7JBZm5Ox0fLCyOJqJQuGIZW2Q+MWi58e3jOlCZ5b74fKtCbMJ+6Rja/DvKTc5QcKuFqHN4wiTopkj1DMzC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B6tuzUiuwOgPinEo5Cy2GbvBhF9atzlgi4lE3+/TGUXGnAHz0nI+LtJ7WpZke5ry/BvtI8f/xWluLaL49I5t7k=; 7:F8NxxI+kD+mwvnVcXtnFrnZpay6aCAr8HLQStl3o1DwC/+NeLibwOMvH9XZ+bea9Ois6jk7RvvI0Sal0IKRqmwC7qB8GVlYU4LaawShf4fptwN79lbawQ4PrIcqy8OAMQrOlmIObXV/NpJFFLSWqy5tEn0ZkwuO8gooK4/95UdezortXjGBIRZcLOn5EpVYKBOhq//r/JrPcrdgTjLo8xcZBu83dEb9nUvJTZTfDWhb4TnTY+2AR7pfGAA9BgZoM SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2018 10:06:01.3099 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ac851fae-d147-4d45-06f7-08d6302a50dd X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4676 Subject: [dpdk-dev] [PATCH v3 15/15] net/dpaa2: support Rx checksum offload in slow parsing 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: Hemant Agrawal This is required for new mode for LX2 platform specifically Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_rxtx.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.17.1 diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index bc8b9ff89..eab943dcf 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -157,6 +157,11 @@ dpaa2_dev_rx_parse_slow(struct rte_mbuf *mbuf, goto parse_done; } + if (BIT_ISSET_AT_POS(annotation->word8, DPAA2_ETH_FAS_L3CE)) + mbuf->ol_flags |= PKT_RX_IP_CKSUM_BAD; + else if (BIT_ISSET_AT_POS(annotation->word8, DPAA2_ETH_FAS_L4CE)) + mbuf->ol_flags |= PKT_RX_L4_CKSUM_BAD; + if (BIT_ISSET_AT_POS(annotation->word4, L3_IP_1_FIRST_FRAGMENT | L3_IP_1_MORE_FRAGMENT | L3_IP_N_FIRST_FRAGMENT |