Skip to content

Commit

Permalink
api: cls: deprecate odp_cos_with_l2_priority()
Browse files Browse the repository at this point in the history
PMR term for matching VLAN PCP field has been added previously.
It can be used instead of an odp_cos_with_l2_priority() call
to setup a CoS per VLAN priority. Removing the function as it
is redundant.

Signed-off-by: Petri Savolainen <[email protected]>
Reviewed-by: Jere Leppänen <[email protected]>
Reviewed-by: Kiran Kumar K <[email protected]>
  • Loading branch information
psavol authored and MatiasElo committed Dec 2, 2022
1 parent 79f3932 commit b73c1a5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
11 changes: 5 additions & 6 deletions include/odp/api/spec/classification.h
Original file line number Diff line number Diff line change
Expand Up @@ -828,8 +828,9 @@ odp_cls_drop_t odp_cos_drop(odp_cos_t cos);
#endif

/**
* Request to override per-port class of service
* based on Layer-2 priority field if present.
* Request to override per-port class of service based on Layer-2 priority field if present.
*
* @deprecated Use #ODP_PMR_VLAN_PCP_0 instead.
*
* @param pktio_in Ingress port identifier.
* @param num_qos Number of QoS levels, typically 8.
Expand All @@ -840,10 +841,8 @@ odp_cls_drop_t odp_cos_drop(odp_cos_t cos);
* @retval 0 on success
* @retval <0 on failure
*/
int odp_cos_with_l2_priority(odp_pktio_t pktio_in,
uint8_t num_qos,
uint8_t qos_table[],
odp_cos_t cos_table[]);
int ODP_DEPRECATE(odp_cos_with_l2_priority)(odp_pktio_t pktio_in, uint8_t num_qos,
uint8_t qos_table[], odp_cos_t cos_table[]);

/**
* Request to override per-port class of service based on Layer-3 priority field if present.
Expand Down
6 changes: 2 additions & 4 deletions platform/linux-generic/odp_classification.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,10 +593,8 @@ int odp_pktio_headroom_set(odp_pktio_t pktio_in, uint32_t headroom)
return 0;
}

int odp_cos_with_l2_priority(odp_pktio_t pktio_in,
uint8_t num_qos,
uint8_t qos_table[],
odp_cos_t cos_table[])
int ODP_DEPRECATE(odp_cos_with_l2_priority)(odp_pktio_t pktio_in, uint8_t num_qos,
uint8_t qos_table[], odp_cos_t cos_table[])
{
pmr_l2_cos_t *l2_cos;
uint32_t i;
Expand Down
13 changes: 11 additions & 2 deletions test/validation/api/classification/odp_classification_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ static odp_pool_t pool_default;
static odp_pktio_t pktio_loop;
static odp_pktio_capability_t pktio_capa;
static odp_cls_testcase_u tc;

#ifdef ODP_DEPRECATED
static int global_num_l2_qos;
#endif

#define NUM_COS_PMR_CHAIN 2
#define NUM_COS_DEFAULT 1
Expand Down Expand Up @@ -706,6 +709,8 @@ static void classification_test_pktio_set_headroom(void)
CU_ASSERT(retval < 0);
}

#ifdef ODP_DEPRECATED

void configure_cos_with_l2_priority(odp_bool_t enable_pktv)
{
uint8_t num_qos = CLS_L2_QOS_MAX;
Expand Down Expand Up @@ -750,9 +755,7 @@ void configure_cos_with_l2_priority(odp_bool_t enable_pktv)
odp_cls_cos_param_init(&cls_param);
cls_param.pool = pool;
cls_param.queue = queue_tbl[i];
#if ODP_DEPRECATED_API
cls_param.drop_policy = ODP_COS_DROP_POOL;
#endif

if (enable_pktv) {
cls_param.vector.enable = true;
Expand Down Expand Up @@ -808,6 +811,8 @@ void test_cos_with_l2_priority(odp_bool_t enable_pktv)
}
}

#endif

void configure_pmr_cos(odp_bool_t enable_pktv)
{
uint16_t val;
Expand Down Expand Up @@ -1024,11 +1029,13 @@ static void classification_test_pktio_configure_common(odp_bool_t enable_pktv)
tc.pmr_chain = 1;
num_cos -= NUM_COS_PMR_CHAIN;
}
#ifdef ODP_DEPRECATED
if (num_cos >= NUM_COS_L2_PRIO && TEST_L2_QOS) {
configure_cos_with_l2_priority(enable_pktv);
tc.l2_priority = 1;
num_cos -= NUM_COS_L2_PRIO;
}
#endif
if (num_cos >= NUM_COS_PMR && TEST_PMR) {
configure_pmr_cos(enable_pktv);
tc.pmr_cos = 1;
Expand Down Expand Up @@ -1063,8 +1070,10 @@ static void classification_test_pktio_test_common(odp_bool_t enable_pktv)
test_pktio_error_cos(enable_pktv);
if (tc.pmr_chain && TEST_PMR_CHAIN)
test_cls_pmr_chain(enable_pktv);
#ifdef ODP_DEPRECATED
if (tc.l2_priority && TEST_L2_QOS)
test_cos_with_l2_priority(enable_pktv);
#endif
if (tc.pmr_cos && TEST_PMR)
test_pmr_cos(enable_pktv);
if (tc.pmr_composite_cos && TEST_PMR_SET)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ typedef union odp_cls_testcase {
uint32_t drop_cos:1;
uint32_t error_cos:1;
uint32_t pmr_chain:1;
#ifdef ODP_DEPRECATED
uint32_t l2_priority:1;
#endif
uint32_t pmr_cos:1;
uint32_t pmr_composite_cos:1;
};
Expand Down

0 comments on commit b73c1a5

Please sign in to comment.