app/regex: configure queue according to capabilities
authorGuy Kaneti <guyk@marvell.com>
Tue, 20 Oct 2020 09:10:08 +0000 (12:10 +0300)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 3 Nov 2020 01:03:52 +0000 (02:03 +0100)
configure qp with OOS according to device capabilities
returned from rte_regexdev_info_get.

Signed-off-by: Guy Kaneti <guyk@marvell.com>
Acked-by: Ori Kam <orika@nvidia.com>
app/test-regex/main.c

index e6080b4..3deaf3c 100644 (file)
@@ -173,7 +173,7 @@ init_port(struct rte_mempool **mbuf_mp, uint32_t nb_jobs,
        };
        struct rte_regexdev_qp_conf qp_conf = {
                .nb_desc = 1024,
-               .qp_conf_flags = RTE_REGEX_QUEUE_PAIR_CFG_OOS_F,
+               .qp_conf_flags = 0,
        };
        int res = 0;
 
@@ -218,6 +218,8 @@ init_port(struct rte_mempool **mbuf_mp, uint32_t nb_jobs,
                        printf("Error, can't configure device %d.\n", id);
                        goto error;
                }
+               if (info.regexdev_capa & RTE_REGEXDEV_CAPA_QUEUE_PAIR_OOS_F)
+                       qp_conf.qp_conf_flags |= RTE_REGEX_QUEUE_PAIR_CFG_OOS_F;
                res = rte_regexdev_queue_pair_setup(id, 0, &qp_conf);
                if (res < 0) {
                        printf("Error, can't setup queue pair for device %d.\n",