From patchwork Wed Dec 26 07:36:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Britstein X-Patchwork-Id: 1018618 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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=mellanox.com 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 43PnCN6LNkz9s8J for ; Wed, 26 Dec 2018 20:06:40 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 2594FEE4; Wed, 26 Dec 2018 09:06:25 +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 CAE7CED1 for ; Wed, 26 Dec 2018 09:06:23 +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 E57E4189 for ; Wed, 26 Dec 2018 09:06:22 +0000 (UTC) Received: from Internal Mail-Server by MTLPINE1 (envelope-from elibr@mellanox.com) with ESMTPS (AES256-SHA encrypted); 26 Dec 2018 09:42:53 +0200 Received: from l-dev-uefi14.mtl.labs.mlnx. (l-dev-uefi14.mtl.labs.mlnx [10.134.80.1]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id wBQ7aRUN006584; Wed, 26 Dec 2018 09:36:27 +0200 From: Eli Britstein To: dev@openvswitch.org Date: Wed, 26 Dec 2018 09:36:22 +0200 Message-Id: <20181226073622.24743-1-elibr@mellanox.com> X-Mailer: git-send-email 2.14.5 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Simon Horman , Eli Britstein Subject: [ovs-dev] [PATCH V2 1/1] netdev-tc-offloads: Support IPv6 hlimit rewrite 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 Add support for IPv6 hlimit field. Signed-off-by: Eli Britstein Reviewed-by: Paul Blakey --- lib/netdev-tc-offloads.c | 4 ++++ lib/tc.c | 5 +++++ lib/tc.h | 1 + 3 files changed, 10 insertions(+) diff --git a/lib/netdev-tc-offloads.c b/lib/netdev-tc-offloads.c index 606a4f4db..772b99b31 100644 --- a/lib/netdev-tc-offloads.c +++ b/lib/netdev-tc-offloads.c @@ -76,6 +76,10 @@ static struct netlink_field set_flower_map[][3] = { offsetof(struct tc_flower_key, ipv6.ipv6_dst), MEMBER_SIZEOF(struct tc_flower_key, ipv6.ipv6_dst) }, + { offsetof(struct ovs_key_ipv6, ipv6_hlimit), + offsetof(struct tc_flower_key, ipv6.rewrite_hlimit), + MEMBER_SIZEOF(struct tc_flower_key, ipv6.rewrite_hlimit) + }, }, [OVS_KEY_ATTR_ETHERNET] = { { offsetof(struct ovs_key_ethernet, eth_src), diff --git a/lib/tc.c b/lib/tc.c index 47127ca2c..adba3cd28 100644 --- a/lib/tc.c +++ b/lib/tc.c @@ -91,6 +91,11 @@ static struct flower_key_to_pedit flower_pedit_map[] = { 8, offsetof(struct tc_flower_key, ipv4.rewrite_ttl), MEMBER_SIZEOF(struct tc_flower_key, ipv4.rewrite_ttl) + }, { + TCA_PEDIT_KEY_EX_HDR_TYPE_IP6, + 7, + offsetof(struct tc_flower_key, ipv6.rewrite_hlimit), + MEMBER_SIZEOF(struct tc_flower_key, ipv6.rewrite_hlimit) }, { TCA_PEDIT_KEY_EX_HDR_TYPE_IP6, 8, diff --git a/lib/tc.h b/lib/tc.h index fe64fa887..7196a32d7 100644 --- a/lib/tc.h +++ b/lib/tc.h @@ -107,6 +107,7 @@ struct tc_flower_key { struct { struct in6_addr ipv6_src; struct in6_addr ipv6_dst; + uint8_t rewrite_hlimit; } ipv6; struct {