Received: by 10.192.165.148 with SMTP id m20csp3901018imm; Mon, 23 Apr 2018 14:40:19 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/LEj2e7dsE32uSo8i2AyOxRB4DN8+bW82M/05M0/Nkf+vwZKdRdTBRs2R7D0fEc4CL4wqM X-Received: by 2002:a17:902:6902:: with SMTP id j2-v6mr21998579plk.92.1524519619176; Mon, 23 Apr 2018 14:40:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524519619; cv=none; d=google.com; s=arc-20160816; b=bNE9cBczHDz5ld7U+tNhA7pqiOiB4ZRtXLkuMrgIKVvD0fnnV3KILMalsAjqghDEyC NqZUzm+8gq10RRzJB8grURnsXN4WWpje1OtjeLvrAaSjGgOmuRur+qeUxXBDfwN3lTzb 0+zRwleu/fg6ZMjutTJ7uP//4vkYty57xyntj26ND8ZPHx090MDmfHt2bODAd1Udu5uo 7nAq0w7osuJ7FKikaF2A9XAfWdpRZLe7pnb4bghFtYtGMP2XCLDM1aeETJRQpVFkyX18 Zz5LliWSpL71jBx02TA/1T7mH6uihvugrPphrzkNU104KapaAtygaFnp2PztT5yoEP+a Qy6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=jnGcyfSWtfOZnMrXJ4ejXtx8DE539ifNqTBcwavwDYU=; b=dNKMCFayzSPYo3cFoejK3sb6xK+Xp2T05B03Gy+/8uqftNwdBBZzu7+JCgE2i9XC5I N10J8eop3UNp9PHs4699p1pjEz5cJBOQKj+TbdmscxTW880zA6bKr6UJU5Aik3/3bpaf GxdqqbPgV6DpS1BPzGuhvRONOm6SSPUa4IMJuHmLrOtl/QWkJYHj411q3dkwGtvE9tBC FAKBSYU8mZRIxV/LvBpnekw3twHLdxcJyRW/eP65moVkX+8FjtNhtmS+Q2Bzlxl9Yxsf IpMX9haXEPAtn7+4a6qv/Qi//RPBOY/LjCMc9OxSv/T4w/jsv19H0cnB/ISQLncSABsh M/jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qnMe3nzT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z30si12143147pfg.140.2018.04.23.14.40.05; Mon, 23 Apr 2018 14:40:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qnMe3nzT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932589AbeDWVhW (ORCPT + 99 others); Mon, 23 Apr 2018 17:37:22 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:40480 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932499AbeDWVhT (ORCPT ); Mon, 23 Apr 2018 17:37:19 -0400 Received: by mail-wr0-f194.google.com with SMTP id v60-v6so45126045wrc.7; Mon, 23 Apr 2018 14:37:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=jnGcyfSWtfOZnMrXJ4ejXtx8DE539ifNqTBcwavwDYU=; b=qnMe3nzTlC+NfcHQ8mokCHruXQuHM4cAmttPoprqD+IXBLi+PwBnlGtUk1OGX72oLl an4nBaPUEi4s8ZunZsXJlWmT1GCvfNG4uaXXPRZVQvyqEExTDvCZtug+rsH6x0QkrET3 T8QDiaYjhQCpUhk5BetDuXb6Jiric/Fk2Bkt8rdaIQksSyxpOmNC87jDvnzv/wnABCwe coz6LekpD5BXmUTxftoh4bjdFhkUDdzMOTLMPskyKbJk0JFdlRg0iafeC8vzl2JodrgZ kDUKDGwA4v0FjmaLJV1iSLdicNulBxzOrMdz1vKip8NnloqShpkgJyj13PIeOylataDv A/1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=jnGcyfSWtfOZnMrXJ4ejXtx8DE539ifNqTBcwavwDYU=; b=Vwkrk08rf+WQBcS0SAkfd9qpUn/PnHp5BK/isMkuFrQjbKX7LVlI6FrBqoGpk42x89 nSA3hNFzyKsCj+/+//XWJAGEOcdATqUakSVCSpA0RgVjSmWTMuv3AdBBQXipoQd9pw4l 9KMe5cNiAHQwE43lr6ItvBw6w/r6ioW3UaWaowb37aIHuneyf6EtTw88E2HRLiO66Rwi +vgru8/q00FUROH0FI+uHEhK10HhLaQ69KrxFE2lRVveC1TJQ5SPuhLuPSwK8bpmH6D0 A3iIfrm1F4TuxuFTMDkJPM07WI7iY+/zT3q98d9M+indnk5dTvbuK4b4ZNx8itDHeQ1q M+3Q== X-Gm-Message-State: ALQs6tDEAdYnJ9280htgu88eYAXpV/ioID4HrwQQ311tlPYUJwfBEuVA EGS9pAizNXplaujmqwwehE4= X-Received: by 2002:adf:a98f:: with SMTP id b15-v6mr17738472wrd.48.1524519437810; Mon, 23 Apr 2018 14:37:17 -0700 (PDT) Received: from localhost.localdomain ([192.135.27.140]) by smtp.gmail.com with ESMTPSA id a69sm8405851wma.7.2018.04.23.14.37.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Apr 2018 14:37:17 -0700 (PDT) From: Ahmed Abdelsalam To: davem@davemloft.net, dav.lebrun@gmail.com, kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Ahmed Abdelsalam Subject: [net-next 1/2] ipv6: sr: add a per namespace sysctl to control seg6 flowlabel Date: Mon, 23 Apr 2018 23:36:59 +0200 Message-Id: <1524519420-1612-1-git-send-email-amsalam20@gmail.com> X-Mailer: git-send-email 2.1.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds a per namespace sysctl, named 'seg6_flowlabel', to be used by seg6_do_srh_encap() to control the behaviour of setting the flowlabel value of outer IPv6. The currently support behaviours are as follows: -1 set flowlabel to zero. 0 copy flowlabel from Inner paceket in case of Inner IPv6 (0 for IPv4/L2) 1 Compute the flowlabel using seg6_make_flowlabel() Signed-off-by: Ahmed Abdelsalam --- include/net/netns/ipv6.h | 1 + net/ipv6/sysctl_net_ipv6.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h index 97b3a54..c978a31 100644 --- a/include/net/netns/ipv6.h +++ b/include/net/netns/ipv6.h @@ -43,6 +43,7 @@ struct netns_sysctl_ipv6 { int max_hbh_opts_cnt; int max_dst_opts_len; int max_hbh_opts_len; + int seg6_flowlabel; }; struct netns_ipv6 { diff --git a/net/ipv6/sysctl_net_ipv6.c b/net/ipv6/sysctl_net_ipv6.c index 6fbdef6..e15cd37 100644 --- a/net/ipv6/sysctl_net_ipv6.c +++ b/net/ipv6/sysctl_net_ipv6.c @@ -152,6 +152,13 @@ static struct ctl_table ipv6_table_template[] = { .extra1 = &zero, .extra2 = &one, }, + { + .procname = "seg6_flowlabel", + .data = &init_net.ipv6.sysctl.seg6_flowlabel, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dointvec + }, { } }; @@ -217,6 +224,7 @@ static int __net_init ipv6_sysctl_net_init(struct net *net) ipv6_table[12].data = &net->ipv6.sysctl.max_dst_opts_len; ipv6_table[13].data = &net->ipv6.sysctl.max_hbh_opts_len; ipv6_table[14].data = &net->ipv6.sysctl.multipath_hash_policy, + ipv6_table[15].data = &net->ipv6.sysctl.seg6_flowlabel; ipv6_route_table = ipv6_route_sysctl_init(net); if (!ipv6_route_table) -- 2.1.4