Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/809092/?format=api
{ "id": 809092, "url": "http://patchwork.ozlabs.org/api/patches/809092/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20170902152126.17286-9-jiri@resnulli.us/", "project": { "id": 7, "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api", "name": "Linux network development", "link_name": "netdev", "list_id": "netdev.vger.kernel.org", "list_email": "netdev@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170902152126.17286-9-jiri@resnulli.us>", "list_archive_url": null, "date": "2017-09-02T15:21:13", "name": "[net-next,08/21] mlxsw: spectrum_router: Add mlxsw_sp_ipip_ops", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "121a8a64d6c3cfeb1666a5dc5c7957bb0beac4b4", "submitter": { "id": 15321, "url": "http://patchwork.ozlabs.org/api/people/15321/?format=api", "name": "Jiri Pirko", "email": "jiri@resnulli.us" }, "delegate": { "id": 34, "url": "http://patchwork.ozlabs.org/api/users/34/?format=api", "username": "davem", "first_name": "David", "last_name": "Miller", "email": "davem@davemloft.net" }, "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20170902152126.17286-9-jiri@resnulli.us/mbox/", "series": [ { "id": 1159, "url": "http://patchwork.ozlabs.org/api/series/1159/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=1159", "date": "2017-09-02T15:21:05", "name": "mlxsw: Offloading GRE tunnels", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/1159/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/809092/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/809092/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<netdev-owner@vger.kernel.org>", "X-Original-To": "patchwork-incoming@ozlabs.org", "Delivered-To": "patchwork-incoming@ozlabs.org", "Authentication-Results": [ "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=resnulli-us.20150623.gappssmtp.com\n\theader.i=@resnulli-us.20150623.gappssmtp.com\n\theader.b=\"WqSLdN2z\"; dkim-atps=neutral" ], "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xl0Gk4xYlz9sQl\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSun, 3 Sep 2017 01:22:38 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752833AbdIBPWh (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tSat, 2 Sep 2017 11:22:37 -0400", "from mail-wm0-f65.google.com ([74.125.82.65]:36188 \"EHLO\n\tmail-wm0-f65.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752735AbdIBPVn (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Sat, 2 Sep 2017 11:21:43 -0400", "by mail-wm0-f65.google.com with SMTP id p17so2641060wmd.3\n\tfor <netdev@vger.kernel.org>; Sat, 02 Sep 2017 08:21:42 -0700 (PDT)", "from localhost (jirka.pirko.cz. [84.16.102.26])\n\tby smtp.gmail.com with ESMTPSA id\n\tn11sm2244877wra.9.2017.09.02.08.21.40\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tSat, 02 Sep 2017 08:21:40 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=resnulli-us.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=w4WpTC3PzE6qqA2CTT9Ud+AJB5tnxyqXnUVkas72r1U=;\n\tb=WqSLdN2z2LuGOyEakfL6ikuTGp6clqK+wqNUlf5CbC+f8qzgWNcjgIwnqb29zC6ekQ\n\tZbj/ve+4LhnX/cv+WaQahH7W/WBQBvJgjTGEdr7Duy+dDRRWBPMF9ogsDymvavcd+YI7\n\tCZn1QLsuL824dCgvIVfFcuBqcT/y8CA0yaWTglOX5I3z2sYOZhpNjdwj3BmcBv0u8Kuu\n\toJNb8vB4suuhSrIGgNqPErRB7gsXdjI2SjUcAp+pMEJcyAvqmcgFOMNpkKmoEAcGGu9x\n\t2s65ih6i2XJHZ+K4aU5UtSVrv8WFzBmAUoLUe3vewXDrIvCXsrnRK8Ehf0LCkBlnePGq\n\tuYjg==", "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=w4WpTC3PzE6qqA2CTT9Ud+AJB5tnxyqXnUVkas72r1U=;\n\tb=jxowte0xmvU/1Y3waTz/8Hn41s4tC4IQhuYBVyPfyUe9FR8kRFFPA+sclp4F40yAGH\n\tbOFV0W3ij5f096fNkuDZKfMIEcrNGY18Iw1R4j2HcvVGW9UxArvUYJG007d8bgRJrk8L\n\tgXi73jQ6btK7kUl/Pfv6rdDWCQpyM+C6Y177nRkKBuLI8Qlki0/dRIMv9Zv6hR2gLGfY\n\tkVI4SZ3bkMXWfoFkBXxA8EjaJez1pICwJDf4JCCks0XdEKPVsy6+Tk+PJFiaU5QQSkLF\n\tJ3KDNo8VxxEnUPHmE0XnPapzjc87fc0o42xFxsY8Zd/n3FNB7K3W8FnXO6uiE0gzK/0g\n\tPqfg==", "X-Gm-Message-State": "AHPjjUjq+FxA7S3ea66s0g9l4ipRKjRsxZEY17g5kmylKiDPgbaHqmYo\n\toP06WZfCZuyHxiBjuH8=", "X-Google-Smtp-Source": "ADKCNb7X4M5t34XRrimHWJw0PUQBr3l6EC44Ye+akozRzpco94StkB93AK954kZWVlYx/y5ryJWXug==", "X-Received": "by 10.28.63.207 with SMTP id m198mr862515wma.177.1504365701200; \n\tSat, 02 Sep 2017 08:21:41 -0700 (PDT)", "From": "Jiri Pirko <jiri@resnulli.us>", "To": "netdev@vger.kernel.org", "Cc": "davem@davemloft.net, petrm@mellanox.com, idosch@mellanox.com,\n\tmlxsw@mellanox.com", "Subject": "[patch net-next 08/21] mlxsw: spectrum_router: Add mlxsw_sp_ipip_ops", "Date": "Sat, 2 Sep 2017 17:21:13 +0200", "Message-Id": "<20170902152126.17286-9-jiri@resnulli.us>", "X-Mailer": "git-send-email 2.9.3", "In-Reply-To": "<20170902152126.17286-1-jiri@resnulli.us>", "References": "<20170902152126.17286-1-jiri@resnulli.us>", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "From: Petr Machata <petrm@mellanox.com>\n\nDetails of individual tunnel types are kept in an array of\nmlxsw_sp_ipip_ops objects. Follow-up patches will use the list to\ndetermine whether a constructed RIF should be a loopback, and to decide\nwhether a next hop references a tunnel.\n\nThe list is currently empty, follow-up patches will add support for GRE.\n\nSigned-off-by: Petr Machata <petrm@mellanox.com>\nReviewed-by: Ido Schimmel <idosch@mellanox.com>\nSigned-off-by: Jiri Pirko <jiri@mellanox.com>\n---\n drivers/net/ethernet/mellanox/mlxsw/Makefile | 4 +-\n .../net/ethernet/mellanox/mlxsw/spectrum_ipip.c | 38 ++++++++++++++++\n .../net/ethernet/mellanox/mlxsw/spectrum_ipip.h | 51 ++++++++++++++++++++++\n .../net/ethernet/mellanox/mlxsw/spectrum_router.c | 19 ++++++++\n 4 files changed, 110 insertions(+), 2 deletions(-)\n create mode 100644 drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c\n create mode 100644 drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h", "diff": "diff --git a/drivers/net/ethernet/mellanox/mlxsw/Makefile b/drivers/net/ethernet/mellanox/mlxsw/Makefile\nindex f9956f3..891ff41 100644\n--- a/drivers/net/ethernet/mellanox/mlxsw/Makefile\n+++ b/drivers/net/ethernet/mellanox/mlxsw/Makefile\n@@ -16,8 +16,8 @@ mlxsw_spectrum-objs\t\t:= spectrum.o spectrum_buffers.o \\\n \t\t\t\t spectrum_switchdev.o spectrum_router.o \\\n \t\t\t\t spectrum_kvdl.o spectrum_acl_tcam.o \\\n \t\t\t\t spectrum_acl.o spectrum_flower.o \\\n-\t\t\t\t spectrum_cnt.o \\\n-\t\t\t\t spectrum_fid.o\n+\t\t\t\t spectrum_cnt.o spectrum_fid.o \\\n+\t\t\t\t spectrum_ipip.o\n mlxsw_spectrum-$(CONFIG_MLXSW_SPECTRUM_DCB)\t+= spectrum_dcb.o\n mlxsw_spectrum-$(CONFIG_NET_DEVLINK) += spectrum_dpipe.o\n obj-$(CONFIG_MLXSW_MINIMAL)\t+= mlxsw_minimal.o\ndiff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c\nnew file mode 100644\nindex 0000000..20b0b96\n--- /dev/null\n+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c\n@@ -0,0 +1,38 @@\n+/*\n+ * drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c\n+ * Copyright (c) 2017 Mellanox Technologies. All rights reserved.\n+ * Copyright (c) 2017 Petr Machata <petrm@mellanox.com>\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions are met:\n+ *\n+ * 1. Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions and the following disclaimer.\n+ * 2. Redistributions in binary form must reproduce the above copyright\n+ * notice, this list of conditions and the following disclaimer in the\n+ * documentation and/or other materials provided with the distribution.\n+ * 3. Neither the names of the copyright holders nor the names of its\n+ * contributors may be used to endorse or promote products derived from\n+ * this software without specific prior written permission.\n+ *\n+ * Alternatively, this software may be distributed under the terms of the\n+ * GNU General Public License (\"GPL\") version 2 as published by the Free\n+ * Software Foundation.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+ * POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#include \"spectrum_ipip.h\"\n+\n+const struct mlxsw_sp_ipip_ops *mlxsw_sp_ipip_ops_arr[] = {\n+};\ndiff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h\nnew file mode 100644\nindex 0000000..65eb493\n--- /dev/null\n+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h\n@@ -0,0 +1,51 @@\n+/*\n+ * drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h\n+ * Copyright (c) 2017 Mellanox Technologies. All rights reserved.\n+ * Copyright (c) 2017 Petr Machata <petrm@mellanox.com>\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions are met:\n+ *\n+ * 1. Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions and the following disclaimer.\n+ * 2. Redistributions in binary form must reproduce the above copyright\n+ * notice, this list of conditions and the following disclaimer in the\n+ * documentation and/or other materials provided with the distribution.\n+ * 3. Neither the names of the copyright holders nor the names of its\n+ * contributors may be used to endorse or promote products derived from\n+ * this software without specific prior written permission.\n+ *\n+ * Alternatively, this software may be distributed under the terms of the\n+ * GNU General Public License (\"GPL\") version 2 as published by the Free\n+ * Software Foundation.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+ * POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#ifndef _MLXSW_IPIP_H_\n+#define _MLXSW_IPIP_H_\n+\n+#include \"spectrum_router.h\"\n+\n+enum mlxsw_sp_ipip_type {\n+\tMLXSW_SP_IPIP_TYPE_MAX,\n+};\n+\n+struct mlxsw_sp_ipip_ops {\n+\tint dev_type;\n+\tenum mlxsw_sp_l3proto ul_proto; /* Underlay. */\n+};\n+\n+extern const struct mlxsw_sp_ipip_ops *mlxsw_sp_ipip_ops_arr[];\n+\n+#endif /* _MLXSW_IPIP_H_*/\ndiff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c\nindex f866ac5..f85d249 100644\n--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c\n+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c\n@@ -62,6 +62,7 @@\n #include \"reg.h\"\n #include \"spectrum_cnt.h\"\n #include \"spectrum_dpipe.h\"\n+#include \"spectrum_ipip.h\"\n #include \"spectrum_router.h\"\n \n struct mlxsw_sp_vr;\n@@ -89,6 +90,7 @@ struct mlxsw_sp_router {\n \tbool aborted;\n \tstruct notifier_block fib_nb;\n \tconst struct mlxsw_sp_rif_ops **rif_ops_arr;\n+\tconst struct mlxsw_sp_ipip_ops **ipip_ops_arr;\n };\n \n struct mlxsw_sp_rif {\n@@ -5152,6 +5154,16 @@ static void mlxsw_sp_rifs_fini(struct mlxsw_sp *mlxsw_sp)\n \tkfree(mlxsw_sp->router->rifs);\n }\n \n+static int mlxsw_sp_ipips_init(struct mlxsw_sp *mlxsw_sp)\n+{\n+\tmlxsw_sp->router->ipip_ops_arr = mlxsw_sp_ipip_ops_arr;\n+\treturn 0;\n+}\n+\n+static void mlxsw_sp_ipips_fini(struct mlxsw_sp *mlxsw_sp)\n+{\n+}\n+\n static void mlxsw_sp_router_fib_dump_flush(struct notifier_block *nb)\n {\n \tstruct mlxsw_sp_router *router;\n@@ -5211,6 +5223,10 @@ int mlxsw_sp_router_init(struct mlxsw_sp *mlxsw_sp)\n \tif (err)\n \t\tgoto err_rifs_init;\n \n+\terr = mlxsw_sp_ipips_init(mlxsw_sp);\n+\tif (err)\n+\t\tgoto err_ipips_init;\n+\n \terr = rhashtable_init(&mlxsw_sp->router->nexthop_ht,\n \t\t\t &mlxsw_sp_nexthop_ht_params);\n \tif (err)\n@@ -5252,6 +5268,8 @@ int mlxsw_sp_router_init(struct mlxsw_sp *mlxsw_sp)\n err_nexthop_group_ht_init:\n \trhashtable_destroy(&mlxsw_sp->router->nexthop_ht);\n err_nexthop_ht_init:\n+\tmlxsw_sp_ipips_fini(mlxsw_sp);\n+err_ipips_init:\n \tmlxsw_sp_rifs_fini(mlxsw_sp);\n err_rifs_init:\n \t__mlxsw_sp_router_fini(mlxsw_sp);\n@@ -5268,6 +5286,7 @@ void mlxsw_sp_router_fini(struct mlxsw_sp *mlxsw_sp)\n \tmlxsw_sp_lpm_fini(mlxsw_sp);\n \trhashtable_destroy(&mlxsw_sp->router->nexthop_group_ht);\n \trhashtable_destroy(&mlxsw_sp->router->nexthop_ht);\n+\tmlxsw_sp_ipips_fini(mlxsw_sp);\n \tmlxsw_sp_rifs_fini(mlxsw_sp);\n \t__mlxsw_sp_router_fini(mlxsw_sp);\n \tkfree(mlxsw_sp->router);\n", "prefixes": [ "net-next", "08/21" ] }