Skip to content

[PATCH v2] fix: cls: invalid CoS index#405

Closed
bala-manoharan wants to merge 2 commits intoOpenDataPlane:masterfrom
bala-manoharan:bug3576
Closed

[PATCH v2] fix: cls: invalid CoS index#405
bala-manoharan wants to merge 2 commits intoOpenDataPlane:masterfrom
bala-manoharan:bug3576

Conversation

@bala-manoharan
Copy link
Contributor

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

Signed-off-by: Balasubramanian Manoharan bala.manoharan@linaro.org

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

Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>
@muvarov muvarov changed the title fix: cls: invalid CoS index [PATCH v1] fix: cls: invalid CoS index Jan 18, 2018
_odp_cls_update_hash_proto(cos,
param->hash_proto);
tbl_index = cos->s.index * CLS_COS_QUEUE_MAX;
tbl_index = i * CLS_COS_QUEUE_MAX;
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we're bug fixing here, if the odp_queue_create() call below fails, it should unwind the previous successful creates before returning ODP_COS_INVALID to avoid leaking queues:

for (j = 0; j < CLS_COS_QUEUE_MAX; j++) {
        queue = odp_queue_create(NULL, &cos->s.queue_param);
        if (queue == ODP_QUEUE_INVALID) {
                while (j > 0) 
                    odp_queue_destroy(queue_grp_tbl->s.queue[tbl_index + j--]);
                UNLOCK(&cos->s.lock);
                return ODP_COS_INVALID;
        }
        queue_grp_tbl->s.queue[tbl_index + j] = queue;
}

This could be a separate commit or PR as you prefer.

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

Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>
@muvarov muvarov changed the title [PATCH v1] fix: cls: invalid CoS index [PATCH v2] fix: cls: invalid CoS index Jan 19, 2018
@codecov
Copy link

codecov bot commented Jan 19, 2018

Codecov Report

Merging #405 into master will decrease coverage by 0.066%.
The diff coverage is 0%.

@@              Coverage Diff              @@
##            master      #405       +/-   ##
=============================================
- Coverage   78.574%   78.508%   -0.067%     
=============================================
  Files          196       196               
  Lines        34818     34818               
=============================================
- Hits         27358     27335       -23     
- Misses        7460      7483       +23
Impacted Files Coverage Δ
platform/linux-generic/odp_classification.c 66.666% <0%> (ø) ⬆️
platform/linux-generic/odp_sorted_list.c 63.114% <0%> (-13.935%) ⬇️
platform/linux-generic/odp_traffic_mngr.c 78.726% <0%> (-0.255%) ⬇️
platform/linux-generic/odp_timer_wheel.c 88.497% <0%> (-0.235%) ⬇️
test/validation/api/traffic_mngr/traffic_mngr.c 68.801% <0%> (-0.111%) ⬇️
platform/linux-generic/_ishm.c 67.376% <0%> (+0.266%) ⬆️
platform/linux-generic/pktio/ipc.c 78.612% <0%> (+0.289%) ⬆️

@Bill-Fischofer-Linaro
Copy link
Contributor

@muvarov Not clear why checkpatch is failing on this PR. It looks like it's failing to launch properly. I've forced a restart of the test but it's still getting the same result.

@muvarov
Copy link
Contributor

muvarov commented Jan 22, 2018

@Bill-Fischofer-Linaro looks like github but to deliver right commit sha to validate. Top level checkpatch check is passed. So it has to be ok.

@muvarov
Copy link
Contributor

muvarov commented Jan 22, 2018

Merged.

@muvarov muvarov closed this Jan 22, 2018
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.

3 participants

Comments