From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70083.outbound.protection.outlook.com [40.107.7.83]) by dpdk.org (Postfix) with ESMTP id 2338D2B92 for ; Tue, 31 Jul 2018 12:34:14 +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:X-MS-Exchange-SenderADCheck; bh=3ZnQn8IFSLWtp7PnXIqiRMVqzvLlMwVf8zxLgvxUdYc=; b=Ad6winR2gubUt41hO+X0hGxEJ7fw1SXDVwjTMWAljAqzl06+S5VWnfq6BNfMO49xpYIOkDzp4RksS92c8cfK5d219g5ixEppxQnEcl6ujm1o9teMlf8zSpXpnFengWFwKDPUiKzPD2YaeC5wgDG3hyGr28fiS+ZRujrer+xYvHU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by AM0PR04MB4675.eurprd04.prod.outlook.com (2603:10a6:208:75::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.19; Tue, 31 Jul 2018 10:34:12 +0000 From: Shreyansh Jain To: ferruh.yigit@intel.com Cc: keith.wiles@intel.com, hemant.agrawal@nxp.com, dev@dpdk.org, Shreyansh Jain Date: Tue, 31 Jul 2018 16:03:02 +0530 Message-Id: <20180731103303.14988-2-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180731103303.14988-1-shreyansh.jain@nxp.com> References: <20180731103303.14988-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BM1PR01CA0105.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00::21) To AM0PR04MB4675.eurprd04.prod.outlook.com (2603:10a6:208:75::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2e7e4e7b-485d-4efc-ce0c-08d5f6d1289b X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB4675; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4675; 3:w2yWFUweTrvTdVbmVmuyReJtQSXXseIp6Z/T/rzPocCONnDK8mQTWBWtSB8aVcfXix5v/kzbVh88sq9mdv8YiEMirCz9qRNUzth5EoCGIGBZkraH31q1wVzz+DzAnytZYGEd+h2NOGcBmRDXNt1+1PEY/wjq+H+hSxHALOL4Wpcv5aist8XzEiNF6YRBQCMn1sgg22I47NCfY9GfMKXTQy7d5Vwv2FEy9lXAogqBZsKM8fgh9UNBaGoa2x9GTsRT; 25:x63pNgdFmZh0e4HVwoV8cAPNbY9saRx6TJcYqc6j7E0igGGn/8ScLbt5Hy/b4MvkmNJGNNxgc0Qo4eLcv/o9ZVLbKFWCZJq7aQm/B2/6+bcgtMo4e9di6IR4pKnS8NsURXvXDib7XzhuszltA1+4UwBDOwQjLW5H3z1JynDnLLr5KPQZ2Eznjj1cdRk8pW4twpvSSUaZ2c4v08lLPtZIt0iQrNajUjEPqAO9lPVpiN7KabUQOZBRvN/uot3Fkx674x2emAd/WGHMwVaYQEiTyva538ol7ZgNnevGp7aLncfuxwvXi9XNzqIN+2Z8I+9GpmpzYLvke2C+qNerjeo7mg==; 31:sb5Iqs9RGh7W4F2+RO5vVmF/CtSK5VIG0IkQNJeaEPZQs3qACxGsoJqHW5D9k4nM2ukpsfG95FEqbhhG4gAFFLdfLOXbu08hvSX8WIwOWGt5qVfcUDWuQP43QeAP39WBp3MibYd/szVn69wBznAs+PpskhYLoMXNfLfGLfX5NPGl8/HSVIZQdCKv0nw+f6g6dYF8u+3YtHYAwED/lXixmmjbNgZG1o6Aen2JI4W8sVo= X-MS-TrafficTypeDiagnostic: AM0PR04MB4675: X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4675; 20:ngKEMU+KcIvhzySYm2iq/6U3jSI2WHaTCxoc+9oVrx9ItZMgT3rtQk4d+xn8tr22XEcbYQ9ojulk1yOk+x6NuptMrW1WtndyR4La6Mm0P5+O94Pcjo77527nUjirgjW5xWoRxmX5S3gs7axlQwRSt8Ks8lI6quG03bnHhB9QL71LbvVdnUJHUSE5qSm69Fe0KYIKIPJ2eoMJIOThEaKvpmNoEFt9glRjKW+THE/FNGcmi9dCaZU0cELyIXqx0gGD2Ga7joRNAJmRRAgf5P/Yy2oQERzO1la5mw46/4MDffAIU/uMd9dw6DHUa7XxZ3dkkpBfUTeMqvOnEW4vUZJLkQ5CoAjb+Hsx/f4zxsUbXxul4gEZXYMfpSS9GirHCcLOOIOc47/jdmA0+iCyaWMbKvpx3XfNYXYiw23cfuStxDfJmi81t/0xRA1YHmGzpnww0Edv8G4qRnLPSyAqr8Bg9ZBsBMJ1jmv4+1ej6eONr+U2+tO+jvvVSQHZyJcHCxp+; 4:z7W58GKDpiz3DsG/DaTqd8fwk5qPl6/wo8T/FZEP2QWchLUtrt6nHo+bEspX5Vb69COq97MkqZWxVmRbTXtoDinEceFeGozofbmuPWNGVGRNAnFWoabRsdpqNCK5ha/O5kHF1umOdLSCvOvsdKUI5BEAcu89f+Y4QDxovJiKR5YAIfZ8J0x//NbJIBARuy2dGsFx6hXpBAMhOwWTwWElcRAO1zplf+aXm9e7k+qJWZ2dtA6HBY428G4RIaOYxlZWeJtNmeHQRCqO/aOTDa5ODI8XVQnTJj5mg8vHJY3DJCRF9PYDn0oQcO6zc+zYi17XEQjQjX6ulKAa5Ij8n2lqxzI6fCyZYYOG6DCNjZJr0Yc= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(228905959029699); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:AM0PR04MB4675; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4675; X-Forefront-PRVS: 0750463DC9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(136003)(376002)(396003)(366004)(346002)(189003)(199004)(106356001)(105586002)(956004)(53936002)(6506007)(305945005)(386003)(4326008)(25786009)(47776003)(2616005)(6486002)(66066001)(6512007)(55236004)(86362001)(2351001)(186003)(6116002)(2906002)(3846002)(97736004)(36756003)(478600001)(11346002)(48376002)(16586007)(68736007)(50466002)(5024004)(16526019)(446003)(26005)(5009440100003)(44832011)(51416003)(6666003)(476003)(76176011)(7736002)(52116002)(1076002)(50226002)(81166006)(5660300001)(8676002)(6916009)(316002)(81156014)(486006)(2361001)(8936002)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4675; H:Tophie.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; AM0PR04MB4675; 23:LsFI8KtPaW5jrMs+3oAg2bDhV/C/bf/Fp/FRCnXsd?= =?us-ascii?Q?Ubw+M8oy0hR0mhmCrBSqWNxHTC2Pm1cPUZUDtQ1YkO0owoAF8exzSsQY+3EI?= =?us-ascii?Q?9SkZDmm0wZ2xYKo8mn3VD+to43QVOR3JXQUpSYFHk3xfXU9i+f9SJRNe/2sP?= =?us-ascii?Q?jC3jW07M3xd1SeUzvqYZnB9ydzJPIGHYZ582W7zy7u39McvKs2EZFSuLyGP7?= =?us-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LZhNboHGEe1bO7SGQJz80wpIuoyCTRVkjdTiLwvJzfBr12SreVGVDPGJCtvwMthKaEhBKLfP4hhoXs5IVsE7t0lAcVRReoVakskUE5UPDqqV+A==; 5:edIIrv481OzacY1IH6J3VtGssDhrfhiYuFL2jJxxjf2v9F9WQbLg0nmgiOsiJONt+yYr1fkKYH8OJ8p/PqUgmRnoFRNpGRSUamClyQ9u9CC2cePRO60myxlZvzdKG3WnKUYGnHevF4byStpCm5pMUiznrY8kDKcoOKTJabM6KDk=; 7:gtZtVDB/Rh/y7eE90wwYyHE9RASPgfuMh5BkMdhZdLz4EdDXUVhT1sazogucNhz5KYI4vH0OmQxcU4BlZqOtlma1RH3xPT/FpiS61STG2zWBmncfpVcdX4Kl7GyS/fNVP29qSe/RXJiCpmeI51ud1lDiwvHTvAb41pPjT39TY1e+2+bxpHuJssnq1KLrTAWU3swyl6E7K9o17IaNLDPPxzMy0XWkt5BDwuBpA01bYtUS4Ie436hQBkBjjmlX8iZe SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2018 10:34:12.1782 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2e7e4e7b-485d-4efc-ce0c-08d5f6d1289b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4675 Subject: [dpdk-dev] [PATCH 1/2] rawdev: fix missing queue count API 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: Tue, 31 Jul 2018 10:34:14 -0000 Rawdev queue count API prototype was declared, but the definition was missing from the library. This patch implements the function. This API is used to query the device about the count of queues it has been configured with. Fixes: c88b3f2558ed ("rawdev: introduce raw device library") Cc: shreyansh.jain@nxp.com Signed-off-by: Shreyansh Jain Suggested-by: Keith Wiles --- lib/librte_rawdev/rte_rawdev.c | 12 ++++++++++++ lib/librte_rawdev/rte_rawdev.h | 1 + lib/librte_rawdev/rte_rawdev_pmd.h | 20 ++++++++++++++++++++ lib/librte_rawdev/rte_rawdev_version.map | 1 + 4 files changed, 34 insertions(+) diff --git a/lib/librte_rawdev/rte_rawdev.c b/lib/librte_rawdev/rte_rawdev.c index 7378bfede..62b6b97ef 100644 --- a/lib/librte_rawdev/rte_rawdev.c +++ b/lib/librte_rawdev/rte_rawdev.c @@ -172,6 +172,18 @@ rte_rawdev_queue_release(uint16_t dev_id, uint16_t queue_id) return (*dev->dev_ops->queue_release)(dev, queue_id); } +uint16_t +rte_rawdev_queue_count(uint16_t dev_id) +{ + struct rte_rawdev *dev; + + RTE_RAWDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL); + dev = &rte_rawdevs[dev_id]; + + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->queue_count, -ENOTSUP); + return (*dev->dev_ops->queue_count)(dev); +} + int rte_rawdev_get_attr(uint16_t dev_id, const char *attr_name, diff --git a/lib/librte_rawdev/rte_rawdev.h b/lib/librte_rawdev/rte_rawdev.h index 7988e76af..684bfdb81 100644 --- a/lib/librte_rawdev/rte_rawdev.h +++ b/lib/librte_rawdev/rte_rawdev.h @@ -182,6 +182,7 @@ rte_rawdev_queue_setup(uint16_t dev_id, */ int rte_rawdev_queue_release(uint16_t dev_id, uint16_t queue_id); + /** * Get the number of raw queues on a specific raw device * diff --git a/lib/librte_rawdev/rte_rawdev_pmd.h b/lib/librte_rawdev/rte_rawdev_pmd.h index 6d6cf14a1..bb9bbc350 100644 --- a/lib/librte_rawdev/rte_rawdev_pmd.h +++ b/lib/librte_rawdev/rte_rawdev_pmd.h @@ -250,6 +250,24 @@ typedef int (*rawdev_queue_setup_t)(struct rte_rawdev *dev, typedef int (*rawdev_queue_release_t)(struct rte_rawdev *dev, uint16_t queue_id); +/** + * Get the count of number of queues configured on this device. + * + * Another way to fetch this information is to fetch the device configuration. + * But, that assumes that the device configuration managed by the driver has + * that kind of information. + * + * This function helps in getting queue count supported, independently. It + * can help in cases where iterator needs to be implemented. + * + * @param + * Raw device pointer + * @return + * Number of queues; 0 is assumed to be a valid response. + * + */ +typedef uint16_t (*rawdev_queue_count_t)(struct rte_rawdev *dev); + /** * Enqueue an array of raw buffers to the device. * @@ -506,6 +524,8 @@ struct rte_rawdev_ops { rawdev_queue_setup_t queue_setup; /**< Release an raw queue. */ rawdev_queue_release_t queue_release; + /**< Get the number of queues attached to the device */ + rawdev_queue_count_t queue_count; /**< Enqueue an array of raw buffers to device. */ rawdev_enqueue_bufs_t enqueue_bufs; diff --git a/lib/librte_rawdev/rte_rawdev_version.map b/lib/librte_rawdev/rte_rawdev_version.map index f5be52df9..b61dbff11 100644 --- a/lib/librte_rawdev/rte_rawdev_version.map +++ b/lib/librte_rawdev/rte_rawdev_version.map @@ -16,6 +16,7 @@ DPDK_18.08 { rte_rawdev_pmd_allocate; rte_rawdev_pmd_release; rte_rawdev_queue_conf_get; + rte_rawdev_queue_count; rte_rawdev_queue_setup; rte_rawdev_queue_release; rte_rawdev_reset; -- 2.17.1