[ovs-dev] [PATCH] datapath: Don't query time for every packet.

Jesse Gross jesse at nicira.com
Mon Jul 26 21:47:03 UTC 2010


On Mon, Jul 26, 2010 at 9:59 AM, Ben Pfaff <blp at nicira.com> wrote:

> On Fri, Jul 23, 2010 at 05:03:26PM -0700, Jesse Gross wrote:
> > Rather than actually query the time every time a packet comes through,
> > just store the current jiffies and convert it to actual time when
> > requested.  GRE is the primary beneficiary of this because the traffic
> > travels through the datapath twice.  This change reduces CPU utilization
> > 3-4% with GRE.
>
> Thanks for re-posting this.  It looks fine.
>
> One change that I would find tempting would be to change
> get_time_offset() to return the structure timespec instead of returning
> it through a pointer, and then change the functions and structs that
> have pointers to struct timespec to have actual "struct timespec"s in
> them.  It is somewhat unusual to pass and return structs by value, but
> the timespec_sub() interface shows that this form is used in the kernel.
>
> Then callers could just pass "get_time_offset()" instead of NULL, and
> this code in get_stats() could be dropped:


struct timespec is not very big and it makes the code a little easier to
read, so I made this change and pushed it out.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20100726/fd86e125/attachment-0003.html>


More information about the dev mailing list