{"id":809788,"url":"http://patchwork.ozlabs.org/api/1.2/patches/809788/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/patch/150455042211.455.6804897285651927718.stgit@firesoul/","project":{"id":7,"url":"http://patchwork.ozlabs.org/api/1.2/projects/7/?format=json","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":"<150455042211.455.6804897285651927718.stgit@firesoul>","list_archive_url":null,"date":"2017-09-04T18:40:22","name":"[net-next,V2] ixgbe: add counter for times rx pages gets allocated, not recycled","commit_ref":null,"pull_url":null,"state":"awaiting-upstream","archived":true,"hash":"1e3852a955d7a83d38628b8e9e95a7684c8343e6","submitter":{"id":13625,"url":"http://patchwork.ozlabs.org/api/1.2/people/13625/?format=json","name":"Jesper Dangaard Brouer","email":"brouer@redhat.com"},"delegate":{"id":34,"url":"http://patchwork.ozlabs.org/api/1.2/users/34/?format=json","username":"davem","first_name":"David","last_name":"Miller","email":"davem@davemloft.net"},"mbox":"http://patchwork.ozlabs.org/project/netdev/patch/150455042211.455.6804897285651927718.stgit@firesoul/mbox/","series":[{"id":1443,"url":"http://patchwork.ozlabs.org/api/1.2/series/1443/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/list/?series=1443","date":"2017-09-04T18:40:22","name":"[net-next,V2] ixgbe: add counter for times rx pages gets allocated, not recycled","version":2,"mbox":"http://patchwork.ozlabs.org/series/1443/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/809788/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/809788/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>)","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=brouer@redhat.com"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xmJZ55DTmz9t24\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue,  5 Sep 2017 04:40:29 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1753962AbdIDSk1 (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 4 Sep 2017 14:40:27 -0400","from mx1.redhat.com ([209.132.183.28]:36474 \"EHLO mx1.redhat.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1753932AbdIDSk0 (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tMon, 4 Sep 2017 14:40:26 -0400","from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id D021D7F7DA;\n\tMon,  4 Sep 2017 18:40:25 +0000 (UTC)","from firesoul.localdomain (ovpn-200-42.brq.redhat.com\n\t[10.40.200.42])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 3F42081521;\n\tMon,  4 Sep 2017 18:40:23 +0000 (UTC)","from [192.168.5.1] (localhost [IPv6:::1])\n\tby firesoul.localdomain (Postfix) with ESMTP id 382053318E71C;\n\tMon,  4 Sep 2017 20:40:22 +0200 (CEST)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com D021D7F7DA","Subject":"[net-next PATCH V2] ixgbe: add counter for times rx pages gets\n\tallocated, not recycled","From":"Jesper Dangaard Brouer <brouer@redhat.com>","To":"intel-wired-lan@lists.osuosl.org,\n\tJeff Kirsher <jeffrey.t.kirsher@intel.com>","Cc":"netdev@vger.kernel.org, Alexander Duyck <alexander.duyck@gmail.com>,\n\tJesper Dangaard Brouer <brouer@redhat.com>","Date":"Mon, 04 Sep 2017 20:40:22 +0200","Message-ID":"<150455042211.455.6804897285651927718.stgit@firesoul>","User-Agent":"StGit/0.17.1-dirty","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.12","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.28]);\n\tMon, 04 Sep 2017 18:40:26 +0000 (UTC)","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"},"content":"The ixgbe driver have page recycle scheme based around the RX-ring\nqueue, where a RX page is shared between two packets. Based on the\nrefcnt, the driver can determine if the RX-page is currently only used\nby a single packet, if so it can then directly refill/recycle the\nRX-slot by with the opposite \"side\" of the page.\n\nWhile this is a clever trick, it is hard to determine when this\nrecycling is successful and when it fails.  Adding a counter, which is\navailable via ethtool --statistics as 'alloc_rx_page'.  Which counts\nthe number of times the recycle fails and the real page allocator is\ninvoked.  When interpreting the stats, do remember that every alloc\nwill serve two packets.\n\nThe counter is collected per rx_ring, but is summed and ethtool\nexported as 'alloc_rx_page'.  It would be relevant to know what\nrx_ring that cannot keep up, but that can be exported later if\nsomeone experience a need for this.\n\nSigned-off-by: Jesper Dangaard Brouer <brouer@redhat.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe.h         |    2 ++\n drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c |    1 +\n drivers/net/ethernet/intel/ixgbe/ixgbe_main.c    |    4 ++++\n 3 files changed, 7 insertions(+)","diff":"diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h\nindex dd5578756ae0..008d0085e01f 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h\n@@ -275,6 +275,7 @@ struct ixgbe_rx_queue_stats {\n \tu64 rsc_count;\n \tu64 rsc_flush;\n \tu64 non_eop_descs;\n+\tu64 alloc_rx_page;\n \tu64 alloc_rx_page_failed;\n \tu64 alloc_rx_buff_failed;\n \tu64 csum_err;\n@@ -655,6 +656,7 @@ struct ixgbe_adapter {\n \tu64 rsc_total_count;\n \tu64 rsc_total_flush;\n \tu64 non_eop_descs;\n+\tu32 alloc_rx_page;\n \tu32 alloc_rx_page_failed;\n \tu32 alloc_rx_buff_failed;\n \ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c\nindex 72c565712a5f..d96d9d6c3492 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c\n@@ -104,6 +104,7 @@ static const struct ixgbe_stats ixgbe_gstrings_stats[] = {\n \t{\"tx_flow_control_xoff\", IXGBE_STAT(stats.lxofftxc)},\n \t{\"rx_flow_control_xoff\", IXGBE_STAT(stats.lxoffrxc)},\n \t{\"rx_csum_offload_errors\", IXGBE_STAT(hw_csum_rx_error)},\n+\t{\"alloc_rx_page\", IXGBE_STAT(alloc_rx_page)},\n \t{\"alloc_rx_page_failed\", IXGBE_STAT(alloc_rx_page_failed)},\n \t{\"alloc_rx_buff_failed\", IXGBE_STAT(alloc_rx_buff_failed)},\n \t{\"rx_no_dma_resources\", IXGBE_STAT(hw_rx_no_dma_resources)},\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex d962368d08d0..d6ac9da8d628 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -1620,6 +1620,7 @@ static bool ixgbe_alloc_mapped_page(struct ixgbe_ring *rx_ring,\n \tbi->page = page;\n \tbi->page_offset = ixgbe_rx_offset(rx_ring);\n \tbi->pagecnt_bias = 1;\n+\trx_ring->rx_stats.alloc_rx_page++;\n \n \treturn true;\n }\n@@ -6771,6 +6772,7 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter)\n \tu32 i, missed_rx = 0, mpc, bprc, lxon, lxoff, xon_off_tot;\n \tu64 non_eop_descs = 0, restart_queue = 0, tx_busy = 0;\n \tu64 alloc_rx_page_failed = 0, alloc_rx_buff_failed = 0;\n+\tu64 alloc_rx_page = 0;\n \tu64 bytes = 0, packets = 0, hw_csum_rx_error = 0;\n \n \tif (test_bit(__IXGBE_DOWN, &adapter->state) ||\n@@ -6791,6 +6793,7 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter)\n \tfor (i = 0; i < adapter->num_rx_queues; i++) {\n \t\tstruct ixgbe_ring *rx_ring = adapter->rx_ring[i];\n \t\tnon_eop_descs += rx_ring->rx_stats.non_eop_descs;\n+\t\talloc_rx_page += rx_ring->rx_stats.alloc_rx_page;\n \t\talloc_rx_page_failed += rx_ring->rx_stats.alloc_rx_page_failed;\n \t\talloc_rx_buff_failed += rx_ring->rx_stats.alloc_rx_buff_failed;\n \t\thw_csum_rx_error += rx_ring->rx_stats.csum_err;\n@@ -6798,6 +6801,7 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter)\n \t\tpackets += rx_ring->stats.packets;\n \t}\n \tadapter->non_eop_descs = non_eop_descs;\n+\tadapter->alloc_rx_page = alloc_rx_page;\n \tadapter->alloc_rx_page_failed = alloc_rx_page_failed;\n \tadapter->alloc_rx_buff_failed = alloc_rx_buff_failed;\n \tadapter->hw_csum_rx_error = hw_csum_rx_error;\n","prefixes":["net-next","V2"]}