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

meta-flow: Add 64-bit registers.

These 64-bit registers are intended to conform with the OpenFlow 1.5
draft specification.

EXT-244.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
This commit is contained in:
Ben Pfaff
2014-07-28 09:50:37 -07:00
parent 3eed53e9cf
commit 79fe0f4611
10 changed files with 145 additions and 3 deletions

View File

@@ -40,9 +40,16 @@ struct pkt_metadata;
* failures in places which likely need to be updated. */
#define FLOW_WC_SEQ 27
/* Number of Open vSwitch extension 32-bit registers. */
#define FLOW_N_REGS 8
BUILD_ASSERT_DECL(FLOW_N_REGS <= NXM_NX_MAX_REGS);
/* Number of OpenFlow 1.5+ 64-bit registers.
*
* Each of these overlays a pair of Open vSwitch 32-bit registers, so there
* are half as many of them.*/
#define FLOW_N_XREGS (FLOW_N_REGS / 2)
/* Used for struct flow's dl_type member for frames that have no Ethernet
* type, that is, pure 802.2 frames. */
#define FLOW_DL_TYPE_NONE 0x5ff
@@ -208,6 +215,19 @@ void flow_set_mpls_lse(struct flow *, int idx, ovs_be32 lse);
void flow_compose(struct ofpbuf *, const struct flow *);
static inline uint64_t
flow_get_xreg(const struct flow *flow, int idx)
{
return ((uint64_t) flow->regs[idx * 2] << 32) | flow->regs[idx * 2 + 1];
}
static inline void
flow_set_xreg(struct flow *flow, int idx, uint64_t value)
{
flow->regs[idx * 2] = value >> 32;
flow->regs[idx * 2 + 1] = value;
}
static inline int
flow_compare_3way(const struct flow *a, const struct flow *b)
{
@@ -291,6 +311,8 @@ bool flow_wildcards_is_catchall(const struct flow_wildcards *);
void flow_wildcards_set_reg_mask(struct flow_wildcards *,
int idx, uint32_t mask);
void flow_wildcards_set_xreg_mask(struct flow_wildcards *,
int idx, uint64_t mask);
void flow_wildcards_and(struct flow_wildcards *dst,
const struct flow_wildcards *src1,