Re: [net-next PATCH v2 1/2] net: pktgen: support injecting packets for qdisc testing

John Fastabend
2016-06-30T16:57:57Z

On 16-06-30 01:37 AM, Jesper Dangaard Brouer wrote:
> On Wed, 29 Jun 2016 13:03:06 -0700
> John Fastabend <john.fastabend@gmail.com> wrote:
>
>> Add another xmit_mode to pktgen to allow testing xmit functionality
>> of qdiscs. The new mode "queue_xmit" injects packets at
>> __dev_queue_xmit() so that qdisc is called.
>>
>> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
>
> I generally like this.
>

[...]

>> @@ -3434,6 +3442,36 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev)
>> #endif
>> } while (--burst > 0);
>> goto out; /* Skips xmit_mode M_START_XMIT */
>> + } else if (pkt_dev->xmit_mode == M_QUEUE_XMIT) {
>> + local_bh_disable();
>> + atomic_add(burst, &pkt_dev->skb->users);
>
> Reading the code, people might think that "burst" is allowed for this
> mode, which it is not. (You do handle this earlier in this patch when
> configuring this mode).

Right we never get here without burst == 1 but sure it does read
a bit strange I'll use atomic_inc().

Thanks,
John