From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00045.outbound.protection.outlook.com [40.107.0.45]) by dpdk.org (Postfix) with ESMTP id 7EF981BB22 for ; Sat, 7 Apr 2018 16:35:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=aEvYrxmxRrBQMbn6c7aDNEZKwblu9/iYJ07ubMp8Sk0=; b=tEmWdgT9+gumIRZ4srcowfYXObqikfa1irrlAJLf8LwDAuqjt/ZvforAFZO98l1/dgVcUg8S1tHK+L0RdgGvH/3J45KAwhV8PPZnau1a9t/TqUWLro4Ww2dBOPQZMwkwZ9YJ+tOMbpUlZ1gYI6yZjLV8sfiWRbm7L70AUUP7xi4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=nipun.gupta@nxp.com; Received: from b27504-OptiPlex-790.ap.freescale.net (14.142.187.166) by DB6PR0401MB2424.eurprd04.prod.outlook.com (2603:10a6:4:4a::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.653.12; Sat, 7 Apr 2018 14:34:58 +0000 From: Nipun Gupta To: thomas@monjalon.net, hemant.agrawal@nxp.com, shreyansh.jain@nxp.com Cc: dev@dpdk.org, Nipun Gupta Date: Sat, 7 Apr 2018 20:04:02 +0530 Message-Id: <1523111645-8076-7-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1523111645-8076-1-git-send-email-nipun.gupta@nxp.com> References: <1519292089-13851-1-git-send-email-nipun.gupta@nxp.com> <1523111645-8076-1-git-send-email-nipun.gupta@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: PN1PR0101CA0017.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:e::27) To DB6PR0401MB2424.eurprd04.prod.outlook.com (2603:10a6:4:4a::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 008c45c5-17b4-4b18-63a5-08d59c94bddf X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(48565401081)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DB6PR0401MB2424; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0401MB2424; 3:YVVi9AgrhU7C48T4pKKwX+R5VSTq9ZJqC9wc5i8hlVVclb9PGtBFuYUTD0Dixqs8p3shPvfAoshwSv843ifuXgrQM6XlnY24g/zfyOyLiFFs3bVnjd916q8yMKw3CMtgJwxCOf1C6/OZXM16cTvL4tE1+VixiwAkoIX68iFe4UWdhXn9pKQm99kguiM987l+zJ4ekT25v4tLARaW8iEHdFn1TQ1qvr4WfbvSusIZEd7GrRb14tYpoQvP6ZC1wis/; 25:E2ZwvmTnUgGlA/UI/2TPLVYVIuDwd+WK+bC5X+PCPy9dt8uSiffPz0LkYQ8eYPKZWHw8LI8KNKlfdE7ddm3+1rk5kITDpQYUwAhT5F/++N8CTwkQWe6a5KSN5dHebipkbt2znbMY7UOYyo7MoTi6/EO+5LeJT8gty2LXq4KBkX/TV6C1WZzSg+zaG8v+HjB1HkEzdbnL774LUR9FczHHEpdbQT7gQtTJcrfE+rEbgHDngnJcoDSOgY0XGemJp9uoKDUVTszPSCzl8LnlC74VX6FC+aTCt+M6mbxPSUW4ZlrYLfyt1gINvg0lJzUKGjr4sBmdaEGUkH5qZRbyfywQew==; 31:IyzYa+ScrrrdgDFmTOO4Ya4TKnzpJ8SUmAYorB8GPAxxou1eDVKBLA6bNP+y2PnS3FJNwvP6WvJgmvXfI2jaot/ppzTa3o4YghknjM/I89fYLIMCgvygUQx74yE5dZr2dEG9BEQUWvcyP9XXjRkr9WTArm4dCsttdEwb5DRvKVQKTqcxcgmq1YUDO9Yf53cRQ3fASlvWwslQ7bMCMEGzQsfZUPLC06r+yiHAs+9bHsI= X-MS-TrafficTypeDiagnostic: DB6PR0401MB2424: X-Microsoft-Exchange-Diagnostics: 1; DB6PR0401MB2424; 20:qn2lIyyXzgS5vhGeXXtP3QKT2iF+50RGnPjpEZzJOqBzDabsafJLohIujit1OOIF05QNXLn6qG5OGpr1Ip+W+zjJqLcsSjjKMOMqKhzAxGW9Dyh235+lVQswEaFHcG8pIVWj6kEcLv/ydTDueQMbFgoTC/h7eSRWD6b64hrF5QrDVj9DpyuEdVOpNgGlSzrTExFnj5xV2FKZWa7xBlh1eIpvO0x5Ly2vI6gw0Ad3+2ff/BhnL7RSyHwFIUVQ6kgmHwqx0xOqKPNjm0huUx46EXGE7+3+XvhAuLXA4Ah9jP/PTQY3rX8iMky48/XNb24wsdiczz9mt1wlDryB166EDbZNAHAQKRGOuDrioDR+et/FoIAcTB5hvL8YsclMQwFfJM1fuUDTW7jOOanrtn+CzNmDZD49qexhXy0D/fCXzif84wBaoou32DsypfVKMNzF3iDFS82RWacAl6aPW/+CcDa2ThGXPHcDKjdhFsaDq9/AOTw/hQf4uwooFWgIRRWX; 4:FPu30yV3hFuP/MWg1EG4c7O1PvqimGXQ3CjUmvARgkn7eS2+oO6Qdy99Rvm+6dc5cxTUgoHXIwu2S651O4dXUX3LBougWzRcVlXtKvlYbLVV9F565CSQdhD0czIO0X9ig9F/AI8qD31T87OjWyGKreyQfgwF3BErL0QI4vVJtaG1ycx5ZLEH/N5JCcCjcZK0+NPc8rx67DUuAQ95tC157gY/GEvEGWP5+D4eRjzVDuX9fJ/YJv1kpER4t+oM2HhBqB9Q74c1cIC2CzFSNb30Ciah5mqosPP10KWrLE9POzCZUdm9k4P81lq+VE0s8M1t X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231221)(944501327)(52105095)(10201501046)(93006095)(93001095)(6055026)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DB6PR0401MB2424; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0401MB2424; X-Forefront-PRVS: 0635D5275E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39380400002)(366004)(376002)(346002)(39860400002)(189003)(199004)(105586002)(26005)(446003)(5009440100003)(48376002)(50226002)(186003)(16526019)(53936002)(47776003)(50466002)(52116002)(476003)(6486002)(36756003)(76176011)(305945005)(86362001)(66066001)(6512007)(6116002)(2616005)(51416003)(956004)(2906002)(16586007)(3846002)(4326008)(7736002)(8936002)(478600001)(81156014)(81166006)(486006)(11346002)(5660300001)(97736004)(316002)(6636002)(55236004)(6666003)(8676002)(25786009)(386003)(106356001)(6506007)(68736007)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0401MB2424; H:b27504-OptiPlex-790.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0401MB2424; 23:tm7O6bzWQE6CmO9Xp0zSCPZGD+HYMXSFPXz40kr?= =?us-ascii?Q?J1EvEVIvjNcitk0aBq7m3RHTgDbvhQFREOAwpa18qCwnnYYEJuiWcU1fKvoZ?= =?us-ascii?Q?x01mntoJln/jmifYwdGyQACWf/MWUI+idq/nyF1TZ+XRyLFN/wiqUzDSX/YK?= =?us-ascii?Q?RWAqfSV7bivIayI6JyBaZgeQcq0f0j1L4qdgR0oomR32VS3ue1/nJ03vaQy1?= =?us-ascii?Q?8Pri+iNK94q0IxR6NLYF46FeOv9Mv1ZSQcruv0FXXCWNHTqSwu+EtiXJCNxY?= =?us-ascii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ELQwDYhAegYUvo1y9YF316Nn3vhjutORE8yNu7cOCGfZq+FVNQRMe2lWtXYjI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB6PR0401MB2424; 7:Mm6cU48KbMmHSkatLSqphf4dOlWERSpR/zYwqTbBb8FJoxjzzpeI63KtTSx7seo0Td7yLKEXatP7VNBFKTm4GwRBD2ZuZViO72ATwHkkDkNZ8ecZ7wupczbW4rpC/AIDSAr6uNEWy5GjY256lhi4cS8iX8a1ZY3LuiTn/zKKM81+jl9czPylG/slSJZFF7jJga1mLPSv8ZoQ3bHMmufTp1dCgaz8lU91uaPxndZsdaLrOiEnOdtkVeiUYpZXeSvh X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2018 14:34:58.6482 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 008c45c5-17b4-4b18-63a5-08d59c94bddf X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0401MB2424 Subject: [dpdk-dev] [PATCH v2 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: Sat, 07 Apr 2018 14:35:00 -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