event/octeontx2: add SSO selftest

Add selftest to verify sanity of SSO.
Can be run by passing devargs to SSO PF as follows:

Example:
	--dev "0002:0e:00.0,selftest=1"

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
This commit is contained in:
Pavan Nikhilesh 2019-06-28 23:53:36 +05:30 committed by Jerin Jacob
parent de128f732f
commit 62561532ac
7 changed files with 1543 additions and 1 deletions

View File

@ -1014,7 +1014,15 @@ test_eventdev_selftest_octeontx(void)
return test_eventdev_selftest_impl("event_octeontx", "");
}
static int
test_eventdev_selftest_octeontx2(void)
{
return test_eventdev_selftest_impl("otx2_eventdev", "");
}
REGISTER_TEST_COMMAND(eventdev_common_autotest, test_eventdev_common);
REGISTER_TEST_COMMAND(eventdev_selftest_sw, test_eventdev_selftest_sw);
REGISTER_TEST_COMMAND(eventdev_selftest_octeontx,
test_eventdev_selftest_octeontx);
REGISTER_TEST_COMMAND(eventdev_selftest_octeontx2,
test_eventdev_selftest_octeontx2);

View File

@ -81,6 +81,15 @@ Runtime Config Options
--dev "0002:0e:00.0,qos=[1-50-50-50]"
- ``Selftest``
The functionality of OCTEON TX2 eventdev can be verified using this option,
various unit and functional tests are run to verify the sanity.
The tests are run once the vdev creation is successfully complete.
For example::
--dev "0002:0e:00.0,selftest=1"
Debugging Options
~~~~~~~~~~~~~~~~~

View File

@ -36,6 +36,7 @@ LIBABIVER := 1
SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX2_EVENTDEV) += otx2_worker_dual.c
SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX2_EVENTDEV) += otx2_worker.c
SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX2_EVENTDEV) += otx2_evdev.c
SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX2_EVENTDEV) += otx2_evdev_selftest.c
SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX2_EVENTDEV) += otx2_evdev_irq.c
LDLIBS += -lrte_eal -lrte_bus_pci -lrte_pci -lrte_kvargs

View File

@ -6,6 +6,7 @@ sources = files('otx2_worker.c',
'otx2_worker_dual.c',
'otx2_evdev.c',
'otx2_evdev_irq.c',
'otx2_evdev_selftest.c',
)
allow_experimental_apis = true

View File

@ -1099,11 +1099,13 @@ static struct rte_eventdev_ops otx2_sso_ops = {
.dev_start = otx2_sso_start,
.dev_stop = otx2_sso_stop,
.dev_close = otx2_sso_close,
.dev_selftest = otx2_sso_selftest,
};
#define OTX2_SSO_XAE_CNT "xae_cnt"
#define OTX2_SSO_SINGLE_WS "single_ws"
#define OTX2_SSO_GGRP_QOS "qos"
#define OTX2_SSO_SELFTEST "selftest"
static void
parse_queue_param(char *value, void *opaque)
@ -1186,6 +1188,8 @@ sso_parse_devargs(struct otx2_sso_evdev *dev, struct rte_devargs *devargs)
if (kvlist == NULL)
return;
rte_kvargs_process(kvlist, OTX2_SSO_SELFTEST, &parse_kvargs_flag,
&dev->selftest);
rte_kvargs_process(kvlist, OTX2_SSO_XAE_CNT, &parse_kvargs_value,
&dev->xae_cnt);
rte_kvargs_process(kvlist, OTX2_SSO_SINGLE_WS, &parse_kvargs_flag,
@ -1301,6 +1305,10 @@ otx2_sso_init(struct rte_eventdev *event_dev)
otx2_sso_dbg("Initializing %s max_queues=%d max_ports=%d",
event_dev->data->name, dev->max_event_queues,
dev->max_event_ports);
if (dev->selftest) {
event_dev->dev->driver = &pci_sso.driver;
event_dev->dev_ops->dev_selftest();
}
return 0;
@ -1347,4 +1355,5 @@ RTE_PMD_REGISTER_PCI_TABLE(event_octeontx2, pci_sso_map);
RTE_PMD_REGISTER_KMOD_DEP(event_octeontx2, "vfio-pci");
RTE_PMD_REGISTER_PARAM_STRING(event_octeontx2, OTX2_SSO_XAE_CNT "=<int>"
OTX2_SSO_SINGLE_WS "=1"
OTX2_SSO_GGRP_QOS "=<string>");
OTX2_SSO_GGRP_QOS "=<string>"
OTX2_SSO_SELFTEST "=1");

View File

@ -130,6 +130,7 @@ struct otx2_sso_evdev {
struct rte_mempool *xaq_pool;
/* Dev args */
uint8_t dual_ws;
uint8_t selftest;
uint32_t xae_cnt;
uint8_t qos_queue_cnt;
struct otx2_sso_qos *qos_parse_data;
@ -247,6 +248,8 @@ typedef void (*otx2_handle_event_t)(void *arg, struct rte_event ev);
void ssogws_flush_events(struct otx2_ssogws *ws, uint8_t queue_id,
uintptr_t base, otx2_handle_event_t fn, void *arg);
void ssogws_reset(struct otx2_ssogws *ws);
/* Selftest */
int otx2_sso_selftest(void);
/* Init and Fini API's */
int otx2_sso_init(struct rte_eventdev *event_dev);
int otx2_sso_fini(struct rte_eventdev *event_dev);

File diff suppressed because it is too large Load Diff