netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 1/2] net: tap: replay while() loop with % operator in tap_get_queue()
@ 2017-12-11 13:26 yuan linyu
  2017-12-11 16:58 ` Stephen Hemminger
  0 siblings, 1 reply; 3+ messages in thread
From: yuan linyu @ 2017-12-11 13:26 UTC (permalink / raw)
  To: netdev; +Cc: David S . Miller, yuan linyu

From: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>

Signed-off-by: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>
---
 drivers/net/tap.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/net/tap.c b/drivers/net/tap.c
index 0a886fda..78900a0 100644
--- a/drivers/net/tap.c
+++ b/drivers/net/tap.c
@@ -275,11 +275,7 @@ static struct tap_queue *tap_get_queue(struct tap_dev *tap,
 
 	if (likely(skb_rx_queue_recorded(skb))) {
 		rxq = skb_get_rx_queue(skb);
-
-		while (unlikely(rxq >= numvtaps))
-			rxq -= numvtaps;
-
-		queue = rcu_dereference(tap->taps[rxq]);
+		queue = rcu_dereference(tap->taps[rxq % numvtaps]);
 		goto out;
 	}
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-12-11 17:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-11 13:26 [PATCH net-next 1/2] net: tap: replay while() loop with % operator in tap_get_queue() yuan linyu
2017-12-11 16:58 ` Stephen Hemminger
2017-12-11 17:02   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).