[ovs-discuss] Metadata 0 in flow struct

Ben Pfaff blp at ovn.org
Wed Dec 4 22:23:57 UTC 2019

On Mon, Dec 02, 2019 at 04:41:34PM -0800, Nick wrote:
> I'm trying to export metadata as an extra field for IPFIX export and I've
> added the logic to the `ofproto-dpif-ipfix.c` file but the `flow->metadata`
> value that I'm setting is always zero. I set metadata in table 0 with
> `actions=load:12345->metadata`, and my ipfix export sample action is in
> table 1, I've assumed it would be populated but apparently not. Is there
> something I'm missing here?

I think what you are most likely seeing is a difference between flow
translation and flow execution.  The "metadata" field (and other
metadata fields like reg0...reg15) are only significant during the flow
translation step.  They do not generally matter for execution, so they
get discarded.  Your new feature is introducing a need for the field in
question at execution time.  The way to deal with that is probably to
save the metadata field at translation time and pass it to the userspace
ipfix action.  You could put it in, for example, the ipfix member of
struct user_action_cookie.

More information about the discuss mailing list