2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-07 13:40:45 +00:00

Expand tunnel IDs from 32 to 64 bits.

We have a need to identify tunnels with keys longer than 32 bits.  This
commit adds basic datapath and OpenFlow support for such keys.  It doesn't
actually add any tunnel protocols that support 64-bit keys, so this is not
very useful yet.

The 'arg' member of struct odp_msg had to be expanded to 64-bits also,
because it sometimes contains a tunnel ID.  This member also contains the
argument passed to ODPAT_CONTROLLER, so I expanded that action's argument
to 64 bits also so that it can use the full width of the expanded 'arg'.
Userspace doesn't take advantage of the new space though (it was only
using 16 bits anyhow).

This commit has been tested only to the extent that it doesn't disrupt
basic Open vSwitch operation.  I have not tested it with tunnel traffic.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Feature #3976.
This commit is contained in:
Ben Pfaff
2010-12-10 10:42:42 -08:00
parent ff9d38264c
commit b9298d3f82
25 changed files with 165 additions and 90 deletions

View File

@@ -128,7 +128,7 @@ cls_rule_set_reg_masked(struct cls_rule *rule, unsigned int reg_idx,
}
void
cls_rule_set_tun_id(struct cls_rule *rule, ovs_be32 tun_id)
cls_rule_set_tun_id(struct cls_rule *rule, ovs_be64 tun_id)
{
rule->wc.wildcards &= ~FWW_TUN_ID;
rule->flow.tun_id = tun_id;
@@ -394,7 +394,7 @@ cls_rule_format(const struct cls_rule *rule, struct ds *s)
}
}
if (!(w & FWW_TUN_ID)) {
ds_put_format(s, "tun_id=0x%"PRIx32",", ntohl(f->tun_id));
ds_put_format(s, "tun_id=0x%"PRIx64",", ntohll(f->tun_id));
}
if (!(w & FWW_IN_PORT)) {
ds_put_format(s, "in_port=%"PRIu16",",
@@ -932,7 +932,7 @@ flow_equal_except(const struct flow *a, const struct flow *b,
const flow_wildcards_t wc = wildcards->wildcards;
int i;
BUILD_ASSERT_DECL(FLOW_SIG_SIZE == 36 + FLOW_N_REGS * 4);
BUILD_ASSERT_DECL(FLOW_SIG_SIZE == 40 + FLOW_N_REGS * 4);
for (i = 0; i < FLOW_N_REGS; i++) {
if ((a->regs[i] ^ b->regs[i]) & wildcards->reg_masks[i]) {
@@ -968,7 +968,7 @@ zero_wildcards(struct flow *flow, const struct flow_wildcards *wildcards)
const flow_wildcards_t wc = wildcards->wildcards;
int i;
BUILD_ASSERT_DECL(FLOW_SIG_SIZE == 36 + 4 * FLOW_N_REGS);
BUILD_ASSERT_DECL(FLOW_SIG_SIZE == 40 + 4 * FLOW_N_REGS);
for (i = 0; i < FLOW_N_REGS; i++) {
flow->regs[i] &= wildcards->reg_masks[i];