[ovs-dev] [PATCH v2] miniflow: Remove unused values_inline branch from miniflow_move()

Jarno Rajahalme jrajahalme at nicira.com
Tue Aug 26 22:46:23 UTC 2014

On Aug 26, 2014, at 3:29 PM, Thomas Graf <tgraf at noironetworks.com> wrote:

> On 08/26/14 at 12:02pm, Jarno Rajahalme wrote:
>> Miniflows can also be dynamically allocated to have more inline space than the default amount. classifier.c makes use of that, but it never calls miniflow_move (even indirectly) so you are not getting an assert fail. The motivation for right-sized miniflows in the classifier is to reduce levels of indirection while not wasting memory.
> I even did a grep for additional alloc sites but missed the embedded
> miniflow in cls_match. Neat but really non obvious ;-)
> The code looked so extremely wrong with dead code branch *plus*
> out of bounds access of the array. Sorry for the noise.

No worries :-) It’s always nice to have another set of eyes on the code!

>> /* Initializes 'dst' with the data in 'src', destroying 'src'.
>> * The caller must eventually free 'dst' with miniflow_destroy().
>> * 'dst' must be regularly sized miniflow, but 'src' can have
>> * larger than default inline values. */
> Maybe also adjust this comment a bit. I didn't get that "larger
> than default inline values" refers to the *size* of
> inline_values.

Done in a patch I just sent out.


More information about the dev mailing list