Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PATCH v1] validation: cls: add capability check for hash result test #2183

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

satheeshpaul
Copy link
Contributor

Added capability check for odp_cls_hash_result() validation test.

Signed-off-by: Satheesh Paul [email protected]

Added capability check for `odp_cls_hash_result()` validation test.

Signed-off-by: Satheesh Paul <[email protected]>
@odpbuild odpbuild changed the title validation: cls: add capability check for hash result test [PATCH v1] validation: cls: add capability check for hash result test Feb 25, 2025
@@ -707,7 +707,6 @@ static void cls_create_cos_with_hash_queues(void)

ret = odp_cls_capability(&capa);
CU_ASSERT_FATAL(ret == 0);
CU_ASSERT_FATAL(capa.hash_protocols.all_bits != 0);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit message lacks any mention of this change. And this change looks wrong anyway, since this test function is run only when multiple hash queues are supported and that in turn implies that there must be at least one protocol field included in the hash.

@@ -733,6 +732,9 @@ static int check_capa_cos_hashing(void)
if (odp_cls_capability(&capa) != 0)
return ODP_TEST_INACTIVE;

if (capa.hash_protocols.all_bits == 0)
return ODP_TEST_INACTIVE;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking the value of max_hash_queues is sufficient for testing if hash is supported. There should not be a case where max_hash_queues is greater than one but hash_protocols.all_bits is zero.

@@ -835,7 +837,7 @@ odp_testinfo_t classification_suite_basic[] = {
ODP_TEST_INFO(cls_cos_set_pool),
ODP_TEST_INFO(cls_pmr_composite_create),
ODP_TEST_INFO_CONDITIONAL(cls_create_cos_with_hash_queues, check_capa_cos_hashing),
ODP_TEST_INFO(cls_hash_result_single_queue),
ODP_TEST_INFO_CONDITIONAL(cls_hash_result_single_queue, check_capa_cos_hashing),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cls_hash_result_single_queue() is intended to be run even if hashing is not supported. In that odp_cls_hash_result() is supposed to return the single queue configured for the CoS. The spec for odp_cls_hash_result() does not say that it depends on hash capability and it appears that the function was meant to be usable for any CoS without the caller having to know the capabilities or the configured queues in the CoS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants