diff mbox series

[API-NEXT,v1,2/2] linux-gen: pktio: implement per queue pktin configuration

Message ID 1533099606-17502-3-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [API-NEXT,v1,1/2] api: pktio: extend odp_pktin_queue_param_t to support per queue configuration | expand

Commit Message

Github ODP bot Aug. 1, 2018, 5 a.m. UTC
From: Bogdan Pricope <bogdan.pricope@linaro.org>


Enables advanced usecases where heterogeneous settings are needed
on input queues of the same interface.

Signed-off-by: Bogdan Pricope <bogdan.pricope@linaro.org>

---
/** Email created from pull request 660 (bogdanPricope:api_next_pktin_queue_pr)
 ** https://github.com/Linaro/odp/pull/660
 ** Patch: https://github.com/Linaro/odp/pull/660.patch
 ** Base sha: 9b2b5a9695ad66977c964c83691cd2fef4c45b85
 ** Merge commit sha: da35db9bd3845097376d2b1ba5459bd8a88f0199
 **/
 platform/linux-generic/odp_packet_io.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c
index 7759f83e4..094e34f2b 100644
--- a/platform/linux-generic/odp_packet_io.c
+++ b/platform/linux-generic/odp_packet_io.c
@@ -1470,11 +1470,20 @@  int odp_pktin_queue_config(odp_pktio_t pktio,
 			snprintf(name, sizeof(name), "odp-pktin-%i-%i",
 				 pktio_id, i);
 
-			if (param->classifier_enable)
+			if (param->classifier_enable) {
 				odp_queue_param_init(&queue_param);
-			else
-				memcpy(&queue_param, &param->queue_param,
-				       sizeof(odp_queue_param_t));
+			} else {
+				const odp_queue_param_t *qparam;
+
+				if (param->queue_param_mode ==
+					 ODP_PKTIN_QUEUE_PARAM_MODE_BASIC)
+					qparam = &param->queue_param;
+				else
+					qparam = param->queue_params + i;
+
+				odp_memcpy(&queue_param, qparam,
+					   sizeof(odp_queue_param_t));
+			}
 
 			queue_param.type = ODP_QUEUE_TYPE_PLAIN;