[{"id":1776030,"web_url":"http://patchwork.ozlabs.org/comment/1776030/","msgid":"<20170926.214721.734746621809140934.davem@davemloft.net>","list_archive_url":null,"date":"2017-09-27T04:47:21","subject":"Re: [PATCH v2 16/16] net: Add support for networking over\n\tThunderbolt cable","submitter":{"id":15,"url":"http://patchwork.ozlabs.org/api/people/15/","name":"David Miller","email":"davem@davemloft.net"},"content":"From: Mika Westerberg <mika.westerberg@linux.intel.com>\nDate: Mon, 25 Sep 2017 14:07:38 +0300\n\n> +struct thunderbolt_ip_header {\n> +\tu32 route_hi;\n> +\tu32 route_lo;\n> +\tu32 length_sn;\n> +\tuuid_t uuid;\n> +\tuuid_t initiator_uuid;\n> +\tuuid_t target_uuid;\n> +\tu32 type;\n> +\tu32 command_id;\n> +} __packed;\n\nAgain, the __packed attribute should not be necessary and needs to be\nremoved.\n\n> +static void tbnet_pull_tail(struct sk_buff *skb)\n> +{\n> +\tskb_frag_t *frag = &skb_shinfo(skb)->frags[0];\n> +\tunsigned int pull_len;\n> +\tvoid *hdr;\n> +\n> +\thdr = skb_frag_address(frag);\n> +\tpull_len = eth_get_headlen(hdr, TBNET_RX_HDR_SIZE);\n> +\n> +\t/* Align pull length to size of long to optimize memcpy performance */\n> +\tskb_copy_to_linear_data(skb, hdr, ALIGN(pull_len, sizeof(long)));\n\nYou do not need to copy here, instead you can build SKB's where the\nskb->data points directly at the head of your first frag page memory.\n\nSee build_skb().\n\n> +\t\tskb = net->skb;\n> +\t\tif (!skb) {\n> +\t\t\tskb = netdev_alloc_skb_ip_align(net->dev,\n> +\t\t\t\t\t\t\tTBNET_RX_HDR_SIZE);\n> +\t\t\tnet->skb = skb;\n> +\t\t}\n> +\t\tif (!skb)\n> +\t\t\tbreak;\n> +\n> +\t\t/* Single small buffer we can copy directly to the\n> +\t\t * header part of the skb.\n> +\t\t */\n> +\t\tif (hdr->frame_count == 1 && frame_size <= TBNET_RX_HDR_SIZE) {\n\nHere you would use build_skb() instead of netdev_alloc_skb*() for the first\nfrag, and keep the existing code tacking on subsequent frags using\nskb_add_Rx_frag().\n\n> +\tret = register_netdev(dev);\n> +\tif (ret) {\n> +\t\tfree_netdev(dev);\n> +\t\treturn ret;\n> +\t}\n> +\n> +\tnet->handler.uuid = &tbnet_svc_uuid;\n> +\tnet->handler.callback = tbnet_handle_packet,\n> +\tnet->handler.data = net;\n> +\ttb_register_protocol_handler(&net->handler);\n> +\n> +\ttb_service_set_drvdata(svc, net);\n\nThere could be races here.\n\nAt the exact moment you call register_netdev(), your device can be\nbrought UP, packets transmitted, etc.  You entire set of driver code\npaths can be executed.\n\nThe rest of those initializations after register_netdev() probably\nare needed by the rest of the driver to function properly, so may\nneed to happen before register_netdev() publishes the device to the\nentire world.","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 3y250Q0pcmz9t3B\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 27 Sep 2017 14:47:34 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S970848AbdI0ErY (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 27 Sep 2017 00:47:24 -0400","from shards.monkeyblade.net ([184.105.139.130]:48728 \"EHLO\n\tshards.monkeyblade.net\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S968465AbdI0ErW (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Wed, 27 Sep 2017 00:47:22 -0400","from localhost (74-93-104-102-Washington.hfc.comcastbusiness.net\n\t[74.93.104.102])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(Client did not present a certificate)\n\t(Authenticated sender: davem-davemloft)\n\tby shards.monkeyblade.net (Postfix) with ESMTPSA id EC60C13401131;\n\tTue, 26 Sep 2017 21:47:21 -0700 (PDT)"],"Date":"Tue, 26 Sep 2017 21:47:21 -0700 (PDT)","Message-Id":"<20170926.214721.734746621809140934.davem@davemloft.net>","To":"mika.westerberg@linux.intel.com","Cc":"gregkh@linuxfoundation.org, andreas.noever@gmail.com,\n\tmichael.jamet@intel.com, yehezkel.bernat@intel.com,\n\tamir.jer.levy@intel.com, Mario.Limonciello@dell.com,\n\tlukas@wunner.de, andriy.shevchenko@linux.intel.com, andrew@lunn.ch,\n\tlinux-kernel@vger.kernel.org, netdev@vger.kernel.org","Subject":"Re: [PATCH v2 16/16] net: Add support for networking over\n\tThunderbolt cable","From":"David Miller <davem@davemloft.net>","In-Reply-To":"<20170925110738.68382-17-mika.westerberg@linux.intel.com>","References":"<20170925110738.68382-1-mika.westerberg@linux.intel.com>\n\t<20170925110738.68382-17-mika.westerberg@linux.intel.com>","X-Mailer":"Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO)","Mime-Version":"1.0","Content-Type":"Text/Plain; charset=us-ascii","Content-Transfer-Encoding":"7bit","X-Greylist":"Sender succeeded SMTP AUTH, not delayed by\n\tmilter-greylist-4.5.12 (shards.monkeyblade.net\n\t[149.20.54.216]); Tue, 26 Sep 2017 21:47:22 -0700 (PDT)","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1776358,"web_url":"http://patchwork.ozlabs.org/comment/1776358/","msgid":"<20170927134238.GC4630@lahna.fi.intel.com>","list_archive_url":null,"date":"2017-09-27T13:42:38","subject":"Re: [PATCH v2 16/16] net: Add support for networking over\n\tThunderbolt cable","submitter":{"id":14534,"url":"http://patchwork.ozlabs.org/api/people/14534/","name":"Mika Westerberg","email":"mika.westerberg@linux.intel.com"},"content":"On Tue, Sep 26, 2017 at 09:47:21PM -0700, David Miller wrote:\n> From: Mika Westerberg <mika.westerberg@linux.intel.com>\n> Date: Mon, 25 Sep 2017 14:07:38 +0300\n> \n> > +struct thunderbolt_ip_header {\n> > +\tu32 route_hi;\n> > +\tu32 route_lo;\n> > +\tu32 length_sn;\n> > +\tuuid_t uuid;\n> > +\tuuid_t initiator_uuid;\n> > +\tuuid_t target_uuid;\n> > +\tu32 type;\n> > +\tu32 command_id;\n> > +} __packed;\n> \n> Again, the __packed attribute should not be necessary and needs to be\n> removed.\n\nOK, will do.\n\n> > +static void tbnet_pull_tail(struct sk_buff *skb)\n> > +{\n> > +\tskb_frag_t *frag = &skb_shinfo(skb)->frags[0];\n> > +\tunsigned int pull_len;\n> > +\tvoid *hdr;\n> > +\n> > +\thdr = skb_frag_address(frag);\n> > +\tpull_len = eth_get_headlen(hdr, TBNET_RX_HDR_SIZE);\n> > +\n> > +\t/* Align pull length to size of long to optimize memcpy performance */\n> > +\tskb_copy_to_linear_data(skb, hdr, ALIGN(pull_len, sizeof(long)));\n> \n> You do not need to copy here, instead you can build SKB's where the\n> skb->data points directly at the head of your first frag page memory.\n> \n> See build_skb().\n> \n> > +\t\tskb = net->skb;\n> > +\t\tif (!skb) {\n> > +\t\t\tskb = netdev_alloc_skb_ip_align(net->dev,\n> > +\t\t\t\t\t\t\tTBNET_RX_HDR_SIZE);\n> > +\t\t\tnet->skb = skb;\n> > +\t\t}\n> > +\t\tif (!skb)\n> > +\t\t\tbreak;\n> > +\n> > +\t\t/* Single small buffer we can copy directly to the\n> > +\t\t * header part of the skb.\n> > +\t\t */\n> > +\t\tif (hdr->frame_count == 1 && frame_size <= TBNET_RX_HDR_SIZE) {\n> \n> Here you would use build_skb() instead of netdev_alloc_skb*() for the first\n> frag, and keep the existing code tacking on subsequent frags using\n> skb_add_Rx_frag().\n\nI'm reading kernel-doc of build_skb() (or rather __build_skb()) and it\nsays caller needs to reserve head room of NET_SKB_PAD and then make sure\nthere is space for SKB_DATA_ALIGN(skb_shared_info).\n\nNow, in case of ThunderboltIP frames, they look like this:\n\n  +---------+\n  | hdr     | 12 bytes\n  +---------+\n  | data    | 4096 - 12 = 4084 bytes\n  |         |\n  |         |\n  +---------+\n\nA packet can consist of multiple frames where each have the 12-byte\nheader and 4084 bytes of TSO/LRO payload except the last one which can\nbe smaller than 4084.\n\nUsing build_skb() then would require to allocate larger buffer, that\nincludes NET_SKB_PAD + SKB_DATA_ALIGN(skb_shared_info) and that exceeds\npage size. Is this something supported by build_skb()? It was not clear\nto me based on the code and other users of build_skb() but I may be\nmissing something.\n\n> > +\tret = register_netdev(dev);\n> > +\tif (ret) {\n> > +\t\tfree_netdev(dev);\n> > +\t\treturn ret;\n> > +\t}\n> > +\n> > +\tnet->handler.uuid = &tbnet_svc_uuid;\n> > +\tnet->handler.callback = tbnet_handle_packet,\n> > +\tnet->handler.data = net;\n> > +\ttb_register_protocol_handler(&net->handler);\n> > +\n> > +\ttb_service_set_drvdata(svc, net);\n> \n> There could be races here.\n> \n> At the exact moment you call register_netdev(), your device can be\n> brought UP, packets transmitted, etc.  You entire set of driver code\n> paths can be executed.\n> \n> The rest of those initializations after register_netdev() probably\n> are needed by the rest of the driver to function properly, so may\n> need to happen before register_netdev() publishes the device to the\n> entire world.\n\nYou're right. I'll change the ordering so that register_netdev() happens\nlast.\n\nThanks!","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 3y2Jwf2Rlgz9tXw\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 27 Sep 2017 23:45:06 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752602AbdI0Nox (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 27 Sep 2017 09:44:53 -0400","from mga04.intel.com ([192.55.52.120]:55831 \"EHLO mga04.intel.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1752131AbdI0Now (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tWed, 27 Sep 2017 09:44:52 -0400","from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t27 Sep 2017 06:44:51 -0700","from lahna.fi.intel.com (HELO lahna) ([10.237.72.157])\n\tby FMSMGA003.fm.intel.com with SMTP; 27 Sep 2017 06:44:47 -0700","by lahna (sSMTP sendmail emulation);\n\tWed, 27 Sep 2017 16:42:38 +0300"],"X-ExtLoop1":"1","X-IronPort-AV":"E=Sophos;i=\"5.42,445,1500966000\"; d=\"scan'208\";a=\"904392718\"","Date":"Wed, 27 Sep 2017 16:42:38 +0300","From":"Mika Westerberg <mika.westerberg@linux.intel.com>","To":"David Miller <davem@davemloft.net>","Cc":"gregkh@linuxfoundation.org, andreas.noever@gmail.com,\n\tmichael.jamet@intel.com, yehezkel.bernat@intel.com,\n\tamir.jer.levy@intel.com, Mario.Limonciello@dell.com,\n\tlukas@wunner.de, andriy.shevchenko@linux.intel.com, andrew@lunn.ch,\n\tlinux-kernel@vger.kernel.org, netdev@vger.kernel.org","Subject":"Re: [PATCH v2 16/16] net: Add support for networking over\n\tThunderbolt cable","Message-ID":"<20170927134238.GC4630@lahna.fi.intel.com>","References":"<20170925110738.68382-1-mika.westerberg@linux.intel.com>\n\t<20170925110738.68382-17-mika.westerberg@linux.intel.com>\n\t<20170926.214721.734746621809140934.davem@davemloft.net>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170926.214721.734746621809140934.davem@davemloft.net>","Organization":"Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo","User-Agent":"Mutt/1.8.3 (2017-05-23)","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1776469,"web_url":"http://patchwork.ozlabs.org/comment/1776469/","msgid":"<20170927.092709.1826177647592316221.davem@davemloft.net>","list_archive_url":null,"date":"2017-09-27T16:27:09","subject":"Re: [PATCH v2 16/16] net: Add support for networking over\n\tThunderbolt cable","submitter":{"id":15,"url":"http://patchwork.ozlabs.org/api/people/15/","name":"David Miller","email":"davem@davemloft.net"},"content":"From: Mika Westerberg <mika.westerberg@linux.intel.com>\nDate: Wed, 27 Sep 2017 16:42:38 +0300\n\n> Using build_skb() then would require to allocate larger buffer, that\n> includes NET_SKB_PAD + SKB_DATA_ALIGN(skb_shared_info) and that exceeds\n> page size. Is this something supported by build_skb()? It was not clear\n> to me based on the code and other users of build_skb() but I may be\n> missing something.\n\nYou need NET_SKB_PAD before and SKB_DATA_ALIGN(skb_shared_info) afterwards.\nAn order 1 page, if that's what you need, should work just fine.","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 3y2NWt59VNz9t5l\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 28 Sep 2017 02:27:22 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752027AbdI0Q1L (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 27 Sep 2017 12:27:11 -0400","from shards.monkeyblade.net ([184.105.139.130]:39662 \"EHLO\n\tshards.monkeyblade.net\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751333AbdI0Q1K (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Wed, 27 Sep 2017 12:27:10 -0400","from localhost (74-93-104-102-Washington.hfc.comcastbusiness.net\n\t[74.93.104.102])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(Client did not present a certificate)\n\t(Authenticated sender: davem-davemloft)\n\tby shards.monkeyblade.net (Postfix) with ESMTPSA id D3EF113408BF1;\n\tWed, 27 Sep 2017 09:27:09 -0700 (PDT)"],"Date":"Wed, 27 Sep 2017 09:27:09 -0700 (PDT)","Message-Id":"<20170927.092709.1826177647592316221.davem@davemloft.net>","To":"mika.westerberg@linux.intel.com","Cc":"gregkh@linuxfoundation.org, andreas.noever@gmail.com,\n\tmichael.jamet@intel.com, yehezkel.bernat@intel.com,\n\tamir.jer.levy@intel.com, Mario.Limonciello@dell.com,\n\tlukas@wunner.de, andriy.shevchenko@linux.intel.com, andrew@lunn.ch,\n\tlinux-kernel@vger.kernel.org, netdev@vger.kernel.org","Subject":"Re: [PATCH v2 16/16] net: Add support for networking over\n\tThunderbolt cable","From":"David Miller <davem@davemloft.net>","In-Reply-To":"<20170927134238.GC4630@lahna.fi.intel.com>","References":"<20170925110738.68382-17-mika.westerberg@linux.intel.com>\n\t<20170926.214721.734746621809140934.davem@davemloft.net>\n\t<20170927134238.GC4630@lahna.fi.intel.com>","X-Mailer":"Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO)","Mime-Version":"1.0","Content-Type":"Text/Plain; charset=us-ascii","Content-Transfer-Encoding":"7bit","X-Greylist":"Sender succeeded SMTP AUTH, not delayed by\n\tmilter-greylist-4.5.12 (shards.monkeyblade.net\n\t[149.20.54.216]); Wed, 27 Sep 2017 09:27:10 -0700 (PDT)","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1776490,"web_url":"http://patchwork.ozlabs.org/comment/1776490/","msgid":"<20170927172702.GE4630@lahna.fi.intel.com>","list_archive_url":null,"date":"2017-09-27T17:27:02","subject":"Re: [PATCH v2 16/16] net: Add support for networking over\n\tThunderbolt cable","submitter":{"id":14534,"url":"http://patchwork.ozlabs.org/api/people/14534/","name":"Mika Westerberg","email":"mika.westerberg@linux.intel.com"},"content":"On Wed, Sep 27, 2017 at 09:27:09AM -0700, David Miller wrote:\n> From: Mika Westerberg <mika.westerberg@linux.intel.com>\n> Date: Wed, 27 Sep 2017 16:42:38 +0300\n> \n> > Using build_skb() then would require to allocate larger buffer, that\n> > includes NET_SKB_PAD + SKB_DATA_ALIGN(skb_shared_info) and that exceeds\n> > page size. Is this something supported by build_skb()? It was not clear\n> > to me based on the code and other users of build_skb() but I may be\n> > missing something.\n> \n> You need NET_SKB_PAD before and SKB_DATA_ALIGN(skb_shared_info) afterwards.\n> An order 1 page, if that's what you need, should work just fine.\n\nI mean in order to fit a single ThunderboltIP frame, I would need to\nallocate NET_SKB_PAD+4096+SKB_DATA_ALIGN(skb_shared_info) size buffer.\nIs that still fine for build_skb()? Also can I use that with\nskb_add_rx_frag() which seem to take single page?\n\nThunderboltIP protocol basically takes advantage of TSO/LRO but it\nactually does not do any segmentation. Instead it just splits the 64kB\nlarge package into smaller 4k frames (which each include 12 byte header)\nand pushes those over the Thunderbolt medium. The receiver side then\ndoes the opposite.\n\nThanks and sorry for dummy questions. I'm just not too familiar with\nthe networking subsystem (yet).","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 3y2PsV04sCz9t66\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 28 Sep 2017 03:27:42 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752188AbdI0R1c (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 27 Sep 2017 13:27:32 -0400","from mga02.intel.com ([134.134.136.20]:56357 \"EHLO mga02.intel.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1752058AbdI0R1a (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tWed, 27 Sep 2017 13:27:30 -0400","from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t27 Sep 2017 10:27:07 -0700","from lahna.fi.intel.com (HELO lahna) ([10.237.72.157])\n\tby orsmga001.jf.intel.com with SMTP; 27 Sep 2017 10:27:03 -0700","by lahna (sSMTP sendmail emulation);\n\tWed, 27 Sep 2017 20:27:02 +0300"],"X-ExtLoop1":"1","X-IronPort-AV":"E=Sophos;i=\"5.42,445,1500966000\"; d=\"scan'208\";a=\"1176390770\"","Date":"Wed, 27 Sep 2017 20:27:02 +0300","From":"Mika Westerberg <mika.westerberg@linux.intel.com>","To":"David Miller <davem@davemloft.net>","Cc":"gregkh@linuxfoundation.org, andreas.noever@gmail.com,\n\tmichael.jamet@intel.com, yehezkel.bernat@intel.com,\n\tamir.jer.levy@intel.com, Mario.Limonciello@dell.com,\n\tlukas@wunner.de, andriy.shevchenko@linux.intel.com, andrew@lunn.ch,\n\tlinux-kernel@vger.kernel.org, netdev@vger.kernel.org","Subject":"Re: [PATCH v2 16/16] net: Add support for networking over\n\tThunderbolt cable","Message-ID":"<20170927172702.GE4630@lahna.fi.intel.com>","References":"<20170925110738.68382-17-mika.westerberg@linux.intel.com>\n\t<20170926.214721.734746621809140934.davem@davemloft.net>\n\t<20170927134238.GC4630@lahna.fi.intel.com>\n\t<20170927.092709.1826177647592316221.davem@davemloft.net>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170927.092709.1826177647592316221.davem@davemloft.net>","Organization":"Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo","User-Agent":"Mutt/1.8.3 (2017-05-23)","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1776521,"web_url":"http://patchwork.ozlabs.org/comment/1776521/","msgid":"<20170927.112317.1120325676502363972.davem@davemloft.net>","list_archive_url":null,"date":"2017-09-27T18:23:17","subject":"Re: [PATCH v2 16/16] net: Add support for networking over\n\tThunderbolt cable","submitter":{"id":15,"url":"http://patchwork.ozlabs.org/api/people/15/","name":"David Miller","email":"davem@davemloft.net"},"content":"From: Mika Westerberg <mika.westerberg@linux.intel.com>\nDate: Wed, 27 Sep 2017 20:27:02 +0300\n\n> On Wed, Sep 27, 2017 at 09:27:09AM -0700, David Miller wrote:\n>> From: Mika Westerberg <mika.westerberg@linux.intel.com>\n>> Date: Wed, 27 Sep 2017 16:42:38 +0300\n>> \n>> > Using build_skb() then would require to allocate larger buffer, that\n>> > includes NET_SKB_PAD + SKB_DATA_ALIGN(skb_shared_info) and that exceeds\n>> > page size. Is this something supported by build_skb()? It was not clear\n>> > to me based on the code and other users of build_skb() but I may be\n>> > missing something.\n>> \n>> You need NET_SKB_PAD before and SKB_DATA_ALIGN(skb_shared_info) afterwards.\n>> An order 1 page, if that's what you need, should work just fine.\n> \n> I mean in order to fit a single ThunderboltIP frame, I would need to\n> allocate NET_SKB_PAD+4096+SKB_DATA_ALIGN(skb_shared_info) size buffer.\n\nWhich would be an order 1 page or 8192 bytes.\n\n> Is that still fine for build_skb()? Also can I use that with\n> skb_add_rx_frag() which seem to take single page?\n\nAgain, an order 1 page should work fine.","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 3y2R5s0Y3vz9tXQ\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 28 Sep 2017 04:23:29 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751983AbdI0SXT (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 27 Sep 2017 14:23:19 -0400","from shards.monkeyblade.net ([184.105.139.130]:42740 \"EHLO\n\tshards.monkeyblade.net\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751016AbdI0SXS (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Wed, 27 Sep 2017 14:23:18 -0400","from localhost (74-93-104-102-Washington.hfc.comcastbusiness.net\n\t[74.93.104.102])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(Client did not present a certificate)\n\t(Authenticated sender: davem-davemloft)\n\tby shards.monkeyblade.net (Postfix) with ESMTPSA id A2F221340B686;\n\tWed, 27 Sep 2017 11:23:17 -0700 (PDT)"],"Date":"Wed, 27 Sep 2017 11:23:17 -0700 (PDT)","Message-Id":"<20170927.112317.1120325676502363972.davem@davemloft.net>","To":"mika.westerberg@linux.intel.com","Cc":"gregkh@linuxfoundation.org, andreas.noever@gmail.com,\n\tmichael.jamet@intel.com, yehezkel.bernat@intel.com,\n\tamir.jer.levy@intel.com, Mario.Limonciello@dell.com,\n\tlukas@wunner.de, andriy.shevchenko@linux.intel.com, andrew@lunn.ch,\n\tlinux-kernel@vger.kernel.org, netdev@vger.kernel.org","Subject":"Re: [PATCH v2 16/16] net: Add support for networking over\n\tThunderbolt cable","From":"David Miller <davem@davemloft.net>","In-Reply-To":"<20170927172702.GE4630@lahna.fi.intel.com>","References":"<20170927134238.GC4630@lahna.fi.intel.com>\n\t<20170927.092709.1826177647592316221.davem@davemloft.net>\n\t<20170927172702.GE4630@lahna.fi.intel.com>","X-Mailer":"Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO)","Mime-Version":"1.0","Content-Type":"Text/Plain; charset=us-ascii","Content-Transfer-Encoding":"7bit","X-Greylist":"Sender succeeded SMTP AUTH, not delayed by\n\tmilter-greylist-4.5.12 (shards.monkeyblade.net\n\t[149.20.54.216]); Wed, 27 Sep 2017 11:23:18 -0700 (PDT)","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}}]