- New %t and %T log escapes to identify the subprogram within a
cooperating group of processes or threads that emitted a log message.
The default log patterns now include this information.
+ - OpenFlow:
+ - Allow bitwise masking for IPv6 flow label.
v1.8.0 - xx xxx xxxx
void
cls_rule_set_ipv6_label(struct cls_rule *rule, ovs_be32 ipv6_label)
{
- rule->wc.wildcards &= ~FWW_IPV6_LABEL;
- rule->flow.ipv6_label = ipv6_label;
+ cls_rule_set_ipv6_label_masked(rule, ipv6_label, htonl(UINT32_MAX));
+}
+
+void
+cls_rule_set_ipv6_label_masked(struct cls_rule *rule, ovs_be32 ipv6_label,
+ ovs_be32 mask)
+{
+ rule->flow.ipv6_label = ipv6_label & mask;
+ rule->wc.ipv6_label_mask = mask;
}
void
int i;
- BUILD_ASSERT_DECL(FLOW_WC_SEQ == 12);
+ BUILD_ASSERT_DECL(FLOW_WC_SEQ == 13);
if (rule->priority != OFP_DEFAULT_PRIORITY) {
ds_put_format(s, "priority=%d,", rule->priority);
if (f->dl_type == htons(ETH_TYPE_IPV6)) {
format_ipv6_netmask(s, "ipv6_src", &f->ipv6_src, &wc->ipv6_src_mask);
format_ipv6_netmask(s, "ipv6_dst", &f->ipv6_dst, &wc->ipv6_dst_mask);
- if (!(w & FWW_IPV6_LABEL)) {
- ds_put_format(s, "ipv6_label=0x%05"PRIx32",", ntohl(f->ipv6_label));
+ if (wc->ipv6_label_mask) {
+ if (wc->ipv6_label_mask == htonl(UINT32_MAX)) {
+ ds_put_format(s, "ipv6_label=0x%05"PRIx32",",
+ ntohl(f->ipv6_label));
+ } else {
+ ds_put_format(s, "ipv6_label=0x%05"PRIx32"/0x%05"PRIx32",",
+ ntohl(f->ipv6_label),
+ ntohl(wc->ipv6_label_mask));
+ }
}
} else {
format_ip_netmask(s, "nw_src", f->nw_src, wc->nw_src_mask);
const flow_wildcards_t wc = wildcards->wildcards;
int i;
- BUILD_ASSERT_DECL(FLOW_WC_SEQ == 12);
+ BUILD_ASSERT_DECL(FLOW_WC_SEQ == 13);
for (i = 0; i < FLOW_N_REGS; i++) {
if ((a->regs[i] ^ b->regs[i]) & wildcards->reg_masks[i]) {
&& !((a->nw_frag ^ b->nw_frag) & wildcards->nw_frag_mask)
&& (wc & FWW_ARP_SHA || eth_addr_equals(a->arp_sha, b->arp_sha))
&& (wc & FWW_ARP_THA || eth_addr_equals(a->arp_tha, b->arp_tha))
- && (wc & FWW_IPV6_LABEL || a->ipv6_label == b->ipv6_label)
+ && !((a->ipv6_label ^ b->ipv6_label) & wildcards->ipv6_label_mask)
&& ipv6_equal_except(&a->ipv6_src, &b->ipv6_src,
&wildcards->ipv6_src_mask)
&& ipv6_equal_except(&a->ipv6_dst, &b->ipv6_dst,
void cls_rule_set_ipv6_dst_masked(struct cls_rule *, const struct in6_addr *,
const struct in6_addr *);
void cls_rule_set_ipv6_label(struct cls_rule *, ovs_be32);
+void cls_rule_set_ipv6_label_masked(struct cls_rule *, ovs_be32, ovs_be32);
void cls_rule_set_nd_target(struct cls_rule *, const struct in6_addr *);
void cls_rule_set_nd_target_masked(struct cls_rule *, const struct in6_addr *,
const struct in6_addr *);
const flow_wildcards_t wc = wildcards->wildcards;
int i;
- BUILD_ASSERT_DECL(FLOW_WC_SEQ == 12);
+ BUILD_ASSERT_DECL(FLOW_WC_SEQ == 13);
for (i = 0; i < FLOW_N_REGS; i++) {
flow->regs[i] &= wildcards->reg_masks[i];
if (wc & FWW_NW_PROTO) {
flow->nw_proto = 0;
}
- if (wc & FWW_IPV6_LABEL) {
- flow->ipv6_label = htonl(0);
- }
+ flow->ipv6_label &= wildcards->ipv6_label_mask;
if (wc & FWW_NW_DSCP) {
flow->nw_tos &= ~IP_DSCP_MASK;
}
void
flow_get_metadata(const struct flow *flow, struct flow_metadata *fmd)
{
- BUILD_ASSERT_DECL(FLOW_WC_SEQ == 12);
+ BUILD_ASSERT_DECL(FLOW_WC_SEQ == 13);
fmd->tun_id = flow->tun_id;
fmd->tun_id_mask = htonll(UINT64_MAX);
void
flow_wildcards_init_catchall(struct flow_wildcards *wc)
{
- BUILD_ASSERT_DECL(FLOW_WC_SEQ == 12);
+ BUILD_ASSERT_DECL(FLOW_WC_SEQ == 13);
wc->wildcards = FWW_ALL;
wc->tun_id_mask = htonll(0);
wc->nw_dst_mask = htonl(0);
wc->ipv6_src_mask = in6addr_any;
wc->ipv6_dst_mask = in6addr_any;
+ wc->ipv6_label_mask = htonl(0);
wc->nd_target_mask = in6addr_any;
memset(wc->reg_masks, 0, sizeof wc->reg_masks);
wc->metadata_mask = htonll(0);
void
flow_wildcards_init_exact(struct flow_wildcards *wc)
{
- BUILD_ASSERT_DECL(FLOW_WC_SEQ == 12);
+ BUILD_ASSERT_DECL(FLOW_WC_SEQ == 13);
wc->wildcards = 0;
wc->tun_id_mask = htonll(UINT64_MAX);
wc->nw_dst_mask = htonl(UINT32_MAX);
wc->ipv6_src_mask = in6addr_exact;
wc->ipv6_dst_mask = in6addr_exact;
+ wc->ipv6_label_mask = htonl(UINT32_MAX);
wc->nd_target_mask = in6addr_exact;
memset(wc->reg_masks, 0xff, sizeof wc->reg_masks);
wc->metadata_mask = htonll(UINT64_MAX);
{
int i;
- BUILD_ASSERT_DECL(FLOW_WC_SEQ == 12);
+ BUILD_ASSERT_DECL(FLOW_WC_SEQ == 13);
if (wc->wildcards
|| wc->tun_id_mask != htonll(UINT64_MAX)
|| !eth_mask_is_exact(wc->dl_dst_mask)
|| !ipv6_mask_is_exact(&wc->ipv6_src_mask)
|| !ipv6_mask_is_exact(&wc->ipv6_dst_mask)
+ || wc->ipv6_label_mask != htonl(UINT32_MAX)
|| !ipv6_mask_is_exact(&wc->nd_target_mask)
|| wc->nw_frag_mask != UINT8_MAX) {
return false;
{
int i;
- BUILD_ASSERT_DECL(FLOW_WC_SEQ == 12);
+ BUILD_ASSERT_DECL(FLOW_WC_SEQ == 13);
if (wc->wildcards != FWW_ALL
|| wc->tun_id_mask != htonll(0)
|| !eth_addr_is_zero(wc->dl_dst_mask)
|| !ipv6_mask_is_any(&wc->ipv6_src_mask)
|| !ipv6_mask_is_any(&wc->ipv6_dst_mask)
+ || wc->ipv6_label_mask != htonl(0)
|| !ipv6_mask_is_any(&wc->nd_target_mask)
|| wc->nw_frag_mask != 0) {
return false;
{
int i;
- BUILD_ASSERT_DECL(FLOW_WC_SEQ == 12);
+ BUILD_ASSERT_DECL(FLOW_WC_SEQ == 13);
dst->wildcards = src1->wildcards | src2->wildcards;
dst->tun_id_mask = src1->tun_id_mask & src2->tun_id_mask;
&src2->ipv6_src_mask);
dst->ipv6_dst_mask = ipv6_addr_bitand(&src1->ipv6_dst_mask,
&src2->ipv6_dst_mask);
+ dst->ipv6_label_mask = src1->ipv6_label_mask & src2->ipv6_label_mask;
dst->nd_target_mask = ipv6_addr_bitand(&src1->nd_target_mask,
&src2->nd_target_mask);
for (i = 0; i < FLOW_N_REGS; i++) {
/* If you change struct flow_wildcards and thereby trigger this
* assertion, please check that the new struct flow_wildcards has no holes
* in it before you update the assertion. */
- BUILD_ASSERT_DECL(sizeof *wc == 96 + FLOW_N_REGS * 4);
+ BUILD_ASSERT_DECL(sizeof *wc == 104 + FLOW_N_REGS * 4);
return hash_bytes(wc, sizeof *wc, basis);
}
{
int i;
- BUILD_ASSERT_DECL(FLOW_WC_SEQ == 12);
+ BUILD_ASSERT_DECL(FLOW_WC_SEQ == 13);
if (a->wildcards != b->wildcards
|| a->tun_id_mask != b->tun_id_mask
|| a->metadata_mask != b->metadata_mask
|| !ipv6_addr_equals(&a->ipv6_src_mask, &b->ipv6_src_mask)
|| !ipv6_addr_equals(&a->ipv6_dst_mask, &b->ipv6_dst_mask)
+ || a->ipv6_label_mask != b->ipv6_label_mask
|| !ipv6_addr_equals(&a->nd_target_mask, &b->nd_target_mask)
|| a->tp_src_mask != b->tp_src_mask
|| a->tp_dst_mask != b->tp_dst_mask
uint8_t eth_masked[ETH_ADDR_LEN];
struct in6_addr ipv6_masked;
- BUILD_ASSERT_DECL(FLOW_WC_SEQ == 12);
+ BUILD_ASSERT_DECL(FLOW_WC_SEQ == 13);
for (i = 0; i < FLOW_N_REGS; i++) {
if ((a->reg_masks[i] & b->reg_masks[i]) != b->reg_masks[i]) {
|| (a->tun_id_mask & b->tun_id_mask) != b->tun_id_mask
|| (a->nw_src_mask & b->nw_src_mask) != b->nw_src_mask
|| (a->nw_dst_mask & b->nw_dst_mask) != b->nw_dst_mask
+ || (a->ipv6_label_mask & b->ipv6_label_mask) != b->ipv6_label_mask
|| (a->vlan_tci_mask & b->vlan_tci_mask) != b->vlan_tci_mask
|| (a->metadata_mask & b->metadata_mask) != b->metadata_mask
|| (a->tp_src_mask & b->tp_src_mask) != b->tp_src_mask
/* This sequence number should be incremented whenever anything involving flows
* or the wildcarding of flows changes. This will cause build assertion
* failures in places which likely need to be updated. */
-#define FLOW_WC_SEQ 12
+#define FLOW_WC_SEQ 13
#define FLOW_N_REGS 8
BUILD_ASSERT_DECL(FLOW_N_REGS <= NXM_NX_MAX_REGS);
BUILD_ASSERT_DECL(sizeof(struct flow) == FLOW_SIG_SIZE + FLOW_PAD_SIZE);
/* Remember to update FLOW_WC_SEQ when changing 'struct flow'. */
-BUILD_ASSERT_DECL(FLOW_SIG_SIZE == 150 && FLOW_WC_SEQ == 12);
+BUILD_ASSERT_DECL(FLOW_SIG_SIZE == 150 && FLOW_WC_SEQ == 13);
void flow_extract(struct ofpbuf *, uint32_t priority, ovs_be64 tun_id,
uint16_t in_port, struct flow *);
#define FWW_NW_ECN ((OVS_FORCE flow_wildcards_t) (1 << 2))
#define FWW_ARP_SHA ((OVS_FORCE flow_wildcards_t) (1 << 3))
#define FWW_ARP_THA ((OVS_FORCE flow_wildcards_t) (1 << 6))
-#define FWW_IPV6_LABEL ((OVS_FORCE flow_wildcards_t) (1 << 7))
-#define FWW_NW_TTL ((OVS_FORCE flow_wildcards_t) (1 << 8))
-#define FWW_ALL ((OVS_FORCE flow_wildcards_t) (((1 << 9)) - 1))
+#define FWW_NW_TTL ((OVS_FORCE flow_wildcards_t) (1 << 7))
+#define FWW_ALL ((OVS_FORCE flow_wildcards_t) (((1 << 8)) - 1))
/* Remember to update FLOW_WC_SEQ when adding or removing FWW_*. */
-BUILD_ASSERT_DECL(FWW_ALL == ((1 << 9) - 1) && FLOW_WC_SEQ == 12);
+BUILD_ASSERT_DECL(FWW_ALL == ((1 << 8) - 1) && FLOW_WC_SEQ == 13);
/* Information on wildcards for a flow, as a supplement to "struct flow".
*
struct in6_addr ipv6_dst_mask; /* 1-bit in each signficant ipv6_dst bit. */
struct in6_addr nd_target_mask; /* 1-bit in each significant
nd_target bit. */
+ ovs_be32 ipv6_label_mask; /* 1 bit in each significant ipv6_label bit. */
ovs_be16 vlan_tci_mask; /* 1-bit in each significant vlan_tci bit. */
ovs_be16 tp_src_mask; /* 1-bit in each significant tp_src bit. */
ovs_be16 tp_dst_mask; /* 1-bit in each significant tp_dst bit. */
uint8_t nw_frag_mask; /* 1-bit in each significant nw_frag bit. */
uint8_t dl_src_mask[6]; /* 1-bit in each significant dl_src bit. */
uint8_t dl_dst_mask[6]; /* 1-bit in each significant dl_dst bit. */
- uint8_t zeros[1]; /* Padding field set to zero. */
+ uint8_t zeros[5]; /* Padding field set to zero. */
};
/* Remember to update FLOW_WC_SEQ when updating struct flow_wildcards. */
-BUILD_ASSERT_DECL(sizeof(struct flow_wildcards) == 128 && FLOW_WC_SEQ == 12);
+BUILD_ASSERT_DECL(sizeof(struct flow_wildcards) == 136 && FLOW_WC_SEQ == 13);
void flow_wildcards_init_catchall(struct flow_wildcards *);
void flow_wildcards_init_exact(struct flow_wildcards *);
{
MFF_IPV6_LABEL, "ipv6_label", NULL,
4, 20,
- MFM_NONE, FWW_IPV6_LABEL,
+ MFM_FULLY, 0,
MFS_HEXADECIMAL,
MFP_IPV6,
false,
case MFF_IP_DSCP:
case MFF_IP_ECN:
case MFF_IP_TTL:
- case MFF_IPV6_LABEL:
case MFF_ARP_OP:
case MFF_ARP_SHA:
case MFF_ARP_THA:
case MFF_IPV6_DST:
return ipv6_mask_is_any(&wc->ipv6_dst_mask);
+ case MFF_IPV6_LABEL:
+ return !wc->ipv6_label_mask;
+
case MFF_ND_TARGET:
return ipv6_mask_is_any(&wc->nd_target_mask);
break;
case MFF_IPV6_LABEL:
- rule->wc.wildcards |= FWW_IPV6_LABEL;
+ rule->wc.ipv6_label_mask = 0;
rule->flow.ipv6_label = 0;
break;
case MFF_ETH_TYPE:
case MFF_VLAN_VID:
case MFF_VLAN_PCP:
- case MFF_IPV6_LABEL:
case MFF_IP_PROTO:
case MFF_IP_TTL:
case MFF_IP_DSCP:
cls_rule_set_ipv6_dst_masked(rule, &value->ipv6, &mask->ipv6);
break;
+ case MFF_IPV6_LABEL:
+ if ((mask->be32 & htonl(IPV6_LABEL_MASK)) == htonl(IPV6_LABEL_MASK)) {
+ mf_set_value(mf, value, rule);
+ } else {
+ cls_rule_set_ipv6_label_masked(rule, value->be32, mask->be32);
+ }
+ break;
+
case MFF_ND_TARGET:
cls_rule_set_nd_target_masked(rule, &value->ipv6, &mask->ipv6);
break;
int match_len;
int i;
- BUILD_ASSERT_DECL(FLOW_WC_SEQ == 12);
+ BUILD_ASSERT_DECL(FLOW_WC_SEQ == 13);
/* Metadata. */
if (!(wc & FWW_IN_PORT)) {
oxm ? OXM_OF_ICMPV6_TYPE : NXM_NX_ICMPV6_TYPE,
oxm ? OXM_OF_ICMPV6_CODE : NXM_NX_ICMPV6_CODE, oxm);
- if (!(wc & FWW_IPV6_LABEL)) {
- nxm_put_32(b, oxm ? OXM_OF_IPV6_FLABEL : NXM_NX_IPV6_LABEL,
- flow->ipv6_label);
- }
+ nxm_put_32m(b, oxm ? OXM_OF_IPV6_FLABEL : NXM_NX_IPV6_LABEL,
+ flow->ipv6_label, cr->wc.ipv6_label_mask);
if (flow->nw_proto == IPPROTO_ICMPV6
&& (flow->tp_src == htons(ND_NEIGHBOR_SOLICIT) ||
void
ofputil_wildcard_from_ofpfw10(uint32_t ofpfw, struct flow_wildcards *wc)
{
- BUILD_ASSERT_DECL(FLOW_WC_SEQ == 12);
+ BUILD_ASSERT_DECL(FLOW_WC_SEQ == 13);
/* Initialize most of rule->wc. */
flow_wildcards_init_catchall(wc);
wc->wildcards = (OVS_FORCE flow_wildcards_t) ofpfw & WC_INVARIANTS;
/* Wildcard fields that aren't defined by ofp10_match or tun_id. */
- wc->wildcards |= (FWW_ARP_SHA | FWW_ARP_THA | FWW_NW_ECN | FWW_NW_TTL
- | FWW_IPV6_LABEL);
+ wc->wildcards |= FWW_ARP_SHA | FWW_ARP_THA | FWW_NW_ECN | FWW_NW_TTL;
if (ofpfw & OFPFW10_NW_TOS) {
/* OpenFlow 1.0 defines a TOS wildcard, but it's much later in
{
const struct flow_wildcards *wc = &rule->wc;
- BUILD_ASSERT_DECL(FLOW_WC_SEQ == 12);
+ BUILD_ASSERT_DECL(FLOW_WC_SEQ == 13);
/* NXM and OF1.1+ supports bitwise matching on ethernet addresses. */
if (!eth_mask_is_exact(wc->dl_src_mask)
}
/* Only NXM supports matching IPv6 flow label. */
- if (!(wc->wildcards & FWW_IPV6_LABEL)) {
+ if (wc->ipv6_label_mask) {
return OFPUTIL_P_NXM_ANY;
}
}
if (!(may_match & MAY_IPV6)) {
wc.ipv6_src_mask = wc.ipv6_dst_mask = in6addr_any;
- wc.wildcards |= FWW_IPV6_LABEL;
+ wc.ipv6_label_mask = htonl(0);
}
if (!(may_match & MAY_ND_TARGET)) {
wc.nd_target_mask = in6addr_any;
OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL(1000000f)
OXM_OF_IPV6_FLABEL(0000000f)
OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL(0000000f)
+OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/0000000f)
+OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/000fffff)
+OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/000ffff0)
+OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/100fffff)
+OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/ffffffff)
+OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/00000000)
# ND source hardware address
OXM_OF_ETH_TYPE(86dd) OXM_OF_IP_PROTO(3a) OXM_OF_ICMPV6_TYPE(87) OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005) OXM_OF_IPV6_ND_SLL(0002e30f80a4)
nx_pull_match() returned error OFPBMC_BAD_VALUE
nx_pull_match() returned error OFPBMC_BAD_PREREQ
OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL(0000000f)
+OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL_W(0000000f/0000000f)
+OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL(0000000f)
+OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL_W(00000000/000ffff0)
+OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL(0000000f)
+OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL(0000000f)
+OXM_OF_ETH_TYPE(86dd)
# ND source hardware address
OXM_OF_ETH_TYPE(86dd), OXM_OF_IP_PROTO(3a), OXM_OF_ICMPV6_TYPE(87), OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005), OXM_OF_IPV6_ND_SLL(0002e30f80a4)