void match_set_nw_ecn(struct match *, uint8_t);
void match_set_nw_ttl(struct match *, uint8_t nw_ttl);
void match_set_nw_ttl_masked(struct match *, uint8_t nw_ttl, uint8_t mask);
+void match_set_nw_tos_masked(struct match *, uint8_t nw_tos, uint8_t mask);
void match_set_nw_frag(struct match *, uint8_t nw_frag);
void match_set_nw_frag_masked(struct match *, uint8_t nw_frag, uint8_t mask);
void match_set_icmp_type(struct match *, uint8_t);
match->flow.nw_ttl = nw_ttl;
}
+void
+match_set_nw_tos_masked(struct match *match, uint8_t nw_tos, uint8_t mask)
+{
+ match->flow.nw_tos = nw_tos & mask;
+ match->wc.masks.nw_tos = mask;
+}
+
void
match_set_nw_ttl_masked(struct match *match, uint8_t nw_ttl, uint8_t mask)
{
match_set_nw_proto(match, key->ip_proto);
}
+ match_set_nw_tos_masked(match, key->ip_tos, mask->ip_tos);
match_set_nw_ttl_masked(match, key->ip_ttl, mask->ip_ttl);
if (mask->flags) {
flower.key.ip_proto = key->nw_proto;
flower.mask.ip_proto = mask->nw_proto;
mask->nw_proto = 0;
+ flower.key.ip_tos = key->nw_tos;
+ flower.mask.ip_tos = mask->nw_tos;
+ mask->nw_tos = 0;
flower.key.ip_ttl = key->nw_ttl;
flower.mask.ip_ttl = mask->nw_ttl;
mask->nw_ttl = 0;
mask->tp_dst = 0;
}
- mask->nw_tos = 0;
-
if (key->dl_type == htons(ETH_P_IP)) {
flower.key.ipv4.ipv4_src = key->nw_src;
flower.mask.ipv4.ipv4_src = mask->nw_src;
.optional = true, },
[TCA_FLOWER_KEY_IP_TTL_MASK] = { .type = NL_A_U8,
.optional = true, },
+ [TCA_FLOWER_KEY_IP_TOS] = { .type = NL_A_U8,
+ .optional = true, },
+ [TCA_FLOWER_KEY_IP_TOS_MASK] = { .type = NL_A_U8,
+ .optional = true, },
[TCA_FLOWER_KEY_TCP_FLAGS] = { .type = NL_A_U16,
.optional = true, },
[TCA_FLOWER_KEY_TCP_FLAGS_MASK] = { .type = NL_A_U16,
key->ip_ttl = nl_attr_get_u8(attrs[TCA_FLOWER_KEY_IP_TTL]);
mask->ip_ttl = nl_attr_get_u8(attrs[TCA_FLOWER_KEY_IP_TTL_MASK]);
}
+
+ if (attrs[TCA_FLOWER_KEY_IP_TOS_MASK]) {
+ key->ip_tos = nl_attr_get_u8(attrs[TCA_FLOWER_KEY_IP_TOS]);
+ mask->ip_tos = nl_attr_get_u8(attrs[TCA_FLOWER_KEY_IP_TOS_MASK]);
+ }
}
static enum tc_offloaded_state
if (host_eth_type == ETH_P_IP || host_eth_type == ETH_P_IPV6) {
FLOWER_PUT_MASKED_VALUE(ip_ttl, TCA_FLOWER_KEY_IP_TTL);
+ FLOWER_PUT_MASKED_VALUE(ip_tos, TCA_FLOWER_KEY_IP_TOS);
if (flower->mask.ip_proto && flower->key.ip_proto) {
nl_msg_put_u8(request, TCA_FLOWER_KEY_IP_PROTO,
uint8_t flags;
uint8_t ip_ttl;
+ uint8_t ip_tos;
struct {
ovs_be32 ipv4_src;