mirror of
https://github.com/openvswitch/ovs
synced 2025-09-03 15:55:19 +00:00
tc: Add matching on tcp flags
To be used later for offloading rules matching on tcp_flags. Signed-off-by: Paul Blakey <paulb@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Acked-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: Joe Stringer <joe@ovn.org>
This commit is contained in:
committed by
Joe Stringer
parent
7cb3241233
commit
cd0810438b
11
lib/tc.c
11
lib/tc.c
@@ -200,6 +200,10 @@ static const struct nl_policy tca_flower_policy[] = {
|
|||||||
.optional = true, },
|
.optional = true, },
|
||||||
[TCA_FLOWER_KEY_IP_TTL_MASK] = { .type = NL_A_U8,
|
[TCA_FLOWER_KEY_IP_TTL_MASK] = { .type = NL_A_U8,
|
||||||
.optional = true, },
|
.optional = true, },
|
||||||
|
[TCA_FLOWER_KEY_TCP_FLAGS] = { .type = NL_A_U16,
|
||||||
|
.optional = true, },
|
||||||
|
[TCA_FLOWER_KEY_TCP_FLAGS_MASK] = { .type = NL_A_U16,
|
||||||
|
.optional = true, },
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -325,6 +329,12 @@ nl_parse_flower_ip(struct nlattr **attrs, struct tc_flower *flower) {
|
|||||||
mask->tcp_dst =
|
mask->tcp_dst =
|
||||||
nl_attr_get_be16(attrs[TCA_FLOWER_KEY_TCP_DST_MASK]);
|
nl_attr_get_be16(attrs[TCA_FLOWER_KEY_TCP_DST_MASK]);
|
||||||
}
|
}
|
||||||
|
if (attrs[TCA_FLOWER_KEY_TCP_FLAGS_MASK]) {
|
||||||
|
key->tcp_flags =
|
||||||
|
nl_attr_get_be16(attrs[TCA_FLOWER_KEY_TCP_FLAGS]);
|
||||||
|
mask->tcp_flags =
|
||||||
|
nl_attr_get_be16(attrs[TCA_FLOWER_KEY_TCP_FLAGS_MASK]);
|
||||||
|
}
|
||||||
} else if (ip_proto == IPPROTO_UDP) {
|
} else if (ip_proto == IPPROTO_UDP) {
|
||||||
if (attrs[TCA_FLOWER_KEY_UDP_SRC_MASK]) {
|
if (attrs[TCA_FLOWER_KEY_UDP_SRC_MASK]) {
|
||||||
key->udp_src = nl_attr_get_be16(attrs[TCA_FLOWER_KEY_UDP_SRC]);
|
key->udp_src = nl_attr_get_be16(attrs[TCA_FLOWER_KEY_UDP_SRC]);
|
||||||
@@ -1036,6 +1046,7 @@ nl_msg_put_flower_options(struct ofpbuf *request, struct tc_flower *flower)
|
|||||||
} else if (flower->key.ip_proto == IPPROTO_TCP) {
|
} else if (flower->key.ip_proto == IPPROTO_TCP) {
|
||||||
FLOWER_PUT_MASKED_VALUE(tcp_src, TCA_FLOWER_KEY_TCP_SRC);
|
FLOWER_PUT_MASKED_VALUE(tcp_src, TCA_FLOWER_KEY_TCP_SRC);
|
||||||
FLOWER_PUT_MASKED_VALUE(tcp_dst, TCA_FLOWER_KEY_TCP_DST);
|
FLOWER_PUT_MASKED_VALUE(tcp_dst, TCA_FLOWER_KEY_TCP_DST);
|
||||||
|
FLOWER_PUT_MASKED_VALUE(tcp_flags, TCA_FLOWER_KEY_TCP_FLAGS);
|
||||||
} else if (flower->key.ip_proto == IPPROTO_SCTP) {
|
} else if (flower->key.ip_proto == IPPROTO_SCTP) {
|
||||||
FLOWER_PUT_MASKED_VALUE(sctp_src, TCA_FLOWER_KEY_SCTP_SRC);
|
FLOWER_PUT_MASKED_VALUE(sctp_src, TCA_FLOWER_KEY_SCTP_SRC);
|
||||||
FLOWER_PUT_MASKED_VALUE(sctp_dst, TCA_FLOWER_KEY_SCTP_DST);
|
FLOWER_PUT_MASKED_VALUE(sctp_dst, TCA_FLOWER_KEY_SCTP_DST);
|
||||||
|
Reference in New Issue
Block a user