On Thu, Dec 17, 2015 at 09:01:14PM -0800, Stephen Hemminger wrote:
...
> > +
> > +   switch (count % 4) {
> > +   while (idx != count) {
> > +           case 0:
> > +                   RTE_MBUF_ASSERT(rte_mbuf_refcnt_read(mbufs[idx]) == 0);
> > +                   rte_mbuf_refcnt_set(mbufs[idx], 1);
> > +                   rte_pktmbuf_reset(mbufs[idx]);
> > +                   idx++;
> > +           case 3:
> > +                   RTE_MBUF_ASSERT(rte_mbuf_refcnt_read(mbufs[idx]) == 0);
> > +                   rte_mbuf_refcnt_set(mbufs[idx], 1);
> > +                   rte_pktmbuf_reset(mbufs[idx]);
> > +                   idx++;
> > +           case 2:
> > +                   RTE_MBUF_ASSERT(rte_mbuf_refcnt_read(mbufs[idx]) == 0);
> > +                   rte_mbuf_refcnt_set(mbufs[idx], 1);
> > +                   rte_pktmbuf_reset(mbufs[idx]);
> > +                   idx++;
> > +           case 1:
> > +                   RTE_MBUF_ASSERT(rte_mbuf_refcnt_read(mbufs[idx]) == 0);
> > +                   rte_mbuf_refcnt_set(mbufs[idx], 1);
> > +                   rte_pktmbuf_reset(mbufs[idx]);
> > +                   idx++;
> > +   }
> > +   }
> > +   return 0;
> > +}
> 
> This is weird. Why not just use Duff's device in a more normal manner.

Duff's device; interesting and good to know. Thanks.

        --yliu

Reply via email to