{"id":812528,"url":"http://patchwork.ozlabs.org/api/patches/812528/?format=json","web_url":"http://patchwork.ozlabs.org/project/openvswitch/patch/1505152570-6143-10-git-send-email-gvrose8192@gmail.com/","project":{"id":47,"url":"http://patchwork.ozlabs.org/api/projects/47/?format=json","name":"Open vSwitch","link_name":"openvswitch","list_id":"ovs-dev.openvswitch.org","list_email":"ovs-dev@openvswitch.org","web_url":"http://openvswitch.org/","scm_url":"git@github.com:openvswitch/ovs.git","webscm_url":"https://github.com/openvswitch/ovs","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<1505152570-6143-10-git-send-email-gvrose8192@gmail.com>","list_archive_url":null,"date":"2017-09-11T17:56:05","name":"[ovs-dev,10/15] datapath: Fixup RTNL ops for kernel 4.13","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"f6ad23371f5fdef7dcb0ab45bb50ed610b97d329","submitter":{"id":69140,"url":"http://patchwork.ozlabs.org/api/people/69140/?format=json","name":"Gregory Rose","email":"gvrose8192@gmail.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/openvswitch/patch/1505152570-6143-10-git-send-email-gvrose8192@gmail.com/mbox/","series":[{"id":2537,"url":"http://patchwork.ozlabs.org/api/series/2537/?format=json","web_url":"http://patchwork.ozlabs.org/project/openvswitch/list/?series=2537","date":"2017-09-11T17:55:56","name":"[ovs-dev,01/15] acinclude: Check for SKB_GSO_UDP","version":1,"mbox":"http://patchwork.ozlabs.org/series/2537/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/812528/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/812528/checks/","tags":{},"related":[],"headers":{"Return-Path":"<ovs-dev-bounces@openvswitch.org>","X-Original-To":["incoming@patchwork.ozlabs.org","dev@openvswitch.org"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","ovs-dev@mail.linuxfoundation.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=openvswitch.org\n\t(client-ip=140.211.169.12; helo=mail.linuxfoundation.org;\n\tenvelope-from=ovs-dev-bounces@openvswitch.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"jt1sxWVy\"; dkim-atps=neutral"],"Received":["from mail.linuxfoundation.org (mail.linuxfoundation.org\n\t[140.211.169.12])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xrbNc2X12z9sNV\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 04:02:06 +1000 (AEST)","from mail.linux-foundation.org (localhost [127.0.0.1])\n\tby mail.linuxfoundation.org (Postfix) with ESMTP id B58ABB6A;\n\tMon, 11 Sep 2017 17:56:33 +0000 (UTC)","from smtp1.linuxfoundation.org (smtp1.linux-foundation.org\n\t[172.17.192.35])\n\tby mail.linuxfoundation.org (Postfix) with ESMTPS id 7846AB00\n\tfor <dev@openvswitch.org>; Mon, 11 Sep 2017 17:56:31 +0000 (UTC)","from mail-pf0-f195.google.com (mail-pf0-f195.google.com\n\t[209.85.192.195])\n\tby smtp1.linuxfoundation.org (Postfix) with ESMTPS id 3583C1D7\n\tfor <dev@openvswitch.org>; Mon, 11 Sep 2017 17:56:31 +0000 (UTC)","by mail-pf0-f195.google.com with SMTP id f84so5199146pfj.3\n\tfor <dev@openvswitch.org>; Mon, 11 Sep 2017 10:56:31 -0700 (PDT)","from gizo.domain (67-5-132-83.ptld.qwest.net. [67.5.132.83])\n\tby smtp.gmail.com with ESMTPSA id\n\th185sm16733084pfe.160.2017.09.11.10.56.29\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 11 Sep 2017 10:56:29 -0700 (PDT)"],"X-Greylist":"whitelisted by SQLgrey-1.7.6","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=Fp0jy2VWVzdGePQ9IHOwA0mTmBpFVj4rHwVBjorT0ss=;\n\tb=jt1sxWVyNwC+q+AjUuiPvOHINDUyc1QyA1VLHb0E5LyBpSXUz3u4RZeO7Vt0xolus6\n\t6IbnD9HaztrUgA/QBOzb3Khuu+SZ4vGdVJQYJxU1sQmU0twTKW+wZDIANMG/z0MoVtug\n\tG87lWeKfmUlzBOC3QuUhH+dZ5FuJgsulkAQHTYdzlmJRAdvPwI/DJQ6Yy+TN+TGuqOmq\n\tLnFWNpy/SZeq7dX6DWM+AHquDvlr0/u/3TYUkkC3VAO0lYhUE+VM+MZecvNQQN0HBIgC\n\tkp9gAa2GzZkfdTvFnjSNqY99fdL/aKMuh5lmd1ZSuZCjaQAS6YEmqbYdMpQPCKGG9r2M\n\t0veA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=Fp0jy2VWVzdGePQ9IHOwA0mTmBpFVj4rHwVBjorT0ss=;\n\tb=CbRE/oqOsHK6a1oRcMzzqSNU9bJpvrnMrqezyWkKALHsgqqA1LqSH56Ov1D0ICpWoV\n\tRzunvZW+Pdz3gjlFpN8aXUWT8XMbNRPtn0JpZ1dEoLap9U8AVvWrENBigKKaUqKthlIi\n\tel4DhyZuoG1oKlnrMUr2XGzzLE3gZ5FCPYA75tV6h0WZf+48uIct2pCZsQmWvhDQ1jU1\n\tk6HxHYQWUMd9xbsHCQNqkhrN7dDYKPx0ZEJZIuhJW2AqGcIaE8jwNVoMRx5Mrn9op+gj\n\tvyy+SV8XbVM52iA0WlWNtxYPIjykb3NT0ZjTst0mmIrpzOKuZb+xFIWwqYkfO8SRUgIb\n\tgz4g==","X-Gm-Message-State":"AHPjjUhy1OU3CMcvMavdIKDOPYiXmPM3Mf6+UXoOFYficv2jv8Kh87S/\n\ta2RX95rp6TCHXfp8","X-Google-Smtp-Source":"ADKCNb5lmeu9IGOFgtmAHS/F7g6vZeK6IGx73adPAQdH3nk3QG+tOCOOzaBWG8Y7gOlf1tW7ORhJIg==","X-Received":"by 10.99.99.197 with SMTP id x188mr12323551pgb.38.1505152590501; \n\tMon, 11 Sep 2017 10:56:30 -0700 (PDT)","From":"Greg Rose <gvrose8192@gmail.com>","To":"dev@openvswitch.org","Date":"Mon, 11 Sep 2017 10:56:05 -0700","Message-Id":"<1505152570-6143-10-git-send-email-gvrose8192@gmail.com>","X-Mailer":"git-send-email 1.8.3.1","In-Reply-To":"<1505152570-6143-1-git-send-email-gvrose8192@gmail.com>","References":"<1505152570-6143-1-git-send-email-gvrose8192@gmail.com>","X-Spam-Status":"No, score=0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,\n\tDKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,\n\tRCVD_IN_DNSWL_NONE, \n\tRCVD_IN_SORBS_SPAM autolearn=disabled version=3.3.1","X-Spam-Checker-Version":"SpamAssassin 3.3.1 (2010-03-16) on\n\tsmtp1.linux-foundation.org","Subject":"[ovs-dev] [PATCH 10/15] datapath: Fixup RTNL ops for kernel 4.13","X-BeenThere":"ovs-dev@openvswitch.org","X-Mailman-Version":"2.1.12","Precedence":"list","List-Id":"<ovs-dev.openvswitch.org>","List-Unsubscribe":"<https://mail.openvswitch.org/mailman/options/ovs-dev>,\n\t<mailto:ovs-dev-request@openvswitch.org?subject=unsubscribe>","List-Archive":"<http://mail.openvswitch.org/pipermail/ovs-dev/>","List-Post":"<mailto:ovs-dev@openvswitch.org>","List-Help":"<mailto:ovs-dev-request@openvswitch.org?subject=help>","List-Subscribe":"<https://mail.openvswitch.org/mailman/listinfo/ovs-dev>,\n\t<mailto:ovs-dev-request@openvswitch.org?subject=subscribe>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"ovs-dev-bounces@openvswitch.org","Errors-To":"ovs-dev-bounces@openvswitch.org"},"content":"The RTNL ops validate and newlink functions now take the extended\nnetlink ack parameter.  Use the new HAVE_EXT_ACK_IN_RTNL_LINKOPS\ndefine to check if the additional parameter is present and add the\nparameter if so.\n\nWhile in the modules remove the checks for Linux kernels < 2.3.39\nsince they are no longer supported since 2.5.x.\n\nSigned-off-by: Greg Rose <gvrose8192@gmail.com>\n---\n datapath/linux/compat/lisp.c | 21 ++++++++++-----------\n datapath/linux/compat/stt.c  | 11 +++++++++++\n 2 files changed, 21 insertions(+), 11 deletions(-)","diff":"diff --git a/datapath/linux/compat/lisp.c b/datapath/linux/compat/lisp.c\nindex c505fad..34f8232 100644\n--- a/datapath/linux/compat/lisp.c\n+++ b/datapath/linux/compat/lisp.c\n@@ -608,7 +608,12 @@ static const struct nla_policy lisp_policy[IFLA_LISP_MAX + 1] = {\n \t[IFLA_LISP_PORT]              = { .type = NLA_U16 },\n };\n \n+#ifdef HAVE_EXT_ACK_IN_RTNL_LINKOPS\n+static int lisp_validate(struct nlattr *tb[], struct nlattr *data[],\n+\t\t\t struct netlink_ext_ack __always_unused *extack)\n+#else\n static int lisp_validate(struct nlattr *tb[], struct nlattr *data[])\n+#endif\n {\n \tif (tb[IFLA_ADDRESS]) {\n \t\tif (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN)\n@@ -660,17 +665,15 @@ static int lisp_configure(struct net *net, struct net_device *dev,\n \treturn 0;\n }\n \n-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)\n+#ifdef HAVE_EXT_ACK_IN_RTNL_LINKOPS\n static int lisp_newlink(struct net *net, struct net_device *dev,\n-\t\tstruct nlattr *tb[], struct nlattr *data[])\n-{\n+\t\tstruct nlattr *tb[], struct nlattr *data[],\n+\t\tstruct netlink_ext_ack __always_unused *extack)\n #else\n-static int lisp_newlink(struct net_device *dev,\n+static int lisp_newlink(struct net *net, struct net_device *dev,\n \t\tstruct nlattr *tb[], struct nlattr *data[])\n-\n-{\n-\tstruct net *net = &init_net;\n #endif\n+{\n \t__be16 dst_port = htons(LISP_UDP_PORT);\n \n \tif (data[IFLA_LISP_PORT])\n@@ -679,11 +682,7 @@ static int lisp_newlink(struct net_device *dev,\n \treturn lisp_configure(net, dev, dst_port);\n }\n \n-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)\n static void lisp_dellink(struct net_device *dev, struct list_head *head)\n-#else\n-static void lisp_dellink(struct net_device *dev)\n-#endif\n {\n \tstruct lisp_dev *lisp = netdev_priv(dev);\n \ndiff --git a/datapath/linux/compat/stt.c b/datapath/linux/compat/stt.c\nindex 964d993..07f5892 100644\n--- a/datapath/linux/compat/stt.c\n+++ b/datapath/linux/compat/stt.c\n@@ -1909,7 +1909,12 @@ static const struct nla_policy stt_policy[IFLA_STT_MAX + 1] = {\n \t[IFLA_STT_PORT]              = { .type = NLA_U16 },\n };\n \n+#ifdef HAVE_EXT_ACK_IN_RTNL_LINKOPS\n+static int stt_validate(struct nlattr *tb[], struct nlattr *data[],\n+\t\t\tstruct netlink_ext_ack __always_unused *extack)\n+#else\n static int stt_validate(struct nlattr *tb[], struct nlattr *data[])\n+#endif\n {\n \tif (tb[IFLA_ADDRESS]) {\n \t\tif (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN)\n@@ -1961,8 +1966,14 @@ static int stt_configure(struct net *net, struct net_device *dev,\n \treturn 0;\n }\n \n+#ifdef HAVE_EXT_ACK_IN_RTNL_LINKOPS\n+static int stt_newlink(struct net *net, struct net_device *dev,\n+\t\tstruct nlattr *tb[], struct nlattr *data[],\n+\t\tstruct netlink_ext_ack __always_unused *extack)\n+#else\n static int stt_newlink(struct net *net, struct net_device *dev,\n \t\tstruct nlattr *tb[], struct nlattr *data[])\n+#endif\n {\n \t__be16 dst_port = htons(STT_DST_PORT);\n \n","prefixes":["ovs-dev","10/15"]}