All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ding Tianhong <dingtianhong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: <arnd-r2nGTMty4D4@public.gmane.org>,
	<davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
	<grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: <sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>,
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	<eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	<zhangfei.gao-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	<joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>,
	<netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	<linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
Subject: [PATCH net-next 5/6] net: hip04: remove the unnecessary check
Date: Wed, 15 Apr 2015 20:30:07 +0800	[thread overview]
Message-ID: <1429101008-9464-6-git-send-email-dingtianhong@huawei.com> (raw)
In-Reply-To: <1429101008-9464-1-git-send-email-dingtianhong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>

Testing bytes_compl should be enough, because there is no way
that pkt_compl could be 0 if bytes_compl is not 0.

Signed-off-by: Ding Tianhong <dingtianhong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Cc: "David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Cc: Eric Dumazet <eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Cc: Zhangfei Gao <zhangfei.gao-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Cc: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
---
 drivers/net/ethernet/hisilicon/hip04_eth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hip04_eth.c b/drivers/net/ethernet/hisilicon/hip04_eth.c
index ff9d19c..a7ab1d9 100644
--- a/drivers/net/ethernet/hisilicon/hip04_eth.c
+++ b/drivers/net/ethernet/hisilicon/hip04_eth.c
@@ -440,7 +440,7 @@ static int hip04_tx_reclaim(struct net_device *ndev, bool force)
 	smp_wmb(); /* Ensure tx_tail visible to xmit */
 
 out:
-	if (pkts_compl || bytes_compl)
+	if (bytes_compl)
 		netdev_completed_queue(ndev, pkts_compl, bytes_compl);
 
 	if (unlikely(netif_queue_stopped(ndev)) && (count < (TX_DESC_NUM - 1)))
-- 
1.8.0


--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Ding Tianhong <dingtianhong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: arnd-r2nGTMty4D4@public.gmane.org,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org
Cc: sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	zhangfei.gao-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org
Subject: [PATCH net-next 5/6] net: hip04: remove the unnecessary check
Date: Wed, 15 Apr 2015 20:30:07 +0800	[thread overview]
Message-ID: <1429101008-9464-6-git-send-email-dingtianhong@huawei.com> (raw)
In-Reply-To: <1429101008-9464-1-git-send-email-dingtianhong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>

Testing bytes_compl should be enough, because there is no way
that pkt_compl could be 0 if bytes_compl is not 0.

Signed-off-by: Ding Tianhong <dingtianhong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Cc: "David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Cc: Eric Dumazet <eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Cc: Zhangfei Gao <zhangfei.gao-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Cc: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
---
 drivers/net/ethernet/hisilicon/hip04_eth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hip04_eth.c b/drivers/net/ethernet/hisilicon/hip04_eth.c
index ff9d19c..a7ab1d9 100644
--- a/drivers/net/ethernet/hisilicon/hip04_eth.c
+++ b/drivers/net/ethernet/hisilicon/hip04_eth.c
@@ -440,7 +440,7 @@ static int hip04_tx_reclaim(struct net_device *ndev, bool force)
 	smp_wmb(); /* Ensure tx_tail visible to xmit */
 
 out:
-	if (pkts_compl || bytes_compl)
+	if (bytes_compl)
 		netdev_completed_queue(ndev, pkts_compl, bytes_compl);
 
 	if (unlikely(netif_queue_stopped(ndev)) && (count < (TX_DESC_NUM - 1)))
-- 
1.8.0


--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: dingtianhong@huawei.com (Ding Tianhong)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH net-next 5/6] net: hip04: remove the unnecessary check
Date: Wed, 15 Apr 2015 20:30:07 +0800	[thread overview]
Message-ID: <1429101008-9464-6-git-send-email-dingtianhong@huawei.com> (raw)
In-Reply-To: <1429101008-9464-1-git-send-email-dingtianhong@huawei.com>

Testing bytes_compl should be enough, because there is no way
that pkt_compl could be 0 if bytes_compl is not 0.

Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Zhangfei Gao <zhangfei.gao@linaro.org>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Joe Perches <joe@perches.com>
---
 drivers/net/ethernet/hisilicon/hip04_eth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hip04_eth.c b/drivers/net/ethernet/hisilicon/hip04_eth.c
index ff9d19c..a7ab1d9 100644
--- a/drivers/net/ethernet/hisilicon/hip04_eth.c
+++ b/drivers/net/ethernet/hisilicon/hip04_eth.c
@@ -440,7 +440,7 @@ static int hip04_tx_reclaim(struct net_device *ndev, bool force)
 	smp_wmb(); /* Ensure tx_tail visible to xmit */
 
 out:
-	if (pkts_compl || bytes_compl)
+	if (bytes_compl)
 		netdev_completed_queue(ndev, pkts_compl, bytes_compl);
 
 	if (unlikely(netif_queue_stopped(ndev)) && (count < (TX_DESC_NUM - 1)))
-- 
1.8.0

  parent reply	other threads:[~2015-04-15 12:30 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-15 12:30 [PATCH net-next 0/6] net: hip04: fix some problem for hip04 drivers Ding Tianhong
2015-04-15 12:30 ` Ding Tianhong
2015-04-15 12:30 ` Ding Tianhong
2015-04-15 12:30 ` [PATCH net-next 1/6] net: hip04: Set more appropriate value for tx coalesce num Ding Tianhong
2015-04-15 12:30   ` Ding Tianhong
2015-04-15 12:30   ` Ding Tianhong
2015-04-15 14:11   ` Arnd Bergmann
2015-04-15 14:11     ` Arnd Bergmann
2015-04-15 12:30 ` [PATCH net-next 4/6] net: hip04: Don't free the tx skb when the buffer is not ready for xmit Ding Tianhong
2015-04-15 12:30   ` Ding Tianhong
2015-04-15 12:30   ` Ding Tianhong
2015-04-15 14:19   ` Arnd Bergmann
2015-04-15 14:19     ` Arnd Bergmann
2015-04-16  6:26     ` Ding Tianhong
2015-04-16  6:26       ` Ding Tianhong
2015-04-16  6:26       ` Ding Tianhong
2015-04-16  8:41       ` Arnd Bergmann
2015-04-16  8:41         ` Arnd Bergmann
2015-04-16  9:38         ` Ding Tianhong
2015-04-16  9:38           ` Ding Tianhong
2015-04-16  9:38           ` Ding Tianhong
     [not found] ` <1429101008-9464-1-git-send-email-dingtianhong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-04-15 12:30   ` [PATCH net-next 2/6] net: hip04: use the big endian for tx and rx desc Ding Tianhong
2015-04-15 12:30     ` Ding Tianhong
2015-04-15 12:30     ` Ding Tianhong
     [not found]     ` <1429101008-9464-3-git-send-email-dingtianhong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-04-15 14:13       ` Arnd Bergmann
2015-04-15 14:13         ` Arnd Bergmann
2015-04-16  6:25         ` Ding Tianhong
2015-04-16  6:25           ` Ding Tianhong
2015-04-16  6:25           ` Ding Tianhong
2015-04-15 12:30   ` [PATCH net-next 3/6] net: hip04: Solve the problem of the skb memory allocation failure Ding Tianhong
2015-04-15 12:30     ` Ding Tianhong
2015-04-15 12:30     ` Ding Tianhong
     [not found]     ` <1429101008-9464-4-git-send-email-dingtianhong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-04-15 14:17       ` Arnd Bergmann
2015-04-15 14:17         ` Arnd Bergmann
2015-04-15 12:30   ` Ding Tianhong [this message]
2015-04-15 12:30     ` [PATCH net-next 5/6] net: hip04: remove the unnecessary check Ding Tianhong
2015-04-15 12:30     ` Ding Tianhong
2015-04-15 14:14     ` Arnd Bergmann
2015-04-15 14:14       ` Arnd Bergmann
2015-04-15 12:30   ` [PATCH net-next 6/6] net: hip04: add ratelimit for rx/tx drops skb Ding Tianhong
2015-04-15 12:30     ` Ding Tianhong
2015-04-15 12:30     ` Ding Tianhong
     [not found]     ` <1429101008-9464-7-git-send-email-dingtianhong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-04-15 14:20       ` Arnd Bergmann
2015-04-15 14:20         ` Arnd Bergmann
2015-04-15 14:25 ` [PATCH net-next 0/6] net: hip04: fix some problem for hip04 drivers Arnd Bergmann
2015-04-15 14:25   ` Arnd Bergmann
2015-04-16  6:28   ` Ding Tianhong
2015-04-16  6:28     ` Ding Tianhong
2015-04-16  6:28     ` Ding Tianhong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1429101008-9464-6-git-send-email-dingtianhong@huawei.com \
    --to=dingtianhong-hv44wf8li93qt0dzr+alfa@public.gmane.org \
    --cc=arnd-r2nGTMty4D4@public.gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org \
    --cc=zhangfei.gao-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.