Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/833724/?format=api
{ "id": 833724, "url": "http://patchwork.ozlabs.org/api/1.2/patches/833724/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20171103090344.19444-17-jiri@resnulli.us/", "project": { "id": 7, "url": "http://patchwork.ozlabs.org/api/1.2/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": "<20171103090344.19444-17-jiri@resnulli.us>", "list_archive_url": null, "date": "2017-11-03T09:03:44", "name": "[net-next,16/16] mlxsw: spectrum_router: Handle down of tunnel underlay", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "3042500e5c8d34b8e4b1e60a1bef4e3053e42ef0", "submitter": { "id": 15321, "url": "http://patchwork.ozlabs.org/api/1.2/people/15321/?format=api", "name": "Jiri Pirko", "email": "jiri@resnulli.us" }, "delegate": { "id": 34, "url": "http://patchwork.ozlabs.org/api/1.2/users/34/?format=api", "username": "davem", "first_name": "David", "last_name": "Miller", "email": "davem@davemloft.net" }, "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20171103090344.19444-17-jiri@resnulli.us/mbox/", "series": [ { "id": 11677, "url": "http://patchwork.ozlabs.org/api/1.2/series/11677/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=11677", "date": "2017-11-03T09:03:28", "name": "mlxsw: Handle changes in GRE configuration", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/11677/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/833724/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/833724/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=\"v6e2jQoD\"; dkim-atps=neutral" ], "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3ySwxX5MYNz9sNV\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 3 Nov 2017 20:04:16 +1100 (AEDT)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S932923AbdKCJEF (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 3 Nov 2017 05:04:05 -0400", "from mail-wm0-f65.google.com ([74.125.82.65]:54344 \"EHLO\n\tmail-wm0-f65.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S932449AbdKCJD7 (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Fri, 3 Nov 2017 05:03:59 -0400", "by mail-wm0-f65.google.com with SMTP id r68so6801wmr.3\n\tfor <netdev@vger.kernel.org>; Fri, 03 Nov 2017 02:03:59 -0700 (PDT)", "from localhost (ip-94-113-127-32.net.upcbroadband.cz.\n\t[94.113.127.32]) by smtp.gmail.com with ESMTPSA id\n\th21sm4409892wrf.47.2017.11.03.02.03.57\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tFri, 03 Nov 2017 02:03:58 -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=iYLihUfhuuKDqy456pxK612t3JTMLwS+AxuTmY+s2to=;\n\tb=v6e2jQoD55FuGwX2EoYZvquRdb9JYPzAyOVw5/A0zpurXnTNxacH7WwEbGMJL3abOK\n\tRnr6NDPXCsbM4xXzpgiJx4i34qZrux2d0V4NCESIkp1mbz6NHraDg85e1uMjU9gQtu5A\n\tiRL/SLR/oMsjGspwZswf46K5BH8QiaATfGsVkz9JHz3k43m2qsPqfHZJefEh9PSCFYZa\n\to5ByScz9vo2GXTBOWluXne4/zloDm10anio8ZeSD2yaF6L7osE9zRfWackt4YNEcXqyJ\n\tEwp6lzs8yhJ2AGH9nxXtsYfYbNkf1p6cXOFBRcqcNa/STdJEeE8WtZZSNn0btdEl/8aI\n\tcC6Q==", "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=iYLihUfhuuKDqy456pxK612t3JTMLwS+AxuTmY+s2to=;\n\tb=ATVhg0CfdRR+b5jVK1f4rjC87TRsZHkOXUFtXfwWJ7Ztd8v6B95EuDSaA0Lak3yAAN\n\tSStDMZCg4kXCg/bMJbUC+juP3xEY0gKSGXpnG2IKGsESAbxhOymibnGv0C7FSoYl6Vos\n\thEzx6Oglhq2aL8Aa685IuEnwS4FR4M8DbugWl8AdN/HM32C4s2a1SOHTrGy+FDr+pfVB\n\t7M+sjTMLKb1KyqEvcmy2PSdcw/jol/10P/rRrZ3OrMBXAgZ7EuaPOkT3t3UmVrvPSh08\n\tkKcULDalm4siWm/zO7w7G7vWwToYXMZ5Ry5ur4HO80x4O5wjhotJoaLsG3ABnowBF354\n\t4zWA==", "X-Gm-Message-State": "AMCzsaU/fi4XIQ4rH9W4s/16uff6QJHjgnW+memlbZjut3zSERnC6cc2\n\t9y1KsZK5SzKz6TeRjO6DwWGd+sS/", "X-Google-Smtp-Source": "ABhQp+R31S63cZV4n7DCjb7tbpaqHK8/DLRv6MSSECI/g34PnIZoAz8/h4TfRPdZyfNX7zysJfXeCA==", "X-Received": "by 10.28.52.5 with SMTP id b5mr4066430wma.135.1509699838411;\n\tFri, 03 Nov 2017 02:03:58 -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 16/16] mlxsw: spectrum_router: Handle down of\n\ttunnel underlay", "Date": "Fri, 3 Nov 2017 10:03:44 +0100", "Message-Id": "<20171103090344.19444-17-jiri@resnulli.us>", "X-Mailer": "git-send-email 2.9.5", "In-Reply-To": "<20171103090344.19444-1-jiri@resnulli.us>", "References": "<20171103090344.19444-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\nWhen the bound device of a tunnel device is down, encapsulated packets\nare not egressed anymore, but tunnel decap still works. Extend\nmlxsw_sp_nexthop_rif_update() to take IFF_UP into consideration when\ndeciding whether a given next hop should be offloaded.\n\nBecause the new logic was added to mlxsw_sp_nexthop_rif_update(), this\nfixes the case where a newly-added tunnel has a down bound device, which\nwould previously be fully offloaded. Now the down state of the bound\ndevice is noted and next hops forwarding to such tunnel are not\noffloaded.\n\nIn addition to that, notice NETDEV_UP and NETDEV_DOWN of a bound device\nto force refresh of tunnel encap route offloads.\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 .../net/ethernet/mellanox/mlxsw/spectrum_router.c | 57 +++++++++++++++++++++-\n 1 file changed, 55 insertions(+), 2 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c\nindex c1928561..e918784 100644\n--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c\n+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c\n@@ -1467,6 +1467,28 @@ mlxsw_sp_netdevice_ipip_ul_vrf_event(struct mlxsw_sp *mlxsw_sp,\n }\n \n static int\n+mlxsw_sp_netdevice_ipip_ul_up_event(struct mlxsw_sp *mlxsw_sp,\n+\t\t\t\t struct mlxsw_sp_ipip_entry *ipip_entry,\n+\t\t\t\t struct net_device *ul_dev)\n+{\n+\treturn __mlxsw_sp_ipip_entry_update_tunnel(mlxsw_sp, ipip_entry,\n+\t\t\t\t\t\t false, false, true, NULL);\n+}\n+\n+static int\n+mlxsw_sp_netdevice_ipip_ul_down_event(struct mlxsw_sp *mlxsw_sp,\n+\t\t\t\t struct mlxsw_sp_ipip_entry *ipip_entry,\n+\t\t\t\t struct net_device *ul_dev)\n+{\n+\t/* A down underlay device causes encapsulated packets to not be\n+\t * forwarded, but decap still works. So refresh next hops without\n+\t * touching anything else.\n+\t */\n+\treturn __mlxsw_sp_ipip_entry_update_tunnel(mlxsw_sp, ipip_entry,\n+\t\t\t\t\t\t false, false, true, NULL);\n+}\n+\n+static int\n mlxsw_sp_netdevice_ipip_ol_change_event(struct mlxsw_sp *mlxsw_sp,\n \t\t\t\t\tstruct net_device *ol_dev,\n \t\t\t\t\tstruct netlink_ext_ack *extack)\n@@ -1604,6 +1626,14 @@ __mlxsw_sp_netdevice_ipip_ul_event(struct mlxsw_sp *mlxsw_sp,\n \t\t\t\t\t\t\t\t ul_dev,\n \t\t\t\t\t\t\t\t extack);\n \t\tbreak;\n+\n+\tcase NETDEV_UP:\n+\t\treturn mlxsw_sp_netdevice_ipip_ul_up_event(mlxsw_sp, ipip_entry,\n+\t\t\t\t\t\t\t ul_dev);\n+\tcase NETDEV_DOWN:\n+\t\treturn mlxsw_sp_netdevice_ipip_ul_down_event(mlxsw_sp,\n+\t\t\t\t\t\t\t ipip_entry,\n+\t\t\t\t\t\t\t ul_dev);\n \t}\n \treturn 0;\n }\n@@ -3297,10 +3327,19 @@ static void mlxsw_sp_nexthop_neigh_fini(struct mlxsw_sp *mlxsw_sp,\n \tneigh_release(n);\n }\n \n+static bool mlxsw_sp_ipip_netdev_ul_up(struct net_device *ol_dev)\n+{\n+\tstruct net_device *ul_dev = __mlxsw_sp_ipip_netdev_ul_dev_get(ol_dev);\n+\n+\treturn ul_dev ? (ul_dev->flags & IFF_UP) : true;\n+}\n+\n static int mlxsw_sp_nexthop_ipip_init(struct mlxsw_sp *mlxsw_sp,\n \t\t\t\t struct mlxsw_sp_nexthop *nh,\n \t\t\t\t struct net_device *ol_dev)\n {\n+\tbool removing;\n+\n \tif (!nh->nh_grp->gateway || nh->ipip_entry)\n \t\treturn 0;\n \n@@ -3308,7 +3347,8 @@ static int mlxsw_sp_nexthop_ipip_init(struct mlxsw_sp *mlxsw_sp,\n \tif (!nh->ipip_entry)\n \t\treturn -ENOENT;\n \n-\t__mlxsw_sp_nexthop_neigh_update(nh, false);\n+\tremoving = !mlxsw_sp_ipip_netdev_ul_up(ol_dev);\n+\t__mlxsw_sp_nexthop_neigh_update(nh, removing);\n \treturn 0;\n }\n \n@@ -3476,9 +3516,22 @@ static void mlxsw_sp_nexthop_rif_update(struct mlxsw_sp *mlxsw_sp,\n \t\t\t\t\tstruct mlxsw_sp_rif *rif)\n {\n \tstruct mlxsw_sp_nexthop *nh;\n+\tbool removing;\n \n \tlist_for_each_entry(nh, &rif->nexthop_list, rif_list_node) {\n-\t\t__mlxsw_sp_nexthop_neigh_update(nh, false);\n+\t\tswitch (nh->type) {\n+\t\tcase MLXSW_SP_NEXTHOP_TYPE_ETH:\n+\t\t\tremoving = false;\n+\t\t\tbreak;\n+\t\tcase MLXSW_SP_NEXTHOP_TYPE_IPIP:\n+\t\t\tremoving = !mlxsw_sp_ipip_netdev_ul_up(rif->dev);\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tWARN_ON(1);\n+\t\t\tcontinue;\n+\t\t}\n+\n+\t\t__mlxsw_sp_nexthop_neigh_update(nh, removing);\n \t\tmlxsw_sp_nexthop_group_refresh(mlxsw_sp, nh->nh_grp);\n \t}\n }\n", "prefixes": [ "net-next", "16/16" ] }