mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 14:25:26 +00:00
lib/tc: Support matching on ip tos
Add the missing code to match on ip tos when dealing with the TC data-path. Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Simon Horman <simon.horman@netronome.com>
This commit is contained in:
10
lib/tc.c
10
lib/tc.c
@@ -302,6 +302,10 @@ static const struct nl_policy tca_flower_policy[] = {
|
||||
.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,
|
||||
@@ -497,6 +501,11 @@ nl_parse_flower_ip(struct nlattr **attrs, struct tc_flower *flower) {
|
||||
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
|
||||
@@ -1626,6 +1635,7 @@ nl_msg_put_flower_options(struct ofpbuf *request, struct tc_flower *flower)
|
||||
|
||||
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,
|
||||
|
Reference in New Issue
Block a user