Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/810833/?format=api
{ "id": 810833, "url": "http://patchwork.ozlabs.org/api/patches/810833/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/1504744467-79590-3-git-send-email-sainath.grandhi@intel.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": "<1504744467-79590-3-git-send-email-sainath.grandhi@intel.com>", "list_archive_url": null, "date": "2017-09-07T00:34:26", "name": "[RFC,v1,2/3] net: Abstracting out common routines from veth for use by vethtap", "commit_ref": null, "pull_url": null, "state": "rfc", "archived": true, "hash": "8926afdfed0382212b35fac551a981730c5c7f80", "submitter": { "id": 70733, "url": "http://patchwork.ozlabs.org/api/people/70733/?format=api", "name": "Grandhi, Sainath", "email": "sainath.grandhi@intel.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/1504744467-79590-3-git-send-email-sainath.grandhi@intel.com/mbox/", "series": [ { "id": 1899, "url": "http://patchwork.ozlabs.org/api/series/1899/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=1899", "date": "2017-09-07T00:34:24", "name": "Support for tap user-space access with veth interfaces", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/1899/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/810833/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/810833/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 3xnhPk0kktz9s8J\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 7 Sep 2017 10:38:02 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752979AbdIGAiA (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 6 Sep 2017 20:38:00 -0400", "from mga05.intel.com ([192.55.52.43]:52065 \"EHLO mga05.intel.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1751978AbdIGAh7 (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tWed, 6 Sep 2017 20:37:59 -0400", "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga105.fm.intel.com with ESMTP; 06 Sep 2017 17:37:59 -0700", "from otc-grantley-03.jf.intel.com ([10.54.39.23])\n\tby fmsmga002.fm.intel.com with ESMTP; 06 Sep 2017 17:37:59 -0700" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.42,355,1500966000\"; d=\"scan'208\";a=\"1215697647\"", "From": "sainath.grandhi@intel.com", "To": "netdev@vger.kernel.org", "Cc": "davem@davemloft.net, Sainath Grandhi <sainath.grandhi@intel.com>", "Subject": "[PATCH RFC v1 2/3] net: Abstracting out common routines from veth\n\tfor use by vethtap", "Date": "Wed, 6 Sep 2017 17:34:26 -0700", "Message-Id": "<1504744467-79590-3-git-send-email-sainath.grandhi@intel.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1504744467-79590-1-git-send-email-sainath.grandhi@intel.com>", "References": "<1504744467-79590-1-git-send-email-sainath.grandhi@intel.com>", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "From: Sainath Grandhi <sainath.grandhi@intel.com>\n\nAbstracting out common routines for link operations in veth implementation\nfor use by vethtap interfaces\n\nSigned-off-by: Sainath Grandhi <sainath.grandhi@intel.com>\n---\n drivers/net/veth.c | 47 +++++++++++++++++++++++++++++++++--------------\n include/linux/if_veth.h | 9 +++++++++\n 2 files changed, 42 insertions(+), 14 deletions(-)\n create mode 100644 include/linux/if_veth.h", "diff": "diff --git a/drivers/net/veth.c b/drivers/net/veth.c\nindex f5438d0..a1b370d 100644\n--- a/drivers/net/veth.c\n+++ b/drivers/net/veth.c\n@@ -18,6 +18,7 @@\n #include <net/dst.h>\n #include <net/xfrm.h>\n #include <linux/veth.h>\n+#include <linux/if_veth.h>\n #include <linux/module.h>\n \n #define DRV_NAME\t\"veth\"\n@@ -29,12 +30,6 @@ struct pcpu_vstats {\n \tstruct u64_stats_sync\tsyncp;\n };\n \n-struct veth_priv {\n-\tstruct net_device __rcu\t*peer;\n-\tatomic64_t\t\tdropped;\n-\tunsigned\t\trequested_headroom;\n-};\n-\n /*\n * ethtool interface\n */\n@@ -298,13 +293,12 @@ static const struct net_device_ops veth_netdev_ops = {\n \t\t NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX | \\\n \t\t NETIF_F_HW_VLAN_STAG_TX | NETIF_F_HW_VLAN_STAG_RX )\n \n-static void veth_setup(struct net_device *dev)\n+void veth_common_setup(struct net_device *dev)\n {\n \tether_setup(dev);\n \n \tdev->priv_flags &= ~IFF_TX_SKB_SHARING;\n \tdev->priv_flags |= IFF_LIVE_ADDR_CHANGE;\n-\tdev->priv_flags |= IFF_NO_QUEUE;\n \tdev->priv_flags |= IFF_PHONY_HEADROOM;\n \n \tdev->netdev_ops = &veth_netdev_ops;\n@@ -325,6 +319,12 @@ static void veth_setup(struct net_device *dev)\n \tdev->mpls_features = NETIF_F_HW_CSUM | NETIF_F_GSO_SOFTWARE;\n }\n \n+static void veth_setup(struct net_device *dev)\n+{\n+\tveth_common_setup(dev);\n+\tdev->priv_flags |= IFF_NO_QUEUE;\n+}\n+\n /*\n * netlink interface\n */\n@@ -465,7 +465,7 @@ static int veth_newlink(struct net *src_net, struct net_device *dev,\n \treturn err;\n }\n \n-static void veth_dellink(struct net_device *dev, struct list_head *head)\n+void veth_dellink(struct net_device *dev, struct list_head *head)\n {\n \tstruct veth_priv *priv;\n \tstruct net_device *peer;\n@@ -503,21 +503,40 @@ static struct rtnl_link_ops veth_link_ops = {\n \t.kind\t\t= DRV_NAME,\n \t.priv_size\t= sizeof(struct veth_priv),\n \t.setup\t\t= veth_setup,\n-\t.validate\t= veth_validate,\n \t.newlink\t= veth_newlink,\n \t.dellink\t= veth_dellink,\n-\t.policy\t\t= veth_policy,\n-\t.maxtype\t= VETH_INFO_MAX,\n-\t.get_link_net\t= veth_get_link_net,\n };\n \n+int veth_link_register(struct rtnl_link_ops *ops)\n+{\n+\t/* common fields */\n+\tops->validate = veth_validate;\n+\tops->policy = veth_policy;\n+\tops->maxtype = VETH_INFO_MAX;\n+\tops->get_link_net = veth_get_link_net;\n+\n+\treturn rtnl_link_register(ops);\n+}\n+\n+void veth_link_ops_init(struct rtnl_link_ops *ops)\n+{\n+\t/*common fields*/\n+\tops->validate = veth_validate;\n+\tops->policy = veth_policy;\n+\tops->maxtype = VETH_INFO_MAX;\n+\tops->get_link_net = veth_get_link_net;\n+}\n /*\n * init/fini\n */\n \n static __init int veth_init(void)\n {\n-\treturn rtnl_link_register(&veth_link_ops);\n+\tint err;\n+\n+\terr = veth_link_register(&veth_link_ops);\n+\n+\treturn err;\n }\n \n static __exit void veth_exit(void)\ndiff --git a/include/linux/if_veth.h b/include/linux/if_veth.h\nnew file mode 100644\nindex 0000000..b007891\n--- /dev/null\n+++ b/include/linux/if_veth.h\n@@ -0,0 +1,9 @@\n+struct veth_priv {\n+\tstruct net_device __rcu *peer;\n+\tatomic64_t dropped;\n+\tunsigned int requested_headroom;\n+};\n+\n+void veth_common_setup(struct net_device *dev);\n+void veth_dellink(struct net_device *dev, struct list_head *head);\n+void veth_link_ops_init(struct rtnl_link_ops *ops);\n", "prefixes": [ "RFC", "v1", "2/3" ] }