aboutsummaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorJere Leppänen <jere.leppanen@nokia.com>2023-01-22 12:45:26 +0200
committerMatias Elo <matias.elo@nokia.com>2023-04-12 13:38:07 +0300
commit04fa670e4fe68b623379a5538313922f555b152a (patch)
tree0da8865ad179d2d7ef8a070ed9f088bd04c9477a /platform
parent1e8a42374caf97b3554eb482cb5ae7ecd9b6b3c5 (diff)
linux-gen: cls: allow default CoS to be set to ODP_COS_INVALID
Allow default CoS to be set to ODP_COS_INVALID. If default CoS is set to ODP_COS_INVALID and classifier is enabled, all received packets are discarded. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Kiran Kumar K <kirankumark@marvell.com>
Diffstat (limited to 'platform')
-rw-r--r--platform/linux-generic/odp_classification.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c
index 1c5ff0f74..a01c6d183 100644
--- a/platform/linux-generic/odp_classification.c
+++ b/platform/linux-generic/odp_classification.c
@@ -534,17 +534,20 @@ odp_cls_drop_t odp_cos_drop(odp_cos_t cos_id)
int odp_pktio_default_cos_set(odp_pktio_t pktio_in, odp_cos_t default_cos)
{
pktio_entry_t *entry;
- cos_t *cos;
+ cos_t *cos = NULL;
entry = get_pktio_entry(pktio_in);
if (entry == NULL) {
_ODP_ERR("Invalid odp_pktio_t handle\n");
return -1;
}
- cos = get_cos_entry(default_cos);
- if (cos == NULL) {
- _ODP_ERR("Invalid odp_cos_t handle\n");
- return -1;
+
+ if (default_cos != ODP_COS_INVALID) {
+ cos = get_cos_entry(default_cos);
+ if (cos == NULL) {
+ _ODP_ERR("Invalid odp_cos_t handle\n");
+ return -1;
+ }
}
entry->cls.default_cos = cos;