From patchwork Thu Dec 27 06:22:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 154546 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6604176ljp; Wed, 26 Dec 2018 22:23:02 -0800 (PST) X-Google-Smtp-Source: ALg8bN4zzqaaDhuoOQHi+4oksIcRBf9iDeMHgSeVzCU5SmCGdQM26W5jhRQonBaplo+ncWM+r+nA X-Received: by 2002:adf:ee07:: with SMTP id y7mr21723150wrn.187.1545891782669; Wed, 26 Dec 2018 22:23:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545891782; cv=none; d=google.com; s=arc-20160816; b=Vo0wj9YFgmtZWcBZB1A3RYeW1qXwH4fm8yRL+Ne0r6fhUhuA4xvHQ2N/1ju0VCFcTN FW0Nmd3bT4sL/NJ6LuvBoMJrVotavKr+X1YoppiTnu6m5r8VVWSIwwu57mjE8j/9jKcF 38M6PRG7EM0Y6iFyN1pC9DHkFZZTI4o5pQpoHwHR/Ky2ut+M0afE/aeucYzXI48lWsUk RGmSi7LRlpt2/Wv91mvBYIgAU3K0Np+H43gQGtQr4qBOGVBnx3AJL7x3e8BbQd5Ep/s4 akBTjETOf5qc6dcEySZEB8NGSPfw7b9t2hPe7jseldED3e80zrJjJs7oEfuQBE15JoFS aWtA== 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:mime-version :content-transfer-encoding:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:cc:to:from :dkim-signature; bh=98HGaX7fKPo/UfVLLd9DuOJZApe+vHFZqqQd3NfLQaM=; b=POtZz6oxOsZ6PBw6kqjvf7Wa6qtKKZYYKGcni4JSwOBVBvzTmXtbmbwSRsXk5n/uEw X7Kf0qQo2JWn8yBbuoe5zd/TaWY+n0tcFNWn6jMxEHbadV+78zoLkNXC71Gx2ZXE8P6x Q+zHBoj4xZNzc1nx9i+abXlVVlcUEcmnIRfMeyUfGRWnA1X+naILpcdWqrCxGjQ5zo2Y fhmZ1pFlES9Vc80TWVdB60jXZiPOXvqdLFdZ7ULUEjbSFEjRMIXOkWirQIHBFsOF9bQP 7lwSHn0YvnxjKjI2zsz5DEIp3YN1Qt/1muC8ffYDuW/u5cHFfKRzzWn0yuSbmmKfD0BD zQ3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=JpMOGMmB; 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 w62si16611012wmb.102.2018.12.26.22.23.02; Wed, 26 Dec 2018 22:23:02 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=JpMOGMmB; 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 6607A3798; Thu, 27 Dec 2018 07:22:55 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140081.outbound.protection.outlook.com [40.107.14.81]) by dpdk.org (Postfix) with ESMTP id D406F325F; Thu, 27 Dec 2018 07:22:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=98HGaX7fKPo/UfVLLd9DuOJZApe+vHFZqqQd3NfLQaM=; b=JpMOGMmBfckx1NuI3O97zVxzByr3Jv3hxefuTPYwDJCHPK94I/m7hZZVEM3TeR9dR1GFPjzJVHfFkkjt7/eC1LFfnyXsMVKBrcDzqkj8CxAmYaGkJ4qGEyQb+c73Azu/C/VlpBvBQQb2iL1kKxChP1xpvSp3QueNBOubXX/ac80= Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com (10.168.65.19) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.134.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Thu, 27 Dec 2018 06:22:52 +0000 Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4]) by VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4%2]) with mapi id 15.20.1471.019; Thu, 27 Dec 2018 06:22:52 +0000 From: Hemant Agrawal To: "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , Shreyansh Jain , Sachin Saxena , "stable@dpdk.org" Thread-Topic: [PATCH 01/20] bus/fslmc: fix to reset portal memory before use Thread-Index: AQHUnayYHB0L3DTgP0KxM1nYldyJyA== Date: Thu, 27 Dec 2018 06:22:52 +0000 Message-ID: <20181227062233.30781-2-hemant.agrawal@nxp.com> References: <20181227062233.30781-1-hemant.agrawal@nxp.com> In-Reply-To: <20181227062233.30781-1-hemant.agrawal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.143.30.134] x-mailer: git-send-email 2.17.1 x-clientproxiedby: BM1PR01CA0120.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:40::14) To VI1PR0401MB2541.eurprd04.prod.outlook.com (2603:10a6:800:56::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0401MB2382; 6:OZ/bYkFyUbPyC4bg0F/KhisETpXAGgpyEScFPkHPxyxZgksgZP8EFJPVk54lX4Z3+DyOhm0dGlTbrZgR/5kxF7gtSM0m9bz5HamuV6zTiqN2j4LBK1kU93MdHl6pVoZJ4s0Eyf6R/MNji9VxQuWkpGE7DWBbSLAiS/dZ2EVjeHkUeu9deAPSm1Nj7vMjw/pbss8Pt1JpqHJQU31eSMxAAZZu7L9Uq1oCMYqaZR35RlTOhOkxb/yEVuLE5jIU5Bap8pBR0Az19k055fvXfkmsjfQiPADYDsu7TdUW+wzaqtAW8hzbzqkv7rtZ03qS25GJNrPk8cQoLDiGYOo1skdsiL8zF95+yQbCkO7IAB6M5EMnKgDZQ9Z6xlsw3soK/brJLj9kgVyJG+p/y6mPx9nIGlpnHIMdlBhyOgsbjI5wgAy9mu877Jxg5pPUWaLgprepKLgLt4Rv3rngttlbH++ABA==; 5:OHvWDl4+JkCZn/fKW/UqxaEwDVbT/9J5ZIQE8bJaEus45VIqiKE6KucsJxEsPNz79945FyP8KJg1laAli4RBLisEwfF1nyFYpQ73CCgl2RGJcm3A0M/xW5GfQFC8aqgORLtYhVx7LNPYxnCHGUaeeClnbbY4QYTw9a5DwVglRPk=; 7:wAlv2xi9DmrrlNo5zkwsvNkKVxiURxjGbZywIZpQ+eXR0yDieRR53Fr/13GlC7KDYgy3LU6QgMuUZp0vktZRr+i+X/ZdH+AxOtjVKZpQ6MNbCN+UaWVLTnPUuBcZkPwTrUPiFUBITg9izGAl5mpFmw== x-ms-office365-filtering-correlation-id: ddaaa37f-1954-43ce-029b-08d66bc3bb17 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2382; x-ms-traffictypediagnostic: VI1PR0401MB2382: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:VI1PR0401MB2382; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0401MB2382; x-forefront-prvs: 0899B47777 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(396003)(366004)(376002)(39860400002)(346002)(199004)(189003)(5660300001)(1076003)(575784001)(26005)(76176011)(186003)(71200400001)(256004)(25786009)(105586002)(4326008)(6436002)(305945005)(11346002)(106356001)(14444005)(446003)(44832011)(476003)(7736002)(55236004)(102836004)(78486014)(486006)(386003)(68736007)(52116002)(86362001)(6506007)(2616005)(71190400001)(66066001)(316002)(54906003)(6116002)(3846002)(2906002)(14454004)(36756003)(99286004)(50226002)(8936002)(1730700003)(81156014)(81166006)(8676002)(6512007)(53936002)(478600001)(97736004)(6486002)(6916009)(5640700003)(2351001)(2501003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2382; H:VI1PR0401MB2541.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Cc29xW69AVPT7hozukFnIOAJX2itYmxss5uiv4JpkxwVYBnL26DG6qv0kYodK15d2K7Jyg8D4iH3GrPq2A0i+evkj++GBEHRv1/Ybk80qEj0kVq0ncOFZoH/MFWsBZWzeZiry3ncJl1phpPiaT2SKSCs7JynssKkzvFtps2Y4C0HdDq4CsSYMGlzqdi0RX537QdOwqN+ZUXMpO4jPYDWXUCt6q2HGjQ4KNA5v4p3GHG+Letokledw+EE73Lml90e3SvQ3BbcOzzyapka8thB3yL4GNE/viuR0K4qUZYJprRzOEwnrB1PkU6UHEAHS8Du spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ddaaa37f-1954-43ce-029b-08d66bc3bb17 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2018 06:22:52.5989 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Subject: [dpdk-dev] [PATCH 01/20] bus/fslmc: fix to reset portal memory before use 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: Sachin Saxena Uninitialized portal memory is causing unwanted issues. Fixes: 293c0ca94c36 ("bus/fslmc: support memory backed portals with QBMAN 5.0") Cc: stable@dpdk.org Signed-off-by: Sachin Saxena --- drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.17.1 diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c index ce0699842..4fc6efec5 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c @@ -369,6 +369,8 @@ dpaa2_create_dpio_device(int vdev_fd, dpio_dev->mc_portal = rte_mcp_ptr_list[MC_PORTAL_INDEX]; dpio_dev->dpio = malloc(sizeof(struct fsl_mc_io)); + memset(dpio_dev->dpio, 0, sizeof(struct fsl_mc_io)); + if (!dpio_dev->dpio) { DPAA2_BUS_ERR("Memory allocation failure"); goto err; From patchwork Thu Dec 27 06:22:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 154547 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6604282ljp; Wed, 26 Dec 2018 22:23:13 -0800 (PST) X-Google-Smtp-Source: ALg8bN5ent41AK2ElLgNX3L9IzmuLQZCqXjVeFy2LN2Bq4EvAMkZUPdxMS/VOkRDD3d7bxf09StH X-Received: by 2002:adf:dc4e:: with SMTP id m14mr21290354wrj.107.1545891792955; Wed, 26 Dec 2018 22:23:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545891792; cv=none; d=google.com; s=arc-20160816; b=uze6xU27P/HLm7CtVDFaZOSn/RPYltVlCCrCuss8Xe7shYRUhCN8PPlhxyEKX3b8PS jDtii/n+x3nm/9J8bqwDRU2h0+cR9HQhcwh/OB7DxzPE0aCfg/FTnYcKh3cwkmaMgoEk cIKoFHVMyvUH82PK73ql1m6+XBhU07+nfqtTMNSWHh4edd8ZzJgAWRJm74W7c6tojjPN sSgvKXRFhu+0bgshZcmYShRUMh6DaGt7mDYvlrmFkT06drUQBsxHrpraYInr8hYAkh3D bViUGS2ZMqZFBw2XI6st9+8JVvJxQBgrFOc/z3q/jaSWxoRY3jaM27qW/Ruuu4V0JsMN XdjA== 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:mime-version :content-transfer-encoding:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:cc:to:from :dkim-signature; bh=LN+7svjFBmgRsw15vJupOLPp9a5SS+JI2X1eOESWi+0=; b=PeyD4dMo2vE1EngzlHYZ3M++L98rQv5vVQL638KI3MvgTO3S/ZriCtG72rY0Zl8TJL odVL7mHn/Kt6gy32pvbq3WWvoBFpj7bM09wetksVnHXTXN2Hh3/JuwvAv0HRYSGOxq5I ghvzBUtj3e0JcH6xK7+oZq/vwxp2U43elTFSFT5o0hC/zL8voIjqHPqPtcFQvORIIXvZ DcZ75NOSXjAzUSUilCf5EkXbjAd+Cbr4SJkSXVF1/6SB8h7vwBWfC5kwxk7YOHC1pFpb amAL221Efx+zIMkMWPWf/OjZvK/5sT8QoCnmZMrDe1x27YaafjOwfWE0kdu/y4zcIrzH h5+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=Cvx+D2Om; 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 h11si19113746wrw.18.2018.12.26.22.23.12; Wed, 26 Dec 2018 22:23:12 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=Cvx+D2Om; 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 04F784C8E; Thu, 27 Dec 2018 07:22:59 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140041.outbound.protection.outlook.com [40.107.14.41]) by dpdk.org (Postfix) with ESMTP id 56169343C; Thu, 27 Dec 2018 07:22:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LN+7svjFBmgRsw15vJupOLPp9a5SS+JI2X1eOESWi+0=; b=Cvx+D2OmFLlrdxY7zcCAYcdsVmPXrIRjCvLpJHy3XDXGZpk5wlUBQhM9n7Twxx5z3EeFKg6vu7QN9NCiAInlaBmbpZL4705Ne2YGdDV3zZ3AfXvR+oJGWSfMBtbSGfgYA/fp31Wpzo31mBh5AAvE4SyBupMSo9omSF1hwTeujig= Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com (10.168.65.19) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.134.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Thu, 27 Dec 2018 06:22:54 +0000 Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4]) by VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4%2]) with mapi id 15.20.1471.019; Thu, 27 Dec 2018 06:22:54 +0000 From: Hemant Agrawal To: "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , Shreyansh Jain , Youri Querry , "stable@dpdk.org" Thread-Topic: [PATCH 02/20] bus/fslmc: fix the ring mode to use correct cache settings Thread-Index: AQHUnayZzCxa8+Z8R06Auv6dMnh3MQ== Date: Thu, 27 Dec 2018 06:22:54 +0000 Message-ID: <20181227062233.30781-3-hemant.agrawal@nxp.com> References: <20181227062233.30781-1-hemant.agrawal@nxp.com> In-Reply-To: <20181227062233.30781-1-hemant.agrawal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.143.30.134] x-mailer: git-send-email 2.17.1 x-clientproxiedby: BM1PR01CA0120.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:40::14) To VI1PR0401MB2541.eurprd04.prod.outlook.com (2603:10a6:800:56::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0401MB2382; 6:9ISOFIRLgtaTsM5GZMrkQnIqwnrN7mxYt+4FqOGoPOuixF4L+AB4wbACSmCwJE1ZJntsabrnJOFCkhh31uN68JtyVF79h+6LS1QMhxHMSlowvPosiN7x2i8W2pyKVQRgbpfKvj2t2EKEDv1jJPBbAq0aXV7Pu1JNdQd5I0EAxGbdPLxNDXe2xevIyiq1hlbvCCDeYGO2GN1szesdJp84So1/nMtSVIBoPtXq2a48YvWvfPVuTVlNPR/G7Qzl4viF7e6lZdQnQKGLn/pfn5CR3A8O1FJANbuW3HO4stSr7G9cGdoUFPUteTVnkVUPHyQxoQny66ktIQISrI6Jg9a5GZDXA/LYZnngKmhIZlWYTfa86M5fLCHc5rjue6ndQCYGQGSCx/Rewq0rksiAHsIufvYHr/KefvZkvnEFaxtE37Bb/cEx1le9dJnohCP0WUDjA6Wzj7GHImCgifxQq0jHyQ==; 5:iWk4IFVU1NjuyQbynM6gWuy3t2khZNY8Rw323/nhGqrKNYFQvauCo1Of6gWqtGsjcM4DZKjonOKf8v6OOk2LDiZruQ+aXJtHWlmtEbx/WIz1K7nhmPmbylphDV3nU2jH3p2gjGlT1AksvVGbZl1oIjgNuV1g10nv6ElntF9D9m4=; 7:+AzsyCTQ1/fyOjULh7JnWrcirVp/TYkExW8Jch90VaXYMuzZjQ/AXGFCW4NoRa/xuiCtzD1g5U0EubPkTdcMv/IiNRRicK9xbXEA6UBHjTI2zyAOi3omr+i2zGw70IumGYcDVMBlxT17aHTtoxdtDQ== x-ms-office365-filtering-correlation-id: a3a5f32a-46ba-4422-2ef9-08d66bc3bc29 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2382; x-ms-traffictypediagnostic: VI1PR0401MB2382: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:VI1PR0401MB2382; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0401MB2382; x-forefront-prvs: 0899B47777 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(396003)(366004)(376002)(39860400002)(346002)(199004)(189003)(5660300001)(1076003)(575784001)(26005)(76176011)(186003)(71200400001)(256004)(25786009)(105586002)(4326008)(6436002)(305945005)(11346002)(106356001)(14444005)(446003)(44832011)(476003)(7736002)(55236004)(102836004)(78486014)(486006)(386003)(68736007)(52116002)(86362001)(6506007)(2616005)(71190400001)(66066001)(316002)(54906003)(6116002)(3846002)(2906002)(14454004)(36756003)(99286004)(50226002)(8936002)(1730700003)(81156014)(81166006)(8676002)(6512007)(53936002)(478600001)(97736004)(6486002)(6916009)(5640700003)(2351001)(2501003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2382; H:VI1PR0401MB2541.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: rdjXPsE7/Ga7VIaf1KwQmo9s90nZhwvn6M1tBeeTuvmLTYMoKiasu1WJSz0dCGFG2LIdKeIS083WrL42IGyD/vIb86sFO7A4nIcfBV1kwsxxTGdm+tWA8WmELju+W173+PXOABAn9pNapJ0X1AxZ+MlY8/UH0nnLq9I7K46E3FWmDo3txgq4QNc/ms5VJ9pSbPLPJQTNNZQPzA0f08hF5gX8rYt1yiZIVbGdwpUIkINlNsVy/ffIXZQ73O8HDiu/TKGVY+Kkfm4fdbK1bA8v23zrZwJcwSzGqQcUBnSmhbwm4nKc76NFhKNgL7jbJKPQ spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a3a5f32a-46ba-4422-2ef9-08d66bc3bc29 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2018 06:22:54.2395 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Subject: [dpdk-dev] [PATCH 02/20] bus/fslmc: fix the ring mode to use correct cache settings X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Youri Querry The code was incorrectly using the cache inhibited access. It shall use cached enabled access for better performance. Fixes: 293c0ca94c36 ("bus/fslmc: support memory backed portals with QBMAN 5.0") Cc: stable@dpdk.org Signed-off-by: Youri Querry --- drivers/bus/fslmc/qbman/qbman_portal.c | 12 ++++++------ drivers/bus/fslmc/qbman/qbman_sys.h | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) -- 2.17.1 diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c b/drivers/bus/fslmc/qbman/qbman_portal.c index 3380e54f5..bbea37efc 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.c +++ b/drivers/bus/fslmc/qbman/qbman_portal.c @@ -683,8 +683,8 @@ static int qbman_swp_enqueue_ring_mode_mem_back(struct qbman_swp *s, 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.ci = qbman_cena_read_reg(&s->sys, + QBMAN_CENA_SWP_EQCR_CI_MEMBACK) & full_mask; s->eqcr.available = qm_cyc_diff(s->eqcr.pi_ring_size, eqcr_ci, s->eqcr.ci); if (!s->eqcr.available) @@ -809,8 +809,8 @@ static int qbman_swp_enqueue_multiple_mem_back(struct qbman_swp *s, 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.ci = qbman_cena_read_reg(&s->sys, + QBMAN_CENA_SWP_EQCR_CI_MEMBACK) & full_mask; s->eqcr.available = qm_cyc_diff(s->eqcr.pi_ring_size, eqcr_ci, s->eqcr.ci); if (!s->eqcr.available) @@ -941,8 +941,8 @@ static int qbman_swp_enqueue_multiple_desc_mem_back(struct qbman_swp *s, 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.ci = qbman_cena_read_reg(&s->sys, + QBMAN_CENA_SWP_EQCR_CI_MEMBACK) & full_mask; s->eqcr.available = qm_cyc_diff(s->eqcr.pi_ring_size, eqcr_ci, s->eqcr.ci); if (!s->eqcr.available) diff --git a/drivers/bus/fslmc/qbman/qbman_sys.h b/drivers/bus/fslmc/qbman/qbman_sys.h index d41af8358..0571097ab 100644 --- a/drivers/bus/fslmc/qbman/qbman_sys.h +++ b/drivers/bus/fslmc/qbman/qbman_sys.h @@ -55,6 +55,7 @@ #define QBMAN_CENA_SWP_RR(vb) (0x700 + ((uint32_t)(vb) >> 1)) #define QBMAN_CENA_SWP_VDQCR 0x780 #define QBMAN_CENA_SWP_EQCR_CI 0x840 +#define QBMAN_CENA_SWP_EQCR_CI_MEMBACK 0x1840 /* CENA register offsets in memory-backed mode */ #define QBMAN_CENA_SWP_DQRR_MEM(n) (0x800 + ((uint32_t)(n) << 6)) From patchwork Thu Dec 27 06:22:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 154548 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6604370ljp; Wed, 26 Dec 2018 22:23:22 -0800 (PST) X-Google-Smtp-Source: ALg8bN4PKm8bMnN9n3YR7OkJH7cjbCCJcfB6TA3RNyAfChXCRuhbD6/OqSjI/+TM/Nu3BtlNKhtO X-Received: by 2002:adf:fd87:: with SMTP id d7mr20076613wrr.74.1545891802589; Wed, 26 Dec 2018 22:23:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545891802; cv=none; d=google.com; s=arc-20160816; b=Jp84HL+5WkZ3ECdwoTVJ+xil+MgaeG7ogpVPY9J4ZbcFuQsTg0GSI5oDz8DHe0PEzn 6H22Mjuuh00vSa2sVhD82FiZHNtO7fKkxDds5pgNaUchRLsHt0IrbBYFLHkhhwC7K2+r XrcQVMA7MJATmlI0nK2Qv/H2CCVqS0IWfslXuefRfSVwgJLLyLJ8ZDx/cM1/rHpR8rgj PJPV3ZRQ4bvccscNQONlBf1Z7OaOV7L4eCcn81+ikCqxmW4mxG8YFh5VDn3AtCl+HWpb CZJHuKtMEnfYQyNzznQ4yoPbD9eEdReyTAlvYAlhA/r1CWemoJOBg83pK9aDW/cZLMZw 7w6A== 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:mime-version :content-transfer-encoding:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:cc:to:from :dkim-signature; bh=KB6Z6l9znzTi2fMkUHnDMQSkuZ0Jvn5aDoH89/6zV4g=; b=iAvXAp87pXVXDseXkV2iRE3xBBHZmXUWvMOn6h02+wCFyLroH9IKMYMjFPHOTzzr5L rx8klZuGOAB8EWGf61yOlbWpj3naL/Yn6OoLMT+PfewcMdN+m3mGrcIjiC4U9TUoHLQP 4iazbwKAuUHvU4zkU9i7qujmpEI9TF/WT6o/AVqwgrBzst23aAEhYpxzH2lMLI31aJPk mNJnaHPH7FDkEZUvfS00AqtNF5JK7vFZjRvfhsx/QVmMNqhYxWe4vuvvEogdbaTa6Hju soTcHh5AbfTAh0mj/Z0REmDAFpxI3PXNWGGXjSetW7E3bd/mR1JHroYfddpr5wSE3DnZ WLyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=drak5m5Y; 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 d63si17000477wmf.51.2018.12.26.22.23.22; Wed, 26 Dec 2018 22:23:22 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=drak5m5Y; 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 4ACEE4C99; Thu, 27 Dec 2018 07:23:00 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140058.outbound.protection.outlook.com [40.107.14.58]) by dpdk.org (Postfix) with ESMTP id 030E54C6C; Thu, 27 Dec 2018 07:22:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KB6Z6l9znzTi2fMkUHnDMQSkuZ0Jvn5aDoH89/6zV4g=; b=drak5m5YGjd6sRIw9r8kCBtv2f9VSoqO7uV26aksodtf2LIkbL8KpoFOdcc2o0W0+frUyExizpWt0MPG8xmz/1DlynmKMu88//oORFVJbT4dcL9g5QwOsRNEp1p4YAu0KWqYmfhXCmZoJlDtjyZ4tL90Qss6CUV8CWdWZAhINkA= Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com (10.168.65.19) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.134.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Thu, 27 Dec 2018 06:22:55 +0000 Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4]) by VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4%2]) with mapi id 15.20.1471.019; Thu, 27 Dec 2018 06:22:55 +0000 From: Hemant Agrawal To: "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , Shreyansh Jain , "stable@dpdk.org" Thread-Topic: [PATCH 03/20] bus/fslmc: fix to use correct physical core for logical core Thread-Index: AQHUnaya6tXM27Eib0evvOZM5Aq7IA== Date: Thu, 27 Dec 2018 06:22:55 +0000 Message-ID: <20181227062233.30781-4-hemant.agrawal@nxp.com> References: <20181227062233.30781-1-hemant.agrawal@nxp.com> In-Reply-To: <20181227062233.30781-1-hemant.agrawal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.143.30.134] x-mailer: git-send-email 2.17.1 x-clientproxiedby: BM1PR01CA0120.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:40::14) To VI1PR0401MB2541.eurprd04.prod.outlook.com (2603:10a6:800:56::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0401MB2382; 6:eSbNQzB8YSPJfVQ1YaMwLK9qu2kf+TUx6ZbJzurfD/N71e/C8eITGL/szMU4ypST67xLC+jvLml8rJlqmvJcFco+DleZz7euxKrZ7ZlnbfVNaPCQJL7F4+TVx6yTA6kjIrFKaO6oJFK76AqONvxaXnMuG9vIkgzFTVP3U6qe2aui2zA/hDONV4xq9gStO07EDec2N2i/z/6GtQScy6yNNAILhF8pcDFckOhZCBQ8Hp6RbweqftcXXBhk9TSysyQv+BMayo3PIlJL8a1eUinzZ0gzllQhHRyXl+wNa5OxWrlW2asztiYdHd9Bk9dunIeH56cDRRHTdQTuEVEZrINnbGW18Kp407JpSoSoRNbS7C4iGIMntHOqncH54Xm79rwNPc7GZtR/pGdzn4khDLwICEMPEbogABY8bZaKtWF3vyM2XGp7ExYFaa2dNVKNZj5YxnR8rGu+ukKDHB3DZMvRXw==; 5:fHIf3GG8mKOdX9MootC3Hx/lDyCOOcMG/sDEAHRhigyYyGvZ3OMmgSgGIZJT9HYRbYVHTKCeTn9KHZnWITwrMKybnNv9A5sW/174mB/OYiF84+2byNVIdNRGQYpKoXt+bzRpsLETMUVy4Zo0dwxwKD4dsHbk62pduo3SUAcRK/g=; 7:IykoCms8KQEltY56zw1JfsI6+ukgoPHK4+0Vfxs8McGxDUDgAZFBcE9yfYgjYz/fXpk9UhSqb6TUlfBxBXyheISv3bJOB3x7Tll+Z0aHvPRH9ib2k1kQH5Hg3ecbTZjxNvEsysh/ByFD/Pdru0Cgzw== x-ms-office365-filtering-correlation-id: 97a621da-399c-4dad-ac96-08d66bc3bd0b x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2382; x-ms-traffictypediagnostic: VI1PR0401MB2382: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:VI1PR0401MB2382; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0401MB2382; x-forefront-prvs: 0899B47777 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(396003)(366004)(376002)(39860400002)(346002)(199004)(189003)(5660300001)(1076003)(26005)(76176011)(186003)(71200400001)(256004)(25786009)(105586002)(4326008)(6436002)(305945005)(11346002)(106356001)(446003)(44832011)(476003)(7736002)(55236004)(102836004)(78486014)(486006)(386003)(68736007)(52116002)(86362001)(6506007)(2616005)(71190400001)(66066001)(316002)(54906003)(6116002)(3846002)(2906002)(14454004)(36756003)(99286004)(50226002)(8936002)(1730700003)(81156014)(81166006)(8676002)(6512007)(53936002)(478600001)(97736004)(6486002)(6916009)(5640700003)(2351001)(2501003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2382; H:VI1PR0401MB2541.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: s/H+tZAii537c26GTGS1NbjybhbdulP0TXpQKua/LF6UgkuI7tCARWmcyzjnAEeg7i72f+bJg6SYOBlJOBF/Vzi2X4rUpxgsyHuBJBEbGA3QBeZH4S3eCR8qH5dUvFWeyBgYlYjQArhAj99nPCHemJVQNt2WAdlfcP6mpF8b2bIcRzk+TpjcNqhWcuvpPo+/hWYiqFBUZYZ2qPs+OC0by/5pbPJi3Y1vMD9fjPuPs2LV8QIMXd9S2JkVuw4EbjMAqloRW326Ej9TCJhp2PWNQ6VYtHz1GuOfZFd+dN9tF9ZHTSg8rK/0O+05k5iXAxS/ spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 97a621da-399c-4dad-ac96-08d66bc3bd0b X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2018 06:22:55.8019 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Subject: [dpdk-dev] [PATCH 03/20] bus/fslmc: fix to use correct physical core for logical core 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" Existing code is using the lcore id as the physical core id. Add code to get the right physical id. Also, dpaa2 can not support one lcore mapping to multiple cpus, print err on such cases. Fixes: ce9efbf5bb09 ("bus/fslmc: support dynamic logging") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 76 ++++++++++++++++++++---- 1 file changed, 63 insertions(+), 13 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 4fc6efec5..ba2e28ce1 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c @@ -53,6 +53,10 @@ static uint32_t io_space_count; /* Variable to store DPAA2 platform type */ uint32_t dpaa2_svr_family; +/* Physical core id for lcores running on dpaa2. */ +/* DPAA2 only support 1 lcore to 1 phy cpu mapping */ +static unsigned int dpaa2_cpu[RTE_MAX_LCORE]; + /* Variable to store DPAA2 DQRR size */ uint8_t dpaa2_dqrr_size; /* Variable to store DPAA2 EQCR size */ @@ -92,7 +96,8 @@ dpaa2_core_cluster_sdest(int cpu_id) } #ifdef RTE_LIBRTE_PMD_DPAA2_EVENTDEV -static void dpaa2_affine_dpio_intr_to_respective_core(int32_t dpio_id) +static void +dpaa2_affine_dpio_intr_to_respective_core(int32_t dpio_id, int lcoreid) { #define STRING_LEN 28 #define COMMAND_LEN 50 @@ -125,7 +130,7 @@ static void dpaa2_affine_dpio_intr_to_respective_core(int32_t dpio_id) return; } - cpu_mask = cpu_mask << rte_lcore_id(); + cpu_mask = cpu_mask << dpaa2_cpu[lcoreid]; snprintf(command, COMMAND_LEN, "echo %X > /proc/irq/%s/smp_affinity", cpu_mask, token); ret = system(command); @@ -139,7 +144,7 @@ static void dpaa2_affine_dpio_intr_to_respective_core(int32_t dpio_id) fclose(file); } -static int dpaa2_dpio_intr_init(struct dpaa2_dpio_dev *dpio_dev) +static int dpaa2_dpio_intr_init(struct dpaa2_dpio_dev *dpio_dev, int lcoreid) { struct epoll_event epoll_ev; int eventfd, dpio_epoll_fd, ret; @@ -176,32 +181,36 @@ static int dpaa2_dpio_intr_init(struct dpaa2_dpio_dev *dpio_dev) } dpio_dev->epoll_fd = dpio_epoll_fd; - dpaa2_affine_dpio_intr_to_respective_core(dpio_dev->hw_id); + dpaa2_affine_dpio_intr_to_respective_core(dpio_dev->hw_id, lcoreid); return 0; } #endif static int -dpaa2_configure_stashing(struct dpaa2_dpio_dev *dpio_dev, int cpu_id) +dpaa2_configure_stashing(struct dpaa2_dpio_dev *dpio_dev, int lcoreid) { int sdest, ret; + int cpu_id; /* Set the Stashing Destination */ - if (cpu_id < 0) { - cpu_id = rte_get_master_lcore(); - if (cpu_id < 0) { + if (lcoreid < 0) { + lcoreid = rte_get_master_lcore(); + if (lcoreid < 0) { DPAA2_BUS_ERR("Getting CPU Index failed"); return -1; } } + + cpu_id = dpaa2_cpu[lcoreid]; + /* Set the STASH Destination depending on Current CPU ID. * Valid values of SDEST are 4,5,6,7. Where, */ sdest = dpaa2_core_cluster_sdest(cpu_id); - DPAA2_BUS_DEBUG("Portal= %d CPU= %u SDEST= %d", - dpio_dev->index, cpu_id, sdest); + DPAA2_BUS_DEBUG("Portal= %d CPU= %u lcore id =%u SDEST= %d", + dpio_dev->index, cpu_id, lcoreid, sdest); ret = dpio_set_stashing_destination(dpio_dev->dpio, CMD_PRI_LOW, dpio_dev->token, sdest); @@ -211,7 +220,7 @@ dpaa2_configure_stashing(struct dpaa2_dpio_dev *dpio_dev, int cpu_id) } #ifdef RTE_LIBRTE_PMD_DPAA2_EVENTDEV - if (dpaa2_dpio_intr_init(dpio_dev)) { + if (dpaa2_dpio_intr_init(dpio_dev, lcoreid)) { DPAA2_BUS_ERR("Interrupt registration failed for dpio"); return -1; } @@ -220,7 +229,7 @@ dpaa2_configure_stashing(struct dpaa2_dpio_dev *dpio_dev, int cpu_id) return 0; } -struct dpaa2_dpio_dev *dpaa2_get_qbman_swp(int cpu_id) +struct dpaa2_dpio_dev *dpaa2_get_qbman_swp(int lcoreid) { struct dpaa2_dpio_dev *dpio_dev = NULL; int ret; @@ -236,7 +245,7 @@ struct dpaa2_dpio_dev *dpaa2_get_qbman_swp(int cpu_id) DPAA2_BUS_DEBUG("New Portal %p (%d) affined thread - %lu", dpio_dev, dpio_dev->index, syscall(SYS_gettid)); - ret = dpaa2_configure_stashing(dpio_dev, cpu_id); + ret = dpaa2_configure_stashing(dpio_dev, lcoreid); if (ret) DPAA2_BUS_ERR("dpaa2_configure_stashing failed"); @@ -340,6 +349,39 @@ dpaa2_affine_qbman_ethrx_swp(void) } } +/* + * This checks for not supported lcore mappings as well as get the physical + * cpuid for the lcore. + * one lcore can only map to 1 cpu i.e. 1@10-14 not supported. + * one cpu can be mapped to more than one lcores. + */ +static int +dpaa2_check_lcore_cpuset(void) +{ + unsigned int lcore_id, i; + int ret = 0; + + for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) + dpaa2_cpu[lcore_id] = 0xffffffff; + + for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) { + for (i = 0; i < RTE_MAX_LCORE; i++) { + if (CPU_ISSET(i, &lcore_config[lcore_id].cpuset)) { + RTE_LOG(DEBUG, EAL, "lcore id = %u cpu=%u\n", + lcore_id, i); + if (dpaa2_cpu[lcore_id] != 0xffffffff) { + DPAA2_BUS_ERR( + "ERR:lcore map to multi-cpu not supported"); + ret = -1; + } else { + dpaa2_cpu[lcore_id] = i; + } + } + } + } + return ret; +} + static int dpaa2_create_dpio_device(int vdev_fd, struct vfio_device_info *obj_info, @@ -349,6 +391,7 @@ dpaa2_create_dpio_device(int vdev_fd, struct vfio_region_info reg_info = { .argsz = sizeof(reg_info)}; struct qbman_swp_desc p_des; struct dpio_attr attr; + static int check_lcore_cpuset; if (obj_info->num_regions < NUM_DPIO_REGIONS) { DPAA2_BUS_ERR("Not sufficient number of DPIO regions"); @@ -368,6 +411,13 @@ dpaa2_create_dpio_device(int vdev_fd, /* Using single portal for all devices */ dpio_dev->mc_portal = rte_mcp_ptr_list[MC_PORTAL_INDEX]; + if (!check_lcore_cpuset) { + check_lcore_cpuset = 1; + + if (dpaa2_check_lcore_cpuset() < 0) + goto err; + } + dpio_dev->dpio = malloc(sizeof(struct fsl_mc_io)); memset(dpio_dev->dpio, 0, sizeof(struct fsl_mc_io)); From patchwork Thu Dec 27 06:22:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 154549 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6604503ljp; Wed, 26 Dec 2018 22:23:33 -0800 (PST) X-Google-Smtp-Source: ALg8bN6QQogj94ayz1CjuO2le7BI3dyxLLrehODnzJzduaupJJC7qxfunA8k0Ps5kk5BgdQjK9QC X-Received: by 2002:a5d:6907:: with SMTP id t7mr3581345wru.226.1545891813113; Wed, 26 Dec 2018 22:23:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545891813; cv=none; d=google.com; s=arc-20160816; b=lJal1oOVoppFO58QU2dRben859S9xP5vfNoDfGPpimkbv4vMc6qCK/KmZovuU0CzPE nbu+ehVuaLN5pu0KltfApgSeHOVwGf3n0BWw4UC8j6QeakZzMB20DXMuoQtUFfkX1lco JAUyOrZ49QoQdmsyEFYHQHBvgw/HIbyErains7YplTA9F0sWLpyFzjQAJU1CslsVp0/J fl9IfhTVGK/Mr4ZqF+w2Yy5xiISOB1MeMqoun9ohoXY+vdcapFvRMiLleh6uN1ciDgIp QBkXYWH+jxgXjqH1QY6zj+NTYc5yCSlK8VuEQ5QB7sgEmQuFuSx0UVVAXnOrwSWsE8vl AU7A== 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:mime-version :content-transfer-encoding:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:cc:to:from :dkim-signature; bh=9tH1Cj2moxYQmathpBY4iIEkUbhdykmvpCfgmba4TwI=; b=z3so//35eod5J4B/IqqOu4cIHU6LLlh02zo/nTXww1Rnx8HVexH4U6qMKSqE7xxwkg r2GhD+k3jZRPR3YI/OxLzkUbpDojqu5HRN8UvKrGq6ZQ4Bj58f60cfCpWlo/VLB/ESsL 4T91dNYNPhJCP2nXj/EA7m3HTGwEyZJKOxAn499Q9fBEBbFtvAi7FHR8RMiganeNcC2q 1tRE9aWT7zO0IaTi+FHKkQmPdp6pwkNtpFjIxkuVnY82fWOTB4tBPHOWFTiCb3SsylPo 2ruRTEIww3OuYEzQrhF3D/otQzjmXPIuPr08hmZtNSYAfalTGmls91I+BMzWAXWc8tqg Yk3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=N6FruELJ; 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 n63si16459500wmn.178.2018.12.26.22.23.32; Wed, 26 Dec 2018 22:23:33 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=N6FruELJ; 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 AE22A4CAB; Thu, 27 Dec 2018 07:23:01 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140077.outbound.protection.outlook.com [40.107.14.77]) by dpdk.org (Postfix) with ESMTP id 67BCF4C8E; Thu, 27 Dec 2018 07:22:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9tH1Cj2moxYQmathpBY4iIEkUbhdykmvpCfgmba4TwI=; b=N6FruELJDaBO73AONtEd5hBgg7unIiuTRBYBWktOkJovCl1IMAP3Mf9/0/pDZopLBXgkf0zdzK3/tmvJugjqklIIq6gCItTQLmfhnsGcD5JkcRBWgNehY17lbL2D8Ko+efTYzSW/tYcNLAHjTdraidTZhfFULKkFTHMFY36RLoc= Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com (10.168.65.19) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.134.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Thu, 27 Dec 2018 06:22:57 +0000 Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4]) by VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4%2]) with mapi id 15.20.1471.019; Thu, 27 Dec 2018 06:22:57 +0000 From: Hemant Agrawal To: "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , Shreyansh Jain , "stable@dpdk.org" Thread-Topic: [PATCH 04/20] net/dpaa2: fix bad check for not-null Thread-Index: AQHUnayb/PWWkdoeG0yoMXAKYHyjBQ== Date: Thu, 27 Dec 2018 06:22:57 +0000 Message-ID: <20181227062233.30781-5-hemant.agrawal@nxp.com> References: <20181227062233.30781-1-hemant.agrawal@nxp.com> In-Reply-To: <20181227062233.30781-1-hemant.agrawal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.143.30.134] x-mailer: git-send-email 2.17.1 x-clientproxiedby: BM1PR01CA0120.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:40::14) To VI1PR0401MB2541.eurprd04.prod.outlook.com (2603:10a6:800:56::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0401MB2382; 6:L8vEk5f2UUoQq8XZ2RuKmtVfEC91imoB/RiBH9eJ7M3DiiXY4CY0I//CHc62fmtA1mFRo8sLjtjbjqwnviiSRzqg/1Lt24QCm6+mnBkiO3FhEY9KdOxMsXMCKJgVWu0byJwI5IxiWgu0pUVG3uMdbK04jbkdh0XVLLW7rJ0WhziYAJ8v1YLENYG5dC0lcZtVDNmmp4xquT7ck2NF3UsYE+dhqWyAIdNSM7b86DlKmIYPC9c+noxVfIor9EEikio64xX5CRb1hZ+UPBVYoPHXui8gQrMKz6ssgJeDmWM9ab9YjO8AHWfMXbZF6NFy3H80JPlfEnuvh1MYN/qNY7spmoBieIBB7g6KijxE1imEoeqn6YC3ti3L5lX/3pfjDLzDy79d0A8Pp17+/fugTxGatLsVNFZn8v6B77Z2IWvhptM9EK2Wvh6YYyyo3k1IFiGWbOf2FD6xMfnoE01V1KaJaQ==; 5:x+DhVm1rVTiChZ/SJmryptEEZGo2YDVTM20kd+FFoSQW7sFKUUfFGwFb+s9yyyK7Pit4/RYuodbkZ071q8YB5qQiPaE66ppDfP2dSmU4B3yEcqT09dLs/ki4ZYQcG0o3tOuJqfmWmGc2eZm/qu6GFnOr/44Num9Ey/khFVg8nCk=; 7:fPCb+PWoB7C0P36NOi5aVbE1espI5hyMZvP0WS1G/Gtm8BNnAIoXw5jnQMBT89McmtZjB15lB7rKbf0UwQWCe0tPPMKAZySUr+XC1k1ESZrNojrwMYcw+6B/7dtFbPXdnDDZ2sBIm5ouh4sbmxX7eA== x-ms-office365-filtering-correlation-id: fb78260d-6290-44a4-b39e-08d66bc3bdf7 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2382; x-ms-traffictypediagnostic: VI1PR0401MB2382: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:VI1PR0401MB2382; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0401MB2382; x-forefront-prvs: 0899B47777 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(396003)(366004)(376002)(39860400002)(346002)(199004)(189003)(5660300001)(1076003)(26005)(76176011)(186003)(71200400001)(256004)(25786009)(105586002)(4326008)(6436002)(305945005)(11346002)(106356001)(446003)(44832011)(476003)(7736002)(55236004)(102836004)(78486014)(486006)(386003)(68736007)(52116002)(86362001)(6506007)(2616005)(71190400001)(66066001)(316002)(54906003)(6116002)(3846002)(2906002)(14454004)(36756003)(99286004)(50226002)(8936002)(1730700003)(81156014)(81166006)(8676002)(6512007)(53936002)(478600001)(97736004)(6486002)(6916009)(5640700003)(2351001)(2501003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2382; H:VI1PR0401MB2541.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 05qtwwGxUPZi15b13Qy4BR/hCBsM3tqSXd4VpV+CMayxjFmROsr/7r3jfgy0HV+Vz1uF0unG3dSFlQHAL/dAjJU+uMe8tMA1le2sEwr7epnnfW9pn24BDVuyfbYjUOPKYs/wp6uEMCSDceFzOOo/vgWKCMLlrNwavxtjgRUlE1xVdoWZL07HLfI0YM7M8wyDUU+9QWFtRMbOY6hyX/OLyomB+moZPmTUNLYBSwbs+EPG02IMSXrv+nR/cgdpRjFxw9mILph4y1BNwcdde3q0uCt/m3YVOZOPWrHURcCceCU5bouJIqGtMG4m8KkFh/Hx spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fb78260d-6290-44a4-b39e-08d66bc3bdf7 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2018 06:22:57.3488 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Subject: [dpdk-dev] [PATCH 04/20] net/dpaa2: fix bad check for not-null 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" The check !dpaa2->cscn is not correct to check non-null value. Fixes: 5d9a1e4d23fe ("net/dpaa2: enhance queue memory cleanup") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_ethdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index fa71807e6..8d4ea1bca 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -311,8 +311,7 @@ dpaa2_free_rx_tx_queues(struct rte_eth_dev *dev) /* 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); + rte_free(dpaa2_q->cscn); } /*free memory for all queues (RX+TX) */ rte_free(priv->rx_vq[0]); From patchwork Thu Dec 27 06:22:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 154550 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6604626ljp; Wed, 26 Dec 2018 22:23:45 -0800 (PST) X-Google-Smtp-Source: AFSGD/VPa+WUlYwPfy1+X9bu6qGtDVRiAV1llvxjirw+Q7SlPEA0r7fz4l6oeogoyDFTtxpHLsXX X-Received: by 2002:a1c:68d7:: with SMTP id d206mr19399049wmc.43.1545891825049; Wed, 26 Dec 2018 22:23:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545891825; cv=none; d=google.com; s=arc-20160816; b=HiU6PKtzE6NOE0Masj/NUq5PjR0cRQ6Cc1JAoBXBiKBlEapLQCR4Vg4qaBTbU6JQd1 0/0BwAxe0oRsRggtR5TmkoPjmZK0XFnamZyoeYPKUWu0m9GTDUp7LlUDZfGY4iJ+nXTZ mxrST/xEu4nTZomqhlQjXAgKGBXT1kqz+1Lne9LcuKJ1DpTOOrTHh6xl5JOW1nR7whQp SS+E6tVo+Fzx3O2iI+Jli3TC32j8+MO6nT+dr7sSYN94zMTQ8czbKh3ct8VKUcbNZds7 2hloRVQBYPbbe8BAxnq2xNRh2Pi2DXQ223aTeZkae9fei7hYJHfuo9JhZ2cRFnjXaOC9 rtYA== 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:mime-version :content-transfer-encoding:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:cc:to:from :dkim-signature; bh=m0pLI3JFXbIw1bD4vy7VTcp0BHZUYVNfR59yR3zPM8M=; b=oZJLJrKdKRM6mLpt5tU47MN20fVzQHCzBn8MvP+Qa28q6OTuNxKwUSYsWwRQHAzFE5 yoDqY+/2L9SCEtmygljD/i3Q8p8H/hvgooRQzl9jbHK+w87mX6Ef/QkMfFdo4OOgEtlG qtF1ADXRFIT7hVQtoZulwDt8yKoWaxS8lOPVQDgfqgqGEg8GlRtahq/QObH3h5qnfEhz iZF+UGqOY8NA7p8fPvdARogQDEOCLEKnbYN8vR+V9flNTzOIsv2ICGFBz2OeUblts7oX xQzlQDNbT/R9gGPO7G5utljEGC/qGWbrEN0xE+w303zk1W9nYjKCziIIUhFHqfaiMHaz mZnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=fWEibfoR; 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 v10si18347278wro.316.2018.12.26.22.23.44; Wed, 26 Dec 2018 22:23:45 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=fWEibfoR; 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 2CD5C5587; Thu, 27 Dec 2018 07:23:04 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140050.outbound.protection.outlook.com [40.107.14.50]) by dpdk.org (Postfix) with ESMTP id EF8A14C96; Thu, 27 Dec 2018 07:22:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=m0pLI3JFXbIw1bD4vy7VTcp0BHZUYVNfR59yR3zPM8M=; b=fWEibfoRZgIx+dzZXkejG/CkjzbHiEomlpx3qPTtfHF5S95v8hemSeB3bY6hiSxJDPaDPWbPdVGN0h5MMMHCiKMTZu0SA/DNN8DNWO4cJ29z9rvu02OT1hj9mOdbqjo3oD8eiKuvzx0EH05Pu6gdcG6lEipLcHiKkWBXBZfnB28= Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com (10.168.65.19) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.134.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Thu, 27 Dec 2018 06:22:59 +0000 Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4]) by VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4%2]) with mapi id 15.20.1471.019; Thu, 27 Dec 2018 06:22:59 +0000 From: Hemant Agrawal To: "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , Shreyansh Jain , "stable@dpdk.org" Thread-Topic: [PATCH 05/20] bus/fslmc: fix to convert error msg to warning Thread-Index: AQHUnaycVLTjt3sn2EaeYtGYvsHpcg== Date: Thu, 27 Dec 2018 06:22:58 +0000 Message-ID: <20181227062233.30781-6-hemant.agrawal@nxp.com> References: <20181227062233.30781-1-hemant.agrawal@nxp.com> In-Reply-To: <20181227062233.30781-1-hemant.agrawal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.143.30.134] x-mailer: git-send-email 2.17.1 x-clientproxiedby: BM1PR01CA0120.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:40::14) To VI1PR0401MB2541.eurprd04.prod.outlook.com (2603:10a6:800:56::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0401MB2382; 6:LoJVc3558VfOW9fwf3mhM7cAAMaAAzknNex9GUZmQyuLZ0pCjLfkAYiQ5evJYysS1BEpGtynJXH6SiAi8isbqP3BIkeuBBO0FoMN9O/FKLxWKJuLeGrAuilP8Ql87fRh5gtajv1Ev/08p5gPWgOMWCFpnc3HEke8PM4voGLPBAxGF6B0cpc1loNn8Y6K5P9CyLVpgNmrMVSJiv+FSfSI5dmgq8Gag0mTalvjQ/Y0OM4Xsu98CP3s6vMj6Q5liKYQc/jc736ZBttvTPbq1N6+9xLqmHDtNDVwRd7IX5owFRhODqCvvls15Rn8uhx+k0L7LdyDZ8i/ngSZ02ghtGPYnUJ8MOUv9322mMs+czbGUgeZkJ6hTv1I7XOmTytfdgNHiLB27VmahCmQ+JA67C+oOBcSC80CxxgIbDDkNAFdfsx5IzUAlIE6LQ2l3Oekw/4U+neVROtSsgL+Lx430ELsuw==; 5:vLeh2WwBYzrzQfYLoDc6N1UOrBzAS+q/A+zK3JqmzvNatTz8k/cn3AQuvQPwlwdDORmV3Ky/cegG7Y6UJZh8PkdYC+hyQRw/uvHxnzaSGR+5XrLGM+rKkMhUUUSy8YuF+KUYWc4JJz8m9Adg5BoHGEIQEFLXzZzdrJVJDWUjgiE=; 7:lBgleQV9jk/Rf4hj5zWWc0LQBNMhhElJt7Lf+3/SOMCrg05IKK2UnJdltgaki6aisPn5T7Y4zmEEysnY+Bh5a4wrEVt9CiGX7oDQnf8+URmqiuf3DBG33aDOtu6HJfdiCb4lZdjCJAtWbMt0G0lFfw== x-ms-office365-filtering-correlation-id: 9c987762-0c0c-42a2-ba95-08d66bc3bee3 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2382; x-ms-traffictypediagnostic: VI1PR0401MB2382: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:VI1PR0401MB2382; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0401MB2382; x-forefront-prvs: 0899B47777 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(396003)(366004)(376002)(39860400002)(346002)(199004)(189003)(5660300001)(1076003)(26005)(76176011)(186003)(71200400001)(256004)(25786009)(105586002)(4326008)(6436002)(305945005)(11346002)(106356001)(14444005)(446003)(44832011)(476003)(7736002)(55236004)(102836004)(78486014)(486006)(386003)(68736007)(52116002)(86362001)(6506007)(2616005)(71190400001)(66066001)(316002)(54906003)(6116002)(3846002)(2906002)(14454004)(36756003)(99286004)(50226002)(8936002)(1730700003)(81156014)(81166006)(8676002)(6512007)(53936002)(478600001)(97736004)(6486002)(6916009)(5640700003)(2351001)(2501003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2382; H:VI1PR0401MB2541.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: SEK3D2Lt3zhJVctBAT5A67zFQ2CUh5dW1F4TkZ1jtHX9L3rm1MwBv6LywyC3fDYwWt5oMHb7vDM11UfxIyuMHYeA1hArWQQESwDKpSymsaDbktwFt2JkDaKiMGgcdJgvdwcuCgKKETr/lbXJkHYfMXhOSU/o4grfOKnXn/+nWAAWna3Q8gkCC7b/sxTHylwtpmsn8HtwNYl1JDKHnyrnJDJ75HOKO6U4lWSHyAT0at2x1JOjpQAQfz6YzWbahj6hqNHmNz8hRZTtiWkFbIn6ex6FCVrqwZquV7EvArHjzupfuy+n7BCFVTvORZx4+7SR spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9c987762-0c0c-42a2-ba95-08d66bc3bee3 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2018 06:22:58.9581 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Subject: [dpdk-dev] [PATCH 05/20] bus/fslmc: fix to convert error msg to warning X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This is just a information. No need to print it as a error. Fixes: ce9efbf5bb09 ("bus/fslmc: support dynamic logging") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/fslmc_vfio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c index 493b6e5be..ce82a99f6 100644 --- a/drivers/bus/fslmc/fslmc_vfio.c +++ b/drivers/bus/fslmc/fslmc_vfio.c @@ -176,7 +176,7 @@ static int vfio_map_irq_region(struct fslmc_vfio_group *group) vaddr = (unsigned long *)mmap(NULL, 0x1000, PROT_WRITE | PROT_READ, MAP_SHARED, container_device_fd, 0x6030000); if (vaddr == MAP_FAILED) { - DPAA2_BUS_ERR("Unable to map region (errno = %d)", errno); + DPAA2_BUS_INFO("Unable to map region (errno = %d)", errno); return -errno; } From patchwork Thu Dec 27 06:23:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 154551 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6604724ljp; Wed, 26 Dec 2018 22:23:54 -0800 (PST) X-Google-Smtp-Source: ALg8bN5G3F3qaDqNQWqO4lQfljpjO8suX8oR3xfY++W4dKaz9whxdvILUcEsFTIEZ7NvakBsz97T X-Received: by 2002:adf:9061:: with SMTP id h88mr20489473wrh.65.1545891834482; Wed, 26 Dec 2018 22:23:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545891834; cv=none; d=google.com; s=arc-20160816; b=rEUkiFg4ebIFjm9SnYpXU7mnyw3hBe+0EzV/sXRAVJ7pz4Vcx/tZR0ad/D8Rxom1ml ixM1gYzmrliOICs2Cq9bSsVKy8OEMiVfv9KyekGIFmv4IX8vKP8WDeoVp9h3pHza/CEA qcEVT/2jNVB2wlm7M4GB9zBFz8O9N3cYE0QGDMrzoxpWFj26UzKsTs0AZ/iHP8qPfWRf 9pnsoXe0+QOvRZ4EBivC9kL2VDnQmyuBaYpoqiz6SUKFY98cj4hv8ZYHLX6ffH/Te16q dTCMvb2O8a5BKf4MPDaQnpZfjhIeBaGUJmeL0AyLCCOOTLrCSCkDG6HGLd3aSP7pY4FH wVQw== 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:mime-version :content-transfer-encoding:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:cc:to:from :dkim-signature; bh=I0bsTyjNVHaT9Ai4Obi5phGJNXVmnnIhnzD7HILujSY=; b=c4AhmAo51Du98nX1PsXVGchggRVdgD1CInmEoa8UadtPOOYIcb8fGXzBktF4DgaNck K9FIngqAdhizobai8IYI+2H9KnJLeQxQOwXhSFKncRSyHUddOM20I1mJLJg+CMQbzxmB LLRNOH4s0Cq55TwSi9UwFejEGZjtvIqLWKeU/VPlzmyUOIiqPJ1QK3HyckrV05nK/GPW ETNyzlfVTeu8NPrpetk+fp2s4v1aSdzYlknTddbju8vWRwQQL6zDrwbSA2PCBK+yC729 +HzRs98JPa//94juGAo5NqdmBPIVIS/cVokd3pfVZtzRydIe39aGpgrwGPg5KrlPlzhA +m+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b="k5vo4R3/"; 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 b1si11594844wrj.176.2018.12.26.22.23.54; Wed, 26 Dec 2018 22:23:54 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b="k5vo4R3/"; 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 1FE5D532C; Thu, 27 Dec 2018 07:23:09 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140082.outbound.protection.outlook.com [40.107.14.82]) by dpdk.org (Postfix) with ESMTP id 6EC224C9D; Thu, 27 Dec 2018 07:23:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I0bsTyjNVHaT9Ai4Obi5phGJNXVmnnIhnzD7HILujSY=; b=k5vo4R3/kDXo0u+u/UFzepV1If/yHt68b9ZA36t116Xj5I9idNzs+PDB4f+T/MUyO0K9dmROpK6iwaTzETTtTolLGOejXakQUoFLg0eY2PaZIAG+8ekJykw6DPUGRIEvmjj9P1DFjfTJuZBXAdNFDUYGd4Ztzlc+12khyMn+wmg= Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com (10.168.65.19) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.134.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Thu, 27 Dec 2018 06:23:00 +0000 Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4]) by VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4%2]) with mapi id 15.20.1471.019; Thu, 27 Dec 2018 06:23:00 +0000 From: Hemant Agrawal To: "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , Shreyansh Jain , "stable@dpdk.org" Thread-Topic: [PATCH 06/20] bus/fslmc: fix parse method for bus devices Thread-Index: AQHUnaydCsxuxzBDukyUp3XV4RzuuA== Date: Thu, 27 Dec 2018 06:23:00 +0000 Message-ID: <20181227062233.30781-7-hemant.agrawal@nxp.com> References: <20181227062233.30781-1-hemant.agrawal@nxp.com> In-Reply-To: <20181227062233.30781-1-hemant.agrawal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.143.30.134] x-mailer: git-send-email 2.17.1 x-clientproxiedby: BM1PR01CA0120.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:40::14) To VI1PR0401MB2541.eurprd04.prod.outlook.com (2603:10a6:800:56::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0401MB2382; 6:hSM8N7fwrJRbNvgF2D8wZCWYatmvG/TjishRNsRtOo4bKcuDd3MeHoDWlQPKfsNKqmgU2cOWxTJFBCMVzI9seDTUNy9KQVOrBfaduBca95ophs2xRwfUiI6AtMLeyyeNrigrGxWZiP54DgXo1m85A9mjeatGLkNvh3JUan4evMTuy05bB6N/Vx1BbkB4eftkX5gO9Wl1ovqCiFhlZpElhlI6itlMxMTHNMEvsYBR57vgmzdESL6iDAxAN7YiHW5Dr+SfYKjfSAmbJiwI9ZhhDrpGI4uDp2qe5ellvTTKncEly5YtUhNlH7Y11nkN2PhXGCz0AfpnV5+GJJTf0J/ywzPa8fgwVOXArEmUxm3Zu49PmE42iWGTPFUAhbNAlTQoZ1DjZlQQml0F7lS4KYmaNTTLC9i2tVEvbaO5xGzn72YihXX6ncvSVOfCSgkkQcUwm2BRtu91yPY2anvouHdk1Q==; 5:AZdiYt3MNXGwJvxfauSVGdaxcRyHoRKEiBZ0vfgWGjWr4x5Imd7nQvUL/DoXwgB8aTJ/E5Jyf37CNokshcz+H1UdYtE+zP0PR0MI8OaOtT/OnH1eiLEdIuAVTKr7OWeuTyTnRKehn4D1NLJYBPkOslniu3/5Nul60XtB3g398Mk=; 7:gDkQJSg8ToGguyJ2yiL81pU4dnuZhsTSh4DE7M/xfg2c8s2PqB6SLh4kEDeqvdEzloxByb1x31OmUgriRw7nUeIZ0UQhxJsqPSd1TK9Ww3+1/ifgVBODk0kzodWk07b7X4KVdm8A/YPGLexRGt1Upw== x-ms-office365-filtering-correlation-id: cae1144a-9eba-40ab-4aee-08d66bc3bfd9 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2382; x-ms-traffictypediagnostic: VI1PR0401MB2382: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:VI1PR0401MB2382; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0401MB2382; x-forefront-prvs: 0899B47777 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(396003)(366004)(376002)(39860400002)(346002)(199004)(189003)(5660300001)(1076003)(26005)(76176011)(186003)(71200400001)(256004)(25786009)(105586002)(4326008)(6436002)(305945005)(11346002)(106356001)(446003)(44832011)(476003)(7736002)(55236004)(102836004)(78486014)(486006)(386003)(68736007)(52116002)(86362001)(6506007)(2616005)(71190400001)(66066001)(316002)(54906003)(6116002)(3846002)(2906002)(14454004)(36756003)(99286004)(50226002)(8936002)(1730700003)(81156014)(81166006)(8676002)(6512007)(53936002)(478600001)(97736004)(6486002)(6916009)(5640700003)(2351001)(2501003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2382; H:VI1PR0401MB2541.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 6uC+Nd0yW73j7s52jCxE1WBhPKg7SVtcnDkbiCMBhtrBG3shuLnSkqK8yhpkvzmA0NKwJKlc+W1En8/xvL23kSpTf0ZXIbzqLm+7IDuJn1CA6QNFD6FRrx2ZbRmisMZVY1u5Y0BZOBXIDQ5dcID+KaiN+trqVmtZUtNHEepgNopPdOeEN7b6DqPN1qbEo+zH5gtwXHKw7TO3DR6obL09AzxwY7Mc15azjkRo/VEIrNFStKRGIWeyny6iNeMLbHiM2aRXyhSkj9WsUn+JStnMT6bm4tDUJ7xoIQsqsB8oqIB/UeIhzdKP1IXpztjKwCrd spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cae1144a-9eba-40ab-4aee-08d66bc3bfd9 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2018 06:23:00.3956 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Subject: [dpdk-dev] [PATCH 06/20] bus/fslmc: fix parse method for bus devices 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: Shreyansh Jain Current code expects that bus->parse() would get a string containing the name of the bus. That is incorrect. bus->parse() is expected to have strings like: dpni.1,key=val dpio.2,key=val when user passed: -b fslmc:dpni.1,key=val This commit fixes this behavior. Fixes: 50245be05d1a ("bus/fslmc: support device blacklisting") Cc: stable@dpdk.org Signed-off-by: Shreyansh Jain --- drivers/bus/fslmc/fslmc_bus.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) -- 2.17.1 diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c index 89af9385a..565e0148f 100644 --- a/drivers/bus/fslmc/fslmc_bus.c +++ b/drivers/bus/fslmc/fslmc_bus.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: BSD-3-Clause * - * Copyright 2016 NXP + * Copyright 2016,2018 NXP * */ @@ -227,20 +227,16 @@ static int rte_fslmc_parse(const char *name, void *addr) { uint16_t dev_id; - char *t_ptr; - char *sep = strchr(name, ':'); + char *t_ptr = NULL, *dname = NULL; - if (strncmp(name, RTE_STR(FSLMC_BUS_NAME), - strlen(RTE_STR(FSLMC_BUS_NAME)))) { - return -EINVAL; - } + /* 'name' is expected to contain name of device, for example, dpio.1, + * dpni.2, etc. + */ - if (!sep) { - DPAA2_BUS_ERR("Incorrect device name observed"); + dname = strdup(name); + if (!dname) return -EINVAL; - } - - t_ptr = (char *)(sep + 1); + t_ptr = dname; if (strncmp("dpni", t_ptr, 4) && strncmp("dpseci", t_ptr, 6) && @@ -251,24 +247,29 @@ rte_fslmc_parse(const char *name, void *addr) strncmp("dpmcp", t_ptr, 5) && strncmp("dpdmai", t_ptr, 6)) { DPAA2_BUS_ERR("Unknown or unsupported device"); - return -EINVAL; + goto err_out; } t_ptr = strchr(name, '.'); if (!t_ptr) { DPAA2_BUS_ERR("Incorrect device string observed (%s)", t_ptr); - return -EINVAL; + goto err_out; } t_ptr = (char *)(t_ptr + 1); if (sscanf(t_ptr, "%hu", &dev_id) <= 0) { DPAA2_BUS_ERR("Incorrect device string observed (%s)", t_ptr); - return -EINVAL; + goto err_out; } + free(dname); if (addr) - strcpy(addr, (char *)(sep + 1)); + strcpy(addr, name); + return 0; +err_out: + free(dname); + return -EINVAL; } static int From patchwork Thu Dec 27 06:23:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 154552 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6604817ljp; Wed, 26 Dec 2018 22:24:02 -0800 (PST) X-Google-Smtp-Source: AFSGD/WFxt6yUZ8ucuwFiFHSn6JIlJ78kQI5zgKzzCMgpXuUrYRAFQ6GXL6Imucuw8nKvSt3lxYS X-Received: by 2002:a1c:1b8d:: with SMTP id b135mr20388719wmb.115.1545891842092; Wed, 26 Dec 2018 22:24:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545891842; cv=none; d=google.com; s=arc-20160816; b=JJo6ZvXVVaNJ8y2as8GSVXX90AHbnxNMHA1MmqVtQEgvJhkDRpwN+8pkhB5sshILJC PkbEVNYWonWy/BCupzRqixzHd9XG+E625pcJF3HWqDqOXJNU1Ce4q9mwq/3LiFdW6+iD nxBgGdMUYhJzdOj5JXpD/7qz6gA5KXXzrp4ZxKzA+4E5pHu6lH/XctfV7FsYhJ8Fq7z3 oiAgXV7sU9KgMrS6G7YAk2HHF4l1nO6JrBJfEI1JFKH5NaHx79fQBdb7gaV1JvNSUxny TKbBvOMA3tQ7daMkq1K9GrTPkQjj3H9aTN+Olw25y2fffrf9h9B2tXvtJC7zkp+7PJUy EiiQ== 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:mime-version :content-transfer-encoding:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:cc:to:from :dkim-signature; bh=6yMzxLZNcNqV6V7f+K7K/x9jYdWbUKqz8/iLU3i2EIY=; b=namKJVFcz2Xr4QjPmFEFA7ymzQCx9cumeJ75PavLmuoYmNsHcRGiZii4uVxwsfATKN uWydSEbGW3vvAXT91T+ABvir545caEFDzfQN5r71NTyPa4rvMu6aynPoi+a6vZtf0wAY UE8xby6Etn54zPanh89eIZ95EoXXTTQhzrPBZ4Su7eZHZFv2CGF9Mssdt4RLCtG99oU0 ch+u9YvQT7zDFCxC+JMst43QpC0RcPUlsYBtjs/ljAyZDR2U95063i1W/DMDKki3Ccs6 fFzyx1sTfPuhM+PR6XhhYXyNSkSiXeZoOsSo97HqlV4aRUZRiEn/c+JJY8X1aEmZflqe 1gIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=xuyw2qbz; 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 n6si18056889wrw.334.2018.12.26.22.24.01; Wed, 26 Dec 2018 22:24:02 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=xuyw2qbz; 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 AFD7456A3; Thu, 27 Dec 2018 07:23:10 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140084.outbound.protection.outlook.com [40.107.14.84]) by dpdk.org (Postfix) with ESMTP id 06B664CE4; Thu, 27 Dec 2018 07:23:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6yMzxLZNcNqV6V7f+K7K/x9jYdWbUKqz8/iLU3i2EIY=; b=xuyw2qbzryDMr5HjBiLlKKlNJ2TpiRWY5hO/OKH9kAAUBBesyNHffUMInSkuWWwVxl4ogKuH2s/MohnKiGczSRfM+rDFBtykxupzjz+ORs5lae7SdmPpVaflcNaRRH2pailHW/SNDGvtubJcPaOWL8OZpbiP+Zt9wN1M0xvTruE= Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com (10.168.65.19) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.134.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Thu, 27 Dec 2018 06:23:02 +0000 Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4]) by VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4%2]) with mapi id 15.20.1471.019; Thu, 27 Dec 2018 06:23:02 +0000 From: Hemant Agrawal To: "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , Shreyansh Jain , "stable@dpdk.org" Thread-Topic: [PATCH 07/20] net/dpaa2: fix device init for secondary process Thread-Index: AQHUnaye6bo6ysjQ+0GW0Kcr9YUv4w== Date: Thu, 27 Dec 2018 06:23:01 +0000 Message-ID: <20181227062233.30781-8-hemant.agrawal@nxp.com> References: <20181227062233.30781-1-hemant.agrawal@nxp.com> In-Reply-To: <20181227062233.30781-1-hemant.agrawal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.143.30.134] x-mailer: git-send-email 2.17.1 x-clientproxiedby: BM1PR01CA0120.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:40::14) To VI1PR0401MB2541.eurprd04.prod.outlook.com (2603:10a6:800:56::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0401MB2382; 6:YSBIhe3NEIv74FQoWq8KMLkiBmbqYHRP5a1/Rrm53484A8/Ka4jCjBqRu45RronTPdYycXjEnX8GatWhQWfK+LARl5lgAn2017m+ZxREsWNjkoWj1jqdYQaUTgsD2/hUgQkuCoYGjV21oImHlQvSfF9MocvCSr+0BLDQSnx1ixCLjXz+r9tnHPJljizm0/ETSXerLzlyLLhuKldICGNtJ7vphYdrlWuXfmvrV0vWGJK4pzBNAUmcqATK6XsnJ29yxdVJy7WIJGzaE1yzf8GouL5StR6xHs8ZyTpz4hKw/FSq5aYikArcsvvRuaR4ep5WRwH5pK7VOtxPLIpxKCeToBcIjujWso5ut6MGairS+T86Vg020sqU3EVCEcveS5+LsUoSnIURc2PYobpKtvgvIJH9Ouue1/0zNiaGrvlOHIlZR2jR05+73ubC0vtU/ksH70J5U46Q03xUzII5wlWy/A==; 5:yYxmUrbZt287h/0Ke3sNxYADZXCoZ8mAIWXkZv9kiclNOlkGWN0Ftl7YhEMg3hsh090ex9fSYwonTOOTVgj75ZVOn4PK9GYIkHKx27QLiv2RpvkFNunxtJFJU6bz0pgKGot8m/3BCoFoSxteRe6oXOqcO/QaFg2GDbkqn1grJis=; 7:UNdvMvY6bDUUIGJMbPLLVYzGJkHwYUgJtu81EilGtq1ewZkmwlDTgkZCvS2Ms83vYSDLOHZhc5SU/KSxtnCKm1/EbtKEgR6WRmXUlG5N+aCXZjD7uW+EztS8p77HJzfCys+FaBX5VZkjuz4EOKanEw== x-ms-office365-filtering-correlation-id: 9b7304df-a473-4e21-a198-08d66bc3c0b4 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2382; x-ms-traffictypediagnostic: VI1PR0401MB2382: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:VI1PR0401MB2382; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0401MB2382; x-forefront-prvs: 0899B47777 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(979002)(136003)(396003)(366004)(376002)(39860400002)(346002)(199004)(189003)(5660300001)(1076003)(26005)(76176011)(186003)(71200400001)(256004)(25786009)(105586002)(4326008)(6436002)(305945005)(11346002)(106356001)(14444005)(446003)(44832011)(476003)(7736002)(55236004)(102836004)(78486014)(486006)(386003)(68736007)(52116002)(86362001)(6506007)(2616005)(71190400001)(66066001)(316002)(54906003)(6116002)(3846002)(2906002)(14454004)(36756003)(99286004)(50226002)(8936002)(1730700003)(81156014)(81166006)(8676002)(6512007)(53936002)(478600001)(97736004)(6486002)(6916009)(5640700003)(2351001)(2501003)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2382; H:VI1PR0401MB2541.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: qA16ZuOgMdOXbqd/4wAqKUG/Jey7NQ+MXICdM5Pd3HT6Gw3J7J9zdiJJNH0c5cPi+yT1EO25lnY/joMWXMILGgj5h/47qitJ60+luzFUGBYvjLXfmp4FGeHpN2TqtR66KfUUTEmvwEwI1Ht41PlNzLzmDQrVTAvcbmY1oWiqSqGpb84JntSIsLvoeYd2l3QFDxd/8SN4HkD0eP3KUPBMnN32la+Il9NMT4h0pX3UK5gyDyGvqc2qZtMWVoHnPCOy+vVIxePQjVauWQNxWd/L4Fp2jZVnIUZ8Svv1ik9n2X6ogLD9qXouHDIsTJJvy/Gt spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9b7304df-a473-4e21-a198-08d66bc3c0b4 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2018 06:23:01.9736 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Subject: [dpdk-dev] [PATCH 07/20] net/dpaa2: fix device init for secondary process 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" In order to support I/O from secondary process, the burst APIs and OPS APIs shall be mapped/plugged. Fixes: c147eae01cb3 ("net/dpaa2: introduce NXP DPAA2 driver") Cc: stable@dpdk.org Signed-off-by: Shreyansh Jain --- drivers/net/dpaa2/dpaa2_ethdev.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 8d4ea1bca..39f85ae7b 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -1918,8 +1918,15 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) PMD_INIT_FUNC_TRACE(); /* For secondary processes, the primary has done all the work */ - if (rte_eal_process_type() != RTE_PROC_PRIMARY) + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { + /* In case of secondary, only burst and ops API need to be + * plugged. + */ + eth_dev->dev_ops = &dpaa2_ethdev_ops; + eth_dev->rx_pkt_burst = dpaa2_dev_prefetch_rx; + eth_dev->tx_pkt_burst = dpaa2_dev_tx; return 0; + } dpaa2_dev = container_of(dev, struct rte_dpaa2_device, device); From patchwork Thu Dec 27 06:23:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 154553 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6604950ljp; Wed, 26 Dec 2018 22:24:15 -0800 (PST) X-Google-Smtp-Source: ALg8bN6VC1wL/Oteka9Ryu61KBwijpQV2tXu4yyk8cRYtC275Ka1oeTkhAQY5rEmaa085u+yE7UT X-Received: by 2002:adf:9f10:: with SMTP id l16mr21332599wrf.206.1545891855293; Wed, 26 Dec 2018 22:24:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545891855; cv=none; d=google.com; s=arc-20160816; b=CrM2MHSq3wGXpoO5Bjpe0ILkNZd/ojEqBAbwxldJMrhHnfO8kiclFDV42wYPRjcWQs 27fV1cU34YXY0fWMqHVubet5YrGKlrBSDxkmLA6b6umIbg4mwhmHqkMlCKUCt+oUKxG5 LmOMKOgG4CXfgDvCMWDQH3cdcFiApIdAzKCNtsNM1a6vA426oMCHCuX1UOdl/7lpJEeD uqwIq0j9AJTp6UiaMP73OOfgMFI3ARzxt6ztkcSPTEQ9Tr1v6ShpkPOkYC7Hj7aqfpFf wmZXQF+QhoYgkkrxCV/rYfFi7nDwIQn91XiR2sreSKdwHAv5nOB4DLQOgUbAPJE9BXf0 iyKw== 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:mime-version :content-transfer-encoding:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:cc:to:from :dkim-signature; bh=cJ7YG24b+2Ze8JACRCDpwNnDrKbqx2gzNABKrH83naM=; b=RJIzcjdTITVJ5TkpVbQos8OmR9KhTpp9DBxJVXxMfUrjzIBB6Ad8gAepESuKzbVVkT wrJ29QPe9B7wBB3KcWQXHSpKix+iWwX38kRnhC3yAiO3dIKaDj2QOeRmednVf+Uo59Oa OBGL+VDs+MAT/bAeYBHSmcH7H5Fk/EiV5AzZvz78Khfxl2/39EUcOomnIcHIHwRWUHn4 hdG3vRSlsRIVfVnLZcUqsWivGIzuWYS+2uIjP/AoGK2eF+Pptq1W2x8JW6LkCygDuot+ sA3OfOWsS//gGiGbZdHO0cqNmAd7QIowCKnobc6RYFjXb+wG0VMIEpidVXXxVieIcVDz njrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=spUCVoST; 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 j65si18133753wmd.175.2018.12.26.22.24.15; Wed, 26 Dec 2018 22:24:15 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=spUCVoST; 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 2D33158CB; Thu, 27 Dec 2018 07:23:13 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140053.outbound.protection.outlook.com [40.107.14.53]) by dpdk.org (Postfix) with ESMTP id A9CD45681 for ; Thu, 27 Dec 2018 07:23:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cJ7YG24b+2Ze8JACRCDpwNnDrKbqx2gzNABKrH83naM=; b=spUCVoSThuFCVzOSKYaKr19LTDR+XBuvTEu6iCSTP7VU2I4NPg3SYz/0oJi4//R06FzqqpzW/3Wj2ndPtEVH5DZpyVjylFjDp2pKl1/yJNI28EijluxXHVr1o42LDXttrx6OX2R2BWoj7IlpF5a4RSaaeOV4LL2/PN9CYux7irQ= Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com (10.168.65.19) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.134.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Thu, 27 Dec 2018 06:23:03 +0000 Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4]) by VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4%2]) with mapi id 15.20.1471.019; Thu, 27 Dec 2018 06:23:03 +0000 From: Hemant Agrawal To: "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , Shreyansh Jain , Akhil Goyal Thread-Topic: [PATCH 08/20] net/dpaa2: enable optional timestamp in mbuf Thread-Index: AQHUnayfnI9sjf1yC0CfM0Y9d7Jj4Q== Date: Thu, 27 Dec 2018 06:23:03 +0000 Message-ID: <20181227062233.30781-9-hemant.agrawal@nxp.com> References: <20181227062233.30781-1-hemant.agrawal@nxp.com> In-Reply-To: <20181227062233.30781-1-hemant.agrawal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.143.30.134] x-mailer: git-send-email 2.17.1 x-clientproxiedby: BM1PR01CA0120.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:40::14) To VI1PR0401MB2541.eurprd04.prod.outlook.com (2603:10a6:800:56::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0401MB2382; 6:xq+HNEVdxQCoAsD2bgCysG74F84ROZC+YO3iQbgQZQzeasPAIC1R1KXlTlnQhk9q4DAZGo9PREkMMhQSRVcscmIbtbv1kdXo6ouOPGnYFkcPqFvZXH6plLsyGHZrzgqAKYtn5y1ahKFdpBhhwmWAML5DfYRgMQzfI/U4M+Sb2IKNrqcUfJDX3VAIDYRv2DsDxEH0LBknZtTg9shuRB7byHr2tRMLT2gnMx3DebIPcI1YJi4lRjLodMrWRoDbq7Jy6VvIFd20Wzx2/+cMnJbPaOanusFe/qRZU5aqYyoKbXK/3mDM9qbLsC44Vb9ry8H176fOTi+ycZ+ZUiggwOhAew+oSiEosTSrJHZBajHJwvvg0mDBUMk3vwXXctQnuTXy64QfDSKrf0QS/UBlvGNSyaX3C3lZ6zKnxnP1MgMC25c77sEpYfw6tmyOdfh4zsXfZqKGFUBQW4Sxvy2jaKs8Mg==; 5:JRcO63CrVeqaJAre8agmNgHb/L8YMuvnVUU2eg0tesDHDCvUEroaKDcT21fminNe3nFU9JODKagTZZvyydxJEOVsU/lGD+TBoGP/ngPoDe05r0jJGTBr8ikOWlg/l5GtGLOxk+vmrKkHyHr5FxdmGjOWjuRftSQ4O80PG3oukk8=; 7:epVEYv9/3ZjR7SXakns2bLwOtrgBL550+H+KBXXzL192Fl9QE2rLIktSNeFDvcTowjRaXdfmrRHKJmVB8fkhpVAIMcEQSAbj3LjL9QofvmOxbSE8+KOqSPcneiEvSbzz124gJe7qvIZjlTlhl32EnA== x-ms-office365-filtering-correlation-id: 9a168d21-2d9b-439f-6d42-08d66bc3c1a5 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2382; x-ms-traffictypediagnostic: VI1PR0401MB2382: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:VI1PR0401MB2382; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0401MB2382; x-forefront-prvs: 0899B47777 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(396003)(366004)(376002)(39860400002)(346002)(199004)(189003)(5660300001)(1076003)(26005)(76176011)(186003)(71200400001)(256004)(25786009)(105586002)(4326008)(6436002)(305945005)(11346002)(106356001)(14444005)(446003)(44832011)(476003)(5024004)(7736002)(55236004)(102836004)(78486014)(486006)(386003)(68736007)(52116002)(86362001)(6506007)(2616005)(71190400001)(66066001)(316002)(54906003)(6116002)(3846002)(2906002)(14454004)(36756003)(99286004)(50226002)(8936002)(1730700003)(81156014)(81166006)(8676002)(6512007)(53936002)(478600001)(97736004)(6486002)(6916009)(5640700003)(2351001)(2501003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2382; H:VI1PR0401MB2541.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: b52ajO5qsrg3lOQLTOnNvVn6Eq0nVeFO7ve4fLi5+pTBf7MEhGqZTEaD5unRwck9JaQjBraxNW33vQfTewb2PiFDaYlg5I2TikYfhpDXOJYpLYjOqBKi4AwerwnA45P0IBbGBag1ndvyqYLFPXNHBmuiDw9DNP1J6dDuPPNFUJLbZv04wXQfcMZmZL/np8IxiBVyM3TQm9PDa/M2Wped14+hZJt1ysgtEpyIHGeVTE+1fi0goBjKjutcbbUbNP8Qx61UwfJ44nB/utdRVh310btkWwl53IgXc+b5y6T7mXlZaf3TH1dO+7/eI5o5iLqm spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9a168d21-2d9b-439f-6d42-08d66bc3c1a5 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2018 06:23:03.4423 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Subject: [dpdk-dev] [PATCH 08/20] net/dpaa2: enable optional timestamp in mbuf 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: Akhil Goyal This patch enables the population of timestamp field in mbuf on packet receive. It may give performance impact on LX2xxx platforms. So, it has been made optional for Lx2xxx platform. One shall call, rte_dpaa2_enable_ts() to enable it. Nothing is required for LS2 and LS1088 platforms. Signed-off-by: Akhil Goyal --- doc/api/doxy-api-index.md | 1 + doc/api/doxy-api.conf.in | 1 + drivers/net/dpaa2/Makefile | 2 ++ drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 2 ++ drivers/net/dpaa2/dpaa2_ethdev.c | 9 +++++ drivers/net/dpaa2/dpaa2_ethdev.h | 4 +++ drivers/net/dpaa2/dpaa2_rxtx.c | 18 ++++++++++ drivers/net/dpaa2/meson.build | 2 ++ drivers/net/dpaa2/rte_pmd_dpaa2.h | 39 +++++++++++++++++++++ drivers/net/dpaa2/rte_pmd_dpaa2_version.map | 6 ++++ 10 files changed, 84 insertions(+) create mode 100644 drivers/net/dpaa2/rte_pmd_dpaa2.h -- 2.17.1 diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md index e27874c5a..d95ad566c 100644 --- a/doc/api/doxy-api-index.md +++ b/doc/api/doxy-api-index.md @@ -43,6 +43,7 @@ The public API headers are grouped by topics: [i40e] (@ref rte_pmd_i40e.h), [bnxt] (@ref rte_pmd_bnxt.h), [dpaa] (@ref rte_pmd_dpaa.h), + [dpaa2] (@ref rte_pmd_dpaa2.h), [dpaa2_mempool] (@ref rte_dpaa2_mempool.h), [dpaa2_cmdif] (@ref rte_pmd_dpaa2_cmdif.h), [dpaa2_qdma] (@ref rte_pmd_dpaa2_qdma.h), diff --git a/doc/api/doxy-api.conf.in b/doc/api/doxy-api.conf.in index 77ba327a8..bef9320c0 100644 --- a/doc/api/doxy-api.conf.in +++ b/doc/api/doxy-api.conf.in @@ -9,6 +9,7 @@ INPUT = @TOPDIR@/doc/api/doxy-api-index.md \ @TOPDIR@/drivers/net/bnxt \ @TOPDIR@/drivers/net/bonding \ @TOPDIR@/drivers/net/dpaa \ + @TOPDIR@/drivers/net/dpaa2 \ @TOPDIR@/drivers/net/i40e \ @TOPDIR@/drivers/net/ixgbe \ @TOPDIR@/drivers/net/softnic \ diff --git a/drivers/net/dpaa2/Makefile b/drivers/net/dpaa2/Makefile index ca5f7a336..2b9c011d6 100644 --- a/drivers/net/dpaa2/Makefile +++ b/drivers/net/dpaa2/Makefile @@ -42,4 +42,6 @@ LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs LDLIBS += -lrte_common_dpaax +# install this header file +SYMLINK-$(CONFIG_RTE_LIBRTE_DPAA2_PMD)-include := rte_pmd_dpaa2.h include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c index 713a41bf3..a6f86df8c 100644 --- a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c +++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c @@ -296,8 +296,10 @@ dpaa2_attach_bp_list(struct dpaa2_dev_priv *priv, DPNI_BUF_LAYOUT_OPT_FRAME_STATUS | DPNI_BUF_LAYOUT_OPT_PARSER_RESULT | DPNI_BUF_LAYOUT_OPT_DATA_ALIGN | + DPNI_BUF_LAYOUT_OPT_TIMESTAMP | DPNI_BUF_LAYOUT_OPT_PRIVATE_DATA_SIZE; + layout.pass_timestamp = true; layout.pass_frame_status = 1; layout.private_data_size = DPAA2_FD_PTA_SIZE; layout.pass_parser_result = 1; diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 39f85ae7b..861fbcd90 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -56,6 +56,9 @@ static uint64_t dev_tx_offloads_nodis = DEV_TX_OFFLOAD_MT_LOCKFREE | DEV_TX_OFFLOAD_MBUF_FAST_FREE; +/* enable timestamp in mbuf */ +enum pmd_dpaa2_ts dpaa2_enable_ts; + struct rte_dpaa2_xstats_name_off { char name[RTE_ETH_XSTATS_NAME_SIZE]; uint8_t page_id; /* dpni statistics page id */ @@ -88,6 +91,12 @@ static int dpaa2_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu); int dpaa2_logtype_pmd; +__rte_experimental void +rte_pmd_dpaa2_set_timestamp(enum pmd_dpaa2_ts enable) +{ + dpaa2_enable_ts = enable; +} + static int dpaa2_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) { diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h index bd69f523d..7cf6e4191 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.h +++ b/drivers/net/dpaa2/dpaa2_ethdev.h @@ -9,6 +9,7 @@ #define _DPAA2_ETHDEV_H #include +#include #include #include @@ -83,6 +84,9 @@ #define DPAA2_PKT_TYPE_VLAN_1 0x0160 #define DPAA2_PKT_TYPE_VLAN_2 0x0260 +/* enable timestamp in mbuf*/ +extern enum pmd_dpaa2_ts dpaa2_enable_ts; + struct dpaa2_dev_priv { void *hw; int32_t hw_id; diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index eab943dcf..816ea00fd 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -42,6 +42,7 @@ dpaa2_dev_rx_parse_slow(struct rte_mbuf *mbuf, static inline void __attribute__((hot)) dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd) { + struct dpaa2_annot_hdr *annotation; uint16_t frc = DPAA2_GET_FD_FRC_PARSE_SUM(fd); m->packet_type = RTE_PTYPE_UNKNOWN; @@ -104,6 +105,19 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd) } m->hash.rss = fd->simple.flc_hi; m->ol_flags |= PKT_RX_RSS_HASH; + + if (dpaa2_enable_ts == PMD_DPAA2_ENABLE_TS) { + annotation = (struct dpaa2_annot_hdr *) + ((size_t)DPAA2_IOVA_TO_VADDR( + DPAA2_GET_FD_ADDR(fd)) + DPAA2_FD_PTA_SIZE); + m->timestamp = annotation->word2; + m->ol_flags |= PKT_RX_TIMESTAMP; + DPAA2_PMD_DP_DEBUG("pkt timestamp:0x%" PRIx64 "", m->timestamp); + } + + DPAA2_PMD_DP_DEBUG("HW frc = 0x%x\t packet type =0x%x " + "ol_flags =0x%" PRIx64 "", + frc, m->packet_type, m->ol_flags); } static inline uint32_t __attribute__((hot)) @@ -205,6 +219,10 @@ dpaa2_dev_rx_parse(struct rte_mbuf *mbuf, void *hw_annot_addr) else if (BIT_ISSET_AT_POS(annotation->word8, DPAA2_ETH_FAS_L4CE)) mbuf->ol_flags |= PKT_RX_L4_CKSUM_BAD; + mbuf->ol_flags |= PKT_RX_TIMESTAMP; + mbuf->timestamp = annotation->word2; + DPAA2_PMD_DP_DEBUG("pkt timestamp: 0x%" PRIx64 "", mbuf->timestamp); + /* Check detailed parsing requirement */ if (annotation->word3 & 0x7FFFFC3FFFF) return dpaa2_dev_rx_parse_slow(mbuf, annotation); diff --git a/drivers/net/dpaa2/meson.build b/drivers/net/dpaa2/meson.build index b34595258..07aada87c 100644 --- a/drivers/net/dpaa2/meson.build +++ b/drivers/net/dpaa2/meson.build @@ -18,3 +18,5 @@ includes += include_directories('base', 'mc') # depends on fslmc bus which uses experimental API allow_experimental_apis = true + +install_headers('rte_pmd_dpaa2.h') diff --git a/drivers/net/dpaa2/rte_pmd_dpaa2.h b/drivers/net/dpaa2/rte_pmd_dpaa2.h new file mode 100644 index 000000000..f9303acad --- /dev/null +++ b/drivers/net/dpaa2/rte_pmd_dpaa2.h @@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2018 NXP + */ + +#ifndef _RTE_PMD_DPAA2_H +#define _RTE_PMD_DPAA2_H + +/** + * @file rte_pmd_dpaa2.h + * + * NXP dpaa2 PMD specific functions. + * + * @warning + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice + * + */ + +#include + +enum pmd_dpaa2_ts { + PMD_DPAA2_DISABLE_TS, + PMD_DPAA2_ENABLE_TS +}; + +/** + * @warning + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice + * + * Enable/Disable timestamping update in mbuf for LX2160 kind of devices. + * For LS2088/LS1088 devices, timestamping will be updated in mbuf without + * calling this API. + * + * @param pmd_dpaa2_ts + * Enum to enable/disable timestamp update in mbuf for LX2160 devices. + */ +__rte_experimental +void rte_pmd_dpaa2_set_timestamp(enum pmd_dpaa2_ts); + +#endif /* _RTE_PMD_DPAA2_H */ diff --git a/drivers/net/dpaa2/rte_pmd_dpaa2_version.map b/drivers/net/dpaa2/rte_pmd_dpaa2_version.map index 09f4364bc..de95a03cd 100644 --- a/drivers/net/dpaa2/rte_pmd_dpaa2_version.map +++ b/drivers/net/dpaa2/rte_pmd_dpaa2_version.map @@ -10,3 +10,9 @@ DPDK_17.11 { dpaa2_eth_eventq_detach; } DPDK_17.05; + +EXPERIMENTAL { + global: + + rte_pmd_dpaa2_set_timestamp; +} DPDK_17.11; From patchwork Thu Dec 27 06:23:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 154554 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6605068ljp; Wed, 26 Dec 2018 22:24:27 -0800 (PST) X-Google-Smtp-Source: AFSGD/W9HHVqrOoiwhcF1lIyc74R0OFRmIj6R6uItSYDA4XdytKM0I0KjvoFdBK6kb+S035yvsNy X-Received: by 2002:a1c:a6c2:: with SMTP id p185mr18583528wme.133.1545891867320; Wed, 26 Dec 2018 22:24:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545891867; cv=none; d=google.com; s=arc-20160816; b=CMFpsJPKZ+KpZ0iudFHrww7dOsuJYLTm0NakRUvqcLfsHiZokRkqlRjeRdOHrUI+ze P0Z55gNwhJJvo/RuCrR4aQn3ZLOT7+0O9mHfSkUfSceYvD0TqL3FX1CUt3d41zkzdPAT bfWX/XZBa9QtHeaKn74SGfkdI2WxphlhPO3C5sGBD15qFUUsz+r0/ybK0S/j9elHtm6I 5jHdV46yshoqr/+bhPnIGMeMsSg9I9x57PltloAebC7EWtSpS76IwPF9OtDiVDuOtWfP zcEYli3UiM2pH0SA2iODwm4Es+RJKMet0Uu015u4+Z9+MUTHjozu22bsypb/YTLPAKeJ T/TA== 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:mime-version :content-transfer-encoding:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:cc:to:from :dkim-signature; bh=gYGg26Hi4WHGu76QL91wEzudXBl1iIOrM/5zqnMwmHA=; b=NnB86IKTBiKFRacgP2+2FaDzSilVeVarFCATyWDJz+pZf7c23RJMgoJO8iH+qRE6zX cJLS+vivlpVZnbJU24eYf78eAXqMGpKNHSmXivVpkYkXABqgOSlgQ2fJQ2NXqUL+xjUO dJjYuwLhpRv4J3G05vXSl6DdZ0+rbyPLLcjwhzlMtFgheB1Tje8bLo7m/7rMgqaVwDFY Nzmbjtl55N6qMClXTFlyuxqqgFbXG61LX7VWBBKIssMhfUdEBLIvrUCd6Q7n0bpA31De +5iv2C6xYCPzWxsc2xp1usCj1nIJ2vVtm/LbzoxDOIlYrKG9VBsONXvBdV6MnqdDKf3h tQ8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=QTdVpqxp; 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 m3si18935965wrj.401.2018.12.26.22.24.27; Wed, 26 Dec 2018 22:24:27 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=QTdVpqxp; 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 530325920; Thu, 27 Dec 2018 07:23:16 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140088.outbound.protection.outlook.com [40.107.14.88]) by dpdk.org (Postfix) with ESMTP id 341DF5689 for ; Thu, 27 Dec 2018 07:23:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gYGg26Hi4WHGu76QL91wEzudXBl1iIOrM/5zqnMwmHA=; b=QTdVpqxpGXPJcoFbLkWLaqsobeA2l/G/VN/4rpwHLv0Bft0G+E6y30hzK6ozzlLPvfwvA8BWnlP/+jkOdlb0LjHZYDq7tIbyiPzYD1RpmMiv4k+FUTHJyM2YHhAhvlHk9x2Y39kHLLyIEzMVy2c3cujSpXVfVJMl9Inwm8JAcjg= Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com (10.168.65.19) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.134.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Thu, 27 Dec 2018 06:23:05 +0000 Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4]) by VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4%2]) with mapi id 15.20.1471.019; Thu, 27 Dec 2018 06:23:05 +0000 From: Hemant Agrawal To: "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , Shreyansh Jain , Youri Querry , Nipun Gupta Thread-Topic: [PATCH 09/20] bus/fslmc: upgrade to latest qbman library Thread-Index: AQHUnaygdr1vJTTkCUGG+FacvwnB5g== Date: Thu, 27 Dec 2018 06:23:05 +0000 Message-ID: <20181227062233.30781-10-hemant.agrawal@nxp.com> References: <20181227062233.30781-1-hemant.agrawal@nxp.com> In-Reply-To: <20181227062233.30781-1-hemant.agrawal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.143.30.134] x-mailer: git-send-email 2.17.1 x-clientproxiedby: BM1PR01CA0120.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:40::14) To VI1PR0401MB2541.eurprd04.prod.outlook.com (2603:10a6:800:56::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0401MB2382; 6:nbiwIKiMPjZBvl4WJs5p0SSJjsce0ABbjQryz1cBUjBZhnnZonLag7HRlQRwNEku2nVFZ3hAVayjZaA/ox9k2aGwLQo77UMZy8cXwCkT0CTfBiOBWkuwUlXga5Vvt8fQGO5/Rgp39YbUUiiVbwd62fx5QdGVkcj4qAnjKVjJbIYSY66KIAVjXCFSY8zkdaMoB/PQAkEGEO1kv+bXkxQrnhBR/MRjLvIqWJxP0C/rw+ZaXiNVW92XoL3BvrkfhEOBn49PAnZytVVk+SDV9cIWSe9ihmTUHGEgNLBCJgFsxRsEa6StPbsU5p+qoZ0vGqhvp14cxL4AHkMtOBECW8w/+0qFB8sEQtpYvlr7kuMPJmxRoeM/0JgsoEsVlcR3akVd/a9fDpDQqmJPOk1Gs4yPZwn+UOcbbn9k1y7bRDfFQ9dJg1hZ61Y44n9rNq9KchO/XjLiHkApnx18XsaSQP7hJg==; 5:AsBM6hEP5rcI+hNav2l5h3RDjWmWae/O3Y0uFGuq8DanN7qVuk3L/6j+wIGAgyTL/GJFeJtqDAdUVlDoa932y33Cf8OX7SHTvVjcWpdRni//bniRxbqFYCHw5SvfGlvRGtGYS1Ax+fYB0ljvilFRMm326uNKmFUEW3g2wyIYhFo=; 7:GjeV7Zooe4cIVkLl8KYXOnFaYY4FWVr6Kfs53/5FPl1YqrMLBuXhy60KKggsAYDF2vy8gLvNfKsvXdZh40xKUW1YSmTkbVJaJURO85UraCYyCJIEiuVJihhxhEv8IbyqjNe51mNbNHdj8WsRQLUSzA== x-ms-office365-filtering-correlation-id: d512e965-42ac-4c0d-c246-08d66bc3c29f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2382; x-ms-traffictypediagnostic: VI1PR0401MB2382: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:VI1PR0401MB2382; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0401MB2382; x-forefront-prvs: 0899B47777 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(396003)(366004)(376002)(39860400002)(346002)(199004)(189003)(5660300001)(1076003)(26005)(76176011)(186003)(71200400001)(256004)(25786009)(105586002)(4326008)(6436002)(305945005)(11346002)(106356001)(14444005)(446003)(44832011)(476003)(7736002)(55236004)(102836004)(78486014)(486006)(386003)(68736007)(52116002)(86362001)(6506007)(2616005)(71190400001)(66066001)(316002)(54906003)(6116002)(3846002)(2906002)(14454004)(36756003)(99286004)(50226002)(8936002)(1730700003)(81156014)(81166006)(8676002)(6512007)(53936002)(478600001)(97736004)(6486002)(6916009)(5640700003)(2351001)(2501003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2382; H:VI1PR0401MB2541.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: /bTeRlmBLh4WosqMD6DadX2NlU4mQxiqNSFM3kQdSUfR5s+HPixRUN2xQoTp1viwSQV0N3BUt0J6wkY6oxSQMznovu5BLHlIA+ZfCQEd2hN71I6BivacT9yWlpTmtQefQv4e/keVaylYZdf2SDz++bhWYUYjBSTrEi9zX3fjT04VRX9gG+cmLhx8LrItxcVjYC3uI3xseU+y5UdHoybCKOEZ1k93blKFIPRpN4wt0CJTtFVnyPmCtkBGH6t7yq+NQYt58v85l9XCDbAtSkwpwEIn5QIpwsTSDer9+r/HFik6tdW9rNOK0tRvHUT5yNhB spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d512e965-42ac-4c0d-c246-08d66bc3c29f X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2018 06:23:05.1454 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Subject: [dpdk-dev] [PATCH 09/20] bus/fslmc: upgrade to latest qbman library X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch upgrades and sync the dpdk based qbman code with new version of qbman flib. Signed-off-by: Youri Querry Signed-off-by: Nipun Gupta Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/qbman/qbman_portal.c | 8 ++++---- drivers/bus/fslmc/qbman/qbman_sys.h | 17 +++++++++++------ 2 files changed, 15 insertions(+), 10 deletions(-) -- 2.17.1 diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c b/drivers/bus/fslmc/qbman/qbman_portal.c index bbea37efc..2f572a08b 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.c +++ b/drivers/bus/fslmc/qbman/qbman_portal.c @@ -201,7 +201,7 @@ struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d) p->vdq.valid_bit = QB_VALID_BIT; p->dqrr.valid_bit = QB_VALID_BIT; qman_version = p->desc.qman_version; - if ((qman_version & 0xFFFF0000) < QMAN_REV_4100) { + if ((qman_version & QMAN_REV_MASK) < QMAN_REV_4100) { p->dqrr.dqrr_size = 4; p->dqrr.reset_bug = 1; } else { @@ -1315,9 +1315,9 @@ const struct qbman_result *qbman_swp_dqrr_next_mem_back(struct qbman_swp *s) */ 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)) + if ((response_verb == QBMAN_RESULT_DQ) + && (flags & QBMAN_DQ_STAT_VOLATILE) + && (flags & QBMAN_DQ_STAT_EXPIRED)) atomic_inc(&s->vdq.busy); return p; } diff --git a/drivers/bus/fslmc/qbman/qbman_sys.h b/drivers/bus/fslmc/qbman/qbman_sys.h index 0571097ab..e3bd1c5e6 100644 --- a/drivers/bus/fslmc/qbman/qbman_sys.h +++ b/drivers/bus/fslmc/qbman/qbman_sys.h @@ -387,6 +387,10 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s, { uint32_t reg; int i; + int cena_region_size = 4*1024; + + if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000) + cena_region_size = 64*1024; #ifdef RTE_ARCH_64 uint8_t wn = CENA_WRITE_ENABLE; #else @@ -396,7 +400,8 @@ 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(64*1024); + s->cena = malloc(cena_region_size); + if (!s->cena) { pr_err("Could not allocate page for cena shadow\n"); return -1; @@ -412,12 +417,12 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s, QBMAN_BUG_ON(reg); #endif if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000) - memset(s->addr_cena, 0, 64*1024); + memset(s->addr_cena, 0, cena_region_size); else { /* Invalidate the portal memory. * This ensures no stale cache lines */ - for (i = 0; i < 0x1000; i += 64) + for (i = 0; i < cena_region_size; i += 64) dccivac(s->addr_cena + i); } @@ -425,12 +430,12 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s, 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) + 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); + 1, 3, 2, 0, 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); + 1, 3, 2, 2, 1, 1, 1, 1, 1, 1); } if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000) { From patchwork Thu Dec 27 06:23:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 154555 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6605185ljp; Wed, 26 Dec 2018 22:24:38 -0800 (PST) X-Google-Smtp-Source: ALg8bN43gEq6vUr6tqfWcwN/XsQl5AN+yj+Qo3Z50MxfHP/hdUA+zHvU4991802Zik/pHWsIaN9n X-Received: by 2002:a5d:6aca:: with SMTP id u10mr20343443wrw.310.1545891878463; Wed, 26 Dec 2018 22:24:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545891878; cv=none; d=google.com; s=arc-20160816; b=Xe8QXVfe5vgZGZTA/Qx80IK7TSPsUYjGj5CvRlGXgg0xGCMpP7TxUaRFKd9MPul55L M7+SIDkgJWPUc0F6efAWeg9ceMC0GucSoaOrScKh2f5pdGDHkSGVEua8J+epsCWy+qlF lkP/zWYlF/dbvU3y1BUz6ZYvMiB5N9QRcFBtshfStowJFronrevLMWDgaKF3WWmdJEqh VmFuTAK4q0+OURliw/+3vMwTWDL5m2dVRy5fbavk2jWsTYtULx6A7inWbhrK7c0nx9qm t7f0gbMytsMhUXJ0KCr8z1zJER5Ud2CLEvxbiHH4TFuEW0NA6R6SUNxbQqqShlhttoRt 53rA== 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:mime-version :content-transfer-encoding:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:cc:to:from :dkim-signature; bh=oKq03j6KB+Lq6RJYA96PcYgrtuHdspSpE3NF4KQlgqA=; b=S9+gZlxH+i3Gqzw5A2PaID6rDFdbVK9T+1zSEU+mXPNY3e9rPaKfGJAXln/Nc+6r4a hEef6/nFGFth/a0OaORYbo89p9l8/9wl3TbIAVjWsSwMSmg6R87jzY0Ww5DlWIR5K4Kl gnoJDH/EER1GMsgN4xnjiJK84HKvdhIQH21RemO92wa/AvA6Nz1WB2A9iOpTiPVVTT1S HZ3K7JKgG/mJVqLPViXQfqd2ykrPd9pG04SplIxsaznE6UjVME+3WbwZVypxKjreiKSy OGJJGFX5YrZTQTZ3EZf+e4mdQl12q7ZjmjL/Vr4UxJFXGjiU+91r/MjWHNZzLzzQk24+ ObfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=oGn3KwBC; 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 n6si18057782wrw.334.2018.12.26.22.24.38; Wed, 26 Dec 2018 22:24:38 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=oGn3KwBC; 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 245E55A6A; Thu, 27 Dec 2018 07:23:18 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140047.outbound.protection.outlook.com [40.107.14.47]) by dpdk.org (Postfix) with ESMTP id 3A7CC4F9A for ; Thu, 27 Dec 2018 07:23:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oKq03j6KB+Lq6RJYA96PcYgrtuHdspSpE3NF4KQlgqA=; b=oGn3KwBCDQhAvdXn3ra0f+lYyef88hn4fEscqlSyJeX1L4gVo+JwzKrx928WkojBGihgPWujAoYth1P456BSqcXs3jeLS1j1xg6s+vwIiry7y3rvxJvAFqWgJLku4z2fVoZQ2lFG+v8pOThCZM6XDoRxHu8CIwPVoNU9oQdp/JQ= Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com (10.168.65.19) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.134.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Thu, 27 Dec 2018 06:23:07 +0000 Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4]) by VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4%2]) with mapi id 15.20.1471.019; Thu, 27 Dec 2018 06:23:07 +0000 From: Hemant Agrawal To: "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , Shreyansh Jain , Roy Pledge , Youri Querry Thread-Topic: [PATCH 10/20] bus/fslmc: add dynamic config for memback portal mode Thread-Index: AQHUnayhxD33pZRKb0mmT/0mvsVW0w== Date: Thu, 27 Dec 2018 06:23:06 +0000 Message-ID: <20181227062233.30781-11-hemant.agrawal@nxp.com> References: <20181227062233.30781-1-hemant.agrawal@nxp.com> In-Reply-To: <20181227062233.30781-1-hemant.agrawal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.143.30.134] x-mailer: git-send-email 2.17.1 x-clientproxiedby: BM1PR01CA0120.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:40::14) To VI1PR0401MB2541.eurprd04.prod.outlook.com (2603:10a6:800:56::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0401MB2382; 6:Jr5XF+6ehKvBOTEiRtLEOXWvXSpEzWGppC8oe7QgO9Fwtp9xlfUHoXIHanVGMtRS6J0sW2dOK4vgs3gnJbGoOfyLTam5Edf0LwgkvIMxeK6Mu6eny9PWDaAGfvmT6rkMdDwgcLmYLx4L9Ew2Tz07Ym4clkuRsC4et3yIqiayCODlGFg9DR0SbhWjpJwWqhDJ2BqJkWdZ5TzVBxcA+h1tPFKxC7pWlXdGVrDdpUUAmXXssEF1WNBCpb53bX+5v8fAAFF1Z3o1zK/iMArxmpbC0/CqbjqhXgv6te8EVzYGF8RHu0qd9nMbJr8enWv3/Xs3l4x5lgSnBnnYsyQHLEtlW5id/ODavpT1vQu0JyGxX+FuSY30qVy+ua+OOgBnxUah1711DA2gbyJC7y5EX8LsXSi4414G4jknbjt/prKADxdBfXdAXiAOwyoRAkqFduMknAYPWGNCSvRVcxfxvYlEKw==; 5:ZOXyjQsARbUXNWKeeiStUCKjkU59Pdy7j+q8pyHhhMiaCNjnUdc4EExvjmG6oSNa0w1XhXjrLaWeqQlk3d0IasQov73D0iO334QuXJv5xBFe/IpB1s5LcFNDdwPx/O7JZInb6332uCj1gEx2ZR3+DWhrCnVC9VkVWsRfIa/BE7g=; 7:epiWbwEKlPP00WHiQZvupiKCpSRkXpwYQbVHpXopt/P+TS16ft7doWiYk+V3hEDxoqCM9dJ44q1d8gMUeCHp4XnweIwW++1lnF1kydqO3lWDeTKTHBsQJmB4KxnNZhn5lF4vcmUibH/ZtthQFsUHqg== x-ms-office365-filtering-correlation-id: a826eecd-26e5-4da6-a09b-08d66bc3c3a3 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2382; x-ms-traffictypediagnostic: VI1PR0401MB2382: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:VI1PR0401MB2382; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0401MB2382; x-forefront-prvs: 0899B47777 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(396003)(366004)(376002)(39860400002)(346002)(199004)(189003)(5660300001)(1076003)(26005)(76176011)(186003)(71200400001)(256004)(25786009)(105586002)(4326008)(6436002)(305945005)(11346002)(106356001)(14444005)(446003)(44832011)(476003)(7736002)(55236004)(102836004)(78486014)(486006)(386003)(68736007)(52116002)(86362001)(6506007)(2616005)(71190400001)(66066001)(316002)(54906003)(6116002)(3846002)(2906002)(14454004)(36756003)(99286004)(50226002)(8936002)(1730700003)(81156014)(81166006)(8676002)(6512007)(53936002)(478600001)(97736004)(6486002)(6916009)(5640700003)(2351001)(2501003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2382; H:VI1PR0401MB2541.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 33abCjG5qFF/1zN5pO8xcJQeQs6L0i0DDfKTK6eIGJL7lPgLDnNil+RAZ7PKf2wrUtXGR4hqDd9TC8bt3pVAbArJr3aFNqE9tUfADt1vrkP+ld8FWdnsPnwqmcUhQrncCpTYAEVp1sng1SaX+tvxn8ceIetJWbielkQKQ4F4RVG/g3Jl/E3kWft3wXP+U5Gure4Ztj0S3aFACxv/+Qtr9XUnpZwgLJNOpPEtDCgkpl1DoPGNIeM3j+BSulA0/PzqdDtXl0uu299VXvi21AvBbaiGi5tNglU016ihDtnUq+t0TSIcb0GMkQ1LjCsN7I/a spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a826eecd-26e5-4da6-a09b-08d66bc3c3a3 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2018 06:23:06.8641 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Subject: [dpdk-dev] [PATCH 10/20] bus/fslmc: add dynamic config for memback portal mode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add flag in portal init to adjust the qbman memory type, to decide between legacy portal mode or newly introduced memory backed portals. Signed-off-by: Roy Pledge Signed-off-by: Youri Querry Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 2 + .../bus/fslmc/qbman/include/fsl_qbman_base.h | 11 +++- drivers/bus/fslmc/qbman/qbman_portal.c | 52 +++++++++++-------- drivers/bus/fslmc/qbman/qbman_sys.h | 20 ++++--- 4 files changed, 53 insertions(+), 32 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 ba2e28ce1..37723a094 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c @@ -509,6 +509,8 @@ dpaa2_create_dpio_device(int vdev_fd, p_des.cinh_bar = (void *)(dpio_dev->qbman_portal_ci_paddr); p_des.irq = -1; p_des.qman_version = attr.qbman_version; + p_des.eqcr_mode = qman_eqcr_vb_ring; + p_des.cena_access_mode = qman_cena_fastest_access; dpio_dev->sw_portal = qbman_swp_init(&p_des); if (dpio_dev->sw_portal == NULL) { diff --git a/drivers/bus/fslmc/qbman/include/fsl_qbman_base.h b/drivers/bus/fslmc/qbman/include/fsl_qbman_base.h index bb60a98f9..48bdaafa4 100644 --- a/drivers/bus/fslmc/qbman/include/fsl_qbman_base.h +++ b/drivers/bus/fslmc/qbman/include/fsl_qbman_base.h @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * * Copyright (C) 2014 Freescale Semiconductor, Inc. + * Copyright 2017-2018 NXP * */ #ifndef _FSL_QBMAN_BASE_H @@ -33,7 +34,12 @@ struct qbman_block_desc { enum qbman_eqcr_mode { qman_eqcr_vb_ring = 2, /* Valid bit, with eqcr in ring mode */ - qman_eqcr_vb_array, /* Valid bit, with eqcr in array mode */ + qman_eqcr_vb_array, /* Valid bit, with eqcr in array mode */ +}; + +enum qbman_cena_access_mode { + qman_cena_fastest_access = 0, /* Use memory backed node if available */ + qman_cena_direct_access, /* Use direct access to the CENA region */ }; /** @@ -46,6 +52,8 @@ enum qbman_eqcr_mode { * @qman_version: the qman version. * @eqcr_mode: Select the eqcr mode, currently only valid bit ring mode and * valid bit array mode are supported. + * @cena_access_mode: Mode used to access the CENA region, direct + * or memory backed. * * Descriptor for a QBMan software portal, expressed in terms that make sense to * the user context. Ie. on MC, this information is likely to be true-physical, @@ -62,6 +70,7 @@ struct qbman_swp_desc { int idx; uint32_t qman_version; enum qbman_eqcr_mode eqcr_mode; + enum qbman_cena_access_mode cena_access_mode; }; /* Driver object for managing a QBMan portal */ diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c b/drivers/bus/fslmc/qbman/qbman_portal.c index 2f572a08b..08bfdc9f8 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.c +++ b/drivers/bus/fslmc/qbman/qbman_portal.c @@ -194,7 +194,8 @@ struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d) 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) + if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000 + && (d->cena_access_mode == qman_cena_fastest_access)) p->mr.valid_bit = QB_VALID_BIT; atomic_set(&p->vdq.busy, 1); @@ -233,7 +234,8 @@ struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d) qbman_cinh_write(&p->sys, QBMAN_CINH_SWP_SDQCR, 0); p->eqcr.pi_ring_size = 8; - if ((qman_version & 0xFFFF0000) >= QMAN_REV_5000) { + if ((qman_version & QMAN_REV_MASK) >= QMAN_REV_5000 + && (d->cena_access_mode == qman_cena_fastest_access)) { p->eqcr.pi_ring_size = 32; qbman_swp_enqueue_array_mode_ptr = qbman_swp_enqueue_array_mode_mem_back; @@ -253,7 +255,8 @@ struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d) eqcr_pi = qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_EQCR_PI); p->eqcr.pi = eqcr_pi & p->eqcr.pi_mask; p->eqcr.pi_vb = eqcr_pi & QB_VALID_BIT; - if ((p->desc.qman_version & QMAN_REV_MASK) < QMAN_REV_5000) + if ((p->desc.qman_version & QMAN_REV_MASK) >= QMAN_REV_5000 + && (d->cena_access_mode == qman_cena_fastest_access)) p->eqcr.ci = qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_EQCR_CI) & p->eqcr.pi_mask; else @@ -362,10 +365,11 @@ void *qbman_swp_mc_start(struct qbman_swp *p) #ifdef QBMAN_CHECKING QBMAN_BUG_ON(p->mc.check != swp_mc_can_start); #endif - if ((p->desc.qman_version & QMAN_REV_MASK) < QMAN_REV_5000) - ret = qbman_cena_write_start(&p->sys, QBMAN_CENA_SWP_CR); - else + if ((p->desc.qman_version & QMAN_REV_MASK) >= QMAN_REV_5000 + && (p->desc.cena_access_mode == qman_cena_fastest_access)) ret = qbman_cena_write_start(&p->sys, QBMAN_CENA_SWP_CR_MEM); + else + ret = qbman_cena_write_start(&p->sys, QBMAN_CENA_SWP_CR); #ifdef QBMAN_CHECKING if (!ret) p->mc.check = swp_mc_can_submit; @@ -385,16 +389,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); - 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 { + if ((p->desc.qman_version & QMAN_REV_MASK) >= QMAN_REV_5000 + && (p->desc.cena_access_mode == qman_cena_fastest_access)) { *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); + } else { + dma_wmb(); + *v = cmd_verb | p->mc.valid_bit; + qbman_cena_write_complete(&p->sys, QBMAN_CENA_SWP_CR, cmd); + clean(cmd); } #ifdef QBMAN_CHECKING p->mc.check = swp_mc_can_poll; @@ -407,30 +412,31 @@ void *qbman_swp_mc_result(struct qbman_swp *p) #ifdef QBMAN_CHECKING QBMAN_BUG_ON(p->mc.check != swp_mc_can_poll); #endif - 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)); + if ((p->desc.qman_version & QMAN_REV_MASK) >= QMAN_REV_5000 + && (p->desc.cena_access_mode == qman_cena_fastest_access)) { + 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->mc.valid_bit ^= QB_VALID_BIT; + p->mr.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; + 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->mr.valid_bit ^= QB_VALID_BIT; + p->mc.valid_bit ^= QB_VALID_BIT; } #ifdef QBMAN_CHECKING p->mc.check = swp_mc_can_start; diff --git a/drivers/bus/fslmc/qbman/qbman_sys.h b/drivers/bus/fslmc/qbman/qbman_sys.h index e3bd1c5e6..71f7a6782 100644 --- a/drivers/bus/fslmc/qbman/qbman_sys.h +++ b/drivers/bus/fslmc/qbman/qbman_sys.h @@ -389,7 +389,8 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s, int i; int cena_region_size = 4*1024; - if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000) + if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000 + && (d->cena_access_mode == qman_cena_fastest_access)) cena_region_size = 64*1024; #ifdef RTE_ARCH_64 uint8_t wn = CENA_WRITE_ENABLE; @@ -416,7 +417,8 @@ 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) + if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000 + && (d->cena_access_mode == qman_cena_fastest_access)) memset(s->addr_cena, 0, cena_region_size); else { /* Invalidate the portal memory. @@ -426,11 +428,12 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s, dccivac(s->addr_cena + i); } - if (s->eqcr_mode == qman_eqcr_vb_array) + 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 { - if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000) + } else { + if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000 && + (d->cena_access_mode == qman_cena_fastest_access)) reg = qbman_set_swp_cfg(dqrr_size, wn, 1, 3, 2, 0, 1, 1, 1, 1, 1, 1); else @@ -438,11 +441,11 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s, 1, 3, 2, 2, 1, 1, 1, 1, 1, 1); } - if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000) { + if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000 + && (d->cena_access_mode == qman_cena_fastest_access)) 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); @@ -452,7 +455,8 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s, return -1; } - if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000) { + if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000 + && (d->cena_access_mode == qman_cena_fastest_access)) { qbman_cinh_write(s, QBMAN_CINH_SWP_EQCR_PI, QMAN_RT_MODE); qbman_cinh_write(s, QBMAN_CINH_SWP_RCR_PI, QMAN_RT_MODE); } From patchwork Thu Dec 27 06:23:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 154556 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6605328ljp; Wed, 26 Dec 2018 22:24:55 -0800 (PST) X-Google-Smtp-Source: ALg8bN4WkIzEXn1ISLYt2cIGHcVlukaHA63djrTPendXnnffYL1/HxZ4SROh7Fjc3ZfyZEMU2wRd X-Received: by 2002:adf:a393:: with SMTP id l19mr21307137wrb.110.1545891895677; Wed, 26 Dec 2018 22:24:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545891895; cv=none; d=google.com; s=arc-20160816; b=0FJ/Mf0M+Chg100gJHddwPW1nZvEqOzcV42/Q8VdnNlc+F0yblrbm+8vd003R0YxiP W/FjkhCOHTnVoEh5x8b8wg9rqs9+4g0BLiuDn+Pp9A3qOJ9i4DGiCxYa3vcASfd7bY7x bbQh41z+xsC3neNn7Sd2UELzqqDwv6Y71YdJ+uHVILmdBvlm6NRrjTpIhPq3zkKPQLB3 s1l+VmUBFNCAywWgmdqazRjAG0sd7GQKCRxrovvOAqexQtQIJKE7iTIm4Xgy32/us1nJ sRUCxXElhsc7g4aEUN7ueojeuhFnlp6O4DiYhz7aIoCSCX6j0u21jrjbW6rWZFeemX0O +1xg== 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:mime-version :content-transfer-encoding:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:cc:to:from :dkim-signature; bh=9CuOq796UjiJQbUIFpBH2AAxFTj/0nyzLS+l5XC//DA=; b=GzOCr/sPY3rMe1fUmryAHWBMbnHvQTiBQn3dIDqdzfvLSqxgoOtjxJuG/5SwqjtPdD 7C6gOKyYX0OKPpx5jvpZzlMn3zUD2f33PhEX1vAYreHqst8A2v8GEAFE9IQk6Xgc9ri3 m53Mu91fw/zrJftAbq7bUoGbX6B2qhBFjSfTQP2fYZQ+ypwoPj0E++eNiSZjkfIuPTR/ rVQ4eFgbkEkO6uIIQA5WYEiDYHoRXadfLnVDmQwVAJmLl3skl5tRxWUe0RhhBlyzMXpV gAgkGClHpywdA0soCibQBNQvebP2xSRS9ZoYCmew0s41mkbOmVQBS6m1V3ikJNEgOCi+ 3rVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=k26UTk2B; 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 y129si17325921wmy.153.2018.12.26.22.24.55; Wed, 26 Dec 2018 22:24:55 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=k26UTk2B; 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 33D8E5B3A; Thu, 27 Dec 2018 07:23:20 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140084.outbound.protection.outlook.com [40.107.14.84]) by dpdk.org (Postfix) with ESMTP id 63B6B5689 for ; Thu, 27 Dec 2018 07:23:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9CuOq796UjiJQbUIFpBH2AAxFTj/0nyzLS+l5XC//DA=; b=k26UTk2BIXpMavAtKhmUBrmMw0iv/FUO6/ASxOHELEn94r7ZijVKg/GSbQvvSLiPnwt/hxHQ9mPKT9xZdLQXYOpiWRTPv4OoXYvJmCfoef1tGWS4yBqz7Y8fL27ke7L8dWhBspqNL4SBIkLxZoHzItpxTTQGmeQ1o/I/Oy+OC18= Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com (10.168.65.19) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.134.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Thu, 27 Dec 2018 06:23:08 +0000 Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4]) by VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4%2]) with mapi id 15.20.1471.019; Thu, 27 Dec 2018 06:23:08 +0000 From: Hemant Agrawal To: "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , Shreyansh Jain , Youri Querry Thread-Topic: [PATCH 11/20] bus/fslmc: rename portal pi index to consumer index Thread-Index: AQHUnayiIT6BsRrKw0qXGAwMptZ4Mg== Date: Thu, 27 Dec 2018 06:23:08 +0000 Message-ID: <20181227062233.30781-12-hemant.agrawal@nxp.com> References: <20181227062233.30781-1-hemant.agrawal@nxp.com> In-Reply-To: <20181227062233.30781-1-hemant.agrawal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.143.30.134] x-mailer: git-send-email 2.17.1 x-clientproxiedby: BM1PR01CA0120.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:40::14) To VI1PR0401MB2541.eurprd04.prod.outlook.com (2603:10a6:800:56::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0401MB2382; 6:uyX0FLKuMJ5Jqy9GcO8mlQ6TfBEt3bIql67YAzR+kZYRHX/hJtMkt+ZDFqAPFLCENUtFVjI2lXmYHt6h4yrsHUiTei4SDHPjigudsYpFG3mkZVKQFxEA92C21Xb+Mn5wUPAG73lx6dfUjcHb8z6l7OZ32hfm5VRYCT3qjfmLKdvrrplxrLOGBsrXKDozb3wOuCq0mUJBRr4tYJup/fdHJXlJeUrLjnyC3IxH3I2x+adBmkBkrBuFJhvNiYDXVokNi5Fw+f8JDP3vEohskyO7bwx34PqO/QiI1qsRkuG+wkA/9LEQqVvO2y7jBOsk7BpRaYtNKYdjN1ycWWkRKU6D6Q5+VKYkHcKEqxdZbRRfe/ydzpwteBFzuc7dDHFIN5UJuUZi/o/Qa/3+dsJvH9JYPqgSWJlzB4/UtCA76TQCngvQSda8LUPiZVo+lcT/PEwqIGmSr3Iz04Z/sjCDxE2Qsg==; 5:T+8PFyEMiyCMzZ6TDwjXzEYfybV9xnmFW4gE1XYOynvJ38pNH1EEOqPwIm11c30HgK5NLadWYEh5yoSgbEonBjDGebnfn4ElN95/eQPARX9jhe9flP3cmRHYTDW3Ki3SAqe7BlNZZdKDJd6liWtYtK7d1ybwKrf92L4y5i6JBPU=; 7:tLLFiHbnYKHoUcS90jpT6sLUGWOrKbK/a1g/M41371hwIZp4pMbuGr+37a43s/MiLOIMzOMsmN65LBWYgeEJyucDyx80Ujs/hZetJnSqbndwfP9CrAZpP/WAOAoYNXPbov3stjL6045z+x2R89nccA== x-ms-office365-filtering-correlation-id: 0ce76b5a-3d08-40d1-a796-08d66bc3c48f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2382; x-ms-traffictypediagnostic: VI1PR0401MB2382: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:VI1PR0401MB2382; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0401MB2382; x-forefront-prvs: 0899B47777 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(396003)(366004)(376002)(39860400002)(346002)(199004)(189003)(5660300001)(1076003)(575784001)(26005)(76176011)(186003)(71200400001)(256004)(25786009)(105586002)(4326008)(6436002)(305945005)(11346002)(106356001)(14444005)(446003)(44832011)(476003)(7736002)(55236004)(102836004)(78486014)(486006)(386003)(68736007)(52116002)(86362001)(6506007)(2616005)(71190400001)(66066001)(316002)(54906003)(6116002)(3846002)(2906002)(14454004)(36756003)(99286004)(50226002)(8936002)(1730700003)(81156014)(81166006)(8676002)(6512007)(53936002)(478600001)(97736004)(6486002)(6916009)(5640700003)(2351001)(2501003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2382; H:VI1PR0401MB2541.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: uLtThg0PzY/mZsSLa4VVOC1Fx4WUDNJykK4vOtA4sURPo2ZwNa1zJoQqze5VLv2+Uxt4JahxXxAa4oSHMMnxYS660O16PzP6UHiFt1h30imFM/ZHJ22jnLLW1BmK+aCuNnwWhHPkcjZVI46ymjlkPNIO1XgI+s6MOqEXbgdNMvW5AKedf9yNOqobfAVL9d+MLbNmX1ObM/faqc7FtQMGk03pN1O612fBxOeLPo0G313rAQOv10JaRnfD3edirSD0ZBOYUMChlSVlxB+Zxe+QsTbrK63Od/JzO/SfY9MHieHdJRu8mj/YUTPyYRSrPXv3 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0ce76b5a-3d08-40d1-a796-08d66bc3c48f X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2018 06:23:08.3328 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Subject: [dpdk-dev] [PATCH 11/20] bus/fslmc: rename portal pi index to consumer index X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This is to align with the latest qbman hw library Signed-off-by: Youri Querry Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/qbman/qbman_portal.c | 51 +++++++++++--------------- drivers/bus/fslmc/qbman/qbman_portal.h | 2 +- 2 files changed, 23 insertions(+), 30 deletions(-) -- 2.17.1 diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c b/drivers/bus/fslmc/qbman/qbman_portal.c index 08bfdc9f8..14f4b0344 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.c +++ b/drivers/bus/fslmc/qbman/qbman_portal.c @@ -251,21 +251,21 @@ struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d) } for (mask_size = p->eqcr.pi_ring_size; mask_size > 0; mask_size >>= 1) - p->eqcr.pi_mask = (p->eqcr.pi_mask<<1) + 1; + p->eqcr.pi_ci_mask = (p->eqcr.pi_ci_mask<<1) + 1; eqcr_pi = qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_EQCR_PI); - p->eqcr.pi = eqcr_pi & p->eqcr.pi_mask; + p->eqcr.pi = eqcr_pi & p->eqcr.pi_ci_mask; p->eqcr.pi_vb = eqcr_pi & QB_VALID_BIT; if ((p->desc.qman_version & QMAN_REV_MASK) >= QMAN_REV_5000 && (d->cena_access_mode == qman_cena_fastest_access)) - p->eqcr.ci = qbman_cinh_read(&p->sys, - QBMAN_CINH_SWP_EQCR_CI) & p->eqcr.pi_mask; + p->eqcr.ci = qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_EQCR_PI) + & p->eqcr.pi_ci_mask; else - p->eqcr.ci = qbman_cinh_read(&p->sys, - QBMAN_CINH_SWP_EQCR_PI) & p->eqcr.pi_mask; + p->eqcr.ci = qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_EQCR_CI) + & p->eqcr.pi_ci_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)); + p->eqcr.ci & (p->eqcr.pi_ci_mask<<1), + p->eqcr.pi & (p->eqcr.pi_ci_mask<<1)); portal_idx_map[p->desc.idx] = p; return p; @@ -646,8 +646,8 @@ static int qbman_swp_enqueue_ring_mode_direct(struct qbman_swp *s, 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; + half_mask = (s->eqcr.pi_ci_mask>>1); + full_mask = s->eqcr.pi_ci_mask; if (!s->eqcr.available) { eqcr_ci = s->eqcr.ci; s->eqcr.ci = qbman_cena_read_reg(&s->sys, @@ -685,8 +685,8 @@ static int qbman_swp_enqueue_ring_mode_mem_back(struct qbman_swp *s, 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; + half_mask = (s->eqcr.pi_ci_mask>>1); + full_mask = s->eqcr.pi_ci_mask; if (!s->eqcr.available) { eqcr_ci = s->eqcr.ci; s->eqcr.ci = qbman_cena_read_reg(&s->sys, @@ -743,8 +743,8 @@ static int qbman_swp_enqueue_multiple_direct(struct qbman_swp *s, int i, num_enqueued = 0; uint64_t addr_cena; - half_mask = (s->eqcr.pi_mask>>1); - full_mask = s->eqcr.pi_mask; + half_mask = (s->eqcr.pi_ci_mask>>1); + full_mask = s->eqcr.pi_ci_mask; if (!s->eqcr.available) { eqcr_ci = s->eqcr.ci; s->eqcr.ci = qbman_cena_read_reg(&s->sys, @@ -811,8 +811,8 @@ static int qbman_swp_enqueue_multiple_mem_back(struct qbman_swp *s, 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; + half_mask = (s->eqcr.pi_ci_mask>>1); + full_mask = s->eqcr.pi_ci_mask; if (!s->eqcr.available) { eqcr_ci = s->eqcr.ci; s->eqcr.ci = qbman_cena_read_reg(&s->sys, @@ -833,15 +833,6 @@ static int qbman_swp_enqueue_multiple_mem_back(struct qbman_swp *s, 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; @@ -849,6 +840,8 @@ static int qbman_swp_enqueue_multiple_mem_back(struct qbman_swp *s, ((flags[i]) & QBMAN_EQCR_DCA_IDXMASK); } eqcr_pi++; + p[0] = cl[0] | s->eqcr.pi_vb; + if (!(eqcr_pi & half_mask)) s->eqcr.pi_vb ^= QB_VALID_BIT; } @@ -880,8 +873,8 @@ static int qbman_swp_enqueue_multiple_desc_direct(struct qbman_swp *s, int i, num_enqueued = 0; uint64_t addr_cena; - half_mask = (s->eqcr.pi_mask>>1); - full_mask = s->eqcr.pi_mask; + half_mask = (s->eqcr.pi_ci_mask>>1); + full_mask = s->eqcr.pi_ci_mask; if (!s->eqcr.available) { eqcr_ci = s->eqcr.ci; s->eqcr.ci = qbman_cena_read_reg(&s->sys, @@ -943,8 +936,8 @@ static int qbman_swp_enqueue_multiple_desc_mem_back(struct qbman_swp *s, 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; + half_mask = (s->eqcr.pi_ci_mask>>1); + full_mask = s->eqcr.pi_ci_mask; if (!s->eqcr.available) { eqcr_ci = s->eqcr.ci; s->eqcr.ci = qbman_cena_read_reg(&s->sys, diff --git a/drivers/bus/fslmc/qbman/qbman_portal.h b/drivers/bus/fslmc/qbman/qbman_portal.h index 3b0fc540b..e54f2661c 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.h +++ b/drivers/bus/fslmc/qbman/qbman_portal.h @@ -98,7 +98,7 @@ struct qbman_swp { uint32_t pi; uint32_t pi_vb; uint32_t pi_ring_size; - uint32_t pi_mask; + uint32_t pi_ci_mask; uint32_t ci; int available; } eqcr; From patchwork Thu Dec 27 06:23:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 154557 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6605473ljp; Wed, 26 Dec 2018 22:25:08 -0800 (PST) X-Google-Smtp-Source: ALg8bN4XhQo9E4zXz6pj6d+sxFFPZ3wUa8gNwRYeZIT5c2ee6Px1f3Wo4Xy8KAiM+7JuxNFU/JLF X-Received: by 2002:a1c:8095:: with SMTP id b143mr19678661wmd.63.1545891908196; Wed, 26 Dec 2018 22:25:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545891908; cv=none; d=google.com; s=arc-20160816; b=gHCE8cquSeyKEOJv74OneNcn4pDJrxT5So4XTAPRCZuvpiQ15G2/tp1SPw3AH8Tz6P fKgh7987VkygJeU7s6le4gR22rG1rhPtNdJb5xc28ofaQXgsgNcQRc4WOgCc9ogS65Wu uxbPxH23Lj7QU4/fbwAWebbHEOg97uIqQ9x5aPz54hw7LSrxQiZoDUoV5KYp9Y55Ik/u LtyvD0/L2A5Tb14QEp2K5wSDLkRpcdt7dTartisxPS9ZfZBjr9bEvLUBfwDQwy6HmLnD lx89Cx6pRpJmsVHySKawJx+FowJv8aDmdJeYRoMPjG7K+OWpr/8T87ASLCDWafk5tpcr ZcuQ== 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:mime-version :content-transfer-encoding:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:cc:to:from :dkim-signature; bh=qIpIdTbBy9kpF7gRxPLaL3KP79vSjeOnA+1mEQ3eNUE=; b=KhmSBJUW2VL6TmSaKr9AMFSEDzFq4cBCWVEB1QWC5xVR9y0WvYECb00GbreV5a2oO1 P/IBFZHMG6+qa8Yj2os8mPHw/VDKgr/KnH++J9ZaHfaHIhL8ECca8CC/wDMUfaEl8Owm 0tr7fLUQsNfyxoZTs5xGmAIe6kj1n8IkKg80Lz4Q+Ar/UWZmWKq5/5qaGpkDpg/HmblB M9l4AFOd5Pz/7JHQXgioY7ffvAR4S9g74XUgrmQvdrJQxnLGWnAVZXA5GbtnOCvrw9B/ XokY8diIhjUV0d8WXhdAKD3PsIz8zPSC10hN5rCypAXQ923vSELVAoaRBaJBkVtYPv/T 20iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=ZMcLLs4k; 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 d5si18368983wro.232.2018.12.26.22.25.08; Wed, 26 Dec 2018 22:25:08 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=ZMcLLs4k; 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 0DF5F5F14; Thu, 27 Dec 2018 07:23:22 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140044.outbound.protection.outlook.com [40.107.14.44]) by dpdk.org (Postfix) with ESMTP id C55D358CB for ; Thu, 27 Dec 2018 07:23:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qIpIdTbBy9kpF7gRxPLaL3KP79vSjeOnA+1mEQ3eNUE=; b=ZMcLLs4kYEUqo5SJjqs3Nan5dLP900aoOm3cAcwSVnvXukPzUqJJM7e12mvhDoAuivVX98fKofKcL8g8i41GB0SxXqrZ8zZ0yn7Of9cT3jAjGg9sXpojyFmF/HAgt3I8s4M+mWMJ6WskTt6Vox/oaYcal8r0x+N5fx9bkXRnZU8= Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com (10.168.65.19) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.134.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Thu, 27 Dec 2018 06:23:09 +0000 Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4]) by VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4%2]) with mapi id 15.20.1471.019; Thu, 27 Dec 2018 06:23:09 +0000 From: Hemant Agrawal To: "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , Shreyansh Jain Thread-Topic: [PATCH 12/20] bus/fslmc: make portal func static Thread-Index: AQHUnayjTzhV+pa3ikeTd8quRQxjww== Date: Thu, 27 Dec 2018 06:23:09 +0000 Message-ID: <20181227062233.30781-13-hemant.agrawal@nxp.com> References: <20181227062233.30781-1-hemant.agrawal@nxp.com> In-Reply-To: <20181227062233.30781-1-hemant.agrawal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.143.30.134] x-mailer: git-send-email 2.17.1 x-clientproxiedby: BM1PR01CA0120.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:40::14) To VI1PR0401MB2541.eurprd04.prod.outlook.com (2603:10a6:800:56::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0401MB2382; 6:VgofEWTBl+Le4Pb3nhiMZWQ33WjHtkD8tJt4cXldCKcHxgC4DzWtwuVzU58q03yAI+nUctiKyUaDuDsVwmiRSQYoTXngS8CgJ44cx0EZETCgW13eFXwdG+GtGWLqFpQa1G72IuZ9AgDjyVENHAWu5+DGeMzyOeaqkHhUdQxjJ9wapQTONsm/3ERxxuZncaV5aPpY/qtT4fnOPapEmC4BdkNOYiKeARC8q3lKbL8MQvNbQVuNCq9CfTdtt1tClnTmr+Ve8Q2StBzm7mq3rdh7QIXNuEN1U0pvEAessloxyvp30RcFi4dkSm/6GMZ8di9yeuzjcOUtNi0HgpJIQ6dBHj4zrcNny/9HgacRwCJmKHtHWk+DaeBz56ywqGUwWLJJhUPJPgGoiAnnjYnTr9CdvhZjbkPHg2EO3VRYAWt9ZUoHdRALqUvfnQ4u3b8uovAMSWHANejMSsu3QzeFz4Cqzg==; 5:eCTqDiAf5qDWAI4e1W9L2a/3Fdly2TPEscx3PPhJLZrIwPeG+MgfzacsdhmFWqEHtWBEOlJ0sT3awS3o/9P3wn12vEbgem3uwP0TvVOCzC1kvI2SNA5V9tbtCvLhmhJRAV1tY4Sja5t6CEUyGYKuk0g0MFp6UFO8d6wPxTvzkmw=; 7:QCvNDWphNrhYx+YL1g24PCVN90JSJHw7Reh9KO9cahyumPu0vBPZildRO9WZDNGG8zoNHBZCp/8LbKz8Y/RN4771pVazewxTAAfczzdZdyJQo9MIBKHHlMMSiZC9JY1/Z4zyYQV9TBTPn/j9tiVsvQ== x-ms-office365-filtering-correlation-id: fa46ac09-a7cc-4667-eb9a-08d66bc3c557 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2382; x-ms-traffictypediagnostic: VI1PR0401MB2382: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:VI1PR0401MB2382; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0401MB2382; x-forefront-prvs: 0899B47777 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(396003)(366004)(376002)(39860400002)(346002)(199004)(189003)(5660300001)(1076003)(26005)(76176011)(186003)(71200400001)(256004)(25786009)(105586002)(4326008)(6436002)(305945005)(11346002)(106356001)(446003)(44832011)(476003)(7736002)(55236004)(102836004)(78486014)(486006)(386003)(68736007)(52116002)(86362001)(6506007)(2616005)(71190400001)(66066001)(316002)(54906003)(6116002)(3846002)(2906002)(14454004)(36756003)(99286004)(50226002)(8936002)(1730700003)(81156014)(81166006)(8676002)(6512007)(53936002)(478600001)(97736004)(6486002)(6916009)(5640700003)(2351001)(2501003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2382; H:VI1PR0401MB2541.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: ePwxCbFr8wSAbPg1IZGARsOSktxtrpBM0he4QbkvP3akssj86D5EmfR9fWGxf78YfSE+U9TI37c1Y9uEEfIkXn6pefJK+j7SCj9egFfrA2AR1hoJx4svtFvI5J+vuPw6yjt5vXBnblAlqARGCuY1nUObf6RKddrHwoKHwf2YJKnkW/DU3MiPvPmfllxOutz2elPKKENMY+3c91J66NmwDBcwteEA1zLyY6zBfdaDRM4O+6a7r/aBd7T+dVEb8Mgpm9gp8IACXv9Z5h3JPRSBTyegzxaBDEyD97bWcuQdMD8GRkxCK2mzXzmxnLW57QX4 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fa46ac09-a7cc-4667-eb9a-08d66bc3c557 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2018 06:23:09.8015 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Subject: [dpdk-dev] [PATCH 12/20] bus/fslmc: make portal func static 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" It was not required to be a function. Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 2 +- drivers/bus/fslmc/portal/dpaa2_hw_dpio.h | 2 -- 2 files changed, 1 insertion(+), 3 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 37723a094..cd28441f3 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c @@ -229,7 +229,7 @@ dpaa2_configure_stashing(struct dpaa2_dpio_dev *dpio_dev, int lcoreid) return 0; } -struct dpaa2_dpio_dev *dpaa2_get_qbman_swp(int lcoreid) +static struct dpaa2_dpio_dev *dpaa2_get_qbman_swp(int lcoreid) { struct dpaa2_dpio_dev *dpio_dev = NULL; int ret; diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h index 462501a2e..4354c76de 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h @@ -37,8 +37,6 @@ extern uint8_t dpaa2_eqcr_size; extern struct dpaa2_io_portal_t dpaa2_io_portal[RTE_MAX_LCORE]; -struct dpaa2_dpio_dev *dpaa2_get_qbman_swp(int cpu_id); - /* Affine a DPIO portal to current processing thread */ int dpaa2_affine_qbman_swp(void); From patchwork Thu Dec 27 06:23:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 154558 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6605574ljp; Wed, 26 Dec 2018 22:25:18 -0800 (PST) X-Google-Smtp-Source: ALg8bN55pQs569UE6laMN3uNeUrU4YrynCyQzOYxwTVBrluqW6BQqKXWa+9pVJtMQY3TjR2tF11Z X-Received: by 2002:a1c:6e06:: with SMTP id j6mr20725233wmc.3.1545891918124; Wed, 26 Dec 2018 22:25:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545891918; cv=none; d=google.com; s=arc-20160816; b=0Uy9EVVYUtrdZrs55TCwHpIbhSjB1BbsV89xZtHtxgsWWQ/y9XL9YcxQjNRRasSA02 sljWCnYP/q4mn6vDuFpAweWYc8knTAuTGEJnxZmLgShZUhGjV56CBs3Ud2dJxPYsuz3N SYhZQIzPU9ELfaZpZHRQiMBibacumLwbJacqKtPaxdyJeyxmZsXj9boccFWXVrlLPHqV qRgZYVEHe/+/fANizp59lGKEcMWQ1/YDfWwchVP8yk8CgmNpCOqUkX2RqRQHmS4zOd24 E6GbhTw4ejj6CS/JxjOI5wkkQoa04YDp7zhDP5HZQcpYdNT89LTuI0YqKZbAHfFDtV92 nsSQ== 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:mime-version :content-transfer-encoding:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:cc:to:from :dkim-signature; bh=QfJpZRkQUD72uvz/MmhMXqJpPPfwYlzyRqdDuWD8/vE=; b=Ntq+PR2riKZfc0TlKgxWyZzXnb7mbZumlDirLkPyMWGI1IL4CPXg5QCCA0o8HUNRhd LM4bERUYmty68vHeQGrTePb1XuvLkN+oEQxKucDFWayhjCl3Nrs+HYI7RHJqJXDltqUF YG1fEzYfG4BOMBxFtY1V5y7ErrqNrEgVHDjtkBlNfTyrgci8maZesqlA1RAIMZcCxVBi Y6CDk6xrh8BFw4fbxxSoMi7x8DHQv4UPAAqAn/WBnXI5QwhcIGvvgkd6uF34Z7gEWGii LsVUnXFCvgFOKojb/u2lhgdSaR46YXSITZbb/yAtvl3Yibn646W+3cLyd+RvaK2SNQ/Y CaCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=iAnMeOsa; 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 o204si16959983wme.148.2018.12.26.22.25.17; Wed, 26 Dec 2018 22:25:18 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=iAnMeOsa; 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 07BA15B16; Thu, 27 Dec 2018 07:23:24 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140055.outbound.protection.outlook.com [40.107.14.55]) by dpdk.org (Postfix) with ESMTP id 495E9568A for ; Thu, 27 Dec 2018 07:23:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QfJpZRkQUD72uvz/MmhMXqJpPPfwYlzyRqdDuWD8/vE=; b=iAnMeOsaECHHw8Y4dK6rA+00bLAsQ+ZDux6kPhjWK2UMkODEioTKSib9jrGb37pHQlOB+BNcRXphTpcPB2O6O/pfOLCKOrfm7m3EqCon6hnzAK65bdWlcNgNR4c8JtoxN+DrkoorAjHdlo68roQutDaB7h3VP8McSfbCpiUgWqY= Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com (10.168.65.19) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.134.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Thu, 27 Dec 2018 06:23:11 +0000 Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4]) by VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4%2]) with mapi id 15.20.1471.019; Thu, 27 Dec 2018 06:23:11 +0000 From: Hemant Agrawal To: "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , Shreyansh Jain , Nipun Gupta Thread-Topic: [PATCH 13/20] net/dpaa2: add dpdmux mc flib Thread-Index: AQHUnaykzVN3OaSFokCx76WbgBO0DQ== Date: Thu, 27 Dec 2018 06:23:11 +0000 Message-ID: <20181227062233.30781-14-hemant.agrawal@nxp.com> References: <20181227062233.30781-1-hemant.agrawal@nxp.com> In-Reply-To: <20181227062233.30781-1-hemant.agrawal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.143.30.134] x-mailer: git-send-email 2.17.1 x-clientproxiedby: BM1PR01CA0120.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:40::14) To VI1PR0401MB2541.eurprd04.prod.outlook.com (2603:10a6:800:56::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0401MB2382; 6:4drmB3szAeMitfqm4PiLjq4wXn4wdc9ImC5IxNMdgNZ8C6cXGWV//HFylE572GprXhNom2nEicY8YrsUiGssR2Igm/QB3rVdn/t80k13KPye51dkdHVVsWPiFlWX6XsfHYjoZ2khpA8M6WSbILpHbKC39LjepcsoL/3t7oMICFCJ09rAbcTt5RuqOA7pwZOgOInB1BQWxE5E+jlXWOSSHHMI4KbMUMrweHqJNLYkFKjNoip/Zgbs12+S7Sdo03StDTPOll7PgP//95M9s7EptoB3tuEH9y71RMq//LJ47iTdIUEgzsnok4KnNJ943lmtU2UzaXrMkJRAgBhFuVBhWxGrJTh6n6/9XKRdmo1r63jo6fr70p1BvcVPMAYG/PeHZPN25YefcAkZZbkV5ChMfnUFDC2gFh0q5xw87E9WAF51HlFk8nqdLMBDkba1ngddkBsCyiAsvMdY7+FWm8FmMQ==; 5:X6POCoEUDtziS41M+fVupaOG+flcp04k6/1hc9ZLFvkyW5rrOT6qGLYp1InDJfpJAuK4xH35jge8UQb8lgBkKdCzu+DFD5vWW2Qu/wWse0GrGxr4liBAlG1qgfcYes4D8R06nhjmrHjsNQxTJmPKWlbzWxxjF+fbVhPJpDoVyRA=; 7:GTiCCCPtgv48vWgWk8q1T2ZZ4wZyBorrcuESEfO/JIc8VclDYG70sKDffCM/t6ZgenLgWgnyuKnfO+dh3FsWvA40OIL1K1J4bkLSxJO1Il8Jax6ZKqhmXkBRiOzisedfU0nn/OzyMAdoNZByRRa5iA== x-ms-office365-filtering-correlation-id: 1bd3d02a-82f0-4992-de40-08d66bc3c64f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2382; x-ms-traffictypediagnostic: VI1PR0401MB2382: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:VI1PR0401MB2382; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0401MB2382; x-forefront-prvs: 0899B47777 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(396003)(366004)(376002)(39860400002)(346002)(199004)(189003)(5660300001)(1076003)(575784001)(26005)(76176011)(186003)(71200400001)(256004)(25786009)(105586002)(4326008)(6436002)(305945005)(11346002)(4744004)(106356001)(14444005)(446003)(44832011)(476003)(7736002)(55236004)(102836004)(78486014)(486006)(386003)(68736007)(52116002)(86362001)(6506007)(2616005)(71190400001)(66066001)(316002)(54906003)(6116002)(3846002)(2906002)(14454004)(36756003)(99286004)(50226002)(8936002)(1730700003)(81156014)(81166006)(8676002)(6512007)(53936002)(478600001)(97736004)(6486002)(6916009)(53946003)(5640700003)(2351001)(2501003)(559001)(569006); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2382; H:VI1PR0401MB2541.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: xEovrVmBGP5EiYyehQDG6cAfk1WomwsTxKJZd1udYEV/7zj7Oc56VlVOy2wu/3eSkBhZU0g67tcaSvWZoElbxrqS/qiPXszB4i00BsCYVakncqxfDqfutUOeB3+4XlCqfRYbL1Zq7MtnEBQOXXvd0GdU9wqW+MZLXbZkYEOhNvHjxK6g9M8R82jJshgdoCfdTezpUXEgtDTIUq9FfUDI2QysdGeEaoG3QDYMRVTNyr1/fLJlQYW73DH69VCfizo8erJVmNbeCaz94qt2DpcS9MA8tLbVvTruEk9IFvUTo2NVwODEHOHgOgqJsJFFWVad spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1bd3d02a-82f0-4992-de40-08d66bc3c64f X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2018 06:23:11.3640 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Subject: [dpdk-dev] [PATCH 13/20] net/dpaa2: add dpdmux mc flib 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 dpdmux object is added as a part of net driver as it is used to de-multiplex packets to separate interfaces on basis of specific rules. These rules can be configured from the software Signed-off-by: Nipun Gupta --- drivers/net/dpaa2/Makefile | 1 + drivers/net/dpaa2/mc/dpdmux.c | 929 ++++++++++++++++++++++++++ drivers/net/dpaa2/mc/fsl_dpdmux.h | 410 ++++++++++++ drivers/net/dpaa2/mc/fsl_dpdmux_cmd.h | 221 ++++++ drivers/net/dpaa2/meson.build | 1 + 5 files changed, 1562 insertions(+) create mode 100644 drivers/net/dpaa2/mc/dpdmux.c create mode 100644 drivers/net/dpaa2/mc/fsl_dpdmux.h create mode 100644 drivers/net/dpaa2/mc/fsl_dpdmux_cmd.h -- 2.17.1 diff --git a/drivers/net/dpaa2/Makefile b/drivers/net/dpaa2/Makefile index 2b9c011d6..c58a39725 100644 --- a/drivers/net/dpaa2/Makefile +++ b/drivers/net/dpaa2/Makefile @@ -35,6 +35,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += dpaa2_rxtx.c SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += dpaa2_ethdev.c SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += mc/dpni.c SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += mc/dpkg.c +SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += mc/dpdmux.c LDLIBS += -lrte_bus_fslmc LDLIBS += -lrte_mempool_dpaa2 diff --git a/drivers/net/dpaa2/mc/dpdmux.c b/drivers/net/dpaa2/mc/dpdmux.c new file mode 100644 index 000000000..7962213b7 --- /dev/null +++ b/drivers/net/dpaa2/mc/dpdmux.c @@ -0,0 +1,929 @@ +/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) + * + * Copyright 2013-2016 Freescale Semiconductor Inc. + * Copyright 2018 NXP + * + */ +#include +#include +#include +#include + +/** @addtogroup dpdmux + * @{ + */ + +/** + * dpdmux_open() - Open a control session for the specified object + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @dpdmux_id: DPDMUX unique ID + * @token: Returned token; use in subsequent API calls + * + * This function can be used to open a control session for an + * already created object; an object may have been declared in + * the DPL or by calling the dpdmux_create() function. + * This function returns a unique authentication token, + * associated with the specific object ID and the specific MC + * portal; this token must be used in all subsequent commands for + * this specific object. + * + * Return: '0' on Success; Error code otherwise. + */ +int dpdmux_open(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + int dpdmux_id, + uint16_t *token) +{ + struct mc_command cmd = { 0 }; + struct dpdmux_cmd_open *cmd_params; + int err; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_OPEN, + cmd_flags, + 0); + cmd_params = (struct dpdmux_cmd_open *)cmd.params; + cmd_params->dpdmux_id = cpu_to_le32(dpdmux_id); + + /* send command to mc*/ + err = mc_send_command(mc_io, &cmd); + if (err) + return err; + + /* retrieve response parameters */ + *token = mc_cmd_hdr_read_token(&cmd); + + return 0; +} + +/** + * dpdmux_close() - Close the control session of the object + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPDMUX object + * + * After this function is called, no further operations are + * allowed on the object without opening a new control session. + * + * Return: '0' on Success; Error code otherwise. + */ +int dpdmux_close(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token) +{ + struct mc_command cmd = { 0 }; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_CLOSE, + cmd_flags, + token); + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +/** + * dpdmux_create() - Create the DPDMUX object + * @mc_io: Pointer to MC portal's I/O object + * @dprc_token: Parent container token; '0' for default container + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @cfg: Configuration structure + * @obj_id: returned object id + * + * Create the DPDMUX object, allocate required resources and + * perform required initialization. + * + * The object can be created either by declaring it in the + * DPL file, or by calling this function. + * + * The function accepts an authentication token of a parent + * container that this object should be assigned to. The token + * can be '0' so the object will be assigned to the default container. + * The newly created object can be opened with the returned + * object id and using the container's associated tokens and MC portals. + * + * Return: '0' on Success; Error code otherwise. + */ +int dpdmux_create(struct fsl_mc_io *mc_io, + uint16_t dprc_token, + uint32_t cmd_flags, + const struct dpdmux_cfg *cfg, + uint32_t *obj_id) +{ + struct mc_command cmd = { 0 }; + struct dpdmux_cmd_create *cmd_params; + int err; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_CREATE, + cmd_flags, + dprc_token); + cmd_params = (struct dpdmux_cmd_create *)cmd.params; + cmd_params->method = cfg->method; + cmd_params->manip = cfg->manip; + cmd_params->num_ifs = cpu_to_le16(cfg->num_ifs); + cmd_params->adv_max_dmat_entries = + cpu_to_le16(cfg->adv.max_dmat_entries); + cmd_params->adv_max_mc_groups = cpu_to_le16(cfg->adv.max_mc_groups); + cmd_params->adv_max_vlan_ids = cpu_to_le16(cfg->adv.max_vlan_ids); + cmd_params->options = cpu_to_le64(cfg->adv.options); + + /* send command to mc*/ + err = mc_send_command(mc_io, &cmd); + if (err) + return err; + + /* retrieve response parameters */ + *obj_id = mc_cmd_read_object_id(&cmd); + + return 0; +} + +/** + * dpdmux_destroy() - Destroy the DPDMUX object and release all its resources. + * @mc_io: Pointer to MC portal's I/O object + * @dprc_token: Parent container token; '0' for default container + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @object_id: The object id; it must be a valid id within the container that + * created this object; + * + * The function accepts the authentication token of the parent container that + * created the object (not the one that currently owns the object). The object + * is searched within parent using the provided 'object_id'. + * All tokens to the object must be closed before calling destroy. + * + * Return: '0' on Success; error code otherwise. + */ +int dpdmux_destroy(struct fsl_mc_io *mc_io, + uint16_t dprc_token, + uint32_t cmd_flags, + uint32_t object_id) +{ + struct mc_command cmd = { 0 }; + struct dpdmux_cmd_destroy *cmd_params; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_DESTROY, + cmd_flags, + dprc_token); + cmd_params = (struct dpdmux_cmd_destroy *)cmd.params; + cmd_params->dpdmux_id = cpu_to_le32(object_id); + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +/** + * dpdmux_enable() - Enable DPDMUX functionality + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPDMUX object + * + * Return: '0' on Success; Error code otherwise. + */ +int dpdmux_enable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token) +{ + struct mc_command cmd = { 0 }; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_ENABLE, + cmd_flags, + token); + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +/** + * dpdmux_disable() - Disable DPDMUX functionality + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPDMUX object + * + * Return: '0' on Success; Error code otherwise. + */ +int dpdmux_disable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token) +{ + struct mc_command cmd = { 0 }; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_DISABLE, + cmd_flags, + token); + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +/** + * dpdmux_is_enabled() - Check if the DPDMUX is enabled. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPDMUX object + * @en: Returns '1' if object is enabled; '0' otherwise + * + * Return: '0' on Success; Error code otherwise. + */ +int dpdmux_is_enabled(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + int *en) +{ + struct mc_command cmd = { 0 }; + struct dpdmux_rsp_is_enabled *rsp_params; + int err; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_IS_ENABLED, + cmd_flags, + token); + + /* send command to mc*/ + err = mc_send_command(mc_io, &cmd); + if (err) + return err; + + /* retrieve response parameters */ + rsp_params = (struct dpdmux_rsp_is_enabled *)cmd.params; + *en = dpdmux_get_field(rsp_params->en, ENABLE); + + return 0; +} + +/** + * dpdmux_reset() - Reset the DPDMUX, returns the object to initial 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 DPDMUX object + * + * Return: '0' on Success; Error code otherwise. + */ +int dpdmux_reset(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token) +{ + struct mc_command cmd = { 0 }; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_RESET, + cmd_flags, + token); + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +/** + * dpdmux_get_attributes() - Retrieve DPDMUX 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 DPDMUX object + * @attr: Returned object's attributes + * + * Return: '0' on Success; Error code otherwise. + */ +int dpdmux_get_attributes(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + struct dpdmux_attr *attr) +{ + struct mc_command cmd = { 0 }; + struct dpdmux_rsp_get_attr *rsp_params; + int err; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_GET_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 dpdmux_rsp_get_attr *)cmd.params; + attr->id = le32_to_cpu(rsp_params->id); + attr->options = le64_to_cpu(rsp_params->options); + attr->method = rsp_params->method; + attr->manip = rsp_params->manip; + attr->num_ifs = le16_to_cpu(rsp_params->num_ifs); + attr->mem_size = le16_to_cpu(rsp_params->mem_size); + + return 0; +} + +/** + * dpdmux_if_enable() - Enable Interface + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPDMUX object + * @if_id: Interface Identifier + * + * Return: Completion status. '0' on Success; Error code otherwise. + */ +int dpdmux_if_enable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t if_id) +{ + struct dpdmux_cmd_if *cmd_params; + struct mc_command cmd = { 0 }; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_IF_ENABLE, + cmd_flags, + token); + cmd_params = (struct dpdmux_cmd_if *)cmd.params; + cmd_params->if_id = cpu_to_le16(if_id); + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +/** + * dpdmux_if_disable() - Disable Interface + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPDMUX object + * @if_id: Interface Identifier + * + * Return: Completion status. '0' on Success; Error code otherwise. + */ +int dpdmux_if_disable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t if_id) +{ + struct dpdmux_cmd_if *cmd_params; + struct mc_command cmd = { 0 }; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_IF_DISABLE, + cmd_flags, + token); + cmd_params = (struct dpdmux_cmd_if *)cmd.params; + cmd_params->if_id = cpu_to_le16(if_id); + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +/** + * dpdmux_set_max_frame_length() - Set the maximum frame length in DPDMUX + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPDMUX object + * @max_frame_length: The required maximum frame length + * + * Update the maximum frame length on all DMUX interfaces. + * In case of VEPA, the maximum frame length on all dmux interfaces + * will be updated with the minimum value of the mfls of the connected + * dpnis and the actual value of dmux mfl. + * + * Return: '0' on Success; Error code otherwise. + */ +int dpdmux_set_max_frame_length(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t max_frame_length) +{ + struct mc_command cmd = { 0 }; + struct dpdmux_cmd_set_max_frame_length *cmd_params; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_SET_MAX_FRAME_LENGTH, + cmd_flags, + token); + cmd_params = (struct dpdmux_cmd_set_max_frame_length *)cmd.params; + cmd_params->max_frame_length = cpu_to_le16(max_frame_length); + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +/** + * dpdmux_ul_reset_counters() - Function resets the uplink counter + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPDMUX object + * + * Return: '0' on Success; Error code otherwise. + */ +int dpdmux_ul_reset_counters(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token) +{ + struct mc_command cmd = { 0 }; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_UL_RESET_COUNTERS, + cmd_flags, + token); + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +/** + * dpdmux_if_set_accepted_frames() - Set the accepted frame types + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPDMUX object + * @if_id: Interface ID (0 for uplink, or 1-num_ifs); + * @cfg: Frame types configuration + * + * if 'DPDMUX_ADMIT_ONLY_VLAN_TAGGED' is set - untagged frames or + * priority-tagged frames are discarded. + * if 'DPDMUX_ADMIT_ONLY_UNTAGGED' is set - untagged frames or + * priority-tagged frames are accepted. + * if 'DPDMUX_ADMIT_ALL' is set (default mode) - all VLAN tagged, + * untagged and priority-tagged frame are accepted; + * + * Return: '0' on Success; Error code otherwise. + */ +int dpdmux_if_set_accepted_frames(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t if_id, + const struct dpdmux_accepted_frames *cfg) +{ + struct mc_command cmd = { 0 }; + struct dpdmux_cmd_if_set_accepted_frames *cmd_params; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_IF_SET_ACCEPTED_FRAMES, + cmd_flags, + token); + cmd_params = (struct dpdmux_cmd_if_set_accepted_frames *)cmd.params; + cmd_params->if_id = cpu_to_le16(if_id); + dpdmux_set_field(cmd_params->frames_options, + ACCEPTED_FRAMES_TYPE, + cfg->type); + dpdmux_set_field(cmd_params->frames_options, + UNACCEPTED_FRAMES_ACTION, + cfg->unaccept_act); + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +/** + * dpdmux_if_get_attributes() - Obtain DPDMUX interface 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 DPDMUX object + * @if_id: Interface ID (0 for uplink, or 1-num_ifs); + * @attr: Interface attributes + * + * Return: '0' on Success; Error code otherwise. + */ +int dpdmux_if_get_attributes(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t if_id, + struct dpdmux_if_attr *attr) +{ + struct mc_command cmd = { 0 }; + struct dpdmux_cmd_if *cmd_params; + struct dpdmux_rsp_if_get_attr *rsp_params; + int err; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_IF_GET_ATTR, + cmd_flags, + token); + cmd_params = (struct dpdmux_cmd_if *)cmd.params; + cmd_params->if_id = cpu_to_le16(if_id); + + /* send command to mc*/ + err = mc_send_command(mc_io, &cmd); + if (err) + return err; + + /* retrieve response parameters */ + rsp_params = (struct dpdmux_rsp_if_get_attr *)cmd.params; + attr->rate = le32_to_cpu(rsp_params->rate); + attr->enabled = dpdmux_get_field(rsp_params->enabled, ENABLE); + attr->is_default = dpdmux_get_field(rsp_params->enabled, IS_DEFAULT); + attr->accept_frame_type = dpdmux_get_field( + rsp_params->accepted_frames_type, + ACCEPTED_FRAMES_TYPE); + + return 0; +} + +/** + * dpdmux_if_remove_l2_rule() - Remove L2 rule from DPDMUX table + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPDMUX object + * @if_id: Destination interface ID + * @rule: L2 rule + * + * Function removes a L2 rule from DPDMUX table + * or adds an interface to an existing multicast address + * + * Return: '0' on Success; Error code otherwise. + */ +int dpdmux_if_remove_l2_rule(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t if_id, + const struct dpdmux_l2_rule *rule) +{ + struct mc_command cmd = { 0 }; + struct dpdmux_cmd_if_l2_rule *cmd_params; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_IF_REMOVE_L2_RULE, + cmd_flags, + token); + cmd_params = (struct dpdmux_cmd_if_l2_rule *)cmd.params; + cmd_params->if_id = cpu_to_le16(if_id); + cmd_params->vlan_id = cpu_to_le16(rule->vlan_id); + cmd_params->mac_addr5 = rule->mac_addr[5]; + cmd_params->mac_addr4 = rule->mac_addr[4]; + cmd_params->mac_addr3 = rule->mac_addr[3]; + cmd_params->mac_addr2 = rule->mac_addr[2]; + cmd_params->mac_addr1 = rule->mac_addr[1]; + cmd_params->mac_addr0 = rule->mac_addr[0]; + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +/** + * dpdmux_if_add_l2_rule() - Add L2 rule into DPDMUX table + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPDMUX object + * @if_id: Destination interface ID + * @rule: L2 rule + * + * Function adds a L2 rule into DPDMUX table + * or adds an interface to an existing multicast address + * + * Return: '0' on Success; Error code otherwise. + */ +int dpdmux_if_add_l2_rule(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t if_id, + const struct dpdmux_l2_rule *rule) +{ + struct mc_command cmd = { 0 }; + struct dpdmux_cmd_if_l2_rule *cmd_params; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_IF_ADD_L2_RULE, + cmd_flags, + token); + cmd_params = (struct dpdmux_cmd_if_l2_rule *)cmd.params; + cmd_params->if_id = cpu_to_le16(if_id); + cmd_params->vlan_id = cpu_to_le16(rule->vlan_id); + cmd_params->mac_addr5 = rule->mac_addr[5]; + cmd_params->mac_addr4 = rule->mac_addr[4]; + cmd_params->mac_addr3 = rule->mac_addr[3]; + cmd_params->mac_addr2 = rule->mac_addr[2]; + cmd_params->mac_addr1 = rule->mac_addr[1]; + cmd_params->mac_addr0 = rule->mac_addr[0]; + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +/** + * dpdmux_if_get_counter() - Functions obtains specific counter of an interface + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPDMUX object + * @if_id: Interface Id + * @counter_type: counter type + * @counter: Returned specific counter information + * + * Return: '0' on Success; Error code otherwise. + */ +int dpdmux_if_get_counter(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t if_id, + enum dpdmux_counter_type counter_type, + uint64_t *counter) +{ + struct mc_command cmd = { 0 }; + struct dpdmux_cmd_if_get_counter *cmd_params; + struct dpdmux_rsp_if_get_counter *rsp_params; + int err; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_IF_GET_COUNTER, + cmd_flags, + token); + cmd_params = (struct dpdmux_cmd_if_get_counter *)cmd.params; + cmd_params->if_id = cpu_to_le16(if_id); + cmd_params->counter_type = counter_type; + + /* send command to mc*/ + err = mc_send_command(mc_io, &cmd); + if (err) + return err; + + /* retrieve response parameters */ + rsp_params = (struct dpdmux_rsp_if_get_counter *)cmd.params; + *counter = le64_to_cpu(rsp_params->counter); + + return 0; +} + +/** + * dpdmux_if_set_link_cfg() - set the link 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 DPSW object + * @if_id: interface id + * @cfg: Link configuration + * + * Return: '0' on Success; Error code otherwise. + */ +int dpdmux_if_set_link_cfg(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t if_id, + struct dpdmux_link_cfg *cfg) +{ + struct mc_command cmd = { 0 }; + struct dpdmux_cmd_if_set_link_cfg *cmd_params; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_IF_SET_LINK_CFG, + cmd_flags, + token); + cmd_params = (struct dpdmux_cmd_if_set_link_cfg *)cmd.params; + cmd_params->if_id = cpu_to_le16(if_id); + 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); +} + +/** + * dpdmux_if_get_link_state - Return the 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 DPSW object + * @if_id: interface id + * @state: link state + * + * @returns '0' on Success; Error code otherwise. + */ +int dpdmux_if_get_link_state(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t if_id, + struct dpdmux_link_state *state) +{ + struct mc_command cmd = { 0 }; + struct dpdmux_cmd_if_get_link_state *cmd_params; + struct dpdmux_rsp_if_get_link_state *rsp_params; + int err; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_IF_GET_LINK_STATE, + cmd_flags, + token); + cmd_params = (struct dpdmux_cmd_if_get_link_state *)cmd.params; + cmd_params->if_id = cpu_to_le16(if_id); + + /* send command to mc*/ + err = mc_send_command(mc_io, &cmd); + if (err) + return err; + + /* retrieve response parameters */ + rsp_params = (struct dpdmux_rsp_if_get_link_state *)cmd.params; + state->rate = le32_to_cpu(rsp_params->rate); + state->options = le64_to_cpu(rsp_params->options); + state->up = dpdmux_get_field(rsp_params->up, UP); + state->state_valid = dpdmux_get_field(rsp_params->up, STATE_VALID); + state->supported = le64_to_cpu(rsp_params->supported); + state->advertising = le64_to_cpu(rsp_params->advertising); + + return 0; +} + +/** + * dpdmux_if_set_default - Set default interface + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPSW object + * @if_id: interface id + * + * @returns '0' on Success; Error code otherwise. + */ +int dpdmux_if_set_default(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t if_id) +{ + struct dpdmux_cmd_if *cmd_params; + struct mc_command cmd = { 0 }; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_IF_SET_DEFAULT, + cmd_flags, + token); + cmd_params = (struct dpdmux_cmd_if *)cmd.params; + cmd_params->if_id = cpu_to_le16(if_id); + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +/** + * dpdmux_if_get_default - Get default interface + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPSW object + * @if_id: interface id + * + * @returns '0' on Success; Error code otherwise. + */ +int dpdmux_if_get_default(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t *if_id) +{ + struct dpdmux_cmd_if *rsp_params; + struct mc_command cmd = { 0 }; + int err; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_IF_GET_DEFAULT, + cmd_flags, + token); + + /* send command to mc*/ + err = mc_send_command(mc_io, &cmd); + if (err) + return err; + + /* retrieve response parameters */ + rsp_params = (struct dpdmux_cmd_if *)cmd.params; + *if_id = le16_to_cpu(rsp_params->if_id); + + return 0; +} + +/** + * dpdmux_set_custom_key - Set a custom classification key. + * + * This API is only available for DPDMUX instance created with + * DPDMUX_METHOD_CUSTOM. This API must be called before populating the + * classification table using dpdmux_add_custom_cls_entry. + * + * Calls to dpdmux_set_custom_key remove all existing classification entries + * that may have been added previously using dpdmux_add_custom_cls_entry. + * + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPSW object + * @if_id: Interface id + * @key_cfg_iova: DMA address of a configuration structure set up using + * dpkg_prepare_key_cfg. Maximum key size is 24 bytes + * + * @returns '0' on Success; Error code otherwise. + */ +int dpdmux_set_custom_key(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint64_t key_cfg_iova) +{ + struct dpdmux_set_custom_key *cmd_params; + struct mc_command cmd = { 0 }; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_SET_CUSTOM_KEY, + cmd_flags, + token); + cmd_params = (struct dpdmux_set_custom_key *)cmd.params; + cmd_params->key_cfg_iova = cpu_to_le64(key_cfg_iova); + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +/** + * dpdmux_add_custom_cls_entry - Adds a custom classification entry. + * + * This API is only available for DPDMUX instances created with + * DPDMUX_METHOD_CUSTOM. Before calling this function a classification key + * composition rule must be set up using dpdmux_set_custom_key. + * + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPSW object + * @rule: Classification rule to insert. Rules cannot be duplicated, if a + * matching rule already exists, the action will be replaced. + * @action: Action to perform for matching traffic. + * + * @returns '0' on Success; Error code otherwise. + */ +int dpdmux_add_custom_cls_entry(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + struct dpdmux_rule_cfg *rule, + struct dpdmux_cls_action *action) +{ + struct dpdmux_cmd_add_custom_cls_entry *cmd_params; + struct mc_command cmd = { 0 }; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_ADD_CUSTOM_CLS_ENTRY, + cmd_flags, + token); + + cmd_params = (struct dpdmux_cmd_add_custom_cls_entry *)cmd.params; + cmd_params->key_size = rule->key_size; + cmd_params->dest_if = cpu_to_le16(action->dest_if); + cmd_params->key_iova = cpu_to_le64(rule->key_iova); + cmd_params->mask_iova = cpu_to_le64(rule->mask_iova); + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +/** + * dpdmux_remove_custom_cls_entry - Removes a custom classification entry. + * + * This API is only available for DPDMUX instances created with + * DPDMUX_METHOD_CUSTOM. The API can be used to remove classification + * entries previously inserted using dpdmux_add_custom_cls_entry. + * + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPSW object + * @rule: Classification rule to remove + * + * @returns '0' on Success; Error code otherwise. + */ +int dpdmux_remove_custom_cls_entry(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + struct dpdmux_rule_cfg *rule) +{ + struct dpdmux_cmd_remove_custom_cls_entry *cmd_params; + struct mc_command cmd = { 0 }; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_REMOVE_CUSTOM_CLS_ENTRY, + cmd_flags, + token); + cmd_params = (struct dpdmux_cmd_remove_custom_cls_entry *)cmd.params; + cmd_params->key_size = rule->key_size; + cmd_params->key_iova = cpu_to_le64(rule->key_iova); + cmd_params->mask_iova = cpu_to_le64(rule->mask_iova); + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +/** + * dpdmux_get_api_version() - Get Data Path Demux API version + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @major_ver: Major version of data path demux API + * @minor_ver: Minor version of data path demux API + * + * Return: '0' on Success; Error code otherwise. + */ +int dpdmux_get_api_version(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t *major_ver, + uint16_t *minor_ver) +{ + struct mc_command cmd = { 0 }; + struct dpdmux_rsp_get_api_version *rsp_params; + int err; + + cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_GET_API_VERSION, + cmd_flags, + 0); + + err = mc_send_command(mc_io, &cmd); + if (err) + return err; + + rsp_params = (struct dpdmux_rsp_get_api_version *)cmd.params; + *major_ver = le16_to_cpu(rsp_params->major); + *minor_ver = le16_to_cpu(rsp_params->minor); + + return 0; +} diff --git a/drivers/net/dpaa2/mc/fsl_dpdmux.h b/drivers/net/dpaa2/mc/fsl_dpdmux.h new file mode 100644 index 000000000..c69cb7aab --- /dev/null +++ b/drivers/net/dpaa2/mc/fsl_dpdmux.h @@ -0,0 +1,410 @@ +/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) + * + * Copyright 2013-2016 Freescale Semiconductor Inc. + * Copyright 2018 NXP + * + */ +#ifndef __FSL_DPDMUX_H +#define __FSL_DPDMUX_H + +#include + +struct fsl_mc_io; + +/** @addtogroup dpdmux Data Path Demux API + * Contains API for handling DPDMUX topology and functionality + * @{ + */ + +int dpdmux_open(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + int dpdmux_id, + uint16_t *token); + +int dpdmux_close(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); + +/** + * DPDMUX general options + */ + +/** + * Enable bridging between internal interfaces + */ +#define DPDMUX_OPT_BRIDGE_EN 0x0000000000000002ULL + +/** + * Mask support for classification + */ +#define DPDMUX_OPT_CLS_MASK_SUPPORT 0x0000000000000020ULL + +#define DPDMUX_IRQ_INDEX_IF 0x0000 +#define DPDMUX_IRQ_INDEX 0x0001 + +/** + * IRQ event - Indicates that the link state changed + */ +#define DPDMUX_IRQ_EVENT_LINK_CHANGED 0x0001 + +/** + * enum dpdmux_manip - DPDMUX manipulation operations + * @DPDMUX_MANIP_NONE: No manipulation on frames + * @DPDMUX_MANIP_ADD_REMOVE_S_VLAN: Add S-VLAN on egress, remove it on ingress + */ +enum dpdmux_manip { + DPDMUX_MANIP_NONE = 0x0, + DPDMUX_MANIP_ADD_REMOVE_S_VLAN = 0x1 +}; + +/** + * enum dpdmux_method - DPDMUX method options + * @DPDMUX_METHOD_NONE: no DPDMUX method + * @DPDMUX_METHOD_C_VLAN_MAC: DPDMUX based on C-VLAN and MAC address + * @DPDMUX_METHOD_MAC: DPDMUX based on MAC address + * @DPDMUX_METHOD_C_VLAN: DPDMUX based on C-VLAN + * @DPDMUX_METHOD_S_VLAN: DPDMUX based on S-VLAN + */ +enum dpdmux_method { + DPDMUX_METHOD_NONE = 0x0, + DPDMUX_METHOD_C_VLAN_MAC = 0x1, + DPDMUX_METHOD_MAC = 0x2, + DPDMUX_METHOD_C_VLAN = 0x3, + DPDMUX_METHOD_S_VLAN = 0x4, + DPDMUX_METHOD_CUSTOM = 0x5, +}; + +/** + * struct dpdmux_cfg - DPDMUX configuration parameters + * @method: Defines the operation method for the DPDMUX address table + * @manip: Required manipulation operation + * @num_ifs: Number of interfaces (excluding the uplink interface) + * @adv: Advanced parameters; default is all zeros; + * use this structure to change default settings + * @adv.options: DPDMUX options - combination of 'DPDMUX_OPT_' flags. + * @adv.max_dmat_entries: Maximum entries in DPDMUX address table + * 0 - indicates default: 64 entries per interface. + * @adv.max_mc_groups: Number of multicast groups in DPDMUX table + * 0 - indicates default: 32 multicast groups. + * @adv.max_vlan_ids: Maximum vlan ids allowed in the system - + * relevant only case of working in mac+vlan method. + * 0 - indicates default 16 vlan ids. + */ +struct dpdmux_cfg { + enum dpdmux_method method; + enum dpdmux_manip manip; + uint16_t num_ifs; + struct { + uint64_t options; + uint16_t max_dmat_entries; + uint16_t max_mc_groups; + uint16_t max_vlan_ids; + } adv; +}; + +int dpdmux_create(struct fsl_mc_io *mc_io, + uint16_t dprc_token, + uint32_t cmd_flags, + const struct dpdmux_cfg *cfg, + uint32_t *obj_id); + +int dpdmux_destroy(struct fsl_mc_io *mc_io, + uint16_t dprc_token, + uint32_t cmd_flags, + uint32_t object_id); + +int dpdmux_enable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); + +int dpdmux_disable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); + +int dpdmux_is_enabled(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + int *en); + +int dpdmux_reset(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); + +/** + * struct dpdmux_attr - Structure representing DPDMUX attributes + * @id: DPDMUX object ID + * @options: Configuration options (bitmap) + * @method: DPDMUX address table method + * @manip: DPDMUX manipulation type + * @num_ifs: Number of interfaces (excluding the uplink interface) + * @mem_size: DPDMUX frame storage memory size + */ +struct dpdmux_attr { + int id; + uint64_t options; + enum dpdmux_method method; + enum dpdmux_manip manip; + uint16_t num_ifs; + uint16_t mem_size; +}; + +int dpdmux_get_attributes(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + struct dpdmux_attr *attr); + +int dpdmux_set_max_frame_length(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t max_frame_length); + +/** + * enum dpdmux_counter_type - Counter types + * @DPDMUX_CNT_ING_FRAME: Counts ingress frames + * @DPDMUX_CNT_ING_BYTE: Counts ingress bytes + * @DPDMUX_CNT_ING_FLTR_FRAME: Counts filtered ingress frames + * @DPDMUX_CNT_ING_FRAME_DISCARD: Counts discarded ingress frames + * @DPDMUX_CNT_ING_MCAST_FRAME: Counts ingress multicast frames + * @DPDMUX_CNT_ING_MCAST_BYTE: Counts ingress multicast bytes + * @DPDMUX_CNT_ING_BCAST_FRAME: Counts ingress broadcast frames + * @DPDMUX_CNT_ING_BCAST_BYTES: Counts ingress broadcast bytes + * @DPDMUX_CNT_EGR_FRAME: Counts egress frames + * @DPDMUX_CNT_EGR_BYTE: Counts egress bytes + * @DPDMUX_CNT_EGR_FRAME_DISCARD: Counts discarded egress frames + */ +enum dpdmux_counter_type { + DPDMUX_CNT_ING_FRAME = 0x0, + DPDMUX_CNT_ING_BYTE = 0x1, + DPDMUX_CNT_ING_FLTR_FRAME = 0x2, + DPDMUX_CNT_ING_FRAME_DISCARD = 0x3, + DPDMUX_CNT_ING_MCAST_FRAME = 0x4, + DPDMUX_CNT_ING_MCAST_BYTE = 0x5, + DPDMUX_CNT_ING_BCAST_FRAME = 0x6, + DPDMUX_CNT_ING_BCAST_BYTES = 0x7, + DPDMUX_CNT_EGR_FRAME = 0x8, + DPDMUX_CNT_EGR_BYTE = 0x9, + DPDMUX_CNT_EGR_FRAME_DISCARD = 0xa +}; + +/** + * enum dpdmux_accepted_frames_type - DPDMUX frame types + * @DPDMUX_ADMIT_ALL: The device accepts VLAN tagged, untagged and + * priority-tagged frames + * @DPDMUX_ADMIT_ONLY_VLAN_TAGGED: The device discards untagged frames or + * priority-tagged frames that are received on this + * interface + * @DPDMUX_ADMIT_ONLY_UNTAGGED: Untagged frames or priority-tagged frames + * received on this interface are accepted + */ +enum dpdmux_accepted_frames_type { + DPDMUX_ADMIT_ALL = 0, + DPDMUX_ADMIT_ONLY_VLAN_TAGGED = 1, + DPDMUX_ADMIT_ONLY_UNTAGGED = 2 +}; + +/** + * enum dpdmux_action - DPDMUX action for un-accepted frames + * @DPDMUX_ACTION_DROP: Drop un-accepted frames + * @DPDMUX_ACTION_REDIRECT_TO_CTRL: Redirect un-accepted frames to the + * control interface + */ +enum dpdmux_action { + DPDMUX_ACTION_DROP = 0, + DPDMUX_ACTION_REDIRECT_TO_CTRL = 1 +}; + +/** + * struct dpdmux_accepted_frames - Frame types configuration + * @type: Defines ingress accepted frames + * @unaccept_act: Defines action on frames not accepted + */ +struct dpdmux_accepted_frames { + enum dpdmux_accepted_frames_type type; + enum dpdmux_action unaccept_act; +}; + +int dpdmux_if_set_accepted_frames(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t if_id, + const struct dpdmux_accepted_frames *cfg); + +/** + * struct dpdmux_if_attr - Structure representing frame types configuration + * @rate: Configured interface rate (in bits per second) + * @enabled: Indicates if interface is enabled + * @accept_frame_type: Indicates type of accepted frames for the interface + */ +struct dpdmux_if_attr { + uint32_t rate; + int enabled; + int is_default; + enum dpdmux_accepted_frames_type accept_frame_type; +}; + +int dpdmux_if_get_attributes(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t if_id, + struct dpdmux_if_attr *attr); + +int dpdmux_if_enable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t if_id); + +int dpdmux_if_disable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t if_id); + +/** + * struct dpdmux_l2_rule - Structure representing L2 rule + * @mac_addr: MAC address + * @vlan_id: VLAN ID + */ +struct dpdmux_l2_rule { + uint8_t mac_addr[6]; + uint16_t vlan_id; +}; + +int dpdmux_if_remove_l2_rule(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t if_id, + const struct dpdmux_l2_rule *rule); + +int dpdmux_if_add_l2_rule(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t if_id, + const struct dpdmux_l2_rule *rule); + +int dpdmux_if_get_counter(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t if_id, + enum dpdmux_counter_type counter_type, + uint64_t *counter); + +int dpdmux_ul_reset_counters(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); + +/** + * Enable auto-negotiation + */ +#define DPDMUX_LINK_OPT_AUTONEG 0x0000000000000001ULL +/** + * Enable half-duplex mode + */ +#define DPDMUX_LINK_OPT_HALF_DUPLEX 0x0000000000000002ULL +/** + * Enable pause frames + */ +#define DPDMUX_LINK_OPT_PAUSE 0x0000000000000004ULL +/** + * Enable a-symmetric pause frames + */ +#define DPDMUX_LINK_OPT_ASYM_PAUSE 0x0000000000000008ULL + +/** + * struct dpdmux_link_cfg - Structure representing DPDMUX link configuration + * @rate: Rate + * @options: Mask of available options; use 'DPDMUX_LINK_OPT_' values + */ +struct dpdmux_link_cfg { + uint32_t rate; + uint64_t options; + uint64_t advertising; +}; + +int dpdmux_if_set_link_cfg(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t if_id, + struct dpdmux_link_cfg *cfg); +/** + * struct dpdmux_link_state - Structure representing DPDMUX link state + * @rate: Rate + * @options: Mask of available options; use 'DPDMUX_LINK_OPT_' values + * @up: 0 - down, 1 - 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 dpdmux_link_state { + uint32_t rate; + uint64_t options; + int up; + int state_valid; + uint64_t supported; + uint64_t advertising; +}; + +int dpdmux_if_get_link_state(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t if_id, + struct dpdmux_link_state *state); + +int dpdmux_if_set_default(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t if_id); + +int dpdmux_if_get_default(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t *if_id); + +int dpdmux_set_custom_key(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint64_t key_cfg_iova); + +/** + * struct dpdmux_rule_cfg - Custom classification rule. + * + * @key_iova: DMA address of buffer storing the look-up value + * @mask_iova: DMA address of the mask used for TCAM classification + * @key_size: size, in bytes, of the look-up value. This must match the size + * of the look-up key defined using dpdmux_set_custom_key, otherwise the + * entry will never be hit + */ +struct dpdmux_rule_cfg { + uint64_t key_iova; + uint64_t mask_iova; + uint8_t key_size; +}; + +/** + * struct dpdmux_cls_action - Action to execute for frames matching the + * classification entry + * + * @dest_if: Interface to forward the frames to. Port numbering is similar to + * the one used to connect interfaces: + * - 0 is the uplink port, + * - all others are downlink ports. + */ +struct dpdmux_cls_action { + uint16_t dest_if; +}; + +int dpdmux_add_custom_cls_entry(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + struct dpdmux_rule_cfg *rule, + struct dpdmux_cls_action *action); + +int dpdmux_remove_custom_cls_entry(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + struct dpdmux_rule_cfg *rule); + +int dpdmux_get_api_version(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t *major_ver, + uint16_t *minor_ver); + +#endif /* __FSL_DPDMUX_H */ diff --git a/drivers/net/dpaa2/mc/fsl_dpdmux_cmd.h b/drivers/net/dpaa2/mc/fsl_dpdmux_cmd.h new file mode 100644 index 000000000..a36349feb --- /dev/null +++ b/drivers/net/dpaa2/mc/fsl_dpdmux_cmd.h @@ -0,0 +1,221 @@ +/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) + * + * Copyright 2013-2016 Freescale Semiconductor Inc. + * Copyright 2018 NXP + * + */ +#ifndef _FSL_DPDMUX_CMD_H +#define _FSL_DPDMUX_CMD_H + +/* DPDMUX Version */ +#define DPDMUX_VER_MAJOR 6 +#define DPDMUX_VER_MINOR 3 + +#define DPDMUX_CMD_BASE_VERSION 1 +#define DPDMUX_CMD_VERSION_2 2 +#define DPDMUX_CMD_ID_OFFSET 4 + +#define DPDMUX_CMD(id) (((id) << DPDMUX_CMD_ID_OFFSET) |\ + DPDMUX_CMD_BASE_VERSION) +#define DPDMUX_CMD_V2(id) (((id) << DPDMUX_CMD_ID_OFFSET) | \ + DPDMUX_CMD_VERSION_2) + +/* Command IDs */ +#define DPDMUX_CMDID_CLOSE DPDMUX_CMD(0x800) +#define DPDMUX_CMDID_OPEN DPDMUX_CMD(0x806) +#define DPDMUX_CMDID_CREATE DPDMUX_CMD(0x906) +#define DPDMUX_CMDID_DESTROY DPDMUX_CMD(0x986) +#define DPDMUX_CMDID_GET_API_VERSION DPDMUX_CMD(0xa06) + +#define DPDMUX_CMDID_ENABLE DPDMUX_CMD(0x002) +#define DPDMUX_CMDID_DISABLE DPDMUX_CMD(0x003) +#define DPDMUX_CMDID_GET_ATTR DPDMUX_CMD(0x004) +#define DPDMUX_CMDID_RESET DPDMUX_CMD(0x005) +#define DPDMUX_CMDID_IS_ENABLED DPDMUX_CMD(0x006) + +#define DPDMUX_CMDID_SET_MAX_FRAME_LENGTH DPDMUX_CMD(0x0a1) + +#define DPDMUX_CMDID_UL_RESET_COUNTERS DPDMUX_CMD(0x0a3) + +#define DPDMUX_CMDID_IF_SET_ACCEPTED_FRAMES DPDMUX_CMD(0x0a7) +#define DPDMUX_CMDID_IF_GET_ATTR DPDMUX_CMD(0x0a8) +#define DPDMUX_CMDID_IF_ENABLE DPDMUX_CMD(0x0a9) +#define DPDMUX_CMDID_IF_DISABLE DPDMUX_CMD(0x0aa) + +#define DPDMUX_CMDID_IF_ADD_L2_RULE DPDMUX_CMD(0x0b0) +#define DPDMUX_CMDID_IF_REMOVE_L2_RULE DPDMUX_CMD(0x0b1) +#define DPDMUX_CMDID_IF_GET_COUNTER DPDMUX_CMD(0x0b2) +#define DPDMUX_CMDID_IF_SET_LINK_CFG DPDMUX_CMD_V2(0x0b3) +#define DPDMUX_CMDID_IF_GET_LINK_STATE DPDMUX_CMD_V2(0x0b4) + +#define DPDMUX_CMDID_SET_CUSTOM_KEY DPDMUX_CMD(0x0b5) +#define DPDMUX_CMDID_ADD_CUSTOM_CLS_ENTRY DPDMUX_CMD(0x0b6) +#define DPDMUX_CMDID_REMOVE_CUSTOM_CLS_ENTRY DPDMUX_CMD(0x0b7) + +#define DPDMUX_CMDID_IF_SET_DEFAULT DPDMUX_CMD(0x0b8) +#define DPDMUX_CMDID_IF_GET_DEFAULT DPDMUX_CMD(0x0b9) + +#define DPDMUX_MASK(field) \ + GENMASK(DPDMUX_##field##_SHIFT + DPDMUX_##field##_SIZE - 1, \ + DPDMUX_##field##_SHIFT) +#define dpdmux_set_field(var, field, val) \ + ((var) |= (((val) << DPDMUX_##field##_SHIFT) & DPDMUX_MASK(field))) +#define dpdmux_get_field(var, field) \ + (((var) & DPDMUX_MASK(field)) >> DPDMUX_##field##_SHIFT) + +#pragma pack(push, 1) +struct dpdmux_cmd_open { + uint32_t dpdmux_id; +}; + +struct dpdmux_cmd_create { + uint8_t method; + uint8_t manip; + uint16_t num_ifs; + uint32_t pad; + + uint16_t adv_max_dmat_entries; + uint16_t adv_max_mc_groups; + uint16_t adv_max_vlan_ids; + uint16_t pad1; + + uint64_t options; +}; + +struct dpdmux_cmd_destroy { + uint32_t dpdmux_id; +}; + +#define DPDMUX_ENABLE_SHIFT 0 +#define DPDMUX_ENABLE_SIZE 1 +#define DPDMUX_IS_DEFAULT_SHIFT 1 +#define DPDMUX_IS_DEFAULT_SIZE 1 + +struct dpdmux_rsp_is_enabled { + uint8_t en; +}; + +struct dpdmux_rsp_get_attr { + uint8_t method; + uint8_t manip; + uint16_t num_ifs; + uint16_t mem_size; + uint16_t pad; + + uint64_t pad1; + + uint32_t id; + uint32_t pad2; + + uint64_t options; +}; + +struct dpdmux_cmd_set_max_frame_length { + uint16_t max_frame_length; +}; + +#define DPDMUX_ACCEPTED_FRAMES_TYPE_SHIFT 0 +#define DPDMUX_ACCEPTED_FRAMES_TYPE_SIZE 4 +#define DPDMUX_UNACCEPTED_FRAMES_ACTION_SHIFT 4 +#define DPDMUX_UNACCEPTED_FRAMES_ACTION_SIZE 4 + +struct dpdmux_cmd_if_set_accepted_frames { + uint16_t if_id; + uint8_t frames_options; +}; + +struct dpdmux_cmd_if { + uint16_t if_id; +}; + +struct dpdmux_rsp_if_get_attr { + uint8_t pad[3]; + uint8_t enabled; + uint8_t pad1[3]; + uint8_t accepted_frames_type; + uint32_t rate; +}; + +struct dpdmux_cmd_if_l2_rule { + uint16_t if_id; + uint8_t mac_addr5; + uint8_t mac_addr4; + uint8_t mac_addr3; + uint8_t mac_addr2; + uint8_t mac_addr1; + uint8_t mac_addr0; + + uint32_t pad; + uint16_t vlan_id; +}; + +struct dpdmux_cmd_if_get_counter { + uint16_t if_id; + uint8_t counter_type; +}; + +struct dpdmux_rsp_if_get_counter { + uint64_t pad; + uint64_t counter; +}; + +struct dpdmux_cmd_if_set_link_cfg { + uint16_t if_id; + uint16_t pad[3]; + + uint32_t rate; + uint32_t pad1; + + uint64_t options; + uint64_t advertising; +}; + +struct dpdmux_cmd_if_get_link_state { + uint16_t if_id; +}; + +#define DPDMUX_UP_SHIFT 0 +#define DPDMUX_UP_SIZE 1 +#define DPDMUX_STATE_VALID_SHIFT 1 +#define DPDMUX_STATE_VALID_SIZE 1 +struct dpdmux_rsp_if_get_link_state { + uint32_t pad; + uint8_t up; + uint8_t pad1[3]; + + uint32_t rate; + uint32_t pad2; + + uint64_t options; + uint64_t supported; + uint64_t advertising; +}; + +struct dpdmux_rsp_get_api_version { + uint16_t major; + uint16_t minor; +}; + +struct dpdmux_set_custom_key { + uint64_t pad[6]; + uint64_t key_cfg_iova; +}; + +struct dpdmux_cmd_add_custom_cls_entry { + uint8_t pad[3]; + uint8_t key_size; + uint16_t pad1; + uint16_t dest_if; + uint64_t key_iova; + uint64_t mask_iova; +}; + +struct dpdmux_cmd_remove_custom_cls_entry { + uint8_t pad[3]; + uint8_t key_size; + uint32_t pad1; + uint64_t key_iova; + uint64_t mask_iova; +}; +#pragma pack(pop) +#endif /* _FSL_DPDMUX_CMD_H */ diff --git a/drivers/net/dpaa2/meson.build b/drivers/net/dpaa2/meson.build index 07aada87c..c7c2df417 100644 --- a/drivers/net/dpaa2/meson.build +++ b/drivers/net/dpaa2/meson.build @@ -12,6 +12,7 @@ sources = files('base/dpaa2_hw_dpni.c', 'dpaa2_ethdev.c', 'dpaa2_rxtx.c', 'mc/dpkg.c', + 'mc/dpdmux.c', 'mc/dpni.c') includes += include_directories('base', 'mc') From patchwork Thu Dec 27 06:23:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 154559 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6605660ljp; Wed, 26 Dec 2018 22:25:26 -0800 (PST) X-Google-Smtp-Source: ALg8bN6CvLq53Em28E5jTwewzurrUDvH5VrbJ3ikHZYpw3dUN8up9fXNyoPLtIKZ/OUqnZ7T3Ypt X-Received: by 2002:adf:f052:: with SMTP id t18mr22108774wro.112.1545891926800; Wed, 26 Dec 2018 22:25:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545891926; cv=none; d=google.com; s=arc-20160816; b=ZN3cR5AKdNJ1sYhMloHIbp/TQTQRdvxqp3GEX3eDnXDzY+2Bqx+A0U2tfytRoe76hV IUfDHsEI/StwIoLPWNSaxMGicb7uzKy53zF8JWjqNbvaxtv5Nh8p7V2HuRsc4GsUIyJW Y0ug4gC0b09vj0NRTN4RuCo49yavjzuBXbVjC/tk+13zsQ4pubfPP670fJntc/VIc6Dz R2aPIMVZLlASku764z2FOaV9yPYtQ35T5mDGETraazOp9g3TGBs+4iaCqGcnnLmjAii2 yLUMsRF65vPRda77Zk0zFoU/dfHdDlqQ6NdPcb3QxDKi9Mycr3KREMRWoniZHYtjOtou Q/hw== 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:mime-version :content-transfer-encoding:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:cc:to:from :dkim-signature; bh=1QrjlbXLAHtsN6Op052Z6NJ6Je29dKuCGmwv9o5gUIc=; b=rtikCiuxw3I7kanZxsIjiJUjK6lNG/lYCMTKPLw9MnkKf/0Gbedqq5Nm0FoQZiv7g+ tpEeLm4+svtW9cE02Sh3ySm8wgM+4ERgkrfxKCtdvrgs9YwWMQyRMDqF/gCMj72feQGY 6abf3u9Tdjiuhdxlr/q6mp4Dbe1G8HdmHYD/BdwGp8wsRb9CGARKBupTbtBIDnDvg4Vb VJJFvcf4W5/FGy02JkTNka3AwxBxTjAVVLvLJ9ULeW+oPbLl2LUoegQjdh81/Zd4j9qX BvurYskz/j2DFbDSoDifw+A7aTe1FY3ryxupNxojGRQcycgINiFi3shr4azzJGqf1Z7O UU/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=ZCFX2WDE; 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 v1si18194446wrq.443.2018.12.26.22.25.26; Wed, 26 Dec 2018 22:25:26 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=ZCFX2WDE; 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 DA4DF5F1C; Thu, 27 Dec 2018 07:23:25 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140045.outbound.protection.outlook.com [40.107.14.45]) by dpdk.org (Postfix) with ESMTP id 0C7D358FE for ; Thu, 27 Dec 2018 07:23:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1QrjlbXLAHtsN6Op052Z6NJ6Je29dKuCGmwv9o5gUIc=; b=ZCFX2WDEETuPBGHbvDxWwFpnnoSv0Kb+08BXXff+qBKWGUVATjhjSxlfFcG9xdEALgHJe37vBmJrN8bnBm1jGOQ0ZSPIVbJu0enR0mJLU6o+A0EHSOfRmMXSRnpoO5cRamfhpYYMojuPDaciNf8lva3bEuxft5M6C9tBp7gCInA= Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com (10.168.65.19) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.134.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Thu, 27 Dec 2018 06:23:13 +0000 Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4]) by VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4%2]) with mapi id 15.20.1471.019; Thu, 27 Dec 2018 06:23:13 +0000 From: Hemant Agrawal To: "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , Shreyansh Jain , Nipun Gupta Thread-Topic: [PATCH 14/20] bus/fslmc: add support for scanning DPDMUX object Thread-Index: AQHUnayl7/UX6DwZJEekykFm3YuFCA== Date: Thu, 27 Dec 2018 06:23:12 +0000 Message-ID: <20181227062233.30781-15-hemant.agrawal@nxp.com> References: <20181227062233.30781-1-hemant.agrawal@nxp.com> In-Reply-To: <20181227062233.30781-1-hemant.agrawal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.143.30.134] x-mailer: git-send-email 2.17.1 x-clientproxiedby: BM1PR01CA0120.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:40::14) To VI1PR0401MB2541.eurprd04.prod.outlook.com (2603:10a6:800:56::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0401MB2382; 6:uQv/pl6TL8OPF//nTM7M6YiW1vyE2VlepoYv0d8alsk+wU/kVSs/2IcEtkmlY7bmqZBvASeTGQL6lKeB+08f5G7QC90vR6iM6X9bSCoTAKA7GZmOFpz+lg8uu2dLiXiz/86OQV2cWPt7ktRk1CJ/q/6gUL6F0igfB3ajrWiY7XzStg9cChM6Q7BLGqTSc7UhM0TLYYhpBYVg6+2VeNw7BzOVet68JJbgJjINZmfRr9OblwMJUR4L8Wn5ug2i82jTXNmAaJkOvtxzNvOP1Z2SYjI3VM9kXeD1VNag9BvnnH5DpX3gsgoKxQ/Ad3CnawY2CdJV+oxjTcQWhUk6OLWQ5J/2+Fv0wX5T5SXiVCGKYVbYBQ0fhDfBfL9DigX2Eeh/StQsuq9IgguJxGARjLp20fHSuNVVk/0LqNzciMlp1IDxCl3YplDBd3Jn8bI/Xpwpmzsm1Ew9YdQ23FfAGlxZCA==; 5:M77TgsopOx14OTHUO8UVCVdiLAwxq2qI95jTPaksTrca7/fTEAilO0Azu6x/yDQxiKvII089K4i2hLp+12gv7KF6xqbqVtMPi8aL7L6NPr+R/wM9SLBmOhEsO12+Ggib8Hcig+AMJoNDCy2BjE1ZvutVWVP3HhGqrVtU/2KC/1E=; 7:OHis98KlqFjD+4bLHLsb1IsRtAhE3cVFu8adcOOdEGo77NOAbnKLS8tqJoCNDTCiBZ8btrmoeU4NJdQ0fDSTvYmowlQ3es2vYMM+Xxv9KIndBFaCZiz8uo0StFLuW8hrpmbCzmgsA1OGF2lbzbANCw== x-ms-office365-filtering-correlation-id: eefcb9da-52eb-411a-a9ee-08d66bc3c740 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2382; x-ms-traffictypediagnostic: VI1PR0401MB2382: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:VI1PR0401MB2382; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0401MB2382; x-forefront-prvs: 0899B47777 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(396003)(366004)(376002)(39860400002)(346002)(199004)(189003)(5660300001)(1076003)(26005)(76176011)(186003)(71200400001)(256004)(25786009)(105586002)(4326008)(6436002)(305945005)(11346002)(106356001)(14444005)(446003)(44832011)(476003)(7736002)(55236004)(102836004)(78486014)(486006)(386003)(68736007)(52116002)(86362001)(6506007)(2616005)(71190400001)(66066001)(316002)(54906003)(6116002)(3846002)(2906002)(14454004)(36756003)(99286004)(50226002)(8936002)(1730700003)(81156014)(81166006)(8676002)(6512007)(53936002)(478600001)(97736004)(6486002)(6916009)(5640700003)(2351001)(2501003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2382; H:VI1PR0401MB2541.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: GVA8QpJi1ogTBHAy7zTsVgieV9cNOHs28MXh3APQ0Eh8+7N7jS4Fe+m+bMLhHvBCTp9xd4jnRjNQY4Jg/5haRE6Aj2uufRJugtljrtLdhbNDqTrskO3v2edeeV2QJcUwu+5/V0li54uc6GU94tJZooc7G9PR40xk/G7iA4RUxtznptX/3jC0YbF8JkJGjvtuzfTrPSzCC0Q5nbAiT6KTIau5imAoVe5aei5n9+dDWf377yU1pfmdTTtLNQv+AQm1ESD8bJSKdCAfxiXxczgcCOrXTDKxO5ZUyHNm3uF9V+6IhGHn4We/7KvXtZfvLlGv spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: eefcb9da-52eb-411a-a9ee-08d66bc3c740 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2018 06:23:12.9421 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Subject: [dpdk-dev] [PATCH 14/20] bus/fslmc: add support for scanning DPDMUX object 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 Add support in bus and vfio to scan dpdmux type of objects Signed-off-by: Nipun Gupta --- drivers/bus/fslmc/fslmc_bus.c | 5 ++++- drivers/bus/fslmc/fslmc_vfio.c | 2 ++ drivers/bus/fslmc/rte_fslmc.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c index 565e0148f..fa1505377 100644 --- a/drivers/bus/fslmc/fslmc_bus.c +++ b/drivers/bus/fslmc/fslmc_bus.c @@ -187,6 +187,8 @@ scan_one_fslmc_device(char *dev_name) dev->dev_type = DPAA2_MPORTAL; else if (!strncmp("dpdmai", t_ptr, 6)) dev->dev_type = DPAA2_QDMA; + else if (!strncmp("dpdmux", t_ptr, 6)) + dev->dev_type = DPAA2_MUX; else dev->dev_type = DPAA2_UNKNOWN; @@ -245,7 +247,8 @@ rte_fslmc_parse(const char *name, void *addr) strncmp("dpio", t_ptr, 4) && strncmp("dpci", t_ptr, 4) && strncmp("dpmcp", t_ptr, 5) && - strncmp("dpdmai", t_ptr, 6)) { + strncmp("dpdmai", t_ptr, 6) && + strncmp("dpdmux", t_ptr, 6)) { DPAA2_BUS_ERR("Unknown or unsupported device"); goto err_out; } diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c index ce82a99f6..98768a46c 100644 --- a/drivers/bus/fslmc/fslmc_vfio.c +++ b/drivers/bus/fslmc/fslmc_vfio.c @@ -560,6 +560,7 @@ fslmc_process_iodevices(struct rte_dpaa2_device *dev) case DPAA2_IO: case DPAA2_CI: case DPAA2_BPOOL: + case DPAA2_MUX: TAILQ_FOREACH(object, &dpaa2_obj_list, next) { if (dev->dev_type == object->dev_type) object->create(dev_fd, &device_info, @@ -691,6 +692,7 @@ fslmc_vfio_process_group(void) case DPAA2_IO: case DPAA2_CI: case DPAA2_BPOOL: + case DPAA2_MUX: /* Call the object creation routine and remove the * device entry from device list */ diff --git a/drivers/bus/fslmc/rte_fslmc.h b/drivers/bus/fslmc/rte_fslmc.h index cea5b78f9..5cfb24505 100644 --- a/drivers/bus/fslmc/rte_fslmc.h +++ b/drivers/bus/fslmc/rte_fslmc.h @@ -66,6 +66,7 @@ enum rte_dpaa2_dev_type { DPAA2_CI, /**< DPCI type device */ DPAA2_MPORTAL, /**< DPMCP type device */ DPAA2_QDMA, /**< DPDMAI type device */ + DPAA2_MUX, /**< DPDMUX type device */ /* Unknown device placeholder */ DPAA2_UNKNOWN, DPAA2_DEVTYPE_MAX, From patchwork Thu Dec 27 06:23:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 154560 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6605758ljp; Wed, 26 Dec 2018 22:25:35 -0800 (PST) X-Google-Smtp-Source: ALg8bN45LtL8CvLBZyDgpHWiNC8dxtUDbxiYrZ8HFuJVcCm985PNr64erCRDtmEnLTExHkL9USc4 X-Received: by 2002:a5d:694d:: with SMTP id r13mr20156970wrw.323.1545891935683; Wed, 26 Dec 2018 22:25:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545891935; cv=none; d=google.com; s=arc-20160816; b=XAHTlKOk3XwlfmD5ZgqURO7Hvh/4pGSx25h+T+R514oltHXV0aZDlMvzVSLoUMHLx2 dZWA+4HO6AuGHVWmHTq94BglSIhQaCJwGnJ2EkEwDsR+mlWHV+u0EeqA5gLRDW21bGNn J++/cq5N0l1A52dOOsfmG0SiTM3RYlYVUFjgEcYR5CdX5dXN9wMv8PfyzZb+a5WpjNoJ XzvxGsJHG/eGG4Bvf8MpSFzVRrJUxUMTMOwigUj3l9ckfohDeFB04D82fmgds9/aj+vK pcB0ZB4M1M1UPfkoYaFv1OmP/WDQDRycUwaCh+gHclMKBEYtqH6QY7a152tT9GPjMNoZ tcWw== 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:mime-version :content-transfer-encoding:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:cc:to:from :dkim-signature; bh=9q55Feyxk3PPmMigXFOKyK/svdTV1hC/yIK2lv7Mj/A=; b=CMgciSNoOsFSfmEV9jUSOGgc1tJl4vXlmyX4m9PKyzavG1H5VV7o2Xezqb+sdq/lHe dVpr7M/PE0s7gTMbZ/HPlN9bY018UqV4FhYjcGXLkRYpD76I4gJKM08kZM6Z9kHmn+Do H7R80HPtmsRXBboHmCuWvkhVoaqdRJtXkeQkIVDSpdjsbtaSvIqIAJwbY5M7+6sIpOcV Tuhe5V9S7D7fJVEkslDIhnYr7LykPj9vknrH+XxszY7o165ZogFp3bEcVtZZhqQhzHmE PtvEMSYYX411Ghk2COELQ6WpHY3C4GW/b/oILdCLIblzItRg+mfKtShYMaBJhCZMUgBW rUqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=qcJqhbFR; 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 z2si12960126wmb.141.2018.12.26.22.25.35; Wed, 26 Dec 2018 22:25:35 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=qcJqhbFR; 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 80D2F5F24; Thu, 27 Dec 2018 07:23:27 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140040.outbound.protection.outlook.com [40.107.14.40]) by dpdk.org (Postfix) with ESMTP id 220454C8D for ; Thu, 27 Dec 2018 07:23:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9q55Feyxk3PPmMigXFOKyK/svdTV1hC/yIK2lv7Mj/A=; b=qcJqhbFRaddKXLvVxeFGAsvhmOlN6qq4znFacDiafq/3fCm/ad9adLwKP0eEaj85t3vQBblAIj8/Z68DWV870xbOzr/AesWHmSmY4AM/dRO0hdpjdK5jj5JO7KLn+v12aVk1TaLheK5ksSSTdpemEW3EPGdOQzdPEnpIf61L8ik= Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com (10.168.65.19) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.134.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Thu, 27 Dec 2018 06:23:14 +0000 Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4]) by VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4%2]) with mapi id 15.20.1471.019; Thu, 27 Dec 2018 06:23:14 +0000 From: Hemant Agrawal To: "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , Shreyansh Jain , Nipun Gupta Thread-Topic: [PATCH 15/20] net/dpaa2: add dpdmux initialization and configuration Thread-Index: AQHUnaylmBB19FCKv0qy9Bt41yLG+g== Date: Thu, 27 Dec 2018 06:23:14 +0000 Message-ID: <20181227062233.30781-16-hemant.agrawal@nxp.com> References: <20181227062233.30781-1-hemant.agrawal@nxp.com> In-Reply-To: <20181227062233.30781-1-hemant.agrawal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.143.30.134] x-mailer: git-send-email 2.17.1 x-clientproxiedby: BM1PR01CA0120.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:40::14) To VI1PR0401MB2541.eurprd04.prod.outlook.com (2603:10a6:800:56::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0401MB2382; 6:Eg1CzGny/PdGWypEmSI4jlhIbBENkl5jeY68OcW5kARmanc7fqmpwY6TB7ZJD07HpUV23jkvkHghcnsnocINq0rMov2FY+csYTcpNHKRQ+4UO9cvPDVzTxS3SToAem4GXA3ahiBtWTCpqP+kabI9Gj910Fys9hhVBbOXLe8g4c3KUEyffA1uRQveNJsoYhaBgQFT9OCnXoAA2sigY40Fs+IlzbVxpoVx1qZOneb6j4K//AwTWnSTzymNsL1DdDJ1/asCN8JXKcCdXHCbc5K+fRpPYRu32tXcTfNpD1zaZMkAKQ21XjHD9qEaafJ8iA2UcW+LMNFzXw9OTYzhr8ORkSqgZPnK15y6QYYEd4yESz9kkjUm9aqlpI90YEMYnCohd4dxVTLuo+qpokWhEUnqncMzN+UUCyesMINgtNKS9PGrOrTtUdpSlPWvaRpIVqi7EDgWwX9eLJoHyB813/cgow==; 5:b/e2AToMaaEl9jx+T9Vw6+oON5y92ezGT/AUkEAZ7EuCsUR9FRgZaOKQFa7JqpgtMxUOxh+k9ed9GeXene/VGr1vT7ocVwC4Q7MVYfqbe1luRvHq82hJZgXpepvia9wyRRrzih8640+TMFXS4cumIfWHnFZDlaLab2g3bFfDUus=; 7:80I7IonU27bOCoMzlSLnmBN74rc1UqnM30wDzJ33PyDajEf8E7s2Qw6qtaQWYoArD2ViX3aDzi8j3Ep30EcxbJ2BwThwB8iVBQRJvvrKXtrAJ6orswg/DwE4XdbzQaCQIT92VDqE1DPyGyCw7Kjprw== x-ms-office365-filtering-correlation-id: bb85b745-3675-46f4-133f-08d66bc3c82f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2382; x-ms-traffictypediagnostic: VI1PR0401MB2382: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:VI1PR0401MB2382; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0401MB2382; x-forefront-prvs: 0899B47777 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(396003)(366004)(376002)(39860400002)(346002)(199004)(189003)(5660300001)(1076003)(26005)(76176011)(186003)(71200400001)(256004)(25786009)(105586002)(4326008)(6436002)(305945005)(11346002)(106356001)(14444005)(446003)(44832011)(476003)(7736002)(55236004)(102836004)(78486014)(486006)(386003)(68736007)(52116002)(86362001)(6506007)(2616005)(71190400001)(66066001)(316002)(54906003)(6116002)(3846002)(2906002)(14454004)(36756003)(99286004)(50226002)(8936002)(1730700003)(81156014)(81166006)(8676002)(6512007)(53936002)(478600001)(97736004)(6486002)(6916009)(5640700003)(2351001)(2501003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2382; H:VI1PR0401MB2541.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: RALMt04P3wEUk/sXn8OIMv6j5FsCt2dlcSNQVIu+AYOerlZipTEsy11yUkPsXO8FKCfL8dWLrp4NIC+GjQ+3URKh0NSSwH8yn67X6eEvOgG8EL/spPgDVgMZLp6TlZxA1hdY6ty60KYNS0UGHxpl9vl9wOSp84u+/xVjwC+l0thI2C3u9UM16MYmgDR3XcYnm77wiZU4dxRMdKiUJYVC2mvOYyKdrANR7jzhD2iM+K60b6NuoeBLMhTE4suEjglzDHP6VpZDOA1UW7QZcnOJWEChygSZZgpc+Ab90A84VEpgqkoGCYMgttjMv7XJanaj spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bb85b745-3675-46f4-133f-08d66bc3c82f X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2018 06:23:14.4889 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Subject: [dpdk-dev] [PATCH 15/20] net/dpaa2: add dpdmux initialization and configuration 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 patch introduces an rte pmd API to configure dpdmux from the application. dpdmux can work in association with dpni as an additional distribution capability on the NIC. Signed-off-by: Nipun Gupta --- drivers/net/dpaa2/Makefile | 1 + drivers/net/dpaa2/dpaa2_ethdev.h | 2 + drivers/net/dpaa2/dpaa2_mux.c | 222 ++++++++++++++++++++ drivers/net/dpaa2/meson.build | 1 + drivers/net/dpaa2/rte_pmd_dpaa2.h | 23 ++ drivers/net/dpaa2/rte_pmd_dpaa2_version.map | 1 + 6 files changed, 250 insertions(+) create mode 100644 drivers/net/dpaa2/dpaa2_mux.c -- 2.17.1 diff --git a/drivers/net/dpaa2/Makefile b/drivers/net/dpaa2/Makefile index c58a39725..562551175 100644 --- a/drivers/net/dpaa2/Makefile +++ b/drivers/net/dpaa2/Makefile @@ -33,6 +33,7 @@ CFLAGS += -DALLOW_EXPERIMENTAL_API SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += base/dpaa2_hw_dpni.c SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += dpaa2_rxtx.c SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += dpaa2_ethdev.c +SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += dpaa2_mux.c SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += mc/dpni.c SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += mc/dpkg.c SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += mc/dpdmux.c diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h index 7cf6e4191..420ad6446 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.h +++ b/drivers/net/dpaa2/dpaa2_ethdev.h @@ -11,6 +11,8 @@ #include #include +#include + #include #include diff --git a/drivers/net/dpaa2/dpaa2_mux.c b/drivers/net/dpaa2/dpaa2_mux.c new file mode 100644 index 000000000..1d043dcdc --- /dev/null +++ b/drivers/net/dpaa2/dpaa2_mux.c @@ -0,0 +1,222 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2018 NXP + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +struct dpaa2_dpdmux_dev { + TAILQ_ENTRY(dpaa2_dpdmux_dev) next; + /**< Pointer to Next device instance */ + struct fsl_mc_io dpdmux; /** handle to DPDMUX portal object */ + uint16_t token; + uint32_t dpdmux_id; /*HW ID for DPDMUX object */ + uint8_t num_ifs; /* Number of interfaces in DPDMUX */ +}; + +struct rte_flow { + struct dpdmux_rule_cfg rule; +}; + +TAILQ_HEAD(dpdmux_dev_list, dpaa2_dpdmux_dev); +static struct dpdmux_dev_list dpdmux_dev_list = + TAILQ_HEAD_INITIALIZER(dpdmux_dev_list); /*!< DPDMUX device list */ + +static struct dpaa2_dpdmux_dev *get_dpdmux_from_id(uint32_t dpdmux_id) +{ + struct dpaa2_dpdmux_dev *dpdmux_dev = NULL; + + /* Get DPBP dev handle from list using index */ + TAILQ_FOREACH(dpdmux_dev, &dpdmux_dev_list, next) { + if (dpdmux_dev->dpdmux_id == dpdmux_id) + break; + } + + return dpdmux_dev; +} + +struct rte_flow * +rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id, + struct rte_flow_item *pattern[], + struct rte_flow_action *actions[]) +{ + struct dpaa2_dpdmux_dev *dpdmux_dev; + struct dpkg_profile_cfg kg_cfg; + const struct rte_flow_item_ipv4 *spec; + const struct rte_flow_action_vf *vf_conf; + struct dpdmux_cls_action dpdmux_action; + struct rte_flow *flow = NULL; + void *key_iova, *mask_iova, *key_cfg_iova = NULL; + int ret; + + if (pattern[0]->type != RTE_FLOW_ITEM_TYPE_IPV4) { + DPAA2_PMD_ERR("Not supported pattern type: %d", + pattern[0]->type); + return NULL; + } + + /* Find the DPDMUX from dpdmux_id in our list */ + dpdmux_dev = get_dpdmux_from_id(dpdmux_id); + if (!dpdmux_dev) { + DPAA2_PMD_ERR("Invalid dpdmux_id: %d", dpdmux_id); + return NULL; + } + + key_cfg_iova = rte_zmalloc(NULL, DIST_PARAM_IOVA_SIZE, + RTE_CACHE_LINE_SIZE); + if (!key_cfg_iova) { + DPAA2_PMD_ERR("Unable to allocate flow-dist parameters"); + return NULL; + } + + /* Currently taking only IP protocol as an extract type. + * This can be exended to other fields using pattern->type. + */ + memset(&kg_cfg, 0, sizeof(struct dpkg_profile_cfg)); + kg_cfg.extracts[0].extract.from_hdr.prot = NET_PROT_IP; + kg_cfg.extracts[0].extract.from_hdr.field = NH_FLD_IP_PROTO; + kg_cfg.extracts[0].type = DPKG_EXTRACT_FROM_HDR; + kg_cfg.extracts[0].extract.from_hdr.type = DPKG_FULL_FIELD; + kg_cfg.num_extracts = 1; + + ret = dpkg_prepare_key_cfg(&kg_cfg, key_cfg_iova); + if (ret) { + DPAA2_PMD_ERR("dpkg_prepare_key_cfg failed: err(%d)", ret); + goto creation_error; + } + + ret = dpdmux_set_custom_key(&dpdmux_dev->dpdmux, CMD_PRI_LOW, + dpdmux_dev->token, + (uint64_t)(DPAA2_VADDR_TO_IOVA(key_cfg_iova))); + if (ret) { + DPAA2_PMD_ERR("dpdmux_set_custom_key failed: err(%d)", ret); + goto creation_error; + } + + /* As now our key extract parameters are set, let us configure + * the rule. + */ + flow = rte_zmalloc(NULL, sizeof(struct rte_flow) + + (2 * DIST_PARAM_IOVA_SIZE), RTE_CACHE_LINE_SIZE); + if (!flow) { + DPAA2_PMD_ERR( + "Memory allocation failure for rule configration\n"); + goto creation_error; + } + key_iova = (void *)((size_t)flow + sizeof(struct rte_flow)); + mask_iova = (void *)((size_t)key_iova + DIST_PARAM_IOVA_SIZE); + + spec = (const struct rte_flow_item_ipv4 *)pattern[0]->spec; + memcpy(key_iova, (const void *)&spec->hdr.next_proto_id, + sizeof(uint8_t)); + memcpy(mask_iova, pattern[0]->mask, sizeof(uint8_t)); + + flow->rule.key_iova = (uint64_t)(DPAA2_VADDR_TO_IOVA(key_iova)); + flow->rule.mask_iova = (uint64_t)(DPAA2_VADDR_TO_IOVA(mask_iova)); + flow->rule.key_size = sizeof(uint8_t); + + vf_conf = (const struct rte_flow_action_vf *)(actions[0]->conf); + if (vf_conf->id == 0 || vf_conf->id > dpdmux_dev->num_ifs) { + DPAA2_PMD_ERR("Invalid destination id\n"); + goto creation_error; + } + dpdmux_action.dest_if = vf_conf->id; + + ret = dpdmux_add_custom_cls_entry(&dpdmux_dev->dpdmux, CMD_PRI_LOW, + dpdmux_dev->token, &flow->rule, + &dpdmux_action); + if (ret) { + DPAA2_PMD_ERR("dpdmux_add_custom_cls_entry failed: err(%d)", + ret); + goto creation_error; + } + + return flow; + +creation_error: + rte_free((void *)key_cfg_iova); + rte_free((void *)flow); + return NULL; +} + +static int +dpaa2_create_dpdmux_device(int vdev_fd __rte_unused, + struct vfio_device_info *obj_info __rte_unused, + int dpdmux_id) +{ + struct dpaa2_dpdmux_dev *dpdmux_dev; + struct dpdmux_attr attr; + int ret; + + PMD_INIT_FUNC_TRACE(); + + /* Allocate DPAA2 dpdmux handle */ + dpdmux_dev = rte_malloc(NULL, sizeof(struct dpaa2_dpdmux_dev), 0); + if (!dpdmux_dev) { + DPAA2_PMD_ERR("Memory allocation failed for DPDMUX Device"); + return -1; + } + + /* Open the dpdmux object */ + dpdmux_dev->dpdmux.regs = rte_mcp_ptr_list[MC_PORTAL_INDEX]; + ret = dpdmux_open(&dpdmux_dev->dpdmux, CMD_PRI_LOW, dpdmux_id, + &dpdmux_dev->token); + if (ret) { + DPAA2_PMD_ERR("Unable to open dpdmux object: err(%d)", ret); + goto init_err; + } + + ret = dpdmux_get_attributes(&dpdmux_dev->dpdmux, CMD_PRI_LOW, + dpdmux_dev->token, &attr); + if (ret) { + DPAA2_PMD_ERR("Unable to get dpdmux attr: err(%d)", ret); + goto init_err; + } + + ret = dpdmux_if_set_default(&dpdmux_dev->dpdmux, CMD_PRI_LOW, + dpdmux_dev->token, 1); + if (ret) { + DPAA2_PMD_ERR("setting default interface failed in %s", + __func__); + goto init_err; + } + + dpdmux_dev->dpdmux_id = dpdmux_id; + dpdmux_dev->num_ifs = attr.num_ifs; + + TAILQ_INSERT_TAIL(&dpdmux_dev_list, dpdmux_dev, next); + + return 0; + +init_err: + if (dpdmux_dev) + rte_free(dpdmux_dev); + + return -1; +} + +static struct rte_dpaa2_object rte_dpaa2_dpdmux_obj = { + .dev_type = DPAA2_MUX, + .create = dpaa2_create_dpdmux_device, +}; + +RTE_PMD_REGISTER_DPAA2_OBJECT(dpdmux, rte_dpaa2_dpdmux_obj); diff --git a/drivers/net/dpaa2/meson.build b/drivers/net/dpaa2/meson.build index c7c2df417..801cbf5d7 100644 --- a/drivers/net/dpaa2/meson.build +++ b/drivers/net/dpaa2/meson.build @@ -9,6 +9,7 @@ endif deps += ['mempool_dpaa2'] sources = files('base/dpaa2_hw_dpni.c', + 'dpaa2_mux.c', 'dpaa2_ethdev.c', 'dpaa2_rxtx.c', 'mc/dpkg.c', diff --git a/drivers/net/dpaa2/rte_pmd_dpaa2.h b/drivers/net/dpaa2/rte_pmd_dpaa2.h index f9303acad..57de27f21 100644 --- a/drivers/net/dpaa2/rte_pmd_dpaa2.h +++ b/drivers/net/dpaa2/rte_pmd_dpaa2.h @@ -36,4 +36,27 @@ enum pmd_dpaa2_ts { __rte_experimental void rte_pmd_dpaa2_set_timestamp(enum pmd_dpaa2_ts); +/** + * @warning + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice + * + * Create a flow rule to demultiplex ethernet traffic to separate network + * interfaces. + * + * @param dpdmux_id + * ID of the DPDMUX MC object. + * @param[in] pattern + * Pattern specification. + * @param[in] actions + * Associated actions. + * + * @return + * A valid handle in case of success, NULL otherwise. + */ +__rte_experimental +struct rte_flow * +rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id, + struct rte_flow_item *pattern[], + struct rte_flow_action *actions[]); + #endif /* _RTE_PMD_DPAA2_H */ diff --git a/drivers/net/dpaa2/rte_pmd_dpaa2_version.map b/drivers/net/dpaa2/rte_pmd_dpaa2_version.map index de95a03cd..1661c5fb5 100644 --- a/drivers/net/dpaa2/rte_pmd_dpaa2_version.map +++ b/drivers/net/dpaa2/rte_pmd_dpaa2_version.map @@ -14,5 +14,6 @@ DPDK_17.11 { EXPERIMENTAL { global: + rte_pmd_dpaa2_mux_flow_create; rte_pmd_dpaa2_set_timestamp; } DPDK_17.11; From patchwork Thu Dec 27 06:23:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 154561 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6605877ljp; Wed, 26 Dec 2018 22:25:46 -0800 (PST) X-Google-Smtp-Source: ALg8bN4YfjYw4+k9B0+PomkZ8+ePOtZWU9yh+5sv/Kl8MollwWHzDN6rRjagv1FUvCQBr3gx9JSh X-Received: by 2002:adf:c108:: with SMTP id r8mr21715025wre.233.1545891946485; Wed, 26 Dec 2018 22:25:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545891946; cv=none; d=google.com; s=arc-20160816; b=SS6mYeulEbMd9ABCvsFpZUQAUwIlr18MllDRSU6Cp541/+iiVE1dlmr+5iKH91dbhy q10xWiFn5L1podg4GPXFP6KjMhIFK4iVlIQVqvEBBxE0sEggMr6xgR2YeKMi8b0BkAR4 Sb7lOac4okhjSsqqWdj/ClZeOWqEbx7Umfv5lJsghNklPI7WRLwM3WQn1I/YL/m2VaQ+ mZytIpik/NeqleCXsmgHv08/i6GnExcHMg9ViVuL1UzJiQgzk+GIgvSKkJEYWTHl14GR yBkQVmIjLFzYFUX43NovTgZFFYto8A8aDksYD8Kane0wm7T5Xqo09epU7YNoOo87PE2J qKGg== 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:mime-version :content-transfer-encoding:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:cc:to:from :dkim-signature; bh=PC7qI6LRSzcO5yVWHOCM6HvoQY56fuN8Z2Ohmlb8lgs=; b=OpN8kn77u0DJwzhuheq0n4oseCPi2MttJGUnA2RvwadqdkdVxADPUvuNNtgAFG8+7t I79w03hfZxdNGjWj1QzHEhFt4QSSEF4BpbNOfvRDLYtYaSheEy6eBPXlEAaMRAkirC6n QStlZ6Dy3J/C8yZh6JcqrP36JBqYgOT5Oc5QbjCHTr+RbqJvQRcHanIO6luGyQzb3i+i 8By6UbCaJRiZlaC8/SWZnP1CK7WzoTuJ2vw3k45+7WodTvG1qFwcXrS2modHTvG0dsFi /SRI8ys4nhyrmPhpz+pkhI6Lw6DLBdwv7gys18JILRw1/+bZ+WpiyuTbFcLfd9v1L3wE Ae4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=qDkoMi1n; 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 y74si17278940wmc.97.2018.12.26.22.25.46; Wed, 26 Dec 2018 22:25:46 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=qDkoMi1n; 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 A245B5F29; Thu, 27 Dec 2018 07:23:29 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140042.outbound.protection.outlook.com [40.107.14.42]) by dpdk.org (Postfix) with ESMTP id F2FB65A4A for ; Thu, 27 Dec 2018 07:23:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PC7qI6LRSzcO5yVWHOCM6HvoQY56fuN8Z2Ohmlb8lgs=; b=qDkoMi1ngZn2/4lBCQDj3lzVJJBIyf7u1hmAdhnwdjCADOR/s8vHHlBNYJ6W9sm2dss8qamSPm9Oa3BC49A7hmb7++GW81o6zpKBAr/n7ML/2i6LrV2pb8hwZ5VxqTbefbRi3ma5D7Mo8UcQ16Wb+YV9/xOeH2EJLAOoFR6OvQE= Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com (10.168.65.19) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.134.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Thu, 27 Dec 2018 06:23:16 +0000 Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4]) by VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4%2]) with mapi id 15.20.1471.019; Thu, 27 Dec 2018 06:23:16 +0000 From: Hemant Agrawal To: "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , Shreyansh Jain , Nipun Gupta Thread-Topic: [PATCH 16/20] net/dpaa2: add API to support custom hash key Thread-Index: AQHUnaymVO0pGEMYYk2ingFo4fJwPw== Date: Thu, 27 Dec 2018 06:23:15 +0000 Message-ID: <20181227062233.30781-17-hemant.agrawal@nxp.com> References: <20181227062233.30781-1-hemant.agrawal@nxp.com> In-Reply-To: <20181227062233.30781-1-hemant.agrawal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.143.30.134] x-mailer: git-send-email 2.17.1 x-clientproxiedby: BM1PR01CA0120.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:40::14) To VI1PR0401MB2541.eurprd04.prod.outlook.com (2603:10a6:800:56::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0401MB2382; 6:B6DD1vgtib/0TSlxJFXmM1r2Kl6iTv2Nsoxy6x267nQ8QE9TvYQaOlLsUpGJXa3M4oooKgaBqVZ1kKiUylZkh6+Kd/6tACGktnjIGo07dYreWoAiOWrMdpulvRPittSFHHzm4MxaMYNlUKMWTr0kuAk/HET6EvoAcB/hMSkbnhHikKytSmtAC80l7QNuj7RbGp+psvT9T/7BoXwhZmbsR56OtGpBslc6sxMYchAQlxVIV61d9mz+RaPX7qBMigYPSswegRRETLvv1pBWMgZnYhP29kfAwoRbRwVjjs4m8NnvnyJQykXtLuyYBkVFC97kKHiPNyCDttX2Vyrx+D4UrznMtfJtfATTTDuvm1+Ks1CAGhoMJ4YUZq9XVe2UIgtTQ3e/VBV9RD2qQuoFzG9isv1PVXFnItP9hSqjuzY1uTgGpDYwnGe+9zBnJa1SsT4I1Hqys5XIbnxitFXdNC6zZQ==; 5:TcD0zQ27II007aacvjLwhd1RgJvNUz3ZxojIoTKPivLb0SJ25v8R3Aee1CnLBbrrYG7VUxqCMMvzdp3Y+p3gl6rY4lTOEam/RNnTqpHWjxOSXi1WTg93BjzLwPdT3ln5dS0kVqHgbwNgvW9SLX+vpmx/iBWN4+OSEEG5Th8F9gc=; 7:WfGsoBF5icaZI8k/M/NF5O6S+G7ZoTVSGfWPatF9Nh5sZDtkv51GrevtB4/Wkj9B6Ezw6Bj5EozxyoNz1JOQeQCjyBd9sFBLpnYTAUCUhqY1R6B+b7aBL5dB01L5EAVQ6l+TyITYYykjujl6QFrbvg== x-ms-office365-filtering-correlation-id: acdaccb2-91a4-4750-b7ed-08d66bc3c918 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2382; x-ms-traffictypediagnostic: VI1PR0401MB2382: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:VI1PR0401MB2382; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0401MB2382; x-forefront-prvs: 0899B47777 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(396003)(366004)(376002)(39860400002)(346002)(199004)(189003)(5660300001)(1076003)(26005)(76176011)(186003)(71200400001)(256004)(25786009)(105586002)(4326008)(6436002)(305945005)(11346002)(106356001)(14444005)(446003)(44832011)(476003)(7736002)(55236004)(102836004)(78486014)(486006)(386003)(68736007)(52116002)(86362001)(6506007)(2616005)(71190400001)(66066001)(316002)(54906003)(6116002)(3846002)(2906002)(14454004)(36756003)(99286004)(50226002)(8936002)(1730700003)(81156014)(81166006)(8676002)(6512007)(53936002)(478600001)(97736004)(6486002)(6916009)(5640700003)(2351001)(2501003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2382; H:VI1PR0401MB2541.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: NeWym7Kp5QBUgCRHvUROGPbra5I8qI0N6+8r8WGzLIq000DfZmpk0PxoKOLu18jXmVgX8rmkHpw0p/6XSaGrt6715+pCAhrdlGAUb/MAhil0t9VOd1fZqoxQUdRkwbrGZjR9xClR+l6SHKlOgMRCuuE/giSOKONVPa5TQ4qNaUu7KzkHh7drhzqO5EYcbyqMUuvFWehn2ZWm89yVYm1thZdr+RmiEXAPIXVlPV26sJ4R97zumtquqjcwqjrGyl6Ckrsl939PDlA0VHgnwZIE5rhbo5VvE8Mp8Oizd9esMzNPwndmQ6GbQ9qgRZTUu4wm spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: acdaccb2-91a4-4750-b7ed-08d66bc3c918 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2018 06:23:15.9107 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Subject: [dpdk-dev] [PATCH 16/20] net/dpaa2: add API to support custom hash key 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 DPAA2 hw can support a special offset based configuration to program distribution on hash. This is for all cases, which are not directly supported. e.g. HASH based distribution on inner ip header of a GRE tunnel. Signed-off-by: Nipun Gupta --- drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 52 ++++++++++++++++++++- drivers/net/dpaa2/rte_pmd_dpaa2.h | 28 +++++++++++ drivers/net/dpaa2/rte_pmd_dpaa2_version.map | 1 + 3 files changed, 80 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c index a6f86df8c..11f14931e 100644 --- a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c +++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.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 * */ @@ -28,6 +28,56 @@ dpaa2_distset_to_dpkg_profile_cfg( uint64_t req_dist_set, struct dpkg_profile_cfg *kg_cfg); +int +rte_pmd_dpaa2_set_custom_hash(uint16_t port_id, + uint16_t offset, + uint8_t size) +{ + struct rte_eth_dev *eth_dev = &rte_eth_devices[port_id]; + struct dpaa2_dev_priv *priv = eth_dev->data->dev_private; + struct fsl_mc_io *dpni = priv->hw; + struct dpni_rx_tc_dist_cfg tc_cfg; + struct dpkg_profile_cfg kg_cfg; + void *p_params; + int ret, tc_index = 0; + + p_params = rte_zmalloc( + NULL, DIST_PARAM_IOVA_SIZE, RTE_CACHE_LINE_SIZE); + if (!p_params) { + DPAA2_PMD_ERR("Unable to allocate flow-dist parameters"); + return -ENOMEM; + } + + kg_cfg.extracts[0].type = DPKG_EXTRACT_FROM_DATA; + kg_cfg.extracts[0].extract.from_data.offset = offset; + kg_cfg.extracts[0].extract.from_data.size = size; + kg_cfg.num_extracts = 1; + + ret = dpkg_prepare_key_cfg(&kg_cfg, p_params); + if (ret) { + DPAA2_PMD_ERR("Unable to prepare extract parameters"); + rte_free(p_params); + return ret; + } + + memset(&tc_cfg, 0, sizeof(struct dpni_rx_tc_dist_cfg)); + tc_cfg.key_cfg_iova = (size_t)(DPAA2_VADDR_TO_IOVA(p_params)); + tc_cfg.dist_size = eth_dev->data->nb_rx_queues; + tc_cfg.dist_mode = DPNI_DIST_MODE_HASH; + + ret = dpni_set_rx_tc_dist(dpni, CMD_PRI_LOW, priv->token, tc_index, + &tc_cfg); + rte_free(p_params); + if (ret) { + DPAA2_PMD_ERR( + "Setting distribution for Rx failed with err: %d", + ret); + return ret; + } + + return 0; +} + int dpaa2_setup_flow_dist(struct rte_eth_dev *eth_dev, uint64_t req_dist_set) diff --git a/drivers/net/dpaa2/rte_pmd_dpaa2.h b/drivers/net/dpaa2/rte_pmd_dpaa2.h index 57de27f21..7052d9da9 100644 --- a/drivers/net/dpaa2/rte_pmd_dpaa2.h +++ b/drivers/net/dpaa2/rte_pmd_dpaa2.h @@ -59,4 +59,32 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id, struct rte_flow_item *pattern[], struct rte_flow_action *actions[]); +/** + * @warning + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice + * + * Create a custom hash key on basis of offset of start of packet and size. + * for e.g. if we need GRE packets (non-vlan and without any extra headers) + * to be hashed on basis of inner IP header, we will provide offset as: + * 14 (eth) + 20 (IP) + 4 (GRE) + 12 (Inner Src offset) = 50 and size + * as 8 bytes. + * + * @param port_id + * The port identifier of the Ethernet device. + * @param offset + * Offset from the start of packet which needs to be included to + * calculate hash + * @param size + * Size of the hash input key + * + * @return + * - 0 if successful. + * - Negative in case of failure. + */ +__rte_experimental +int +rte_pmd_dpaa2_set_custom_hash(uint16_t port_id, + uint16_t offset, + uint8_t size); + #endif /* _RTE_PMD_DPAA2_H */ diff --git a/drivers/net/dpaa2/rte_pmd_dpaa2_version.map b/drivers/net/dpaa2/rte_pmd_dpaa2_version.map index 1661c5fb5..d1b4cdb23 100644 --- a/drivers/net/dpaa2/rte_pmd_dpaa2_version.map +++ b/drivers/net/dpaa2/rte_pmd_dpaa2_version.map @@ -15,5 +15,6 @@ EXPERIMENTAL { global: rte_pmd_dpaa2_mux_flow_create; + rte_pmd_dpaa2_set_custom_hash; rte_pmd_dpaa2_set_timestamp; } DPDK_17.11; From patchwork Thu Dec 27 06:23:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 154562 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6605987ljp; Wed, 26 Dec 2018 22:25:55 -0800 (PST) X-Google-Smtp-Source: ALg8bN4dLwTAwTrVEyW21B5oIkKo7rfVZBru3p6zvARPK3AM9WCXpC7Cm7iCT1AOzJ0+nh70gJTV X-Received: by 2002:adf:e608:: with SMTP id p8mr21012602wrm.166.1545891955542; Wed, 26 Dec 2018 22:25:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545891955; cv=none; d=google.com; s=arc-20160816; b=QIGEguaWB0wdl8p91xiUqVrIeIiqt0wTtyHYmduUwhLQVHdm5kfhp7Cki8GyBm9UCL /v8doLPZe2wl8ZkU7XjJXs4k51a1n9nQMQo7BGJmqYOoWmy3aZXehfdVw8DI/ULzsvmZ vQfOf2cIC8zictawuczf5vTEsRObmmfCdz6Ege6D+QigLxAcf0vFHcmL41+OBWg4Pjm5 ah4RTpTzKZlWcqkMJCGQssotZBqgucU9cpahmKEoJhH+Aa80lBTCuTUlj2cbO7Sguubc fbDVoFdD9CmpQsScSLrxSYjFKJfaRAUwVeOdPC1fGXubKwdjCEFAEITmyNJgAjjagjHU bzbg== 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:mime-version :content-transfer-encoding:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:cc:to:from :dkim-signature; bh=2aDGaNeeQ7vEGjoaQY/ePNElUBkrBoaoPpq/x/rBWPY=; b=Fa4GjMGreGzlpoT5W+ZoB4AmcHECe1rfOBZ6Hiom3QvYzd9VHkHBJGFe6fwYfUxN9k 2SiesQ0W+kw0yIfYUpM6YkaBGfi6NMraeFvz+XLS1ZDYz66l8Wyp6gaxOZpWA1jRbrhV eK/dOTzVjf1cP+fIzIHkceCH5/P7FQFpPNw7KjkOg/icN5gVJPkymZ0rsmNI+eCuuupW fm1JIR4Ye7LULmJE2IWHx4IjhhckqucEE5+PlPWZZfIYxdcCDnxgFmtyNttnvEiVGaHs VMMY70wMmxRNA4jqiHwGMdP7YOnfmT/gmGO1BzkEOd8MfkXrkTee2GjoDgtEUyysrz8P KTDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=JAtnGp3e; 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 f20si16776701wmh.133.2018.12.26.22.25.55; Wed, 26 Dec 2018 22:25:55 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=JAtnGp3e; 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 13EFA5F2F; Thu, 27 Dec 2018 07:23:31 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140048.outbound.protection.outlook.com [40.107.14.48]) by dpdk.org (Postfix) with ESMTP id 618E45B16 for ; Thu, 27 Dec 2018 07:23:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2aDGaNeeQ7vEGjoaQY/ePNElUBkrBoaoPpq/x/rBWPY=; b=JAtnGp3etAuQw1LKYG4jm5AA7+CgkQCIHKoY0fI6wpi9wNuqNh7+f6q9tskOPnQSyD70QjLDZWnzrL7QANezmZ5JCAZHSOTEAZ/VuzMrdjAHRtc5KIetJmjnYqcBpYbgoRvqffdoULI008w8XkOQ55TjMfw2DBzvvTqj29R7pD4= Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com (10.168.65.19) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.134.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Thu, 27 Dec 2018 06:23:17 +0000 Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4]) by VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4%2]) with mapi id 15.20.1471.019; Thu, 27 Dec 2018 06:23:17 +0000 From: Hemant Agrawal To: "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , Shreyansh Jain Thread-Topic: [PATCH 17/20] mempool/dpaa2: support saving context of buffer pool Thread-Index: AQHUnaynDRQunqOOgUOhfrRgtrLVmQ== Date: Thu, 27 Dec 2018 06:23:17 +0000 Message-ID: <20181227062233.30781-18-hemant.agrawal@nxp.com> References: <20181227062233.30781-1-hemant.agrawal@nxp.com> In-Reply-To: <20181227062233.30781-1-hemant.agrawal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.143.30.134] x-mailer: git-send-email 2.17.1 x-clientproxiedby: BM1PR01CA0120.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:40::14) To VI1PR0401MB2541.eurprd04.prod.outlook.com (2603:10a6:800:56::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0401MB2382; 6:hbbiXO452s0T/B+iAbV7ahVrL1P9jiT/Yde8oc++CLhvKMlyiNVL/xwfMZfPjmLexdRsIJb1+oeqlbur7lfFWGL4jrxsVaJnDF6WcO3zZ77epT0AmgWgvqRAO4FSxvRg2RNpngyFOQKvrYUHAv9KTWRO84uJufM7BBK/0tasYZCymxw24v3fW4RyfnirCdpTBWkByjaFO7P4MEFB01XdKRHcx8qAxFrBUlFyQZcLD/2gd3fu2H1wJxqpElVETfkLo8W3ZSdpUfxZGoUPci/4HQ/Sjkazy29+VrQWgERzcQm+InWPQu1ne16M5CVsXRuiSq2euJ+YFN6puu/tyciAXby4eaelXRVbXm26Hl5zkulIkyHmuV1emQ7ZbXMhrNgOedb3SfR28IB4qwGbfccuSXWs1s6QHGUb2COIN8yjLCdZRoOAO+GhMOcvudFKLFVfCA0Rf6KNja7QR57go2tsNg==; 5:95PB554PhIhD05PqHjr4WzkxLDdRttStrt1VxJ/EA51VSPIkRHeVnyl1+mMUsM/aTLypI/K+schhrRLNhgSW2yGDPCZII4C9YXwOLjwZMkIRUtNRXfEVK7rcv1F79JfH1RCjFvuRgJcgd4wRxZcRFl+ECxFVaiOnG71UeftLPWU=; 7:gCUjq1j5wKGXuq4uaNzunJS4TwqWnkNPzc0TBmwjdvND1F5l1qGJmGbBrYzjAJu++ZUJ1G8MYX4ptreboDbZPDvqR5NCa30rcDwhpA/MPWyh2LhL372sWBBFwd+5fMGSMsJnv5LbZ0cxuyTkoRdGxg== x-ms-office365-filtering-correlation-id: 03b9f5d2-8a38-4ac3-d4ed-08d66bc3c9d9 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2382; x-ms-traffictypediagnostic: VI1PR0401MB2382: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:VI1PR0401MB2382; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0401MB2382; x-forefront-prvs: 0899B47777 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(396003)(366004)(376002)(39860400002)(346002)(199004)(189003)(5660300001)(1076003)(26005)(76176011)(186003)(71200400001)(256004)(25786009)(105586002)(4326008)(6436002)(305945005)(11346002)(106356001)(14444005)(446003)(44832011)(476003)(7736002)(55236004)(102836004)(78486014)(486006)(386003)(68736007)(52116002)(86362001)(6506007)(2616005)(71190400001)(66066001)(316002)(54906003)(6116002)(3846002)(2906002)(14454004)(36756003)(99286004)(50226002)(8936002)(1730700003)(81156014)(81166006)(8676002)(6512007)(53936002)(478600001)(97736004)(6486002)(6916009)(5640700003)(2351001)(2501003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2382; H:VI1PR0401MB2541.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: DFpYOPzKDw3IHuNbbJ+Edw/2c97SLSmZnhDS8N6WQE7cWBsuaRcvNrUEnyQIlBeZOA00XYpey2ihGfJU4VT68PeyQHR2gCbqGG66+maP4na3GIztLSD221sezAXcSgPlTTvtuxrLNqMBbDjeWufgyCJEhzDpPyFOsySpG1yzlaecqL46673m1ZU4K2zKxs6gGrH+rPeRFNNrQ3ThRpQv5YgUqL5gwImV4mtxV6TerEgN7wkxV/sTOi4/l0bFj8Tu6QA2siTvl9D63+yypHN5kVIgyxlZ1iJZzxypsjj9l1lVm0Yzxz7qBITsYEzeGXBs spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 03b9f5d2-8a38-4ac3-d4ed-08d66bc3c9d9 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2018 06:23:17.2388 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Subject: [dpdk-dev] [PATCH 17/20] mempool/dpaa2: support saving context of buffer pool 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: Shreyansh Jain Initial design was to have the buffer pool per process where a global static array stores the bpids. But, in case of secondary processes, this would not allow the I/O threads to translate the bpid in Rx'd packets. This patch moves the array to a global area (rte_malloc) and in case of Rx thread not containing a valid reference to the array, reference is build using the handle avaialble in the dpaa2_queue. Signed-off-by: Shreyansh Jain --- drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 1 + drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 12 +++++++++++- drivers/mempool/dpaa2/dpaa2_hw_mempool.h | 2 +- drivers/net/dpaa2/dpaa2_ethdev.c | 1 + drivers/net/dpaa2/dpaa2_rxtx.c | 5 +++++ 5 files changed, 19 insertions(+), 2 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 efbeebef9..20c606dbe 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h @@ -141,6 +141,7 @@ struct dpaa2_queue { }; struct rte_event ev; dpaa2_queue_cb_dqrr_t *cb; + struct dpaa2_bp_info *bp_array; }; struct swp_active_dqs { diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c index 790cded80..335eae40e 100644 --- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c +++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c @@ -32,7 +32,7 @@ #include -struct dpaa2_bp_info rte_dpaa2_bpid_info[MAX_BPID]; +struct dpaa2_bp_info *rte_dpaa2_bpid_info; static struct dpaa2_bp_list *h_bp_list; /* Dynamic logging identified for mempool */ @@ -50,6 +50,16 @@ rte_hw_mbuf_create_pool(struct rte_mempool *mp) avail_dpbp = dpaa2_alloc_dpbp_dev(); + if (rte_dpaa2_bpid_info == NULL) { + rte_dpaa2_bpid_info = (struct dpaa2_bp_info *)rte_malloc(NULL, + sizeof(struct dpaa2_bp_info) * MAX_BPID, + RTE_CACHE_LINE_SIZE); + if (rte_dpaa2_bpid_info == NULL) + return -ENOMEM; + memset(rte_dpaa2_bpid_info, 0, + sizeof(struct dpaa2_bp_info) * MAX_BPID); + } + if (!avail_dpbp) { DPAA2_MEMPOOL_ERR("DPAA2 pool not available!"); return -ENOENT; diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.h b/drivers/mempool/dpaa2/dpaa2_hw_mempool.h index 4d3468746..93694616e 100644 --- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.h +++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.h @@ -59,7 +59,7 @@ struct dpaa2_bp_info { #define mempool_to_bpinfo(mp) ((struct dpaa2_bp_info *)(mp)->pool_data) #define mempool_to_bpid(mp) ((mempool_to_bpinfo(mp))->bpid) -extern struct dpaa2_bp_info rte_dpaa2_bpid_info[MAX_BPID]; +extern struct dpaa2_bp_info *rte_dpaa2_bpid_info; int rte_dpaa2_mbuf_alloc_bulk(struct rte_mempool *pool, void **obj_table, unsigned int count); diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 861fbcd90..3a20158da 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -485,6 +485,7 @@ dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev, } dpaa2_q = (struct dpaa2_queue *)priv->rx_vq[rx_queue_id]; dpaa2_q->mb_pool = mb_pool; /**< mbuf pool to populate RX ring. */ + dpaa2_q->bp_array = rte_dpaa2_bpid_info; /*Get the flow id from given VQ id*/ flow_id = rx_queue_id % priv->nb_rx_queues; diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index 816ea00fd..6e2e8abd7 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -518,6 +518,11 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) return 0; } } + + if (unlikely(!rte_dpaa2_bpid_info && + rte_eal_process_type() == RTE_PROC_SECONDARY)) + rte_dpaa2_bpid_info = dpaa2_q->bp_array; + swp = DPAA2_PER_LCORE_ETHRX_PORTAL; pull_size = (nb_pkts > dpaa2_dqrr_size) ? dpaa2_dqrr_size : nb_pkts; if (unlikely(!q_storage->active_dqs)) { From patchwork Thu Dec 27 06:23:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 154563 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6606140ljp; Wed, 26 Dec 2018 22:26:10 -0800 (PST) X-Google-Smtp-Source: AFSGD/UNs5LhVm/iTGKQEwlZtUo4Q/Y9HOy6G89Bfq4oMLLN94jVPiZEmWS0LT7ObbZOGrXzIEEc X-Received: by 2002:a1c:7306:: with SMTP id d6mr19552240wmb.98.1545891970667; Wed, 26 Dec 2018 22:26:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545891970; cv=none; d=google.com; s=arc-20160816; b=jMJVjazQiWWXWkhzJ0R2S0glwA4okuAkn/YkX947iN0o0qOv0Frb55iP0shYLy8UXn rvOlmoDaoU9ZmTbnue6WKbbSFPYEJkiwsXLoQe5kZPW7xEGuEG991UExnQYn8u1gceVC WPL4n/HIzdmRSwfVR4EvBUGVyhBMJrUMB+T9jsKikHE+zL0COaY+gj5eU5CeVLKiOOek q9C1dT1L+nHe02ebSs+pnv9jRfPSqWkN39ZvuxwE95PL82nNKfsm5noOGNBnHrRgCFFU bl1LpNqRP8jwhr5d4N1z/IWHUEGDJ9gVVVTXfSfVlhIi1JKxtz9X3Sgq/w1lRWJyKw5i W1jw== 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:mime-version :content-transfer-encoding:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:cc:to:from :dkim-signature; bh=hpDu1lt8PvEBP8dE9yOdvLQTk9FxnM9gxWkU4T2I5bM=; b=mMMp074DKLTCaRM6iantqeonPVclYGTtWjiPzuN9U4LH8a31MBC5sFRkmS02ijsK5M qFs+Yx/TA3ttgyV9ErtoZdaU+fW+UmfZ/I7HG2NOnY0rZ8OECotUdVwifxm/VJE/YWee 6E3m/hHrQGALUoG4jwUilzkZsql5IEYk/hJZhLQ9Q34Qh+jNKVAYUZ1686gskHZSBklt nEUDCL2UXMbcH3SUuYJjB00nlvh1TAvtMGTUdwD2iPj/y7BivghccqiUC4P5za5sg/3g 2BiBJXwBFNw6v5OjmyJH//QghP2rWqhvFDdZ4fhgoBb6kniyPxTb26gq4ef//ykNvI5K nFWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=WHVMKdHY; 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 q127si16979007wma.41.2018.12.26.22.26.10; Wed, 26 Dec 2018 22:26:10 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=WHVMKdHY; 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 D8D1A1B0F9; Thu, 27 Dec 2018 07:23:33 +0100 (CET) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70084.outbound.protection.outlook.com [40.107.7.84]) by dpdk.org (Postfix) with ESMTP id 29C2A5B34 for ; Thu, 27 Dec 2018 07:23:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hpDu1lt8PvEBP8dE9yOdvLQTk9FxnM9gxWkU4T2I5bM=; b=WHVMKdHY5tkcf9YkrpUrBZJ7ToCY1YImOKXKf0C6TnHEwpwcEhTOJrDkoD946R11WuBqM9XHC/2epySbMxptAqVFXXJddjer0FYrZOQB0cAMIC5E7dDT6d0JxM35N3n8GR2pyK5tHAthuLmmGTORyYKqQz2XKG6ATYXyONsMioE= Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com (10.168.65.19) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.134.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Thu, 27 Dec 2018 06:23:18 +0000 Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4]) by VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4%2]) with mapi id 15.20.1471.019; Thu, 27 Dec 2018 06:23:18 +0000 From: Hemant Agrawal To: "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , Shreyansh Jain Thread-Topic: [PATCH 18/20] net/dpaa2: change ref of device to private device Thread-Index: AQHUnayoWv0rlQW2jkOvr5WGqTpxjA== Date: Thu, 27 Dec 2018 06:23:18 +0000 Message-ID: <20181227062233.30781-19-hemant.agrawal@nxp.com> References: <20181227062233.30781-1-hemant.agrawal@nxp.com> In-Reply-To: <20181227062233.30781-1-hemant.agrawal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.143.30.134] x-mailer: git-send-email 2.17.1 x-clientproxiedby: BM1PR01CA0120.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:40::14) To VI1PR0401MB2541.eurprd04.prod.outlook.com (2603:10a6:800:56::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0401MB2382; 6:KjJK7B2wDsH1zKbbfOl05VT/HW2dniqhWXpECQwiEuwGRZ4SLyRzID9Uk1DO2ZrE5Yz3J0JqIzkSqEVm0nb26JHFL8zP4oRh3hev9O0vR9EwOfuvwJBi7igBVv3yMVlpJt/m2p+RA5pguLD/AjaYWOCB0Zt0dbRt/0FhdAzy7igmKbsZGllza+77oNjepoAbUu2xMsJ7O871epKY6oc35WLo96vE+vnCJOEHjgOfCjwXGyCNnE0+SN83y847z3CT2J7+RN0xD1MzUB8PKY5IORnYPVRY1bhWywESc03FPYAkaFxZkQdLHFQJHo3QiJ8WJaijZo7hFfMMCkDOsRluwsS3zKO6aKRDGIC0TIapHVxmnnDoH0sXH3na4uJlwiUvFdECzveDq+FWV5GLWC7+o++JChVF9KUTEmRO2lP9ceSsvjY1SvVlzJi2WGiZZCy8fmczLnTOPn8PAD5uCJX3Kw==; 5:QkKt2fuqaunOsRlPHqOQjdiVo1rR0jLl6F7WjRRTR+8oayrQNfpJNf7FvgqEVSAXAnRyvh2PQBdYi5dl7uKBg5dy/vF/b43zxTk8XqiVY77lSaiCdKNPNVDOs0sU6IUsPURxAwi6LdCNQrTFj6cSj93LhjzNeE2aAWl/fuGYtCs=; 7:UC+5b55B79afTdnL7kKqWnxpdIu53esI9lh0oz1upY0dz5eik1Dfnlnusa6goGAzyQaZMb4fQObSWlbIZKKRepo6GCcfTjN6TyIvJ6HPUe+8Y85EubQENums7iz9Jy/v7d2+McSkGsA7HJ1yVNmEzw== x-ms-office365-filtering-correlation-id: b13e6cf7-4117-4671-dd97-08d66bc3caa6 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2382; x-ms-traffictypediagnostic: VI1PR0401MB2382: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:VI1PR0401MB2382; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0401MB2382; x-forefront-prvs: 0899B47777 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(396003)(366004)(376002)(39860400002)(346002)(199004)(189003)(5660300001)(1076003)(26005)(76176011)(186003)(71200400001)(256004)(25786009)(105586002)(4326008)(6436002)(305945005)(11346002)(106356001)(14444005)(446003)(44832011)(476003)(7736002)(55236004)(102836004)(78486014)(486006)(386003)(68736007)(52116002)(86362001)(6506007)(2616005)(71190400001)(66066001)(316002)(54906003)(6116002)(3846002)(2906002)(14454004)(36756003)(99286004)(50226002)(8936002)(1730700003)(81156014)(81166006)(8676002)(6512007)(53936002)(478600001)(97736004)(6486002)(6916009)(5640700003)(2351001)(2501003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2382; H:VI1PR0401MB2541.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: vbFiMlplHFlEXwl61oSvJJmav9NE9g44h+cpPIA0XAHMmcEMWPqI7UxSSVkaKOxiTulviI2o7ecDhJZun4k7uonhVMGX2+wOI9WAlsyYg5DpqTke4/ad7idJ8cxrSS4Zym2InuQJtmAc/U0g05tbG8q+YuFrsOPYdbj6COP5xCngDE/rSXbC4yH9d2/0PUpo2cZYnorMywMU+6/R9Cet8wnz0wYzvbYlHIm/6ZWvBXh3Z9V0AQmk63QZYLK3/8pjLaeK7knUpIFS+CXqG6qCzFFpADrTb4WsPGbcjkl55Rwhxb2qkiaw6+k/orqGSaWy spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b13e6cf7-4117-4671-dd97-08d66bc3caa6 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2018 06:23:18.5825 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Subject: [dpdk-dev] [PATCH 18/20] net/dpaa2: change ref of device to private device 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: Shreyansh Jain The I/O threads for DPAA2 take their reference for bpool ID, the port ID and other info like qdid, from the rte_eth_dev. Further, to get this data during I/O operation, a reference of the RTE device is kept in the queue structure (dpaa2_queue). In case of secondary processes, rte_eth_dev is not same as the primary process. Thus, the reference goes invalid. This patch changes the implementation to use the dev_private rather than the rte_eth_dev as that is shared area across all the processes. Signed-off-by: Shreyansh Jain --- drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 5 ++++- drivers/net/dpaa2/dpaa2_ethdev.c | 4 ++-- drivers/net/dpaa2/dpaa2_rxtx.c | 18 ++++++++++-------- 3 files changed, 16 insertions(+), 11 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 20c606dbe..626fcbbca 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h @@ -127,7 +127,10 @@ typedef void (dpaa2_queue_cb_dqrr_t)(struct qbman_swp *swp, struct dpaa2_queue { struct rte_mempool *mb_pool; /**< mbuf pool to populate RX ring. */ - void *dev; + union { + struct rte_eth_dev_data *eth_data; + void *dev; + }; int32_t eventfd; /*!< Event Fd of this queue */ uint32_t fqid; /*!< Unique ID of this queue */ uint8_t tc_index; /*!< traffic class identifier */ diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 3a20158da..2b90f4021 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -244,7 +244,7 @@ dpaa2_alloc_rx_tx_queues(struct rte_eth_dev *dev) } for (i = 0; i < priv->nb_rx_queues; i++) { - mc_q->dev = dev; + mc_q->eth_data = dev->data; priv->rx_vq[i] = mc_q++; dpaa2_q = (struct dpaa2_queue *)priv->rx_vq[i]; dpaa2_q->q_storage = rte_malloc("dq_storage", @@ -260,7 +260,7 @@ dpaa2_alloc_rx_tx_queues(struct rte_eth_dev *dev) } for (i = 0; i < priv->nb_tx_queues; i++) { - mc_q->dev = dev; + mc_q->eth_data = dev->data; mc_q->flow_id = 0xffff; priv->tx_vq[i] = mc_q++; dpaa2_q = (struct dpaa2_queue *)priv->tx_vq[i]; diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index 6e2e8abd7..2d4b9ef14 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -509,7 +509,7 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) const struct qbman_fd *fd, *next_fd; struct qbman_pull_desc pulldesc; struct queue_storage_info_t *q_storage = dpaa2_q->q_storage; - struct rte_eth_dev *dev = dpaa2_q->dev; + struct rte_eth_dev_data *eth_data = dpaa2_q->eth_data; if (unlikely(!DPAA2_PER_LCORE_ETHRX_DPIO)) { ret = dpaa2_affine_qbman_ethrx_swp(); @@ -613,9 +613,10 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) bufs[num_rx] = eth_sg_fd_to_mbuf(fd); else bufs[num_rx] = eth_fd_to_mbuf(fd); - bufs[num_rx]->port = dev->data->port_id; + bufs[num_rx]->port = eth_data->port_id; - if (dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP) + if (eth_data->dev_conf.rxmode.offloads & + DEV_RX_OFFLOAD_VLAN_STRIP) rte_vlan_strip(bufs[num_rx]); dq_storage++; @@ -716,8 +717,8 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) struct qbman_swp *swp; uint16_t num_tx = 0; uint16_t bpid; - struct rte_eth_dev *dev = dpaa2_q->dev; - struct dpaa2_dev_priv *priv = dev->data->dev_private; + struct rte_eth_dev_data *eth_data = dpaa2_q->eth_data; + struct dpaa2_dev_priv *priv = eth_data->dev_private; uint32_t flags[MAX_TX_RING_SLOTS] = {0}; if (unlikely(!DPAA2_PER_LCORE_DPIO)) { @@ -729,7 +730,8 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) } swp = DPAA2_PER_LCORE_PORTAL; - DPAA2_PMD_DP_DEBUG("===> dev =%p, fqid =%d\n", dev, dpaa2_q->fqid); + DPAA2_PMD_DP_DEBUG("===> eth_data =%p, fqid =%d\n", + eth_data, dpaa2_q->fqid); /*Prepare enqueue descriptor*/ qbman_eq_desc_clear(&eqdesc); @@ -772,7 +774,7 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) rte_mbuf_refcnt_read((*bufs)) == 1)) { if (unlikely(((*bufs)->ol_flags & PKT_TX_VLAN_PKT) || - (dev->data->dev_conf.txmode.offloads + (eth_data->dev_conf.txmode.offloads & DEV_TX_OFFLOAD_VLAN_INSERT))) { ret = rte_vlan_insert(bufs); if (ret) @@ -794,7 +796,7 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) } if (unlikely(((*bufs)->ol_flags & PKT_TX_VLAN_PKT) || - (dev->data->dev_conf.txmode.offloads + (eth_data->dev_conf.txmode.offloads & DEV_TX_OFFLOAD_VLAN_INSERT))) { int ret = rte_vlan_insert(bufs); if (ret) From patchwork Thu Dec 27 06:23:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 154564 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6606233ljp; Wed, 26 Dec 2018 22:26:18 -0800 (PST) X-Google-Smtp-Source: AFSGD/VEzZOgNTWHvRwDSPzP/Tc8KjGNWNzs3ZKiAw/0jc9VjSvoI5KpqbT3+SxnYq6Yfrxyv5lz X-Received: by 2002:a1c:ad43:: with SMTP id w64mr19546352wme.32.1545891978612; Wed, 26 Dec 2018 22:26:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545891978; cv=none; d=google.com; s=arc-20160816; b=vesRM2NLQYHmZuMPL+mLCW8gwDSq+/6bBT/CvUgTLohBdanBTi1NWoARhJdGmBRryI BqGnLOss0lO/GNsLF4PtPxlCbO36xEZ7wXOglVEJOhlNqEf7JPyDdjxzs28sxxhajt48 p/o3v0ww4+NkOWZrALZFgkx5/VOEyxPIqQIUQEMyndIW6eKzwgJ0+qWc6xZc8/2KclCX VLnlcGdzl6HSviUI1lxImHDzdXNJphNW5zqsJ7lO3HNiirXt+hiwmGBM074fMJMrgBYS ICvDFCvCaJ2sGFn4WOsHOUdHgNXuFMsLr2Sg23n6dILPr4kjuYXC20p6xQ06opwq/yc0 n9Ag== 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:mime-version :content-transfer-encoding:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:cc:to:from :dkim-signature; bh=V0zDPId1tA37ylTk4KGJXHJqeDf5b5eTB8M7Fdo8Tok=; b=QnFaL7GB4KfvhTNztX35ovP1m1tDDoBMp1BxEmFf8mA5oxjQPlY7D4MKCZRnaFZbyD ebUceYCimd2JJwh1JqiEeyHEsRutxLnEdWF48mAJBSgZQvEBQdSS8fQRQZKWMGVlrvZh uRKkkLR+ZTgd9yoLY6o3JolrazRv0SvjyDyV0Wl8cyAQlb4ECbBY5SpTtJE/i9hEZefl weLKaVJ7wGdM9I5qyV0vnnqAFtoKRmBqkjtIpcUkKVYNVJh+wGZpGpnja1LlUoFoYcc1 xuOwvQQYDlS6UAcTM3/BuWVfLGsiamBcl66M5QbxTnCInrFWK92+7pFIn2h9lMIezfzG Z1IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=xiQPGApV; 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 l12si20119111wrg.404.2018.12.26.22.26.18; Wed, 26 Dec 2018 22:26:18 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=xiQPGApV; 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 2A50A5F51; Thu, 27 Dec 2018 07:23:37 +0100 (CET) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70047.outbound.protection.outlook.com [40.107.7.47]) by dpdk.org (Postfix) with ESMTP id 20D0A5B34 for ; Thu, 27 Dec 2018 07:23:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=V0zDPId1tA37ylTk4KGJXHJqeDf5b5eTB8M7Fdo8Tok=; b=xiQPGApVCWgEuzCvibtYk7j3ASMyrIop4r6n8fZrxSAbYsaLXD4EHu62XIIUm9+pt0sdw/1OZDckmRqxwIxJtVXXmjgMJRY8oTTi9Ew2J2TNj6oNvL7kcQ6M60ENZ3daLNiLbvrlwFiSY8bVYnhroTtOkI4EpWJyKdnwkQPX4do= Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com (10.168.65.19) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.134.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Thu, 27 Dec 2018 06:23:19 +0000 Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4]) by VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4%2]) with mapi id 15.20.1471.019; Thu, 27 Dec 2018 06:23:19 +0000 From: Hemant Agrawal To: "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , Shreyansh Jain Thread-Topic: [PATCH 19/20] bus/fslmc: add support for secondary processes Thread-Index: AQHUnaypIrgbNA0uEk2pPjfeef0FxA== Date: Thu, 27 Dec 2018 06:23:19 +0000 Message-ID: <20181227062233.30781-20-hemant.agrawal@nxp.com> References: <20181227062233.30781-1-hemant.agrawal@nxp.com> In-Reply-To: <20181227062233.30781-1-hemant.agrawal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.143.30.134] x-mailer: git-send-email 2.17.1 x-clientproxiedby: BM1PR01CA0120.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:40::14) To VI1PR0401MB2541.eurprd04.prod.outlook.com (2603:10a6:800:56::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0401MB2382; 6:V5Khm4CF07gTb8NVuSHmcmUCWNE51hAPlktYpStL/2QcqsHs34QLmnLD4iYdXeebOeD6tj1Lz6zXcX86NlZeWtaNUWiJUznp3yUG2/pmscikeQ2kK2OhHC3iTjuRBLhvRisJx6PcfsPBCnEIfwzdcW3vexrVHiU1rb7sdhsNnbYYj4rdPOy1sQD4nPaMIm8lGg8gWxRwWYkobcuOOVuiz36HDm/5mnAMJK9uy185muypb1owWUDWs+Ny3efpSs79HCfQzMfg1SwDER2ZuBFW0/8SXC9uOTsU9h4FPD/2qiBUCD7QHChbLbc5qP2cV4ILpOjarhLlz7mQAcCvu7sR3dpm6BSp4BsYFt5a7iKP3YNO5MSNTpjStczzjhxFiQUbNiQYEmm6qW5QGTK4l0CxzJBL9vmFVOLO8yy1Lh1sBosK9Vf8LAjkOK5+yvF1Z0sEtjREVRhYkdKfwxjeTGpuHg==; 5:Cp7M46sYKWCQI6FbyrsuQkxDD82nlIKamWJnDhgHHOO9uY+PHBpgveFjN4ujzmxnoCyVWtofa23T0aPfcad2PferCCD9fZLoOdD4v0yVMgDVbsqpdJ+CzaYXWiVp61qkEgTVf2rRU8v+wsQQo6was9LWX6hJWvBh6tHNxX7991Y=; 7:39wxUqeSvcfen+SIZavDwRgM+++Ehz3bXeScVwqRU3Zp+rmX8u3CaknGYHO4kGEO9mM75488uqDzkr1tQinJj3yewXTn/44JYiq0bLtGqjPSnwqjMVv7DdSE2hynMFpOot7M1LmnC5xIuXvlRrfvgA== x-ms-office365-filtering-correlation-id: 1255d6ce-6de0-4277-83ec-08d66bc3cb71 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2382; x-ms-traffictypediagnostic: VI1PR0401MB2382: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:VI1PR0401MB2382; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0401MB2382; x-forefront-prvs: 0899B47777 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(396003)(366004)(376002)(39860400002)(346002)(199004)(189003)(5660300001)(1076003)(26005)(76176011)(186003)(71200400001)(256004)(25786009)(105586002)(4326008)(6436002)(305945005)(11346002)(106356001)(14444005)(446003)(44832011)(476003)(7736002)(55236004)(102836004)(78486014)(486006)(386003)(68736007)(52116002)(86362001)(6506007)(2616005)(71190400001)(66066001)(316002)(54906003)(6116002)(3846002)(2906002)(14454004)(36756003)(99286004)(50226002)(8936002)(1730700003)(81156014)(81166006)(8676002)(6512007)(53936002)(478600001)(97736004)(6486002)(6916009)(5640700003)(2351001)(2501003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2382; H:VI1PR0401MB2541.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: TQzfRMRdrsTD7tA1C2Xk/CT5xguDyyClcmVp4JqGzqkeC+/vbbI+qEf/rkyRA9D2XAabb0/VGNrheZxRZB49PHGJ7hLAhpPF6Em15ZulzBVB/O19I1SHGoYiBkJV1+kWXqkF+GDV+1JwbxN76zgsbVggQyRJmxNav5PPVc7bvVOdOzS6sbaUGfZqX+fu4BKMux1bmAlU8tjulDaf3AJVh+kOrlE/nir3TjFGSyBH+rNfjC54aL752/4lcLG74J/ocD4sN6MZyYaYtWt8rl/fSjzptfB1I/vPNnfEltCE8GRO8WClJAuEMjQ/1ObBOHYa spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1255d6ce-6de0-4277-83ec-08d66bc3cb71 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2018 06:23:19.8637 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Subject: [dpdk-dev] [PATCH 19/20] bus/fslmc: add support for secondary processes 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: Shreyansh Jain Previously FSLMC bus only supported blacklisting of DPNI (eth), DPSECI (crypto) devices. With this patch, devices like DPIO, DPMCP, and other DP* can also be blacklisted/whitelisted. This is a required condition for secondary processes where the secondary needs to be passed a mutually exclusive list of resources as compared the primary and all other secondaries. This patch also moves the DPIO memory from malloc to hugepage so that in future in case the DPIO list can be shared, it can be accessed in secondaries. Once this patch is done, multi-process cases can be executed by whitelisting/blacklisting devices in each instance. Signed-off-by: Shreyansh Jain --- drivers/bus/fslmc/fslmc_vfio.c | 51 ++++++++++++++++++++---- drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 24 +++++++++-- 2 files changed, 63 insertions(+), 12 deletions(-) -- 2.17.1 diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c index 98768a46c..1aae56fa9 100644 --- a/drivers/bus/fslmc/fslmc_vfio.c +++ b/drivers/bus/fslmc/fslmc_vfio.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 2015-2016 Freescale Semiconductor, Inc. All rights reserved. - * Copyright 2016 NXP + * Copyright 2016-2018 NXP * */ @@ -610,6 +610,15 @@ fslmc_process_mcp(struct rte_dpaa2_device *dev) /* check the MC version compatibility */ dpmng.regs = (void *)v_addr; + + /* In case of secondary processes, MC version check is no longer + * required. + */ + if (rte_eal_process_type() == RTE_PROC_SECONDARY) { + rte_mcp_ptr_list[0] = (void *)v_addr; + return 0; + } + if (mc_get_version(&dpmng, CMD_PRI_LOW, &mc_ver_info)) { DPAA2_BUS_ERR("Unable to obtain MC version"); ret = -1; @@ -653,6 +662,15 @@ fslmc_vfio_process_group(void) /* Search the MCP as that should be initialized first. */ TAILQ_FOREACH_SAFE(dev, &rte_fslmc_bus.device_list, next, dev_temp) { if (dev->dev_type == DPAA2_MPORTAL) { + if (dev->device.devargs && + dev->device.devargs->policy == RTE_DEV_BLACKLISTED) { + DPAA2_BUS_LOG(DEBUG, "%s Blacklisted, skipping", + dev->device.name); + TAILQ_REMOVE(&rte_fslmc_bus.device_list, + dev, next); + continue; + } + ret = fslmc_process_mcp(dev); if (ret) { DPAA2_BUS_ERR("Unable to map MC Portal"); @@ -677,6 +695,13 @@ fslmc_vfio_process_group(void) } TAILQ_FOREACH_SAFE(dev, &rte_fslmc_bus.device_list, next, dev_temp) { + if (dev->device.devargs && + dev->device.devargs->policy == RTE_DEV_BLACKLISTED) { + DPAA2_BUS_LOG(DEBUG, "%s Blacklisted, skipping", + dev->device.name); + TAILQ_REMOVE(&rte_fslmc_bus.device_list, dev, next); + continue; + } switch (dev->dev_type) { case DPAA2_ETH: case DPAA2_CRYPTO: @@ -689,10 +714,17 @@ fslmc_vfio_process_group(void) } break; case DPAA2_CON: - case DPAA2_IO: case DPAA2_CI: case DPAA2_BPOOL: case DPAA2_MUX: + /* IN case of secondary processes, all control objects + * like dpbp, dpcon, dpci are not initialized/required + * - all of these are assumed to be initialized and made + * available by primary. + */ + if (rte_eal_process_type() == RTE_PROC_SECONDARY) + continue; + /* Call the object creation routine and remove the * device entry from device list */ @@ -703,12 +735,15 @@ fslmc_vfio_process_group(void) return -1; } - /* This device is not required to be in the DPDK - * exposed device list. - */ - TAILQ_REMOVE(&rte_fslmc_bus.device_list, dev, next); - free(dev); - dev = NULL; + break; + case DPAA2_IO: + ret = fslmc_process_iodevices(dev); + if (ret) { + DPAA2_BUS_DEBUG("Dev (%s) init failed", + dev->device.name); + return -1; + } + break; case DPAA2_UNKNOWN: default: diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c index cd28441f3..f377f24ae 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c @@ -418,9 +418,8 @@ dpaa2_create_dpio_device(int vdev_fd, goto err; } - dpio_dev->dpio = malloc(sizeof(struct fsl_mc_io)); - memset(dpio_dev->dpio, 0, sizeof(struct fsl_mc_io)); - + dpio_dev->dpio = rte_zmalloc(NULL, sizeof(struct fsl_mc_io), + RTE_CACHE_LINE_SIZE); if (!dpio_dev->dpio) { DPAA2_BUS_ERR("Memory allocation failure"); goto err; @@ -535,9 +534,26 @@ dpaa2_create_dpio_device(int vdev_fd, 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->dpio); } + rte_free(dpio_dev); + + /* For each element in the list, cleanup */ + TAILQ_FOREACH(dpio_dev, &dpio_dev_list, next) { + 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); + rte_free(dpio_dev->dpio); + } + rte_free(dpio_dev); + } + + /* Preventing re-use of the list with old entries */ + TAILQ_INIT(&dpio_dev_list); + return -1; } From patchwork Thu Dec 27 06:23:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 154565 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6606313ljp; Wed, 26 Dec 2018 22:26:27 -0800 (PST) X-Google-Smtp-Source: AFSGD/WUbhLUM60ThFeNQqpNFmbBkQ9L2WI5vNT0Lx7lrlXB2C/StVTOBWYDWJ4P2ua8S0kSv24m X-Received: by 2002:a1c:7a16:: with SMTP id v22mr18956025wmc.131.1545891987902; Wed, 26 Dec 2018 22:26:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545891987; cv=none; d=google.com; s=arc-20160816; b=bm5+BuR+V3xXpDWoIsP8ZtJAjRvyIdpYE9RM4iX1Ogod0tdxEGd+nsv4M4H7i5ZK1J 2YBOh0zZMuPo3sxWmQyCu6bUb/YQdUtLvkrECgSOC84Jo229i/0o1/RyacdfaAKCNcd9 yQYj4yDBbx8uy6hg7EzdV9rZ2n6cRedMNtTZk3+/sQ0Tn5LrRqDOn9W+ZSfAQYHbe6Fp +EbvXvkhE9b1FAyzPwsNiY+Zay4A0Z9NT/sc6CLS9ZRXKxX/L+KlBzqkdy8DF7g7qx7S XoM+q806wBGG0vhc9XUEoB25PdjnEljk6eS0tkliQNY+UkAgNt3ZZPPLGY126rC4m2/J WZPg== 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:mime-version :content-transfer-encoding:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:cc:to:from :dkim-signature; bh=mxbYGZFRdATfKdI4q+52DKlAgIfXLpKWmaVRjjfTUzs=; b=K4Q+Oshoz8c6a813Hk5rYz86ZST+qJBmrFpWlIzk88uj6m0oO111Wq5Wk/ZHaMeyYc w6M6BbP6TTUIinApWVYjZYhnLKtpSmCNZPOS3NoBaQBFmtjGEZjPD17K5Tc4QqPWUYhv rF1Jj/Hdt9fT10+PmeCHrxVU5bbPzWHFkssCq4LfB38dtfMW3qIxAqetnids+Kl09Ns5 PsZAcYTbsMS3PPvOGCSgE1KDiXR53cxcnVZlOi+zdJjznfCIOVm0zApvT/rGBCBUeqjF gqqZmEh9kVzPHr8Jbw2H0FNee4eSI0u2pMuvnS1kTDceW48tamyeJA7FsyfxnGtKa128 7lXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=D8bPCHuV; 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 n131si17566838wmb.30.2018.12.26.22.26.27; Wed, 26 Dec 2018 22:26:27 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=D8bPCHuV; 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 599091B108; Thu, 27 Dec 2018 07:23:38 +0100 (CET) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50081.outbound.protection.outlook.com [40.107.5.81]) by dpdk.org (Postfix) with ESMTP id C41F25424 for ; Thu, 27 Dec 2018 07:23:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mxbYGZFRdATfKdI4q+52DKlAgIfXLpKWmaVRjjfTUzs=; b=D8bPCHuVkXUv3Lsym0owm1u4Y7gYktcCQidE5dbAMJwu8miGoxqoXOA4X7cGM4BDBFwbONBlcT/m9WF21+2sJ535X90Wlt0gqBGdYosjD5AlUC3/jCst4c7TJz6Nz4YgxIztAJQssWfH1WOYFRKFEIbW8OhepMGhXHV357jL9ms= Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com (10.168.65.19) by VI1PR0401MB2285.eurprd04.prod.outlook.com (10.169.133.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Thu, 27 Dec 2018 06:23:21 +0000 Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4]) by VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4%2]) with mapi id 15.20.1471.019; Thu, 27 Dec 2018 06:23:21 +0000 From: Hemant Agrawal To: "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , Shreyansh Jain , Pankaj Chauhan , "M.h. Lian" Thread-Topic: [PATCH 20/20] bus/fslmc: add function to map any addr via VFIO Thread-Index: AQHUnayq6dNh6ksZAkOb8Dh+m1inyw== Date: Thu, 27 Dec 2018 06:23:21 +0000 Message-ID: <20181227062233.30781-21-hemant.agrawal@nxp.com> References: <20181227062233.30781-1-hemant.agrawal@nxp.com> In-Reply-To: <20181227062233.30781-1-hemant.agrawal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.143.30.134] x-mailer: git-send-email 2.17.1 x-clientproxiedby: BM1PR01CA0120.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:40::14) To VI1PR0401MB2541.eurprd04.prod.outlook.com (2603:10a6:800:56::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0401MB2285; 6:mujg29rzIAPTQfVodti7yAl1gKTM+4igNUrfkCyptiWb+4mZ0Zf+RBqAI++jSSQLMi08G+nwmNJRiKIxhvt9YAGtlbCzhtIMZt2xOPKLsa2jGsMY89eOriaAxlAHInIpp9X/+3UdtF29C0wOkKWvKhvSMgKLtkRXoCqZjO6173eDIuATv1K7OgKxwerTdQFIY0ifEh245Ux1Y1Z+xu3WW25470Vpbb68ccd/X3QlvE6sBcLEGuSLP29nOtHHMwZsuTsWYdB+SEZTG4kKy3Kmip5DZG/d/RKfMWFPbHh1iSu2tBKW5ppEedqG8mFPP7dWIPZcwZTIDW8kvmKPqiPLEmp//TAnd07583pbv6bpB3T4BHJKAV+0PULVnSdQZK2FwQw9WIzukGOZN4LuFKpYRkDvmTqTLn/chs4cTD4hs8u0WZipizqx4OxCj7Ztox7G63nZwcp4WMNQz4dnmgR27Q==; 5:AbjpgOdEnWMFbTdcOgLzybctSPxBeQzMb1Rtm4WjtiqAhvl4vgeGyHrOcqLifdjw5PnzOsY7JAUSEwzP3fjSmVhMSnUhBehV18uJQfaHv9BK2MHri9SvykpgimZpw8yAexcRPx5p/Y08APKC/FOAcXuRs+0nh40g3hy/EIwxYQU=; 7:cc16qnzUL18bxjaEL5TIfhBDNN72Mkin/38ntVLoZauaY1jtHDgqM3bcSG8Ojz+b4Agu/eN2F7FQAQLAcykqCXhPQBo0+Rox69PmRBtDlrC3rIkHXt6O7W4SMhbD6MSoGtFR1Jr7fDSA+lGfPc1rng== x-ms-office365-filtering-correlation-id: 4c05e7a7-afb9-4d7d-7696-08d66bc3cc69 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2285; x-ms-traffictypediagnostic: VI1PR0401MB2285: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(3231475)(944501520)(52105112)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041310)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:VI1PR0401MB2285; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0401MB2285; x-forefront-prvs: 0899B47777 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(346002)(376002)(39860400002)(396003)(199004)(189003)(2501003)(2351001)(6916009)(53936002)(36756003)(86362001)(105586002)(102836004)(6506007)(106356001)(386003)(25786009)(68736007)(4326008)(11346002)(26005)(446003)(2616005)(476003)(2906002)(186003)(66066001)(5660300001)(256004)(6116002)(44832011)(3846002)(8936002)(6436002)(54906003)(81156014)(316002)(1730700003)(97736004)(8676002)(81166006)(50226002)(99286004)(71200400001)(71190400001)(486006)(78486014)(305945005)(76176011)(52116002)(6512007)(55236004)(6486002)(14454004)(7736002)(5640700003)(478600001)(1076003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2285; H:VI1PR0401MB2541.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: L8cEGMPiLVtQ7iQz6rYielPPwOWW5kt2RQrLXztviJFGin9lDeZiz3Qp+EYYd4RwEvY1ftp5T86IKe9APod+nCoh+X6gsAvGjrif0K8n2pCX6TaGKI6ObAahciQYV3KxYwZ0wZs0SBhhVJO+6ZL9521fQMruT/RzEP/ZLtzJ9MXKq5ETTJ4KAy41rQb2E2Gt2ZctjlOdSWBxbMlRCiGxk51soESkqyvHnhuaRLUHdQT7Le9piqstzxmEKEi2nnZjTSXWyGAwpglqivdOPzpoPMh6FeVp9zd6ehu3F6a6TN8lO6guwrTAcDDNIGK/OiuZ spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4c05e7a7-afb9-4d7d-7696-08d66bc3cc69 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2018 06:23:21.4887 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2285 Subject: [dpdk-dev] [PATCH 20/20] bus/fslmc: add function to map any addr via VFIO 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: Pankaj Chauhan This is required to map any accelerator memory and PCI address to VFIO using QDMA. Signed-off-by: Minghuan Lian Signed-off-by: Pankaj Chauhan --- drivers/bus/fslmc/fslmc_vfio.c | 42 +++++++++++++++++++++ drivers/bus/fslmc/fslmc_vfio.h | 1 + drivers/bus/fslmc/rte_bus_fslmc_version.map | 7 ++++ 3 files changed, 50 insertions(+) -- 2.17.1 diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c index 1aae56fa9..9befc8087 100644 --- a/drivers/bus/fslmc/fslmc_vfio.c +++ b/drivers/bus/fslmc/fslmc_vfio.c @@ -50,6 +50,7 @@ static struct fslmc_vfio_group vfio_group; static struct fslmc_vfio_container vfio_container; static int container_device_fd; static char *g_container; +static int fslmc_iommu_type; static uint32_t *msi_intr_vaddr; void *(*rte_mcp_ptr_list); @@ -90,6 +91,9 @@ fslmc_get_container_group(int *groupid) } } + fslmc_iommu_type = (rte_vfio_noiommu_is_enabled() == 1) ? + RTE_VFIO_NOIOMMU : VFIO_TYPE1_IOMMU; + /* get group number */ ret = rte_vfio_get_group_num(SYSFS_FSL_MC_DEVICES, g_container, groupid); @@ -344,6 +348,44 @@ fslmc_dmamap_seg(const struct rte_memseg_list *msl __rte_unused, return ret; } +int rte_fslmc_vfio_mem_dmamap(uint64_t vaddr, uint64_t iova, uint64_t size) +{ + int ret; + struct fslmc_vfio_group *group; + struct vfio_iommu_type1_dma_map dma_map = { + .argsz = sizeof(struct vfio_iommu_type1_dma_map), + .flags = VFIO_DMA_MAP_FLAG_READ | VFIO_DMA_MAP_FLAG_WRITE, + }; + + if (fslmc_iommu_type == RTE_VFIO_NOIOMMU) { + DPAA2_BUS_DEBUG("Running in NOIOMMU mode"); + return 0; + } + + /* SET DMA MAP for IOMMU */ + group = &vfio_group; + if (!group->container) { + DPAA2_BUS_ERR("Container is not connected"); + return -1; + } + + dma_map.size = size; + dma_map.vaddr = vaddr; + dma_map.iova = iova; + + printf("PCIe vfio map 0x%llx:0x%llx, size 0x%llx\n", dma_map.vaddr, + dma_map.iova, dma_map.size); + ret = ioctl(group->container->fd, VFIO_IOMMU_MAP_DMA, + &dma_map); + if (ret) { + printf("Unable to map DMA address (errno = %d)\n", + errno); + return ret; + } + + return 0; +} + int rte_fslmc_vfio_dmamap(void) { int i = 0, ret; diff --git a/drivers/bus/fslmc/fslmc_vfio.h b/drivers/bus/fslmc/fslmc_vfio.h index 9e2c4feef..4e750d623 100644 --- a/drivers/bus/fslmc/fslmc_vfio.h +++ b/drivers/bus/fslmc/fslmc_vfio.h @@ -50,5 +50,6 @@ int fslmc_vfio_process_group(void); char *fslmc_get_container(void); int fslmc_get_container_group(int *gropuid); int rte_fslmc_vfio_dmamap(void); +int rte_fslmc_vfio_mem_dmamap(uint64_t vaddr, uint64_t iova, uint64_t size); #endif /* _FSLMC_VFIO_H_ */ diff --git a/drivers/bus/fslmc/rte_bus_fslmc_version.map b/drivers/bus/fslmc/rte_bus_fslmc_version.map index dcc4e082e..c4192d978 100644 --- a/drivers/bus/fslmc/rte_bus_fslmc_version.map +++ b/drivers/bus/fslmc/rte_bus_fslmc_version.map @@ -129,3 +129,10 @@ DPDK_18.11 { dpci_set_opr; } DPDK_18.05; + +DPDK_19.02 { + global: + + rte_fslmc_vfio_mem_dmamap; + +} DPDK_18.11;