From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70041.outbound.protection.outlook.com [40.107.7.41]) by dpdk.org (Postfix) with ESMTP id A5AEA14E8 for ; Tue, 31 Jul 2018 12:34:15 +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=ymd/ik5A6jw3Npzr1f7aCmK5+mxuYC+2mFQ87SD6V54=; b=W72NVudePsZAcFE6IP3qz2E4ID8BlQTD1iNqk9pQzQ3MCm3s/eXMFo7JIyZq+Wt2EhBASglgZJEKKooYFU3siiEffdsiZent5++WrNd0Y/mP3LzLO4dFo4UiFSqcRsaBJhi6uoxLZJlg7bKqm/A9ipG7VH9P2lVNJPSOy+nWeiI= 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:13 +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:03 +0530 Message-Id: <20180731103303.14988-3-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: 1f8b62c3-6131-40f4-8950-08d5f6d12977 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:AqtSwSasAbbeHPVCT6LsxCaxXDCgyvg841XI6AiOgUmsJ2n7N+9+rRfgtX41MhEINX7sLnS5GgSi2fyjNJOE2bDWl/Aixc6m4jL8qO2rHN/DBrQXRPWbix1a70vf0MFnjmmzmI9oCdQ67d7uiAHzFn6LiJApxfKZYPJ4DpQ4AWEkHVC56xCd4Ydx+79xDrPtZOB4gmeIlJFXhmFaJraNqO784miktrLm6FaQpiRoJDw2upGIg3I9GzNJbjU9JO2B; 25:2DANnxFoywr/k06g2Lhm6j4r+2QwhiuxBpd7WVQ2dz8u50dERMEkcxIqkm3kBlfwq5NOlF6n/wNVj4506d3SPHw4a0Qb2Ngxe7vGtB6cQwHcyc/SrrjZ3zXlAM8q5Oxg2rzXid60A2ckJP0mZ5D714rc4/feeD/F6iQcz5NzNjbTXaRRS9o/n6XM6Rm2k4+9eSvUcQmh8t2OqUKEZ/FMfmo67LkwiXL1A7Xc6ycmOC3WMW/Z1ytvqUF9I6Mo1idfXUS6Ab3Ci5C5EmNtAQ01T72p+GmtR83Xe3rCvngnYBL9KifwrixyLoS2NG4xtGTdbiYjsG+ZVd8GINdAiwAxPg==; 31:Wv4WeKu1J9Dtg0ZMqHx1dnZspZ6lTo1VecbUcS8clE3caGNMjwk/SGFZCUqFunaADxXskwXCCaZCqC/JhwOzLp6u8gsq3A++U9Kl21WksZIN8MECXJomPvPgb9LSvfqQZN1SlIBWtcvvbK2g0tFUPNXNpMf0EYEPtUBtib+TYiNuGzQ/q0k50ku76MNu/1igKeRTiatGN3g5a52Wqp5UCfX0E6P4vRahLzB3sF9nqaU= X-MS-TrafficTypeDiagnostic: AM0PR04MB4675: X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4675; 20:y229tFY+2ysyOIlljUh6nYkH20qYWftw1CkURY5JlMgthgn7HnyKZ2gwwbXxVWdzIGsQFTwKlznd4rQbroVqTTWk2jhtjzrfaqgv7Y17elaWp5CnrW1cODgK0Ck2N5QlUBi7iKSZqARAE+PoYZSSdne4RWh5JwoPL0NWqwkSJk4bX9Yubwir6AtVMQj0lFRpDJPMf8CZbMtbKGqVu6XEZtVeW1swFpRP99hGm9+2cgZkHrUiEo+dFbSDJRQ2T8heNnnZPSlm98RNlzR0EU9JCnAr3mBqG7+qXbJM7x8zn1An0j0JXIC4W4ZivbIxAH37nxIDw7Z/y1yPQaH4Mh3M+YAwDfz4TPP9xG+uNhErhYQ9DscSM3dh5uovcm1aZX238gqmvh2o4fXfJZHBCp70JV0YQ63mMM3MMLuYzfIX8nV9fDJum1qvos5kchxNTwoktuqbBMDXDsV2PcB/JPluXgR0J3nUw4wzdbQs97gVQoSyA7Gt+kWSE8hVt1SfrH1Z; 4:bw8MKJHWQ/P9Ddz3uXHW7wdEwF6GeOTfchCezX21KmeXibqkkWnTrNAaQbp798KiBAhDyq7SjNm8I1MTaUZxijOabefggQnB1s0cLtdehZgtAnIA8CipW9OfVXhRM1by/2KQ6QVyeR0ODqnRoLCsOs14yEMxy9lSGslHKctXYTLCcFvGUH3JY7QMmKTQMuGqbbu8C8X5rUthNnPizNTOuF5dtLrIV4CN/k8WT65P2E5JX3TjloTDe2U7O4svj751kp2YTQbZPb2K44AiHhXzmVoF26rqSp0sMpKE2zdFX3B4HVGmNQMnyVMtuiT/26CI X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); 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)(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:bk7yPjYm/pWEqR4ItM4EaCmh6WbAhohaCDkNjZpEV?= =?us-ascii?Q?rPxPaNSxUI8FPaKs7pB9tsagATGWzirO8Jh7eGEfHU+Bi+UznFpphvT0M/BU?= =?us-ascii?Q?M+fLJ1Xqwwuk/yZrLyyFCXrjlO2F1LRJmYv6zOtbaMdWBxRwrsW4uKgrHhya?= =?us-ascii?Q?9D9GG2e+PNP3QEezHgAu/GMP3VJjKzWiFZO1fsecvJIxES0i5gINI8vshXsd?= =?us-ascii?Q?XGsWe4d1r0unAIYY6LKdHI7v2cMiGsGf5EW/pEXuPdQ5zNA9jK4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fIPGViSFNnpyl7jp75OFqYDaiBioAVI6PnNpAPA?= =?us-ascii?Q?ukwRVRi/2hyXauRyzV/0S+n4blfnQZeKBSpUGpD66C3usWCRRSQKHRAdJeOa?= =?us-ascii?Q?UR+XrtCWgMql/y0OUVuH8C+Q51tpO+CBZXcDTnlghX3Lpklmu8ZlEHgkHSjl?= =?us-ascii?Q?p8LPGTCPI9vy1gEDmLfcfY=3D?= X-Microsoft-Antispam-Message-Info: ykdGfh8SqOJLosdVoXZyfukN0/EryYG7rnukxOj2bqgsDzJvZFOLBtpWGBrL2i5RvAjgi0/OIuS+QEtdw1WXA68B4zlDe8icj7a399f5SOAWtx9NAmdstkDxAtnZe/ZK4O8jnggRbo0rhBIygaVyDqc4wKqELbTepelikdv8b79c/mlkB/6DOBCzqlzCXj487CuNgn3+t2rIFBUyx3pR6dwDrIENxmqKmpLDjrKtDPqV+BnEMe+AklvmYqgF7DRYsWRYjygIDtELSJr0tkINeRusDz03F/mnDt/EFlC+k0wPahgqpFy9Wf6LzDlCyvcxCQUaxWUfXuTk8TLXw0LATclUPMBv9WZIPkKzLAjMrV0= X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4675; 6:9LheyoAZldNtJx/XDSPegEORQyRfI5tkBLjkcyWPqlaYugE4R4Ae2QNk0QprGmWSNJdimUuCRua7IcRTj2sIAN/apkAb6YZD3rAk1SjDiyUufLfj/qmVFDPI4rfyu2gzdfWuXewViZBmH2evLqo2VZnAkXo27gyefiUGGjHMJo+zfl+N99le93tsWPuDzkDo5Dy1kWHLOiMPjVRCknDdePgUlmaJ5lamJdSgxxuY2GB4OZCiegmyPzZsB7w1fOLRZQnWo1FtNt7H7csGQ0eKoQIBABDoG8ND4W2zXO51nJWLtrHqZiMzKCxV304R2BwF+0xdye/qGOKGgMc+WK/KVqIFenM2S3+USrdPNcru0tm5LTcqHmJBWinf+Qc3Ve10AqMdIeyRhH/UB+7KGB3x2OQn+12t2UV00P1i+AHN/gu4lPc+uNvlleUABHQpRIgfnGRZ5wvgUugWuwafL7o5Fw==; 5:hz13ZJgcyC+KQmKrdCYkbKUtKV5Ne1Y8frFEi8U5V45uRFb3d2IDEhJ0BH+i/VbUg5l2sbeTwWPnA+qxbaBuhh0OdzJeFUpF3mXJbckjmLeSviglxtnxABmbIrMjWR5my1BiIE/gW5CgecCEZOfS1TLVV5qv/ZTmNg+Iq1sQXfo=; 7:9fF8xfhG/r1l4MWei9vjeX3KzYLYgL46wgYn+5uW9ESeRq3Kj7atTPQ0eCLXMDfhHO02P7qz0ajo65NW4HWXAes4RP3QBIBfExVqTOWLYJiQDHf/BUmLoDZJvWmYpcXhlIXSzK1fK5v03SQlSgjKHjBwLLAca4orMCG2gxARsZDQV33uv4/eYTyMNJnvc1nHyoCAgosm05VBWmdshoE2CM/axt/G07a1GtVonYyVz9fYaxsHoexrT0QLbK/WD2Tt SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2018 10:34:13.6263 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1f8b62c3-6131-40f4-8950-08d5f6d12977 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 2/2] raw/skeleton: implement 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:16 -0000 Use the rte_rawdev_queue_count API in skeleton and add its unit test case. Signed-off-by: Shreyansh Jain --- drivers/raw/skeleton_rawdev/skeleton_rawdev.c | 13 +++++++++++++ drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/drivers/raw/skeleton_rawdev/skeleton_rawdev.c b/drivers/raw/skeleton_rawdev/skeleton_rawdev.c index d1489f8ec..6518a2d9a 100644 --- a/drivers/raw/skeleton_rawdev/skeleton_rawdev.c +++ b/drivers/raw/skeleton_rawdev/skeleton_rawdev.c @@ -305,6 +305,18 @@ static int skeleton_rawdev_queue_release(struct rte_rawdev *dev, return ret; } +static uint16_t skeleton_rawdev_queue_count(struct rte_rawdev *dev) +{ + struct skeleton_rawdev *skeldev; + + SKELETON_PMD_FUNC_TRACE(); + + RTE_FUNC_PTR_OR_ERR_RET(dev, -EINVAL); + + skeldev = skeleton_rawdev_get_priv(dev); + return skeldev->num_queues; +} + static int skeleton_rawdev_get_attr(struct rte_rawdev *dev, const char *attr_name, uint64_t *attr_value) @@ -524,6 +536,7 @@ static const struct rte_rawdev_ops skeleton_rawdev_ops = { .queue_def_conf = skeleton_rawdev_queue_def_conf, .queue_setup = skeleton_rawdev_queue_setup, .queue_release = skeleton_rawdev_queue_release, + .queue_count = skeleton_rawdev_queue_count, .attr_get = skeleton_rawdev_get_attr, .attr_set = skeleton_rawdev_set_attr, diff --git a/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c b/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c index 3eb5c3a7b..3405b8984 100644 --- a/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c +++ b/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c @@ -193,6 +193,18 @@ test_rawdev_queue_default_conf_get(void) return TEST_SUCCESS; } +static int +test_rawdev_queue_count(void) +{ + unsigned int q_count; + + /* Get the current configuration */ + q_count = rte_rawdev_queue_count(TEST_DEV_ID); + RTE_TEST_ASSERT_EQUAL(q_count, 1, "Invalid queue count (%d)", q_count); + + return TEST_SUCCESS; +} + static int test_rawdev_queue_setup(void) { @@ -429,6 +441,7 @@ test_rawdev_skeldev(void) SKELDEV_TEST_RUN(test_rawdev_configure, NULL, test_rawdev_queue_default_conf_get); SKELDEV_TEST_RUN(test_rawdev_configure, NULL, test_rawdev_queue_setup); + SKELDEV_TEST_RUN(NULL, NULL, test_rawdev_queue_count); SKELDEV_TEST_RUN(test_rawdev_queue_setup, NULL, test_rawdev_queue_release); SKELDEV_TEST_RUN(NULL, NULL, test_rawdev_attr_set_get); -- 2.17.1