[{"id":1768389,"web_url":"http://patchwork.ozlabs.org/comment/1768389/","msgid":"<139fbb88-f69f-ecf0-5224-8ab2c283a84c@oracle.com>","list_archive_url":null,"date":"2017-09-14T07:55:10","subject":"Re: [PATCH 1/1] forcedeth: remove tx_stop variable","submitter":{"id":70718,"url":"http://patchwork.ozlabs.org/api/people/70718/","name":"Zhu Yanjun","email":"yanjun.zhu@oracle.com"},"content":"Hi, all\n\nAfter this patch is applied, the TCP && UDP tests are made.\n\nThe TCP bandwidth is 939 Mbits/sec. The UDP bandwidth is 806 Mbits/sec.\n\nSo I think this patch can work well.\n\nhost1 <-----> host2\n\nhost1: forcedeth NIC\nIP: 1.1.1.107\niperf -s\n\nhost2: forcedeth NIC\nIP:1.1.1.105\niperf -c 1.1.1.107\n\nThe TCP Bandwidth is as below:\n------------------------------------------------------------\nClient connecting to 1.1.1.107, TCP port 5001\nTCP window size: 85.0 KByte (default)\n------------------------------------------------------------\n[  3] local 1.1.1.105 port 46092 connected with 1.1.1.107 port 5001\n[ ID] Interval       Transfer     Bandwidth\n[  3]  0.0-10.0 sec  1.09 GBytes   939 Mbits/sec\n\nThe UDP is as below:\n\niperf -c 1.1.1.107 -u -b 1000m\n------------------------------------------------------------\nClient connecting to 1.1.1.107, UDP port 5001\nSending 1470 byte datagrams\nUDP buffer size:  208 KByte (default)\n------------------------------------------------------------\n[  3] local 1.1.1.105 port 47265 connected with 1.1.1.107 port 5001\n[ ID] Interval       Transfer     Bandwidth\n[  3]  0.0-10.0 sec   964 MBytes   809 Mbits/sec\n[  3] Sent 687990 datagrams\n[  3] Server Report:\n[  3]  0.0-10.0 sec   960 MBytes   806 Mbits/sec   0.019 ms 2942/687989 \n(0.43%)\n[  3]  0.0-10.0 sec  1 datagrams received out-of-order\n\nZhu Yanjun\n\nOn 2017/9/8 20:28, Zhu Yanjun wrote:\n> The variable tx_stop is used to indicate the tx queue state: started\n> or stopped. In fact, the inline function netif_queue_stopped can do\n> the same work. So replace the variable tx_stop with the\n> function netif_queue_stopped.\n>\n> Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>\n> ---\n>   drivers/net/ethernet/nvidia/forcedeth.c | 13 ++++---------\n>   1 file changed, 4 insertions(+), 9 deletions(-)\n>\n> diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c\n> index 994a83a..e6e0de4 100644\n> --- a/drivers/net/ethernet/nvidia/forcedeth.c\n> +++ b/drivers/net/ethernet/nvidia/forcedeth.c\n> @@ -834,7 +834,6 @@ struct fe_priv {\n>   \tu32 tx_pkts_in_progress;\n>   \tstruct nv_skb_map *tx_change_owner;\n>   \tstruct nv_skb_map *tx_end_flip;\n> -\tint tx_stop;\n>   \n>   \t/* TX software stats */\n>   \tstruct u64_stats_sync swstats_tx_syncp;\n> @@ -1939,7 +1938,6 @@ static void nv_init_tx(struct net_device *dev)\n>   \tnp->tx_pkts_in_progress = 0;\n>   \tnp->tx_change_owner = NULL;\n>   \tnp->tx_end_flip = NULL;\n> -\tnp->tx_stop = 0;\n>   \n>   \tfor (i = 0; i < np->tx_ring_size; i++) {\n>   \t\tif (!nv_optimized(np)) {\n> @@ -2211,7 +2209,6 @@ static netdev_tx_t nv_start_xmit(struct sk_buff *skb, struct net_device *dev)\n>   \tempty_slots = nv_get_empty_tx_slots(np);\n>   \tif (unlikely(empty_slots <= entries)) {\n>   \t\tnetif_stop_queue(dev);\n> -\t\tnp->tx_stop = 1;\n>   \t\tspin_unlock_irqrestore(&np->lock, flags);\n>   \t\treturn NETDEV_TX_BUSY;\n>   \t}\n> @@ -2359,7 +2356,6 @@ static netdev_tx_t nv_start_xmit_optimized(struct sk_buff *skb,\n>   \tempty_slots = nv_get_empty_tx_slots(np);\n>   \tif (unlikely(empty_slots <= entries)) {\n>   \t\tnetif_stop_queue(dev);\n> -\t\tnp->tx_stop = 1;\n>   \t\tspin_unlock_irqrestore(&np->lock, flags);\n>   \t\treturn NETDEV_TX_BUSY;\n>   \t}\n> @@ -2583,8 +2579,8 @@ static int nv_tx_done(struct net_device *dev, int limit)\n>   \n>   \tnetdev_completed_queue(np->dev, tx_work, bytes_compl);\n>   \n> -\tif (unlikely((np->tx_stop == 1) && (np->get_tx.orig != orig_get_tx))) {\n> -\t\tnp->tx_stop = 0;\n> +\tif (unlikely(netif_queue_stopped(dev) &&\n> +\t\t     (np->get_tx.orig != orig_get_tx))) {\n>   \t\tnetif_wake_queue(dev);\n>   \t}\n>   \treturn tx_work;\n> @@ -2637,8 +2633,8 @@ static int nv_tx_done_optimized(struct net_device *dev, int limit)\n>   \n>   \tnetdev_completed_queue(np->dev, tx_work, bytes_cleaned);\n>   \n> -\tif (unlikely((np->tx_stop == 1) && (np->get_tx.ex != orig_get_tx))) {\n> -\t\tnp->tx_stop = 0;\n> +\tif (unlikely(netif_queue_stopped(dev) &&\n> +\t\t     (np->get_tx.ex != orig_get_tx))) {\n>   \t\tnetif_wake_queue(dev);\n>   \t}\n>   \treturn tx_work;\n> @@ -2724,7 +2720,6 @@ static void nv_tx_timeout(struct net_device *dev)\n>   \t/* 2) complete any outstanding tx and do not give HW any limited tx pkts */\n>   \tsaved_tx_limit = np->tx_limit;\n>   \tnp->tx_limit = 0; /* prevent giving HW any limited pkts */\n> -\tnp->tx_stop = 0;  /* prevent waking tx queue */\n>   \tif (!nv_optimized(np))\n>   \t\tnv_tx_done(dev, np->tx_ring_size);\n>   \telse","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 3xt9mK5fFJz9sRm\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 14 Sep 2017 17:54:41 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751418AbdINHyi (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tThu, 14 Sep 2017 03:54:38 -0400","from userp1040.oracle.com ([156.151.31.81]:30779 \"EHLO\n\tuserp1040.oracle.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751206AbdINHyh (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Thu, 14 Sep 2017 03:54:37 -0400","from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71])\n\tby userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with\n\tESMTP id v8E7sX2P024363\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Thu, 14 Sep 2017 07:54:34 GMT","from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72])\n\tby userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v8E7sXqc003777\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Thu, 14 Sep 2017 07:54:33 GMT","from ubhmp0012.oracle.com (ubhmp0012.oracle.com [156.151.24.65])\n\tby userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v8E7sWdX026601; \n\tThu, 14 Sep 2017 07:54:33 GMT","from [10.182.71.144] (/10.182.71.144)\n\tby default (Oracle Beehive Gateway v4.0)\n\twith ESMTP ; Thu, 14 Sep 2017 07:54:32 +0000"],"Subject":"Re: [PATCH 1/1] forcedeth: remove tx_stop variable","To":"davem@davemloft.net, netdev@vger.kernel.org","References":"<1504873725-30180-1-git-send-email-yanjun.zhu@oracle.com>","From":"Yanjun Zhu <yanjun.zhu@oracle.com>","Organization":"Oracle Corporation","Message-ID":"<139fbb88-f69f-ecf0-5224-8ab2c283a84c@oracle.com>","Date":"Thu, 14 Sep 2017 15:55:10 +0800","User-Agent":"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<1504873725-30180-1-git-send-email-yanjun.zhu@oracle.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Transfer-Encoding":"8bit","Content-Language":"en-US","X-Source-IP":"userv0021.oracle.com [156.151.31.71]","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}}]