Hi,
I noticed that alloc_pkt_ctx function calls abort() in case of allocation
failure.
I think a better approach to handle this error is to return a NULL pointer,
free the input buffer (packet) and continue with the schedule loop.

static
pkt_ctx_t *alloc_pkt_ctx(odp_packet_t pkt)
{
        odp_buffer_t ctx_buf = odp_buffer_alloc(ctx_pool);
        pkt_ctx_t *ctx;

        /* There should always be enough contexts */
        if (odp_unlikely(ODP_BUFFER_INVALID == ctx_buf))
                - abort();
                + return NULL;

 if ((completionq != dispatchq) && (seqnumq != dispatchq)) {
                        ctx = alloc_pkt_ctx(pkt);
                       + if (!ctx) {
                       +        odp_buffer_free(buf);
                       +       continue;
                       + }
                        ctx->state = PKT_STATE_INPUT_VERIFY;

Thanks,
Alex
_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to