https://bugs.linaro.org/show_bug.cgi?id=3578

            Bug ID: 3578
           Summary: classification: requested number of queues is ignored
                    in multiqueue CoS
           Product: OpenDataPlane - linux- generic reference
           Version: master
          Hardware: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: minor
          Priority: ---
         Component: Classification
          Assignee: bala.manoha...@linaro.org
          Reporter: or...@starflownetworks.com
                CC: lng-odp@lists.linaro.org
  Target Milestone: ---

When a multiqueue CoS is created in odp_cls_cos_create(), up to
`CLS_COS_QUEUE_MAX` queues can be requested by the user.

But the requested number (`param->num_queue`) is ignored and all possible
queues per CoS (CLS_COS_QUEUE_MAX) are created:

  if (param->num_queue > 1) {
    ...
    for (j = 0; j < CLS_COS_QUEUE_MAX; j++) {
      queue = odp_queue_create(NULL, &cos->s.queue_param);
      ...
      queue_grp_tbl->s.queue[tbl_index + j] = queue;
    }
    ...
  }

In cls_classify_packet(), all possible queues are used to select the queue:

  hash = hash & (CLS_COS_QUEUE_MAX - 1);
  tbl_index = (cos->s.index * CLS_COS_QUEUE_MAX) + hash;
  pkt_hdr->dst_queue = queue_fn->from_ext(queue_grp_tbl->s.queue[tbl_index]);

So effectively `CLS_COS_QUEUE_MAX` queues are used per CoS, regardless of the
requested number. However, the semantics of the API allow the user to access
the requested queues only, and the queues created in excess remain
inaccessible:

  - uint32_t odp_cls_cos_num_queue(odp_cos_t cos_id);
  - uint32_t odp_cls_cos_queues(odp_cos_t cos_id, odp_queue_t queue[],
                                uint32_t num);
  - etc.

To fix this:

  1. Only the requested number of queues should be created.

  for (j = 0; j < param->num_queue; j++) {

  2. Packet hash should only select the created queues:

  tbl_index = (cos->s.index * CLS_COS_QUEUE_MAX) + (hash % cos->s.num_queue);

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to