From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50056.outbound.protection.outlook.com [40.107.5.56]) by dpdk.org (Postfix) with ESMTP id 5851F1B1DD for ; Thu, 22 Feb 2018 10:35:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=aEvYrxmxRrBQMbn6c7aDNEZKwblu9/iYJ07ubMp8Sk0=; b=wvcfCsm+NJLto8MaESEx0DtRJ/Vi7nPDSm6zYuI/UZeZEWthG9jABOJJH5SQztEIFQVlDmu3vXH1YxdbOFHncynai0HmrwMGW9D9ah0TWnFygfD15uQSK0xtFw5i99QFU3+UXiP+F5Ki3WwRskS+FXtU1q4/b7BLDSL0uCJtoCg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=nipun.gupta@nxp.com; Received: from b27504-OptiPlex-790.ap.freescale.net (192.88.169.1) by HE1PR0401MB2425.eurprd04.prod.outlook.com (2603:10a6:3:25::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.527.15; Thu, 22 Feb 2018 09:35:29 +0000 From: Nipun Gupta To: thomas@monjalon.net, hemant.agrawal@nxp.com, shreyansh.jain@nxp.com Cc: dev@dpdk.org, Nipun Gupta Date: Thu, 22 Feb 2018 15:04:46 +0530 Message-Id: <1519292089-13851-7-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1519292089-13851-1-git-send-email-nipun.gupta@nxp.com> References: <1519292089-13851-1-git-send-email-nipun.gupta@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.88.169.1] X-ClientProxiedBy: BM1PR0101CA0061.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:19::23) To HE1PR0401MB2425.eurprd04.prod.outlook.com (2603:10a6:3:25::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: a4efdf80-7086-4d70-7ea2-08d579d79d71 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:HE1PR0401MB2425; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0401MB2425; 3:leRk+4XwL5TUHiSUuVZVOYSUhLtIY5eNSgfAS2q4hYU3JkvWEPuF0G23TDxjfSzY+2RsWQiERrVdd/8rB7YE2xWgUDiqoTTIG4rrGlYG2L40H92qv5hYTIiDnc0oEI9dRTUnGLqAIMzKHrNK8Q5AlbL85EpYBJc4VCAR2IWTq614gBpWyr2CmWiPL5ekoGeG9IgVQT7l85+CoEORmQBs+TH4fysbSKv6cJjzd0RFbEvInWy/v2kZsjeM3tXLBHiD; 25:vb/Owz2v7nzthIOF8DZWpPhUJlR3fdrVS0teMj0vy2gdPTAaydy+f+FyHVFh4anad7I6PkLJxJVRSUWJcAfOZGWwEsHNmkQidp3Uk1lcVD1DaSZJ0LGQ8CsUYXYTX+nnNVqESHp2+hqLk/fkONCcXqkZtIaOvW3wHpHr3t/u0Jhf0Bmb6E+NJ/PqevdA/SUkoMXIMzEwylGMr5jp8LFtjcppIXBnOJfxT0c7TSzrNwZovDQYzKiGY7/dz01qa7BU0RyOHxbmvRCZVVrnaLBbskflCmvQj0uSO8XEGuwV69OB60gekH6J3yNEiUFMSGxaOkIMamOsdEk13Y3mgaslpw==; 31:LAN1O+iVDqE8JeEm1A9zi/vN827SDlBP8PRxG63UEbiIyrla3sYaigq8yDIIMb/S4nOMYOXbiWgipssU8ygZR+UkXxNP2E+eFuXakHynq5XYHMd9IEDjTkuvxVUXVtuX9zrvoyJCwUYuJ+fnVdQ8Vca445dCFG4Lkx1W5or0+HMx2fBzUxRjnYXA5MjZ8QtGhLBYaC+PKIwD/I4rr6IjJa+rRtdGSNwQzM/AUzl1438= X-MS-TrafficTypeDiagnostic: HE1PR0401MB2425: X-Microsoft-Exchange-Diagnostics: 1; HE1PR0401MB2425; 20:v7zIUWnxaFotGbTlN8sy8UX8B3olLIT6frc++lrCYke7BtK/kcb0QeYOlLKLVazXTpUEPKo4BPCKhbv5cXncnNcgxHA667b5cIFUO+2WHlnZEWruWbbAShga0p3bjTbHprAgtk2BGgm7G75wnLbo+GnIFoXwiVTZdu5/r1LFIBuvOAtBYTlIeUF6TRKBVtBOAZ9abUi9Nruk6/iIl1U0Oxlj5qrk6UZg6h8ZaKm4Mdlim3Gw4+DNjEwl2jIXrdGZUN+D/sN1aF8L8JimF1/7wcsWhxTQoL7YnolJ529/OFMRbYt3YGPQ0f3hKrqF9qzU0yOyhE0q54uBZATqhkQfQge4O/PCti8pZD2TkzXhQMV5XXVRvlwd/eTrlcpA8jzbF887BvFV5qYaZ7WkFoBJEloqDpsmK2MtVHc20PaShbNeOlplQ8Bno4bk36KsG8WUFsSup12Ql+ccmmWuOeupuxhXnKaDrlEekQTGfOFn1HHQ3ZX/DmcSYvCTZsClX2zv; 4:s5C6SUtXpg1fEvAM8csNEGPidwQSMvvHTIbHlHFxLA4XPwTa6ewO1kizC3HASRI3ZpAHcShiNvOQeIN/Rhq18R5VRJehPslQLslyCub1aH8qTg+/PA49SMv/Yu98uc6zY4k+ghb1qok9iCM/K8Dv9cbSP2KHgUlivPoudE7WoTgjNuX0LVmRg6HCrE8J0GDZnBG5OgBA8WfNzzQgmDX2/LN6Nk3f32UpkJUW7CWzz6MJpu0jxwKv+nFjqVHLgjz9MWokzExM3ZCfE4dTmv7WDZiUWj89PYRAWAay+b9Qiycqxjw0TtoDQWAFal9FCJsM X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001077)(6040501)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231101)(944501161)(6055026)(6041288)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(6072148)(201708071742011); SRVR:HE1PR0401MB2425; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0401MB2425; X-Forefront-PRVS: 059185FE08 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(39860400002)(376002)(346002)(366004)(396003)(199004)(189003)(7736002)(66066001)(26005)(316002)(305945005)(16586007)(25786009)(4326008)(97736004)(386003)(6506007)(478600001)(50226002)(6486002)(47776003)(36756003)(105586002)(2906002)(81156014)(8936002)(6666003)(106356001)(81166006)(48376002)(86362001)(52116002)(6512007)(51416003)(53936002)(16526019)(5660300001)(186003)(50466002)(6636002)(6116002)(8676002)(68736007)(3846002)(2950100002)(76176011); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0401MB2425; H:b27504-OptiPlex-790.ap.freescale.net; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0401MB2425; 23:zAbrltaV3C/wm0/x6rQnYhCHr3rtRbZsfYts/ej?= =?us-ascii?Q?5838g3yYHizbUpx9/sb1pDbGIa47S7tZLnCgS2An1oGhU0TrE0nIu0eeGUCg?= =?us-ascii?Q?1MBMMYo/2TZp2iC1NS+OxNXOhduyZRm5+A9JRRAGEfHiyakNjofv6d33VjMj?= =?us-ascii?Q?r37uZJFrEZIKjjZsSy9LQgQyq80cgg5+FMdh9uc0cyIfbhKa2960gjgBB3Ea?= =?us-ascii?Q?62g3tiWDtu7y3Wzdo6nDkNhAI9EcccyBNjHLTfdtACJf7VAc3kwgk8bckdue?= =?us-ascii?Q?vLKnwr/HY5uTkdyI9KD3dk4dPe4U7napyTy+FVcMmrseIMX06CEGmg4CMFCZ?= =?us-ascii?Q?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uDzP1zpKoQMpOQs3KOYOdrvRXEqdOvDvUQuXXcDUNRo4gxLyMFNWjDrmnGJMWtDBlN4a9OmMSCNsB4HCkkFuoTXSRS+aFR2FmVqTxMCDwA7n+2AEF+YRVT8Eh69d5cEu/qiFs1Nxya8mzt+vn01jRHRhZwnektLb9vED+aJX7hVzpJggiXtEnMh/99m6Dc+sPZkMoNHQJ7F07TPVtRghAZAnnVEd4Auxzn9puF7asUzJyVe7V6FEmPJRcNvHFMdc8MhhvI84VlFnH7VjcQ=; 5:ofuGp/Qz45Nb7JEzAt6KhS800LbZjC6ZbBj9Q5wrUkflEMHBjqIX/CFUAAUkCvgGlS2kqrwK41qaFJOx6tJ9z31SxXAu2/kMK+sGOFJmKrFqPFUv2FC2DNAbeTFPIHV4N2iRjfxyA6NSz+bmZdXqX7COKssS4P7vR1J/rfYMDVc=; 24:zSX86hxe6Q9dD8Ps7ovISpMr34N8Ekopu4lLtvGfKjSxCiTLCKVDjicNL0bwqdfqLKKgLIPOJoXkgGIkHi+BXCMamBEcDB/uX+AeD7bZwdo=; 7:Wx3cB0h3k5wXZnbhA2lm4GFy52VLfh+pU8MX7vROArX6srKgOBtHefnyN7HJQcDk29DuMRfCnPF/rU5xDlYHQn+lEeF44ISg7jGPjcMMZ2LxGpQPTbZCNHrYz296SnqBq31arscTuWA8mIzK1YbZBSciejOCGFSk2AVYOUFkPYx5nknWGA+zdvoLvHDwh6HnJyiW79tD7X5zuWVHfLTt+H52CCyrQbgyFAuJtSEOpVSxNg+n2Nb/JxHtfg71z36s SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2018 09:35:29.7152 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a4efdf80-7086-4d70-7ea2-08d579d79d71 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0401MB2425 Subject: [dpdk-dev] [PATCH 6/9] raw/dpaa2_cmdif: add attribute get functionality 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: , X-List-Received-Date: Thu, 22 Feb 2018 09:35:32 -0000 Signed-off-by: Nipun Gupta --- drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c index 0d98d36..9044489 100644 --- a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c +++ b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c @@ -29,7 +29,32 @@ /* CMDIF driver object */ static struct rte_vdev_driver dpaa2_cmdif_drv; +/* + * This API provides the DPCI device ID in 'attr_value'. + * The device ID shall be passed by GPP to the AIOP using CMDIF commands. + */ +static int +dpaa2_cmdif_get_attr(struct rte_rawdev *dev, + const char *attr_name, + uint64_t *attr_value) +{ + struct dpaa2_dpci_dev *cidev = dev->dev_private; + + DPAA2_CMDIF_FUNC_TRACE(); + + RTE_SET_USED(attr_name); + + if (!attr_value) { + DPAA2_CMDIF_ERR("Invalid arguments for getting attributes"); + return -EINVAL; + } + *attr_value = cidev->dpci_id; + + return 0; +} + static const struct rte_rawdev_ops dpaa2_cmdif_ops = { + .attr_get = dpaa2_cmdif_get_attr, }; static int -- 1.9.1