From 3b722b2be0e1b7889d3dbada28a76c8b049b28c6 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Fri, 15 May 2026 13:21:39 +0300 Subject: [PATCH 1/2] api: pktio: clarify odp_pktio_default_cos_set() specification Clarify that odp_pktio_default_cos_set() may be called multiple times for the same pktio and that each successful call replaces the previous default CoS binding. Signed-off-by: Matias Elo --- include/odp/api/spec/packet_io.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h index 6c70e3192b..07dc05694d 100644 --- a/include/odp/api/spec/packet_io.h +++ b/include/odp/api/spec/packet_io.h @@ -678,17 +678,19 @@ int odp_pktio_mac_addr_set(odp_pktio_t pktio, const void *mac_addr, int size); /** - * Setup per-port default class-of-service. + * Setup interface default class-of-service * - * @param pktio Ingress port pktio handle. - * @param default_cos Class-of-service set to all packets arriving at this - * ingress port. Use ODP_COS_INVALID to remove the default - * CoS. + * Set default CoS for packets arriving from this packet IO interface, or remove + * the current default CoS by passing ODP_COS_INVALID as 'default_cos'. The + * 'default_cos' must be unique per odp_pktio_t instance. This function may be + * called multiple times on the same interface, and each successful call + * replaces the previous default CoS binding. + * + * @param pktio Packet IO handle + * @param default_cos CoS handle or ODP_COS_INVALID * * @retval 0 on success * @retval <0 on failure - * - * @note The default_cos has to be unique per odp_pktio_t instance. */ int odp_pktio_default_cos_set(odp_pktio_t pktio, odp_cos_t default_cos); From 5c394669d29ae8d7e20dfd8fa902fb522401da00 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Fri, 15 May 2026 13:32:01 +0300 Subject: [PATCH 2/2] api: pktio: clarify odp_pktio_error_cos_set() spec Clarify that odp_pktio_error_cos_set() may be called multiple times for the same pktio and that each successful call replaces the previous error CoS binding. Also, explicitly state that a CoS must not be used as error CoS when calling odp_cos_destroy(). Signed-off-by: Matias Elo --- include/odp/api/spec/classification.h | 4 ++-- include/odp/api/spec/packet_io.h | 19 +++++++++++++------ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/include/odp/api/spec/classification.h b/include/odp/api/spec/classification.h index c10ee0addd..52091bbfbc 100644 --- a/include/odp/api/spec/classification.h +++ b/include/odp/api/spec/classification.h @@ -855,8 +855,8 @@ odp_queue_t odp_cls_hash_result(odp_cos_t cos, odp_packet_t packet); * * Before destroying a CoS, all the PMRs referring to the CoS (as a source or * destination CoS) must be destroyed first. Also, the CoS must not be in use - * as the default CoS in any pktio (see odp_pktio_default_cos_set()) or as the - * destination CoS of any IPsec SA. + * as the default or error CoS in any pktio (see odp_pktio_default_cos_set() and + * odp_pktio_error_cos_set()), or as the destination CoS of any IPsec SA. * * @param cos CoS handle * diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h index 07dc05694d..97e5c44ac2 100644 --- a/include/odp/api/spec/packet_io.h +++ b/include/odp/api/spec/packet_io.h @@ -695,16 +695,23 @@ int odp_pktio_mac_addr_set(odp_pktio_t pktio, const void *mac_addr, int odp_pktio_default_cos_set(odp_pktio_t pktio, odp_cos_t default_cos); /** - * Setup per-port error class-of-service + * Setup interface error class-of-service * - * @param pktio Ingress port pktio handle. - * @param error_cos class-of-service set to all packets arriving at this - * ingress port that contain an error. + * Set CoS for packets arriving from this packet IO interface that contain + * errors detected during packet parsing, or remove the current error CoS by + * passing ODP_COS_INVALID as 'error_cos'. This function may be called multiple + * times on the same interface, and each successful call replaces the previous + * error CoS binding. + * + * When no error CoS is configured, it's implementation defined how packets with + * parsing errors are handled (they may be discarded similarly to classification + * failures). + * + * @param pktio Packet IO handle + * @param error_cos CoS handle or ODP_COS_INVALID * * @retval 0 on success * @retval <0 on failure - * - * @note Optional. */ int odp_pktio_error_cos_set(odp_pktio_t pktio, odp_cos_t error_cos);