Signed-off-by: Nikita Kalyazin <n.kalya...@samsung.com> Reviewed-by: Ilya Maximets <i.maxim...@samsung.com> --- include/odp/api/config.h | 7 ++++++- platform/linux-generic/include/odp_packet_io_internal.h | 1 + platform/linux-generic/odp_packet_io.c | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/include/odp/api/config.h b/include/odp/api/config.h index 302eaf5..b87ed79 100644 --- a/include/odp/api/config.h +++ b/include/odp/api/config.h @@ -34,9 +34,14 @@ extern "C" { #define ODP_CONFIG_POOLS 16 /** + * Maximum number of pktio hardware queues + */ +#define ODP_CONFIG_PKTIO_QUEUES 32 + +/** * Maximum number of queues */ -#define ODP_CONFIG_QUEUES 1024 +#define ODP_CONFIG_QUEUES (1024 * ODP_CONFIG_PKTIO_QUEUES) /** * Number of scheduling priorities diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h index 353b40d..2eb66bb 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -41,6 +41,7 @@ typedef struct { struct pktio_entry { const struct pktio_if_ops *ops; /**< Implementation specific methods */ odp_ticketlock_t lock; /**< entry ticketlock */ + odp_ticketlock_t queue_locks[ODP_CONFIG_PKTIO_QUEUES]; /* queue locks */ int taken; /**< is entry taken(1) or free(0) */ int cls_enabled; /**< is classifier enabled */ odp_pktio_t handle; /**< pktio handle */ diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index fa0817a..a1f51e7 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -39,6 +39,7 @@ int odp_pktio_init_global(void) int id; odp_shm_t shm; int pktio_if; + int i; shm = odp_shm_reserve("odp_pktio_entries", sizeof(pktio_table_t), @@ -56,6 +57,8 @@ int odp_pktio_init_global(void) pktio_entry = &pktio_tbl->entries[id - 1]; odp_ticketlock_init(&pktio_entry->s.lock); + for (i = 0; i < ODP_CONFIG_PKTIO_QUEUES; i++) + odp_ticketlock_init(&pktio_entry->s.queue_locks[i]); odp_spinlock_init(&pktio_entry->s.cls.lock); odp_spinlock_init(&pktio_entry->s.cls.l2_cos_table.lock); odp_spinlock_init(&pktio_entry->s.cls.l3_cos_table.lock); -- 2.5.3 _______________________________________________ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp