From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0068.outbound.protection.outlook.com [104.47.0.68]) by dpdk.org (Postfix) with ESMTP id CF3737CC5 for ; Thu, 26 Apr 2018 12:15:36 +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=JXmqcKaO2kI3X3MyPi3hRBOGPiyrGpejHlQRdazgtTeD73+xGtjDMN4hGi9Nn4gJbXM6ZC7hMqOn+IUpF0WpInAFjvvtL9cinHi+kbWYPlkZX3/CGphgV3wymRR/2hi8lSc/BBe6NgK/X+L29wdKK9WtLXfDB4y1Jj7yQ3jjzkw= 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 VI1PR0401MB2432.eurprd04.prod.outlook.com (2603:10a6:800:2a::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.13; Thu, 26 Apr 2018 10:15:34 +0000 From: Nipun Gupta To: shreyansh.jain@nxp.com, thomas@monjalon.net, hemant.agrawal@nxp.com Cc: dev@dpdk.org, Nipun Gupta Date: Thu, 26 Apr 2018 15:44:54 +0530 Message-Id: <1524737696-3145-6-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1524737696-3145-1-git-send-email-nipun.gupta@nxp.com> References: <1523111645-8076-1-git-send-email-nipun.gupta@nxp.com> <1524737696-3145-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: PN1PR01CA0089.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::29) To VI1PR0401MB2432.eurprd04.prod.outlook.com (2603:10a6:800:2a::25) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2432; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0401MB2432; 3:mlU0DzgKFsTZfuK2O/Dvov/tNbvUKXbBTwdwWrcPHchQcwEb2aJGK3UC79rfuCDsSi1XUY3CbIfJCVkZ34X/k8r0YV41nyFjy/DXldc8AKNfsXQL+NqrTiTxSQ/3zzgMBod62e5vSDA/a2PUUYf4R0Povts5/1ojvjYf7GyLfN8PLD8teY/LN9rEi6H+JCgtbYhe/t3m1amGvnL2WwZDZpev0DrKjapfO5T1wRqo9e4LOkC5CGioyAhF4QXaGOIq; 25:/UAT4uHkyUxmm6ueEkJNLTPVXci+3laoH9vTSslDC7wUKqs1Co1EEXw/hbrLd8hb0ZRTvnHbq1pGNRXyHGKUQXLlfB43GN3qi/AoBvZRUW3WPHC6jtp1QbKZny9VuT2pRhnJR/HwgK/T6dT9MmaEdZJcNyTQEM9dB2mkRBzPTUCJhCsYloOMzSmlo4Q9czC8D0Uur+nL6tcyifNby3Bi0LblboxxW+1ZVy4dJQXxxGdZib+map5ke4NUedEsQ04HNuSIUzxHOyaQpqqXzrdE6mg8XVbAhJMqF/72S38TQW06ztS0iz73Y0WdujqaLZPOqu8Vazrpp6DpxdvckuMqDQ==; 31:T2W8rXMyOYGMNxjNNkin+4e3SVR+6Q3ivWa+lmnR7o672ywN22Ck5bdIPL9lTth5V99j6T2ydGi5BE02cKpb1VMzVJ9kmyGPgFO2HgKJuGnfRyWBZLePK5B+jOn84ejvDR2OqcdP8+kkrckkW/beaUcJniq5Yc4ycvHp1WSxGPdAjWmBabuQekunbHgu0gplDY+cW4XBJZFBTOhRz8wA29LCjK4ukAiVrKYuxKquaGw= X-MS-TrafficTypeDiagnostic: VI1PR0401MB2432: X-Microsoft-Exchange-Diagnostics: 1; VI1PR0401MB2432; 20:0HYjWAfw5cxlFr679YkqU0vQVk+pgfVWGPPNC/8hJpPfBJJYOeFMwPgKFoiAsA0ai72lPoui1U0LVAX7xpuDgG/vjIFsg04fTGWNsFSAg4WKLAqatQfBcCrk6bixUzeYjeP+gvn6/dbBNwv1vI7GmdZOnOgPwLrQZy4NdFVNsBIsRiojb8QjqxoC+eK3LRq6ROksRIbgO/TjivfL5c0prJXa1u9d/TgCFpXoT3tqcSshmtoXlxlLT3cr+Zc7ErQFgDtbGc7nv8+WXJyzZt+l5EstA6l9gjVRgqL5CwF1jCrXeXVkUk2GeUBgAwXcvZw4AN3RAobnKr+SphCuMtPxKHlfKQotiU2smkYYUC3wmmlktJhzw281RMU7wvm/Qsk5AVlWjqhK+el6A1OdGqmKMDkR7MCUH4OSqEEjmHEr2YX5Jm9C4JARhK1UhOUZuBPoSDFt87xK1TxZie9WmJQ9B4/JGrzcAf/Ak/PknaHs6DDmtlZPqsTeztM5PoDmBSa2; 4:I46zR978/3txT7sNygPor1tqW6IAc5/OSUJ9ytlyEgDHzo9WcQaAc1AxXfQ0q/m/KJE5Zblf7SRy7WY7jqO94Uy2dfbioYD1Fq8N/kjCFwUGR5B0v/hoZdfSiy1WohG4UGhJgT0dRHuey2saPcoZHQrixOsThHQOTQ72sgVZzNJRhf/gPEau/UWw0NkEsxkteW4/tBTWsEb/8G/VtnfMihnPFxptck9kHL01RPHNszChb0GlDStSDQs/phFQUZjwjMmE7HAsE3Qkouq3lFCn8Ful27KDS6ihHGIjSQFdUoT8Hp4be2euAhMX2bFL/uG0 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)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3231232)(944501410)(52105095)(3002001)(6055026)(6041310)(20161123558120)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:VI1PR0401MB2432; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0401MB2432; X-Forefront-PRVS: 0654257CF5 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(376002)(366004)(39860400002)(346002)(396003)(199004)(189003)(106356001)(2906002)(3846002)(5009440100003)(6512007)(86362001)(478600001)(44832011)(36756003)(7736002)(5660300001)(6116002)(486006)(97736004)(4326008)(11346002)(956004)(476003)(6486002)(2616005)(446003)(386003)(6506007)(16586007)(53936002)(25786009)(81156014)(47776003)(52116002)(16526019)(66066001)(51416003)(6636002)(105586002)(316002)(50226002)(6666003)(8936002)(50466002)(8676002)(26005)(68736007)(305945005)(48376002)(81166006)(76176011)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2432; 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; VI1PR0401MB2432; 23:njgJSTGlKZksvoHNO20ci6QLFxsGk0o9otEZaK0?= =?us-ascii?Q?eLao6FjD9ggg22pjg+v0tzMZXUFS+67jVPVhvtqYAys2b67H2P28xld2Swts?= =?us-ascii?Q?qSntWm5MweSPfQi5tsjul+g0pMzZGb99TRAdxsh1WvWAGbOMH6ZUaSnbelW/?= =?us-ascii?Q?/gWAcp9Y1mTSO2iSg5AauJJOjApL59TtHBxys5SNeUqGiocueF1UyeiOQ1jc?= =?us-ascii?Q?XEriJWkG8OFCxIhdMkeXANu8q0j5KH/o0r/+RUSY2GDnMLbPSPuwNlE9Ev++?= =?us-ascii?Q?Y7vqKsvTw2b0fhJ4sCwT373ruRkFi7k4GrzOWVBS5hCox/tt0jpFy2wpuQDJ?= =?us-ascii?Q?aAABODl3vzDv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ascii?Q?HGGgqIx6HTIHzd2eAiuI=3D?= X-Microsoft-Antispam-Message-Info: elomKgyxViN6ObeJsTer53cjSLTaerx4vMCm8wxOaH4dQQjUmfTxG9TRBCdr5WICfA0S8ysmgCM1kLq5nygNXkc3wXqmmCUnp49UZL2zD2mZcJ7Z9kRs3BZsoTIsGCJn1UUkegZp/lxRz/WGCF6oiBoi9ShgMZ+fKR3kzPkL3NEXImI/msH0sOuuxZlRbNvo X-Microsoft-Exchange-Diagnostics: 1; VI1PR0401MB2432; 6:AR+38JWmA8zJOXM81bI6aP8GtcA2OaMag4VZpDQKUOsAGxfk7uTf4kOU6B2zti5ZXwON5UbCpbotAqG0tQmgZaJtrObhApqLJEapv7336UMpKcPGjZe1MSkodc5AtCgID1eNQMGB69Ys673dhoqj3cMRddW7X2eOxreT4BpZ4AYWq3VoDBgkvsQ4PRIMPl4Qc02aK1hyR//Q/tMqBKlYwaV/jGBG2qXZXASY1FWHNX0aCXC6BbqLKC/K7zLeZctPF2wAnGCHn0sRJPASjxw5GDm27bhVcVzq80LRV90W3pcp09hdqaDipvEjO31SUw3DFMJRU7zEudDzWtBhKbOVD629/NH2VUHL81d6/Hkz58aN49A0QgCB31bVZvVWsBRgQbo0nt5w405iur4M6hFObdEnI2cEJNffylcHlTOyhnPrkSea9WeVSdBmwMk78EOqdCE5qxDJUwaXyvuKb6bXig==; 5:FRBjZxDyuVyu/H9DwBj2XbQFk/ovgC8M4rSA/FcdqI/xwgM0VkWhkGP6X8kY6ddNKpM1uINi8t2Yki+FzgYVleqc/lc/0S8JAGbSNMifZE737XBCyLnnROsBQxVEVyyDVGhlb80tgMVFxbeeZikOhN8+E5FgVNzBJ4yIo+kmKZ8=; 24:vPOiFeAyOE371peznU0FVgrruQ9B15HAslnv/E94X2eNf0XZxuFZulxE1gAaj86NXdYSCVQIbllcYCjPbcmByJetCwJvbqSJUKrZJEWPdOs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0401MB2432; 7:I/F3lJ3cyV2TOVqL6a+URXQrqR6hbCHuw818DvYiYh9cLPH6UPrEsvS6eu4cV8Ysyoe/FZ8T3XUAJpUlciuOup+CeaXuE+HR2M0YSOhpbhCafOYO6ouaxoUkEYVO9llHpdpG8Kq+OQTT0Uuv6jBGGSn5Sm2df1HriC14Ou9wDKxQ3eVrh2k6QeZRDXUxAUs4Mce9aM+mc23m2W+Zn0bkEmdIt1t/iIOlMz40iNDJwd9oQPrPCKJh6lBCzL2DkY1h X-MS-Office365-Filtering-Correlation-Id: 102b4827-b4af-4584-4be8-08d5ab5ea6aa X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2018 10:15:34.3622 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 102b4827-b4af-4584-4be8-08d5ab5ea6aa X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2432 Subject: [dpdk-dev] [PATCH 5/7 v3] 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, 26 Apr 2018 10:15:37 -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