Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/809155/?format=api
{ "id": 809155, "url": "http://patchwork.ozlabs.org/api/patches/809155/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20170902214929.2890-10-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": "<20170902214929.2890-10-jiri@resnulli.us>", "list_archive_url": null, "date": "2017-09-02T21:49:17", "name": "[net-next,v2,09/21] mlxsw: spectrum_router: Add mlxsw_sp_ipip_ops", "commit_ref": null, "pull_url": null, "state": "accepted", "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/20170902214929.2890-10-jiri@resnulli.us/mbox/", "series": [ { "id": 1180, "url": "http://patchwork.ozlabs.org/api/series/1180/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=1180", "date": "2017-09-02T21:49:08", "name": "mlxsw: Offloading GRE tunnels", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/1180/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/809155/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/809155/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=\"icg3Dccg\"; dkim-atps=neutral" ], "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xl8sZ2cflz9sRY\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSun, 3 Sep 2017 07:49:54 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752833AbdIBVtt (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tSat, 2 Sep 2017 17:49:49 -0400", "from mail-wr0-f194.google.com ([209.85.128.194]:35041 \"EHLO\n\tmail-wr0-f194.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752776AbdIBVtr (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Sat, 2 Sep 2017 17:49:47 -0400", "by mail-wr0-f194.google.com with SMTP id a47so1622679wra.2\n\tfor <netdev@vger.kernel.org>; Sat, 02 Sep 2017 14:49:46 -0700 (PDT)", "from localhost (jirka.pirko.cz. [84.16.102.26])\n\tby smtp.gmail.com with ESMTPSA id\n\tb196sm3207494wmd.29.2017.09.02.14.49.44\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tSat, 02 Sep 2017 14:49:45 -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=icg3DccgJ0k2FCJZ6lfyT1V5zpPk9LDRyF8L8KPt1B3KPsepN2cFrqJHQfaEEyh81+\n\t3ddjU8c0i8lVKIcLT3upUuede7J31FQnrEeD+BoucTHbfJsxATdrSL7HwVXEGLDZBYrs\n\tVD+7hmBAjz90beuyNYrVGVTeIV/vVPViin+wLmVFlgib2yncbfV++0MiP3yjFalG2/wF\n\tH6ndN7C3suiJyjc4yCndbjETrlnbFoqKB3W+b0bnRYSIS9c87zQTJYZ47YjPzj941Am7\n\tvEFKlrcDISRY+IkSfSeIueR97xi+htavEDsTJDV0Ipucaj866t6avlivStyBrpP0Y6VC\n\tTUUA==", "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=fnOLu70X16C3c3nVhJuLEiO9QhKoPidKCDtUtdMLlN0GkjKoANucwsWAdvM5eJC/HU\n\tL9G3VN9uZVL54lUzfjJIrrfgnvdJHuu4yi6bXQiaDaxpMC3R7isqKK3YYDGLDsGu01iK\n\tBqq+Z08fOwN6aZIow8z3a1b31qW49FGoLGxX8bUFVF08tOqAFlQycH0TK5iLHxb30ceB\n\tb1WFYSYkSazeDTzDTNvvKUb9K9x+VJB59gwITiy8cGXChJFtrPO4K8YYdqZVg+AQBNJ/\n\tFZjBOHUXTOiADO1h6na5oO+8Lno2nqk/pmT7X4p5CLsB+n7TGCtw9XuicR1NANIsoKGt\n\tzvgA==", "X-Gm-Message-State": "AHPjjUhX2yQUc/SIqLAnqsKnanlPg6c4ES3VWlYhvlnRxP0/sUhTGOkH\n\t1/uAdTeYGKzwJfv9FT4=", "X-Google-Smtp-Source": "ADKCNb7Nio8mrYZx1vlGzl1CG7RQ/Oi31U0Qa4TJlTYuWIyBa2Dxhm1zqRjyudsp3hTFWaGtl2qp/A==", "X-Received": "by 10.223.192.14 with SMTP id z14mr1393572wre.292.1504388985818; \n\tSat, 02 Sep 2017 14:49:45 -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 v2 09/21] mlxsw: spectrum_router: Add\n\tmlxsw_sp_ipip_ops", "Date": "Sat, 2 Sep 2017 23:49:17 +0200", "Message-Id": "<20170902214929.2890-10-jiri@resnulli.us>", "X-Mailer": "git-send-email 2.9.3", "In-Reply-To": "<20170902214929.2890-1-jiri@resnulli.us>", "References": "<20170902214929.2890-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", "v2", "09/21" ] }