Skip to content

Commit

Permalink
netdev-tc-offloads: Add nw_ttl matching using flower
Browse files Browse the repository at this point in the history
Add matching (put/dump) on ip layer ttl.

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>
  • Loading branch information
Paul Blakey authored and joestringer committed Aug 11, 2017
1 parent c489ad6 commit ab7ecf2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/netdev-tc-offloads.c
Expand Up @@ -312,6 +312,8 @@ parse_tc_flower_to_match(struct tc_flower *flower,
match_set_nw_proto(match, key->ip_proto);
}

match_set_nw_ttl_masked(match, key->ip_ttl, mask->ip_ttl);

match_set_nw_src_masked(match, key->ipv4.ipv4_src, mask->ipv4.ipv4_src);
match_set_nw_dst_masked(match, key->ipv4.ipv4_dst, mask->ipv4.ipv4_dst);

Expand Down Expand Up @@ -595,11 +597,6 @@ test_key_and_mask(struct match *match)
return EOPNOTSUPP;
}

if (mask->nw_ttl) {
VLOG_DBG_RL(&rl, "offloading attribute nw_ttl isn't supported");
return EOPNOTSUPP;
}

if (mask->nw_frag) {
VLOG_DBG_RL(&rl, "offloading attribute nw_frag isn't supported");
return EOPNOTSUPP;
Expand Down Expand Up @@ -757,6 +754,8 @@ netdev_tc_flow_put(struct netdev *netdev, struct match *match,
if (is_ip_any(key)) {
flower.key.ip_proto = key->nw_proto;
flower.mask.ip_proto = mask->nw_proto;
flower.key.ip_ttl = key->nw_ttl;
flower.mask.ip_ttl = mask->nw_ttl;

if (key->nw_proto == IPPROTO_TCP) {
flower.key.tcp_dst = key->tp_dst;
Expand Down Expand Up @@ -784,6 +783,7 @@ netdev_tc_flow_put(struct netdev *netdev, struct match *match,
mask->nw_frag = 0;
mask->nw_tos = 0;
mask->nw_proto = 0;
mask->nw_ttl = 0;

if (key->dl_type == htons(ETH_P_IP)) {
flower.key.ipv4.ipv4_src = key->nw_src;
Expand Down

0 comments on commit ab7ecf2

Please sign in to comment.