Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/806647/?format=api
{ "id": 806647, "url": "http://patchwork.ozlabs.org/api/patches/806647/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/1503935822-20445-1-git-send-email-parthasarathy.bhuvaragan@ericsson.com/", "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": "<1503935822-20445-1-git-send-email-parthasarathy.bhuvaragan@ericsson.com>", "list_archive_url": null, "date": "2017-08-28T15:57:02", "name": "[net,v1,1/1] tipc: permit bond slave as bearer", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "af418e5191667d50c6662a1880a1e4e308845548", "submitter": { "id": 68187, "url": "http://patchwork.ozlabs.org/api/people/68187/?format=api", "name": "Parthasarathy Bhuvaragan", "email": "parthasarathy.bhuvaragan@ericsson.com" }, "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/1503935822-20445-1-git-send-email-parthasarathy.bhuvaragan@ericsson.com/mbox/", "series": [ { "id": 207, "url": "http://patchwork.ozlabs.org/api/series/207/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=207", "date": "2017-08-28T15:57:02", "name": "[net,v1,1/1] tipc: permit bond slave as bearer", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/207/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/806647/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/806647/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 3xgxGw3pKlz9rvt\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 29 Aug 2017 01:57:12 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751610AbdH1P5K (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 28 Aug 2017 11:57:10 -0400", "from sessmg23.ericsson.net ([193.180.251.45]:47865 \"EHLO\n\tsessmg23.ericsson.net\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751302AbdH1P5I (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Mon, 28 Aug 2017 11:57:08 -0400", "from ESESSHC011.ericsson.se (Unknown_Domain [153.88.183.51])\n\tby sessmg23.ericsson.net (Symantec Mail Security) with SMTP id\n\t2F.BF.22436.35D34A95; Mon, 28 Aug 2017 17:57:07 +0200 (CEST)", "from tipsy.lab.linux.ericsson.se (10.35.28.120) by\n\tESESSHC011.ericsson.se (153.88.183.51) with Microsoft SMTP Server\n\t(TLS) id 14.3.352.0; Mon, 28 Aug 2017 17:57:06 +0200" ], "X-AuditID": "c1b4fb2d-103ff700000057a4-57-59a43d538c54", "From": "Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>", "To": "<davem@davemloft.net>", "CC": "<netdev@vger.kernel.org>, <tipc-discussion@lists.sourceforge.net>,\n\t<jon.maloy@ericsson.com>, <maloy@donjonn.com>, <ying.xue@windriver.com>", "Subject": "[PATCH net v1 1/1] tipc: permit bond slave as bearer", "Date": "Mon, 28 Aug 2017 17:57:02 +0200", "Message-ID": "<1503935822-20445-1-git-send-email-parthasarathy.bhuvaragan@ericsson.com>", "X-Mailer": "git-send-email 2.1.4", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-Originating-IP": "[10.35.28.120]", "X-Brightmail-Tracker": "H4sIAAAAAAAAA+NgFlrNLMWRmVeSWpSXmKPExsUyM2K7sW6w7ZJIg4fX+SzmnG9hsVi06DCT\n\txbEFYhZbzmdZPL5+ndmB1WPLyptMHu97rjB57F7wmcnj8yY5j/VbtjIFsEZx2aSk5mSWpRbp\n\t2yVwZfTOncpU8Euu4svz56wNjCcluxg5OSQETCTmLrnPCmILCRxhlDh9XK+LkQvI3s4oMWtz\n\tP3sXIwcHm4CbxLzmBJAaEQFJid53K5lBapgFJjBKfP36jwkkISxgK7Fo1lNmEJtFQFVi5t8u\n\tNhCbVyBUYtP8r6wQy+Qkzh//yQwRF5Q4OfMJC4jNLCAhcfDFC2aII4wkJlw8zgRRryDxbWY3\n\t0wRGvllIWmYhaVnAyLSKUbQ4tbg4N93IWC+1KDO5uDg/Ty8vtWQTIzAID275rbuDcfVrx0OM\n\tAhyMSjy8/i8XRwqxJpYVV+YeYpTgYFYS4Z1gsyRSiDclsbIqtSg/vqg0J7X4EKM0B4uSOK/D\n\tvgsRQgLpiSWp2ampBalFMFkmDk6pBsbZE+RvScXUfi/eL73GPdzCZ5eud8aZiU/bLCbPs9ti\n\t9LKhYbOmU45IkN/u1/P2M31S2zw9ysupW6ZS9FnNmkaWzfyxh5Zbn/a7sC7FrWbSZYPLTxud\n\t/cyPRuV97EhSMZ/9a4/HIvno5Qu1LIoP8DzWOLH8/Zr7ereWbpvl+zjVZw3HsjiL6B4lluKM\n\tREMt5qLiRAASNHj9PgIAAA==", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "For a bond slave device as a tipc bearer, the dev represents the bond\ninterface and orig_dev represents the slave in tipc_l2_rcv_msg().\nSince we decode the tipc_ptr from bonding device (dev), we fail to\nfind the bearer and thus tipc links are not established.\n\nIn this commit, we register the tipc protocol callback per device and\nlook for tipc bearer from both the devices.\n\nSigned-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>\n---\n net/tipc/bearer.c | 26 +++++++++++---------------\n net/tipc/bearer.h | 2 ++\n 2 files changed, 13 insertions(+), 15 deletions(-)", "diff": "diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c\nindex 767e0537dde5..89cd061c4468 100644\n--- a/net/tipc/bearer.c\n+++ b/net/tipc/bearer.c\n@@ -65,6 +65,8 @@ static struct tipc_bearer *bearer_get(struct net *net, int bearer_id)\n }\n \n static void bearer_disable(struct net *net, struct tipc_bearer *b);\n+static int tipc_l2_rcv_msg(struct sk_buff *skb, struct net_device *dev,\n+\t\t\t struct packet_type *pt, struct net_device *orig_dev);\n \n /**\n * tipc_media_find - locates specified media object by name\n@@ -428,6 +430,10 @@ int tipc_enable_l2_media(struct net *net, struct tipc_bearer *b,\n \n \t/* Associate TIPC bearer with L2 bearer */\n \trcu_assign_pointer(b->media_ptr, dev);\n+\tb->pt.dev = dev;\n+\tb->pt.type = htons(ETH_P_TIPC);\n+\tb->pt.func = tipc_l2_rcv_msg;\n+\tdev_add_pack(&b->pt);\n \tmemset(&b->bcast_addr, 0, sizeof(b->bcast_addr));\n \tmemcpy(b->bcast_addr.value, dev->broadcast, b->media->hwaddr_len);\n \tb->bcast_addr.media_id = b->media->type_id;\n@@ -447,6 +453,7 @@ void tipc_disable_l2_media(struct tipc_bearer *b)\n \tstruct net_device *dev;\n \n \tdev = (struct net_device *)rtnl_dereference(b->media_ptr);\n+\tdev_remove_pack(&b->pt);\n \tRCU_INIT_POINTER(dev->tipc_ptr, NULL);\n \tsynchronize_net();\n \tdev_put(dev);\n@@ -594,11 +601,12 @@ static int tipc_l2_rcv_msg(struct sk_buff *skb, struct net_device *dev,\n \tstruct tipc_bearer *b;\n \n \trcu_read_lock();\n-\tb = rcu_dereference_rtnl(dev->tipc_ptr);\n+\tb = rcu_dereference_rtnl(dev->tipc_ptr) ?:\n+\t\trcu_dereference_rtnl(orig_dev->tipc_ptr);\n \tif (likely(b && test_bit(0, &b->up) &&\n \t\t (skb->pkt_type <= PACKET_MULTICAST))) {\n \t\tskb->next = NULL;\n-\t\ttipc_rcv(dev_net(dev), skb, b);\n+\t\ttipc_rcv(dev_net(b->pt.dev), skb, b);\n \t\trcu_read_unlock();\n \t\treturn NET_RX_SUCCESS;\n \t}\n@@ -659,11 +667,6 @@ static int tipc_l2_device_event(struct notifier_block *nb, unsigned long evt,\n \treturn NOTIFY_OK;\n }\n \n-static struct packet_type tipc_packet_type __read_mostly = {\n-\t.type = htons(ETH_P_TIPC),\n-\t.func = tipc_l2_rcv_msg,\n-};\n-\n static struct notifier_block notifier = {\n \t.notifier_call = tipc_l2_device_event,\n \t.priority\t= 0,\n@@ -671,19 +674,12 @@ static struct notifier_block notifier = {\n \n int tipc_bearer_setup(void)\n {\n-\tint err;\n-\n-\terr = register_netdevice_notifier(¬ifier);\n-\tif (err)\n-\t\treturn err;\n-\tdev_add_pack(&tipc_packet_type);\n-\treturn 0;\n+\treturn register_netdevice_notifier(¬ifier);\n }\n \n void tipc_bearer_cleanup(void)\n {\n \tunregister_netdevice_notifier(¬ifier);\n-\tdev_remove_pack(&tipc_packet_type);\n }\n \n void tipc_bearer_stop(struct net *net)\ndiff --git a/net/tipc/bearer.h b/net/tipc/bearer.h\nindex 635c9086e19a..e07a55a80c18 100644\n--- a/net/tipc/bearer.h\n+++ b/net/tipc/bearer.h\n@@ -131,6 +131,7 @@ struct tipc_media {\n * @name: bearer name (format = media:interface)\n * @media: ptr to media structure associated with bearer\n * @bcast_addr: media address used in broadcasting\n+ * @pt: packet type for bearer\n * @rcu: rcu struct for tipc_bearer\n * @priority: default link priority for bearer\n * @window: default window size for bearer\n@@ -151,6 +152,7 @@ struct tipc_bearer {\n \tchar name[TIPC_MAX_BEARER_NAME];\n \tstruct tipc_media *media;\n \tstruct tipc_media_addr bcast_addr;\n+\tstruct packet_type pt;\n \tstruct rcu_head rcu;\n \tu32 priority;\n \tu32 window;\n", "prefixes": [ "net", "v1", "1/1" ] }