aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/raw/skeleton_rawdev
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2018-08-14 18:55:37 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2018-08-14 18:57:39 +0100
commitae1479de3027a4a0f68d90bf65ac6ff2b862b837 (patch)
tree5dbca675b6717b6b61abbe1a9583d5166fed942b /drivers/raw/skeleton_rawdev
parent8cee230dd1f0f9f31f4b0339c671d0b1ee14e111 (diff)
parentb63264c8342e6a1b6971c79550d2af2024b6a4de (diff)
Merge branch 'upstream' into 18.08.x
Change-Id: Ifbda2d554199dd4d11e01f0090881b5f0103ae12 Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'drivers/raw/skeleton_rawdev')
-rw-r--r--drivers/raw/skeleton_rawdev/Makefile1
-rw-r--r--drivers/raw/skeleton_rawdev/meson.build2
-rw-r--r--drivers/raw/skeleton_rawdev/skeleton_rawdev.c18
-rw-r--r--drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c13
4 files changed, 27 insertions, 7 deletions
diff --git a/drivers/raw/skeleton_rawdev/Makefile b/drivers/raw/skeleton_rawdev/Makefile
index bacc66dd..3f97c2ee 100644
--- a/drivers/raw/skeleton_rawdev/Makefile
+++ b/drivers/raw/skeleton_rawdev/Makefile
@@ -8,7 +8,6 @@ include $(RTE_SDK)/mk/rte.vars.mk
#
LIB = librte_pmd_skeleton_rawdev.a
-CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
LDLIBS += -lrte_eal
diff --git a/drivers/raw/skeleton_rawdev/meson.build b/drivers/raw/skeleton_rawdev/meson.build
index 7cb2d3fb..b4a6ed08 100644
--- a/drivers/raw/skeleton_rawdev/meson.build
+++ b/drivers/raw/skeleton_rawdev/meson.build
@@ -4,5 +4,3 @@
deps += ['rawdev', 'kvargs', 'mbuf', 'bus_vdev']
sources = files('skeleton_rawdev.c',
'skeleton_rawdev_test.c')
-
-allow_experimental_apis = true
diff --git a/drivers/raw/skeleton_rawdev/skeleton_rawdev.c b/drivers/raw/skeleton_rawdev/skeleton_rawdev.c
index 6bdbbb50..6518a2d9 100644
--- a/drivers/raw/skeleton_rawdev/skeleton_rawdev.c
+++ b/drivers/raw/skeleton_rawdev/skeleton_rawdev.c
@@ -305,6 +305,18 @@ static int skeleton_rawdev_queue_release(struct rte_rawdev *dev,
return ret;
}
+static uint16_t skeleton_rawdev_queue_count(struct rte_rawdev *dev)
+{
+ struct skeleton_rawdev *skeldev;
+
+ SKELETON_PMD_FUNC_TRACE();
+
+ RTE_FUNC_PTR_OR_ERR_RET(dev, -EINVAL);
+
+ skeldev = skeleton_rawdev_get_priv(dev);
+ return skeldev->num_queues;
+}
+
static int skeleton_rawdev_get_attr(struct rte_rawdev *dev,
const char *attr_name,
uint64_t *attr_value)
@@ -524,6 +536,7 @@ static const struct rte_rawdev_ops skeleton_rawdev_ops = {
.queue_def_conf = skeleton_rawdev_queue_def_conf,
.queue_setup = skeleton_rawdev_queue_setup,
.queue_release = skeleton_rawdev_queue_release,
+ .queue_count = skeleton_rawdev_queue_count,
.attr_get = skeleton_rawdev_get_attr,
.attr_set = skeleton_rawdev_set_attr,
@@ -744,10 +757,7 @@ static struct rte_vdev_driver skeleton_pmd_drv = {
RTE_PMD_REGISTER_VDEV(SKELETON_PMD_RAWDEV_NAME, skeleton_pmd_drv);
-RTE_INIT(skeleton_pmd_init_log);
-
-static void
-skeleton_pmd_init_log(void)
+RTE_INIT(skeleton_pmd_init_log)
{
skeleton_pmd_logtype = rte_log_register("rawdev.skeleton");
if (skeleton_pmd_logtype >= 0)
diff --git a/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c b/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c
index 3eb5c3a7..3405b898 100644
--- a/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c
+++ b/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c
@@ -194,6 +194,18 @@ test_rawdev_queue_default_conf_get(void)
}
static int
+test_rawdev_queue_count(void)
+{
+ unsigned int q_count;
+
+ /* Get the current configuration */
+ q_count = rte_rawdev_queue_count(TEST_DEV_ID);
+ RTE_TEST_ASSERT_EQUAL(q_count, 1, "Invalid queue count (%d)", q_count);
+
+ return TEST_SUCCESS;
+}
+
+static int
test_rawdev_queue_setup(void)
{
int ret;
@@ -429,6 +441,7 @@ test_rawdev_skeldev(void)
SKELDEV_TEST_RUN(test_rawdev_configure, NULL,
test_rawdev_queue_default_conf_get);
SKELDEV_TEST_RUN(test_rawdev_configure, NULL, test_rawdev_queue_setup);
+ SKELDEV_TEST_RUN(NULL, NULL, test_rawdev_queue_count);
SKELDEV_TEST_RUN(test_rawdev_queue_setup, NULL,
test_rawdev_queue_release);
SKELDEV_TEST_RUN(NULL, NULL, test_rawdev_attr_set_get);