diff mbox

[dpdk-dev,v3,05/11] event/octeontx: update octeontx eventdev selftest ops

Message ID 20171225191738.17151-5-pbhagavatula@caviumnetworks.com (mailing list archive)
State Superseded, archived
Delegated to: Jerin Jacob
Headers show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Pavan Nikhilesh Dec. 25, 2017, 7:17 p.m. UTC
Update octeontx eventdev ops to invoke selftest when application
invokes `rte_event_dev_selftest`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
 drivers/event/octeontx/Makefile      | 3 ++-
 drivers/event/octeontx/ssovf_evdev.c | 2 ++
 drivers/event/octeontx/ssovf_evdev.h | 4 ++++
 3 files changed, 8 insertions(+), 1 deletion(-)

Comments

Jerin Jacob Jan. 8, 2018, 10:09 a.m. UTC | #1
-----Original Message-----
> Date: Tue, 26 Dec 2017 00:47:32 +0530
> From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> To: jerin.jacob@caviumnetworks.com, harry.van.haaren@intel.com,
>  gage.eads@intel.com, liang.j.ma@intel.com
> Cc: dev@dpdk.org, Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH v3 05/11] event/octeontx: update octeontx
>  eventdev selftest ops
> X-Mailer: git-send-email 2.14.1
> 
> Update octeontx eventdev ops to invoke selftest when application
> invokes `rte_event_dev_selftest`.
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> ---
>  drivers/event/octeontx/Makefile      | 3 ++-
>  drivers/event/octeontx/ssovf_evdev.c | 2 ++
>  drivers/event/octeontx/ssovf_evdev.h | 4 ++++
>  3 files changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/event/octeontx/Makefile b/drivers/event/octeontx/Makefile
> index fdf1b7385..1ad638574 100644
> --- a/drivers/event/octeontx/Makefile
> +++ b/drivers/event/octeontx/Makefile
> @@ -42,7 +42,7 @@ CFLAGS += -I$(RTE_SDK)/drivers/mempool/octeontx/
>  CFLAGS += -I$(RTE_SDK)/drivers/net/octeontx/
>  
>  LDLIBS += -lrte_eal -lrte_eventdev -lrte_mempool_octeontx
> -LDLIBS += -lrte_bus_pci
> +LDLIBS += -lrte_bus_pci -lrte_mempool -lrte_mbuf
>  LDLIBS += -lrte_bus_vdev
>  
>  EXPORT_MAP := rte_pmd_octeontx_ssovf_version.map
> @@ -54,6 +54,7 @@ LIBABIVER := 1
>  #
>  SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += ssovf_worker.c
>  SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += ssovf_evdev.c
> +SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += octeontx_evdev_selftest.c

Every other file in this directory starts with ssovf_*. IMO, better to
change to ssovf_evdev_selftest.c

With above change:
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
diff mbox

Patch

diff --git a/drivers/event/octeontx/Makefile b/drivers/event/octeontx/Makefile
index fdf1b7385..1ad638574 100644
--- a/drivers/event/octeontx/Makefile
+++ b/drivers/event/octeontx/Makefile
@@ -42,7 +42,7 @@  CFLAGS += -I$(RTE_SDK)/drivers/mempool/octeontx/
 CFLAGS += -I$(RTE_SDK)/drivers/net/octeontx/
 
 LDLIBS += -lrte_eal -lrte_eventdev -lrte_mempool_octeontx
-LDLIBS += -lrte_bus_pci
+LDLIBS += -lrte_bus_pci -lrte_mempool -lrte_mbuf
 LDLIBS += -lrte_bus_vdev
 
 EXPORT_MAP := rte_pmd_octeontx_ssovf_version.map
@@ -54,6 +54,7 @@  LIBABIVER := 1
 #
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += ssovf_worker.c
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += ssovf_evdev.c
+SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += octeontx_evdev_selftest.c
 
 ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
 CFLAGS_ssovf_worker.o += -fno-prefetch-loop-arrays
diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c
index b80a6c0ae..0a96fbd7f 100644
--- a/drivers/event/octeontx/ssovf_evdev.c
+++ b/drivers/event/octeontx/ssovf_evdev.c
@@ -613,6 +613,8 @@  static const struct rte_eventdev_ops ssovf_ops = {
 	.eth_rx_adapter_start = ssovf_eth_rx_adapter_start,
 	.eth_rx_adapter_stop = ssovf_eth_rx_adapter_stop,
 
+	.dev_selftest = test_eventdev_octeontx,
+
 	.dump             = ssovf_dump,
 	.dev_start        = ssovf_start,
 	.dev_stop         = ssovf_stop,
diff --git a/drivers/event/octeontx/ssovf_evdev.h b/drivers/event/octeontx/ssovf_evdev.h
index b093a3e73..72a980447 100644
--- a/drivers/event/octeontx/ssovf_evdev.h
+++ b/drivers/event/octeontx/ssovf_evdev.h
@@ -57,6 +57,9 @@ 
 #define ssovf_log_err(fmt, args...) \
 	RTE_LOG(ERR, EVENTDEV, "[%s] %s() " fmt "\n", \
 		RTE_STR(EVENTDEV_NAME_OCTEONTX_PMD), __func__, ## args)
+#define ssovf_log_selftest(fmt, args...) \
+	RTE_LOG(INFO, EVENTDEV, "[%s] %s() " fmt "\n", \
+		RTE_STR(EVENTDEV_NAME_OCTEONTX_PMD), __func__, ## args)
 
 #define SSO_MAX_VHGRP                     (64)
 #define SSO_MAX_VHWS                      (32)
@@ -196,5 +199,6 @@  uint16_t ssows_deq_timeout_burst(void *port, struct rte_event ev[],
 		uint16_t nb_events, uint64_t timeout_ticks);
 void ssows_flush_events(struct ssows *ws, uint8_t queue_id);
 void ssows_reset(struct ssows *ws);
+int test_eventdev_octeontx(void);
 
 #endif /* __SSOVF_EVDEV_H__ */