[{"id":1763850,"web_url":"http://patchwork.ozlabs.org/comment/1763850/","msgid":"<bdd7d5a3-2004-ad2e-3c09-8198d76acafa@intel.com>","list_archive_url":null,"date":"2017-09-06T07:06:39","subject":"Re: [Intel-wired-lan] [PATCH net-next v3] e1000e: Be drop monitor\n\tfriendly","submitter":{"id":69860,"url":"http://patchwork.ozlabs.org/api/people/69860/","name":"Sasha Neftin","email":"sasha.neftin@intel.com"},"content":"On 8/26/2017 04:14, Florian Fainelli wrote:\n> e1000e_put_txbuf() can be called from normal reclamation path as well as\n> when a DMA mapping failure, so we need to differentiate these two cases\n> when freeing SKBs to be drop monitor friendly. e1000e_tx_hwtstamp_work()\n> and e1000_remove() are processing TX timestamped SKBs and those should\n> not be accounted as drops either.\n>\n> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>\n> ---\n> Changes in v3:\n>\n> - differentiate normal reclamation from TX DMA fragment mapping errors\n> - removed a few invalid dev_kfree_skb() replacements (those are already\n>    drop monitor friendly)\n>\n> Changes in v2:\n>\n> - make it compile\n>\n>   drivers/net/ethernet/intel/e1000e/netdev.c | 18 +++++++++++-------\n>   1 file changed, 11 insertions(+), 7 deletions(-)\n>\n> diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c\n> index 327dfe5bedc0..cfd21858c095 100644\n> --- a/drivers/net/ethernet/intel/e1000e/netdev.c\n> +++ b/drivers/net/ethernet/intel/e1000e/netdev.c\n> @@ -1071,7 +1071,8 @@ static bool e1000_clean_rx_irq(struct e1000_ring *rx_ring, int *work_done,\n>   }\n>   \n>   static void e1000_put_txbuf(struct e1000_ring *tx_ring,\n> -\t\t\t    struct e1000_buffer *buffer_info)\n> +\t\t\t    struct e1000_buffer *buffer_info,\n> +\t\t\t    bool drop)\n>   {\n>   \tstruct e1000_adapter *adapter = tx_ring->adapter;\n>   \n> @@ -1085,7 +1086,10 @@ static void e1000_put_txbuf(struct e1000_ring *tx_ring,\n>   \t\tbuffer_info->dma = 0;\n>   \t}\n>   \tif (buffer_info->skb) {\n> -\t\tdev_kfree_skb_any(buffer_info->skb);\n> +\t\tif (drop)\n> +\t\t\tdev_kfree_skb_any(buffer_info->skb);\n> +\t\telse\n> +\t\t\tdev_consume_skb_any(buffer_info->skb);\n>   \t\tbuffer_info->skb = NULL;\n>   \t}\n>   \tbuffer_info->time_stamp = 0;\n> @@ -1199,7 +1203,7 @@ static void e1000e_tx_hwtstamp_work(struct work_struct *work)\n>   \t\twmb(); /* force write prior to skb_tstamp_tx */\n>   \n>   \t\tskb_tstamp_tx(skb, &shhwtstamps);\n> -\t\tdev_kfree_skb_any(skb);\n> +\t\tdev_consume_skb_any(skb);\n>   \t} else if (time_after(jiffies, adapter->tx_hwtstamp_start\n>   \t\t\t      + adapter->tx_timeout_factor * HZ)) {\n>   \t\tdev_kfree_skb_any(adapter->tx_hwtstamp_skb);\n> @@ -1254,7 +1258,7 @@ static bool e1000_clean_tx_irq(struct e1000_ring *tx_ring)\n>   \t\t\t\t}\n>   \t\t\t}\n>   \n> -\t\t\te1000_put_txbuf(tx_ring, buffer_info);\n> +\t\t\te1000_put_txbuf(tx_ring, buffer_info, false);\n>   \t\t\ttx_desc->upper.data = 0;\n>   \n>   \t\t\ti++;\n> @@ -2421,7 +2425,7 @@ static void e1000_clean_tx_ring(struct e1000_ring *tx_ring)\n>   \n>   \tfor (i = 0; i < tx_ring->count; i++) {\n>   \t\tbuffer_info = &tx_ring->buffer_info[i];\n> -\t\te1000_put_txbuf(tx_ring, buffer_info);\n> +\t\te1000_put_txbuf(tx_ring, buffer_info, false);\n>   \t}\n>   \n>   \tnetdev_reset_queue(adapter->netdev);\n> @@ -5614,7 +5618,7 @@ static int e1000_tx_map(struct e1000_ring *tx_ring, struct sk_buff *skb,\n>   \t\t\ti += tx_ring->count;\n>   \t\ti--;\n>   \t\tbuffer_info = &tx_ring->buffer_info[i];\n> -\t\te1000_put_txbuf(tx_ring, buffer_info);\n> +\t\te1000_put_txbuf(tx_ring, buffer_info, true);\n>   \t}\n>   \n>   \treturn 0;\n> @@ -7411,7 +7415,7 @@ static void e1000_remove(struct pci_dev *pdev)\n>   \tif (adapter->flags & FLAG_HAS_HW_TIMESTAMP) {\n>   \t\tcancel_work_sync(&adapter->tx_hwtstamp_work);\n>   \t\tif (adapter->tx_hwtstamp_skb) {\n> -\t\t\tdev_kfree_skb_any(adapter->tx_hwtstamp_skb);\n> +\t\t\tdev_consume_skb_any(adapter->tx_hwtstamp_skb);\n>   \t\t\tadapter->tx_hwtstamp_skb = NULL;\n>   \t\t}\n>   \t}\n\ni am ok with this patch","headers":{"Return-Path":"<intel-wired-lan-bounces@osuosl.org>","X-Original-To":["incoming@patchwork.ozlabs.org","intel-wired-lan@lists.osuosl.org"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","intel-wired-lan@lists.osuosl.org"],"Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.138; helo=whitealder.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)","Received":["from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xnF4m0DpVz9sNd\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  6 Sep 2017 17:06:47 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id D030988700;\n\tWed,  6 Sep 2017 07:06:45 +0000 (UTC)","from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id JWmcn7e5Tzva; Wed,  6 Sep 2017 07:06:44 +0000 (UTC)","from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id E87A4886FA;\n\tWed,  6 Sep 2017 07:06:44 +0000 (UTC)","from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 6BB7E1C24F3\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed,  6 Sep 2017 07:06:43 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 63F2F87736\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed,  6 Sep 2017 07:06:43 +0000 (UTC)","from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id KxibqHlkRyAw for <intel-wired-lan@lists.osuosl.org>;\n\tWed,  6 Sep 2017 07:06:42 +0000 (UTC)","from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id D453487728\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed,  6 Sep 2017 07:06:42 +0000 (UTC)","from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby orsmga104.jf.intel.com with ESMTP; 06 Sep 2017 00:06:42 -0700","from unknown (HELO [10.185.202.81]) ([10.185.202.81])\n\tby fmsmga004.fm.intel.com with ESMTP; 06 Sep 2017 00:06:40 -0700"],"X-Virus-Scanned":["amavisd-new at osuosl.org","amavisd-new at osuosl.org"],"X-Greylist":"domain auto-whitelisted by SQLgrey-1.7.6","X-ExtLoop1":"1","X-IronPort-AV":"E=Sophos;i=\"5.41,483,1498546800\"; d=\"scan'208\";a=\"308440825\"","To":"Florian Fainelli <f.fainelli@gmail.com>, netdev@vger.kernel.org","References":"<20170826011424.27251-1-f.fainelli@gmail.com>","From":"\"Neftin, Sasha\" <sasha.neftin@intel.com>","Message-ID":"<bdd7d5a3-2004-ad2e-3c09-8198d76acafa@intel.com>","Date":"Wed, 6 Sep 2017 10:06:39 +0300","User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101\n\tThunderbird/45.6.0","MIME-Version":"1.0","In-Reply-To":"<20170826011424.27251-1-f.fainelli@gmail.com>","Cc":"edumazet@gmail.com, \"moderated list:INTEL ETHERNET DRIVERS\"\n\t<intel-wired-lan@lists.osuosl.org>, \n\topen list <linux-kernel@vger.kernel.org>, davem@davemloft.net","Subject":"Re: [Intel-wired-lan] [PATCH net-next v3] e1000e: Be drop monitor\n\tfriendly","X-BeenThere":"intel-wired-lan@osuosl.org","X-Mailman-Version":"2.1.18-1","Precedence":"list","List-Id":"Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>","List-Unsubscribe":"<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>","List-Archive":"<http://lists.osuosl.org/pipermail/intel-wired-lan/>","List-Post":"<mailto:intel-wired-lan@osuosl.org>","List-Help":"<mailto:intel-wired-lan-request@osuosl.org?subject=help>","List-Subscribe":"<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>","Content-Transfer-Encoding":"7bit","Content-Type":"text/plain; charset=\"us-ascii\"; Format=\"flowed\"","Errors-To":"intel-wired-lan-bounces@osuosl.org","Sender":"\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"}},{"id":1768872,"web_url":"http://patchwork.ozlabs.org/comment/1768872/","msgid":"<309B89C4C689E141A5FF6A0C5FB2118B8C6A057B@ORSMSX101.amr.corp.intel.com>","list_archive_url":null,"date":"2017-09-14T23:54:52","subject":"Re: [Intel-wired-lan] [PATCH net-next v3] e1000e: Be drop\n\tmonitor\tfriendly","submitter":{"id":37025,"url":"http://patchwork.ozlabs.org/api/people/37025/","name":"Brown, Aaron F","email":"aaron.f.brown@intel.com"},"content":"> From: Intel-wired-lan [mailto:intel-wired-lan-bounces@osuosl.org] On Behalf\n> Of Florian Fainelli\n> Sent: Friday, August 25, 2017 6:14 PM\n> To: netdev@vger.kernel.org\n> Cc: edumazet@gmail.com; Florian Fainelli <f.fainelli@gmail.com>; open list\n> <linux-kernel@vger.kernel.org>; moderated list:INTEL ETHERNET DRIVERS\n> <intel-wired-lan@lists.osuosl.org>; davem@davemloft.net\n> Subject: [Intel-wired-lan] [PATCH net-next v3] e1000e: Be drop monitor\n> friendly\n> \n> e1000e_put_txbuf() can be called from normal reclamation path as well as\n> when a DMA mapping failure, so we need to differentiate these two cases\n> when freeing SKBs to be drop monitor friendly. e1000e_tx_hwtstamp_work()\n> and e1000_remove() are processing TX timestamped SKBs and those should\n> not be accounted as drops either.\n> \n> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>\n> ---\n> Changes in v3:\n> \n> - differentiate normal reclamation from TX DMA fragment mapping errors\n> - removed a few invalid dev_kfree_skb() replacements (those are already\n>   drop monitor friendly)\n> \n> Changes in v2:\n> \n> - make it compile\n> \n>  drivers/net/ethernet/intel/e1000e/netdev.c | 18 +++++++++++-------\n>  1 file changed, 11 insertions(+), 7 deletions(-)\n\nTested-by: Aaron Brown <aaron.f.brown@intel.com>","headers":{"Return-Path":"<intel-wired-lan-bounces@osuosl.org>","X-Original-To":["incoming@patchwork.ozlabs.org","intel-wired-lan@lists.osuosl.org"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","intel-wired-lan@lists.osuosl.org"],"Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.133; helo=hemlock.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)","Received":["from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xtb4Q0vVQz9s7h\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 15 Sep 2017 09:55:01 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 2754983ABE;\n\tThu, 14 Sep 2017 23:55:00 +0000 (UTC)","from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id w4NNBjPudyHI; Thu, 14 Sep 2017 23:54:58 +0000 (UTC)","from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 46D6B837CF;\n\tThu, 14 Sep 2017 23:54:58 +0000 (UTC)","from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 0EF501C0A2B\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 14 Sep 2017 23:54:57 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 04C5C84E10\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 14 Sep 2017 23:54:57 +0000 (UTC)","from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id ZrJtXBAcq0Gs for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 14 Sep 2017 23:54:55 +0000 (UTC)","from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id F03FD81E99\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 14 Sep 2017 23:54:54 +0000 (UTC)","from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby orsmga104.jf.intel.com with ESMTP; 14 Sep 2017 16:54:54 -0700","from orsmsx110.amr.corp.intel.com ([10.22.240.8])\n\tby fmsmga006.fm.intel.com with ESMTP; 14 Sep 2017 16:54:53 -0700","from orsmsx101.amr.corp.intel.com ([169.254.8.156]) by\n\tORSMSX110.amr.corp.intel.com ([169.254.10.110]) with mapi id\n\t14.03.0319.002; Thu, 14 Sep 2017 16:54:53 -0700"],"X-Virus-Scanned":["amavisd-new at osuosl.org","amavisd-new at osuosl.org"],"X-Greylist":"domain auto-whitelisted by SQLgrey-1.7.6","X-ExtLoop1":"1","X-IronPort-AV":"E=Sophos;i=\"5.42,395,1500966000\"; d=\"scan'208\";a=\"152041457\"","From":"\"Brown, Aaron F\" <aaron.f.brown@intel.com>","To":"Florian Fainelli <f.fainelli@gmail.com>, \"netdev@vger.kernel.org\"\n\t<netdev@vger.kernel.org>","Thread-Topic":"[Intel-wired-lan] [PATCH net-next v3] e1000e: Be drop monitor\n\tfriendly","Thread-Index":"AQHTHgtpncHCiQhd2k6CGHb3rUIi4qK1LW1A","Date":"Thu, 14 Sep 2017 23:54:52 +0000","Message-ID":"<309B89C4C689E141A5FF6A0C5FB2118B8C6A057B@ORSMSX101.amr.corp.intel.com>","References":"<20170826011424.27251-1-f.fainelli@gmail.com>","In-Reply-To":"<20170826011424.27251-1-f.fainelli@gmail.com>","Accept-Language":"en-US","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","dlp-product":"dlpe-windows","dlp-version":"11.0.0.116","dlp-reaction":"no-action","x-originating-ip":"[10.22.254.139]","MIME-Version":"1.0","Cc":"\"edumazet@gmail.com\" <edumazet@gmail.com>,\n\t\"moderated list:INTEL ETHERNET DRIVERS\"\n\t<intel-wired-lan@lists.osuosl.org>, \n\topen list <linux-kernel@vger.kernel.org>,\n\t\"davem@davemloft.net\" <davem@davemloft.net>","Subject":"Re: [Intel-wired-lan] [PATCH net-next v3] e1000e: Be drop\n\tmonitor\tfriendly","X-BeenThere":"intel-wired-lan@osuosl.org","X-Mailman-Version":"2.1.18-1","Precedence":"list","List-Id":"Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>","List-Unsubscribe":"<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>","List-Archive":"<http://lists.osuosl.org/pipermail/intel-wired-lan/>","List-Post":"<mailto:intel-wired-lan@osuosl.org>","List-Help":"<mailto:intel-wired-lan-request@osuosl.org?subject=help>","List-Subscribe":"<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"intel-wired-lan-bounces@osuosl.org","Sender":"\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"}}]