Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/816788/?format=api
{ "id": 816788, "url": "http://patchwork.ozlabs.org/api/patches/816788/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20170921094139.4250-2-privat@egil-hjelmeland.no/", "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": "<20170921094139.4250-2-privat@egil-hjelmeland.no>", "list_archive_url": null, "date": "2017-09-21T09:41:38", "name": "[net-next,1/2] net: dsa: lan9303: Move tag setup to new lan9303_setup_tagging", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "69109de79abe41a4a764887461eea8da54ea0df8", "submitter": { "id": 72044, "url": "http://patchwork.ozlabs.org/api/people/72044/?format=api", "name": "Egil Hjelmeland", "email": "privat@egil-hjelmeland.no" }, "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/20170921094139.4250-2-privat@egil-hjelmeland.no/mbox/", "series": [ { "id": 4342, "url": "http://patchwork.ozlabs.org/api/series/4342/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=4342", "date": "2017-09-21T09:41:38", "name": "lan9303: Add basic offloading of unicast traffic", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/4342/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/816788/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/816788/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>)", "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xyWqg1B5lz9t43\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 21 Sep 2017 19:42:39 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751971AbdIUJm1 (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tThu, 21 Sep 2017 05:42:27 -0400", "from dns3.teletopia.net ([91.220.196.211]:42358 \"EHLO\n\taibo.runbox.com\" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751906AbdIUJmJ (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Thu, 21 Sep 2017 05:42:09 -0400", "from [10.9.9.211] (helo=mailfront11.runbox.com)\n\tby mailtransmit03.runbox with esmtp (Exim 4.86_2)\n\t(envelope-from <privat@egil-hjelmeland.no>)\n\tid 1duxzc-0000qy-AP; Thu, 21 Sep 2017 11:42:00 +0200", "from 93.89.113.32.ip.vitnett.no ([93.89.113.32]\n\thelo=localhost.localdomain)\n\tby mailfront11.runbox.com with esmtpsa (uid:646232 )\n\t(TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82)\n\tid 1duxzS-0002Gh-1T; Thu, 21 Sep 2017 11:41:50 +0200" ], "From": "Egil Hjelmeland <privat@egil-hjelmeland.no>", "To": "andrew@lunn.ch, vivien.didelot@savoirfairelinux.com,\n\tf.fainelli@gmail.com, netdev@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org", "Cc": "Egil Hjelmeland <privat@egil-hjelmeland.no>", "Subject": "[PATCH net-next 1/2] net: dsa: lan9303: Move tag setup to new\n\tlan9303_setup_tagging", "Date": "Thu, 21 Sep 2017 11:41:38 +0200", "Message-Id": "<20170921094139.4250-2-privat@egil-hjelmeland.no>", "X-Mailer": "git-send-email 2.11.0", "In-Reply-To": "<20170921094139.4250-1-privat@egil-hjelmeland.no>", "References": "<20170921094139.4250-1-privat@egil-hjelmeland.no>", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "Prepare for next patch:\nMove tag setup from lan9303_separate_ports() to new function\nlan9303_setup_tagging()\n\nSigned-off-by: Egil Hjelmeland <privat@egil-hjelmeland.no>\n---\n drivers/net/dsa/lan9303-core.c | 42 +++++++++++++++++++++++++-----------------\n 1 file changed, 25 insertions(+), 17 deletions(-)", "diff": "diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c\nindex 07355db2ad81..bba875e114e7 100644\n--- a/drivers/net/dsa/lan9303-core.c\n+++ b/drivers/net/dsa/lan9303-core.c\n@@ -157,6 +157,7 @@\n # define LAN9303_SWE_PORT_MIRROR_ENABLE_RX_MIRRORING BIT(1)\n # define LAN9303_SWE_PORT_MIRROR_ENABLE_TX_MIRRORING BIT(0)\n #define LAN9303_SWE_INGRESS_PORT_TYPE 0x1847\n+#define LAN9303_SWE_INGRESS_PORT_TYPE_VLAN 3\n #define LAN9303_BM_CFG 0x1c00\n #define LAN9303_BM_EGRSS_PORT_TYPE 0x1c0c\n # define LAN9303_BM_EGRSS_PORT_TYPE_SPECIAL_TAG_PORT2 (BIT(17) | BIT(16))\n@@ -510,11 +511,30 @@ static int lan9303_enable_processing_port(struct lan9303 *chip,\n \t\t\t\tLAN9303_MAC_TX_CFG_X_TX_ENABLE);\n }\n \n+/* forward special tagged packets from port 0 to port 1 *or* port 2 */\n+static int lan9303_setup_tagging(struct lan9303 *chip)\n+{\n+\tint ret;\n+\t/* enable defining the destination port via special VLAN tagging\n+\t * for port 0\n+\t */\n+\tret = lan9303_write_switch_reg(chip, LAN9303_SWE_INGRESS_PORT_TYPE,\n+\t\t\t\t LAN9303_SWE_INGRESS_PORT_TYPE_VLAN);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\t/* tag incoming packets at port 1 and 2 on their way to port 0 to be\n+\t * able to discover their source port\n+\t */\n+\treturn lan9303_write_switch_reg(\n+\t\tchip, LAN9303_BM_EGRSS_PORT_TYPE,\n+\t\tLAN9303_BM_EGRSS_PORT_TYPE_SPECIAL_TAG_PORT0);\n+}\n+\n /* We want a special working switch:\n * - do not forward packets between port 1 and 2\n * - forward everything from port 1 to port 0\n * - forward everything from port 2 to port 0\n- * - forward special tagged packets from port 0 to port 1 *or* port 2\n */\n static int lan9303_separate_ports(struct lan9303 *chip)\n {\n@@ -529,22 +549,6 @@ static int lan9303_separate_ports(struct lan9303 *chip)\n \tif (ret)\n \t\treturn ret;\n \n-\t/* enable defining the destination port via special VLAN tagging\n-\t * for port 0\n-\t */\n-\tret = lan9303_write_switch_reg(chip, LAN9303_SWE_INGRESS_PORT_TYPE,\n-\t\t\t\t 0x03);\n-\tif (ret)\n-\t\treturn ret;\n-\n-\t/* tag incoming packets at port 1 and 2 on their way to port 0 to be\n-\t * able to discover their source port\n-\t */\n-\tret = lan9303_write_switch_reg(chip, LAN9303_BM_EGRSS_PORT_TYPE,\n-\t\t\tLAN9303_BM_EGRSS_PORT_TYPE_SPECIAL_TAG_PORT0);\n-\tif (ret)\n-\t\treturn ret;\n-\n \t/* prevent port 1 and 2 from forwarding packets by their own */\n \treturn lan9303_write_switch_reg(chip, LAN9303_SWE_PORT_STATE,\n \t\t\t\tLAN9303_SWE_PORT_STATE_FORWARDING_PORT0 |\n@@ -644,6 +648,10 @@ static int lan9303_setup(struct dsa_switch *ds)\n \t\treturn -EINVAL;\n \t}\n \n+\tret = lan9303_setup_tagging(chip);\n+\tif (ret)\n+\t\tdev_err(chip->dev, \"failed to setup port tagging %d\\n\", ret);\n+\n \tret = lan9303_separate_ports(chip);\n \tif (ret)\n \t\tdev_err(chip->dev, \"failed to separate ports %d\\n\", ret);\n", "prefixes": [ "net-next", "1/2" ] }