[ovs-dev] [PATCH] netdev-provider: Apply batch object to netdev provider.

Ben Pfaff blp at ovn.org
Sat Jun 25 06:29:38 UTC 2016


Thanks.  Please add this rationale to the commit message.

On Fri, Jun 24, 2016 at 10:55:02PM -0700, William Tu wrote:
> 1. We can use batch API:
> Example1:
> -            for (i = 0; i < cnt; i++) {
> -                dp_packet_delete(pkts[i]);
> -            }
> +            dp_packet_delete_batch(batch, may_steal);
> 
> Example2:
> -        for (i = 0; i < cnt; i++) {
> -            int cutlen = dp_packet_get_cutlen(pkts[i]);
> -
> -            dp_packet_set_size(pkts[i], dp_packet_size(pkts[i]) - cutlen);
> -            dp_packet_reset_cutlen(pkts[i]);
> -        }
> -        __netdev_dpdk_vhost_send(netdev, qid, pkts, cnt, may_steal);
> +        dp_packet_batch_apply_cutlen(batch);
> +        __netdev_dpdk_vhost_send(netdev, qid, batch, may_steal);
> 
> 2. Certain batch-level attribute can be passed into netdev provider to
> avoid loop. For example:
> Commit aaca4fe0ce9 introduces 'trunc' in dp_packet_batch.
> if batch->trunc == false, then the entire batch of packet can skip the
> truncate action, we don't need to loop into each packet and check.
> 
> Regards,
> William
> 
> On Fri, Jun 24, 2016 at 10:35 PM, Ben Pfaff <blp at ovn.org> wrote:
> > On Fri, Jun 24, 2016 at 04:11:47PM -0700, William Tu wrote:
> >> This patch applies the packet batch object to the netdev providers,
> >> including dummy, Linux, BSD, and DPDK.
> >>
> >> Tested-at: https://travis-ci.org/williamtu/ovs-travis/builds/140135888
> >> Signed-off-by: William Tu <u9012063 at gmail.com>
> >
> > What's the benefit?
> >
> > I haven't read the patch yet.
> >
> > Thanks,
> >
> > Ben.



More information about the dev mailing list