raw/dpaa2_qdma: handle size for config and queue setup
RAW configure and Queue setup APIs support size parameter for configure. This patch supports the same for DPAA2 QDMA PMD APIs Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
This commit is contained in:
parent
af02d1e2f7
commit
27f3757398
@ -1,5 +1,5 @@
|
||||
/* SPDX-License-Identifier: BSD-3-Clause
|
||||
* Copyright 2018-2020 NXP
|
||||
* Copyright 2018-2021 NXP
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
@ -1146,8 +1146,12 @@ dpaa2_qdma_configure(const struct rte_rawdev *rawdev,
|
||||
|
||||
DPAA2_QDMA_FUNC_TRACE();
|
||||
|
||||
if (config_size != sizeof(*qdma_config))
|
||||
if (config_size != sizeof(*qdma_config)) {
|
||||
DPAA2_QDMA_ERR("Config size mismatch. Expected %" PRIu64
|
||||
", Got: %" PRIu64, (uint64_t)(sizeof(*qdma_config)),
|
||||
(uint64_t)config_size);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* In case QDMA device is not in stopped state, return -EBUSY */
|
||||
if (qdma_dev->state == 1) {
|
||||
@ -1247,8 +1251,12 @@ dpaa2_qdma_queue_setup(struct rte_rawdev *rawdev,
|
||||
|
||||
DPAA2_QDMA_FUNC_TRACE();
|
||||
|
||||
if (conf_size != sizeof(*q_config))
|
||||
if (conf_size != sizeof(*q_config)) {
|
||||
DPAA2_QDMA_ERR("Config size mismatch. Expected %" PRIu64
|
||||
", Got: %" PRIu64, (uint64_t)(sizeof(*q_config)),
|
||||
(uint64_t)conf_size);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
rte_spinlock_lock(&qdma_dev->lock);
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* SPDX-License-Identifier: BSD-3-Clause
|
||||
* Copyright 2018-2020 NXP
|
||||
* Copyright 2018-2021 NXP
|
||||
*/
|
||||
|
||||
#ifndef __RTE_PMD_DPAA2_QDMA_H__
|
||||
@ -177,13 +177,13 @@ struct rte_qdma_queue_config {
|
||||
#define rte_qdma_info rte_rawdev_info
|
||||
#define rte_qdma_start(id) rte_rawdev_start(id)
|
||||
#define rte_qdma_reset(id) rte_rawdev_reset(id)
|
||||
#define rte_qdma_configure(id, cf) rte_rawdev_configure(id, cf)
|
||||
#define rte_qdma_configure(id, cf, sz) rte_rawdev_configure(id, cf, sz)
|
||||
#define rte_qdma_dequeue_buffers(id, buf, num, ctxt) \
|
||||
rte_rawdev_dequeue_buffers(id, buf, num, ctxt)
|
||||
#define rte_qdma_enqueue_buffers(id, buf, num, ctxt) \
|
||||
rte_rawdev_enqueue_buffers(id, buf, num, ctxt)
|
||||
#define rte_qdma_queue_setup(id, qid, cfg) \
|
||||
rte_rawdev_queue_setup(id, qid, cfg)
|
||||
#define rte_qdma_queue_setup(id, qid, cfg, sz) \
|
||||
rte_rawdev_queue_setup(id, qid, cfg, sz)
|
||||
|
||||
/*TODO introduce per queue stats API in rawdew */
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user