From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40081.outbound.protection.outlook.com [40.107.4.81]) by dpdk.org (Postfix) with ESMTP id F04F64CA1 for ; Wed, 2 May 2018 19:16:05 +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=nQc/pp8WaQjzlnG0MVWBSMRw8lChu/ezRG8/EvtbxOo=; b=vlGqpqWA6D/rqaNEweroNgcTUNKRF+BnLW9iaikK6eIHYpH2TyZnT+K+KsSILdEdIWVebNVqQBWcmB9AARsyJbMZdK6N50E/rg2iOILEY6m+x5F1JW+71UBX0Y67Ii9uc5eYXCvkbNfVmxFCiLCKqn0irnAmkaAfDDLOLzkC49g= 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 AM4PR0401MB2419.eurprd04.prod.outlook.com (2603:10a6:200:51::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.715.18; Wed, 2 May 2018 17:16:03 +0000 From: Nipun Gupta To: thomas@monjalon.net, hemant.agrawal@nxp.com, shreyansh.jain@nxp.com Cc: dev@dpdk.org, Nipun Gupta Date: Wed, 2 May 2018 22:45:27 +0530 Message-Id: <1525281329-27984-6-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1525281329-27984-1-git-send-email-nipun.gupta@nxp.com> References: <1524737696-3145-1-git-send-email-nipun.gupta@nxp.com> <1525281329-27984-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: MA1PR0101CA0001.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::11) To AM4PR0401MB2419.eurprd04.prod.outlook.com (2603:10a6:200:51::24) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(5600026)(2017052603328)(7153060)(7193020); SRVR:AM4PR0401MB2419; X-Microsoft-Exchange-Diagnostics: 1; AM4PR0401MB2419; 3:uRXJ0nbrm5Lj5b50IljOokj9fyDxM5HG9C1j5yUSlcWttOZ/uO191VA5bCYXcKuT86SHyRZLGKWVnOBrZuYdCpEQbBO7Qr9puhweXeEeJ7en3MmxGcRyNz0uXUHVDNpzs+RWuCxl6IZWKiINoTgzcF6Cl6eBfduzCBOjaVdsKUEvhKrPaZwQDCo7yvCM70tGU1ZvJAQPgje9Mj6KRN58YqpwxNJDrMM68gXihSQT/n+kx48ZUQ8uQ5EwHxLnXwtH; 25:+vu96zKic49w3tcntUDFih6LQWeBsMHB6H1mp4aiUrByg69PSVxuPBtscvDgsKVq22330IJjIu8IFeo7sC9DZdrOKvAvj7X7NkeXS22aLvJmp4DWPZ98QtaMRX0C0WnmMrrpNsNXu+pIcfzuH3G1BcmhcYtpAAIwFYuPEw7xRDmrNO8MGqbFMufb9bL9E0wFNdSqkYoCTyXaf0lKYjSJP/uz5LrWt+N98aPT4q6d10lkWQmYiI1sHorznaqhU+TudBQ+NN/Jw+tEmx6lT23Qh4kMw5TQJu7lSsWhq7enhJ7aHJUQBvtBekj7wQPexC9mZSamtJHvnpCF6AcNr0BO+g==; 31:QIb9CTpUUG8qutGqRtPrgMKMi1yLCO482c/wAAR4Ox6bb/Lvm1zl1fDHa3mPZSeqUv8tSM4LsTudEcVkFP4gSMRz6tNm0B1ea21EA4H7IW5OYHPoM5ng0PDA/6aNcqilOlzcSuCEfbhxQxw+RWiiETd41bwbgf3Jq5RH9jzH/i6xAafw5A+9VSGK6VC9NX0P3+LoXxy52Nmk1/lxKD9iTgExBuMrwwwrWhsBgT7p6+g= X-MS-TrafficTypeDiagnostic: AM4PR0401MB2419: X-Microsoft-Exchange-Diagnostics: 1; AM4PR0401MB2419; 20:Z1itp9ieckONGIYGAomKL+WoDDrHNxm7zA177MBV71Ti/yGantwBLE6EtqMQwmCNNRVgwnxQREZkW7fkQtSwbkPUHC10Ai8EJHHunR0HzdUMaiJ9uhAAi7JHiKKXD0LSVhVp9eeOjWpLY86VZeBNLSzNasfH38gIRKenjKNIowc/B7qHHtgQA01OJeLZRuMI+AqeYzby4UGZNIPX+MCAjUYFDi1HPUkphyhmhJVlqCFm8zcN9T2pyHCpdS3aA1RNLMDb+xutprDXNxgaeB0md23ACI3Od0rdXfmZDEN3OvFH+yKsrq9UiLE+PeESpZ0yG57TYhTaGnwjwhiByF5S8HkQ50WgUrBzKUpuiLFwyUuMOgv5qj+7022l4zzaqS7SwtevOu9Ad9ALIw6ZsIVuXHVuFJg2VeZszn36xaRH6mcLpj1g8w16WlJ8kTlWyVY8tYhl/8QwV/gYgyAec7WynUF3xw3sanUQ/372VmZi7rCtj4SGirdIR/XIAbxJ8nbM; 4:DezA+ObZ+SI6Rci3EEvN/2lKnJqZRYEdOXvZ0O/gubjUOfbcfxIc84RvNW0sVkskub3Z1KqDG5qeD8E0Vl0EDnZfFmJXw1n6JHL+sNEG/tmEauDtR0UuHX2U92GeblnodFgdltSOBUZOzi8+qBzCXdGb2pwgFvwTN4It4ui+j7Rp7a/ZhartiNyAwr28YaQ7ilefCuXQSQMwIZyZfc1aDmn1pSt81Aqy5BXmVXW0DmCgtwttX9CQxC+J9ffACK/2XRdG9Bb2/Tcic1RC1FPq86X7o1oOhire8ItMv1opmdiglxRhzLZuRi3pHB8hjUu6 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)(3231254)(944501410)(52105095)(10201501046)(93006095)(93001095)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011); SRVR:AM4PR0401MB2419; BCL:0; PCL:0; RULEID:; SRVR:AM4PR0401MB2419; X-Forefront-PRVS: 06607E485E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(376002)(39860400002)(39380400002)(346002)(366004)(199004)(189003)(956004)(316002)(16586007)(11346002)(3846002)(5009440100003)(6506007)(305945005)(4326008)(6636002)(476003)(97736004)(5660300001)(7736002)(2616005)(48376002)(53936002)(50226002)(86362001)(6512007)(50466002)(6666003)(486006)(446003)(386003)(6116002)(36756003)(55236004)(47776003)(51416003)(6486002)(106356001)(8676002)(2906002)(186003)(68736007)(26005)(8936002)(25786009)(81156014)(105586002)(16526019)(44832011)(478600001)(81166006)(52116002)(66066001)(76176011)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR0401MB2419; H:b27504-OptiPlex-790.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM4PR0401MB2419; 23:wcPxqQ5ZQ+kV44AXh2IQlfz8OLizrDg69JIdFZh?= =?us-ascii?Q?PdlXndjp3b8b/ieGccxdAfno17dDardPUMZtFLgcfQqTMWc9J4QKaDkmUfJI?= =?us-ascii?Q?HsfjDmSIICeVE4mJQiRnAPK7Xb4p5q2pvPx8++smQy91jufujzczno5yRbh3?= =?us-ascii?Q?MpHlMUmWx3ka6c4EszQrZjlIBVmHi5JExYSksahmDH54kaB5klc2WIalBDXt?= =?us-ascii?Q?KZQJNd6EeiQAXnUWHM+7s/iJgPunvSXBHVOExKBz5Kvv94guqhC4KOnOrJdh?= =?us-ascii?Q?4mBRTpf00+zSo+TVDdeTWNdl0iM/n+PBVrRnp2mua6J4gHplH0YCvNN6Le0a?=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x9uCBtQB6a46Y8AERDWkfrxFzLxUc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM4PR0401MB2419; 7:5OE0kq9gJjMFcHY9A21EWOTKQag0Y0Q2cBkY6XnDQE6DZIkEEGGFgwUWJaNJ6Bvz8oijOPMb0mmgQU9Ycx9Q+MBx+6MnR6Sru1vCx1WSmnmmiKl4sf8HlWgndUhXLkQKKU3yzI9XPCvjWsgcrQ7gW7GFWmH90Age4brhGTP1ZrQcdWiBUnF73Oa/YSeuGYoF+Le5mHddZnJx1NGePaS8o8jJ15hoLvOSS44eln/EuMgj9xSEL5OahcHY0Xf9WELr X-MS-Office365-Filtering-Correlation-Id: 9292b543-9700-4407-c393-08d5b0506322 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2018 17:16:03.6626 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9292b543-9700-4407-c393-08d5b0506322 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0401MB2419 Subject: [dpdk-dev] [PATCH v4 5/7] 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: Wed, 02 May 2018 17:16:06 -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 e3e2b64..bdd7c16 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