我想了解如何在Open规则中计算元数据。
元数据=0xf30000000000/0xffff0000000000 actions=write_metadata:0xc000f30000000000/0xfffffffffffffffe,goto_table:211
我有一个非常类似于此的流程。元数据是如何计算的。
以及如何导入元数据值和掩码
有人说new_metadata = old_metadata &~掩蔽值& Mask
老实说,我不明白,有人能解释一下吗?
发布于 2018-12-16 17:20:11
value和metadata字段在write_metadata动作中的用途用开放的vSwitch文档解释。
write_metadata:value[/mask]
Updates the metadata field for the flow. If mask is omit‐
ted, the metadata field is set exactly to value; if mask
is specified, then a 1-bit in mask indicates that the
corresponding bit in the metadata field will be replaced
with the corresponding bit from value. Both value and
mask are 64-bit values that are decimal by default; use a
0x prefix to specify them in hexadecimal.上述解释实际上相当于:
new_metadata = (old_metadata & ~mask) | (value & mask)换句话说,我们首先删除在掩码(old_metadata & ~mask)中设置为1的旧元数据值的位,然后将在掩码(| (value & mask))中也设置为1的值的位设置为1。
https://stackoverflow.com/questions/53771023
复制相似问题