Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/809151/?format=api
{ "id": 809151, "url": "http://patchwork.ozlabs.org/api/patches/809151/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20170902214929.2890-2-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-2-jiri@resnulli.us>", "list_archive_url": null, "date": "2017-09-02T21:49:09", "name": "[net-next,v2,01/21] mlxsw: reg: Update RITR to support loopback device", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "eddb70c2d2f47ad3ed622a677741be634ab58229", "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-2-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/809151/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/809151/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=\"AMypDij/\"; dkim-atps=neutral" ], "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xl8sP6vtGz9sRY\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSun, 3 Sep 2017 07:49:45 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752788AbdIBVth (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tSat, 2 Sep 2017 17:49:37 -0400", "from mail-wr0-f196.google.com ([209.85.128.196]:38896 \"EHLO\n\tmail-wr0-f196.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752776AbdIBVtg (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Sat, 2 Sep 2017 17:49:36 -0400", "by mail-wr0-f196.google.com with SMTP id j3so1613399wrb.5\n\tfor <netdev@vger.kernel.org>; Sat, 02 Sep 2017 14:49:35 -0700 (PDT)", "from localhost (jirka.pirko.cz. [84.16.102.26])\n\tby smtp.gmail.com with ESMTPSA id\n\tt8sm4256215wrg.21.2017.09.02.14.49.33\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tSat, 02 Sep 2017 14:49:33 -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=R1DNXHa4C6ahOvke3DNWMPUKMGgy0Zq0XJ+1gJGeLUg=;\n\tb=AMypDij/wu8km36F9u0XbQ+2bkShu2kcKR98axHXuNLeMPgkylW78HFs2JNmxBMUwl\n\tvcHzMM5w9YM7l9RFHxU+NnWoaLnYCgtRVShlDXnZJ5gPJ+eYGE1VgFWXDdesg12WKm8s\n\tHWE8DSbdeTVCmArzCfXGg2mnS2X0mD31nBWFL0QTpXihUWCLfSa9b5vrfDMxXopZRMYG\n\tiPOgVo2hXSmMRNUMyLSkgPNYOz5dNamT82Y8wY+ck4ZguhQ5UvPq4xZWmujle6fZFW3v\n\t19JYa3WNMpPjzMWoi5fb1PasmBs9+bypdvWdSBEaPPWvddl67E6izEGgKG3dq0irhZ3i\n\t6zJg==", "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=R1DNXHa4C6ahOvke3DNWMPUKMGgy0Zq0XJ+1gJGeLUg=;\n\tb=I+28mPNH6BfTVfywTN5fYbyk2DLMuL60JIs7tuph1j02Q5M6nT6ZFOWK+ehe8iMUKa\n\tjW0oTMW/RcOj4iJUy7ALhjO8qgP6i6k0r/YYcYeEYgSM6iAhfUGh0REBLMMiOZKMISNn\n\tK8WpZVXpvzUYVSd2Zg6ACo4JOiQSVKkpEaeGYR/ashTshUcg6+Y/DxeNPBZ7NbGEtetJ\n\t1u9DctcSVzZ1mkwKhuAiA8yIvDTTjo60N1FFTWzGIvhznJXKTMhqtyuT22WTBMO3M/vG\n\t9kUtGvMWBncXMop/OI1/WMR8Vl31WVKaG1jH33YZ9mwPatQ1LZ1GsVtcznd675JgcoMh\n\txjgQ==", "X-Gm-Message-State": "AHPjjUhuaxojvXE4bYkr8410n7kigqJ2DpSocPa0JO0E2VHyjY/Z9sok\n\tMn9PifwekZUrb/lWgWY=", "X-Google-Smtp-Source": "ADKCNb7waV01XQ1xb3PGmkkRPq0Hp+CVcOlMsA6g6URP3Iewc5wTlf55sdkpcIYsY1Wd6UpaxsP8SQ==", "X-Received": "by 10.223.167.7 with SMTP id c7mr3743482wrd.300.1504388974102;\n\tSat, 02 Sep 2017 14:49:34 -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 01/21] mlxsw: reg: Update RITR to support\n\tloopback device", "Date": "Sat, 2 Sep 2017 23:49:09 +0200", "Message-Id": "<20170902214929.2890-2-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\nUpdate the register so that loopback RIFs can be created and loopback\nproperties specified.\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/reg.h | 88 +++++++++++++++++++++++++++++++\n 1 file changed, 88 insertions(+)", "diff": "diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h\nindex 11e290c..8736f8492 100644\n--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h\n+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h\n@@ -3998,6 +3998,8 @@ enum mlxsw_reg_ritr_if_type {\n \tMLXSW_REG_RITR_FID_IF,\n \t/* Sub-port interface. */\n \tMLXSW_REG_RITR_SP_IF,\n+\t/* Loopback Interface. */\n+\tMLXSW_REG_RITR_LOOPBACK_IF,\n };\n \n /* reg_ritr_type\n@@ -4129,6 +4131,67 @@ MLXSW_ITEM32(reg, ritr, sp_if_system_port, 0x08, 0, 16);\n */\n MLXSW_ITEM32(reg, ritr, sp_if_vid, 0x18, 0, 12);\n \n+/* Loopback Interface */\n+\n+enum mlxsw_reg_ritr_loopback_protocol {\n+\t/* IPinIP IPv4 underlay Unicast */\n+\tMLXSW_REG_RITR_LOOPBACK_PROTOCOL_IPIP_IPV4,\n+\t/* IPinIP IPv6 underlay Unicast */\n+\tMLXSW_REG_RITR_LOOPBACK_PROTOCOL_IPIP_IPV6,\n+};\n+\n+/* reg_ritr_loopback_protocol\n+ * Access: RW\n+ */\n+MLXSW_ITEM32(reg, ritr, loopback_protocol, 0x08, 28, 4);\n+\n+enum mlxsw_reg_ritr_loopback_ipip_type {\n+\t/* Tunnel is IPinIP. */\n+\tMLXSW_REG_RITR_LOOPBACK_IPIP_TYPE_IP_IN_IP,\n+\t/* Tunnel is GRE, no key. */\n+\tMLXSW_REG_RITR_LOOPBACK_IPIP_TYPE_IP_IN_GRE_IN_IP,\n+\t/* Tunnel is GRE, with a key. */\n+\tMLXSW_REG_RITR_LOOPBACK_IPIP_TYPE_IP_IN_GRE_KEY_IN_IP,\n+};\n+\n+/* reg_ritr_loopback_ipip_type\n+ * Encapsulation type.\n+ * Access: RW\n+ */\n+MLXSW_ITEM32(reg, ritr, loopback_ipip_type, 0x10, 24, 4);\n+\n+enum mlxsw_reg_ritr_loopback_ipip_options {\n+\t/* The key is defined by gre_key. */\n+\tMLXSW_REG_RITR_LOOPBACK_IPIP_OPTIONS_GRE_KEY_PRESET,\n+};\n+\n+/* reg_ritr_loopback_ipip_options\n+ * Access: RW\n+ */\n+MLXSW_ITEM32(reg, ritr, loopback_ipip_options, 0x10, 20, 4);\n+\n+/* reg_ritr_loopback_ipip_uvr\n+ * Underlay Virtual Router ID.\n+ * Range is 0..cap_max_virtual_routers-1.\n+ * Reserved for Spectrum-2.\n+ * Access: RW\n+ */\n+MLXSW_ITEM32(reg, ritr, loopback_ipip_uvr, 0x10, 0, 16);\n+\n+/* reg_ritr_loopback_ipip_usip*\n+ * Encapsulation Underlay source IP.\n+ * Access: RW\n+ */\n+MLXSW_ITEM_BUF(reg, ritr, loopback_ipip_usip6, 0x18, 16);\n+MLXSW_ITEM32(reg, ritr, loopback_ipip_usip4, 0x24, 0, 32);\n+\n+/* reg_ritr_loopback_ipip_gre_key\n+ * GRE Key.\n+ * Reserved when ipip_type is not IP_IN_GRE_KEY_IN_IP.\n+ * Access: RW\n+ */\n+MLXSW_ITEM32(reg, ritr, loopback_ipip_gre_key, 0x28, 0, 32);\n+\n /* Shared between ingress/egress */\n enum mlxsw_reg_ritr_counter_set_type {\n \t/* No Count. */\n@@ -4219,6 +4282,31 @@ static inline void mlxsw_reg_ritr_pack(char *payload, bool enable,\n \tmlxsw_reg_ritr_if_mac_memcpy_to(payload, mac);\n }\n \n+static inline void\n+mlxsw_reg_ritr_loopback_ipip_common_pack(char *payload,\n+\t\t\t enum mlxsw_reg_ritr_loopback_ipip_type ipip_type,\n+\t\t\t enum mlxsw_reg_ritr_loopback_ipip_options options,\n+\t\t\t u16 uvr_id, u32 gre_key)\n+{\n+\tmlxsw_reg_ritr_loopback_ipip_type_set(payload, ipip_type);\n+\tmlxsw_reg_ritr_loopback_ipip_options_set(payload, options);\n+\tmlxsw_reg_ritr_loopback_ipip_uvr_set(payload, uvr_id);\n+\tmlxsw_reg_ritr_loopback_ipip_gre_key_set(payload, gre_key);\n+}\n+\n+static inline void\n+mlxsw_reg_ritr_loopback_ipip4_pack(char *payload,\n+\t\t\t enum mlxsw_reg_ritr_loopback_ipip_type ipip_type,\n+\t\t\t enum mlxsw_reg_ritr_loopback_ipip_options options,\n+\t\t\t u16 uvr_id, u32 usip, u32 gre_key)\n+{\n+\tmlxsw_reg_ritr_loopback_protocol_set(payload,\n+\t\t\t\t MLXSW_REG_RITR_LOOPBACK_PROTOCOL_IPIP_IPV4);\n+\tmlxsw_reg_ritr_loopback_ipip_common_pack(payload, ipip_type, options,\n+\t\t\t\t\t\t uvr_id, gre_key);\n+\tmlxsw_reg_ritr_loopback_ipip_usip4_set(payload, usip);\n+}\n+\n /* RATR - Router Adjacency Table Register\n * --------------------------------------\n * The RATR register is used to configure the Router Adjacency (next-hop)\n", "prefixes": [ "net-next", "v2", "01/21" ] }