From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0075.outbound.protection.outlook.com [104.47.2.75]) by dpdk.org (Postfix) with ESMTP id 311F42C19 for ; Fri, 4 May 2018 12:12:03 +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=qKhJScfs5c3f+vxYOktwNOM/sX4gjjn4SlElmEB0RXI=; b=V4rTrWHZcqer8rp9ZqVRn6BuJaOwe0EFAb7TD+aNe26if7aKDAWctnUS/c6lOz4ipHTz6YNLgbdher2xOJVCw1Y/LnRMamqkV6BLZB20EZzDnYo68mXvVjhNz78zdwWA0vyN/0UxaSrodmaL6t2/NYUlmxzu+24BqyebgP2msYM= 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 DB6PR0401MB2422.eurprd04.prod.outlook.com (2603:10a6:4:4a::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.715.24; Fri, 4 May 2018 10:12:01 +0000 From: Nipun Gupta To: thomas@monjalon.net, hemant.agrawal@nxp.com, shreyansh.jain@nxp.com Cc: dev@dpdk.org, Nipun Gupta Date: Fri, 4 May 2018 15:41:27 +0530 Message-Id: <1525428689-8076-6-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1525428689-8076-1-git-send-email-nipun.gupta@nxp.com> References: <1525365233-5956-1-git-send-email-nipun.gupta@nxp.com> <1525428689-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: PN1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::11) To DB6PR0401MB2422.eurprd04.prod.outlook.com (2603:10a6:4:4a::25) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DB6PR0401MB2422; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0401MB2422; 3:S+OAY56n5RNmy+GuN51RUIPzwV/1lK9undAi0bmPv+l/BMbSvZEjfuAUXdnuzGEw49dnrsk8HN/xnjqJPM+B3CHJf1HQs58OnxErpsu3NOehF0Q1eaoMyd72QcxXNm9nIIw5Rs8YbM90EX1PdVeBtUQmcKJHcGandoVKgncN/5uBZ3OwZBMBfQOG5rt2U7QBL+Y4lu3jyQVriImaX2+YuTvCwwZ2cv/xlj2HJYxfU+lnaV3QqF/aUB5ky1Ff9N+e; 25:SPiiYSdrSkpJwDjVtYxJzzqsgJMyr3gRIXXe3SeqNRcPGgtkmvx2u4EnLEMv8pvevIXGWdIwLWXlwxBKpucYYATACZW9I22Oyapz6mHHU4MKOeLvRWEih2eJYuRiZONPBj5QSdVELAz7mMkC9sZEh2PeB6vOXtrFB/dPYpBScbqtbFNJOPM6UEniKOLfuO9OsqIiP1Sfx395BjNOppey4rP/4SV7UT7q7yZLYszNUYOiI86yg+dzNV7L3vYtQtrgZ/RUeIj+Vs456YQYyBSBcqhFNmkzcIXaunZpDeQv3ZUa9PBez1eICWK9f7OJiMjZFN8QWh+c+IXOaENy2f0r2Q==; 31:5Q9mhIttzhleH9wVBW7z1SmE8RWhinOnDk4WXUyqVlmdJZveokVYWTdCIbMuyXouYEcwW9cKtBU2YLpvAsyTOSLCLOzmrG546TAz6wF7kIuHVdZxPmlwyDc8La/owR//FkBrRgsh763X31jZhVFsvDP4AansBPCv/yHMTetmk4v9HCS3FYJBRGK3MxKcsRMC49/xdb8Sd9m09S8bKvGx1CcU4UutWLk8hM1FMpMxjH0= X-MS-TrafficTypeDiagnostic: DB6PR0401MB2422: X-Microsoft-Exchange-Diagnostics: 1; DB6PR0401MB2422; 20:xeHGsHWsUKm1ECRLMvtsNgMpc+wxfuVrU1G6S2qxkslezX9TB71PE8ort/qqc8HlcOWQT7fDBwN8D4qKZY92fV3AnMGYLckUTSxbzyp9gMs4bqH7Vs0hT4hqXRvAtsuFCHqISjfbJod5ieW5YdEpYG9BWGEOlwytqQ8WGkV3URQdhQ5WF2nk3vb4ZhhSlHY3KIunXeX/LxjctWsOtXy8bijsWhgr7b0oC1HLEg0sm+yXxNpLBGRRC/xXgA0ZmmxLG4VifRsjT1mV8rzIv/Y9byIFy6jsdZ0x8zuD5/wGx4wBgpdZQLixgBkZJKW4V6PpYSYXSfj46eA/eMSNMKFDpwvG3qEl1VEo7fW49aMh38Da41TcUdx5rFpBl1QMNTBuC0kRU2xC5jjRVIYIliD9+qSvdUwCR10s4n35NuRuMt3xfxlp9pzwguyESvrXdb3H92ne1WvDX8R0mjrVLQtQoozhSLUjdBtW4HzeA3RG8BrMWpH3lhZ8HPSfZCAcd5gV; 4:wtlv811WbBI0dV2fqzvlgA/yosQ2/0uDxc8AGc79QNTTRKJb72SG39Q2JzRxWJN0CryU0+PjFqX15x7J8GUvuONBMDD8Vqd9BTUhPRYRsK8YH5E/BBkW6Saui0JHFnAq/zbxnwql5617RbJgIPprBYGrB7rwQWxUvDiNlZdDX3GyiwvAWaWSBVijc1/e90TC4bcMGbKRIJsGT5aFfDupCGBk4JeSlunFZ1Vn3xTHzeS3hwfJTCdUOvtSfXI5TUPySiVHV3VUkJ/TfGsSWELoFtLaGpK2y6isAPZ1IBWw8m3dVYb+21JPdiQ13c9FOlw9 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)(3231254)(944501410)(52105095)(10201501046)(3002001)(93006095)(93001095)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(6072148)(201708071742011); SRVR:DB6PR0401MB2422; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0401MB2422; X-Forefront-PRVS: 06628F7CA4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39380400002)(376002)(39860400002)(346002)(366004)(199004)(189003)(51416003)(53936002)(59450400001)(52116002)(4326008)(8936002)(105586002)(386003)(305945005)(6506007)(26005)(50226002)(55236004)(446003)(186003)(81156014)(5660300001)(76176011)(8676002)(5009440100003)(11346002)(25786009)(68736007)(7736002)(44832011)(106356001)(316002)(16526019)(48376002)(478600001)(6666003)(476003)(3846002)(2616005)(6116002)(16586007)(36756003)(6636002)(81166006)(486006)(956004)(47776003)(6486002)(2906002)(50466002)(86362001)(6512007)(66066001)(97736004)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0401MB2422; 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; DB6PR0401MB2422; 23:N+GquUWxhObrCyO0lCtmFx3TNOEqVT+sv57cFPz?= =?us-ascii?Q?+U/mMtuXwiL0SISlhX29JCIJ/6BD1A0oQJKafSwop4vIozZgCMT2m/nThEiV?= =?us-ascii?Q?0KGx3AmmHPm3k2DC1OYDS5P2eQVLZ/CG0XyPpuQtYWZkd0KndJ6IBiy+N+vS?= =?us-ascii?Q?fCHSCoMs0XSWvOGHHOhVBMtB19veYOa393aQQaFMUJ88Ppwk1xs9CHetzJdE?= =?us-ascii?Q?peTpm4mmvZ0PrZAvk3tfXASw+dSNthfAcOH5z2kWrKUyuqS0BGqkaWtX6DOa?= =?us-ascii?Q?IvGDEYZJHyxd0iUsPtHNO85cDGOAhOCVPphIJXtDjnsR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sUb+xAjt+lK72Wma0hAE+671Ex1kevDXJW0gdVdV4Cs+6AyEG43EAHYiSH2zx0wx/Da1qvqZScR/U8lO++/q9hUwRYXuCc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB6PR0401MB2422; 7:j9EsSQuF/9cZ3zS99/InzovKWZNOb/RUtsgR79A8tOy0kr0N9kr+uL5iqVXEz0TwezJwtmL9yUXVPqVxibyIspPrzMr0aaRq4A3D9XvCe7BKBU9V89kSwnypYQRRVLYMNXW3JUtfjT8a0poQfy/JtzUfnaBcQdPwTAbiB8uNkpQBfxYzWWAajBmD2S2I6CFN07824ucUA8DxUXf+xXcWU8MHxtdj29ZSYKbjt+L7KrAdT0ocRgaZVcfU19YH0wC6 X-MS-Office365-Filtering-Correlation-Id: b12b6df8-0b58-4a7f-e2bf-08d5b1a77b57 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2018 10:12:01.8554 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b12b6df8-0b58-4a7f-e2bf-08d5b1a77b57 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0401MB2422 Subject: [dpdk-dev] [PATCH v6 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: Fri, 04 May 2018 10:12:04 -0000 Signed-off-by: Nipun Gupta --- drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c index 789fe36..c16bb12 100644 --- a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c +++ b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c @@ -28,7 +28,33 @@ /* CMDIF driver object */ static struct rte_vdev_driver dpaa2_cmdif_drv; -static const struct rte_rawdev_ops dpaa2_cmdif_ops; +/* + * 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 dpaa2_cmdif_create(const char *name, -- 1.9.1