2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 22:35:15 +00:00

Introduce 128-bit xxregs.

These are needed to handle IPv6 addresses.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
Justin Pettit
2015-10-31 04:45:28 -07:00
parent 847b8b027a
commit b23ada8eec
13 changed files with 184 additions and 6 deletions

View File

@@ -119,6 +119,28 @@ flow_set_xreg(struct flow *flow, int idx, uint64_t value)
flow->regs[idx * 2 + 1] = value;
}
static inline ovs_u128
flow_get_xxreg(const struct flow *flow, int idx)
{
ovs_u128 value;
value.u64.hi = (uint64_t) flow->regs[idx * 4] << 32;
value.u64.hi |= flow->regs[idx * 4 + 1];
value.u64.lo = (uint64_t) flow->regs[idx * 4 + 2] << 32;
value.u64.lo |= flow->regs[idx * 4 + 3];
return value;
}
static inline void
flow_set_xxreg(struct flow *flow, int idx, ovs_u128 value)
{
flow->regs[idx * 4] = value.u64.hi >> 32;
flow->regs[idx * 4 + 1] = value.u64.hi;
flow->regs[idx * 4 + 2] = value.u64.lo >> 32;
flow->regs[idx * 4 + 3] = value.u64.lo;
}
static inline int
flow_compare_3way(const struct flow *a, const struct flow *b)
{