From patchwork Mon Aug 7 15:19:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roi Dayan X-Patchwork-Id: 798726 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xR1Vr3D0wz9s1h for ; Tue, 8 Aug 2017 01:22:44 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 9829AACC; Mon, 7 Aug 2017 15:20:32 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 5551AAC9 for ; Mon, 7 Aug 2017 15:20:31 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by smtp1.linuxfoundation.org (Postfix) with ESMTP id 0968A45C for ; Mon, 7 Aug 2017 15:19:36 +0000 (UTC) Received: from Internal Mail-Server by MTLPINE1 (envelope-from roid@mellanox.com) with ESMTPS (AES256-SHA encrypted); 7 Aug 2017 18:19:15 +0300 Received: from dev-r-vrt-189.mtr.labs.mlnx (dev-r-vrt-189.mtr.labs.mlnx [10.212.189.1]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id v77FJEFr002778; Mon, 7 Aug 2017 18:19:14 +0300 From: Roi Dayan To: dev@openvswitch.org Date: Mon, 7 Aug 2017 18:19:08 +0300 Message-Id: <1502119151-49792-5-git-send-email-roid@mellanox.com> X-Mailer: git-send-email 2.8.0 In-Reply-To: <1502119151-49792-1-git-send-email-roid@mellanox.com> References: <1502119151-49792-1-git-send-email-roid@mellanox.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Simon Horman Subject: [ovs-dev] [PATCH 4/7] netdev-tc-offloads: Add nw_ttl matching using flower X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org From: Paul Blakey Add matching (put/dump) on ip layer ttl. Signed-off-by: Paul Blakey Reviewed-by: Roi Dayan --- lib/netdev-tc-offloads.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/netdev-tc-offloads.c b/lib/netdev-tc-offloads.c index 2af1546..fec621b 100644 --- a/lib/netdev-tc-offloads.c +++ b/lib/netdev-tc-offloads.c @@ -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;