event/cnxk: add SSO selftest and dump

Add selftest to verify sanity of SSO and also add function to
dump internal state of SSO.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
This commit is contained in:
Pavan Nikhilesh 2021-05-04 05:57:10 +05:30 committed by Jerin Jacob
parent 5b4576e2df
commit 2351506401
7 changed files with 1615 additions and 1 deletions

View File

@ -1036,6 +1036,18 @@ test_eventdev_selftest_dlb2(void)
return test_eventdev_selftest_impl("dlb2_event", "");
}
static int
test_eventdev_selftest_cn9k(void)
{
return test_eventdev_selftest_impl("event_cn9k", "");
}
static int
test_eventdev_selftest_cn10k(void)
{
return test_eventdev_selftest_impl("event_cn10k", "");
}
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,
@ -1044,3 +1056,5 @@ REGISTER_TEST_COMMAND(eventdev_selftest_octeontx2,
test_eventdev_selftest_octeontx2);
REGISTER_TEST_COMMAND(eventdev_selftest_dpaa2, test_eventdev_selftest_dpaa2);
REGISTER_TEST_COMMAND(eventdev_selftest_dlb2, test_eventdev_selftest_dlb2);
REGISTER_TEST_COMMAND(eventdev_selftest_cn9k, test_eventdev_selftest_cn9k);
REGISTER_TEST_COMMAND(eventdev_selftest_cn10k, test_eventdev_selftest_cn10k);

View File

@ -401,6 +401,12 @@ cn10k_sso_close(struct rte_eventdev *event_dev)
return cnxk_sso_close(event_dev, cn10k_sso_hws_unlink);
}
static int
cn10k_sso_selftest(void)
{
return cnxk_sso_selftest(RTE_STR(event_cn10k));
}
static struct rte_eventdev_ops cn10k_sso_dev_ops = {
.dev_infos_get = cn10k_sso_info_get,
.dev_configure = cn10k_sso_dev_configure,
@ -414,9 +420,11 @@ static struct rte_eventdev_ops cn10k_sso_dev_ops = {
.port_unlink = cn10k_sso_port_unlink,
.timeout_ticks = cnxk_sso_timeout_ticks,
.dump = cnxk_sso_dump,
.dev_start = cn10k_sso_start,
.dev_stop = cn10k_sso_stop,
.dev_close = cn10k_sso_close,
.dev_selftest = cn10k_sso_selftest,
};
static int

View File

@ -222,7 +222,7 @@ cn9k_sso_hws_reset(void *arg, void *hws)
}
}
static void
void
cn9k_sso_set_rsrc(void *arg)
{
struct cnxk_sso_evdev *dev = arg;
@ -475,6 +475,12 @@ cn9k_sso_close(struct rte_eventdev *event_dev)
return cnxk_sso_close(event_dev, cn9k_sso_hws_unlink);
}
static int
cn9k_sso_selftest(void)
{
return cnxk_sso_selftest(RTE_STR(event_cn9k));
}
static struct rte_eventdev_ops cn9k_sso_dev_ops = {
.dev_infos_get = cn9k_sso_info_get,
.dev_configure = cn9k_sso_dev_configure,
@ -488,9 +494,11 @@ static struct rte_eventdev_ops cn9k_sso_dev_ops = {
.port_unlink = cn9k_sso_port_unlink,
.timeout_ticks = cnxk_sso_timeout_ticks,
.dump = cnxk_sso_dump,
.dev_start = cn9k_sso_start,
.dev_stop = cn9k_sso_stop,
.dev_close = cn9k_sso_close,
.dev_selftest = cn9k_sso_selftest,
};
static int

View File

@ -326,6 +326,14 @@ cnxk_sso_timeout_ticks(struct rte_eventdev *event_dev, uint64_t ns,
return 0;
}
void
cnxk_sso_dump(struct rte_eventdev *event_dev, FILE *f)
{
struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
roc_sso_dump(&dev->sso, dev->sso.nb_hws, dev->sso.nb_hwgrp, f);
}
static void
cnxk_handle_event(void *arg, struct rte_event event)
{

View File

@ -211,5 +211,10 @@ void cnxk_sso_stop(struct rte_eventdev *event_dev,
cnxk_sso_hws_reset_t reset_fn,
cnxk_sso_hws_flush_t flush_fn);
int cnxk_sso_close(struct rte_eventdev *event_dev, cnxk_sso_unlink_t unlink_fn);
int cnxk_sso_selftest(const char *dev_name);
void cnxk_sso_dump(struct rte_eventdev *event_dev, FILE *f);
/* CN9K */
void cn9k_sso_set_rsrc(void *arg);
#endif /* __CNXK_EVENTDEV_H__ */

File diff suppressed because it is too large Load Diff

View File

@ -14,6 +14,7 @@ sources = files(
'cn10k_eventdev.c',
'cn10k_worker.c',
'cnxk_eventdev.c',
'cnxk_eventdev_selftest.c',
)
deps += ['bus_pci', 'common_cnxk']