diff mbox series

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

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

Commit Message

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


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: 3ce9d6ab16d064b0f83508e2f0b2e476d64b15e1
 ** Merge commit sha: c38e7fcc8cefc49f85a8cb7422a9d885788894c4
 **/
 platform/linux-generic/odp_classification.c | 6 ++++--
 1 file changed, 4 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..5447afa92 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,10 +221,11 @@  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;
 
+	/* Packets are dropped if Queue (except hashing) or Pool is invalid */
 	drop_policy = param->drop_policy;
 
 	for (i = 0; i < CLS_COS_MAX_ENTRY; i++) {