diff mbox series

[v1,1/1] linux-gen: pktio: ignore num_queues parameter if classifier enabled

Message ID 1508346006-5616-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [v1,1/1] linux-gen: pktio: ignore num_queues parameter if classifier enabled | expand

Commit Message

Github ODP bot Oct. 18, 2017, 5 p.m. UTC
From: Maxim Uvarov <maxim.uvarov@linaro.org>


Api defines statemet:
  "When classifier is enabled in odp_pktin_queue_config() this
   value is ignored, otherwise at least one queue is required."
https://bugs.linaro.org/show_bug.cgi?id=3289

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

---
/** Email created from pull request 240 (muvarov:master_bug3289)
 ** https://github.com/Linaro/odp/pull/240
 ** Patch: https://github.com/Linaro/odp/pull/240.patch
 ** Base sha: ec0c3145fcafa09ae3a79875e7e07dd4794583cc
 ** Merge commit sha: 60bc1a69f6144605f6a6139d66169f911390a6a9
 **/
 platform/linux-generic/odp_packet_io.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c
index 5cf94a146..2b6fceae5 100644
--- a/platform/linux-generic/odp_packet_io.c
+++ b/platform/linux-generic/odp_packet_io.c
@@ -1229,7 +1229,12 @@  int odp_pktin_queue_config(odp_pktio_t pktio,
 	if (mode == ODP_PKTIN_MODE_DISABLED)
 		return 0;
 
-	num_queues = param->num_queues;
+	if (param->classifier_enable) {
+		ODP_DBG("num_queues ignored if classifier is enabled\n");
+		num_queues = 1;
+	} else {
+		num_queues = param->num_queues;
+	}
 
 	if (num_queues == 0) {
 		ODP_DBG("pktio %s: zero input queues\n", entry->s.name);