diff mbox series

[v2,1/1] linux-gen: cls: fix: update capability to return max hash queues

Message ID 1516726812-17319-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [v2,1/1] linux-gen: cls: fix: update capability to return max hash queues | expand

Commit Message

Github ODP bot Jan. 23, 2018, 5 p.m. UTC
From: Balasubramanian Manoharan <bala.manoharan@linaro.org>


updates cls capability to return max supported hash queues
Fixes: https://bugs.linaro.org/show_bug.cgi?id=3579

Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>

---
/** Email created from pull request 418 (bala-manoharan:BUG3579)
 ** https://github.com/Linaro/odp/pull/418
 ** Patch: https://github.com/Linaro/odp/pull/418.patch
 ** Base sha: b122176ee59494dd957f0f5ff41d4b55a1477e13
 ** Merge commit sha: 675214846a9348c9bc766e2ddd7aa02db63469b1
 **/
 platform/linux-generic/odp_classification.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c
index 5aa3b84a1..5dcf20a0c 100644
--- a/platform/linux-generic/odp_classification.c
+++ b/platform/linux-generic/odp_classification.c
@@ -194,6 +194,7 @@  int odp_cls_capability(odp_cls_capability_t *capability)
 	capability->back_pressure = ODP_SUPPORT_NO;
 	capability->threshold_red.all_bits = 0;
 	capability->threshold_bp.all_bits = 0;
+	capability->max_hash_queues = CLS_COS_QUEUE_MAX;
 	return 0;
 }
 
@@ -220,8 +221,8 @@  odp_cos_t odp_cls_cos_create(const char *name, odp_cls_cos_param_t *param)
 	cos_t *cos;
 	uint32_t tbl_index;
 
-	/* Packets are dropped if Queue or Pool is invalid*/
-	if (param->num_queue > CLS_COS_QUEUE_MAX)
+	/* num_queue should not be zero */
+	if (param->num_queue > CLS_COS_QUEUE_MAX || param->num_queue < 1)
 		return ODP_COS_INVALID;
 
 	drop_policy = param->drop_policy;