From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0079.outbound.protection.outlook.com [104.47.34.79]) by dpdk.org (Postfix) with ESMTP id 7833E1B161 for ; Tue, 12 Dec 2017 20:28:31 +0100 (CET) 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=yI5adekjdVJIrNfynRmAPTiRycwUZgbh/NOg4emC+Ws=; b=lKeu3MrJk6JLU9iRGieXyTJq8zBQasKNgBn+932ePB539j3NYtJT1U0MHPyiWgepfjsETYZba3pRNTo30K8TB9WpfxpzjYkGs2dJ937+FPiArBp0OBXNLufWbjxt7BJlPyc9YyUdsoWRR6WOcTP9ji8JOyjci5IYdVG4KKiJ1H8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (111.93.218.67) by CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Tue, 12 Dec 2017 19:28:26 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, bruce.richardson@intel.com, harry.van.haaren@intel.com, gage.eads@intel.com, hemant.agrawal@nxp.com, nipun.gupta@nxp.com, liang.j.ma@intel.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Wed, 13 Dec 2017 00:57:12 +0530 Message-Id: <20171212192713.17620-6-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171212192713.17620-1-pbhagavatula@caviumnetworks.com> References: <20171212192713.17620-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: HK2PR04CA0045.apcprd04.prod.outlook.com (10.170.154.13) To CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 860bd460-f5d9-4ca1-fcb8-08d541968698 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307); SRVR:CY4PR07MB3464; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 3:Ilh7uJc3DYFWrYe/rSOmMBLq2rW3lpthKn3QNmkMPWXGe1f9hnuTcjLJLhtEksWEsKAUyg6Q5TC40mNL6Dx0Y5jLoOhcqVHJr9l/YsBGNWAJbGy3t/W3FRBSajy4q35wS17Hy302LXZN5+d0V4Ir3okF+Dhb8VofoSzS6+8TYIDQbbCr6NDJU4hgTG9ofvRrvmZaFQDHtqO2KUII6toaf8BKK9zgjCzLakcGbwhQ7D+XJIwxwLj+gpsG4gZC9S2+; 25:fXHrryWC+otHP2vwmXMsID7Z0JyLMU18UfX+E7HStTWCb/qFjncsNxcrhk7QG5SSGw0Gs2bJcNrmQ9nyZB2CGnaDy5EoxrJpG8DIMyw2eVGIrKg4wA635CPsZD27tgQtxP3fgvkZAf9jF+Tn4OShTmgBHPp+M/K9Cr69XFBY9UGM191KIEXDvtlJSkVRnTmkBQPoJBKGn/4/X5gruq0qPIM0bn47nnGePcHq4PqlTWBRB2QupAuI/qYCmCjN7l0eIuI2T0OXy10e3HIshMaS3p7HZtXwx8C9lFCaNW61ZaNmQhTFuM/CYVHY0ovUQQFLZjw4A93eJd1wPkZvl7Z20A==; 31:azBqUNdX+I/iVr+dABLHYAkurhztLDerZDqISEv125xPdKU9yjpR3ZlSk84XVzDIbn5yVstHxnW2WB+05/UOMBf+TKgvxl1Bkr8/lwb4DUBZIQFlTgu8k3oM7e6Tq5rsExq/6SL5nSD74z+i6IoALH4Zf+K7j8KRXE8MtDKuqtit5qGONcbZ4Ed6TysDKPSXeWz5AdJU9AX0ODaAjOEPGuZ02U6BBpgSb3iAGiiv+Lc= X-MS-TrafficTypeDiagnostic: CY4PR07MB3464: X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 20:TMONDT5fuyHFl/Q6eNYLEaz6wnNh/Yt3LL/UQDzIJgFukdi9yxwp4TJLI3NVLjHIXpZDlLNY0B0+z1DWEJoNOmk+v7LEYs91kYcKST/IZtGBqrG49KnUAX7abOAcB73CB9pCYh22FjEpRc1JlJsV0e+8AjDmN+tUMOBDPdue3/0mmrfvBabXZgdVxEmGYeNw7YWaEjq2xNnEezQ/oxNs/IxPTObb3+W4wzFxgnls0anFV7yoqW4Ag/TZZ8uJcIS+NWrAYnc7F7121bmd92jTTfVtwGXGUbZEJ93mNkY87wo8YKlYuiPTJSrFfwYrNbi0jmPJL4JkIp/byvT8TSOSCzPf52uBgUaGB+XmPovCwjPvdyPU4bq0lgut0EwfL/8p/YiAbf0G9ywNudB/kzomaxte8gliPzKxPSG6Jc3qU/deJmKEPJRXt4atByS48IWR/w+usRrkAJd7KPS9MWAFF6AblYryLoMmdlySXKgaqrOACIuXSvWwPjhF5CXOWlpPzRKNNvobX5NsPIb34pfvRA8NN8M1QMFUQyKdIdh1HQTK331MdMS+IU5HOy2SNhf6Kb+2ZgmfhfxzmVSAmdvlMaEsJvkmiUJ5Byw2krU8KeU=; 4:VbsLCpYRLwS8+jz6fXjt8AucpTkcShUvR1pcQMn+WhygkKouPZfLGltxIU3u177+HzhhP7GDxu77N/oDcB/aijATD4uhWu0OimzJgHfyKTqhlY1Rz82MhqZlHI46svJP/1hKdBgoC85jAjE3ST1QGPkqvmMAUPwGltYRq3LbqjatIc7EV0wy7q2YjZ01QPacDpjfW81QRwgyw4GmyvjI7XY3fQFyo7WEb5b76RdddSJa59rpDxNtlyVBqjgMDhwqNrWxcknEum1dyt4ttRb9Mg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(93006095)(10201501046)(3231023)(3002001)(6041248)(20161123560025)(20161123564025)(20161123558100)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(201708071742011); SRVR:CY4PR07MB3464; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY4PR07MB3464; X-Forefront-PRVS: 051900244E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(346002)(366004)(376002)(189003)(199004)(66066001)(4326008)(5660300001)(6486002)(316002)(16526018)(575784001)(36756003)(50466002)(25786009)(72206003)(47776003)(478600001)(68736007)(8676002)(305945005)(81166006)(6506007)(386003)(81156014)(16586007)(48376002)(50226002)(6116002)(3846002)(7736002)(5009440100003)(53936002)(106356001)(1076002)(97736004)(42882006)(76176011)(6666003)(2906002)(107886003)(6512007)(2950100002)(8656006)(52116002)(51416003)(8936002)(105586002)(42262002)(309714004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3464; H:localhost.localdomain; 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; CY4PR07MB3464; 23:Fiz0ofHqO42CR8tlHrFtWIWuBTqgI6S2w5H1SARrx?= =?us-ascii?Q?+JOgbO5T3yqyG+Ow4U5L2PpkFxtz3FDM8gQlyJWwi+kk3IDb/1bEuCsgJM3U?= =?us-ascii?Q?lO9Z7Xc58ANNwbg2Q7OJ48d1OKpQDTSzpehj3NiARlcBUt48t0/c8BigRwan?= =?us-ascii?Q?XiUjnzb/azbx9fNY1uifpBSs+x68yShSEbln4eKSY4r6o7aeKjI4cG5xSV5e?= =?us-ascii?Q?FRy5eSyqRIhqG7nG59lCsM1ojs111b+mcpUH9xbF6kAuR8YuG64xhw+/ESj5?= =?us-ascii?Q?+MCkDp9xhj86WlpXeC8Cd89s1Lfou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ascii?Q?z/7rIB5jS8mfUo=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 6:lngm7tcy35IO0przLRvR2QeqjNb/ijeOlYQ+BpNt8IVDe0Evy/K6edDwL+635mSSc4qfUc1lqWQvuW8CqZ6l+Q3csrc8Vlezo/8cVpjQ8ZpsYqM/IWqz72L82AaCSpTZINq8whcSPIo0I5C1wfVJY9M6Qw4qJ8jypCLWkAhCV06DBhkIWnEKPnguwJEe26NbboW/y1RNPmSUbuFdMIZP35pe4V3CWLbMuXaP0plMn7Z7NwgJGSGJNFsLncKOQmA2aybjIMuVYEYhzJh3cLSCy2MX467skWkcBmsb4oQzbTMglp4kvgOSbmIjSPBnvvd3ceeVX9YJYw7NfptSfv/Vpb59iqHs/1Y/VxAv+0vNs5w=; 5:S7N6l+yuAmfT2B3hma0an9dZpaZObvGAd+eeC7TCJwfpc9qIhrTRKs563blkvvc7mFPYErgw8vp8oDpZ51iwDE2rU8pEfN0JzQReK6sJj4Xv3/NXJ3htb9GeFbImcDR6KMp3lxhr8cxacY6EVUEkx/u4bOoQLrpBhw5F+9VxXzI=; 24:RJ+caeu0UkDHmb4FsRmibmUngzf/OorkDPXG3iQTANBK+5foKmnupUrT7PurPPd32H/5oNRadZb63MJmTgomwYIgJqMoK+C76Hme06ckcXg=; 7:C7Sq5Quh2oekBlB5S7k3CzxHFP6QQEEs8BV+unQAivWKdGDbfU+prgr8SwJLFzy+LQ5ZxLC8qC6a2UNjAPCBxByGu4H3vusUJUv3Tsl6Z8xocHp+n1UTpHl6RUUuJ9pScHRZuMYBVPmGLtJXEXZj0EBljMXKEwEdN0vNmcokFEfkfUdfbB9Gv5HP769Fb9kiN0RAUvZHJR+nAKzeYnN1nkZ80QCQ+SzMT0gsJNpHvSnloOYIZGlDKLmqXoGosMv5 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 19:28:26.7809 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 860bd460-f5d9-4ca1-fcb8-08d541968698 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3464 Subject: [dpdk-dev] [PATCH 6/7] event/sw: add selftest to device arguments 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, 12 Dec 2017 19:28:32 -0000 Add selftest as a device argument that can be enabled by suppling 'self_test=1' as a vdev parameter --vdev="event_sw,self_test=1" The selftest is run after vdev creation is successfully complete. Signed-off-by: Pavan Nikhilesh --- drivers/event/sw/Makefile | 2 ++ drivers/event/sw/sw_evdev.c | 23 +++++++++++++++++++++++ drivers/event/sw/sw_evdev.h | 1 + 3 files changed, 26 insertions(+) diff --git a/drivers/event/sw/Makefile b/drivers/event/sw/Makefile index 2f2b67bac..d4f7677fe 100644 --- a/drivers/event/sw/Makefile +++ b/drivers/event/sw/Makefile @@ -44,6 +44,7 @@ CFLAGS += -Wno-missing-field-initializers endif endif LDLIBS += -lrte_eal -lrte_eventdev -lrte_kvargs -lrte_ring +LDLIBS += -lrte_mempool -lrte_mbuf LDLIBS += -lrte_bus_vdev # library version @@ -57,6 +58,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_SW_EVENTDEV) += sw_evdev.c SRCS-$(CONFIG_RTE_LIBRTE_PMD_SW_EVENTDEV) += sw_evdev_worker.c SRCS-$(CONFIG_RTE_LIBRTE_PMD_SW_EVENTDEV) += sw_evdev_scheduler.c SRCS-$(CONFIG_RTE_LIBRTE_PMD_SW_EVENTDEV) += sw_evdev_xstats.c +SRCS-$(CONFIG_RTE_LIBRTE_PMD_SW_EVENTDEV) += selftest_sw.c # export include files SYMLINK-y-include += diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c index 5b4a20889..7c16d0de6 100644 --- a/drivers/event/sw/sw_evdev.c +++ b/drivers/event/sw/sw_evdev.c @@ -47,6 +47,7 @@ #define NUMA_NODE_ARG "numa_node" #define SCHED_QUANTA_ARG "sched_quanta" #define CREDIT_QUANTA_ARG "credit_quanta" +#define SELF_TEST_ARG "self_test" static void sw_info_get(struct rte_eventdev *dev, struct rte_event_dev_info *info); @@ -756,6 +757,13 @@ set_credit_quanta(const char *key __rte_unused, const char *value, void *opaque) return 0; } +static int +set_self_test(const char *key __rte_unused, const char *value, void *opaque) +{ + int *test = opaque; + *test = !!atoi(value); + return 0; +} static int32_t sw_sched_service_func(void *args) { @@ -796,6 +804,7 @@ sw_probe(struct rte_vdev_device *vdev) NUMA_NODE_ARG, SCHED_QUANTA_ARG, CREDIT_QUANTA_ARG, + SELF_TEST_ARG, NULL }; const char *name; @@ -805,6 +814,7 @@ sw_probe(struct rte_vdev_device *vdev) int socket_id = rte_socket_id(); int sched_quanta = SW_DEFAULT_SCHED_QUANTA; int credit_quanta = SW_DEFAULT_CREDIT_QUANTA; + int self_test = 0; name = rte_vdev_device_name(vdev); params = rte_vdev_device_args(vdev); @@ -846,6 +856,16 @@ sw_probe(struct rte_vdev_device *vdev) return ret; } + ret = rte_kvargs_process(kvlist, SELF_TEST_ARG, + set_self_test, &self_test); + if (ret != 0) { + SW_LOG_ERR( + "%s: Error parsing self test parameter", + name); + rte_kvargs_free(kvlist); + return ret; + } + rte_kvargs_free(kvlist); } } @@ -897,6 +917,9 @@ sw_probe(struct rte_vdev_device *vdev) dev->data->service_inited = 1; dev->data->service_id = sw->service_id; + if (self_test) + test_sw_eventdev(); + return 0; } diff --git a/drivers/event/sw/sw_evdev.h b/drivers/event/sw/sw_evdev.h index 085938887..838ff0b58 100644 --- a/drivers/event/sw/sw_evdev.h +++ b/drivers/event/sw/sw_evdev.h @@ -333,5 +333,6 @@ int sw_xstats_reset(struct rte_eventdev *dev, const uint32_t ids[], uint32_t nb_ids); +void test_sw_eventdev(void); #endif /* _SW_EVDEV_H_ */ -- 2.14.1