Răsfoiți Sursa

ppp: remove unnecessary bh disable in xmit path

Since the commit 55454a565836 ("ppp: avoid dealock on recursive xmit"),
the PPP xmit path is protected by wrapper functions which disable the
bh already. So it is unnecessary to disable the bh again in the real
xmit path.

Signed-off-by: Gao Feng <gfree.wind@vip.163.com>
Acked-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Gao Feng 8 ani în urmă
părinte
comite
97fcc193f6
1 a modificat fișierele cu 11 adăugiri și 11 ștergeri
  1. 11 11
      drivers/net/ppp/ppp_generic.c

+ 11 - 11
drivers/net/ppp/ppp_generic.c

@@ -1618,7 +1618,7 @@ ppp_push(struct ppp *ppp)
 		list = list->next;
 		list = list->next;
 		pch = list_entry(list, struct channel, clist);
 		pch = list_entry(list, struct channel, clist);
 
 
-		spin_lock_bh(&pch->downl);
+		spin_lock(&pch->downl);
 		if (pch->chan) {
 		if (pch->chan) {
 			if (pch->chan->ops->start_xmit(pch->chan, skb))
 			if (pch->chan->ops->start_xmit(pch->chan, skb))
 				ppp->xmit_pending = NULL;
 				ppp->xmit_pending = NULL;
@@ -1627,7 +1627,7 @@ ppp_push(struct ppp *ppp)
 			kfree_skb(skb);
 			kfree_skb(skb);
 			ppp->xmit_pending = NULL;
 			ppp->xmit_pending = NULL;
 		}
 		}
-		spin_unlock_bh(&pch->downl);
+		spin_unlock(&pch->downl);
 		return;
 		return;
 	}
 	}
 
 
@@ -1757,7 +1757,7 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb)
 		}
 		}
 
 
 		/* check the channel's mtu and whether it is still attached. */
 		/* check the channel's mtu and whether it is still attached. */
-		spin_lock_bh(&pch->downl);
+		spin_lock(&pch->downl);
 		if (pch->chan == NULL) {
 		if (pch->chan == NULL) {
 			/* can't use this channel, it's being deregistered */
 			/* can't use this channel, it's being deregistered */
 			if (pch->speed == 0)
 			if (pch->speed == 0)
@@ -1765,7 +1765,7 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb)
 			else
 			else
 				totspeed -= pch->speed;
 				totspeed -= pch->speed;
 
 
-			spin_unlock_bh(&pch->downl);
+			spin_unlock(&pch->downl);
 			pch->avail = 0;
 			pch->avail = 0;
 			totlen = len;
 			totlen = len;
 			totfree--;
 			totfree--;
@@ -1816,7 +1816,7 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb)
 		 */
 		 */
 		if (flen <= 0) {
 		if (flen <= 0) {
 			pch->avail = 2;
 			pch->avail = 2;
-			spin_unlock_bh(&pch->downl);
+			spin_unlock(&pch->downl);
 			continue;
 			continue;
 		}
 		}
 
 
@@ -1861,14 +1861,14 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb)
 		len -= flen;
 		len -= flen;
 		++ppp->nxseq;
 		++ppp->nxseq;
 		bits = 0;
 		bits = 0;
-		spin_unlock_bh(&pch->downl);
+		spin_unlock(&pch->downl);
 	}
 	}
 	ppp->nxchan = i;
 	ppp->nxchan = i;
 
 
 	return 1;
 	return 1;
 
 
  noskb:
  noskb:
-	spin_unlock_bh(&pch->downl);
+	spin_unlock(&pch->downl);
 	if (ppp->debug & 1)
 	if (ppp->debug & 1)
 		netdev_err(ppp->dev, "PPP: no memory (fragment)\n");
 		netdev_err(ppp->dev, "PPP: no memory (fragment)\n");
 	++ppp->dev->stats.tx_errors;
 	++ppp->dev->stats.tx_errors;
@@ -1883,7 +1883,7 @@ static void __ppp_channel_push(struct channel *pch)
 	struct sk_buff *skb;
 	struct sk_buff *skb;
 	struct ppp *ppp;
 	struct ppp *ppp;
 
 
-	spin_lock_bh(&pch->downl);
+	spin_lock(&pch->downl);
 	if (pch->chan) {
 	if (pch->chan) {
 		while (!skb_queue_empty(&pch->file.xq)) {
 		while (!skb_queue_empty(&pch->file.xq)) {
 			skb = skb_dequeue(&pch->file.xq);
 			skb = skb_dequeue(&pch->file.xq);
@@ -1897,14 +1897,14 @@ static void __ppp_channel_push(struct channel *pch)
 		/* channel got deregistered */
 		/* channel got deregistered */
 		skb_queue_purge(&pch->file.xq);
 		skb_queue_purge(&pch->file.xq);
 	}
 	}
-	spin_unlock_bh(&pch->downl);
+	spin_unlock(&pch->downl);
 	/* see if there is anything from the attached unit to be sent */
 	/* see if there is anything from the attached unit to be sent */
 	if (skb_queue_empty(&pch->file.xq)) {
 	if (skb_queue_empty(&pch->file.xq)) {
-		read_lock_bh(&pch->upl);
+		read_lock(&pch->upl);
 		ppp = pch->ppp;
 		ppp = pch->ppp;
 		if (ppp)
 		if (ppp)
 			__ppp_xmit_process(ppp);
 			__ppp_xmit_process(ppp);
-		read_unlock_bh(&pch->upl);
+		read_unlock(&pch->upl);
 	}
 	}
 }
 }