@@ -122,9 +122,26 @@ static odp_pktio_t create_pktio(const char *dev, odp_pool_t pool, int mode)
odp_queue_param_t qparam;
char inq_name[ODP_QUEUE_NAME_LEN];
int ret;
+ odp_pktio_param_t pktio_param;
+
+ memset(&pktio_param, 0, sizeof(pktio_param));
+
+ switch (mode) {
+ case APPL_MODE_PKT_BURST:
+ pktio_param.in_mode = ODP_PKTIN_MODE_RECV;
+ break;
+ case APPL_MODE_PKT_QUEUE:
+ pktio_param.in_mode = ODP_PKTIN_MODE_POLL;
+ break;
+ case APPL_MODE_PKT_SCHED:
+ pktio_param.in_mode = ODP_PKTIN_MODE_SCHED;
+ break;
+ default:
+ EXAMPLE_ABORT("invalid mode %d\n", mode);
+ }
Since you're standardizing terms in this patch series, why not APPL_MODE_PKT_RECV to pair with ODP_PKTIN_MODE_RECV, etc.? Having BURST ==> RECV and QUEUE ==> POLL seems non-intuitive.
APPL_MODE_XXX is what the application have used for mode selection. It would topic of another patch to change the application structure. This patch just updates the API.
-Petri