From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0057.outbound.protection.outlook.com [104.47.34.57]) by dpdk.org (Postfix) with ESMTP id 91BA0237 for ; Mon, 11 Sep 2017 18:51:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=szS+Um5YsAPUWxsXEKJvlSQ07BCzY8OB8oRh0bSSR64=; b=WdUwzRR5Xwapcq2ZsQ47sgaN3KxBuRqtZVNUFLqXxRK92Yy5JEbl4kMVIkQqkXyHUr01ilsbawCgJFg8B+wbx/jfNOxWQ87r1EDm+UwfovqLDUrI0O9sIv6ruM6d9x5Nm9465I78KzLK11atDvaVrVKw/ly7HqL7oFDej9ycb7M= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (14.140.2.178) by BN3PR07MB2515.namprd07.prod.outlook.com (10.167.4.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10; Mon, 11 Sep 2017 16:51:44 +0000 Date: Mon, 11 Sep 2017 22:21:23 +0530 From: Jerin Jacob To: Harry van Haaren Cc: dev@dpdk.org Message-ID: <20170911165122.GC21422@jerin> References: <1504883894-43451-1-git-send-email-harry.van.haaren@intel.com> <1504885015-44642-1-git-send-email-harry.van.haaren@intel.com> <1504885015-44642-3-git-send-email-harry.van.haaren@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1504885015-44642-3-git-send-email-harry.van.haaren@intel.com> User-Agent: Mutt/1.9.0 (2017-09-02) X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: BM1PR01CA0091.INDPRD01.PROD.OUTLOOK.COM (10.174.208.159) To BN3PR07MB2515.namprd07.prod.outlook.com (10.167.4.140) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b59ed72f-8c13-4e48-c785-08d4f93562e7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:BN3PR07MB2515; X-Microsoft-Exchange-Diagnostics: 1; BN3PR07MB2515; 3:t0GZcEKZA6Z0zL3xGHk5MlHYYQESzrB9UtvACAYIXiPKIsBYx1q0mE+wTkBQSKFRbVsLYM2BebIbBLgy6t+qZTfRPX6L5LwJ8aDGByiX82L7cMgFUQEIqox5c23HUK8yXKhNPHWsF+1sOEcC1btUTX0PnhKEUmY4MSeTDiEDMzW3Op8twGbhexzqnJND8YtVrGVmjH8ldTxt8Tbd55+3MC2J8ufl00estdTLMcD8GDqLPnNpacS4gHjr7VnCKBu4; 25:myS/31XPsltZwtxBYeAna2sQl9XlGwm9Pe6Uq9+RWtdVGqxQfrWDzoYvY/8sPTTvfnNMaqvKlWiR04YMeKP7zcc/88YxfNuSrHN/6H5Ak81vMDxs5I52KrfPxcW+QQkloPRQz/93XQ/ABBUmwVSZQ8nZv1FIGPFyGdCBfaB1wzfIktRY+0UbdSbAFVqBo0IHTyF96ITo45uoseVAHGERAwCgAwTClXsLRQJmRGUeNQ8mAhUXVUq0uzE+9BGLJC6JRaski665y6ZVoESE48p73iMS7OSMymdpqjfjNquk235AQw/8513vxK7J/tYsBcF53ybpSVJ2W/e4Vu6+C6E2dw==; 31:UWRBmC/GcgyTyDJ6FBiMRugSGPGb5+8PLsSZNeysWtV2ZTFpxCh3DubGDI3BDIbDFM3dRfXMKj1Qu0E1fhjHf9nd1B/arNudlHeX65uWwigWip3vYazsHXT+Yw/tXSRLBCrrvGlo22RZI0FmVgr3VUP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2U+FpKT35fE= X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(3002001)(10201501046)(6041248)(20161123558100)(20161123560025)(20161123562025)(20161123564025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN3PR07MB2515; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN3PR07MB2515; X-Forefront-PRVS: 04270EF89C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(13464003)(189002)(199003)(478600001)(6246003)(6666003)(575784001)(42882006)(53936002)(7736002)(6496005)(229853002)(42186005)(305945005)(110136004)(189998001)(25786009)(2906002)(105586002)(4326008)(106356001)(47776003)(66066001)(76176999)(101416001)(9686003)(54356999)(50986999)(68736007)(23726003)(3846002)(6116002)(83506001)(33656002)(4001350100001)(97736004)(33716001)(1076002)(72206003)(5660300001)(6916009)(2950100002)(8676002)(81156014)(8936002)(55016002)(50466002)(5009440100003)(81166006)(110426004)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR07MB2515; H:jerin; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR07MB2515; 23:oK/ROFWKQCXwN+pvSo7lX/WKl9UA9BCmB3CGRqjJn?= =?us-ascii?Q?XNmTCHqeyQoopFGM1coMWu2Ufnns0czbZscyq59kMSWSKl4IIU04nJxaBFlD?= =?us-ascii?Q?2L6YuQ++50vsiF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0abZAnwtNx9DPVRb7IukpXbseRY1SoTrpRC4k2524Lw72FSuZfdb/OslbZk64VA35WcGU6f/jwRSX4upwwuay8hq9tAv1nBHjFtIWCvb1Tvcv5mhTstrHD/QCWSN3wQKo8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2017 16:51:44.1053 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR07MB2515 Subject: Re: [dpdk-dev] [PATCH v3 2/4] eventdev: add dev attribute get function 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: Mon, 11 Sep 2017 16:51:48 -0000 -----Original Message----- > Date: Fri, 8 Sep 2017 16:36:53 +0100 > From: Harry van Haaren > To: dev@dpdk.org > CC: jerin.jacob@caviumnetworks.com, Harry van Haaren > > Subject: [PATCH v3 2/4] eventdev: add dev attribute get function > X-Mailer: git-send-email 2.7.4 > > This commit adds a device attribute function, allowing flexible > fetching of device attributes, like port count or queue count. > The unit tests and .map file are updated to the new function. > > Signed-off-by: Harry van Haaren > --- > lib/librte_eventdev/rte_eventdev.c | 24 ++++++++-- > lib/librte_eventdev/rte_eventdev.h | 28 ++++++++--- > lib/librte_eventdev/rte_eventdev_version.map | 2 +- > test/test/test_eventdev.c | 36 +++++++++++--- > test/test/test_eventdev_octeontx.c | 72 ++++++++++++++++++++-------- > 5 files changed, 124 insertions(+), 38 deletions(-) > > diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c > index a02ff0a..4b1c0be 100644 > --- a/lib/librte_eventdev/rte_eventdev.c > +++ b/lib/librte_eventdev/rte_eventdev.c > @@ -743,13 +743,27 @@ rte_event_port_setup(uint8_t dev_id, uint8_t port_id, > return 0; > } > > -uint8_t > -rte_event_port_count(uint8_t dev_id) > +int > +rte_event_dev_attr_get(uint8_t dev_id, uint32_t attr_id, > + uint32_t *attr_value /*out */) > { > struct rte_eventdev *dev; > > + if (!attr_value) > + return -EINVAL; > + RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL); > dev = &rte_eventdevs[dev_id]; > - return dev->data->nb_ports; > + > + switch (attr_id) { > + case RTE_EVENT_DEV_ATTR_PORT_COUNT: > + *attr_value = dev->data->nb_ports; > + break; > + case RTE_EVENT_DEV_ATTR_QUEUE_COUNT: > + *attr_value = dev->data->nb_queues; > + break; Same as previous "default case" comment. > + } > + > + return 0; With above change: Acked-by: Jerin Jacob