[ovs-dev] [PATCH 2/3] datapath: Mega flow implementation

Andy Zhou azhou at nicira.com
Fri Jun 7 14:39:34 UTC 2013


Thanks for the suggestion.

The kernel source I am looking at: 3.9.0-rc8, does not a accessible
definition of ROUND_UP,  but roundup(x,y) is, and fits the bill.  I am
thinking of using it instead, unless it breaks on some older kernel version
that we care about.

>From kernel.h:

/* The `const' in roundup() prevents gcc-3.3 from calling __divdi3 */
#define roundup(x, y) (                 \
{                           \
    const typeof(y) __y = y;            \
    (((x) + (__y - 1)) / __y) * __y;        \
}


On Fri, Jun 7, 2013 at 7:19 AM, Rajahalme, Jarno (NSN - FI/Espoo) <
jarno.rajahalme at nsn.com> wrote:

>
>  On Jun 7, 2013, at 13:35 , ext Andy Zhou wrote:
>
>  Is this the same as DIV_ROUND_UP?
>>
> I did not use it because DIV_ROUND_UP gives the roundup of u32, I needed
> the roundup in bytes.  However, I could rewrite this function using
> DIV_ROUND_UP.
>
>
> There is ROUND_UP doing that already.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20130607/708e7933/attachment-0003.html>


More information about the dev mailing list