Hi Eric,

Yes, that is correct that only Packets allocated by mPIPE get to this function. The PACKET_TEST_ACTION macro has a test of root, which can’t be true at this point, so I left this as Tom originally wrote it, but since it is failing a QA test, I will change it to use the macro.

Cheers,
-Ken

From: Eric Leblond [mailto:notifications@github.com]
Sent: Friday, July 26, 2013 10:08 AM
To: inliniac/suricata
Cc: Kenneth Steele
Subject: Re: [suricata] Initial Tile mPIPE support (#462)


In src/source-mpipe.c:

> +    edesc.words[1] = 0;

> +    edesc.bound = 1;

> +    edesc.xfer_size = p->mpipe_v.idesc.l2_size;

> +    edesc.va = p->mpipe_v.idesc.va;

> +    edesc.stack_idx = p->mpipe_v.idesc.stack_idx;

> +    edesc.hwb = 1; /* mPIPE will return packet buffer to proper stack. */

> +    edesc.size = p->mpipe_v.idesc.size;

> +    int channel = p->mpipe_v.idesc.channel;

> +    /* Tell mPIPE to egress the packet. */

> +    gxio_mpipe_equeue_put(channel_to_equeue[channel].peer_equeue, edesc);

> +}

> +

> +/* Release Packet and send copy if action is not DROP. */

> +void MpipeReleasePacketCopyIPS(Packet *p)

> +{

> +    if (unlikely(p->action & ACTION_DROP)) {

Ken, I don't get your point. It I read your code correctly, the MpipeReleasePacket* function are only set on packet read from the card. So a pseudo packet should never reached this point. So it is sane to use the PACKET_TEST_ACTION macro that will have an equivalent behevior/

—
Reply to this email directly or view it on GitHub<https://github.com/inliniac/suricata/pull/462/files#r5423096>.