]> git.proxmox.com Git - mirror_ovs.git/commitdiff
netdev-tc-offloads: Add nw_ttl matching using flower
authorPaul Blakey <paulb@mellanox.com>
Mon, 7 Aug 2017 15:19:08 +0000 (18:19 +0300)
committerJoe Stringer <joe@ovn.org>
Fri, 11 Aug 2017 18:43:40 +0000 (11:43 -0700)
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>
lib/netdev-tc-offloads.c

index 2af1546e2419f2964884e2fe5b3ae1663e4b0f19..fec621b27a919dd32b2973c03d3601e454e394d7 100644 (file)
@@ -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);
 
@@ -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;
@@ -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;
@@ -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;